SparkFun Iridium 9604  v1.0.0
Library for the Iridium 9604 Hybrid LTE-M Cellular + Iridium Satellite (SBD) + GNSS IoT module
Loading...
Searching...
No Matches
SparkFun_Iridium_9604::nmeaMessageVector Class Reference

The collection of NMEA message objects. More...

#include <nmeaMessageVector.h>

Inheritance diagram for SparkFun_Iridium_9604::nmeaMessageVector:

Public Member Functions

 nmeaMessageVector (void)
 Construct the vector and populate it with one instance of every registered NMEA message. More...
 
 ~nmeaMessageVector (void)
 Destroy the vector, deleting every message object it owns. More...
 
nmeaMessage * find (const char *msgId)
 Find the registered message object for a given NMEA message identifier. More...
 
nmeaMessage * findByName (const char *msgId)
 Find the registered message object by its name. Equivalent to find(). More...
 
nmea_status_e initStorage (const char *msgId)
 Lazily allocate a registered message's raw payload storage. More...
 
nmea_status_e isURCEnabled (const char *msgId, bool *enabled)
 Get whether the module has been told to output this message as a +UUGNMEA URC. More...
 
nmea_status_e setURCEnabled (const char *msgId, bool enabled)
 Record whether the module has been told to output this message as a +UUGNMEA URC. More...
 
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. More...
 
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. More...
 
nmea_status_e moduleQueried (const char *msgId, bool *queried)
 Get whether fresh data has arrived for a registered message since it was last reported. More...
 
nmea_status_e setModuleQueried (const char *msgId, bool queried)
 Set whether fresh data has arrived for a registered message since it was last reported. More...
 
nmea_status_e setCallback (const char *msgId, void(*callbackPtr)(nmeaCallbackDataCommon_t *))
 Register (or clear) the user callback function for a registered message. More...
 
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. More...
 
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. More...
 
void debugPrint (const char *message, bool important=false)
 Print a debug message (no trailing newline), if debugging is enabled. More...
 
void debugPrint (int value, bool important=false)
 Print a signed debug value in decimal, if debugging is enabled. More...
 
void debugPrint (int value, int printBase, bool important=false)
 Print a signed debug value in a given base (e.g. HEX, DEC), if debugging is enabled. More...
 
void debugPrint (unsigned int value, bool important=false)
 Print an unsigned debug value in decimal, if debugging is enabled. More...
 
void debugPrint (unsigned int value, int printBase, bool important=false)
 Print an unsigned debug value in a given base (e.g. HEX, DEC), if debugging is enabled. More...
 
void debugPrint (long value, bool important=false)
 Print a signed (long) debug value in decimal, if debugging is enabled. More...
 
void debugPrint (long value, int printBase, bool important=false)
 Print a signed (long) debug value in a given base, if debugging is enabled. More...
 
void debugPrint (unsigned long value, bool important=false)
 Print an unsigned (long) debug value in decimal, if debugging is enabled. More...
 
void debugPrint (unsigned long value, int printBase, bool important=false)
 Print an unsigned (long) debug value in a given base, if debugging is enabled. More...
 
void debugPrintDouble (double value, int decimalPlaces, bool important=false)
 Print a floating point debug value with the given number of decimal places, if debugging is enabled. More...
 
void debugPrintln (const char *message, bool important=false)
 Print a debug message followed by a newline, if debugging is enabled. More...
 
void debugPrintln (int value, bool important=false)
 Print a signed debug value in decimal followed by a newline, if debugging is enabled. More...
 
void debugPrintln (int value, int printBase, bool important=false)
 Print a signed debug value in a given base followed by a newline, if debugging is enabled. More...
 
void debugPrintln (unsigned int value, bool important=false)
 Print an unsigned debug value in decimal followed by a newline, if debugging is enabled. More...
 
void debugPrintln (unsigned int value, int printBase, bool important=false)
 Print an unsigned debug value in a given base followed by a newline, if debugging is enabled. More...
 
