mirror of
https://github.com/KevinMidboe/TinyGSM.git
synced 2025-10-29 18:00:18 +00:00
Listed for UUPSDA on ublox
This commit is contained in:
@@ -399,7 +399,7 @@ TINY_GSM_MODEM_WAIT_FOR_NETWORK()
|
|||||||
// action = 3: activate; it activates a PDP context with the specified profile,
|
// action = 3: activate; it activates a PDP context with the specified profile,
|
||||||
// using the current parameters
|
// using the current parameters
|
||||||
sendAT(GF("+UPSDA=0,3")); // Activate the PDP context associated with profile 0
|
sendAT(GF("+UPSDA=0,3")); // Activate the PDP context associated with profile 0
|
||||||
if (waitResponse(360000L) != 1) {
|
if (waitResponse(360000L) != 1) { // Should return ok
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -409,11 +409,19 @@ TINY_GSM_MODEM_WAIT_FOR_NETWORK()
|
|||||||
// AT+UPSND=<profile_id>,<param_tag>
|
// AT+UPSND=<profile_id>,<param_tag>
|
||||||
// profile_id = 0: PSD profile identifier, in range 0-6 (NOT PDP context)
|
// profile_id = 0: PSD profile identifier, in range 0-6 (NOT PDP context)
|
||||||
// param_tag = 8: PSD profile status: if the profile is active the return value is 1, 0 otherwise
|
// param_tag = 8: PSD profile status: if the profile is active the return value is 1, 0 otherwise
|
||||||
sendAT(GF("+UPSND=0,8")); // Activate PSD profile 0
|
sendAT(GF("+UPSND=0,8")); // Check if PSD profile 0 is now active
|
||||||
if (waitResponse(GF(",8,1")) != 1) {
|
int res = waitResponse(GF(",8,1"), GF(",8,0"));
|
||||||
|
waitResponse(); // Should return another OK
|
||||||
|
if (res == 1) {
|
||||||
|
return true; // It's now active
|
||||||
|
} else if (res == 2) { // If it's not active yet, wait for the +UUPSDA URC
|
||||||
|
if (waitResponse(180000L, GF("+UUPSDA: 0")) != 1) { // 0=successful
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
streamSkipUntil('\n'); // Ignore the IP address, if returned
|
||||||
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
waitResponse();
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user