Skip to content

Commit 23a76a9

Browse files
authored
Move isIdentifying out of util.cpp (project-chip#32407)
* Move emberAfIsDeficeIdentifying into the only used place for this. This is to minimize dependencies on generated code. * Restyle
1 parent 40ffedf commit 23a76a9

File tree

3 files changed

+12
-31
lines changed

3 files changed

+12
-31
lines changed

src/app/clusters/groups-server/groups-server.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,18 @@ using namespace app::Clusters::Groups;
4040
using namespace chip::Credentials;
4141
using Protocols::InteractionModel::Status;
4242

43+
// Is the device identifying?
44+
static bool emberAfIsDeviceIdentifying(EndpointId endpoint)
45+
{
46+
#ifdef ZCL_USING_IDENTIFY_CLUSTER_SERVER
47+
uint16_t identifyTime;
48+
Status status = app::Clusters::Identify::Attributes::IdentifyTime::Get(endpoint, &identifyTime);
49+
return (status == Status::Success && 0 < identifyTime);
50+
#else
51+
return false;
52+
#endif
53+
}
54+
4355
/**
4456
* @brief Checks if group-endpoint association exist for the given fabric
4557
*/

src/app/util/af.h

-15
Original file line numberDiff line numberDiff line change
@@ -196,21 +196,6 @@ bool emberAfIsTypeSigned(EmberAfAttributeType dataType);
196196

197197
/** @} END Attribute Storage */
198198

199-
/** @name Device Control */
200-
// @{
201-
202-
/**
203-
* @brief Function that checks if endpoint is identifying
204-
*
205-
* This function returns true if device at a given endpoint is
206-
* identifying.
207-
*
208-
* @param endpoint Zigbee endpoint number
209-
*/
210-
bool emberAfIsDeviceIdentifying(chip::EndpointId endpoint);
211-
212-
/** @} END Device Control */
213-
214199
/** @name Miscellaneous */
215200
// @{
216201

src/app/util/util.cpp

-16
Original file line numberDiff line numberDiff line change
@@ -32,26 +32,10 @@
3232
// TODO: figure out a clear path for compile-time codegen
3333
#include <app/PluginApplicationCallbacks.h>
3434

35-
#ifdef MATTER_DM_PLUGIN_GROUPS_SERVER
36-
#include <app/clusters/groups-server/groups-server.h>
37-
#endif // MATTER_DM_PLUGIN_GROUPS_SERVER
38-
3935
using namespace chip;
4036

4137
using chip::Protocols::InteractionModel::Status;
4238

43-
// Is the device identifying?
44-
bool emberAfIsDeviceIdentifying(EndpointId endpoint)
45-
{
46-
#ifdef ZCL_USING_IDENTIFY_CLUSTER_SERVER
47-
uint16_t identifyTime;
48-
Status status = app::Clusters::Identify::Attributes::IdentifyTime::Get(endpoint, &identifyTime);
49-
return (status == Status::Success && 0 < identifyTime);
50-
#else
51-
return false;
52-
#endif
53-
}
54-
5539
// Calculates difference. See EmberAfDifferenceType for the maximum data size
5640
// that this function will support.
5741
EmberAfDifferenceType emberAfGetDifference(uint8_t * pData, EmberAfDifferenceType value, uint8_t dataSize)

0 commit comments

Comments
 (0)