Replace *most* toInt and toFloat's
Signed-off-by: Sara Damiano <sdamiano@stroudcenter.org>
This commit is contained in:
@@ -517,7 +517,7 @@ class TinyGsmSequansMonarch
|
||||
sendAT(GF("+SQNSRECV="), mux, ',', (uint16_t)size);
|
||||
if (waitResponse(GF("+SQNSRECV: ")) != 1) { return 0; }
|
||||
streamSkipUntil(','); // Skip mux
|
||||
int len = stream.readStringUntil('\n').toInt();
|
||||
int len = streamGetInt('\n');
|
||||
for (int i = 0; i < len; i++) {
|
||||
uint32_t startMillis = millis();
|
||||
while (!stream.available() &&
|
||||
@@ -538,10 +538,10 @@ class TinyGsmSequansMonarch
|
||||
sendAT(GF("+SQNSI="), mux);
|
||||
size_t result = 0;
|
||||
if (waitResponse(GF("+SQNSI:")) == 1) {
|
||||
streamSkipUntil(','); // Skip mux
|
||||
streamSkipUntil(','); // Skip total sent
|
||||
streamSkipUntil(','); // Skip total received
|
||||
result = stream.readStringUntil(',').toInt(); // keep data not yet read
|
||||
streamSkipUntil(','); // Skip mux
|
||||
streamSkipUntil(','); // Skip total sent
|
||||
streamSkipUntil(','); // Skip total received
|
||||
result = streamGetInt(','); // keep data not yet read
|
||||
waitResponse();
|
||||
}
|
||||
DBG("### Available:", result, "on", mux);
|
||||
@@ -555,7 +555,7 @@ class TinyGsmSequansMonarch
|
||||
for (int muxNo = 1; muxNo <= TINY_GSM_MUX_COUNT; muxNo++) {
|
||||
if (waitResponse(GFP(GSM_OK), GF(GSM_NL "+SQNSS: ")) != 2) { break; }
|
||||
uint8_t status = 0;
|
||||
// if (stream.readStringUntil(',').toInt() != muxNo) { // check the mux no
|
||||
// if (streamGetInt(',') != muxNo) { // check the mux no
|
||||
// DBG("### Warning: misaligned mux numbers!");
|
||||
// }
|
||||
streamSkipUntil(','); // skip mux [use muxNo]
|
||||
@@ -623,8 +623,8 @@ class TinyGsmSequansMonarch
|
||||
index = 5;
|
||||
goto finish;
|
||||
} else if (data.endsWith(GF(GSM_NL "+SQNSRING:"))) {
|
||||
int mux = stream.readStringUntil(',').toInt();
|
||||
int len = stream.readStringUntil('\n').toInt();
|
||||
int mux = streamGetInt(',');
|
||||
int len = streamGetInt('\n');
|
||||
if (mux >= 0 && mux < TINY_GSM_MUX_COUNT &&
|
||||
sockets[mux % TINY_GSM_MUX_COUNT]) {
|
||||
sockets[mux % TINY_GSM_MUX_COUNT]->got_data = true;
|
||||
@@ -633,7 +633,7 @@ class TinyGsmSequansMonarch
|
||||
data = "";
|
||||
DBG("### URC Data Received:", len, "on", mux);
|
||||
} else if (data.endsWith(GF("SQNSH: "))) {
|
||||
int mux = stream.readStringUntil('\n').toInt();
|
||||
int mux = streamGetInt('\n');
|
||||
if (mux >= 0 && mux < TINY_GSM_MUX_COUNT &&
|
||||
sockets[mux % TINY_GSM_MUX_COUNT]) {
|
||||
sockets[mux % TINY_GSM_MUX_COUNT]->sock_connected = false;
|
||||
|
||||
Reference in New Issue
Block a user