23#include "../urcHandler.h"
32 typedef void (*
callback_t)(int, sfe_ip_address_t,
unsigned int, int, sfe_ip_address_t,
unsigned int);
40 unsigned int port = 0;
41 unsigned int listenPort = 0;
42 sfe_ip_address_t remoteIP = {0, 0, 0, 0};
43 sfe_ip_address_t localIP = {0, 0, 0, 0};
44 int remoteIPstore[4] = {0, 0, 0, 0};
45 int localIPstore[4] = {0, 0, 0, 0};
47 int ret = sscanf(params,
48 "%d,\"%d.%d.%d.%d\",%u,%d,\"%d.%d.%d.%d\",%u",
50 &remoteIPstore[0], &remoteIPstore[1], &remoteIPstore[2], &remoteIPstore[3],
52 &localIPstore[0], &localIPstore[1], &localIPstore[2], &localIPstore[3],
54 for (
int i = 0; i <= 3; i++)
57 remoteIP[i] = (uint8_t)remoteIPstore[i];
59 localIP[i] = (uint8_t)localIPstore[i];
const char IRIDIUM_9604_LISTEN_SOCKET_URC[]
The +UUSOLI: URC.
Definition: Iridium_9604_AT_commands.h:148
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.
virtual void urcSocketListenIndication(sfe_ip_address_t localIP, sfe_ip_address_t remoteIP)=0
Record the IP addresses (lastRemoteIP())
The URC handler for +UUSOLI: - Set Listening Socket: incoming connection. See the file description fo...
Definition: urcUUSOLI.h:30
void(* callback_t)(int, sfe_ip_address_t, unsigned int, int, sfe_ip_address_t, unsigned int)
The callback signature. See the file description.
Definition: urcUUSOLI.h:32
bool process(urcHandlerInterface &device, const char *params)
Parse the URC parameters and act on them.
Definition: urcUUSOLI.h:36
urcUUSOLI(void)
Definition: urcUUSOLI.h:34
Definition: nmeaMessage.h:30
#define urcRegisterHandler(kHandler)
Declare a file-scope static builder that self-registers a URC handler class.
Definition: urcHandler.h:238