Rename so *I* don't screw them up
Signed-off-by: Sara Damiano <sdamiano@stroudcenter.org>
This commit is contained in:
@@ -428,7 +428,7 @@ class TinyGsmSim5360 : public TinyGsmModem<TinyGsmSim5360>,
|
||||
streamSkipUntil(','); // Skip battery charge status
|
||||
streamSkipUntil(','); // Skip battery charge level
|
||||
// get voltage in VOLTS
|
||||
float voltage = streamGetFloat('\n');
|
||||
float voltage = streamGetFloatBefore('\n');
|
||||
// Wait for final OK
|
||||
waitResponse();
|
||||
// Return millivolts
|
||||
@@ -441,10 +441,10 @@ class TinyGsmSim5360 : public TinyGsmModem<TinyGsmSim5360>,
|
||||
uint16_t& milliVolts) {
|
||||
sendAT(GF("+CBC"));
|
||||
if (waitResponse(GF(GSM_NL "+CBC:")) != 1) { return false; }
|
||||
chargeState = streamGetInt(',');
|
||||
percent = streamGetInt(',');
|
||||
chargeState = streamGetIntBefore(',');
|
||||
percent = streamGetIntBefore(',');
|
||||
// get voltage in VOLTS
|
||||
float voltage = streamGetFloat('\n');
|
||||
float voltage = streamGetFloatBefore('\n');
|
||||
milliVolts = voltage * 1000;
|
||||
// Wait for final OK
|
||||
waitResponse();
|
||||
@@ -463,7 +463,7 @@ class TinyGsmSim5360 : public TinyGsmModem<TinyGsmSim5360>,
|
||||
// Get Temparature Value
|
||||
sendAT(GF("+CMTE?"));
|
||||
if (waitResponse(GF(GSM_NL "+CMTE:")) != 1) { return false; }
|
||||
float res = streamGetFloat('\n');
|
||||
float res = streamGetFloatBefore('\n');
|
||||
// Wait for final OK
|
||||
waitResponse();
|
||||
return res;
|
||||
@@ -498,7 +498,7 @@ class TinyGsmSim5360 : public TinyGsmModem<TinyGsmSim5360>,
|
||||
streamSkipUntil(','); // Skip mux
|
||||
streamSkipUntil(','); // Skip requested bytes to send
|
||||
// TODO(?): make sure requested and confirmed bytes match
|
||||
return streamGetInt('\n');
|
||||
return streamGetIntBefore('\n');
|
||||
}
|
||||
|
||||
size_t modemRead(size_t size, uint8_t mux) {
|
||||
@@ -511,9 +511,9 @@ class TinyGsmSim5360 : public TinyGsmModem<TinyGsmSim5360>,
|
||||
#endif
|
||||
streamSkipUntil(','); // Skip Rx mode 2/normal or 3/HEX
|
||||
streamSkipUntil(','); // Skip mux/cid (connecion id)
|
||||
int16_t len_requested = streamGetInt(',');
|
||||
int16_t len_requested = streamGetIntBefore(',');
|
||||
// ^^ Requested number of data bytes (1-1460 bytes)to be read
|
||||
int16_t len_confirmed = streamGetInt('\n');
|
||||
int16_t len_confirmed = streamGetIntBefore('\n');
|
||||
// ^^ The data length which not read in the buffer
|
||||
for (int i = 0; i < len_requested; i++) {
|
||||
uint32_t startMillis = millis();
|
||||
@@ -550,7 +550,7 @@ class TinyGsmSim5360 : public TinyGsmModem<TinyGsmSim5360>,
|
||||
if (waitResponse(GF("+CIPRXGET:")) == 1) {
|
||||
streamSkipUntil(','); // Skip mode 4
|
||||
streamSkipUntil(','); // Skip mux
|
||||
result = streamGetInt('\n');
|
||||
result = streamGetIntBefore('\n');
|
||||
waitResponse();
|
||||
}
|
||||
DBG("### Available:", result, "on", mux);
|
||||
@@ -615,9 +615,9 @@ class TinyGsmSim5360 : public TinyGsmModem<TinyGsmSim5360>,
|
||||
index = 5;
|
||||
goto finish;
|
||||
} else if (data.endsWith(GF(GSM_NL "+CIPRXGET:"))) {
|
||||
int8_t mode = streamGetInt(',');
|
||||
int8_t mode = streamGetIntBefore(',');
|
||||
if (mode == 1) {
|
||||
int8_t mux = streamGetInt('\n');
|
||||
int8_t mux = streamGetIntBefore('\n');
|
||||
if (mux >= 0 && mux < TINY_GSM_MUX_COUNT && sockets[mux]) {
|
||||
sockets[mux]->got_data = true;
|
||||
}
|
||||
@@ -627,8 +627,8 @@ class TinyGsmSim5360 : public TinyGsmModem<TinyGsmSim5360>,
|
||||
data += mode;
|
||||
}
|
||||
} else if (data.endsWith(GF(GSM_NL "+RECEIVE:"))) {
|
||||
int8_t mux = streamGetInt(',');
|
||||
int16_t len = streamGetInt('\n');
|
||||
int8_t mux = streamGetIntBefore(',');
|
||||
int16_t len = streamGetIntBefore('\n');
|
||||
if (mux >= 0 && mux < TINY_GSM_MUX_COUNT && sockets[mux]) {
|
||||
sockets[mux]->got_data = true;
|
||||
sockets[mux]->sock_available = len;
|
||||
@@ -636,7 +636,7 @@ class TinyGsmSim5360 : public TinyGsmModem<TinyGsmSim5360>,
|
||||
data = "";
|
||||
DBG("### Got Data:", len, "on", mux);
|
||||
} else if (data.endsWith(GF("+IPCLOSE:"))) {
|
||||
int8_t mux = streamGetInt(',');
|
||||
int8_t mux = streamGetIntBefore(',');
|
||||
streamSkipUntil('\n'); // Skip the reason code
|
||||
if (mux >= 0 && mux < TINY_GSM_MUX_COUNT && sockets[mux]) {
|
||||
sockets[mux]->sock_connected = false;
|
||||
|
||||
Reference in New Issue
Block a user