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::urcHandlerVector Class Reference

The collection of registered URC handlers. Replaces the SARA-R5 processURCEvent(). More...

#include <urcHandlerVector.h>

Inheritance diagram for SparkFun_Iridium_9604::urcHandlerVector:

Public Member Functions

 urcHandlerVector (void)
 Construct the vector and populate it with one instance of every registered URC handler. More...
 
 ~urcHandlerVector (void)
 Destroy the vector, deleting every handler object it owns. More...
 
urcHandler * find (const char *urcPrefix)
 Find the registered handler for a URC prefix. More...
 
bool setCallback (const char *urcPrefix, urcCallback_t callback, uint8_t index=0)
 Register (or clear) a user callback for a URC. More...
 
bool isURC (const char *event)
 Does this event contain a URC we want to keep in the backlog? Used by pruneBacklog(). More...
 
bool processEvent (urcHandlerInterface &device, const char *event)
 Pass an event to the handlers. The first handler which matches and decodes it, wins. 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< urcHandler * > urcHandlerVectors
 The URC handler 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 registered URC handlers. Replaces the SARA-R5 processURCEvent().

Constructor & Destructor Documentation

◆ urcHandlerVector()

SparkFun_Iridium_9604::urcHandlerVector::urcHandlerVector ( void  )
inline

Construct the vector and populate it with one instance of every registered URC handler.

◆ ~urcHandlerVector()

SparkFun_Iridium_9604::urcHandlerVector::~urcHandlerVector ( void  )
inline

Destroy the vector, deleting every handler 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.

◆ find()

urcHandler * SparkFun_Iridium_9604::urcHandlerVector::find ( const char *  urcPrefix)
inline

Find the registered handler for a URC prefix.

Parameters
urcPrefixThe URC prefix, e.g. "+UUSORD:" (IRIDIUM_9604_READ_SOCKET_URC).
Returns
Pointer to the handler, or nullptr if no handler is registered for that prefix.

◆ isURC()

bool SparkFun_Iridium_9604::urcHandlerVector::isURC ( const char *  event)
inline

Does this event contain a URC we want to keep in the backlog? Used by pruneBacklog().

◆ processEvent()

bool SparkFun_Iridium_9604::urcHandlerVector::processEvent ( urcHandlerInterface &  device,
const char *  event 
)
inline

Pass an event to the handlers. The first handler which matches and decodes it, wins.

Parameters
deviceThe DevIridium9604 services available to the handlers.
eventOne event (one line, with the CR LF removed).
Returns
true if a handler decoded the event.

◆ setCallback()

bool SparkFun_Iridium_9604::urcHandlerVector::setCallback ( const char *  urcPrefix,
urcCallback_t  callback,
uint8_t  index = 0 
)
inline

Register (or clear) a user callback for a URC.

Parameters
urcPrefixThe URC prefix, e.g. "+UUSORD:".
callbackThe callback, cast to urcCallback_t. nullptr clears the callback.
indexWhich of the URC's callbacks to set. Usually 0.
Returns
true on success; false if no handler is registered for that prefix or index is out of range.

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.

◆ urcHandlerVectors

std::vector<urcHandler *> SparkFun_Iridium_9604::urcHandlerVector::urcHandlerVectors

The URC handler objects.


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