Fix all Wextra warnings

This commit is contained in:
Sara Damiano
2019-08-27 16:39:29 -04:00
parent 3a8a2ada1a
commit dac86a22cd
14 changed files with 252 additions and 85 deletions

View File

@@ -195,15 +195,29 @@ public:
bool init(const char* pin = NULL) {
DBG(GF("### TinyGSM Version:"), TINYGSM_VERSION);
if (!testAT()) {
return false;
}
sendAT(GF("E0")); // Echo Off
if (waitResponse() != 1) {
return false;
}
getSimStatus();
return true;
DBG(GF("### Modem:"), getModemName());
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) {
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);
}
}
String getModemName() {