You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LoRaMac.c static TimerTime_t SetNextChannel( void ) returns 0 even if no channels are supported, if nextTxDelay is never assigned a value after initialization:
if( nbEnabledChannels>0 )
{
Channel=enabledChannels[randr( 0, nbEnabledChannels-1 )];
#if defined( USE_BAND_915 ) || defined( USE_BAND_915_HYBRID )
DisableChannelInMask( Channel, ChannelsMaskRemaining );
#endifreturn0;
}
else
{
// Protect the function of returning the initialization value of nextTxDelayreturn ( nextTxDelay== ( TimerTime_t )( -1 ) ) ? 0 : nextTxDelay;
}
But if .TimeOff of all bands == 0 in the following...
...then nextTxDelay == ( TimerTime_t )( -1 ), and if nbEnabledChannels == 0, the function returns 0. This is problematic since ScheduleTx then calls SendFrameOnChannel using the current Channel value, even though no channels are currently enabled.
One quick fix would be for SetNextChannel to return ( TimerTime_t )( -1 ), and then have ScheduleTx check for this as an error. Any problems with this?
The text was updated successfully, but these errors were encountered:
thanks for the report. I see your point. We will provide an update in the next release. I'm not sure yet, which solution we apply. But I think your quick fix should work.
LoRaMac.c
static TimerTime_t SetNextChannel( void )
returns 0 even if no channels are supported, if nextTxDelay is never assigned a value after initialization:But if .TimeOff of all bands == 0 in the following...
...then nextTxDelay == ( TimerTime_t )( -1 ), and if nbEnabledChannels == 0, the function returns 0. This is problematic since ScheduleTx then calls SendFrameOnChannel using the current Channel value, even though no channels are currently enabled.
One quick fix would be for SetNextChannel to return ( TimerTime_t )( -1 ), and then have ScheduleTx check for this as an error. Any problems with this?
The text was updated successfully, but these errors were encountered: