endpoint C207 radio support
Dependents: mbed_mqtt_endpoint_ublox_cellular mbed_nsp_endpoint_ublox_cellular
Diff: MBEDUbloxGPS.cpp
- Revision:
- 8:ad37c7157d3c
- Parent:
- 7:948040230536
- Child:
- 12:29ff8e9e0cbe
diff -r 948040230536 -r ad37c7157d3c MBEDUbloxGPS.cpp --- a/MBEDUbloxGPS.cpp Tue Apr 01 03:23:32 2014 +0000 +++ b/MBEDUbloxGPS.cpp Tue Apr 01 04:46:33 2014 +0000 @@ -25,24 +25,25 @@ // our instance MBEDUbloxGPS *_ublox_gps_instance = NULL; bool _ublox_gps_loop = true; - + // threaded task static void read_gps(void const *args) { while (_ublox_gps_loop == true && _ublox_gps_instance != NULL) { _ublox_gps_instance->update(); wait_ms(UBLOX_GPS_POLL_MS); } + if (_ublox_gps_instance != NULL) _ublox_gps_instance->logger()->log("GPS update thread stopping..."); } // default constructor MBEDUbloxGPS::MBEDUbloxGPS(ErrorHandler *error_handler, void *endpoint) : BaseClass(error_handler,endpoint) { + this->m_gps_poll_thread = NULL; this->m_c027 = new C027(); this->m_gps = new I2C(GPSSDA, GPSSCL); this->m_gps->frequency(UBLOX_GPS_FREQ); this->m_latitude = 0; this->m_longitude = 0; _ublox_gps_instance = this; - this->m_gps_poll_thread = NULL; } // default destructor @@ -97,7 +98,10 @@ // 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); + if (this->m_gps_poll_thread == NULL) { + this->logger()->log("starting GPS update thread..."); + //this->m_gps_poll_thread = new Thread(read_gps); + } return true; }