The NMEA GNS message: GNSS fix data.
More...
#include <nmeaGNS.h>
|
| | nmeaGNS (void) |
| | Construct a new nmeaGNS object and register it with the NMEA message registry. More...
|
| |
| bool | amI (const char *msgId) const |
| | Check whether this message object represents the given NMEA message identifier. More...
|
| |
| bool | initStorage (void) |
| | Lazily allocate this message's raw payload storage (_storage), if not already done. More...
|
| |
| bool | initCallbackStorage (void) |
| | Lazily allocate this message's callback ring-buffer storage (_callbackStorage), if not already done. More...
|
| |
| 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. More...
|
| |
| void | addNMEA (const char *msgId, uint8_t messageLength, uint8_t numCallbackCopies, uint8_t numFields, const void *nmeaFields, const void *blockFields=nullptr, uint8_t numBlockFields=0, uint8_t numHeaderFields=0, uint8_t maxNumBlocks=0) |
| | Register this message's identity, field table and metadata with the base class. More...
|
| |
The NMEA GNS message: GNSS fix data.
◆ nmeaGNS()
| SparkFun_Iridium_9604::nmeaGNS::nmeaGNS |
( |
void |
| ) |
|
|
inline |
Construct a new nmeaGNS object and register it with the NMEA message registry.
NMEA GNS: GNSS fix data. Registers this message's identifier, field table and callback-copy count with the base nmeaMessage class via addNMEA(), making it discoverable by the generic NMEA dispatch, field-lookup and callback machinery in DevIridium9604.
◆ addNMEA()
| void SparkFun_Iridium_9604::nmeaMessage::addNMEA |
( |
const char * |
msgId, |
|
|
uint8_t |
messageLength, |
|
|
uint8_t |
numCallbackCopies, |
|
|
uint8_t |
numFields, |
|
|
const void * |
nmeaFields, |
|
|
const void * |
blockFields = nullptr, |
|
|
uint8_t |
numBlockFields = 0, |
|
|
uint8_t |
numHeaderFields = 0, |
|
|
uint8_t |
maxNumBlocks = 0 |
|
) |
| |
|
inlineinherited |
Register this message's identity, field table and metadata with the base class.
Called once, from the subclass's own constructor, to populate every _* member below with the subclass's message identifier, field table(s) and configuration keys, and to reset all storage pointers and callback bookkeeping to their initial "nothing allocated yet" state.
- Parameters
-
| msgId | The 3-character NMEA message identifier (e.g. "GGA"). |
| messageLength | Maximum message length in bytes (an actual received sentence may be shorter). |
| numCallbackCopies | Number of ring-buffer slots to allocate for callback storage. |
| numFields | Number of entries in 'nmeaFields' (header + footer fields only - excludes 'numBlockFields'). |
| nmeaFields | Pointer to this message's own, permanently-lived field table. |
| blockFields | Optional field table describing one repeated block, for a variable-length message (e.g. NMEA GSV's per-satellite blocks). Defaults to nullptr (no repeated blocks). |
| numBlockFields | Number of entries in 'blockFields'. Defaults to 0. |
| numHeaderFields | Number of header fields before the first repeated block (also the field-table position of the first footer field). Defaults to 0. |
| maxNumBlocks | Upper bound on the number of repeated blocks. Defaults to 0. |
◆ amI()
| bool SparkFun_Iridium_9604::nmeaMessage::amI |
( |
const char * |
msgId | ) |
const |
|
inlineinherited |
Check whether this message object represents the given NMEA message identifier.
- Parameters
-
| msgId | The 3-character NMEA message identifier to test against (e.g. "GGA"). |
- Returns
- true if this object's registered _msgId matches, false otherwise.
◆ extractFieldFrom()
| bool SparkFun_Iridium_9604::nmeaMessage::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 |
|
inlineinherited |
Look up one field of this message, by name, in a given NMEA sentence buffer.
Walks the comma-delimited sentence in 'buffer' to find field 'fieldName' and returns its text, converted according to that field's nmeaDataType (see nmeaFieldFormats_t above). Shared core used both for a live/polled read (from this object's own _storage) and for a callback read (from _callbackStorage) - see getNmeaMessageField() and getNmeaMessageBlockField()/getNmeaMessageBlockFieldCallback() in Iridium_9604_GNSS.cpp.
- Parameters
-
| buffer | The NMEA sentence bytes to search (this message's _storage, or its _callbackStorage), which must start with '$'. |
| fieldName | Name of the field to find, matched against each entry's fieldName. |
| value | Out parameter: filled in with the field's text (converted per its data type), or cleared to an empty String on failure. |
| fieldsOverride | Optional field table to search instead of this object's own _fields - used to search a repeated block's own field table (see _blockFields, e.g. NMEA GSV's per-satellite blocks). Defaults to nullptr (search _fields). |
| numFieldsOverride | Number of entries in 'fieldsOverride'; ignored when 'fieldsOverride' is nullptr. |
| blockIndex | Which repeated block a block-field lookup should read; ignored unless 'fieldsOverride' is given. Defaults to 0. |
- Returns
- true if 'fieldName' was found (and *value filled in); false if 'buffer' is null, malformed, too short, 'blockIndex' is out of range, or the field name was not found.
◆ initCallbackStorage()
| bool SparkFun_Iridium_9604::nmeaMessage::initCallbackStorage |
( |
void |
| ) |
|
|
inlineinherited |
Lazily allocate this message's callback ring-buffer storage (_callbackStorage), if not already done.
Allocates _numCallbackCopies slots of _messageLength bytes each, the first time a callback is registered for this message. Subsequent calls are a no-op.
- Returns
- true if _callbackStorage is non-null after the call, false if the allocation failed.
◆ initStorage()
| bool SparkFun_Iridium_9604::nmeaMessage::initStorage |
( |
void |
| ) |
|
|
inlineinherited |
Lazily allocate this message's raw payload storage (_storage), if not already done.
Allocates and zero-fills a buffer of _messageLength bytes on first call; subsequent calls are a no-op. This is what lets a message that is never instantiated/used avoid consuming any RAM for its payload - see the class-level comment above for the "delete the header,
save the RAM" design intent.
- Returns
- true if _storage is non-null after the call (already allocated, or successfully allocated now); false if the allocation failed.
◆ _blockFields
| const void* SparkFun_Iridium_9604::nmeaMessage::_blockFields = nullptr |
|
inherited |
Points at the subclass's own nmeaBlockFields[] table; nullptr => no repeated blocks.
◆ _callbackCount
| uint8_t SparkFun_Iridium_9604::nmeaMessage::_callbackCount = 0 |
|
inherited |
How many slots currently hold fresh, undelivered data (replaces the old single _callbackDataValid bool)
◆ _callbackHead
| uint8_t SparkFun_Iridium_9604::nmeaMessage::_callbackHead = 0 |
|
inherited |
Next free slot the write side will write into.
◆ _callbackPtr
◆ _callbackReadIndex
| uint8_t SparkFun_Iridium_9604::nmeaMessage::_callbackReadIndex = 0 |
|
inherited |
Set by checkCallbacks() to _callbackTail immediately before each callback firing, so getNmeaMessageFieldCallback()/getNmeaMessageBlockFieldCallback() know which slot to read.
◆ _callbackStorage
| uint8_t* SparkFun_Iridium_9604::nmeaMessage::_callbackStorage = nullptr |
|
inherited |
Ring buffer of _numCallbackCopies slots, each _messageLength bytes - nullptr until initCallbackStorage() is called.
◆ _callbackTail
| uint8_t SparkFun_Iridium_9604::nmeaMessage::_callbackTail = 0 |
|
inherited |
Next fresh slot checkCallbacks() will read and dispatch.
◆ _fields
| const void* SparkFun_Iridium_9604::nmeaMessage::_fields = nullptr |
|
inherited |
Points at the subclass's own, permanently-lived nmeaFields[] table.
◆ _maxNumBlocks
| uint8_t SparkFun_Iridium_9604::nmeaMessage::_maxNumBlocks = 0 |
|
inherited |
Upper bound on the number of repeated blocks (e.g. GSV's 4)
◆ _memoryEnabled
| bool SparkFun_Iridium_9604::nmeaMessage::_memoryEnabled = false |
|
inherited |
Has the module been told to store this message in its internal buffer? (AT+UGNMEA <output> bit 0)
◆ _messageLength
| uint8_t SparkFun_Iridium_9604::nmeaMessage::_messageLength = 0 |
|
inherited |
The maximum message length in bytes. Messages could be less than this.
◆ _moduleQueried
| bool SparkFun_Iridium_9604::nmeaMessage::_moduleQueried = false |
|
inherited |
true when fresh data has arrived. Cleared by getNMEA().
◆ _msgId
| const char* SparkFun_Iridium_9604::nmeaMessage::_msgId = nullptr |
|
inherited |
The message ID, e.g. "GGA".
◆ _numBlockFields
| uint8_t SparkFun_Iridium_9604::nmeaMessage::_numBlockFields = 0 |
|
inherited |
Number of entries in _blockFields.
◆ _numCallbackCopies
| uint8_t SparkFun_Iridium_9604::nmeaMessage::_numCallbackCopies = 0 |
|
inherited |
Number of ring-buffer slots in _callbackStorage - 1 for most messages, 54 for GSV - see the GNSS v4 AGENTS.md "Adding support for NMEA GSV messages".
◆ _numFields
| uint8_t SparkFun_Iridium_9604::nmeaMessage::_numFields = 0 |
|
inherited |
Number of entries in _fields (header + footer fields only - excludes _numBlockFields)
◆ _numHeaderFields
| uint8_t SparkFun_Iridium_9604::nmeaMessage::_numHeaderFields = 0 |
|
inherited |
Number of header fields before the first repeated block (also the field-table position of the first footer field)
◆ _storage
| uint8_t* SparkFun_Iridium_9604::nmeaMessage::_storage = nullptr |
|
inherited |
◆ _urcEnabled
| bool SparkFun_Iridium_9604::nmeaMessage::_urcEnabled = false |
|
inherited |
Has the module been told to output this message as a +UUGNMEA URC? (AT+UGNMEA <output> bit 1)
◆ messageLength
The maximum message length (bytes).
◆ msgId
| const char SparkFun_Iridium_9604::nmeaGNS::msgId[4] = "GNS" |
◆ nmeaFields
Initial value:= {
}
@ nmeaDataTypeChar
A single ASCII character: e.g. N S E W M.
Definition: nmeaMessage.h:69
@ nmeaDataTypeDDDMM
Degrees Minutes for Longitude: 3 digit degrees, 2 digit minutes. Could have a variable number of deci...
Definition: nmeaMessage.h:68
@ nmeaDataTypeTime
Time in the format HHMMSS. Could have a variable number of decimal places: HHMMSS....
Definition: nmeaMessage.h:66
@ nmeaDataTypeString
An array of ASCII char.
Definition: nmeaMessage.h:65
@ nmeaDataTypeNumeric
A numeric: could be integer or floating point; could be negative.
Definition: nmeaMessage.h:71
@ nmeaDataTypeDDMM
Degrees Minutes for Latitude: 2 digit degrees, 2 digit minutes. Could have a variable number of decim...
Definition: nmeaMessage.h:67
The message fields, by name.
◆ numCallbackCopies
| const uint8_t SparkFun_Iridium_9604::nmeaGNS::numCallbackCopies = 1 |
The number of copies stored for the callback.
◆ numFields
| const uint8_t SparkFun_Iridium_9604::nmeaGNS::numFields = 14 |
|
static |
◆ supportedVersions
| const uint8_t SparkFun_Iridium_9604::nmeaGNS::supportedVersions = 1 |
The documentation for this class was generated from the following file: