File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -358,6 +358,13 @@ int GPRS::ping(IPAddress ip, uint8_t ttl)
358
358
return ping (host, ttl);
359
359
}
360
360
361
+ GSM3_NetworkStatus_t GPRS::status ()
362
+ {
363
+ MODEM.poll ();
364
+
365
+ return _status;
366
+ }
367
+
361
368
void GPRS::handleUrc (const String& urc)
362
369
{
363
370
if (urc.startsWith (" +UUPINGER: " )) {
@@ -380,5 +387,12 @@ void GPRS::handleUrc(const String& urc)
380
387
_pingResult = GPRS_PING_ERROR;
381
388
}
382
389
}
390
+ } else if (urc.startsWith (" +UUPSDD: " )) {
391
+ int profileId = urc.charAt (urc.length () - 1 ) - ' 0' ;
392
+
393
+ if (profileId == 0 ) {
394
+ // disconnected
395
+ _status = IDLE;
396
+ }
383
397
}
384
398
}
Original file line number Diff line number Diff line change @@ -88,6 +88,8 @@ class GPRS : public ModemUrcHandler {
88
88
int ping (const String& hostname, uint8_t ttl = 128 );
89
89
int ping (IPAddress ip, uint8_t ttl = 128 );
90
90
91
+ GSM3_NetworkStatus_t status ();
92
+
91
93
void handleUrc (const String& urc);
92
94
93
95
private:
You can’t perform that action at this time.
0 commit comments