void debugPrintln (long value, bool important=false)
 Print a signed (long) debug value in decimal followed by a newline, if debugging is enabled. More...
 
void debugPrintln (long value, int printBase, bool important=false)
 Print a signed (long) debug value in a given base followed by a newline, if debugging is enabled. More...
 
void debugPrintln (unsigned long value, bool important=false)
 Print an unsigned (long) debug value in decimal followed by a newline, if debugging is enabled. More...
 
void debugPrintln (unsigned long value, int printBase, bool important=false)
 Print an unsigned (long) debug value in a given base followed by a newline, if debugging is enabled. More...
 
void debugPrintln (void)
 Print a blank debug line, if debugging is enabled and not in limited-debug mode. More...
 
void debugWrite (char c, bool important=false)
 Write a single raw character to the debug port, if debugging is enabled. More...
 
void atDebugPrint (const char *message)
 Echo raw AT traffic to the AT debug port, if AT debugging is enabled (enableAtDebugging). More...
 
void atDebugWrite (const char *buffer, size_t length)
 Echo raw AT traffic (binary-safe) to the AT debug port, if AT debugging is enabled. More...
 
void atDebugWrite (char c)
 Echo one raw AT character to the AT debug port, if AT debugging is enabled. More...
 
bool debugEnabled (void) const
 true if debug messages are enabled. More...
 
bool atDebugEnabled (void) const
 true if AT-traffic debug messages are enabled. More...
 
void copyDebugStateFrom (const SfeDebugPrint &other)
 Copy debug state (output streams and enabled flags) from another SfeDebugPrint. More...
 

Public Attributes

std::vector< nmeaMessage * > nmeaMessageVectors
 The NMEA message objects. More...
 

Protected Attributes

SfePrint _debugSerial
 The stream to send debug messages to if enabled. More...
 
bool _printDebug = false
 Flag to print the debug messages. More...
 
bool _printLimitedDebug = false
 Flag to print limited (important only) debug messages. More...
 
SfePrint _debugAtSerial
 The stream to echo the AT traffic to if enabled. More...
 
bool _printAtDebug = false
 Flag to echo the AT traffic. More...
 

Detailed Description

The collection of NMEA message objects.

Constructor & Destructor Documentation

◆ nmeaMessageVector()

SparkFun_Iridium_9604::nmeaMessageVector::nmeaMessageVector ( void  )
inline

Construct the vector and populate it with one instance of every registered NMEA message.

Asks nmeaMessageRegistry to build one instance of every message class that self-registered via nmeaRegisterMessage() in its own header.

◆ ~nmeaMessageVector()

SparkFun_Iridium_9604::nmeaMessageVector::~nmeaMessageVector ( void  )
inline

Destroy the vector, deleting every message object it owns.

Member Function Documentation

◆ atDebugEnabled()

bool SparkFun_Iridium_9604::SfeDebugPrint::atDebugEnabled ( void  ) const
inlineinherited

true if AT-traffic debug messages are enabled.

◆ atDebugPrint()

void SparkFun_Iridium_9604::SfeDebugPrint::atDebugPrint ( const char *  message)
inherited

Echo raw AT traffic to the AT debug port, if AT debugging is enabled (enableAtDebugging).

◆ atDebugWrite() [1/2]

void SparkFun_Iridium_9604::SfeDebugPrint::atDebugWrite ( char  c)
inherited

Echo one raw AT character to the AT debug port, if AT debugging is enabled.

◆ atDebugWrite() [2/2]

void SparkFun_Iridium_9604::SfeDebugPrint::atDebugWrite ( const char *  buffer,
size_t  length 
)
inherited

Echo raw AT traffic (binary-safe) to the AT debug port, if AT debugging is enabled.

◆ copyDebugStateFrom()

void SparkFun_Iridium_9604::SfeDebugPrint::copyDebugStateFrom ( const SfeDebugPrint &  other)
inlineinherited

Copy debug state (output streams and enabled flags) from another SfeDebugPrint.

Lets DevIridium9604::enableDebugging()/disableDebugging() push its own state onto its separately-inherited member objects (nmeaMessages, urcHandlers) right after updating it.

