Browse Source

Get name from modem

v_master
Sara Damiano 5 years ago
parent
commit
9ce1a2d998
5 changed files with 49 additions and 9 deletions
  1. +1
    -1
      library.json
  2. +1
    -1
      library.properties
  3. +21
    -1
      src/TinyGsmClientSIM7000.h
  4. +25
    -5
      src/TinyGsmClientSIM800.h
  5. +1
    -1
      src/TinyGsmCommon.h

+ 1
- 1
library.json View File

@ -1,6 +1,6 @@
{
"name": "TinyGSM",
"version": "0.7.7",
"version": "0.7.8",
"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.7.7
version=0.7.8
author=Volodymyr Shymanskyy
maintainer=Volodymyr Shymanskyy
sentence=A small Arduino library for GPRS modules, that just works.


+ 21
- 1
src/TinyGsmClientSIM7000.h View File

@ -181,7 +181,27 @@ public:
}
String getModemName() {
return "SIMCom SIM7000";
String name = "SIMCom SIM7000";
sendAT(GF("+CGMI"));
String res1;
if (waitResponse(1000L, res1) != 1) {
return name;
}
res1.replace(GSM_NL "OK" GSM_NL, "");
res1.trim();
sendAT(GF("+GMM"));
String res2;
if (waitResponse(1000L, res2) != 1) {
return name;
}
res2.replace(GSM_NL "OK" GSM_NL, "");
res2.trim();
name = res1 + String(' ') + res2;
DBG("### Modem:", name);
return name;
}
TINY_GSM_MODEM_SET_BAUD_IPR()


+ 25
- 5
src/TinyGsmClientSIM800.h View File

@ -184,16 +184,36 @@ public:
}
String getModemName() {
String name = "";
#if defined(TINY_GSM_MODEM_SIM800)
return "SIMCom SIM800";
name = "SIMCom SIM800";
#elif defined(TINY_GSM_MODEM_SIM808)
return "SIMCom SIM808";
name = "SIMCom SIM808";
#elif defined(TINY_GSM_MODEM_SIM868)
return "SIMCom SIM868";
name = "SIMCom SIM868";
#elif defined(TINY_GSM_MODEM_SIM900)
return "SIMCom SIM900";
name = "SIMCom SIM900";
#endif
return "SIMCom SIM800";
sendAT(GF("+CGMI"));
String res1;
if (waitResponse(1000L, res1) != 1) {
return name;
}
res1.replace(GSM_NL "OK" GSM_NL, "");
res1.trim();
sendAT(GF("+GMM"));
String res2;
if (waitResponse(1000L, res2) != 1) {
return name;
}
res2.replace(GSM_NL "OK" GSM_NL, "");
res2.trim();
name = res1 + String(' ') + res2;
DBG("### Modem:", name);
return name;
}
TINY_GSM_MODEM_SET_BAUD_IPR()


+ 1
- 1
src/TinyGsmCommon.h View File

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


Loading…
Cancel
Save