Refixed the CBC error found by @VinceKezel

Signed-off-by: Sara Damiano <sdamiano@stroudcenter.org>
This commit is contained in:
Sara Damiano
2020-02-07 13:42:26 -05:00
parent 0a0e66dc94
commit efb6450045
4 changed files with 8 additions and 4 deletions

View File

@@ -1136,7 +1136,7 @@ class TinyGsmModem {
}
uint8_t getBattChargeStateImpl() {
thisModem().sendAT(GF("+CBC?"));
thisModem().sendAT(GF("+CBC"));
if (thisModem().waitResponse(GF("+CBC:")) != 1) { return false; }
// Read battery charge status
int res = thisModem().stream.readStringUntil(',').toInt();
@@ -1147,7 +1147,7 @@ class TinyGsmModem {
bool getBattStatsImpl(uint8_t& chargeState, int8_t& percent,
uint16_t& milliVolts) {
thisModem().sendAT(GF("+CBC?"));
thisModem().sendAT(GF("+CBC"));
if (thisModem().waitResponse(GF("+CBC:")) != 1) { return false; }
chargeState = thisModem().stream.readStringUntil(',').toInt();
percent = thisModem().stream.readStringUntil(',').toInt();