Skip to content

Commit

Permalink
Handle MLME requests at the same place.
Browse files Browse the repository at this point in the history
  • Loading branch information
mluis1 committed Jun 7, 2019
1 parent fb90984 commit ba41ff8
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/mac/LoRaMac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1600,14 +1600,21 @@ static void LoRaMacHandleMcpsRequest( void )
static void LoRaMacHandleJoinRequest( void )
{
// Handle join request
if( ( MacCtx.MacFlags.Bits.MlmeReq == 1 ) && ( LoRaMacConfirmQueueIsCmdActive( MLME_JOIN ) == true ) )
if( MacCtx.MacFlags.Bits.MlmeReq == 1 )
{
if( LoRaMacConfirmQueueGetStatus( MLME_JOIN ) == LORAMAC_EVENT_INFO_STATUS_OK )
{// Node joined successfully
LoRaMacResetFCnts( );
MacCtx.ChannelsNbTransCounter = 0;
if( ( LoRaMacConfirmQueueIsCmdActive( MLME_JOIN ) == true ) )
{
if( LoRaMacConfirmQueueGetStatus( MLME_JOIN ) == LORAMAC_EVENT_INFO_STATUS_OK )
{// Node joined successfully
MacCtx.ChannelsNbTransCounter = 0;
}
MacCtx.MacState &= ~LORAMAC_TX_RUNNING;
}
else if( ( LoRaMacConfirmQueueIsCmdActive( MLME_TXCW ) == true ) ||
( LoRaMacConfirmQueueIsCmdActive( MLME_TXCW_1 ) == true ) )
{
MacCtx.MacState &= ~LORAMAC_TX_RUNNING;
}
MacCtx.MacState &= ~LORAMAC_TX_RUNNING;
}
}

Expand Down

0 comments on commit ba41ff8

Please sign in to comment.