Grouped connection quality functions
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user