Fix #199
This commit is contained in:
@@ -275,10 +275,15 @@ public:
|
|||||||
DBG(GF("### SARA N2 NB-IoT modems not supported!"), name);
|
DBG(GF("### SARA N2 NB-IoT modems not supported!"), name);
|
||||||
}
|
}
|
||||||
int ret = getSimStatus();
|
int ret = getSimStatus();
|
||||||
|
// if the sim isn't ready and a pin has been provided, try to unlock the sim
|
||||||
if (ret != SIM_READY && pin != NULL && strlen(pin) > 0) {
|
if (ret != SIM_READY && pin != NULL && strlen(pin) > 0) {
|
||||||
simUnlock(pin);
|
simUnlock(pin);
|
||||||
|
return (getSimStatus() == SIM_READY);
|
||||||
|
}
|
||||||
|
// if the sim is ready, or it's locked but no pin has been provided, return true
|
||||||
|
else {
|
||||||
|
return (ret == SIM_READY || ret == SIM_LOCKED);
|
||||||
}
|
}
|
||||||
return (getSimStatus() == SIM_READY);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
String getModemName() {
|
String getModemName() {
|
||||||
@@ -383,7 +388,7 @@ public:
|
|||||||
if (waitResponse(10000L) != 1) {
|
if (waitResponse(10000L) != 1) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
delay(3000);
|
delay(3000); // TODO: Verify delay timing here
|
||||||
return init();
|
return init();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -513,7 +518,7 @@ public:
|
|||||||
if (waitResponse() != 1) {
|
if (waitResponse() != 1) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
sendAT(GF("+URAT="), urat); // Radio Access Technology (RAT) selection
|
sendAT(GF("+URAT="), urat); // Radio Access Technology (RAT) selection
|
||||||
if (waitResponse() != 1) {
|
if (waitResponse() != 1) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user