2017-04-03 01:55 AM
In function OnMacStateCheckTimerEvent there is a line:
LoRaMacParams.ChannelsDatarate = MAX( LoRaMacParams.ChannelsDatarate - 1, getPhy.Param.Value );
The problem is that
LoRaMacParams.ChannelsDatarate is an unsigned 8 bit integer that can take a value of 0, i.e. DR_0. So 0 - 1 results in an illegal value.
Needs a test for zero.
E.g. if (
LoRaMacParams.ChannelsDatarate == 0) {
LoRaMacParams.ChannelsDatarate =
getPhy.Param.Value;
}
else {
LoRaMacParams.ChannelsDatarate = MAX( LoRaMacParams.ChannelsDatarate - 1, getPhy.Param.Value );
}
Cheers
Ron