File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -1699,11 +1699,10 @@ static void OnMacStateCheckTimerEvent( void )
16991699 {
17001700 LoRaMacParams .ChannelsDatarate = MAX ( LoRaMacParams .ChannelsDatarate - 1 , LORAMAC_TX_MIN_DATARATE );
17011701 }
1702- if ( ValidatePayloadLength ( LoRaMacTxPayloadLen , LoRaMacParams .ChannelsDatarate , MacCommandsBufferIndex ) == true )
1702+ // Try to send the frame again
1703+ if ( ScheduleTx ( ) == LORAMAC_STATUS_OK )
17031704 {
17041705 LoRaMacFlags .Bits .MacDone = 0 ;
1705- // Sends the same frame again
1706- ScheduleTx ( );
17071706 }
17081707 else
17091708 {
@@ -1769,6 +1768,8 @@ static void OnMacStateCheckTimerEvent( void )
17691768 LoRaMacFlags .Bits .MlmeReq = 0 ;
17701769 }
17711770
1771+ // Procedure done. Reset variables.
1772+ MacCommandsBufferIndex = 0 ;
17721773 LoRaMacFlags .Bits .MacDone = 0 ;
17731774 }
17741775 else
@@ -2902,10 +2903,6 @@ static LoRaMacStatus_t ScheduleTx( void )
29022903 RxWindow2Delay = LoRaMacParams .ReceiveDelay2 + RxWindowsParams [1 ].RxOffset ;
29032904 }
29042905
2905- // MacCommandsBufferIndex variable is reset here because we now have
2906- // managed all uplink & downlink parameters.
2907- MacCommandsBufferIndex = 0 ;
2908-
29092906 // Schedule transmission of frame
29102907 if ( dutyCycleTimeOff == 0 )
29112908 {
You can’t perform that action at this time.
0 commit comments