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.
diff --git a/src/app/util/af.h b/src/app/util/af.h
index 043c5e8..9c9bad4 100644
--- a/src/app/util/af.h
+++ b/src/app/util/af.h
@@ -303,16 +303,6 @@
*/
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 661c973..d9b76de 100644
--- a/src/app/util/attribute-storage.cpp
+++ b/src/app/util/attribute-storage.cpp
@@ -242,7 +242,6 @@
// Now enable the endpoint.
emberAfEndpointEnableDisable(id, true);
- emberAfSetDeviceEnabled(id, true);
return EMBER_ZCL_STATUS_SUCCESS;
}
@@ -257,7 +256,6 @@
(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 c0a7e48..1115b77 100644
--- a/src/app/util/util.cpp
+++ b/src/app/util/util.cpp
@@ -41,9 +41,6 @@
//------------------------------------------------------------------------------
// 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 @@
//------------------------------------------------------------------------------
-// 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 @@
// emberAfPopNetworkIndex();
}
- memset(afDeviceEnabled, true, emberAfEndpointCount());
-
MATTER_PLUGINS_INIT
emAfCallInits();