Skip to content

Commit ca07cad

Browse files
Merge pull request #224 from TheThingsNetwork/fix/sleep-overflow
Fix sleep time overflow
2 parents 3c38c7b + adc4111 commit ca07cad

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/TheThingsNetwork.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,7 @@ bool TheThingsNetwork::sendPayload(uint8_t mode, uint8_t port, uint8_t *payload,
944944

945945
void TheThingsNetwork::sleep(uint32_t mseconds)
946946
{
947-
if (mseconds < 100 || mseconds >= 4294967296)
947+
if (mseconds < 100)
948948
{
949949
return;
950950
}
@@ -953,7 +953,7 @@ void TheThingsNetwork::sleep(uint32_t mseconds)
953953
sendCommand(SYS_TABLE, SYS_PREFIX, true);
954954
sendCommand(SYS_TABLE, SYS_SLEEP, true);
955955

956-
sprintf(buffer, "%ld", mseconds);
956+
sprintf(buffer, "%lu", mseconds);
957957
modemStream->write(buffer);
958958
modemStream->write(SEND_MSG);
959959
debugPrintLn(buffer);

0 commit comments

Comments
 (0)