Merge pull request #543 from FStefanni/master
Added ublox method to set technology + other minor improvements
This commit is contained in:
6
src/TinyGSM.h
Normal file
6
src/TinyGSM.h
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#ifndef TINYGSM_H
|
||||||
|
#define TINYGSM_H
|
||||||
|
|
||||||
|
#include "TinyGsmClient.h"
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -224,7 +224,6 @@ class TinyGsmUBLOX : public TinyGsmModem<TinyGsmUBLOX>,
|
|||||||
res2.trim();
|
res2.trim();
|
||||||
|
|
||||||
String name = res1 + String(' ') + res2;
|
String name = res1 + String(' ') + res2;
|
||||||
DBG("### Modem:", name);
|
|
||||||
if (name.startsWith("u-blox SARA-R4") ||
|
if (name.startsWith("u-blox SARA-R4") ||
|
||||||
name.startsWith("u-blox SARA-N4")) {
|
name.startsWith("u-blox SARA-N4")) {
|
||||||
DBG("### WARNING: You are using the wrong TinyGSM modem!");
|
DBG("### WARNING: You are using the wrong TinyGSM modem!");
|
||||||
@@ -272,6 +271,29 @@ class TinyGsmUBLOX : public TinyGsmModem<TinyGsmUBLOX>,
|
|||||||
return (RegStatus)getRegistrationStatusXREG("CGREG");
|
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:
|
protected:
|
||||||
bool isNetworkConnectedImpl() {
|
bool isNetworkConnectedImpl() {
|
||||||
RegStatus s = getRegistrationStatus();
|
RegStatus s = getRegistrationStatus();
|
||||||
@@ -774,7 +796,7 @@ class TinyGsmUBLOX : public TinyGsmModem<TinyGsmUBLOX>,
|
|||||||
if (len >= 0 && len <= 1024) { sockets[mux]->sock_available = len; }
|
if (len >= 0 && len <= 1024) { sockets[mux]->sock_available = len; }
|
||||||
}
|
}
|
||||||
data = "";
|
data = "";
|
||||||
DBG("### URC Data Received:", len, "on", mux);
|
//DBG("### URC Data Received:", len, "on", mux);
|
||||||
} else if (data.endsWith(GF("+UUSOCL:"))) {
|
} else if (data.endsWith(GF("+UUSOCL:"))) {
|
||||||
int8_t mux = streamGetIntBefore('\n');
|
int8_t mux = streamGetIntBefore('\n');
|
||||||
if (mux >= 0 && mux < TINY_GSM_MUX_COUNT && sockets[mux]) {
|
if (mux >= 0 && mux < TINY_GSM_MUX_COUNT && sockets[mux]) {
|
||||||
|
|||||||
Reference in New Issue
Block a user