Parameters
otherThe SfeDebugPrint object whose debug state to copy.

◆ debugEnabled()

bool SparkFun_Iridium_9604::SfeDebugPrint::debugEnabled ( void  ) const
inlineinherited

true if debug messages are enabled.

◆ debugPrint() [1/9]

void SparkFun_Iridium_9604::SfeDebugPrint::debugPrint ( const char *  message,
bool  important = false 
)
inherited

Print a debug message (no trailing newline), if debugging is enabled.

◆ debugPrint() [2/9]

void SparkFun_Iridium_9604::SfeDebugPrint::debugPrint ( int  value,
bool  important = false 
)
inherited

Print a signed debug value in decimal, if debugging is enabled.

◆ debugPrint() [3/9]

void SparkFun_Iridium_9604::SfeDebugPrint::debugPrint ( int  value,
int  printBase,
bool  important = false 
)
inherited

Print a signed debug value in a given base (e.g. HEX, DEC), if debugging is enabled.

◆ debugPrint() [4/9]

void SparkFun_Iridium_9604::SfeDebugPrint::debugPrint ( long  value,
bool  important = false 
)
inherited

Print a signed (long) debug value in decimal, if debugging is enabled.

◆ debugPrint() [5/9]

void SparkFun_Iridium_9604::SfeDebugPrint::debugPrint ( long  value,
int  printBase,
bool  important = false 
)
inherited

Print a signed (long) debug value in a given base, if debugging is enabled.

◆ debugPrint() [6/9]

void SparkFun_Iridium_9604::SfeDebugPrint::debugPrint ( unsigned int  value,
bool  important = false 
)
inherited

Print an unsigned debug value in decimal, if debugging is enabled.

◆ debugPrint() [7/9]

void SparkFun_Iridium_9604::SfeDebugPrint::debugPrint ( unsigned int  value,
int  printBase,
bool  important = false 
)
inherited

Print an unsigned debug value in a given base (e.g. HEX, DEC), if debugging is enabled.

◆ debugPrint() [8/9]

void SparkFun_Iridium_9604::SfeDebugPrint::debugPrint ( unsigned long  value,
bool  important = false 
)
inherited

Print an unsigned (long) debug value in decimal, if debugging is enabled.

◆ debugPrint() [9/9]

void SparkFun_Iridium_9604::SfeDebugPrint::debugPrint ( unsigned long  value,
int  printBase,
bool  important = false 
)
inherited

Print an unsigned (long) debug value in a given base, if debugging is enabled.

◆ debugPrintDouble()

void SparkFun_Iridium_9604::SfeDebugPrint::debugPrintDouble ( double  value,
int  decimalPlaces,
bool  important = false 
)
inherited

Print a floating point debug value with the given number of decimal places, if debugging is enabled.

◆ debugPrintln() [1/10]

void SparkFun_Iridium_9604::SfeDebugPrint::debugPrintln ( const char *  message,
bool  important = false 
)
inherited

Print a debug message followed by a newline, if debugging is enabled.

◆ debugPrintln() [2/10]

void SparkFun_Iridium_9604::SfeDebugPrint::debugPrintln ( int  value,
bool  important = false 
)
inherited

Print a signed debug value in decimal followed by a newline, if debugging is enabled.

◆ debugPrintln() [3/10]

void SparkFun_Iridium_9604::SfeDebugPrint::debugPrintln ( int  value,
int  printBase,
bool  important = false 
)
inherited

Print a signed debug value in a given base followed by a newline, if debugging is enabled.

◆ debugPrintln() [4/10]

void SparkFun_Iridium_9604::SfeDebugPrint::debugPrintln ( long  value,
bool  important = false 
)
inherited

Print a signed (long) debug value in decimal followed by a newline, if debugging is enabled.

◆ debugPrintln() [5/10]

void SparkFun_Iridium_9604::SfeDebugPrint::debugPrintln ( long  value,
int  printBase,
bool  important = false 
)
inherited

