mirror of
https://github.com/KevinMidboe/TinyGSM.git
synced 2025-10-29 18:00:18 +00:00
made sequans virtual
This commit is contained in:
@@ -243,17 +243,15 @@ public:
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
TinyGsmSequansMonarch(Stream& stream)
|
TinyGsmSequansMonarch(Stream& stream)
|
||||||
: stream(stream)
|
: TinyGsmModem(stream), stream(stream)
|
||||||
{
|
{
|
||||||
memset(sockets, 0, sizeof(sockets));
|
memset(sockets, 0, sizeof(sockets));
|
||||||
}
|
}
|
||||||
|
virtual ~TinyGsmSequansMonarch() {}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Basic functions
|
* Basic functions
|
||||||
*/
|
*/
|
||||||
bool begin() {
|
|
||||||
return init();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool init() {
|
bool init() {
|
||||||
DBG(GF("### TinyGSM Version:"), TINYGSM_VERSION);
|
DBG(GF("### TinyGSM Version:"), TINYGSM_VERSION);
|
||||||
@@ -472,16 +470,6 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool waitForNetwork(unsigned long timeout = 60000L) {
|
|
||||||
for (unsigned long start = millis(); millis() - start < timeout; ) {
|
|
||||||
if (isNetworkConnected()) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
delay(250);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* GPRS functions
|
* GPRS functions
|
||||||
*/
|
*/
|
||||||
@@ -542,10 +530,6 @@ public:
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
IPAddress localIP() {
|
|
||||||
return TinyGsmIpFromString(getLocalIP());
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Phone Call functions
|
* Phone Call functions
|
||||||
*/
|
*/
|
||||||
@@ -710,31 +694,6 @@ public:
|
|||||||
|
|
||||||
/* Utilities */
|
/* Utilities */
|
||||||
|
|
||||||
bool commandMode(int retries = 2) {
|
|
||||||
streamWrite(GF("+++")); // enter command mode
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
void streamWrite(T last) {
|
|
||||||
stream.print(last);
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T, typename... Args>
|
|
||||||
void streamWrite(T head, Args... tail) {
|
|
||||||
stream.print(head);
|
|
||||||
streamWrite(tail...);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool streamSkipUntil(char c) { //TODO: timeout
|
|
||||||
while (true) {
|
|
||||||
while (!stream.available()) { TINY_GSM_YIELD(); }
|
|
||||||
if (stream.read() == c)
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename... Args>
|
template<typename... Args>
|
||||||
void sendAT(Args... cmd) {
|
void sendAT(Args... cmd) {
|
||||||
streamWrite("AT", cmd..., '\r');
|
streamWrite("AT", cmd..., '\r');
|
||||||
|
|||||||
Reference in New Issue
Block a user