Skip to content

Commit

Permalink
Remove emberAfSetDeviceEnabled. (#23851)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Sep 7, 2023
1 parent ccde984 commit 4326836
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 32 deletions.
10 changes: 0 additions & 10 deletions src/app/util/af.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 0 additions & 2 deletions src/app/util/attribute-storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down
20 changes: 0 additions & 20 deletions src/app/util/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -167,8 +149,6 @@ void emberAfInit(chip::Messaging::ExchangeManager * exchangeMgr)
// emberAfPopNetworkIndex();
}

memset(afDeviceEnabled, true, emberAfEndpointCount());

MATTER_PLUGINS_INIT

emAfCallInits();
Expand Down

0 comments on commit 4326836

Please sign in to comment.