Grouped connection quality functions
This commit is contained in:
@@ -241,7 +241,7 @@ public:
|
||||
}
|
||||
|
||||
/*
|
||||
* SIM card & Network Operator functions
|
||||
* SIM card functions
|
||||
*/
|
||||
|
||||
bool simUnlock(const char *pin) {
|
||||
@@ -269,16 +269,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?"));
|
||||
@@ -320,6 +310,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();
|
||||
@@ -456,12 +460,6 @@ public:
|
||||
* Messaging functions
|
||||
*/
|
||||
|
||||
void sendUSSD() {
|
||||
}
|
||||
|
||||
void sendSMS() {
|
||||
}
|
||||
|
||||
bool sendSMS(const String& number, const String& text) {
|
||||
sendAT(GF("+CMGF=1"));
|
||||
waitResponse();
|
||||
@@ -504,8 +502,6 @@ public:
|
||||
/*
|
||||
* Location functions
|
||||
*/
|
||||
void getLocation() {
|
||||
}
|
||||
|
||||
String getGsmLocation() {
|
||||
sendAT(GF("+CIPGSMLOC=1,1"));
|
||||
|
||||
Reference in New Issue
Block a user