-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add functions to set TagList attribute in descriptor cluster #28753
Add functions to set TagList attribute in descriptor cluster #28753
Conversation
examples/all-clusters-app/all-clusters-common/all-clusters-app.matter
Outdated
Show resolved
Hide resolved
PR #28753: Size comparison from f23326b to 3e46fc1 Increases above 0.2%:
Increases (61 builds for bl602, bl702, bl702l, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
Decreases (4 builds for psoc6)
Full report (62 builds for bl602, bl702, bl702l, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
|
PR #28753: Size comparison from 2e59655 to 2c61aba Increases above 0.2%:
Increases (61 builds for bl602, bl702, bl702l, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
Decreases (4 builds for psoc6)
Full report (62 builds for bl602, bl702, bl702l, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
|
return aEncoder.Encode(featureFlags); | ||
} | ||
|
||
CHIP_ERROR DescriptorAttrAccess::ReadTagAttribute(EndpointId endpoint, AttributeValueEncoder & aEncoder) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be called ReadTagListAttribute.
@@ -20,6 +20,7 @@ | |||
* @brief Implementation for the Descriptor Server Cluster | |||
***************************************************************************/ | |||
|
|||
#include <app-common/zap-generated/attributes/Accessors.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this using Accessors.h? I don't think it's being used... why was it included?
@@ -221,6 +222,11 @@ struct EmberAfDefinedEndpoint | |||
* Root endpoint id for composed device type. | |||
*/ | |||
chip::EndpointId parentEndpointId = chip::kInvalidEndpointId; | |||
|
|||
/** | |||
* Span pointing to a list of tag. Lifetime has to outlive usage, and data is owned by callers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"list of tags"
@@ -1088,6 +1088,19 @@ chip::Span<const EmberAfDeviceType> emberAfDeviceTypeListFromEndpoint(chip::Endp | |||
return emAfEndpoints[endpointIndex].deviceTypeList; | |||
} | |||
|
|||
CHIP_ERROR GetTagListFromEndpointAtIndex(EndpointId endpoint, size_t index, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a "GetTagListFromEndpointAtIndex", in terms of what it does. It's a "GetSematicTagForEndpointAtIndex" [edit: "GetSemanticTagForEndpointAtIndex"], no? It gets one tag, not a tag list...
/** | ||
* Get the tag list of endpoint. | ||
* Fills in the provided SemanticTagStruct with tag at index `index` if there is one, | ||
* or returns CHIP_ERROR_NOT_FOUND if the index is out of range for the list of tag, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"list of tags".
@@ -201,6 +201,18 @@ const EmberAfCluster * emberAfGetClusterByIndex(chip::EndpointId endpoint, uint8 | |||
// | |||
chip::Span<const EmberAfDeviceType> emberAfDeviceTypeListFromEndpoint(chip::EndpointId endpoint, CHIP_ERROR & err); | |||
|
|||
/** | |||
* Get the tag list of endpoint. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Get the semantic tags of the endpoint"
@@ -209,6 +221,15 @@ chip::Span<const EmberAfDeviceType> emberAfDeviceTypeListFromEndpoint(chip::Endp | |||
// | |||
CHIP_ERROR emberAfSetDeviceTypeList(chip::EndpointId endpoint, chip::Span<const EmberAfDeviceType> deviceTypeList); | |||
|
|||
// | |||
// Over-ride the tag list current associated with an endpoint with a user-provided list. The buffers backing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"override" is a single word.
…-chip#28753) * Add TagList support feature in descriptor cluster * Restyled by clang-format * Add descriptor in all-cluster-app * modify descriptor cluster's revision * Restyled by clang-format * read featureMap before read tag attribute * Restyled by clang-format * modify the namespace in descriptor cluster * Restyled by clang-format * Optimize the descriptor cluster with review suggestion * Optimize GetTagListFromEndpointAtIndex api and add ReadFeatureMap api * Add read taglist and featureMap in TestDescriptorCluster.yaml * zap regen * Restyled by whitespace * Restyled by clang-format * Restyled by prettier-yaml * Add advice of review * update TestScript for descriptor cluster * Restyled by clang-format * update read tagList step in Test_TC_DESC_2_1.yaml * fixes spelling * resume featureMap setting in zap, set while set taglist * fix read tagList step in Test_TC_DESC_2_1.yaml * fix CI error * fix CI error --------- Co-authored-by: Restyled.io <[email protected]>
project-chip#28753 updated some ZAP files but didn't fix the XML.
#28753 updated some ZAP files but didn't fix the XML.
…9034) project-chip#28753 updated some ZAP files but didn't fix the XML.
…-chip#28753) * Add TagList support feature in descriptor cluster * Restyled by clang-format * Add descriptor in all-cluster-app * modify descriptor cluster's revision * Restyled by clang-format * read featureMap before read tag attribute * Restyled by clang-format * modify the namespace in descriptor cluster * Restyled by clang-format * Optimize the descriptor cluster with review suggestion * Optimize GetTagListFromEndpointAtIndex api and add ReadFeatureMap api * Add read taglist and featureMap in TestDescriptorCluster.yaml * zap regen * Restyled by whitespace * Restyled by clang-format * Restyled by prettier-yaml * Add advice of review * update TestScript for descriptor cluster * Restyled by clang-format * update read tagList step in Test_TC_DESC_2_1.yaml * fixes spelling * resume featureMap setting in zap, set while set taglist * fix read tagList step in Test_TC_DESC_2_1.yaml * fix CI error * fix CI error --------- Co-authored-by: Restyled.io <[email protected]>
…9034) project-chip#28753 updated some ZAP files but didn't fix the XML.
Background
Some of the new devices being added in the Fall 2023 release require device composition using the Tag List.
This is not currently achievable via Zap Tool .
fixes: #28098
fixes: #28389
fixes: #27556
Description
I have added two functions in attribute-storage.cpp:
emberAfTagListFromEndpoint
emberAfSetTagList
These can be used by the application to configure it's device's tagList.
My hope is that in the future, Zap Tool can provide this additional data that can be parsed by the initial emberAfEndpointConfigure function when the Chip App is being brought up.
Testing
Manually tested via rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45 chef device using the following ApplicationInit function:
const Clusters::Descriptor::Structs::SemanticTagStruct::Type gTagList[] = { {.namespaceID = 3, .tag = 3}, {.namespaceID = 4, .tag = 5} };
void ApplicationInit()
{
emberAfSetTagList(2, Span(gTagList));
}