Official reference client implementation for Cumulocity SmartREST on u-blox C027.
Dependencies: C027_Support C12832 LM75B MMA7660 MbedSmartRest mbed-rtos mbed
Fork of MbedSmartRestMain by
GPSTracker.h
00001 #ifndef GPSTRACKER_H 00002 #define GPSTRACKER_H 00003 00004 #include <stddef.h> 00005 #include "GPS.h" 00006 #include "rtos.h" 00007 00008 /** 00009 * A GPS tracker class providing access to the current position. 00010 */ 00011 class GPSTracker 00012 { 00013 public: 00014 /** 00015 * Initialize a new GPSTracker object. 00016 * @param gps a previously initialized instance of the GPSI2C class 00017 */ 00018 GPSTracker(); 00019 00020 typedef struct { 00021 double altitude; // altitude meters 00022 double latitude; // latitude degrees 00023 double longitude; // longitude degrees 00024 } Position; 00025 00026 /** 00027 * Retrieves and invalidates the current position. 00028 * @param position a pointer of type Position where the current position is written to 00029 * @return true on success, false otherwise 00030 */ 00031 bool position(Position*); 00032 00033 protected: 00034 void thread(); 00035 static void thread_func(void const*); 00036 00037 private: 00038 GPSI2C _gps; 00039 Thread _thread; 00040 Mutex _mutex; 00041 Position _position; 00042 bool _positionSet; 00043 }; 00044 00045 #endif
Generated on Wed Jul 13 2022 19:40:51 by 1.7.2