From a0d246be80b5646e6f0c8fa9d3c2aa01d969a53a Mon Sep 17 00:00:00 2001 From: Francesco Stefanni Date: Fri, 30 Apr 2021 09:14:43 +0200 Subject: [PATCH] Added ublox method to set technology Added missing TinyGSM.h --- src/TinyGSM.h | 6 ++++++ src/TinyGsmClientUBLOX.h | 26 ++++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 src/TinyGSM.h diff --git a/src/TinyGSM.h b/src/TinyGSM.h new file mode 100644 index 0000000..850e346 --- /dev/null +++ b/src/TinyGSM.h @@ -0,0 +1,6 @@ +#ifndef TINYGSM_H +#define TINYGSM_H + +#include "TinyGsmClient.h" + +#endif diff --git a/src/TinyGsmClientUBLOX.h b/src/TinyGsmClientUBLOX.h index 6a95a6d..da547b2 100644 --- a/src/TinyGsmClientUBLOX.h +++ b/src/TinyGsmClientUBLOX.h @@ -224,7 +224,6 @@ class TinyGsmUBLOX : public TinyGsmModem, res2.trim(); String name = res1 + String(' ') + res2; - DBG("### Modem:", name); if (name.startsWith("u-blox SARA-R4") || name.startsWith("u-blox SARA-N4")) { DBG("### WARNING: You are using the wrong TinyGSM modem!"); @@ -272,6 +271,29 @@ class TinyGsmUBLOX : public TinyGsmModem, return (RegStatus)getRegistrationStatusXREG("CGREG"); } + bool setRadioAccessTecnology(int selected) { + // selected: + // 0: GSM / GPRS / eGPRS (single mode) + // 1: GSM / UMTS (dual mode) + // 2: UMTS (single mode) + // 3: LTE (single mode) + // 4: GSM / UMTS / LTE (tri mode) + // 5: GSM / LTE (dual mode) + // 6: UMTS / LTE (dual mode) + // preferred: + // 0: GSM / GPRS / eGPRS + // 2: UTRAN + // 3: LTE + sendAT(GF("+URAT="), selected, GF(","), preferred); + if (waitResponse() != 1) { return false; } + return true; + } + + bool getCurrentRadioAccessTecnology(int & selected) { + // @TODO + return false; + } + protected: bool isNetworkConnectedImpl() { RegStatus s = getRegistrationStatus(); @@ -774,7 +796,7 @@ class TinyGsmUBLOX : public TinyGsmModem, if (len >= 0 && len <= 1024) { sockets[mux]->sock_available = len; } } data = ""; - DBG("### URC Data Received:", len, "on", mux); + //DBG("### URC Data Received:", len, "on", mux); } else if (data.endsWith(GF("+UUSOCL:"))) { int8_t mux = streamGetIntBefore('\n'); if (mux >= 0 && mux < TINY_GSM_MUX_COUNT && sockets[mux]) {