Skip to content

Commit e3910af

Browse files
committed
Fix duty-cycle handling issue while activating the device without answer from the server.
Replace verification of join state in function CalculateBackOff and align it to the implementation in function ScheduleTx.
1 parent 82c2947 commit e3910af

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/mac/LoRaMac.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2397,11 +2397,8 @@ static LoRaMacStatus_t ScheduleTx( bool allowDelayedTx )
23972397
nextChan.Datarate = MacCtx.NvmCtx->MacParams.ChannelsDatarate;
23982398
nextChan.DutyCycleEnabled = MacCtx.NvmCtx->DutyCycleOn;
23992399
nextChan.QueryNextTxDelayOnly = false;
2400-
if( MacCtx.NvmCtx->NetworkActivation == ACTIVATION_TYPE_NONE )
2401-
{
2402-
nextChan.Joined = false;
2403-
}
2404-
else
2400+
nextChan.Joined = false;
2401+
if( MacCtx.NvmCtx->NetworkActivation != ACTIVATION_TYPE_NONE )
24052402
{
24062403
nextChan.Joined = true;
24072404
}
@@ -2534,7 +2531,8 @@ static void CalculateBackOff( uint8_t channel )
25342531
calcBackOff.ElapsedTime = SysTimeSub( SysTimeGetMcuTime( ), MacCtx.NvmCtx->InitializationTime );
25352532
calcBackOff.TxTimeOnAir = MacCtx.TxTimeOnAir;
25362533
calcBackOff.LastTxIsJoinRequest = false;
2537-
if( ( MacCtx.MacFlags.Bits.MlmeReq == 1 ) && ( LoRaMacConfirmQueueIsCmdActive( MLME_JOIN ) == true ) )
2534+
2535+
if( MacCtx.NvmCtx->NetworkActivation == ACTIVATION_TYPE_NONE )
25382536
{
25392537
calcBackOff.LastTxIsJoinRequest = true;
25402538
}

0 commit comments

Comments
 (0)