From 9f4b4fb2124319950a9b115d125bce978d5c7185 Mon Sep 17 00:00:00 2001 From: Frank Leon Rose Date: Mon, 17 Jun 2019 12:55:37 -0400 Subject: [PATCH] Fix failed attempts condition --- src/TheThingsNetwork.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TheThingsNetwork.cpp b/src/TheThingsNetwork.cpp index 8ae3933d..e06b7934 100644 --- a/src/TheThingsNetwork.cpp +++ b/src/TheThingsNetwork.cpp @@ -364,7 +364,7 @@ size_t TheThingsNetwork::readLine(char *buffer, size_t size, uint8_t attempts) { read = modemStream->readBytesUntil('\n', buffer, size); } - if (attempts<=0) + if (!read) { // If attempts is activated return 0 and set RN state marker this->needsHardReset = true; // Inform the application about the radio module is not responsive. debugPrintLn("No response from RN module.");