Added virtual master class

This commit is contained in:
Sara Damiano
2018-09-07 18:15:42 -04:00
parent fc9922904d
commit 56dca5185b
10 changed files with 149 additions and 79 deletions

View File

@@ -40,7 +40,7 @@ enum RegStatus {
};
class TinyGsmBG96
class TinyGsmBG96 : public TinyGsmMasterModem
{
public:
@@ -206,7 +206,7 @@ public:
#else
TinyGsmBG96(Stream& stream)
#endif
: stream(stream)
: TinyGsmMasterModem(stream), stream(stream)
{
memset(sockets, 0, sizeof(sockets));
}
@@ -467,6 +467,10 @@ public:
return localIP() != 0;
}
/*
* IP Address functions
*/
String getLocalIP() {
sendAT(GF("+CGPADDR=1"));
if (waitResponse(10000L, GF(GSM_NL "+CGPADDR:")) != 1) {
@@ -480,10 +484,6 @@ public:
return res;
}
IPAddress localIP() {
return TinyGsmIpFromString(getLocalIP());
}
/*
* Messaging functions
*/