Nol.A SDK Library 26.11.2
For IoT System Software Development
Loading...
Searching...
No Matches
MT3339 Class Reference

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>

Inheritance diagram for MT3339:
Gps

Public Member Functions

 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.
Public Member Functions inherited from Gps
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.

Additional Inherited Members

Public Attributes inherited from Gps
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 Protected Member Functions inherited from Gps
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)
Protected Attributes inherited from Gps
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)

Detailed Description

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.

Member Function Documentation

◆ getLatestGGA()

const char * MT3339::getLatestGGA ( )
inline

Return the cached CRLF-terminated GGA sentence, or nullptr if unavailable.

86{ return _latestGGA; }

◆ getLatestGSA()

const char * MT3339::getLatestGSA ( )
inline

Return the cached CRLF-terminated GSA sentence, or nullptr if unavailable.

90{ return _latestGSA; }

◆ getLatestGSV()

const char * MT3339::getLatestGSV ( uint8_t seq)
inline

Return a cached CRLF-terminated GSV sentence.

Parameters
seqCache 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.

82{ return _latestRMC; }

◆ 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: