From 44801925e0a8a0cd9163b787d131b33b1853abce Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 1 Dec 2022 08:42:45 -0500 Subject: [PATCH] Remove emberAfSetDeviceEnabled. (#23851) This function does two things: 1) Write to afDeviceEnabled, which nothing reads. 2) If needed set the ZCL_DEVICE_ENABLED_ATTRIBUTE_ID attribute, which does not exist in Matter. --- src/app/util/af.h | 10 ---------- src/app/util/attribute-storage.cpp | 2 -- src/app/util/util.cpp | 20 -------------------- 3 files changed, 32 deletions(-) diff --git a/src/app/util/af.h b/src/app/util/af.h index 043c5e80ebe5bb..9c9bad4b3f1345 100644 --- a/src/app/util/af.h +++ b/src/app/util/af.h @@ -303,16 +303,6 @@ void emberAfCopyLongString(uint8_t * dest, const uint8_t * src, size_t size); */ bool emberAfIsDeviceIdentifying(chip::EndpointId endpoint); -/** - * @brief Function that enables or disables an endpoint. - * - * By calling this function, you turn off all processing of incoming traffic - * for a given endpoint. - * - * @param endpoint Zigbee endpoint number - */ -void emberAfSetDeviceEnabled(chip::EndpointId endpoint, bool enabled); - /** @} END Device Control */ /** @name Miscellaneous */ diff --git a/src/app/util/attribute-storage.cpp b/src/app/util/attribute-storage.cpp index 661c97308e7866..d9b76dec4101af 100644 --- a/src/app/util/attribute-storage.cpp +++ b/src/app/util/attribute-storage.cpp @@ -242,7 +242,6 @@ EmberAfStatus emberAfSetDynamicEndpoint(uint16_t index, EndpointId id, const Emb // Now enable the endpoint. emberAfEndpointEnableDisable(id, true); - emberAfSetDeviceEnabled(id, true); return EMBER_ZCL_STATUS_SUCCESS; } @@ -257,7 +256,6 @@ EndpointId emberAfClearDynamicEndpoint(uint16_t index) (emberAfEndpointIndexIsEnabled(index))) { ep = emAfEndpoints[index].endpoint; - emberAfSetDeviceEnabled(ep, false); emberAfEndpointEnableDisable(ep, false); emAfEndpoints[index].endpoint = kInvalidEndpointId; } diff --git a/src/app/util/util.cpp b/src/app/util/util.cpp index c0a7e48e94f898..1115b776d5f2e8 100644 --- a/src/app/util/util.cpp +++ b/src/app/util/util.cpp @@ -41,9 +41,6 @@ using namespace chip; //------------------------------------------------------------------------------ // Globals -// Storage and functions for turning on and off devices -bool afDeviceEnabled[MAX_ENDPOINT_COUNT]; - #ifdef EMBER_AF_ENABLE_STATISTICS // a variable containing the number of messages send from the utilities // since emberAfInit was called. @@ -83,21 +80,6 @@ EMBER_AF_GENERATED_PLUGIN_TICK_FUNCTION_DECLARATIONS //------------------------------------------------------------------------------ -// Device enabled/disabled functions - -void emberAfSetDeviceEnabled(EndpointId endpoint, bool enabled) -{ - uint16_t index = emberAfIndexFromEndpoint(endpoint); - if (index != 0xFFFF && index < sizeof(afDeviceEnabled)) - { - afDeviceEnabled[index] = enabled; - } -#ifdef ZCL_USING_BASIC_CLUSTER_DEVICE_ENABLED_ATTRIBUTE - emberAfWriteServerAttribute(endpoint, app::Clusters::Basic::Id, ZCL_DEVICE_ENABLED_ATTRIBUTE_ID, (uint8_t *) &enabled, - ZCL_BOOLEAN_ATTRIBUTE_TYPE); -#endif -} - // Is the device identifying? bool emberAfIsDeviceIdentifying(EndpointId endpoint) { @@ -167,8 +149,6 @@ void emberAfInit(chip::Messaging::ExchangeManager * exchangeMgr) // emberAfPopNetworkIndex(); } - memset(afDeviceEnabled, true, emberAfEndpointCount()); - MATTER_PLUGINS_INIT emAfCallInits();