Skip to content

Commit e8db3d9

Browse files
Merge pull request #256 from Teralytic/fix-readline-attempts
Fix `readLine`'s `needsHardReset` condition
2 parents 3164696 + 9f4b4fb commit e8db3d9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/TheThingsNetwork.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ size_t TheThingsNetwork::readLine(char *buffer, size_t size, uint8_t attempts)
364364
{
365365
read = modemStream->readBytesUntil('\n', buffer, size);
366366
}
367-
if (attempts<=0)
367+
if (!read)
368368
{ // If attempts is activated return 0 and set RN state marker
369369
this->needsHardReset = true; // Inform the application about the radio module is not responsive.
370370
debugPrintLn("No response from RN module.");

0 commit comments

Comments
 (0)