LRWN V1.1.0 LoRaMac.c Bug
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2017-04-03 1:55 AM
Posted on April 03, 2017 at 10:55
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
This discussion is locked. Please start a new topic to ask your question.
0 REPLIES 0