Print a signed (long) debug value in a given base followed by a newline, if debugging is enabled.

◆ debugPrintln() [6/10]

void SparkFun_Iridium_9604::SfeDebugPrint::debugPrintln ( unsigned int  value,
bool  important = false 
)
inherited

Print an unsigned debug value in decimal followed by a newline, if debugging is enabled.

◆ debugPrintln() [7/10]

void SparkFun_Iridium_9604::SfeDebugPrint::debugPrintln ( unsigned int  value,
int  printBase,
bool  important = false 
)
inherited

Print an unsigned debug value in a given base followed by a newline, if debugging is enabled.

◆ debugPrintln() [8/10]

void SparkFun_Iridium_9604::SfeDebugPrint::debugPrintln ( unsigned long  value,
bool  important = false 
)
inherited

Print an unsigned (long) debug value in decimal followed by a newline, if debugging is enabled.

◆ debugPrintln() [9/10]

void SparkFun_Iridium_9604::SfeDebugPrint::debugPrintln ( unsigned long  value,
int  printBase,
bool  important = false 
)
inherited

Print an unsigned (long) debug value in a given base followed by a newline, if debugging is enabled.

◆ debugPrintln() [10/10]

void SparkFun_Iridium_9604::SfeDebugPrint::debugPrintln ( void  )
inherited

Print a blank debug line, if debugging is enabled and not in limited-debug mode.

◆ debugWrite()

void SparkFun_Iridium_9604::SfeDebugPrint::debugWrite ( char  c,
bool  important = false 
)
inherited

Write a single raw character to the debug port, if debugging is enabled.

◆ extractValue()

nmea_status_e SparkFun_Iridium_9604::nmeaMessageVector::extractValue ( const char *  msgId,
const char *  field,
sfe_string_t &  value 
)
inline

Look up one named field of a registered message's live sentence.

Parameters
msgIdThe NMEA message identifier to look up.
fieldName of the field to extract.
valueOut parameter: filled in with the field's text if found.
Returns
NMEA_STATUS_SUCCESS if found, NMEA_STATUS_INVALID_ARG if no message is registered under msgId or the field was not found, or NMEA_STATUS_MEM_ERR if no data has arrived for this message yet.

◆ find()

nmeaMessage * SparkFun_Iridium_9604::nmeaMessageVector::find ( const char *  msgId)
inline

Find the registered message object for a given NMEA message identifier.

Parameters
msgIdThe 3-character NMEA message identifier to look up (e.g. "GGA").
Returns
Pointer to the matching nmeaMessage, or nullptr if no message is registered under that id.

◆ findByName()

nmeaMessage * SparkFun_Iridium_9604::nmeaMessageVector::findByName ( const char *  msgId)
inline

Find the registered message object by its name. Equivalent to find().

◆ initStorage()

nmea_status_e SparkFun_Iridium_9604::nmeaMessageVector::initStorage ( const char *  msgId)
inline

Lazily allocate a registered message's raw payload storage.

Parameters
msgIdThe NMEA message identifier to look up.
Returns
NMEA_STATUS_SUCCESS on success, NMEA_STATUS_INVALID_ARG if no message is registered under msgId, or NMEA_STATUS_MEM_ERR if the allocation failed.

◆ isMemoryEnabled()

nmea_status_e SparkFun_Iridium_9604::nmeaMessageVector::isMemoryEnabled ( const char *  msgId,
bool *  enabled 
)
inline

Get whether the module has been told to store this message in its internal (memory) buffer.

◆ isURCEnabled()

nmea_status_e SparkFun_Iridium_9604::nmeaMessageVector::isURCEnabled ( const char *  msgId,
bool *  enabled 
)
inline

Get whether the module has been told to output this message as a +UUGNMEA URC.

◆ moduleQueried()

nmea_status_e SparkFun_Iridium_9604::nmeaMessageVector::moduleQueried ( const char *  msgId,
bool *  queried 
)
inline

Get whether fresh data has arrived for a registered message since it was last reported.

