File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
src/apps/LoRaMac/common/LmHandler Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -660,13 +660,19 @@ LmHandlerErrorStatus_t LmHandlerRequestClass( DeviceClass_t newClass )
660660 break ;
661661 case CLASS_B :
662662 {
663- if ( currentClass != CLASS_A )
663+ if ( IsClassBSwitchPending == false )
664664 {
665- errorStatus = LORAMAC_HANDLER_ERROR ;
665+ if ( currentClass != CLASS_A )
666+ {
667+ errorStatus = LORAMAC_HANDLER_ERROR ;
668+ }
669+ // Beacon must first be acquired
670+ errorStatus = LmHandlerDeviceTimeReq ( );
671+ if ( errorStatus == LORAMAC_HANDLER_SUCCESS )
672+ {
673+ IsClassBSwitchPending = true;
674+ }
666675 }
667- // Beacon must first be acquired
668- errorStatus = LmHandlerDeviceTimeReq ( );
669- IsClassBSwitchPending = true;
670676 }
671677 break ;
672678 case CLASS_C :
You can’t perform that action at this time.
0 commit comments