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
urcCREG.h
Go to the documentation of this file.
1
21#pragma once
22
23#include "../urcHandler.h"
24
26{
27
29 class urcCREG : public urcHandler
30 {
31 public:
32 typedef void (*callback_t)(IRIDIUM_9604_registration_status_t, unsigned int, unsigned int, int);
33
35
36 bool process(urcHandlerInterface &device, const char *params)
37 {
38 int status = 0;
39 unsigned int area = 0, ci = 0;
40 int Act = 0;
41 int scanNum = sscanf(params, "%d,\"%4x\",\"%x\",%d", &status, &area, &ci, &Act);
42 if (scanNum != 4)
43 return false;
44
45 device.urcDebug().debugPrintln("processURCEvent: CREG");
46
47 if (_callbackPtr[0] != nullptr)
49
50 return true;
51 }
52 };
53
55
56} // namespace SparkFun_Iridium_9604
const char IRIDIUM_9604_REGISTRATION_STATUS_URC[]
The +CREG: URC.
Definition: Iridium_9604_AT_commands.h:155
IRIDIUM_9604_registration_status_t
The network registration status (+CREG / +CEREG).
Definition: Iridium_9604_typedefs.h:150
void debugPrintln(const char *message, bool important=false)
Print a debug message followed by a newline, if debugging is enabled.
Definition: sfe_debug.cpp:76
The URC handler for +CREG: - Network registration status. See the file description for the callback(s...
Definition: urcCREG.h:30
urcCREG(void)
Definition: urcCREG.h:34
bool process(urcHandlerInterface &device, const char *params)
Parse the URC parameters and act on them.
Definition: urcCREG.h:36
void(* callback_t)(IRIDIUM_9604_registration_status_t, unsigned int, unsigned int, int)
The callback signature. See the file description.
Definition: urcCREG.h:32
The base class for the URC handlers. See the file description for how to add a new URC.
Definition: urcHandler.h:92
urcCallback_t _callbackPtr[URC_MAX_CALLBACKS]
The user's callbacks, stored generically.
Definition: urcHandler.h:168
void addURC(const char *urcPrefix, bool keepInBacklog=true)
Register this handler's identity. Called once, from the subclass's own constructor.
Definition: urcHandler.h:108
urcHandlerInterface: the services DevIridium9604 provides to the URC handlers. DevIridium9604 inherit...
Definition: urcHandler.h:70
virtual SfeDebugPrint & urcDebug(void)=0
The debug printer.
Definition: nmeaMessage.h:30
#define urcRegisterHandler(kHandler)
Declare a file-scope static builder that self-registers a URC handler class.
Definition: urcHandler.h:238