endpoint C207 radio support
Dependents: mbed_mqtt_endpoint_ublox_cellular mbed_nsp_endpoint_ublox_cellular
Diff: MBEDUbloxCellRadio.cpp
- Revision:
- 16:19f597d8048f
- Parent:
- 14:5061a0361ab4
- Child:
- 18:2d9bb520794c
--- a/MBEDUbloxCellRadio.cpp Thu Apr 03 01:55:08 2014 +0000 +++ b/MBEDUbloxCellRadio.cpp Mon Jun 30 22:17:48 2014 +0000 @@ -21,16 +21,10 @@ // MBEDEndpoint support #include "MBEDEndpoint.h" - - #ifdef CELLULAR_NETWORK - // external status fn (temp) - extern int getUbloxConnectStatus(); - #endif // default constructor - MBEDUbloxCellRadio::MBEDUbloxCellRadio(ErrorHandler *error_handler, void *endpoint,UBLOX_MODEM *modem,C027 *c027) : BaseClass(error_handler,endpoint) { - this->m_modem = modem; - this->m_c027 = c027; + MBEDUbloxCellRadio::MBEDUbloxCellRadio(ErrorHandler *error_handler,void *endpoint,void *modem) : BaseClass(error_handler,endpoint) { + this->m_modem = (MDMSerial *)modem; this->m_connected = false; } @@ -40,8 +34,8 @@ // connect bool MBEDUbloxCellRadio::connect() { - this->m_connected = false; - if (getUbloxConnectStatus() == 0) this->m_connected = true; + if (this->m_connected == false) + this->m_connected = this->m_modem->connect(SIMPIN, APN,USERNAME,PASSWORD); return this->m_connected; } @@ -49,7 +43,7 @@ bool MBEDUbloxCellRadio::disconnect() { if (this->m_connected == true) { this->m_modem->disconnect(); - this->m_c027->mdmPower(false); + this->m_modem->powerOff(); this->m_connected = false; } return !this->m_connected;