Skip to content

Commit ba41ff8

Browse files
committed
Handle MLME requests at the same place.
#606
1 parent fb90984 commit ba41ff8

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

src/mac/LoRaMac.c

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1600,14 +1600,21 @@ static void LoRaMacHandleMcpsRequest( void )
16001600
static void LoRaMacHandleJoinRequest( void )
16011601
{
16021602
// Handle join request
1603-
if( ( MacCtx.MacFlags.Bits.MlmeReq == 1 ) && ( LoRaMacConfirmQueueIsCmdActive( MLME_JOIN ) == true ) )
1603+
if( MacCtx.MacFlags.Bits.MlmeReq == 1 )
16041604
{
1605-
if( LoRaMacConfirmQueueGetStatus( MLME_JOIN ) == LORAMAC_EVENT_INFO_STATUS_OK )
1606-
{// Node joined successfully
1607-
LoRaMacResetFCnts( );
1608-
MacCtx.ChannelsNbTransCounter = 0;
1605+
if( ( LoRaMacConfirmQueueIsCmdActive( MLME_JOIN ) == true ) )
1606+
{
1607+
if( LoRaMacConfirmQueueGetStatus( MLME_JOIN ) == LORAMAC_EVENT_INFO_STATUS_OK )
1608+
{// Node joined successfully
1609+
MacCtx.ChannelsNbTransCounter = 0;
1610+
}
1611+
MacCtx.MacState &= ~LORAMAC_TX_RUNNING;
1612+
}
1613+
else if( ( LoRaMacConfirmQueueIsCmdActive( MLME_TXCW ) == true ) ||
1614+
( LoRaMacConfirmQueueIsCmdActive( MLME_TXCW_1 ) == true ) )
1615+
{
1616+
MacCtx.MacState &= ~LORAMAC_TX_RUNNING;
16091617
}
1610-
MacCtx.MacState &= ~LORAMAC_TX_RUNNING;
16111618
}
16121619
}
16131620

0 commit comments

Comments
 (0)