diff options
Diffstat (limited to 'Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingProvisioner/STM32_WPAN/app/appli_config_client.c')
-rw-r--r-- | Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingProvisioner/STM32_WPAN/app/appli_config_client.c | 309 |
1 files changed, 123 insertions, 186 deletions
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingProvisioner/STM32_WPAN/app/appli_config_client.c b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingProvisioner/STM32_WPAN/app/appli_config_client.c index 0ab8a8578..ba0b3307a 100644 --- a/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingProvisioner/STM32_WPAN/app/appli_config_client.c +++ b/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_MeshLightingProvisioner/STM32_WPAN/app/appli_config_client.c @@ -6,7 +6,7 @@ ****************************************************************************** * @attention * - * <h2><center>© Copyright (c) 2019 STMicroelectronics. + * <h2><center>© Copyright (c) 2020 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under Ultimate Liberty license @@ -24,6 +24,7 @@ #include "appli_generic.h" #include "appli_light.h" #include "common.h" +#include "mesh_cfg.h" #include "mesh_cfg_usr.h" #include "appli_nvm.h" #include "config_client.h" @@ -58,6 +59,10 @@ #define NUM_VENDOR_MODELS_TO_PUBLISH 0 #define NUM_VENDOR_MODELS_TO_BIND_APP 0 +/******************************************************************************/ +#if defined (ENABLE_PROVISIONER_FEATURE) || defined(DYNAMIC_PROVISIONER) +/******************************************************************************/ + const MOBLEUINT8 aConfigAppKeyDefault[19]= { /* NetKeyIndexAndAppKeyIndex : 3B Index of the NetKey and index of the AppKey*/ @@ -88,52 +93,6 @@ const MOBLEUINT8 aNoParamDefaultConfig; const MOBLEUINT8 aNoInitParamDefault[MAX_CONFIG_PARAM_SIZE]= {0}; /* Private macro -------------------------------------------------------------*/ -#ifndef CONFIGURE_AS_PER_COMPOSITION_DATA -MOBLEUINT16 aSigModelsToBind[][MAX_ELEMENTS_PER_NODE] = { - { - GENERIC_MODEL_SERVER_ONOFF_MODEL_ID, - GENERIC_MODEL_SERVER_LEVEL_MODEL_ID, - // GENERIC_MODEL_SERVER_DEFAULT_TRANSITION_TIME_MODEL_ID, - // SENSOR_SERVER_MODEL_ID, - // LIGHT_MODEL_SERVER_LIGHTNESS_MODEL_ID, - // LIGHT_MODEL_SERVER_LC_MODEL_ID - }, - { - GENERIC_MODEL_SERVER_ONOFF_MODEL_ID, - GENERIC_MODEL_SERVER_LEVEL_MODEL_ID, - // GENERIC_MODEL_SERVER_DEFAULT_TRANSITION_TIME_MODEL_ID, - // SENSOR_SERVER_MODEL_ID, - // LIGHT_MODEL_SERVER_LIGHTNESS_MODEL_ID, - // LIGHT_MODEL_SERVER_LC_MODEL_ID - }, -{ - GENERIC_MODEL_SERVER_ONOFF_MODEL_ID, - GENERIC_MODEL_SERVER_LEVEL_MODEL_ID, - // GENERIC_MODEL_SERVER_DEFAULT_TRANSITION_TIME_MODEL_ID, - // SENSOR_SERVER_MODEL_ID, - // LIGHT_MODEL_SERVER_LIGHTNESS_MODEL_ID, - // LIGHT_MODEL_SERVER_LC_MODEL_ID - } -}; -#endif - -MOBLEUINT16 aPublishModels[] = -{ - GENERIC_MODEL_SERVER_ONOFF_MODEL_ID, - GENERIC_MODEL_SERVER_LEVEL_MODEL_ID, -// GENERIC_MODEL_SERVER_DEFAULT_TRANSITION_TIME_MODEL_ID, -// SENSOR_SERVER_MODEL_ID, -// LIGHT_MODEL_SERVER_LIGHTNESS_MODEL_ID, -// LIGHT_MODEL_SERVER_LC_MODEL_ID -}; - -MOBLEUINT16 aSubscribeModels[] = -{ - GENERIC_MODEL_SERVER_ONOFF_MODEL_ID, - GENERIC_MODEL_SERVER_LEVEL_MODEL_ID, -// GENERIC_MODEL_SERVER_DEFAULT_TRANSITION_TIME_MODEL_ID, -// LIGHT_MODEL_SERVER_LC_MODEL_ID -}; const MODEL_CONFIG_CLIENT_OpcodeTableParam_t ConfigClient_MessageOpcodes_Table[] = { /* MOBLEUINT16 opcode, @@ -619,7 +578,7 @@ const MODEL_CONFIG_CLIENT_OpcodeTableParam_t ConfigClient_MessageOpcodes_Table[] Modified Publish Period is used for sending Current Health Status messages when there are active faults to communicate */ { OPCODE_HEALTH_PERIOD_SET_UNACKNOWLEDGED, 1, 1, aNoInitParamDefault }, -//// { OPCODE_HEALTH_PERIOD_STATUS 0x8037 + /* { OPCODE_HEALTH_PERIOD_STATUS 0x8037 */ @@ -823,14 +782,14 @@ MOBLE_RESULT Appli_ConfigClient_ConfigureNode(void) { /* Waiting for the Provisioning to be done before to Start the node configuration procedure */ - return result; + return result; } if (eServerRespRecdState == NodeNoResponse_State) { /* No Response received from Node under Provisioning for some config messages. So, no need to do the trials */ - return MOBLE_RESULT_FAIL; + return MOBLE_RESULT_FAIL; } if (eClientSendMsgState == ProvisioningDone_State) @@ -842,12 +801,12 @@ MOBLE_RESULT Appli_ConfigClient_ConfigureNode(void) else if (eClientSendMsgState == CompositionGet_State) { - nowClockTime = Clock_Time(); - if( (nowClockTime - NodeInfo.Initial_time) < CONFIGURATION_START_DELAY) - { - return result; - } - /*------------- Add the delay before to start the configuration messages */ + nowClockTime = Clock_Time(); + if( (nowClockTime - NodeInfo.Initial_time) < CONFIGURATION_START_DELAY) + { + return result; + } + /*------------- Add the delay before to start the configuration messages */ if (eServerRespRecdState == CompositionRecdCompleted_State) { @@ -871,8 +830,8 @@ MOBLE_RESULT Appli_ConfigClient_ConfigureNode(void) else { /* Continue the AppKeyAdd servicing */ - Appli_ConfigClient_DefaultAppKeyAdd(); - } + Appli_ConfigClient_DefaultAppKeyAdd(); + } } else if (eClientSendMsgState == AppBindModel_State) @@ -884,9 +843,9 @@ MOBLE_RESULT Appli_ConfigClient_ConfigureNode(void) } else { - /* Continue the AppKeyBIND servicing */ - Appli_ConfigClient_DefaultAppKeyBind(); - } + /* Continue the AppKeyBIND servicing */ + Appli_ConfigClient_DefaultAppKeyBind(); + } } else if (eClientSendMsgState == AddSubscription_State) @@ -899,7 +858,7 @@ MOBLE_RESULT Appli_ConfigClient_ConfigureNode(void) else { /* Continue the Subscription add servicing */ - AppliConfigClient_SubscriptionAddDefault(); + AppliConfigClient_SubscriptionAddDefault(); } } @@ -1188,62 +1147,62 @@ MOBLE_RESULT Appli_ConfigClient_DefaultAppKeyBind (void) */ MOBLE_RESULT AppliConfigClient_SubscriptionAddDefault (void) { - static MOBLEUINT32 modelIdentifier; - static MOBLEUINT16 elementAddress; - static MOBLEUINT8 elementIndex; - static MOBLEUINT8 indexSIGmodels; - static MOBLEUINT8 indexVendormodels; - MOBLEUINT8 numSIGmodels; - MOBLEUINT8 numVendorModels; - MOBLEUINT8 numofElements; - MOBLEUINT16 address = DEFAULT_GROUP_ADDR; - MOBLE_RESULT result = MOBLE_RESULT_SUCCESS; - MOBLEUINT8 retry; + static MOBLEUINT32 modelIdentifier; + static MOBLEUINT16 elementAddress; + static MOBLEUINT8 elementIndex; + static MOBLEUINT8 indexSIGmodels; + static MOBLEUINT8 indexVendormodels; + MOBLEUINT8 numSIGmodels; + MOBLEUINT8 numVendorModels; + MOBLEUINT8 numofElements; + MOBLEUINT16 address = DEFAULT_GROUP_ADDR; + MOBLE_RESULT result = MOBLE_RESULT_SUCCESS; + MOBLEUINT8 retry; - switch(eServerRespRecdState) - { + switch(eServerRespRecdState) + { case NodeIdle_State: /* Start the SubscriptionAdd message */ - elementIndex = 0; /* Initialize it for the complete loop */ - indexSIGmodels = 0; /* Initialize it for the complete loop */ - indexVendormodels = 0; + elementIndex = 0; /* Initialize it for the complete loop */ + indexSIGmodels = 0; /* Initialize it for the complete loop */ + indexVendormodels = 0; case NodeNextSigModel_State: - numSIGmodels = GetCountSIGModelToSubscribe(elementIndex); - modelIdentifier = GetSIGModelToSubscribe(elementIndex, + numSIGmodels = GetCountSIGModelToSubscribe(elementIndex); + modelIdentifier = GetSIGModelToSubscribe(elementIndex, &indexSIGmodels, numSIGmodels); /* Switch to NodeSendMessage_State */ - eServerRespRecdState = NodeSendMessage_State; + eServerRespRecdState = NodeSendMessage_State; break; case NodeNextVendorModel_State: - modelIdentifier = GetVendorModelToSubscribe(elementIndex,indexVendormodels ); - /* Switch to NodeSendMessage_State */ - eServerRespRecdState = NodeSendMessage_State; + modelIdentifier = GetVendorModelToSubscribe(elementIndex,indexVendormodels ); + /* Switch to NodeSendMessage_State */ + eServerRespRecdState = NodeSendMessage_State; break; case NodeSendMessage_State: - elementAddress = GetServerElementAddress(elementIndex); - ConfigClient_SaveMsgSendingTime(); + elementAddress = GetServerElementAddress(elementIndex); + ConfigClient_SaveMsgSendingTime(); + + /* Switch to InProgress_State */ + eServerRespRecdState = InProgress_State; + ConfigClient_SubscriptionAdd (elementAddress, address, modelIdentifier); - /* Switch to InProgress_State */ - eServerRespRecdState = InProgress_State; - ConfigClient_SubscriptionAdd (elementAddress, address, modelIdentifier); - break; case SubscriptionAck_State: - /* Need to check if all SIG Models are subscribed ? */ + /* Need to check if all SIG Models are subscribed ? */ ConfigClient_ResetTrials(); numSIGmodels = GetCountSIGModelToSubscribe(elementIndex); numVendorModels = GetCountVendorModelToSubscribe(elementIndex); elementAddress = GetServerElementAddress(elementIndex); - + if (indexSIGmodels < numSIGmodels ) { /* Even when all SIG Models are serviced, we need to start for Vendor Models */ indexSIGmodels++; @@ -1254,16 +1213,16 @@ MOBLE_RESULT AppliConfigClient_SubscriptionAddDefault (void) indexVendormodels++; /* When SIG Models and Vendor Models are processed the loop condition will become true */ } - + if (indexSIGmodels < numSIGmodels ) {/* if index is still less, then we have scope of reading 1 more index */ - + /* Get the Next Model and Bind it again till all SIG Models are binded */ eServerRespRecdState = NodeNextSigModel_State; - + } else if (indexVendormodels < numVendorModels) -{ + { eServerRespRecdState = NodeNextVendorModel_State; } else @@ -1282,8 +1241,8 @@ MOBLE_RESULT AppliConfigClient_SubscriptionAddDefault (void) eServerRespRecdState = NodeNextSigModel_State; indexSIGmodels =0; /* Reset the variable again for the next element */ - indexVendormodels = 0; - } + indexVendormodels = 0; + } } break; @@ -1291,7 +1250,7 @@ MOBLE_RESULT AppliConfigClient_SubscriptionAddDefault (void) /* Just wait and let the messages be completed or look for timeout */ retry = ConfigClient_ChkRetries(); - + if (retry == CLIENT_TX_RETRY_ENDS) { eServerRespRecdState = NodeNoResponse_State; @@ -1305,8 +1264,8 @@ MOBLE_RESULT AppliConfigClient_SubscriptionAddDefault (void) default: /* Error State */ break; - } - + } + return result; } @@ -1481,11 +1440,11 @@ MOBLE_RESULT AppliConfigClient_SelfPublicationSetDefault (void) MOBLEUINT8 elementIndex; MOBLE_RESULT result = MOBLE_RESULT_SUCCESS; - for (elementIndex=0; elementIndex < MAX_ELEMENTS_PER_NODE; elementIndex++ ) + for (elementIndex=0; elementIndex < APPLICATION_NUMBER_OF_ELEMENTS; elementIndex++ ) { /*Checking for SIG Models*/ - for (MOBLEUINT8 index=0; index < MAX_SIG_MODELS_PER_ELEMENT; index++) - { + for (MOBLEUINT8 index=0; index < APPLICATION_SIG_MODELS_MAX_COUNT; index++) + { elementAddress = BLEMesh_GetAddress(); elementAddress += elementIndex; @@ -1495,6 +1454,14 @@ MOBLE_RESULT AppliConfigClient_SelfPublicationSetDefault (void) { break; } + else if (MODEL_IS_FOUNDATION_MODEL(modelIdentifier)) + { + /* If Model is Foundation Model, then it doesnt need to be + added for Publishing */ + + /* Do NOTHING, let the next Model be picked */ + } + else { ConfigClient_PublicationSet(elementAddress, @@ -1510,7 +1477,7 @@ MOBLE_RESULT AppliConfigClient_SelfPublicationSetDefault (void) } /*Checking for VENDOR Models*/ - for (MOBLEUINT8 index=0; index < MAX_VENDOR_MODELS_PER_ELEMENT; index++) + for (MOBLEUINT8 index=0; index < APPLICATION_VENDOR_MODELS_MAX_COUNT; index++) { elementAddress = BLEMesh_GetAddress(); elementAddress += elementIndex; @@ -1523,17 +1490,17 @@ MOBLE_RESULT AppliConfigClient_SelfPublicationSetDefault (void) } else { - ConfigClient_PublicationSet(elementAddress, - publishAddress, - appKeyIndex, - credentialFlag, - publishTTL, - publishPeriod, - publishRetransmitCount, - publishRetransmitIntervalSteps, - modelIdentifier); - } - } + ConfigClient_PublicationSet(elementAddress, + publishAddress, + appKeyIndex, + credentialFlag, + publishTTL, + publishPeriod, + publishRetransmitCount, + publishRetransmitIntervalSteps, + modelIdentifier); + } + } } return result; } @@ -1554,10 +1521,10 @@ MOBLE_RESULT AppliConfigClient_SelfSubscriptionSetDefault (void) MOBLEUINT16 address = DEFAULT_GROUP_ADDR; MOBLE_RESULT result = MOBLE_RESULT_SUCCESS; - for (elementIndex=0; elementIndex < MAX_ELEMENTS_PER_NODE; elementIndex++ ) + for (elementIndex=0; elementIndex < APPLICATION_NUMBER_OF_ELEMENTS; elementIndex++ ) { /*Checking for SIG Models*/ - for (MOBLEUINT8 index=0; index < MAX_SIG_MODELS_PER_ELEMENT; index++) + for (MOBLEUINT8 index=0; index < APPLICATION_SIG_MODELS_MAX_COUNT; index++) { elementAddress = BLEMesh_GetAddress(); elementAddress += elementIndex; @@ -1569,6 +1536,13 @@ MOBLE_RESULT AppliConfigClient_SelfSubscriptionSetDefault (void) { break; } + else if (MODEL_IS_FOUNDATION_MODEL(modelIdentifier)) + { + /* If Model is Foundation Model, then it doesnt need to be + Subscribed */ + + /* Do NOTHING, let the next Model be picked */ + } else { ConfigClient_SubscriptionAdd (elementAddress, address, modelIdentifier); @@ -1576,7 +1550,7 @@ MOBLE_RESULT AppliConfigClient_SelfSubscriptionSetDefault (void) } /*Checking for Vendor Models*/ - for (MOBLEUINT8 index=0; index < MAX_VENDOR_MODELS_PER_ELEMENT; index++) + for (MOBLEUINT8 index=0; index < APPLICATION_VENDOR_MODELS_MAX_COUNT; index++) { elementAddress = BLEMesh_GetAddress(); elementAddress += elementIndex; @@ -1613,10 +1587,10 @@ MOBLE_RESULT Appli_ConfigClient_SelfDefaultAppKeyBind (void) MOBLE_RESULT result = MOBLE_RESULT_SUCCESS; appKeyIndex = DEFAULT_APPKEY_INDEX; - for (elementIndex=0; elementIndex < MAX_ELEMENTS_PER_NODE; elementIndex++ ) + for (elementIndex=0; elementIndex < APPLICATION_NUMBER_OF_ELEMENTS; elementIndex++ ) { /*Checking for SIG Models*/ - for (MOBLEUINT8 index=0; index < MAX_SIG_MODELS_PER_ELEMENT; index++) + for (MOBLEUINT8 index=0; index < APPLICATION_SIG_MODELS_MAX_COUNT; index++) { elementAddress = BLEMesh_GetAddress(); elementAddress += elementIndex; @@ -1627,14 +1601,21 @@ MOBLE_RESULT Appli_ConfigClient_SelfDefaultAppKeyBind (void) { break; } + else if (MODEL_IS_FOUNDATION_MODEL(modelIdentifier)) + { + /* If Model is Foundation Model, then it doesnt need to be binded + with AppKey */ + + /* Do NOTHING, let the next Model be picked */ + } else - { + { ConfigClient_ModelAppBind (elementAddress, appKeyIndex, modelIdentifier); } } /*Checking for VENDOR Models*/ - for (MOBLEUINT8 index=0; index < MAX_VENDOR_MODELS_PER_ELEMENT; index++) + for (MOBLEUINT8 index=0; index < APPLICATION_VENDOR_MODELS_MAX_COUNT; index++) { elementAddress = BLEMesh_GetAddress(); elementAddress += elementIndex; @@ -1647,9 +1628,9 @@ MOBLE_RESULT Appli_ConfigClient_SelfDefaultAppKeyBind (void) } else { - ConfigClient_ModelAppBind (elementAddress, appKeyIndex, modelIdentifier); - } - } + ConfigClient_ModelAppBind (elementAddress, appKeyIndex, modelIdentifier); + } + } } return result; @@ -1663,7 +1644,7 @@ MOBLE_RESULT Appli_ConfigClient_SelfDefaultAppKeyBind (void) */ void Appli_CompositionDataStatusCb(MOBLE_RESULT status) { - eServerRespRecdState = CompositionRecd_State; + eServerRespRecdState = CompositionRecd_State; } @@ -1675,8 +1656,8 @@ void Appli_CompositionDataStatusCb(MOBLE_RESULT status) */ void Appli_AppKeyStatusCb(MOBLEUINT8 status) { - /* Change the received state for application */ - eServerRespRecdState = AppkeyAck_State; + /* Change the received state for application */ + eServerRespRecdState = AppkeyAck_State; } @@ -1688,8 +1669,8 @@ void Appli_AppKeyStatusCb(MOBLEUINT8 status) */ void Appli_AppBindModelStatusCb(MOBLEUINT8 status) { - /* Change the received state for application */ - eServerRespRecdState = AppBindModelAck_State; + /* Change the received state for application */ + eServerRespRecdState = AppBindModelAck_State; } @@ -1701,8 +1682,8 @@ void Appli_AppBindModelStatusCb(MOBLEUINT8 status) */ void Appli_SubscriptionAddStatusCb(MOBLEUINT8 status) { - /* Change the received state for application */ - eServerRespRecdState = SubscriptionAck_State; + /* Change the received state for application */ + eServerRespRecdState = SubscriptionAck_State; } @@ -1714,8 +1695,8 @@ void Appli_SubscriptionAddStatusCb(MOBLEUINT8 status) */ void Appli_PublicationStatusCb(MOBLEUINT8 status) { - /* Change the received state for application */ - eServerRespRecdState = PublicationStatus_State; + /* Change the received state for application */ + eServerRespRecdState = PublicationStatus_State; } @@ -1727,8 +1708,8 @@ void Appli_PublicationStatusCb(MOBLEUINT8 status) */ void Appli_NodeResetStatusCb(void) { - /* Change the received state for application */ - eServerRespRecdState = NodeResetStatus_State; + /* Change the received state for application */ + eServerRespRecdState = NodeResetStatus_State; } @@ -1744,7 +1725,6 @@ MOBLEUINT16 GetSIGModelToBindApp(MOBLEUINT8 elementIndex, MOBLEUINT8 numberOfModels) { -#ifdef CONFIGURE_AS_PER_COMPOSITION_DATA MOBLEUINT16 model_id; MOBLEUINT8 index; MOBLEUINT8 idxSIG = *pModelIndex; @@ -1765,9 +1745,7 @@ MOBLEUINT16 GetSIGModelToBindApp(MOBLEUINT8 elementIndex, *pModelIndex = index; return model_id; -#else - return aSigModelsToBind[idxSIG][elementIdx] ; -#endif + } @@ -1780,11 +1758,7 @@ MOBLEUINT16 GetSIGModelToBindApp(MOBLEUINT8 elementIndex, */ MOBLEUINT32 GetVendorModelToBindApp(MOBLEUINT8 elementIndex, MOBLEUINT8 indexModels) { -#ifdef CONFIGURE_AS_PER_COMPOSITION_DATA return aNodeElements[elementIndex].aVendorModels[indexModels]; -#else - return VENDORMODEL_STMICRO_ID1 ; -#endif } /** @@ -1795,11 +1769,7 @@ MOBLEUINT32 GetVendorModelToBindApp(MOBLEUINT8 elementIndex, MOBLEUINT8 indexMod */ MOBLEUINT8 GetCountSIGModelToBindApp(MOBLEUINT8 elementIndex) { -#ifdef CONFIGURE_AS_PER_COMPOSITION_DATA return aNodeElements[elementIndex].NumSIGmodels; -#else - return sizeof(aSigModelsToBind)/sizeof(MOBLEUINT16); -#endif } @@ -1810,11 +1780,7 @@ MOBLEUINT8 GetCountSIGModelToBindApp(MOBLEUINT8 elementIndex) */ MOBLEUINT8 GetCountVendorModelToBindApp(MOBLEUINT8 elementIndex) { -#ifdef CONFIGURE_AS_PER_COMPOSITION_DATA return aNodeElements[elementIndex].NumVendorModels; -#else - return NUM_VENDOR_MODELS_TO_BIND_APP; -#endif } @@ -1830,13 +1796,9 @@ MOBLEUINT16 GetSIGModelToPublish(MOBLEUINT8 elementIndex, MOBLEUINT8 numberOfModels) { -#ifdef CONFIGURE_AS_PER_COMPOSITION_DATA return GetSIGModelToBindApp(elementIndex, pModelIndex, numberOfModels); -#else - return aPublishModels[idxSIG] ; -#endif } @@ -1848,11 +1810,7 @@ MOBLEUINT16 GetSIGModelToPublish(MOBLEUINT8 elementIndex, */ MOBLEUINT32 GetVendorModelToPublish(MOBLEUINT8 elementIndex, MOBLEUINT8 idxSIG) { -#ifdef CONFIGURE_AS_PER_COMPOSITION_DATA return aNodeElements[elementIndex].aVendorModels[idxSIG]; -#else - return VENDORMODEL_STMICRO_ID1 ; -#endif } @@ -1863,11 +1821,7 @@ MOBLEUINT32 GetVendorModelToPublish(MOBLEUINT8 elementIndex, MOBLEUINT8 idxSIG) */ MOBLEUINT8 GetCountSIGModelToPublish(MOBLEUINT8 elementIndex) { -#ifdef CONFIGURE_AS_PER_COMPOSITION_DATA return aNodeElements[elementIndex].NumSIGmodels; -#else - return sizeof(aPublishModels)/sizeof(MOBLEUINT16); -#endif } @@ -1878,11 +1832,7 @@ MOBLEUINT8 GetCountSIGModelToPublish(MOBLEUINT8 elementIndex) */ MOBLEUINT8 GetCountVendorModelToPublish(MOBLEUINT8 elementIndex) { -#ifdef CONFIGURE_AS_PER_COMPOSITION_DATA return aNodeElements[elementIndex].NumVendorModels; -#else - return NUM_VENDOR_MODELS_TO_PUBLISH; -#endif } @@ -1897,13 +1847,9 @@ MOBLEUINT16 GetSIGModelToSubscribe(MOBLEUINT8 elementIndex, MOBLEUINT8 *pModelIndex, MOBLEUINT8 numberOfModels) { -#ifdef CONFIGURE_AS_PER_COMPOSITION_DATA return GetSIGModelToBindApp(elementIndex, pModelIndex, numberOfModels); -#else - return aSubscribeModels[idxSIG] ; -#endif } @@ -1917,11 +1863,7 @@ MOBLEUINT16 GetSIGModelToSubscribe(MOBLEUINT8 elementIndex, MOBLEUINT32 GetVendorModelToSubscribe(MOBLEUINT8 elementIndex, MOBLEUINT8 idxSIG) { -#ifdef CONFIGURE_AS_PER_COMPOSITION_DATA return aNodeElements[elementIndex].aVendorModels[idxSIG]; -#else - return VENDORMODEL_STMICRO_ID1 ; -#endif } @@ -1932,11 +1874,7 @@ MOBLEUINT32 GetVendorModelToSubscribe(MOBLEUINT8 elementIndex, */ MOBLEUINT8 GetCountSIGModelToSubscribe(MOBLEUINT8 elementIndex) { -#ifdef CONFIGURE_AS_PER_COMPOSITION_DATA return aNodeElements[elementIndex].NumSIGmodels; -#else - return sizeof(aSubscribeModels)/sizeof(MOBLEUINT16); -#endif } @@ -1948,11 +1886,7 @@ MOBLEUINT8 GetCountSIGModelToSubscribe(MOBLEUINT8 elementIndex) */ MOBLEUINT8 GetCountVendorModelToSubscribe(MOBLEUINT8 elementIndex) { -#ifdef CONFIGURE_AS_PER_COMPOSITION_DATA return aNodeElements[elementIndex].NumVendorModels; -#else - return NUM_VENDOR_MODELS_TO_SUBSCRIBE; -#endif } @@ -1968,6 +1902,9 @@ MOBLEUINT8 AppliConfigClient_SendMessageDefault(MOBLEUINT8 elementIdx) return NUM_VENDOR_MODELS_TO_SUBSCRIBE; } +/******************************************************************************/ +#endif /* defined (ENABLE_PROVISIONER_FEATURE) || defined(DYNAMIC_PROVISIONER) */ +/******************************************************************************/ /** * @} @@ -1977,5 +1914,5 @@ MOBLEUINT8 AppliConfigClient_SendMessageDefault(MOBLEUINT8 elementIdx) * @} */ -/******************* (C) COPYRIGHT 2017 STMicroelectronics *****END OF FILE****/ +/******************* (C) COPYRIGHT 2020 STMicroelectronics *****END OF FILE****/ |