endpoint C207 radio support
Dependents: mbed_mqtt_endpoint_ublox_cellular mbed_nsp_endpoint_ublox_cellular
Diff: MBEDUbloxGPS.cpp
- Revision:
- 7:948040230536
- Parent:
- 6:cd2d23300f05
- Child:
- 8:ad37c7157d3c
diff -r cd2d23300f05 -r 948040230536 MBEDUbloxGPS.cpp --- a/MBEDUbloxGPS.cpp Tue Apr 01 03:19:55 2014 +0000 +++ b/MBEDUbloxGPS.cpp Tue Apr 01 03:23:32 2014 +0000 @@ -42,7 +42,7 @@ this->m_latitude = 0; this->m_longitude = 0; _ublox_gps_instance = this; - this->m_gps_poll_thread = new Thread(read_gps); + this->m_gps_poll_thread = NULL; } // default destructor @@ -95,8 +95,14 @@ this->logger()->log("GPS: Output: %s",out); } + // start the update thread and connect + bool MBEDUbloxGPS::connect() { + if (this->m_gps_poll_thread == NULL) this->m_gps_poll_thread = new Thread(read_gps); + return true; + } + // halt the update thread and disconnect - bool MBEDUbloxGPS::disconnect() { _ublox_gps_loop = false; } + bool MBEDUbloxGPS::disconnect() { _ublox_gps_loop = false; return true; } // get latitude float MBEDUbloxGPS::getLatitude() { return this->m_latitude; }