Merge pull request #1 from Gelemikke/network-system-mode-sim7600

add getNetworkSystemMode() for SIM7600
This commit is contained in:
Mikael Fredriksson
2024-03-06 12:21:29 +01:00
committed by GitHub

View File

@@ -291,6 +291,17 @@ class TinyGsmSim7600 : public TinyGsmModem<TinyGsmSim7600>,
return waitResponse() == 1;
}
bool getNetworkSystemMode(bool& n, int16_t& stat) {
// n: whether to automatically report the system mode info
// stat: the current service. 0 if it not connected
sendAT(GF("+CNSMOD?"));
if (waitResponse(GF(GSM_NL "+CNSMOD:")) != 1) { return false; }
n = streamGetIntBefore(',') != 0;
stat = streamGetIntBefore('\n');
waitResponse();
return true;
}
String getLocalIPImpl() {
sendAT(GF("+IPADDR")); // Inquire Socket PDP address
// sendAT(GF("+CGPADDR=1")); // Show PDP address