Common GPS callback interface and NMEA parsers for device-specific drivers.
More...
#include <GPS.hpp>
|
| void | onReadDone (void(*func)(uint8_t fixQuality, uint8_t hour, uint8_t minute, uint8_t sec, uint16_t subsec, int32_t latitude, int32_t longitude, int32_t altitude, uint8_t numSatellites)) |
| | Register the GGA callback; nullptr disables legacy GGA notifications.
|
| virtual void | turnOn ()=0 |
| | Enable reception or device power according to the concrete driver.
|
| virtual void | turnOff ()=0 |
| | Disable reception or device power according to the concrete driver.
|
| virtual bool | isOn ()=0 |
| | Return the concrete driver's reception or hardware power state.
|
|
|
void(* | onNMEAReceived )(Gps &) = nullptr |
| | Optional raw-NMEA notification used by MT3339 after receiving VTG. Invoked only when no onReadDone() callback is installed; read cached sentences during the callback because most caches are cleared immediately afterward.
|
|
| static uint8_t | ParseGGA (const char *msg, uint8_t *hour, uint8_t *minute, uint8_t *sec, uint16_t *subsec, int32_t *latitude, int32_t *longitude, uint8_t *numSat, char *strHDOP, int32_t *altitude, int32_t *sep, int32_t *diffAge, int32_t *diffStation) |
|
static bool | ParseGSA (const char *msg, char *opMode, uint8_t *navMode, float *pdop, float *hdop, float *vdop) |
|
static bool | ParseRMC (const char *msg, float *spd, float *cog) |
|
|
void(* | callbackRead )(uint8_t fixQuality, uint8_t hour, uint8_t minute, uint8_t sec, uint16_t subsec, int32_t latitude, int32_t longitude, int32_t altitude, uint8_t numSatellites) |
Common GPS callback interface and NMEA parsers for device-specific drivers.
- Author
- Jongsoo Jeong (CoXlab)
- Date
- 2016. 9. 7.
- Examples
- feather-m0/UltimateGPS+OLED/main.cpp.
◆ isOn()
| virtual bool Gps::isOn |
( |
| ) |
|
|
pure virtual |
◆ onReadDone()
| void Gps::onReadDone |
( |
void(* | func )(uint8_t fixQuality, uint8_t hour, uint8_t minute, uint8_t sec, uint16_t subsec, int32_t latitude, int32_t longitude, int32_t altitude, uint8_t numSatellites) | ) |
|
Register the GGA callback; nullptr disables legacy GGA notifications.
- Parameters
-
| func | Receives fix quality (0 means invalid), UTC hour/minute/second, the unscaled fractional-second digits, encoded NMEA latitude/longitude, encoded altitude, and satellite count. Coordinates are not decimal degrees: the parser multiplies the degrees-and-minutes integer part by 100000 and adds the raw fractional digits, with negative values for south/west. Altitude similarly uses the integer part times 10 plus the fractional digits. Check fix quality before using position values; fractional fields are not normalized. |
◆ ParseGGA()
| uint8_t Gps::ParseGGA |
( |
const char * | msg, |
|
|
uint8_t * | hour, |
|
|
uint8_t * | minute, |
|
|
uint8_t * | sec, |
|
|
uint16_t * | subsec, |
|
|
int32_t * | latitude, |
|
|
int32_t * | longitude, |
|
|
uint8_t * | numSat, |
|
|
char * | strHDOP, |
|
|
int32_t * | altitude, |
|
|
int32_t * | sep, |
|
|
int32_t * | diffAge, |
|
|
int32_t * | diffStation ) |
|
staticprotected |
- Returns
- Fix quality 0: No fix / invalid 1: Standard GPS (2D/3D) 2: Differential GPS 4: RTK fixed solution 5: RTK float solution 6: Estimated (DR) fix
◆ turnOff()
| virtual void Gps::turnOff |
( |
| ) |
|
|
pure virtual |
◆ turnOn()
| virtual void Gps::turnOn |
( |
| ) |
|
|
pure virtual |
The documentation for this class was generated from the following file: