mirror of
https://github.com/vshymanskyy/TinyGSM.git
synced 2026-05-15 04:06:10 +00:00
Move down provider
Signed-off-by: Sara Damiano <sdamiano@stroudcenter.org>
This commit is contained in:
@@ -378,6 +378,15 @@ class TinyGsmA7672X : public TinyGsmModem<TinyGsmA7672X>,
|
||||
return true;
|
||||
}
|
||||
|
||||
String getProviderImpl() {
|
||||
sendAT(GF("+CSPN?"));
|
||||
if (waitResponse(GF("+CSPN:")) != 1) { return ""; }
|
||||
streamSkipUntil('"'); /* Skip mode and format */
|
||||
String res = stream.readStringUntil('"');
|
||||
waitResponse();
|
||||
return res;
|
||||
}
|
||||
|
||||
/*
|
||||
* SIM card functions
|
||||
*/
|
||||
|
||||
@@ -316,6 +316,15 @@ class TinyGsmBG96 : public TinyGsmModem<TinyGsmBG96>,
|
||||
return true;
|
||||
}
|
||||
|
||||
String getProviderImpl() {
|
||||
sendAT(GF("+QSPN?"));
|
||||
if (waitResponse(GF("+QSPN:")) != 1) { return ""; }
|
||||
streamSkipUntil('"'); // Skip mode and format
|
||||
String res = stream.readStringUntil('"'); // read the provider
|
||||
waitResponse(); // skip anything else
|
||||
return res;
|
||||
}
|
||||
|
||||
/*
|
||||
* SIM card functions
|
||||
*/
|
||||
|
||||
@@ -334,6 +334,15 @@ class TinyGsmM95 : public TinyGsmModem<TinyGsmM95>,
|
||||
return waitResponse(60000L, GF("DEACT OK"), GF("ERROR")) == 1;
|
||||
}
|
||||
|
||||
String getProviderImpl() {
|
||||
sendAT(GF("+QSPN?"));
|
||||
if (waitResponse(GF("+QSPN:")) != 1) { return ""; }
|
||||
streamSkipUntil('"'); // Skip mode and format
|
||||
String res = stream.readStringUntil('"'); // read the provider
|
||||
waitResponse(); // skip anything else
|
||||
return res;
|
||||
}
|
||||
|
||||
/*
|
||||
* SIM card functions
|
||||
*/
|
||||
|
||||
@@ -307,6 +307,15 @@ class TinyGsmMC60 : public TinyGsmModem<TinyGsmMC60>,
|
||||
return waitResponse(60000L, GF("DEACT OK"), GF("ERROR")) == 1;
|
||||
}
|
||||
|
||||
String getProviderImpl() {
|
||||
sendAT(GF("+QSPN?"));
|
||||
if (waitResponse(GF("+QSPN:")) != 1) { return ""; }
|
||||
streamSkipUntil('"'); // Skip mode and format
|
||||
String res = stream.readStringUntil('"'); // read the provider
|
||||
waitResponse(); // skip anything else
|
||||
return res;
|
||||
}
|
||||
|
||||
/*
|
||||
* SIM card functions
|
||||
*/
|
||||
|
||||
@@ -400,6 +400,15 @@ class TinyGsmSim5360 : public TinyGsmModem<TinyGsmSim5360>,
|
||||
return true;
|
||||
}
|
||||
|
||||
String getProviderImpl() {
|
||||
sendAT(GF("+CSPN?"));
|
||||
if (waitResponse(GF("+CSPN:")) != 1) { return ""; }
|
||||
streamSkipUntil('"'); /* Skip mode and format */
|
||||
String res = stream.readStringUntil('"');
|
||||
waitResponse();
|
||||
return res;
|
||||
}
|
||||
|
||||
/*
|
||||
* SIM card functions
|
||||
*/
|
||||
|
||||
@@ -389,6 +389,15 @@ class TinyGsmSim7600 : public TinyGsmModem<TinyGsmSim7600>,
|
||||
return true;
|
||||
}
|
||||
|
||||
String getProviderImpl() {
|
||||
sendAT(GF("+CSPN?"));
|
||||
if (waitResponse(GF("+CSPN:")) != 1) { return ""; }
|
||||
streamSkipUntil('"'); /* Skip mode and format */
|
||||
String res = stream.readStringUntil('"');
|
||||
waitResponse();
|
||||
return res;
|
||||
}
|
||||
|
||||
/*
|
||||
* SIM card functions
|
||||
*/
|
||||
|
||||
@@ -397,6 +397,15 @@ class TinyGsmSim800 : public TinyGsmModem<TinyGsmSim800>,
|
||||
return true;
|
||||
}
|
||||
|
||||
String getProviderImpl() {
|
||||
sendAT(GF("+CSPN?"));
|
||||
if (waitResponse(GF("+CSPN:")) != 1) { return ""; }
|
||||
streamSkipUntil('"'); /* Skip mode and format */
|
||||
String res = stream.readStringUntil('"');
|
||||
waitResponse();
|
||||
return res;
|
||||
}
|
||||
|
||||
/*
|
||||
* SIM card functions
|
||||
*/
|
||||
|
||||
@@ -184,14 +184,7 @@ class TinyGsmGPRS {
|
||||
return res;
|
||||
}
|
||||
|
||||
String getProviderImpl() {
|
||||
thisModem().sendAT(GF("+CSPN?"));
|
||||
if (thisModem().waitResponse(GF("+CSPN:")) != 1) { return ""; }
|
||||
thisModem().streamSkipUntil('"'); /* Skip mode and format */
|
||||
String res = thisModem().stream.readStringUntil('"');
|
||||
thisModem().waitResponse();
|
||||
return res;
|
||||
}
|
||||
String getProviderImpl() TINY_GSM_ATTR_NOT_IMPLEMENTED;
|
||||
};
|
||||
|
||||
#endif // SRC_TINYGSMGPRS_H_
|
||||
|
||||
Reference in New Issue
Block a user