230 debugPrint(
"nmeaMessageVector::storePayload: msgId ");
235 memcpy(msg->
_storage, payload, len);
252 memcpy(slot, payload, len);
260 debugPrint(
"nmeaMessageVector::storePayload: msgId ",
true);
262 debugPrintln(
" _callbackStorage ring buffer full. Message lost.",
true);
Debug printing: replaces the SARA-R5 library _debugPort prints. A base class of DevIridium9604 and th...
Definition: sfe_debug.h:38
void debugPrintln(void)
Print a blank debug line, if debugging is enabled and not in limited-debug mode.
Definition: sfe_debug.cpp:145
void debugPrint(const char *message, bool important=false)
Print a debug message (no trailing newline), if debugging is enabled.
Definition: sfe_debug.cpp:25
The base class for the NMEA messages. Each message stores its latest copy and a ring buffer of copies...
Definition: nmeaMessage.h:88
uint8_t _numCallbackCopies
Number of ring-buffer slots in _callbackStorage - 1 for most messages, 54 for GSV - see the GNSS v4 A...
Definition: nmeaMessage.h:510
void(* _callbackPtr)(nmeaCallbackDataCommon_t *)
The user callback.
Definition: nmeaMessage.h:539
uint8_t * _callbackStorage
Ring buffer of _numCallbackCopies slots, each _messageLength bytes - nullptr until initCallbackStorag...
Definition: nmeaMessage.h:526
bool initCallbackStorage(void)
Lazily allocate this message's callback ring-buffer storage (_callbackStorage), if not already done.
Definition: nmeaMessage.h:170
bool initStorage(void)
Lazily allocate this message's raw payload storage (_storage), if not already done.
Definition: nmeaMessage.h:150
uint8_t * _storage
Raw payload storage - nullptr until initStorage() is called.
Definition: nmeaMessage.h:511
bool _moduleQueried
true when fresh data has arrived. Cleared by getNMEA().
Definition: nmeaMessage.h:515
uint8_t _messageLength
The maximum message length in bytes. Messages could be less than this.
Definition: nmeaMessage.h:509
bool _urcEnabled
Has the module been told to output this message as a +UUGNMEA URC? (AT+UGNMEA <output> bit 1)
Definition: nmeaMessage.h:540
uint8_t _callbackHead
Next free slot the write side will write into.
Definition: nmeaMessage.h:534
bool _memoryEnabled
Has the module been told to store this message in its internal buffer? (AT+UGNMEA <output> bit 0)
Definition: nmeaMessage.h:541
bool extractFieldFrom(const uint8_t *buffer, const char *fieldName, sfe_string_t &value, const void *fieldsOverride=nullptr, uint8_t numFieldsOverride=0, uint16_t blockIndex=0) const
Look up one field of this message, by name, in a given NMEA sentence buffer.
Definition: nmeaMessage.h:218
uint8_t _callbackCount
How many slots currently hold fresh, undelivered data (replaces the old single _callbackDataValid boo...
Definition: nmeaMessage.h:536
void buildAll(std::vector< nmeaMessage * > &messages) const
Construct one instance of every currently-registered NMEA message class.
Definition: nmeaMessageRegistry.h:64
static nmeaMessageRegistry & get(void)
Get the single, lazily-constructed nmeaMessageRegistry instance.
Definition: nmeaMessageRegistry.h:35
The collection of NMEA message objects.
Definition: nmeaMessageVector.h:59
nmea_status_e extractValue(const char *msgId, const char *field, sfe_string_t &value)
Look up one named field of a registered message's live sentence.
Definition: nmeaMessageVector.h:280
nmea_status_e initStorage(const char *msgId)
Lazily allocate a registered message's raw payload storage.
Definition: nmeaMessageVector.h:114
std::vector< nmeaMessage * > nmeaMessageVectors
The NMEA message objects.
Definition: nmeaMessageVector.h:61
nmea_status_e isMemoryEnabled(const char *msgId, bool *enabled)
Get whether the module has been told to store this message in its internal (memory) buffer.
Definition: nmeaMessageVector.h:142
nmea_status_e setModuleQueried(const char *msgId, bool queried)
Set whether fresh data has arrived for a registered message since it was last reported.
Definition: nmeaMessageVector.h:177
nmea_status_e setURCEnabled(const char *msgId, bool enabled)
Record whether the module has been told to output this message as a +UUGNMEA URC.
Definition: nmeaMessageVector.h:132
nmea_status_e setMemoryEnabled(const char *msgId, bool enabled)
Record whether the module has been told to store this message in its internal (memory) buffer.
Definition: nmeaMessageVector.h:151
nmea_status_e isURCEnabled(const char *msgId, bool *enabled)
Get whether the module has been told to output this message as a +UUGNMEA URC.
Definition: nmeaMessageVector.h:123
nmeaMessage * findByName(const char *msgId)
Find the registered message object by its name. Equivalent to find().
Definition: nmeaMessageVector.h:102
nmeaMessageVector(void)
Construct the vector and populate it with one instance of every registered NMEA message.
Definition: nmeaMessageVector.h:69
nmea_status_e setCallback(const char *msgId, void(*callbackPtr)(nmeaCallbackDataCommon_t *))
Register (or clear) the user callback function for a registered message.
Definition: nmeaMessageVector.h:194
~nmeaMessageVector(void)
Destroy the vector, deleting every message object it owns.
Definition: nmeaMessageVector.h:77
nmea_status_e moduleQueried(const char *msgId, bool *queried)
Get whether fresh data has arrived for a registered message since it was last reported.
Definition: nmeaMessageVector.h:168
nmeaMessage * find(const char *msgId)
Find the registered message object for a given NMEA message identifier.
Definition: nmeaMessageVector.h:89
nmea_status_e storePayload(const char *msgId, const uint8_t *payload, uint16_t len)
Copy a freshly-received (and already checksum-validated) NMEA sentence into a message's storage.
Definition: nmeaMessageVector.h:221
Definition: nmeaMessage.h:30
nmea_status_e
Status codes returned by the nmeaMessageVector methods (replaces GNSS v4's sfe_ublox_status_e)
Definition: nmeaMessage.h:53
@ NMEA_STATUS_SUCCESS
Definition: nmeaMessage.h:54
@ NMEA_STATUS_INVALID_ARG
Definition: nmeaMessage.h:55
@ NMEA_STATUS_MEM_ERR
Definition: nmeaMessage.h:56
Forward declaration - see nmeaCallbackDataCommon_t below.
Definition: nmeaMessage.h:80