MT3339 UART NMEA receiver. Call begin(), register callbacks, then turnOn(). Cached sentence pointers belong to the driver and must not be freed. A new sentence can replace its cache; VTG reception clears RMC/GGA/GSA/GSV caches after onNMEAReceived returns. Copy needed sentences within that callback.
More...
#include <MT3339.hpp>
|
|
| MT3339 (SerialPort &uart) |
| | Bind the receiver UART, which must outlive this object.
|
|
virtual void | begin () |
| | Configure 9600-baud NMEA reception with listening initially disabled.
|
| virtual void | turnOn () |
| | Enable UART listening without changing hardware power.
|
| virtual void | turnOff () |
| | Disable UART listening without changing hardware power.
|
| virtual bool | isOn () |
| | Return whether the UART is listening.
|
| const char * | getLatestRMC () |
| | Return the cached CRLF-terminated RMC sentence, or nullptr if unavailable.
|
| const char * | getLatestGGA () |
| | Return the cached CRLF-terminated GGA sentence, or nullptr if unavailable.
|
| const char * | getLatestGSA () |
| | Return the cached CRLF-terminated GSA sentence, or nullptr if unavailable.
|
| const char * | getLatestGSV (uint8_t seq) |
| | Return a cached CRLF-terminated GSV sentence.
|
| const char * | getLatestVTG () |
| | Return the cached CRLF-terminated VTG sentence, or nullptr if unavailable.
|
| 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.
|
|
|
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) |
MT3339 UART NMEA receiver. Call begin(), register callbacks, then turnOn(). Cached sentence pointers belong to the driver and must not be freed. A new sentence can replace its cache; VTG reception clears RMC/GGA/GSA/GSV caches after onNMEAReceived returns. Copy needed sentences within that callback.
- Author
- Jongsoo Jeong (CoXlab)
- Date
- 2017. 6. 14.
◆ getLatestGGA()
| const char * MT3339::getLatestGGA |
( |
| ) |
|
|
inline |
Return the cached CRLF-terminated GGA sentence, or nullptr if unavailable.
◆ getLatestGSA()
| const char * MT3339::getLatestGSA |
( |
| ) |
|
|
inline |
Return the cached CRLF-terminated GSA sentence, or nullptr if unavailable.
◆ getLatestGSV()
| const char * MT3339::getLatestGSV |
( |
uint8_t | seq | ) |
|
|
inline |
Return a cached CRLF-terminated GSV sentence.
- Parameters
-
| seq | Cache index, 0 through 2. |
- Returns
- Driver-owned pointer, or nullptr if absent or the index is out of range.
96{ return (seq < 3) ? _latestGSV[seq] : nullptr; }
◆ getLatestRMC()
| const char * MT3339::getLatestRMC |
( |
| ) |
|
|
inline |
Return the cached CRLF-terminated RMC sentence, or nullptr if unavailable.
◆ getLatestVTG()
| const char * MT3339::getLatestVTG |
( |
| ) |
|
|
inline |
Return the cached CRLF-terminated VTG sentence, or nullptr if unavailable.
100{ return _latestVTG; }
◆ isOn()
| virtual bool MT3339::isOn |
( |
| ) |
|
|
virtual |
Return whether the UART is listening.
Implements Gps.
◆ turnOff()
| virtual void MT3339::turnOff |
( |
| ) |
|
|
virtual |
Disable UART listening without changing hardware power.
Implements Gps.
◆ turnOn()
| virtual void MT3339::turnOn |
( |
| ) |
|
|
virtual |
Enable UART listening without changing hardware power.
Implements Gps.
The documentation for this class was generated from the following file: