File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -5700,3 +5700,21 @@ LoRaMacStatus_t LoRaMacDeInitialization( void )
57005700 return LORAMAC_STATUS_BUSY ;
57015701 }
57025702}
5703+
5704+ void LoRaMacReset ( void )
5705+ {
5706+ // Reset state machine
5707+ MacCtx .MacState &= ~LORAMAC_TX_RUNNING ;
5708+ MacCtx .MacFlags .Bits .MacDone = 1 ;
5709+
5710+ // Stop Timers
5711+ TimerStop ( & MacCtx .TxDelayedTimer );
5712+ TimerStop ( & MacCtx .RxWindowTimer1 );
5713+ TimerStop ( & MacCtx .RxWindowTimer2 );
5714+
5715+ // Stop retransmissions
5716+ MacCtx .ChannelsNbTransCounter = Nvm .MacGroup2 .MacParams .ChannelsNbTrans ;
5717+
5718+ // Inform application layer
5719+ OnMacProcessNotify ( );
5720+ }
Original file line number Diff line number Diff line change @@ -2921,6 +2921,13 @@ LoRaMacStatus_t LoRaMacMcpsRequest( McpsReq_t* mcpsRequest );
29212921 */
29222922LoRaMacStatus_t LoRaMacDeInitialization ( void );
29232923
2924+ /*!
2925+ * \brief Resets the internal state machine.
2926+ *
2927+ * \details Resets the internal state machine to force the MAC to finalize a procedure.
2928+ */
2929+ void LoRaMacReset ( void );
2930+
29242931/*! \} defgroup LORAMAC */
29252932
29262933#ifdef __cplusplus
You can’t perform that action at this time.
0 commit comments