File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
src/apps/LoRaMac/common/LmHandler/packages Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ typedef struct LmhpClockSyncState_s
5353 bool AppTimeReqPending ;
5454 bool AdrEnabledPrev ;
5555 uint8_t NbTransPrev ;
56+ uint8_t DataratePrev ;
5657}LmhpClockSyncState_t ;
5758
5859typedef enum LmhpClockSyncMoteCmd_e
@@ -201,6 +202,11 @@ static void LmhpClockSyncOnMcpsConfirm( McpsConfirm_t *mcpsConfirm )
201202 mibReq .Param .ChannelsNbTrans = LmhpClockSyncState .NbTransPrev ;
202203 LoRaMacMibSetRequestConfirm ( & mibReq );
203204
205+ // Revert data rate setting
206+ mibReq .Type = MIB_CHANNELS_DATARATE ;
207+ mibReq .Param .ChannelsDatarate = LmhpClockSyncState .DataratePrev ;
208+ LoRaMacMibSetRequestConfirm ( & mibReq );
209+
204210 LmhpClockSyncState .AppTimeReqPending = false;
205211 }
206212}
@@ -315,6 +321,11 @@ LmHandlerErrorStatus_t LmhpClockSyncAppTimeReq( void )
315321 mibReq .Param .ChannelsNbTrans = 1 ;
316322 LoRaMacMibSetRequestConfirm ( & mibReq );
317323
324+ // Store data rate
325+ mibReq .Type = MIB_CHANNELS_DATARATE ;
326+ LoRaMacMibGetRequestConfirm ( & mibReq );
327+ LmhpClockSyncState .DataratePrev = mibReq .Param .ChannelsDatarate ;
328+
318329 // Add DeviceTimeReq MAC command.
319330 // In case the network server supports this more precise command
320331 // this package will use DeviceTimeAns answer as clock synchronization
You can’t perform that action at this time.
0 commit comments