endpoint C207 radio support
Dependents: mbed_mqtt_endpoint_ublox_cellular mbed_nsp_endpoint_ublox_cellular
Diff: MBEDUbloxGPS.cpp
- Revision:
- 5:a8fd1fa0f0d0
- Parent:
- 3:6acc6c8143b7
- Child:
- 6:cd2d23300f05
diff -r 0cc421d46a2b -r a8fd1fa0f0d0 MBEDUbloxGPS.cpp --- a/MBEDUbloxGPS.cpp Mon Mar 31 05:46:08 2014 +0000 +++ b/MBEDUbloxGPS.cpp Mon Mar 31 18:47:26 2014 +0000 @@ -23,33 +23,31 @@ #include "MBEDEndpoint.h" // our instance - MBEDUbloxGPS *_instance = NULL; + MBEDUbloxGPS *_ublox_gps_instance = NULL; // threaded task static void read_gps(void const *args) { - while (_instance != NULL) { - _instance->update(); + while (_ublox_gps_instance != NULL) { + _ublox_gps_instance->update(); wait_ms(UBLOX_GPS_POLL_MS); } } // default constructor - MBEDUbloxGPS::MBEDUbloxGPS(ErrorHandler *error_handler, void *endpoint) { - this->m_error_handler = error_handler; - this->m_endpoint = endpoint; - this->m_c207 = new C207(); + MBEDUbloxGPS::MBEDUbloxGPS(ErrorHandler *error_handler, void *endpoint) : BaseClass(error_handler,endpoint) { + 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; - _instance = this; + _ublox_gps_instance = this; this->m_gps_poll_thread = new Thread(read_gps); } // default destructor MBEDUbloxGPS::~MBEDUbloxGPS() { if (this->m_gps_poll_thread != NULL) { this->m_gps_poll_thread->terminate(); delete this->m_gps_poll_thread; } - if (this->m_c207 != NULL) delete this->m_c207; + if (this->m_c027 != NULL) delete this->m_c027; if (this->m_gps != NULL) delete this->m_gps; } @@ -100,7 +98,4 @@ float MBEDUbloxGPS::getLatitude() { return this->m_latitude; } // get longitude - float MBEDUbloxGPS::getLongitude() { return this->m_longitude; } - - // ErrorHandler - ErrorHandler *Ubloxgps::logger() { return this->m_error_handler; } \ No newline at end of file + float MBEDUbloxGPS::getLongitude() { return this->m_longitude; } \ No newline at end of file