endpoint C207 radio support

Dependents:   mbed_mqtt_endpoint_ublox_cellular mbed_nsp_endpoint_ublox_cellular

Committer:
ansond
Date:
Sun Mar 30 16:11:30 2014 +0000
Revision:
2:a28f19f39f2b
Parent:
1:76d2da9e2b84
updates

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ansond 1:76d2da9e2b84 1 /* Copyright C2013 Doug Anson, MIT License
ansond 1:76d2da9e2b84 2 *
ansond 1:76d2da9e2b84 3 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
ansond 1:76d2da9e2b84 4 * and associated documentation files the "Software", to deal in the Software without restriction,
ansond 1:76d2da9e2b84 5 * including without limitation the rights to use, copy, modify, merge, publish, distribute,
ansond 1:76d2da9e2b84 6 * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
ansond 1:76d2da9e2b84 7 * furnished to do so, subject to the following conditions:
ansond 1:76d2da9e2b84 8 *
ansond 1:76d2da9e2b84 9 * The above copyright notice and this permission notice shall be included in all copies or
ansond 1:76d2da9e2b84 10 * substantial portions of the Software.
ansond 1:76d2da9e2b84 11 *
ansond 1:76d2da9e2b84 12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
ansond 1:76d2da9e2b84 13 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
ansond 1:76d2da9e2b84 14 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
ansond 1:76d2da9e2b84 15 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
ansond 1:76d2da9e2b84 16 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
ansond 1:76d2da9e2b84 17 */
ansond 1:76d2da9e2b84 18
ansond 1:76d2da9e2b84 19 #ifndef _UBLOX_MODEM_H_
ansond 1:76d2da9e2b84 20 #define _UBLOX_MODEM_H_
ansond 1:76d2da9e2b84 21
ansond 2:a28f19f39f2b 22 #include "mbed.h"
ansond 2:a28f19f39f2b 23 #include "C027.h"
ansond 2:a28f19f39f2b 24 #include "UbloxUSBGSMModem.h"
ansond 2:a28f19f39f2b 25 #include "UbloxUSBCDMAModem.h"
ansond 2:a28f19f39f2b 26
ansond 1:76d2da9e2b84 27 // ErrorHandler support
ansond 1:76d2da9e2b84 28 #include "ErrorHandler.h"
ansond 1:76d2da9e2b84 29
ansond 2:a28f19f39f2b 30 #ifndef MODEM_APN
ansond 2:a28f19f39f2b 31 #warning APN not specified, using "internet"
ansond 2:a28f19f39f2b 32 #define MODEM_APN "internet"
ansond 2:a28f19f39f2b 33 #endif
ansond 2:a28f19f39f2b 34
ansond 2:a28f19f39f2b 35 #ifndef MODEM_USERNAME
ansond 2:a28f19f39f2b 36 #warning username not specified
ansond 2:a28f19f39f2b 37 #define MODEM_USERNAME NULL
ansond 2:a28f19f39f2b 38 #endif
ansond 2:a28f19f39f2b 39
ansond 2:a28f19f39f2b 40 #ifndef MODEM_PASSWORD
ansond 2:a28f19f39f2b 41 #warning password not specified
ansond 2:a28f19f39f2b 42 #define MODEM_PASSWORD NULL
ansond 2:a28f19f39f2b 43 #endif
ansond 1:76d2da9e2b84 44
ansond 2:a28f19f39f2b 45 #ifndef PPP_SUPPORT
ansond 2:a28f19f39f2b 46 #warning PPP not enabled
ansond 2:a28f19f39f2b 47 #endif
ansond 2:a28f19f39f2b 48
ansond 1:76d2da9e2b84 49 class UbloxModem {
ansond 1:76d2da9e2b84 50 private:
ansond 1:76d2da9e2b84 51 ErrorHandler *m_error_handler;
ansond 1:76d2da9e2b84 52 void *m_endpoint;
ansond 1:76d2da9e2b84 53 UBLOX_MODEM *m_modem;
ansond 1:76d2da9e2b84 54 C027 *m_c027;
ansond 1:76d2da9e2b84 55 bool m_connected;
ansond 1:76d2da9e2b84 56
ansond 1:76d2da9e2b84 57 public:
ansond 1:76d2da9e2b84 58 UbloxModem(ErrorHandler *error_handler, void *endpoint);
ansond 1:76d2da9e2b84 59 ~UbloxModem();
ansond 1:76d2da9e2b84 60
ansond 1:76d2da9e2b84 61 bool connect();
ansond 1:76d2da9e2b84 62 bool disconnect();
ansond 1:76d2da9e2b84 63
ansond 1:76d2da9e2b84 64 private:
ansond 1:76d2da9e2b84 65 ErrorHandler *logger();
ansond 1:76d2da9e2b84 66 };
ansond 1:76d2da9e2b84 67
ansond 1:76d2da9e2b84 68 #endif // _UBLOX_MODEM_H_
ansond 1:76d2da9e2b84 69
ansond 1:76d2da9e2b84 70