Parameters
msgIdThe NMEA message identifier to look up.
queriedOut parameter: filled in with the message's moduleQueried flag.
Returns
NMEA_STATUS_SUCCESS on success, NMEA_STATUS_INVALID_ARG if no message is registered under msgId.

◆ setCallback()

nmea_status_e SparkFun_Iridium_9604::nmeaMessageVector::setCallback ( const char *  msgId,
void(*)(nmeaCallbackDataCommon_t *)  callbackPtr 
)
inline

Register (or clear) the user callback function for a registered message.

Parameters
msgIdThe NMEA message identifier to look up.
callbackPtrFunction to call once fresh data is waiting for this message, or nullptr to clear any previously-registered callback.
Returns
NMEA_STATUS_SUCCESS on success, NMEA_STATUS_INVALID_ARG if no message is registered under msgId.

◆ setMemoryEnabled()

nmea_status_e SparkFun_Iridium_9604::nmeaMessageVector::setMemoryEnabled ( const char *  msgId,
bool  enabled 
)
inline

Record whether the module has been told to store this message in its internal (memory) buffer.

◆ setModuleQueried()

nmea_status_e SparkFun_Iridium_9604::nmeaMessageVector::setModuleQueried ( const char *  msgId,
bool  queried 
)
inline

Set whether fresh data has arrived for a registered message since it was last reported.

◆ setURCEnabled()

nmea_status_e SparkFun_Iridium_9604::nmeaMessageVector::setURCEnabled ( const char *  msgId,
bool  enabled 
)
inline

Record whether the module has been told to output this message as a +UUGNMEA URC.

◆ storePayload()

nmea_status_e SparkFun_Iridium_9604::nmeaMessageVector::storePayload ( const char *  msgId,
const uint8_t *  payload,
uint16_t  len 
)
inline

Copy a freshly-received (and already checksum-validated) NMEA sentence into a message's storage.

This is the live NMEA dispatch path - DevIridium9604::processNMEA() calls it. It mirrors the NMEA dispatch / ring-buffer logic in GNSS v4 DevUBLOXGNSS::process(): the sentence is copied into _storage (for polling with getNMEA() / getNmeaMessageField()) and, if a callback is registered, into the next free slot of the _callbackStorage ring buffer (for checkCallbacks()). For _numCallbackCopies <= 1 the newest sentence always overwrites the single slot; for multi-slot messages (GSV, GSA, GRS) a full ring drops the new sentence and keeps what is already buffered.

Unlike GNSS v4, the copy is always NULL-terminated: at most _messageLength - 1 bytes are copied.

Parameters
msgIdThe NMEA message identifier (e.g. "GGA").
payloadPointer to the sentence, starting with '$'.
lenNumber of bytes in the sentence.
Returns
NMEA_STATUS_SUCCESS on success, NMEA_STATUS_INVALID_ARG if no message is registered under msgId, or NMEA_STATUS_MEM_ERR if storage could not be allocated.

Member Data Documentation

◆ _debugAtSerial

SfePrint SparkFun_Iridium_9604::SfeDebugPrint::_debugAtSerial
protectedinherited

The stream to echo the AT traffic to if enabled.

◆ _debugSerial

SfePrint SparkFun_Iridium_9604::SfeDebugPrint::_debugSerial
protectedinherited

The stream to send debug messages to if enabled.

◆ _printAtDebug

bool SparkFun_Iridium_9604::SfeDebugPrint::_printAtDebug = false
protectedinherited

Flag to echo the AT traffic.

◆ _printDebug

bool SparkFun_Iridium_9604::SfeDebugPrint::_printDebug = false
protectedinherited

Flag to print the debug messages.

◆ _printLimitedDebug

bool SparkFun_Iridium_9604::SfeDebugPrint::_printLimitedDebug = false
protectedinherited

Flag to print limited (important only) debug messages.

◆ nmeaMessageVectors

std::vector<nmeaMessage *> SparkFun_Iridium_9604::nmeaMessageVector::nmeaMessageVectors

The NMEA message objects.


The documentation for this class was generated from the following file: