22#include "../urcHandler.h"
31 typedef void (*
callback_t)(int, int, sfe_string_t, sfe_ip_address_t, int, long);
40 sfe_string_t remote_host =
"";
41 sfe_ip_address_t remoteIP = {0, 0, 0, 0};
45 int scanNum = sscanf(params,
"%d,%d,", &retry, &p_size);
51 const char *searchPtr = strchr(params,
'\"');
52 if (searchPtr !=
nullptr)
55 while ((*(++searchPtr) !=
'\"') && (*searchPtr !=
'\0'))
57 remote_host += *(searchPtr);
60 if (*searchPtr !=
'\0')
63 scanNum = sscanf(searchPtr,
"\",\"%d.%d.%d.%d\",%d,%ld",
64 &remoteIPstore[0], &remoteIPstore[1], &remoteIPstore[2], &remoteIPstore[3], &ttl, &rtt);
67 for (
int i = 0; i <= 3; i++)
68 remoteIP[i] = (uint8_t)remoteIPstore[i];
const char IRIDIUM_9604_PING_COMMAND_URC[]
The +UUPING: URC.
Definition: Iridium_9604_AT_commands.h:154
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 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.
The URC handler for +UUPING: - Ping Result. See the file description for the callback(s).
Definition: urcUUPING.h:29
urcUUPING(void)
Definition: urcUUPING.h:33
bool process(urcHandlerInterface &device, const char *params)
Parse the URC parameters and act on them.
Definition: urcUUPING.h:35
void(* callback_t)(int, int, sfe_string_t, sfe_ip_address_t, int, long)
The callback signature. See the file description.
Definition: urcUUPING.h:31
Definition: nmeaMessage.h:30
#define urcRegisterHandler(kHandler)
Declare a file-scope static builder that self-registers a URC handler class.
Definition: urcHandler.h:238