Sodaq_RN2483
Sodaq_RN2483 copied to clipboard
sendReqAck not working if ACK contains empty payload
I believe there is a bug when using sendReqAck if an empty ACK packet is received from the network.
In Sodaq_RN2483::onMacRC()
if the ACK packet doesn't contain any payload the last token will be a NULL pointer and subsequently _inputBuffer[inputIndex]
will fail.
I propose to add a NULL check after the last strtok and return NoError in such cases.
// payload
token = strtok(NULL, " "); // until end of string
if (!token) {
debugPrintLn("[onMacRX]: packet contains no payload.");
return NoError;
}