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::urcHandler Class Referenceabstract

The base class for the URC handlers. See the file description for how to add a new URC. More...

#include <urcHandler.h>

Inheritance diagram for SparkFun_Iridium_9604::urcHandler:

Public Member Functions

 urcHandler (void)
 
virtual ~urcHandler (void)
 
void addURC (const char *urcPrefix, bool keepInBacklog=true)
 Register this handler's identity. Called once, from the subclass's own constructor. More...
 
bool amI (const char *urcPrefix) const
 Does this object handle this URC prefix? (Exact match, e.g. "+UUSORD:") More...
 
const char * match (const char *event) const
 Does this event contain this handler's URC? More...
 
virtual bool process (urcHandlerInterface &device, const char *params)=0
 Parse the URC parameters and act on them. More...
 
bool setCallback (urcCallback_t callback, uint8_t index=0)
 Set (or clear, with nullptr) callback 'index' for this URC. More...
 
bool hasCallback (uint8_t index=0) const
 true if callback 'index' has been registered. More...
 

Public Attributes

const char * _urcPrefix = nullptr
 e.g. "+UUSORD:" More...
 
bool _keepInBacklog = true
 Keep this URC in the backlog for the next bufferedPoll. More...
 
urcCallback_t _callbackPtr [URC_MAX_CALLBACKS]
 The user's callbacks, stored generically. More...
 

Detailed Description

The base class for the URC handlers. See the file description for how to add a new URC.

Constructor & Destructor Documentation

◆ urcHandler()

SparkFun_Iridium_9604::urcHandler::urcHandler ( void  )
inline

◆ ~urcHandler()

virtual SparkFun_Iridium_9604::urcHandler::~urcHandler ( void  )
inlinevirtual

Member Function Documentation

◆ addURC()

void SparkFun_Iridium_9604::urcHandler::addURC ( const char *  urcPrefix,
bool  keepInBacklog = true 
)
inline

Register this handler's identity. Called once, from the subclass's own constructor.

Parameters
urcPrefixThe URC prefix, including the colon, e.g. "+UUSORD:". Must be permanently lived.
keepInBacklogIf true (the default), pruneBacklog() keeps events containing this URC so they are processed by the next bufferedPoll().

◆ amI()

bool SparkFun_Iridium_9604::urcHandler::amI ( const char *  urcPrefix) const
inline

Does this object handle this URC prefix? (Exact match, e.g. "+UUSORD:")

◆ hasCallback()

bool SparkFun_Iridium_9604::urcHandler::hasCallback ( uint8_t  index = 0) const
inline

true if callback 'index' has been registered.

◆ match()

const char * SparkFun_Iridium_9604::urcHandler::match ( const char *  event) const
inline

Does this event contain this handler's URC?

Parameters
eventThe event (one line, CR LF removed).
Returns
Pointer to the first parameter character (the prefix and any spaces skipped), or nullptr if the event does not contain the URC.

◆ process()

virtual bool SparkFun_Iridium_9604::urcHandler::process ( urcHandlerInterface &  device,
const char *  params 
)
pure virtual

Parse the URC parameters and act on them.

Parameters
deviceThe DevIridium9604 services available to the handler.
paramsThe URC parameters: the text after the URC prefix (and any spaces).
Returns
true if the URC was decoded (and handled), false if the parameters could not be parsed. (Some AT command responses look like URCs - e.g. the response to AT+CREG? - and will fail to parse. processEvent() then tries the remaining handlers.)

Implemented in SparkFun_Iridium_9604::urcAREG, SparkFun_Iridium_9604::urcCEREG, SparkFun_Iridium_9604::urcCIEV, SparkFun_Iridium_9604::urcCREG, SparkFun_Iridium_9604::urcUUFTPCR, SparkFun_Iridium_9604::urcUUGIND, SparkFun_Iridium_9604::urcUUGNMEA, SparkFun_Iridium_9604::urcUUHTTPCR, SparkFun_Iridium_9604::urcUULOC, SparkFun_Iridium_9604::urcUUMQTTC, SparkFun_Iridium_9604::urcUUPING, SparkFun_Iridium_9604::urcUUSIMSTAT, SparkFun_Iridium_9604::urcUUSOCL, SparkFun_Iridium_9604::urcUUSOLI, SparkFun_Iridium_9604::urcUUSORD, and SparkFun_Iridium_9604::urcUUSORF.

◆ setCallback()

bool SparkFun_Iridium_9604::urcHandler::setCallback ( urcCallback_t  callback,
uint8_t  index = 0 
)
inline

Set (or clear, with nullptr) callback 'index' for this URC.

Member Data Documentation

◆ _callbackPtr

urcCallback_t SparkFun_Iridium_9604::urcHandler::_callbackPtr[URC_MAX_CALLBACKS]

The user's callbacks, stored generically.

◆ _keepInBacklog

bool SparkFun_Iridium_9604::urcHandler::_keepInBacklog = true

Keep this URC in the backlog for the next bufferedPoll.

◆ _urcPrefix

const char* SparkFun_Iridium_9604::urcHandler::_urcPrefix = nullptr

e.g. "+UUSORD:"


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