diff --git a/board/TencentOS_Tiny_EVB_STM32WL/BSP/Middlewares/LoRaWAN/Mac/LoRaMac.c b/board/TencentOS_Tiny_EVB_STM32WL/BSP/Middlewares/LoRaWAN/Mac/LoRaMac.c index 804e897e8..6f13f405e 100644 --- a/board/TencentOS_Tiny_EVB_STM32WL/BSP/Middlewares/LoRaWAN/Mac/LoRaMac.c +++ b/board/TencentOS_Tiny_EVB_STM32WL/BSP/Middlewares/LoRaWAN/Mac/LoRaMac.c @@ -4422,17 +4422,19 @@ LoRaMacStatus_t LoRaMacMcChannelSetupRxParams( AddressIdentifier_t groupID, McRx return LORAMAC_STATUS_BUSY; } + if( ( groupID >= LORAMAC_MAX_MC_CTX ) || + ( MacCtx.NvmCtx->MulticastChannelList[groupID].ChannelParams.IsEnabled == false ) ) + { + return LORAMAC_STATUS_MC_GROUP_UNDEFINED; + } + DeviceClass_t devClass = MacCtx.NvmCtx->MulticastChannelList[groupID].ChannelParams.Class; if( ( devClass == CLASS_A ) || ( devClass > CLASS_C ) ) { return LORAMAC_STATUS_PARAMETER_INVALID; } - if( ( groupID >= LORAMAC_MAX_MC_CTX ) || - ( MacCtx.NvmCtx->MulticastChannelList[groupID].ChannelParams.IsEnabled == false ) ) - { - return LORAMAC_STATUS_MC_GROUP_UNDEFINED; - } + *status &= 0x0F; // groupID OK VerifyParams_t verify;