Browse Source

Close 5360 sockets cleanly

v_master
Sara Damiano 5 years ago
parent
commit
9f359eac91
5 changed files with 13 additions and 8 deletions
  1. +1
    -1
      .github/ISSUE_TEMPLATE.md
  2. +1
    -1
      library.json
  3. +1
    -1
      library.properties
  4. +9
    -4
      src/TinyGsmClientSIM5360.h
  5. +1
    -1
      src/TinyGsmCommon.h

+ 1
- 1
.github/ISSUE_TEMPLATE.md View File

@ -23,7 +23,7 @@ with your board before submitting any issues.
Main processor board: <!-- Uno, Zero, ESP32, Particle, etc -->
Modem: <!-- Brand, model, variant, firmware version -->
TinyGSM version: <!-- always try to use the latest (0.9.4) -->
TinyGSM version: <!-- always try to use the latest (0.9.5) -->
Code: <!-- Example name or paste in your code -->
### Scenario, steps to reproduce


+ 1
- 1
library.json View File

@ -1,6 +1,6 @@
{
"name": "TinyGSM",
"version": "0.9.4",
"version": "0.9.5",
"description": "A small Arduino library for GPRS modules, that just works. Includes examples for Blynk, MQTT, File Download, and Web Client. Supports many GSM, LTE, and WiFi modules with AT command interfaces.",
"keywords": "GSM, AT commands, AT, SIM800, SIM900, A6, A7, M590, ESP8266, SIM7000, SIM800A, SIM800C, SIM800L, SIM800H, SIM808, SIM868, SIM900A, SIM900D, SIM908, SIM968, M95, MC60, MC60E, BG96, ublox, Quectel, SIMCOM, AI Thinker, LTE, LTE-M",
"authors":


+ 1
- 1
library.properties View File

@ -1,5 +1,5 @@
name=TinyGSM
version=0.9.4
version=0.9.5
author=Volodymyr Shymanskyy
maintainer=Volodymyr Shymanskyy
sentence=A small Arduino library for GPRS modules, that just works.


+ 9
- 4
src/TinyGsmClientSIM5360.h View File

@ -400,6 +400,13 @@ TINY_GSM_MODEM_WAIT_FOR_NETWORK()
}
bool gprsDisconnect() {
// Close any open sockets
for (int mux = 0; mux < TINY_GSM_MUX_COUNT; mux++) {
GsmClient *sock = sockets[mux];
if (sock) {
sock->stop();
}
}
// Stop the socket service
// Note: all sockets should be closed first
@ -422,13 +429,11 @@ TINY_GSM_MODEM_WAIT_FOR_NETWORK()
bool isGprsConnected() {
sendAT(GF("+NETOPEN?"));
if (waitResponse(GF(GSM_NL "+NETOPEN:")) != 1) {
// May return +NETOPEN: 1, 0. We just confirm that the first number is 1
if (waitResponse(GF(GSM_NL "+NETOPEN: 1")) != 1) {
return false;
}
int res = stream.readStringUntil('\n').toInt();
waitResponse();
if (res != 1)
return false;
sendAT(GF("+IPADDR")); // Inquire Socket PDP address
// sendAT(GF("+CGPADDR=1")); // Show PDP address


+ 1
- 1
src/TinyGsmCommon.h View File

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


Loading…
Cancel
Save