From db6bb0e6c06f9b982bf838cde5eaa00a4e5e73be Mon Sep 17 00:00:00 2001 From: Sara Damiano Date: Fri, 24 May 2019 23:47:49 -0400 Subject: [PATCH] Fix ublox battery percent --- library.json | 2 +- library.properties | 2 +- src/TinyGsmClientUBLOX.h | 4 +++- src/TinyGsmCommon.h | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/library.json b/library.json index 2aaf99c..fb2fa8c 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "TinyGSM", - "version": "0.7.8", + "version": "0.7.9", "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": diff --git a/library.properties b/library.properties index 423a068..df969ab 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=TinyGSM -version=0.7.8 +version=0.7.9 author=Volodymyr Shymanskyy maintainer=Volodymyr Shymanskyy sentence=A small Arduino library for GPRS modules, that just works. diff --git a/src/TinyGsmClientUBLOX.h b/src/TinyGsmClientUBLOX.h index 08e3015..180615e 100644 --- a/src/TinyGsmClientUBLOX.h +++ b/src/TinyGsmClientUBLOX.h @@ -501,8 +501,10 @@ TINY_GSM_MODEM_GET_GPRS_IP_CONNECTED() } int res = stream.readStringUntil(',').toInt(); + int8_t percent = res*20; // return is 0-5 + // Wait for final OK waitResponse(); - return res; + return percent; } uint8_t getBattChargeState() TINY_GSM_ATTR_NOT_AVAILABLE; diff --git a/src/TinyGsmCommon.h b/src/TinyGsmCommon.h index 0b0a347..7b87633 100644 --- a/src/TinyGsmCommon.h +++ b/src/TinyGsmCommon.h @@ -10,7 +10,7 @@ #define TinyGsmCommon_h // The current library version number -#define TINYGSM_VERSION "0.7.8" +#define TINYGSM_VERSION "0.7.9" #if defined(SPARK) || defined(PARTICLE) #include "Particle.h"