Skip to content

Commit 1106860

Browse files
bzbarsky-applepull[bot]
authored andcommitted
Remove manufacturer code from attribute-storage APIs. (#13546)
Matter does not use a separate manufacturer code.
1 parent bf7c60b commit 1106860

File tree

8 files changed

+56
-225
lines changed

8 files changed

+56
-225
lines changed

src/app/clusters/ias-zone-server/ias-zone-server.cpp

+5-8
Original file line numberDiff line numberDiff line change
@@ -594,29 +594,26 @@ static bool areZoneServerAttributesNonVolatile(EndpointId endpoint)
594594
{
595595
EmberAfAttributeMetadata * metadata;
596596

597-
metadata = emberAfLocateAttributeMetadata(endpoint, ZCL_IAS_ZONE_CLUSTER_ID, ZCL_IAS_CIE_ADDRESS_ATTRIBUTE_ID,
598-
CLUSTER_MASK_SERVER, EMBER_AF_NULL_MANUFACTURER_CODE);
597+
metadata =
598+
emberAfLocateAttributeMetadata(endpoint, ZCL_IAS_ZONE_CLUSTER_ID, ZCL_IAS_CIE_ADDRESS_ATTRIBUTE_ID, CLUSTER_MASK_SERVER);
599599
if (!metadata->IsNonVolatile())
600600
{
601601
return false;
602602
}
603603

604-
metadata = emberAfLocateAttributeMetadata(endpoint, ZCL_IAS_ZONE_CLUSTER_ID, ZCL_ZONE_STATE_ATTRIBUTE_ID, CLUSTER_MASK_SERVER,
605-
EMBER_AF_NULL_MANUFACTURER_CODE);
604+
metadata = emberAfLocateAttributeMetadata(endpoint, ZCL_IAS_ZONE_CLUSTER_ID, ZCL_ZONE_STATE_ATTRIBUTE_ID, CLUSTER_MASK_SERVER);
606605
if (!metadata->IsNonVolatile())
607606
{
608607
return false;
609608
}
610609

611-
metadata = emberAfLocateAttributeMetadata(endpoint, ZCL_IAS_ZONE_CLUSTER_ID, ZCL_ZONE_TYPE_ATTRIBUTE_ID, CLUSTER_MASK_SERVER,
612-
EMBER_AF_NULL_MANUFACTURER_CODE);
610+
metadata = emberAfLocateAttributeMetadata(endpoint, ZCL_IAS_ZONE_CLUSTER_ID, ZCL_ZONE_TYPE_ATTRIBUTE_ID, CLUSTER_MASK_SERVER);
613611
if (!metadata->IsNonVolatile())
614612
{
615613
return false;
616614
}
617615

618-
metadata = emberAfLocateAttributeMetadata(endpoint, ZCL_IAS_ZONE_CLUSTER_ID, ZCL_ZONE_ID_ATTRIBUTE_ID, CLUSTER_MASK_SERVER,
619-
EMBER_AF_NULL_MANUFACTURER_CODE);
616+
metadata = emberAfLocateAttributeMetadata(endpoint, ZCL_IAS_ZONE_CLUSTER_ID, ZCL_ZONE_ID_ATTRIBUTE_ID, CLUSTER_MASK_SERVER);
620617
if (!metadata->IsNonVolatile())
621618
{
622619
return false;

src/app/clusters/level-control/level-control.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -1034,15 +1034,14 @@ static bool areStartUpLevelControlServerAttributesNonVolatile(EndpointId endpoin
10341034
{
10351035
EmberAfAttributeMetadata * metadata;
10361036

1037-
metadata = emberAfLocateAttributeMetadata(endpoint, LevelControl::Id, ZCL_CURRENT_LEVEL_ATTRIBUTE_ID, CLUSTER_MASK_SERVER,
1038-
EMBER_AF_NULL_MANUFACTURER_CODE);
1037+
metadata = emberAfLocateAttributeMetadata(endpoint, LevelControl::Id, ZCL_CURRENT_LEVEL_ATTRIBUTE_ID, CLUSTER_MASK_SERVER);
10391038
if (!metadata->IsNonVolatile())
10401039
{
10411040
return false;
10421041
}
10431042

1044-
metadata = emberAfLocateAttributeMetadata(endpoint, LevelControl::Id, ZCL_START_UP_CURRENT_LEVEL_ATTRIBUTE_ID,
1045-
CLUSTER_MASK_SERVER, EMBER_AF_NULL_MANUFACTURER_CODE);
1043+
metadata =
1044+
emberAfLocateAttributeMetadata(endpoint, LevelControl::Id, ZCL_START_UP_CURRENT_LEVEL_ATTRIBUTE_ID, CLUSTER_MASK_SERVER);
10461045
if (!metadata->IsNonVolatile())
10471046
{
10481047
return false;

src/app/clusters/on-off-server/on-off-server.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -486,15 +486,13 @@ bool OnOffServer::areStartUpOnOffServerAttributesNonVolatile(EndpointId endpoint
486486
{
487487
EmberAfAttributeMetadata * metadata;
488488

489-
metadata = emberAfLocateAttributeMetadata(endpoint, OnOff::Id, Attributes::OnOff::Id, CLUSTER_MASK_SERVER,
490-
EMBER_AF_NULL_MANUFACTURER_CODE);
489+
metadata = emberAfLocateAttributeMetadata(endpoint, OnOff::Id, Attributes::OnOff::Id, CLUSTER_MASK_SERVER);
491490
if (!metadata->IsNonVolatile())
492491
{
493492
return false;
494493
}
495494

496-
metadata = emberAfLocateAttributeMetadata(endpoint, OnOff::Id, Attributes::StartUpOnOff::Id, CLUSTER_MASK_SERVER,
497-
EMBER_AF_NULL_MANUFACTURER_CODE);
495+
metadata = emberAfLocateAttributeMetadata(endpoint, OnOff::Id, Attributes::StartUpOnOff::Id, CLUSTER_MASK_SERVER);
498496
if (!metadata->IsNonVolatile())
499497
{
500498
return false;

src/app/util/af-main-common.cpp

+1-8
Original file line numberDiff line numberDiff line change
@@ -576,14 +576,7 @@ void emAfMessageSentHandler(const MessageSendDestination & destination, EmberAps
576576

577577
if (messageContents != NULL && messageContents[0] & ZCL_CLUSTER_SPECIFIC_COMMAND)
578578
{
579-
emberAfClusterMessageSentWithMfgCodeCallback(
580-
destination, apsFrame, messageLength, messageContents, status,
581-
// If the manufacturer specific flag is set
582-
// get read it as next part of message
583-
// else use null code.
584-
(((messageContents[0] & ZCL_MANUFACTURER_SPECIFIC_MASK) == ZCL_MANUFACTURER_SPECIFIC_MASK)
585-
? emberAfGetInt16u(messageContents, 1, messageLength)
586-
: EMBER_AF_NULL_MANUFACTURER_CODE));
579+
emberAfClusterMessageSentCallback(destination, apsFrame, messageLength, messageContents, status);
587580
}
588581

589582
if (callback != NULL)

src/app/util/af.h

+4-49
Original file line numberDiff line numberDiff line change
@@ -92,59 +92,29 @@
9292
* @return Returns pointer to the attribute metadata location.
9393
*/
9494
EmberAfAttributeMetadata * emberAfLocateAttributeMetadata(chip::EndpointId endpoint, chip::ClusterId clusterId,
95-
chip::AttributeId attributeId, uint8_t mask, uint16_t manufacturerCode);
95+
chip::AttributeId attributeId, uint8_t mask);
9696

9797
#ifdef DOXYGEN_SHOULD_SKIP_THIS
9898
/** @brief Returns true if the attribute exists. */
99-
bool emberAfContainsAttribute(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId, uint8_t mask,
100-
uint16_t manufacturerCode);
99+
bool emberAfContainsAttribute(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId, uint8_t mask);
101100
#else
102-
#define emberAfContainsAttribute(endpoint, clusterId, attributeId, mask, manufacturerCode) \
103-
(emberAfLocateAttributeMetadata(endpoint, clusterId, attributeId, mask, manufacturerCode) != NULL)
101+
#define emberAfContainsAttribute(endpoint, clusterId, attributeId, mask) \
102+
(emberAfLocateAttributeMetadata(endpoint, clusterId, attributeId, mask) != NULL)
104103
#endif
105104

106-
/**
107-
* @brief Returns true if endpoint contains a cluster, checking for mfg code.
108-
*
109-
* This function returns true regardless of whether
110-
* the endpoint contains server, client or both.
111-
* For standard libraries (when ClusterId < FC00),
112-
* the manufacturerCode is ignored.
113-
*/
114-
bool emberAfContainsClusterWithMfgCode(chip::EndpointId endpoint, chip::ClusterId clusterId, uint16_t manufacturerCode);
115-
116105
/**
117106
* @brief Returns true if endpoint contains the ZCL cluster with specified id.
118107
*
119108
* This function returns true regardless of whether
120109
* the endpoint contains server, client or both in the Zigbee cluster Library.
121-
* This wraps emberAfContainsClusterWithMfgCode with
122-
* manufacturerCode = EMBER_AF_NULL_MANUFACTURER_CODE
123-
* If this function is used with a manufacturer specific clusterId
124-
* then this will return the first cluster that it finds in the Cluster table.
125-
* and will not return any other clusters that share that id.
126110
*/
127111
bool emberAfContainsCluster(chip::EndpointId endpoint, chip::ClusterId clusterId);
128112

129-
/**
130-
* @brief Returns true if endpoint has cluster server, checking for mfg code.
131-
*
132-
* This function returns true if
133-
* the endpoint contains server of a given cluster.
134-
* For standard librarys (when ClusterId < FC00), the manufacturerCode is ignored.
135-
*/
136-
bool emberAfContainsServerWithMfgCode(chip::EndpointId endpoint, chip::ClusterId clusterId, uint16_t manufacturerCode);
137-
138113
/**
139114
* @brief Returns true if endpoint contains the ZCL server with specified id.
140115
*
141116
* This function returns true if
142117
* the endpoint contains server of a given cluster.
143-
* This wraps emberAfContainsServer with
144-
* manufacturerCode = EMBER_AF_NULL_MANUFACTURER_CODE
145-
* If this function is used with a manufacturer specific clusterId
146-
* then this will return the first cluster that it finds in the Cluster table.
147-
* and will not return any other clusters that share that id.
148118
*/
149119
bool emberAfContainsServer(chip::EndpointId endpoint, chip::ClusterId clusterId);
150120

@@ -159,26 +129,11 @@ bool emberAfContainsServer(chip::EndpointId endpoint, chip::ClusterId clusterId)
159129
*/
160130
bool emberAfContainsServerFromIndex(uint16_t index, chip::ClusterId clusterId);
161131

162-
/**
163-
* @brief Returns true if endpoint contains cluster client.
164-
*
165-
* This function returns true if
166-
* the endpoint contains client of a given cluster.
167-
* For standard library clusters (when ClusterId < FC00),
168-
* the manufacturerCode is ignored.
169-
*/
170-
bool emberAfContainsClientWithMfgCode(chip::EndpointId endpoint, chip::ClusterId clusterId, uint16_t manufacturerCode);
171-
172132
/**
173133
* @brief Returns true if endpoint contains the ZCL client with specified id.
174134
*
175135
* This function returns true if
176136
* the endpoint contains client of a given cluster.
177-
* This wraps emberAfContainsClient with
178-
* manufacturerCode = EMBER_AF_NULL_MANUFACTURER_CODE
179-
* If this function is used with a manufacturer specific clusterId
180-
* then this will return the first cluster that it finds in the Cluster table.
181-
* and will not return any other clusters that share that id.
182137
*/
183138
bool emberAfContainsClient(chip::EndpointId endpoint, chip::ClusterId clusterId);
184139

0 commit comments

Comments
 (0)