![]() |
SparkFun Iridium 9604
v1.0.0
Library for the Iridium 9604 Hybrid LTE-M Cellular + Iridium Satellite (SBD) + GNSS IoT module
|
The NMEA GSV message: GNSS satellites in view. More...
#include <nmeaGSV.h>
Public Member Functions | |
| nmeaGSV (void) | |
| Construct a new nmeaGSV 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... | |
Public Attributes | |
| const char | msgId [4] = "GSV" |
| The message identifier. More... | |
| const uint8_t | supportedVersions = 1 |
| Reserved for future use. More... | |
| const uint8_t | numCallbackCopies = 54 |
| Up to 9 GSV messages per constellation, 6 constellations;. More... | |
| const uint8_t | messageLength = NMEA_GSV_MAX_LENGTH |
| The maximum message length (bytes). More... | |
| const nmeaField | nmeaFields [numFields] |
| The message fields, by name. More... | |
| const nmeaField | nmeaBlockFields [numBlockFields] |
| The repeated block fields, by name. More... | |
| const char * | _msgId = nullptr |
| The message ID, e.g. "GGA". More... | |
| uint8_t | _messageLength = 0 |
| The maximum message length in bytes. Messages could be less than this. More... | |
| uint8_t | _numCallbackCopies = 0 |
| 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". More... | |
| uint8_t * | _storage = nullptr |
| Raw payload storage - nullptr until initStorage() is called. More... | |
| uint8_t | _numFields = 0 |
| Number of entries in _fields (header + footer fields only - excludes _numBlockFields) More... | |
| bool | _moduleQueried = false |
| true when fresh data has arrived. Cleared by getNMEA(). More... | |
| const void * | _fields = nullptr |
Points at the subclass's own, permanently-lived nmeaFields[] table. More... | |
| const void * | _blockFields = nullptr |
Points at the subclass's own nmeaBlockFields[] table; nullptr => no repeated blocks. More... | |
| uint8_t | _numBlockFields = 0 |
| Number of entries in _blockFields. More... | |
| uint8_t | _numHeaderFields = 0 |
| Number of header fields before the first repeated block (also the field-table position of the first footer field) More... | |
| uint8_t | _maxNumBlocks = 0 |
| Upper bound on the number of repeated blocks (e.g. GSV's 4) More... | |
| uint8_t * | _callbackStorage = nullptr |
| Ring buffer of _numCallbackCopies slots, each _messageLength bytes - nullptr until initCallbackStorage() is called. More... | |
| uint8_t | _callbackHead = 0 |
| Next free slot the write side will write into. More... | |
| uint8_t | _callbackTail = 0 |
| Next fresh slot checkCallbacks() will read and dispatch. More... | |
| uint8_t | _callbackCount = 0 |
| How many slots currently hold fresh, undelivered data (replaces the old single _callbackDataValid bool) More... | |
| uint8_t | _callbackReadIndex = 0 |
| Set by checkCallbacks() to _callbackTail immediately before each callback firing, so getNmeaMessageFieldCallback()/getNmeaMessageBlockFieldCallback() know which slot to read. More... | |
| void(* | _callbackPtr )(nmeaCallbackDataCommon_t *) = nullptr |
| The user callback. More... | |
| bool | _urcEnabled = false |
| Has the module been told to output this message as a +UUGNMEA URC? (AT+UGNMEA <output> bit 1) More... | |
| bool | _memoryEnabled = false |
| Has the module been told to store this message in its internal buffer? (AT+UGNMEA <output> bit 0) More... | |
Static Public Attributes | |
| static const uint8_t | numHeaderFields = 4 |
| The number of header fields. More... | |
| static const uint8_t | numFields = 5 |
| numHeaderFields (4) + footer (1) More... | |
| static const uint8_t | numBlockFields = 4 |
| The number of fields in each repeated block. More... | |
| static const uint8_t | maxNumBlocks = 4 |
| Up to 4 satellites per GSV sentence. More... | |
The NMEA GSV message: GNSS satellites in view.
|
inline |
Construct a new nmeaGSV object and register it with the NMEA message registry.
NMEA GSV: GNSS satellites in view. 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.
|
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.
| 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. |
|
inlineinherited |
Check whether this message object represents the given NMEA message identifier.
| msgId | The 3-character NMEA message identifier to test against (e.g. "GGA"). |
|
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.
| 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. |
|
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.
|
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.
|
inherited |
Points at the subclass's own nmeaBlockFields[] table; nullptr => no repeated blocks.
|
inherited |
How many slots currently hold fresh, undelivered data (replaces the old single _callbackDataValid bool)
|
inherited |
Next free slot the write side will write into.
|
inherited |
The user callback.
|
inherited |
Set by checkCallbacks() to _callbackTail immediately before each callback firing, so getNmeaMessageFieldCallback()/getNmeaMessageBlockFieldCallback() know which slot to read.
|
inherited |
Ring buffer of _numCallbackCopies slots, each _messageLength bytes - nullptr until initCallbackStorage() is called.
|
inherited |
Next fresh slot checkCallbacks() will read and dispatch.
|
inherited |
Points at the subclass's own, permanently-lived nmeaFields[] table.
|
inherited |
Upper bound on the number of repeated blocks (e.g. GSV's 4)
|
inherited |
Has the module been told to store this message in its internal buffer? (AT+UGNMEA <output> bit 0)
|
inherited |
The maximum message length in bytes. Messages could be less than this.
|
inherited |
true when fresh data has arrived. Cleared by getNMEA().
|
inherited |
The message ID, e.g. "GGA".
|
inherited |
Number of entries in _blockFields.
|
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".
|
inherited |
Number of entries in _fields (header + footer fields only - excludes _numBlockFields)
|
inherited |
Number of header fields before the first repeated block (also the field-table position of the first footer field)
|
inherited |
Raw payload storage - nullptr until initStorage() is called.
|
inherited |
Has the module been told to output this message as a +UUGNMEA URC? (AT+UGNMEA <output> bit 1)
|
static |
Up to 4 satellites per GSV sentence.
| const uint8_t SparkFun_Iridium_9604::nmeaGSV::messageLength = NMEA_GSV_MAX_LENGTH |
The maximum message length (bytes).
| const char SparkFun_Iridium_9604::nmeaGSV::msgId[4] = "GSV" |
The message identifier.
| const nmeaField SparkFun_Iridium_9604::nmeaGSV::nmeaBlockFields[numBlockFields] |
The repeated block fields, by name.
The message fields, by name.
|
static |
The number of fields in each repeated block.
| const uint8_t SparkFun_Iridium_9604::nmeaGSV::numCallbackCopies = 54 |
Up to 9 GSV messages per constellation, 6 constellations;.
|
static |
numHeaderFields (4) + footer (1)
|
static |
The number of header fields.
| const uint8_t SparkFun_Iridium_9604::nmeaGSV::supportedVersions = 1 |
Reserved for future use.