From 58ff6b42dddb450890bb48e6383000106d7ed4ea Mon Sep 17 00:00:00 2001 From: Sara Damiano Date: Tue, 3 Sep 2019 13:24:52 -0400 Subject: [PATCH] Move up QIMODE and QIMUX --- src/TinyGsmClientM95.h | 24 ++++++++++++------------ src/TinyGsmClientMC60.h | 24 ++++++++++++------------ 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/TinyGsmClientM95.h b/src/TinyGsmClientM95.h index b0564ca..6ab855b 100644 --- a/src/TinyGsmClientM95.h +++ b/src/TinyGsmClientM95.h @@ -346,6 +346,18 @@ TINY_GSM_MODEM_WAIT_FOR_NETWORK() return false; } + // Select TCP/IP transfer mode - NOT transparent mode + sendAT(GF("+QIMODE=0")); + if (waitResponse() != 1) { + return false; + } + + // Enable multiple TCP/IP connections + sendAT(GF("+QIMUX=1")); + if (waitResponse() != 1) { + return false; + } + //Activate GPRS/CSD Context sendAT(GF("+QIACT")); if (waitResponse(60000L) != 1) { @@ -369,18 +381,6 @@ TINY_GSM_MODEM_WAIT_FOR_NETWORK() return false; } - // Select TCP/IP transfer mode - NOT transparent mode - sendAT(GF("+QIMODE=0")); - if (waitResponse() != 1) { - return false; - } - - //Enable multiple TCP/IP connections - sendAT(GF("+QIMUX=1")); - if (waitResponse() != 1) { - return false; - } - return true; } diff --git a/src/TinyGsmClientMC60.h b/src/TinyGsmClientMC60.h index 0b8bf9a..c474b91 100644 --- a/src/TinyGsmClientMC60.h +++ b/src/TinyGsmClientMC60.h @@ -358,6 +358,18 @@ TINY_GSM_MODEM_WAIT_FOR_NETWORK() return false; } + // Select TCP/IP transfer mode - NOT transparent mode + sendAT(GF("+QIMODE=0")); + if (waitResponse() != 1) { + return false; + } + + // Enable multiple TCP/IP connections + sendAT(GF("+QIMUX=1")); + if (waitResponse() != 1) { + return false; + } + //Activate GPRS/CSD Context sendAT(GF("+QIACT")); if (waitResponse(60000L) != 1) { @@ -381,18 +393,6 @@ TINY_GSM_MODEM_WAIT_FOR_NETWORK() return false; } - // Select TCP/IP transfer mode - NOT transparent mode - sendAT(GF("+QIMODE=0")); - if (waitResponse() != 1) { - return false; - } - - //Enable multiple TCP/IP connections - sendAT(GF("+QIMUX=1")); - if (waitResponse() != 1) { - return false; - } - return true; }