Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: CAN HTTPClient MODSERIAL MyThings Pyrn3GModem Socket TinyGPS MyUSBHost lwip-sys lwip mbed-rtos mbed-src
GPSSensor.h
00001 #ifndef GPS_SENSOR_H 00002 #define GPS_SENSOR_H 00003 00004 #include "mbed.h" 00005 #include "MySensor.h" 00006 #include "MODSERIAL.h" 00007 #include "TinyGPS.h" 00008 00009 #define GPS_STORE_SIZE 256 00010 #define GPS_RECV_BUFF 512 00011 00012 class GPSSensor: public MySensor { 00013 protected: 00014 TinyGPS gpsParser; 00015 enum frameType{ 00016 GGA = 1, 00017 RMC = 2 00018 }; 00019 typedef struct _gpsImpact{ 00020 uint32_t date; 00021 uint32_t time; 00022 int32_t lon; 00023 int32_t lat; 00024 int32_t alt; 00025 uint16_t hdop; 00026 } __attribute__((packed)) gpsImpact; 00027 uint8_t recvBuff[GPS_RECV_BUFF]; 00028 uint8_t store[GPS_STORE_SIZE]; 00029 gpsImpact impact; 00030 MODSERIAL gps; 00031 //Serial gps; 00032 uint32_t trackTime; 00033 uint32_t lastImpact; 00034 bool fixed; 00035 public: 00036 GPSSensor(PinName tx, PinName rx, uint32_t trackingTime = 10, uint32_t idle = 250); 00037 virtual void InitResultsStatic(void); 00038 virtual void Loop(void); 00039 virtual void StoreLastImpact(void); 00040 virtual bool NeedImpact(void); 00041 virtual int GetLine(void); 00042 virtual void Sample(void); 00043 }; 00044 00045 #endif //GPS_SENSOR_H
Generated on Wed Jul 13 2022 02:07:11 by
 1.7.2
 1.7.2