Skip to content

Commit 823a3fd

Browse files
Daniel Jaecklemluis1
authored andcommitted
Issue #879 - Revert changes from commit 9254748
The MacCtx.ChannelsNbTransCounter must be reset to 0, otherwise the next data transmission will be treated as a re-transmission which leads to a decrement of the frame counter.
1 parent 8615bc9 commit 823a3fd

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/mac/LoRaMac.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1620,9 +1620,16 @@ static void LoRaMacHandleMlmeRequest( void )
16201620
// Handle join request
16211621
if( MacCtx.MacFlags.Bits.MlmeReq == 1 )
16221622
{
1623-
if( ( LoRaMacConfirmQueueIsCmdActive( MLME_JOIN ) == true ) ||
1624-
( LoRaMacConfirmQueueIsCmdActive( MLME_TXCW ) == true ) ||
1625-
( LoRaMacConfirmQueueIsCmdActive( MLME_TXCW_1 ) == true ) )
1623+
if( LoRaMacConfirmQueueIsCmdActive( MLME_JOIN ) == true )
1624+
{
1625+
if( LoRaMacConfirmQueueGetStatus( MLME_JOIN ) == LORAMAC_EVENT_INFO_STATUS_OK )
1626+
{// Node joined successfully
1627+
MacCtx.ChannelsNbTransCounter = 0;
1628+
}
1629+
MacCtx.MacState &= ~LORAMAC_TX_RUNNING;
1630+
}
1631+
else if( ( LoRaMacConfirmQueueIsCmdActive( MLME_TXCW ) == true ) ||
1632+
( LoRaMacConfirmQueueIsCmdActive( MLME_TXCW_1 ) == true ) )
16261633
{
16271634
MacCtx.MacState &= ~LORAMAC_TX_RUNNING;
16281635
}

0 commit comments

Comments
 (0)