Grouped connection quality functions

This commit is contained in:
SRGDamia1
2017-06-08 13:29:05 -04:00
parent b5dace330b
commit ea1a4706f9
6 changed files with 81 additions and 85 deletions

View File

@@ -234,7 +234,7 @@ public:
}
/*
* SIM card & Network Operator functions
* SIM card functions
*/
bool simUnlock(const char *pin) {
@@ -262,16 +262,6 @@ public:
return res;
}
int getSignalQuality() {
sendAT(GF("+CSQ"));
if (waitResponse(GF(GSM_NL "+CSQ:")) != 1) {
return 99;
}
int res = streamReadUntil(',').toInt();
waitResponse();
return res;
}
SimStatus getSimStatus(unsigned long timeout = 10000L) {
for (unsigned long start = millis(); millis() - start < timeout; ) {
sendAT(GF("+CPIN?"));
@@ -313,6 +303,20 @@ public:
return res;
}
/*
* Generic network functions
*/
int getSignalQuality() {
sendAT(GF("+CSQ"));
if (waitResponse(GF(GSM_NL "+CSQ:")) != 1) {
return 99;
}
int res = streamReadUntil(',').toInt();
waitResponse();
return res;
}
bool waitForNetwork(unsigned long timeout = 60000L) {
for (unsigned long start = millis(); millis() - start < timeout; ) {
RegStatus s = getRegistrationStatus();
@@ -399,12 +403,6 @@ public:
* Messaging functions
*/
void sendUSSD() {
}
void sendSMS() {
}
bool sendSMS(const String& number, const String& text) {
sendAT(GF("+CMGF=1"));
waitResponse();
@@ -420,8 +418,6 @@ public:
/*
* Location functions
*/
void getLocation() {
}
/*
* Battery functions