Fix QIRDI

This commit is contained in:
Sara Damiano
2019-09-06 15:09:49 -04:00
parent f3079d1b42
commit c83063fa5d
6 changed files with 18 additions and 16 deletions

View File

@@ -340,12 +340,6 @@ TINY_GSM_MODEM_WAIT_FOR_NETWORK()
return false;
}
//Start TCPIP Task and Set APN, User Name and Password
sendAT("+QIREGAPP=\"", apn, "\",\"", user, "\",\"", pwd, "\"" );
if (waitResponse() != 1) {
return false;
}
// Select TCP/IP transfer mode - NOT transparent mode
sendAT(GF("+QIMODE=0"));
if (waitResponse() != 1) {
@@ -358,6 +352,12 @@ TINY_GSM_MODEM_WAIT_FOR_NETWORK()
return false;
}
//Start TCPIP Task and Set APN, User Name and Password
sendAT("+QIREGAPP=\"", apn, "\",\"", user, "\",\"", pwd, "\"" );
if (waitResponse() != 1) {
return false;
}
//Activate GPRS/CSD Context
sendAT(GF("+QIACT"));
if (waitResponse(60000L) != 1) {
@@ -727,6 +727,7 @@ TINY_GSM_MODEM_STREAM_UTILITIES()
if (mux >= 0 && mux < TINY_GSM_MUX_COUNT && sockets[mux]) {
sockets[mux]->got_data = true;
}
data = "";
} else if (data.endsWith(GF("CLOSED" GSM_NL))) {
int nl = data.lastIndexOf(GSM_NL, data.length()-8);
int coma = data.indexOf(',', nl+2);

View File

@@ -352,12 +352,6 @@ TINY_GSM_MODEM_WAIT_FOR_NETWORK()
sendAT(GF("+CGACT=1,1"));
waitResponse(60000L);
//Start TCPIP Task and Set APN, User Name and Password
sendAT("+QIREGAPP=\"", apn, "\",\"", user, "\",\"", pwd, "\"" );
if (waitResponse() != 1) {
return false;
}
// Select TCP/IP transfer mode - NOT transparent mode
sendAT(GF("+QIMODE=0"));
if (waitResponse() != 1) {
@@ -370,6 +364,12 @@ TINY_GSM_MODEM_WAIT_FOR_NETWORK()
return false;
}
//Start TCPIP Task and Set APN, User Name and Password
sendAT("+QIREGAPP=\"", apn, "\",\"", user, "\",\"", pwd, "\"" );
if (waitResponse() != 1) {
return false;
}
//Activate GPRS/CSD Context
sendAT(GF("+QIACT"));
if (waitResponse(60000L) != 1) {
@@ -732,6 +732,7 @@ TINY_GSM_MODEM_STREAM_UTILITIES()
if (mux >= 0 && mux < TINY_GSM_MUX_COUNT && sockets[mux]) {
sockets[mux]->got_data = true;
}
data = "";
} else if (data.endsWith(GF("CLOSED" GSM_NL))) {
int nl = data.lastIndexOf(GSM_NL, data.length()-8);
int coma = data.indexOf(',', nl+2);

View File

@@ -10,7 +10,7 @@
#define TinyGsmCommon_h
// The current library version number
#define TINYGSM_VERSION "0.9.13"
#define TINYGSM_VERSION "0.9.14"
#if defined(SPARK) || defined(PARTICLE)
#include "Particle.h"