From 0b6f89424097a4ca5f4933c29d064b806a48b7f2 Mon Sep 17 00:00:00 2001 From: mideayanghui Date: Fri, 18 Aug 2023 19:01:41 +0800 Subject: [PATCH 01/25] Add TagList support feature in descriptor cluster --- src/app/clusters/descriptor/descriptor.cpp | 23 ++++++++++++++++++ src/app/util/af-types.h | 6 +++++ src/app/util/attribute-storage.cpp | 27 ++++++++++++++++++++++ src/app/util/attribute-storage.h | 13 +++++++++++ 4 files changed, 69 insertions(+) diff --git a/src/app/clusters/descriptor/descriptor.cpp b/src/app/clusters/descriptor/descriptor.cpp index 8d8b318639722e..2efb0430ac76cd 100644 --- a/src/app/clusters/descriptor/descriptor.cpp +++ b/src/app/clusters/descriptor/descriptor.cpp @@ -46,6 +46,7 @@ class DescriptorAttrAccess : public AttributeAccessInterface private: static constexpr uint16_t ClusterRevision = 1; + CHIP_ERROR ReadTagAttribute(EndpointId endpoint, AttributeValueEncoder & aEncoder); CHIP_ERROR ReadPartsAttribute(EndpointId endpoint, AttributeValueEncoder & aEncoder); CHIP_ERROR ReadDeviceAttribute(EndpointId endpoint, AttributeValueEncoder & aEncoder); CHIP_ERROR ReadClientServerAttribute(EndpointId endpoint, AttributeValueEncoder & aEncoder, bool server); @@ -54,6 +55,25 @@ class DescriptorAttrAccess : public AttributeAccessInterface constexpr uint16_t DescriptorAttrAccess::ClusterRevision; +CHIP_ERROR DescriptorAttrAccess::ReadTagAttribute(EndpointId endpoint, AttributeValueEncoder & aEncoder) +{ + CHIP_ERROR err = aEncoder.EncodeList([&endpoint](const auto & encoder) -> CHIP_ERROR { + CHIP_ERROR err2; + + auto tagList = emberAfTagListFromEndpoint(endpoint, err2); + ReturnErrorOnFailure(err2); + + for (auto & tagStruct : tagList) + { + ReturnErrorOnFailure(encoder.Encode(tagStruct)); + } + + return CHIP_NO_ERROR; + }); + + return err; +} + CHIP_ERROR DescriptorAttrAccess::ReadPartsAttribute(EndpointId endpoint, AttributeValueEncoder & aEncoder) { CHIP_ERROR err = CHIP_NO_ERROR; @@ -190,6 +210,9 @@ CHIP_ERROR DescriptorAttrAccess::Read(const ConcreteReadAttributePath & aPath, A case PartsList::Id: { return ReadPartsAttribute(aPath.mEndpointId, aEncoder); } + case TagList::Id: { + return ReadTagAttribute(aPath.mEndpointId, aEncoder); + } case ClusterRevision::Id: { return ReadClusterRevision(aPath.mEndpointId, aEncoder); } diff --git a/src/app/util/af-types.h b/src/app/util/af-types.h index 20ab5fcfc0b508..71fdccbc8f251c 100644 --- a/src/app/util/af-types.h +++ b/src/app/util/af-types.h @@ -40,6 +40,7 @@ #include #include +#include /** * @brief Type for the cluster mask @@ -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 + */ + chip::Span tagList; }; // Cluster specific types diff --git a/src/app/util/attribute-storage.cpp b/src/app/util/attribute-storage.cpp index 118e38f78961f2..781aea5a4673a7 100644 --- a/src/app/util/attribute-storage.cpp +++ b/src/app/util/attribute-storage.cpp @@ -1088,6 +1088,21 @@ chip::Span emberAfDeviceTypeListFromEndpoint(chip::Endp return emAfEndpoints[endpointIndex].deviceTypeList; } +Span emberAfTagListFromEndpoint(chip::EndpointId endpoint, CHIP_ERROR & err) +{ + uint16_t endpointIndex = emberAfIndexFromEndpoint(endpoint); + Span ret; + + if (endpointIndex == 0xFFFF) + { + err = CHIP_ERROR_INVALID_ARGUMENT; + return ret; + } + + err = CHIP_NO_ERROR; + return emAfEndpoints[endpointIndex].tagList; +} + CHIP_ERROR emberAfSetDeviceTypeList(EndpointId endpoint, Span deviceTypeList) { uint16_t endpointIndex = emberAfIndexFromEndpoint(endpoint); @@ -1100,6 +1115,18 @@ CHIP_ERROR emberAfSetDeviceTypeList(EndpointId endpoint, Span tagList) +{ + uint16_t endpointIndex = emberAfIndexFromEndpoint(endpoint); + if (endpointIndex == 0xFFFF) + { + return CHIP_ERROR_INVALID_ARGUMENT; + } + + emAfEndpoints[endpointIndex].tagList = tagList; + return CHIP_NO_ERROR; +} + // Returns the cluster of Nth server or client cluster, // depending on server toggle. const EmberAfCluster * emberAfGetNthCluster(EndpointId endpoint, uint8_t n, bool server) diff --git a/src/app/util/attribute-storage.h b/src/app/util/attribute-storage.h index 91a41570fb84c5..d67b3ed13bdebd 100644 --- a/src/app/util/attribute-storage.h +++ b/src/app/util/attribute-storage.h @@ -201,6 +201,11 @@ const EmberAfCluster * emberAfGetClusterByIndex(chip::EndpointId endpoint, uint8 // chip::Span emberAfDeviceTypeListFromEndpoint(chip::EndpointId endpoint, CHIP_ERROR & err); +// +// Retrieve the tag list associated with a specific endpoint. +// +chip::Span emberAfTagListFromEndpoint(chip::EndpointId endpoint, CHIP_ERROR & err); + // // Over-ride the device type list current associated with an endpoint with a user-provided list. The buffers backing // that list have to live as long as the endpoint is enabled. @@ -209,6 +214,14 @@ chip::Span emberAfDeviceTypeListFromEndpoint(chip::Endp // CHIP_ERROR emberAfSetDeviceTypeList(chip::EndpointId endpoint, chip::Span deviceTypeList); +// +// Over-ride the tag list current associated with an endpoint with a user-provided list. The buffers backing +// that list have to live as long as the endpoint is enabled. +// +// NOTE: It is the application's responsibility to free the existing list that is being replaced if needed. +// +CHIP_ERROR emberAfSetTagList(chip::EndpointId endpoint, chip::Span tagList); + // Register a dynamic endpoint. This involves registering descriptors that describe // the composition of the endpoint (encapsulated in the 'ep' argument) as well as providing // storage for data versions. From a963019d56b4077792f61df901e1ec1ccd563c25 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Fri, 18 Aug 2023 11:19:04 +0000 Subject: [PATCH 02/25] Restyled by clang-format --- src/app/util/attribute-storage.cpp | 3 ++- src/app/util/attribute-storage.h | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/app/util/attribute-storage.cpp b/src/app/util/attribute-storage.cpp index 781aea5a4673a7..b670773eb5e2f5 100644 --- a/src/app/util/attribute-storage.cpp +++ b/src/app/util/attribute-storage.cpp @@ -1088,7 +1088,8 @@ chip::Span emberAfDeviceTypeListFromEndpoint(chip::Endp return emAfEndpoints[endpointIndex].deviceTypeList; } -Span emberAfTagListFromEndpoint(chip::EndpointId endpoint, CHIP_ERROR & err) +Span emberAfTagListFromEndpoint(chip::EndpointId endpoint, + CHIP_ERROR & err) { uint16_t endpointIndex = emberAfIndexFromEndpoint(endpoint); Span ret; diff --git a/src/app/util/attribute-storage.h b/src/app/util/attribute-storage.h index d67b3ed13bdebd..ba9bf06b4c5496 100644 --- a/src/app/util/attribute-storage.h +++ b/src/app/util/attribute-storage.h @@ -204,7 +204,8 @@ chip::Span emberAfDeviceTypeListFromEndpoint(chip::Endp // // Retrieve the tag list associated with a specific endpoint. // -chip::Span emberAfTagListFromEndpoint(chip::EndpointId endpoint, CHIP_ERROR & err); +chip::Span +emberAfTagListFromEndpoint(chip::EndpointId endpoint, CHIP_ERROR & err); // // Over-ride the device type list current associated with an endpoint with a user-provided list. The buffers backing @@ -220,7 +221,8 @@ CHIP_ERROR emberAfSetDeviceTypeList(chip::EndpointId endpoint, chip::Span tagList); +CHIP_ERROR emberAfSetTagList(chip::EndpointId endpoint, + chip::Span tagList); // Register a dynamic endpoint. This involves registering descriptors that describe // the composition of the endpoint (encapsulated in the 'ep' argument) as well as providing From 02c067cd3f261fd5d9e0f05060c0a07f3d28aee7 Mon Sep 17 00:00:00 2001 From: mideayanghui Date: Tue, 22 Aug 2023 19:00:21 +0800 Subject: [PATCH 03/25] Add descriptor in all-cluster-app --- .../all-clusters-app.matter | 12 ++-- .../all-clusters-common/all-clusters-app.zap | 68 +++++++++---------- .../all-clusters-app/linux/main-common.cpp | 5 ++ 3 files changed, 46 insertions(+), 39 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 7fbee2897d73bf..9e2be30a48d8b2 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -558,6 +558,7 @@ server cluster Descriptor = 29 { readonly attribute CLUSTER_ID serverList[] = 1; readonly attribute CLUSTER_ID clientList[] = 2; readonly attribute ENDPOINT_NO partsList[] = 3; + readonly attribute SemanticTagStruct tagList[] = 4; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -6109,7 +6110,7 @@ endpoint 0 { callback attribute eventList; callback attribute attributeList; ram attribute featureMap default = 0; - callback attribute clusterRevision default = 1; + callback attribute clusterRevision default = 2; } server cluster Binding { @@ -6608,12 +6609,13 @@ endpoint 1 { callback attribute serverList; callback attribute clientList; callback attribute partsList; + callback attribute tagList; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 0; - callback attribute clusterRevision default = 1; + ram attribute featureMap default = 1; + callback attribute clusterRevision default = 2; } server cluster Binding { @@ -7612,7 +7614,7 @@ endpoint 2 { callback attribute eventList; callback attribute attributeList; ram attribute featureMap default = 0; - callback attribute clusterRevision default = 1; + callback attribute clusterRevision default = 2; } server cluster PowerSource { @@ -7649,7 +7651,7 @@ endpoint 65534 { callback attribute clientList; callback attribute partsList; ram attribute featureMap default = 0; - callback attribute clusterRevision default = 1; + callback attribute clusterRevision default = 2; } server cluster NetworkCommissioning { diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index 10b38caca7129e..21525c40b06b5e 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -16,6 +16,12 @@ } ], "package": [ + { + "pathRelativity": "relativeToZap", + "path": "../../../src/app/zap-templates/app-templates.json", + "type": "gen-templates-json", + "version": "chip-v1" + }, { "pathRelativity": "relativeToZap", "path": "../../../src/app/zap-templates/zcl/zcl-with-test-extensions.json", @@ -23,20 +29,14 @@ "category": "matter", "version": 1, "description": "Matter SDK ZCL data with some extensions" - }, - { - "pathRelativity": "relativeToZap", - "path": "../../../src/app/zap-templates/app-templates.json", - "type": "gen-templates-json", - "version": "chip-v1" } ], "endpointTypes": [ { - "id": 1, + "id": 17, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 3, + "id": 56, "code": 17, "profileId": 259, "label": "MA-powersource", @@ -44,14 +44,14 @@ }, "deviceTypes": [ { - "id": 3, + "id": 56, "code": 17, "profileId": 259, "label": "MA-powersource", "name": "MA-powersource" }, { - "id": 2, + "id": 55, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -59,8 +59,8 @@ } ], "deviceTypeRefs": [ - 3, - 2 + 56, + 55 ], "deviceVersions": [ 1, @@ -1048,7 +1048,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -10512,10 +10512,10 @@ ] }, { - "id": 2, + "id": 18, "name": "MA-onofflight", "deviceTypeRef": { - "id": 8, + "id": 61, "code": 256, "profileId": 259, "label": "MA-onofflight", @@ -10523,14 +10523,14 @@ }, "deviceTypes": [ { - "id": 8, + "id": 61, "code": 256, "profileId": 259, "label": "MA-onofflight", "name": "MA-onofflight" }, { - "id": 3, + "id": 56, "code": 17, "profileId": 259, "label": "MA-powersource", @@ -10538,8 +10538,8 @@ } ], "deviceTypeRefs": [ - 8, - 3 + 61, + 56 ], "deviceVersions": [ 1, @@ -12403,7 +12403,7 @@ "mfgCode": null, "side": "server", "type": "array", - "included": 0, + "included": 1, "storageOption": "External", "singleton": 0, "bounded": 0, @@ -12487,7 +12487,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": "1", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -12503,7 +12503,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -30401,10 +30401,10 @@ ] }, { - "id": 3, + "id": 19, "name": "MA-onofflight", "deviceTypeRef": { - "id": 8, + "id": 61, "code": 256, "profileId": 259, "label": "MA-onofflight", @@ -30412,14 +30412,14 @@ }, "deviceTypes": [ { - "id": 8, + "id": 61, "code": 256, "profileId": 259, "label": "MA-onofflight", "name": "MA-onofflight" }, { - "id": 3, + "id": 56, "code": 17, "profileId": 259, "label": "MA-powersource", @@ -30427,8 +30427,8 @@ } ], "deviceTypeRefs": [ - 8, - 3 + 61, + 56 ], "deviceVersions": [ 1, @@ -31952,7 +31952,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -34685,10 +34685,10 @@ ] }, { - "id": 4, + "id": 20, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 53, + "id": 106, "code": 61442, "profileId": 259, "label": "MA-secondary-network-commissioning", @@ -34696,7 +34696,7 @@ }, "deviceTypes": [ { - "id": 53, + "id": 106, "code": 61442, "profileId": 259, "label": "MA-secondary-network-commissioning", @@ -34704,7 +34704,7 @@ } ], "deviceTypeRefs": [ - 53 + 106 ], "deviceVersions": [ 1 @@ -34840,7 +34840,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/all-clusters-app/linux/main-common.cpp b/examples/all-clusters-app/linux/main-common.cpp index 3f0c5071b13de1..9a3bac2ae4a0f4 100644 --- a/examples/all-clusters-app/linux/main-common.cpp +++ b/examples/all-clusters-app/linux/main-common.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -58,6 +59,8 @@ AllClustersCommandDelegate sAllClustersCommandDelegate; Clusters::WindowCovering::WindowCoveringManager sWindowCoveringManager; Clusters::TemperatureControl::AppSupportedTemperatureLevelsDelegate sAppSupportedTemperatureLevelsDelegate; + +const Clusters::Descriptor::Structs::SemanticTagStruct::Type gTagList[] = { {.namespaceID = 3, .tag = 3}, {.namespaceID = 4, .tag = 5} }; } // namespace #ifdef EMBER_AF_PLUGIN_DISHWASHER_ALARM_SERVER @@ -185,6 +188,8 @@ void ApplicationInit() MatterDishwasherAlarmServerInit(); #endif Clusters::TemperatureControl::SetInstance(&sAppSupportedTemperatureLevelsDelegate); + + emberAfSetTagList(1, Span(gTagList)); } void ApplicationShutdown() From dbef8aa63cb956fdd1ce16933a435b563240bfb4 Mon Sep 17 00:00:00 2001 From: mideayanghui Date: Tue, 22 Aug 2023 19:06:51 +0800 Subject: [PATCH 04/25] modify descriptor cluster's revision --- src/app/clusters/descriptor/descriptor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/clusters/descriptor/descriptor.cpp b/src/app/clusters/descriptor/descriptor.cpp index 2efb0430ac76cd..d4493bb4b80279 100644 --- a/src/app/clusters/descriptor/descriptor.cpp +++ b/src/app/clusters/descriptor/descriptor.cpp @@ -44,7 +44,7 @@ class DescriptorAttrAccess : public AttributeAccessInterface CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; private: - static constexpr uint16_t ClusterRevision = 1; + static constexpr uint16_t ClusterRevision = 2; CHIP_ERROR ReadTagAttribute(EndpointId endpoint, AttributeValueEncoder & aEncoder); CHIP_ERROR ReadPartsAttribute(EndpointId endpoint, AttributeValueEncoder & aEncoder); From 1d182c088c2386a23698ae3a69d1c52abfc485b3 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Tue, 22 Aug 2023 11:07:30 +0000 Subject: [PATCH 05/25] Restyled by clang-format --- examples/all-clusters-app/linux/main-common.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/all-clusters-app/linux/main-common.cpp b/examples/all-clusters-app/linux/main-common.cpp index 9a3bac2ae4a0f4..84f842fd2ae6a5 100644 --- a/examples/all-clusters-app/linux/main-common.cpp +++ b/examples/all-clusters-app/linux/main-common.cpp @@ -60,7 +60,8 @@ Clusters::WindowCovering::WindowCoveringManager sWindowCoveringManager; Clusters::TemperatureControl::AppSupportedTemperatureLevelsDelegate sAppSupportedTemperatureLevelsDelegate; -const Clusters::Descriptor::Structs::SemanticTagStruct::Type gTagList[] = { {.namespaceID = 3, .tag = 3}, {.namespaceID = 4, .tag = 5} }; +const Clusters::Descriptor::Structs::SemanticTagStruct::Type gTagList[] = { { .namespaceID = 3, .tag = 3 }, + { .namespaceID = 4, .tag = 5 } }; } // namespace #ifdef EMBER_AF_PLUGIN_DISHWASHER_ALARM_SERVER From 82608ff745dd73c861fd026b0c813aa935d47205 Mon Sep 17 00:00:00 2001 From: mideayanghui Date: Wed, 23 Aug 2023 20:37:34 +0800 Subject: [PATCH 06/25] read featureMap before read tag attribute --- src/app/clusters/descriptor/descriptor.cpp | 35 +++++++++++++++------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/src/app/clusters/descriptor/descriptor.cpp b/src/app/clusters/descriptor/descriptor.cpp index d4493bb4b80279..972dfeb83479c1 100644 --- a/src/app/clusters/descriptor/descriptor.cpp +++ b/src/app/clusters/descriptor/descriptor.cpp @@ -20,6 +20,7 @@ * @brief Implementation for the Descriptor Server Cluster ***************************************************************************/ +#include #include #include #include @@ -31,6 +32,7 @@ using namespace chip; using namespace chip::app; using namespace chip::app::Clusters; +using namespace chip::app::Clusters::Descriptor; using namespace chip::app::Clusters::Descriptor::Attributes; namespace { @@ -51,25 +53,38 @@ class DescriptorAttrAccess : public AttributeAccessInterface CHIP_ERROR ReadDeviceAttribute(EndpointId endpoint, AttributeValueEncoder & aEncoder); CHIP_ERROR ReadClientServerAttribute(EndpointId endpoint, AttributeValueEncoder & aEncoder, bool server); CHIP_ERROR ReadClusterRevision(EndpointId endpoint, AttributeValueEncoder & aEncoder); + bool HasFeature(EndpointId endpoint, Feature feature); }; constexpr uint16_t DescriptorAttrAccess::ClusterRevision; +bool DescriptorAttrAccess::HasFeature(EndpointId endpoint, Feature feature) +{ + bool success; + uint32_t featureMap; + success = (FeatureMap::Get(endpoint, &featureMap) == EMBER_ZCL_STATUS_SUCCESS); + + return success ? ((featureMap & to_underlying(feature)) != 0) : false; +} + CHIP_ERROR DescriptorAttrAccess::ReadTagAttribute(EndpointId endpoint, AttributeValueEncoder & aEncoder) { - CHIP_ERROR err = aEncoder.EncodeList([&endpoint](const auto & encoder) -> CHIP_ERROR { - CHIP_ERROR err2; + CHIP_ERROR err = CHIP_NO_ERROR; + if (HasFeature(endpoint, Feature::kTagList)) { + err = aEncoder.EncodeList([&endpoint](const auto & encoder) -> CHIP_ERROR { + CHIP_ERROR err2; - auto tagList = emberAfTagListFromEndpoint(endpoint, err2); - ReturnErrorOnFailure(err2); + auto tagList = emberAfTagListFromEndpoint(endpoint, err2); + ReturnErrorOnFailure(err2); - for (auto & tagStruct : tagList) - { - ReturnErrorOnFailure(encoder.Encode(tagStruct)); - } + for (auto & tagStruct : tagList) + { + ReturnErrorOnFailure(encoder.Encode(tagStruct)); + } - return CHIP_NO_ERROR; - }); + return CHIP_NO_ERROR; + }); + } return err; } From 8282bb0317a49aa530c0af6b5893a74df69d6f17 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Wed, 23 Aug 2023 12:40:01 +0000 Subject: [PATCH 07/25] Restyled by clang-format --- src/app/clusters/descriptor/descriptor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/clusters/descriptor/descriptor.cpp b/src/app/clusters/descriptor/descriptor.cpp index 972dfeb83479c1..d1731351993074 100644 --- a/src/app/clusters/descriptor/descriptor.cpp +++ b/src/app/clusters/descriptor/descriptor.cpp @@ -70,7 +70,8 @@ bool DescriptorAttrAccess::HasFeature(EndpointId endpoint, Feature feature) CHIP_ERROR DescriptorAttrAccess::ReadTagAttribute(EndpointId endpoint, AttributeValueEncoder & aEncoder) { CHIP_ERROR err = CHIP_NO_ERROR; - if (HasFeature(endpoint, Feature::kTagList)) { + if (HasFeature(endpoint, Feature::kTagList)) + { err = aEncoder.EncodeList([&endpoint](const auto & encoder) -> CHIP_ERROR { CHIP_ERROR err2; From 9bd7d97e42dae549331615035af82057d169aa93 Mon Sep 17 00:00:00 2001 From: mideayanghui Date: Wed, 23 Aug 2023 21:01:05 +0800 Subject: [PATCH 08/25] modify the namespace in descriptor cluster --- examples/all-clusters-app/linux/main-common.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/all-clusters-app/linux/main-common.cpp b/examples/all-clusters-app/linux/main-common.cpp index a15fa11a0a98fb..28446ca7e52976 100644 --- a/examples/all-clusters-app/linux/main-common.cpp +++ b/examples/all-clusters-app/linux/main-common.cpp @@ -61,8 +61,9 @@ Clusters::WindowCovering::WindowCoveringManager sWindowCoveringManager; Clusters::TemperatureControl::AppSupportedTemperatureLevelsDelegate sAppSupportedTemperatureLevelsDelegate; -const Clusters::Descriptor::Structs::SemanticTagStruct::Type gTagList[] = { { .namespaceID = 3, .tag = 3 }, - { .namespaceID = 4, .tag = 5 } }; +//Please refer to https://github.com/CHIP-Specifications/connectedhomeip-spec/blob/master/src/namespaces +const Clusters::Descriptor::Structs::SemanticTagStruct::Type gTagList[] = { { .namespaceID = 7, .tag = 0 }, //Common Number Namespace: 7, tag 0 (Zero) + { .namespaceID = 8, .tag = 2 } }; //Common Position Namespace: 8, tag: 2 (Top) } // namespace #ifdef EMBER_AF_PLUGIN_DISHWASHER_ALARM_SERVER From a7bdccc755f86985e33115849f7b2fc04323bf2c Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Wed, 23 Aug 2023 13:01:33 +0000 Subject: [PATCH 09/25] Restyled by clang-format --- examples/all-clusters-app/linux/main-common.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/all-clusters-app/linux/main-common.cpp b/examples/all-clusters-app/linux/main-common.cpp index 28446ca7e52976..57580b5c77687d 100644 --- a/examples/all-clusters-app/linux/main-common.cpp +++ b/examples/all-clusters-app/linux/main-common.cpp @@ -61,9 +61,11 @@ Clusters::WindowCovering::WindowCoveringManager sWindowCoveringManager; Clusters::TemperatureControl::AppSupportedTemperatureLevelsDelegate sAppSupportedTemperatureLevelsDelegate; -//Please refer to https://github.com/CHIP-Specifications/connectedhomeip-spec/blob/master/src/namespaces -const Clusters::Descriptor::Structs::SemanticTagStruct::Type gTagList[] = { { .namespaceID = 7, .tag = 0 }, //Common Number Namespace: 7, tag 0 (Zero) - { .namespaceID = 8, .tag = 2 } }; //Common Position Namespace: 8, tag: 2 (Top) +// Please refer to https://github.com/CHIP-Specifications/connectedhomeip-spec/blob/master/src/namespaces +const Clusters::Descriptor::Structs::SemanticTagStruct::Type gTagList[] = { + { .namespaceID = 7, .tag = 0 }, // Common Number Namespace: 7, tag 0 (Zero) + { .namespaceID = 8, .tag = 2 } +}; // Common Position Namespace: 8, tag: 2 (Top) } // namespace #ifdef EMBER_AF_PLUGIN_DISHWASHER_ALARM_SERVER From e82e0a0807b70cfd91f6eb8ff6434f2f9a6af061 Mon Sep 17 00:00:00 2001 From: mideayanghui Date: Thu, 24 Aug 2023 17:59:08 +0800 Subject: [PATCH 10/25] Optimize the descriptor cluster with review suggestion --- examples/all-clusters-app/linux/main-common.cpp | 14 ++++++++++---- src/app/clusters/descriptor/descriptor.cpp | 2 +- src/app/util/attribute-storage.cpp | 7 +++---- src/app/util/attribute-storage.h | 4 ++-- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/examples/all-clusters-app/linux/main-common.cpp b/examples/all-clusters-app/linux/main-common.cpp index 57580b5c77687d..03e9cc7413e186 100644 --- a/examples/all-clusters-app/linux/main-common.cpp +++ b/examples/all-clusters-app/linux/main-common.cpp @@ -62,10 +62,16 @@ Clusters::WindowCovering::WindowCoveringManager sWindowCoveringManager; Clusters::TemperatureControl::AppSupportedTemperatureLevelsDelegate sAppSupportedTemperatureLevelsDelegate; // Please refer to https://github.com/CHIP-Specifications/connectedhomeip-spec/blob/master/src/namespaces +// Common Number Namespace: 7, tag 0 (Zero) +constexpr const uint8_t CommonNumNamespace = 7; +constexpr const uint8_t TagNumZero = 0; +// Common Position Namespace: 8, tag: 2 (Top) +constexpr const uint8_t CommonPositionNamespace = 8; +constexpr const uint8_t TagNumTop = 2; const Clusters::Descriptor::Structs::SemanticTagStruct::Type gTagList[] = { - { .namespaceID = 7, .tag = 0 }, // Common Number Namespace: 7, tag 0 (Zero) - { .namespaceID = 8, .tag = 2 } -}; // Common Position Namespace: 8, tag: 2 (Top) + { .namespaceID = CommonNumNamespace, .tag = TagNumZero }, + { .namespaceID = CommonPositionNamespace, .tag = TagNumTop } +}; } // namespace #ifdef EMBER_AF_PLUGIN_DISHWASHER_ALARM_SERVER @@ -194,7 +200,7 @@ void ApplicationInit() #endif Clusters::TemperatureControl::SetInstance(&sAppSupportedTemperatureLevelsDelegate); - emberAfSetTagList(1, Span(gTagList)); + SetTagList(/* endpoint= */1, Span(gTagList)); } void ApplicationShutdown() diff --git a/src/app/clusters/descriptor/descriptor.cpp b/src/app/clusters/descriptor/descriptor.cpp index d1731351993074..f8353b73b0b6d3 100644 --- a/src/app/clusters/descriptor/descriptor.cpp +++ b/src/app/clusters/descriptor/descriptor.cpp @@ -75,7 +75,7 @@ CHIP_ERROR DescriptorAttrAccess::ReadTagAttribute(EndpointId endpoint, Attribute err = aEncoder.EncodeList([&endpoint](const auto & encoder) -> CHIP_ERROR { CHIP_ERROR err2; - auto tagList = emberAfTagListFromEndpoint(endpoint, err2); + auto tagList = GetTagListFromEndpoint(endpoint, err2); ReturnErrorOnFailure(err2); for (auto & tagStruct : tagList) diff --git a/src/app/util/attribute-storage.cpp b/src/app/util/attribute-storage.cpp index b670773eb5e2f5..9d177842c38f72 100644 --- a/src/app/util/attribute-storage.cpp +++ b/src/app/util/attribute-storage.cpp @@ -1088,16 +1088,15 @@ chip::Span emberAfDeviceTypeListFromEndpoint(chip::Endp return emAfEndpoints[endpointIndex].deviceTypeList; } -Span emberAfTagListFromEndpoint(chip::EndpointId endpoint, +Span GetTagListFromEndpoint(chip::EndpointId endpoint, CHIP_ERROR & err) { uint16_t endpointIndex = emberAfIndexFromEndpoint(endpoint); - Span ret; if (endpointIndex == 0xFFFF) { err = CHIP_ERROR_INVALID_ARGUMENT; - return ret; + return Span{}; } err = CHIP_NO_ERROR; @@ -1116,7 +1115,7 @@ CHIP_ERROR emberAfSetDeviceTypeList(EndpointId endpoint, Span tagList) +CHIP_ERROR SetTagList(EndpointId endpoint, Span tagList) { uint16_t endpointIndex = emberAfIndexFromEndpoint(endpoint); if (endpointIndex == 0xFFFF) diff --git a/src/app/util/attribute-storage.h b/src/app/util/attribute-storage.h index ba9bf06b4c5496..bac0aa860f6e3e 100644 --- a/src/app/util/attribute-storage.h +++ b/src/app/util/attribute-storage.h @@ -205,7 +205,7 @@ chip::Span emberAfDeviceTypeListFromEndpoint(chip::Endp // Retrieve the tag list associated with a specific endpoint. // chip::Span -emberAfTagListFromEndpoint(chip::EndpointId endpoint, CHIP_ERROR & err); +GetTagListFromEndpoint(chip::EndpointId endpoint, CHIP_ERROR & err); // // Over-ride the device type list current associated with an endpoint with a user-provided list. The buffers backing @@ -221,7 +221,7 @@ CHIP_ERROR emberAfSetDeviceTypeList(chip::EndpointId endpoint, chip::Span tagList); // Register a dynamic endpoint. This involves registering descriptors that describe From 5127572d213bb9810b16b5b169f1d1641cae62fe Mon Sep 17 00:00:00 2001 From: mideayanghui Date: Thu, 24 Aug 2023 19:59:13 +0800 Subject: [PATCH 11/25] Optimize GetTagListFromEndpointAtIndex api and add ReadFeatureMap api --- src/app/clusters/descriptor/descriptor.cpp | 51 ++++++++++++---------- src/app/util/attribute-storage.cpp | 14 +++--- src/app/util/attribute-storage.h | 15 ++++--- 3 files changed, 45 insertions(+), 35 deletions(-) diff --git a/src/app/clusters/descriptor/descriptor.cpp b/src/app/clusters/descriptor/descriptor.cpp index f8353b73b0b6d3..ff0fa2c2ce8573 100644 --- a/src/app/clusters/descriptor/descriptor.cpp +++ b/src/app/clusters/descriptor/descriptor.cpp @@ -53,41 +53,41 @@ class DescriptorAttrAccess : public AttributeAccessInterface CHIP_ERROR ReadDeviceAttribute(EndpointId endpoint, AttributeValueEncoder & aEncoder); CHIP_ERROR ReadClientServerAttribute(EndpointId endpoint, AttributeValueEncoder & aEncoder, bool server); CHIP_ERROR ReadClusterRevision(EndpointId endpoint, AttributeValueEncoder & aEncoder); - bool HasFeature(EndpointId endpoint, Feature feature); + CHIP_ERROR ReadFeatureMap(EndpointId endpoint, AttributeValueEncoder & aEncoder); }; constexpr uint16_t DescriptorAttrAccess::ClusterRevision; -bool DescriptorAttrAccess::HasFeature(EndpointId endpoint, Feature feature) +CHIP_ERROR DescriptorAttrAccess::ReadFeatureMap(EndpointId endpoint, AttributeValueEncoder & aEncoder) { - bool success; - uint32_t featureMap; - success = (FeatureMap::Get(endpoint, &featureMap) == EMBER_ZCL_STATUS_SUCCESS); + Clusters::Descriptor::Structs::SemanticTagStruct::Type tag; + size_t index = 0; + BitFlags featureFlags; - return success ? ((featureMap & to_underlying(feature)) != 0) : false; + if (GetTagListFromEndpointAtIndex(endpoint, index, tag) == CHIP_NO_ERROR) + { + featureFlags.Set(Feature::kTagList); + } + return aEncoder.Encode(featureFlags); } CHIP_ERROR DescriptorAttrAccess::ReadTagAttribute(EndpointId endpoint, AttributeValueEncoder & aEncoder) { - CHIP_ERROR err = CHIP_NO_ERROR; - if (HasFeature(endpoint, Feature::kTagList)) - { - err = aEncoder.EncodeList([&endpoint](const auto & encoder) -> CHIP_ERROR { - CHIP_ERROR err2; - - auto tagList = GetTagListFromEndpoint(endpoint, err2); - ReturnErrorOnFailure(err2); - - for (auto & tagStruct : tagList) - { - ReturnErrorOnFailure(encoder.Encode(tagStruct)); - } - + return aEncoder.EncodeList([&endpoint](const auto & encoder) -> CHIP_ERROR { + Clusters::Descriptor::Structs::SemanticTagStruct::Type tag; + size_t index = 0; + CHIP_ERROR err = CHIP_NO_ERROR; + while ((err = GetTagListFromEndpointAtIndex(endpoint, index, tag)) == CHIP_NO_ERROR) + { + ReturnErrorOnFailure(encoder.Encode(tag)); + index++; + } + if (err == CHIP_ERROR_NOT_FOUND || err == CHIP_ERROR_INVALID_ARGUMENT) + { return CHIP_NO_ERROR; - }); - } - - return err; + } + return err; + }); } CHIP_ERROR DescriptorAttrAccess::ReadPartsAttribute(EndpointId endpoint, AttributeValueEncoder & aEncoder) @@ -232,6 +232,9 @@ CHIP_ERROR DescriptorAttrAccess::Read(const ConcreteReadAttributePath & aPath, A case ClusterRevision::Id: { return ReadClusterRevision(aPath.mEndpointId, aEncoder); } + case FeatureMap::Id: { + return ReadFeatureMap(aPath.mEndpointId, aEncoder); + } default: { break; } diff --git a/src/app/util/attribute-storage.cpp b/src/app/util/attribute-storage.cpp index 9d177842c38f72..a2fdc7a57954b5 100644 --- a/src/app/util/attribute-storage.cpp +++ b/src/app/util/attribute-storage.cpp @@ -1088,19 +1088,21 @@ chip::Span emberAfDeviceTypeListFromEndpoint(chip::Endp return emAfEndpoints[endpointIndex].deviceTypeList; } -Span GetTagListFromEndpoint(chip::EndpointId endpoint, - CHIP_ERROR & err) +CHIP_ERROR GetTagListFromEndpointAtIndex(EndpointId endpoint, size_t index, Clusters::Descriptor::Structs::SemanticTagStruct::Type & tag) { uint16_t endpointIndex = emberAfIndexFromEndpoint(endpoint); if (endpointIndex == 0xFFFF) { - err = CHIP_ERROR_INVALID_ARGUMENT; - return Span{}; + return CHIP_ERROR_INVALID_ARGUMENT; } - err = CHIP_NO_ERROR; - return emAfEndpoints[endpointIndex].tagList; + if (index >= emAfEndpoints[endpointIndex].tagList.size()) + { + return CHIP_ERROR_NOT_FOUND; + } + tag = emAfEndpoints[endpointIndex].tagList[index]; + return CHIP_NO_ERROR; } CHIP_ERROR emberAfSetDeviceTypeList(EndpointId endpoint, Span deviceTypeList) diff --git a/src/app/util/attribute-storage.h b/src/app/util/attribute-storage.h index bac0aa860f6e3e..3a78536ab4d10e 100644 --- a/src/app/util/attribute-storage.h +++ b/src/app/util/attribute-storage.h @@ -201,11 +201,16 @@ const EmberAfCluster * emberAfGetClusterByIndex(chip::EndpointId endpoint, uint8 // chip::Span emberAfDeviceTypeListFromEndpoint(chip::EndpointId endpoint, CHIP_ERROR & err); -// -// Retrieve the tag list associated with a specific endpoint. -// -chip::Span -GetTagListFromEndpoint(chip::EndpointId endpoint, CHIP_ERROR & err); +/** + * 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, + * or returns CHIP_ERROR_INVALID_ARGUMENT if the endpoint is invalid. + * @param endpoint The target endpoint. + * @param index The index of the tag, with 0 representing the first tag. + * @param tag The SemanticTagStruct is filled. + */ +CHIP_ERROR GetTagListFromEndpointAtIndex(chip::EndpointId endpoint, size_t index, chip::app::Clusters::Descriptor::Structs::SemanticTagStruct::Type & tag); // // Over-ride the device type list current associated with an endpoint with a user-provided list. The buffers backing From f38007a1ea87e9b9520bdb11e6320d3fa717f1f0 Mon Sep 17 00:00:00 2001 From: mideayanghui Date: Thu, 24 Aug 2023 20:20:33 +0800 Subject: [PATCH 12/25] Add read taglist and featureMap in TestDescriptorCluster.yaml --- .../tests/suites/TestDescriptorCluster.yaml | 16 +++++ .../zap-generated/test/Commands.h | 66 ++++++++++++++++++- 2 files changed, 81 insertions(+), 1 deletion(-) diff --git a/src/app/tests/suites/TestDescriptorCluster.yaml b/src/app/tests/suites/TestDescriptorCluster.yaml index eb822dd28450a1..28d3d5d4aac884 100644 --- a/src/app/tests/suites/TestDescriptorCluster.yaml +++ b/src/app/tests/suites/TestDescriptorCluster.yaml @@ -84,3 +84,19 @@ tests: attribute: "PartsList" response: value: [1, 2] + + - label: "Read attribute Tag list" + command: "readAttribute" + attribute: "TagList" + response: + value: + [{ MfgCode: null, NamespaceID: 7, Tag: 0 }, { MfgCode: null, NamespaceID: 8, Tag: 2 }] + + - label: "Read feature map Attribute" + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: bitmap32 + hasMasksSet: [0x1] + diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index 140f8444f563dd..7e46e1a7584f24 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -140842,6 +140842,14 @@ class TestDescriptorCluster : public TestCommandBridge { ChipLogProgress(chipTool, " ***** Test Step 4 : Read attribute Parts list\n"); err = TestReadAttributePartsList_4(); break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read attribute Tag list\n"); + err = TestReadAttributeTagList_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Read feature map Attribute\n"); + err = TestReadFeatureMapAttribute_6(); + break; } if (CHIP_NO_ERROR != err) { @@ -140868,6 +140876,12 @@ class TestDescriptorCluster : public TestCommandBridge { case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -140881,7 +140895,7 @@ class TestDescriptorCluster : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; + const uint16_t mTestCount = 7; chip::Optional mNodeId; chip::Optional mCluster; @@ -141025,6 +141039,56 @@ class TestDescriptorCluster : public TestCommandBridge { return CHIP_NO_ERROR; } + + CHIP_ERROR TestReadAttributeTagList_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterDescriptor alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeTagListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute Tag list Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("TagList", [actualValue count], static_cast(2))); + VerifyOrReturn(CheckValueNull("MfgCode", ((MTRDescriptorClusterSemanticTagStruct *) actualValue[0]).mfgCode)); + VerifyOrReturn( + CheckValue("NamespaceID", ((MTRDescriptorClusterSemanticTagStruct *) actualValue[0]).namespaceID, 7U)); + VerifyOrReturn(CheckValue("Tag", ((MTRDescriptorClusterSemanticTagStruct *) actualValue[0]).tag, 0U)); + VerifyOrReturn(CheckValueNull("MfgCode", ((MTRDescriptorClusterSemanticTagStruct *) actualValue[1]).mfgCode)); + VerifyOrReturn( + CheckValue("NamespaceID", ((MTRDescriptorClusterSemanticTagStruct *) actualValue[1]).namespaceID, 8U)); + VerifyOrReturn(CheckValue("Tag", ((MTRDescriptorClusterSemanticTagStruct *) actualValue[1]).tag, 2U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadFeatureMapAttribute_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterDescriptor alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read feature map Attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } }; class TestBasicInformation : public TestCommandBridge { From 2ede8675bdda230d540c5357cc87cc4a90adb2ae Mon Sep 17 00:00:00 2001 From: mideayanghui Date: Thu, 24 Aug 2023 22:02:39 +0800 Subject: [PATCH 13/25] zap regen --- .../all-clusters-app.matter | 6 +- .../all-clusters-common/all-clusters-app.zap | 282 +++++++++--------- 2 files changed, 145 insertions(+), 143 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 9316ca0707e7a5..47d33df0cc3188 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -558,6 +558,7 @@ server cluster Descriptor = 29 { readonly attribute CLUSTER_ID serverList[] = 1; readonly attribute CLUSTER_ID clientList[] = 2; readonly attribute ENDPOINT_NO partsList[] = 3; + readonly attribute SemanticTagStruct tagList[] = 4; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -6634,12 +6635,13 @@ endpoint 1 { callback attribute serverList; callback attribute clientList; callback attribute partsList; + callback attribute tagList; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 0; - callback attribute clusterRevision default = 1; + ram attribute featureMap default = 1; + callback attribute clusterRevision default = 2; } server cluster Binding { diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index a020f5c9b9788d..ac3c5e94ffdf95 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -16,12 +16,6 @@ } ], "package": [ - { - "pathRelativity": "relativeToZap", - "path": "../../../src/app/zap-templates/app-templates.json", - "type": "gen-templates-json", - "version": "chip-v1" - }, { "pathRelativity": "relativeToZap", "path": "../../../src/app/zap-templates/zcl/zcl-with-test-extensions.json", @@ -29,14 +23,20 @@ "category": "matter", "version": 1, "description": "Matter SDK ZCL data with some extensions" + }, + { + "pathRelativity": "relativeToZap", + "path": "../../../src/app/zap-templates/app-templates.json", + "type": "gen-templates-json", + "version": "chip-v1" } ], "endpointTypes": [ { - "id": 4, + "id": 5, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 56, + "id": 3, "code": 17, "profileId": 259, "label": "MA-powersource", @@ -44,14 +44,14 @@ }, "deviceTypes": [ { - "id": 56, + "id": 3, "code": 17, "profileId": 259, "label": "MA-powersource", "name": "MA-powersource" }, { - "id": 55, + "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -59,8 +59,8 @@ } ], "deviceTypeRefs": [ - 56, - 55 + 3, + 2 ], "deviceVersions": [ 1, @@ -10512,10 +10512,10 @@ ] }, { - "id": 7, + "id": 8, "name": "MA-onofflight", "deviceTypeRef": { - "id": 61, + "id": 8, "code": 256, "profileId": 259, "label": "MA-onofflight", @@ -10523,14 +10523,14 @@ }, "deviceTypes": [ { - "id": 61, + "id": 8, "code": 256, "profileId": 259, "label": "MA-onofflight", "name": "MA-onofflight" }, { - "id": 56, + "id": 3, "code": 17, "profileId": 259, "label": "MA-powersource", @@ -10538,8 +10538,8 @@ } ], "deviceTypeRefs": [ - 61, - 56 + 8, + 3 ], "deviceVersions": [ 1, @@ -12403,7 +12403,7 @@ "mfgCode": null, "side": "server", "type": "array", - "included": 0, + "included": 1, "storageOption": "External", "singleton": 0, "bounded": 0, @@ -12487,7 +12487,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": "1", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -12503,7 +12503,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -23943,7 +23943,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "401", @@ -23959,7 +23959,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "50", @@ -23975,7 +23975,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1500", @@ -23991,7 +23991,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "511", @@ -24007,7 +24007,7 @@ "side": "server", "type": "elapsed_s", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "3600", @@ -24023,7 +24023,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "213", @@ -24039,7 +24039,7 @@ "side": "server", "type": "elapsed_s", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "3600", @@ -24055,7 +24055,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "10", @@ -24071,7 +24071,7 @@ "side": "server", "type": "MeasurementUnitEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -24087,7 +24087,7 @@ "side": "server", "type": "MeasurementMediumEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -24103,7 +24103,7 @@ "side": "server", "type": "LevelValueEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "3", @@ -24267,7 +24267,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "458", @@ -24283,7 +24283,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "300", @@ -24299,7 +24299,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "2000", @@ -24315,7 +24315,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "523", @@ -24331,7 +24331,7 @@ "side": "server", "type": "elapsed_s", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "3600", @@ -24347,7 +24347,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "421", @@ -24363,7 +24363,7 @@ "side": "server", "type": "elapsed_s", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "3600", @@ -24379,7 +24379,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "5", @@ -24395,7 +24395,7 @@ "side": "server", "type": "MeasurementUnitEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -24411,7 +24411,7 @@ "side": "server", "type": "MeasurementMediumEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -24427,7 +24427,7 @@ "side": "server", "type": "LevelValueEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -24591,7 +24591,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "3", @@ -24607,7 +24607,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -24623,7 +24623,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "150", @@ -24639,7 +24639,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "3", @@ -24655,7 +24655,7 @@ "side": "server", "type": "elapsed_s", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "120", @@ -24671,7 +24671,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "3", @@ -24687,7 +24687,7 @@ "side": "server", "type": "elapsed_s", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "120", @@ -24703,7 +24703,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -24719,7 +24719,7 @@ "side": "server", "type": "MeasurementUnitEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -24735,7 +24735,7 @@ "side": "server", "type": "MeasurementMediumEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -24751,7 +24751,7 @@ "side": "server", "type": "LevelValueEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -24915,7 +24915,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "10", @@ -24931,7 +24931,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "3", @@ -24947,7 +24947,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "300", @@ -24963,7 +24963,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "50", @@ -24979,7 +24979,7 @@ "side": "server", "type": "elapsed_s", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "3600", @@ -24995,7 +24995,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "20", @@ -25011,7 +25011,7 @@ "side": "server", "type": "elapsed_s", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "3600", @@ -25027,7 +25027,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -25043,7 +25043,7 @@ "side": "server", "type": "MeasurementUnitEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -25059,7 +25059,7 @@ "side": "server", "type": "MeasurementMediumEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -25075,7 +25075,7 @@ "side": "server", "type": "LevelValueEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -25239,7 +25239,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "42", @@ -25255,7 +25255,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -25271,7 +25271,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "400", @@ -25287,7 +25287,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "90", @@ -25303,7 +25303,7 @@ "side": "server", "type": "elapsed_s", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "3600", @@ -25319,7 +25319,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "35", @@ -25335,7 +25335,7 @@ "side": "server", "type": "elapsed_s", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "3600", @@ -25351,7 +25351,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "4", @@ -25367,7 +25367,7 @@ "side": "server", "type": "MeasurementUnitEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "4", @@ -25383,7 +25383,7 @@ "side": "server", "type": "MeasurementMediumEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -25399,7 +25399,7 @@ "side": "server", "type": "LevelValueEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "2", @@ -25563,7 +25563,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "10", @@ -25579,7 +25579,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -25595,7 +25595,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "200", @@ -25611,7 +25611,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "10", @@ -25627,7 +25627,7 @@ "side": "server", "type": "elapsed_s", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "7200", @@ -25643,7 +25643,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "2", @@ -25659,7 +25659,7 @@ "side": "server", "type": "elapsed_s", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "7200", @@ -25675,7 +25675,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -25691,7 +25691,7 @@ "side": "server", "type": "MeasurementUnitEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "3", @@ -25707,7 +25707,7 @@ "side": "server", "type": "MeasurementMediumEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -25723,7 +25723,7 @@ "side": "server", "type": "LevelValueEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "2", @@ -25887,7 +25887,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "39", @@ -25903,7 +25903,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -25919,7 +25919,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "400", @@ -25935,7 +25935,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "70", @@ -25951,7 +25951,7 @@ "side": "server", "type": "elapsed_s", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "3600", @@ -25967,7 +25967,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "41", @@ -25983,7 +25983,7 @@ "side": "server", "type": "elapsed_s", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "3600", @@ -25999,7 +25999,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "4", @@ -26015,7 +26015,7 @@ "side": "server", "type": "MeasurementUnitEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "4", @@ -26031,7 +26031,7 @@ "side": "server", "type": "MeasurementMediumEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -26047,7 +26047,7 @@ "side": "server", "type": "LevelValueEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -26211,7 +26211,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "7", @@ -26227,7 +26227,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "2", @@ -26243,7 +26243,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "400", @@ -26259,7 +26259,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "49", @@ -26275,7 +26275,7 @@ "side": "server", "type": "elapsed_s", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "3600", @@ -26291,7 +26291,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "43", @@ -26307,7 +26307,7 @@ "side": "server", "type": "elapsed_s", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "3600", @@ -26323,7 +26323,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "2", @@ -26339,7 +26339,7 @@ "side": "server", "type": "MeasurementUnitEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "4", @@ -26355,7 +26355,7 @@ "side": "server", "type": "MeasurementMediumEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -26371,7 +26371,7 @@ "side": "server", "type": "LevelValueEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -26535,7 +26535,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "5", @@ -26551,7 +26551,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -26567,7 +26567,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "100", @@ -26583,7 +26583,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "8", @@ -26599,7 +26599,7 @@ "side": "server", "type": "elapsed_s", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "3600", @@ -26615,7 +26615,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "2", @@ -26631,7 +26631,7 @@ "side": "server", "type": "elapsed_s", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "3600", @@ -26647,7 +26647,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -26663,7 +26663,7 @@ "side": "server", "type": "MeasurementUnitEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -26679,7 +26679,7 @@ "side": "server", "type": "MeasurementMediumEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -26695,7 +26695,7 @@ "side": "server", "type": "LevelValueEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -26859,7 +26859,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "10", @@ -26875,7 +26875,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "5", @@ -26891,7 +26891,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "100", @@ -26907,7 +26907,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "36", @@ -26923,7 +26923,7 @@ "side": "server", "type": "elapsed_s", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "3600", @@ -26939,7 +26939,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "20", @@ -26955,7 +26955,7 @@ "side": "server", "type": "elapsed_s", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "3600", @@ -26971,7 +26971,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -26987,7 +26987,7 @@ "side": "server", "type": "MeasurementUnitEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -27003,7 +27003,7 @@ "side": "server", "type": "MeasurementMediumEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -27019,7 +27019,7 @@ "side": "server", "type": "LevelValueEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "3", @@ -30613,10 +30613,10 @@ ] }, { - "id": 5, + "id": 6, "name": "MA-onofflight", "deviceTypeRef": { - "id": 61, + "id": 8, "code": 256, "profileId": 259, "label": "MA-onofflight", @@ -30624,14 +30624,14 @@ }, "deviceTypes": [ { - "id": 61, + "id": 8, "code": 256, "profileId": 259, "label": "MA-onofflight", "name": "MA-onofflight" }, { - "id": 56, + "id": 3, "code": 17, "profileId": 259, "label": "MA-powersource", @@ -30639,8 +30639,8 @@ } ], "deviceTypeRefs": [ - 61, - 56 + 8, + 3 ], "deviceVersions": [ 1, @@ -34897,10 +34897,10 @@ ] }, { - "id": 6, + "id": 7, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 106, + "id": 53, "code": 61442, "profileId": 259, "label": "MA-secondary-network-commissioning", @@ -34908,7 +34908,7 @@ }, "deviceTypes": [ { - "id": 106, + "id": 53, "code": 61442, "profileId": 259, "label": "MA-secondary-network-commissioning", @@ -34916,7 +34916,7 @@ } ], "deviceTypeRefs": [ - 106 + 53 ], "deviceVersions": [ 1 From d784a8977f6eebbba69e55c36b25e046eb7e6e59 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Thu, 24 Aug 2023 14:03:26 +0000 Subject: [PATCH 14/25] Restyled by whitespace --- src/app/tests/suites/TestDescriptorCluster.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/tests/suites/TestDescriptorCluster.yaml b/src/app/tests/suites/TestDescriptorCluster.yaml index 28d3d5d4aac884..f2662e9ede8973 100644 --- a/src/app/tests/suites/TestDescriptorCluster.yaml +++ b/src/app/tests/suites/TestDescriptorCluster.yaml @@ -99,4 +99,3 @@ tests: constraints: type: bitmap32 hasMasksSet: [0x1] - From fa25b618c5b9c981bfeb018efae9561384915cf7 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Thu, 24 Aug 2023 14:03:31 +0000 Subject: [PATCH 15/25] Restyled by clang-format --- examples/all-clusters-app/linux/main-common.cpp | 11 +++++------ src/app/clusters/descriptor/descriptor.cpp | 2 +- src/app/util/attribute-storage.cpp | 3 ++- src/app/util/attribute-storage.h | 5 +++-- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/examples/all-clusters-app/linux/main-common.cpp b/examples/all-clusters-app/linux/main-common.cpp index 03e9cc7413e186..b9065404d9fbeb 100644 --- a/examples/all-clusters-app/linux/main-common.cpp +++ b/examples/all-clusters-app/linux/main-common.cpp @@ -64,13 +64,12 @@ Clusters::TemperatureControl::AppSupportedTemperatureLevelsDelegate sAppSupporte // Please refer to https://github.com/CHIP-Specifications/connectedhomeip-spec/blob/master/src/namespaces // Common Number Namespace: 7, tag 0 (Zero) constexpr const uint8_t CommonNumNamespace = 7; -constexpr const uint8_t TagNumZero = 0; +constexpr const uint8_t TagNumZero = 0; // Common Position Namespace: 8, tag: 2 (Top) -constexpr const uint8_t CommonPositionNamespace = 8; -constexpr const uint8_t TagNumTop = 2; +constexpr const uint8_t CommonPositionNamespace = 8; +constexpr const uint8_t TagNumTop = 2; const Clusters::Descriptor::Structs::SemanticTagStruct::Type gTagList[] = { - { .namespaceID = CommonNumNamespace, .tag = TagNumZero }, - { .namespaceID = CommonPositionNamespace, .tag = TagNumTop } + { .namespaceID = CommonNumNamespace, .tag = TagNumZero }, { .namespaceID = CommonPositionNamespace, .tag = TagNumTop } }; } // namespace @@ -200,7 +199,7 @@ void ApplicationInit() #endif Clusters::TemperatureControl::SetInstance(&sAppSupportedTemperatureLevelsDelegate); - SetTagList(/* endpoint= */1, Span(gTagList)); + SetTagList(/* endpoint= */ 1, Span(gTagList)); } void ApplicationShutdown() diff --git a/src/app/clusters/descriptor/descriptor.cpp b/src/app/clusters/descriptor/descriptor.cpp index ff0fa2c2ce8573..0b112a0d2f5efd 100644 --- a/src/app/clusters/descriptor/descriptor.cpp +++ b/src/app/clusters/descriptor/descriptor.cpp @@ -61,7 +61,7 @@ constexpr uint16_t DescriptorAttrAccess::ClusterRevision; CHIP_ERROR DescriptorAttrAccess::ReadFeatureMap(EndpointId endpoint, AttributeValueEncoder & aEncoder) { Clusters::Descriptor::Structs::SemanticTagStruct::Type tag; - size_t index = 0; + size_t index = 0; BitFlags featureFlags; if (GetTagListFromEndpointAtIndex(endpoint, index, tag) == CHIP_NO_ERROR) diff --git a/src/app/util/attribute-storage.cpp b/src/app/util/attribute-storage.cpp index a2fdc7a57954b5..e01d5faf7ec23e 100644 --- a/src/app/util/attribute-storage.cpp +++ b/src/app/util/attribute-storage.cpp @@ -1088,7 +1088,8 @@ chip::Span emberAfDeviceTypeListFromEndpoint(chip::Endp return emAfEndpoints[endpointIndex].deviceTypeList; } -CHIP_ERROR GetTagListFromEndpointAtIndex(EndpointId endpoint, size_t index, Clusters::Descriptor::Structs::SemanticTagStruct::Type & tag) +CHIP_ERROR GetTagListFromEndpointAtIndex(EndpointId endpoint, size_t index, + Clusters::Descriptor::Structs::SemanticTagStruct::Type & tag) { uint16_t endpointIndex = emberAfIndexFromEndpoint(endpoint); diff --git a/src/app/util/attribute-storage.h b/src/app/util/attribute-storage.h index 3a78536ab4d10e..ca7cb326e228cf 100644 --- a/src/app/util/attribute-storage.h +++ b/src/app/util/attribute-storage.h @@ -210,7 +210,8 @@ chip::Span emberAfDeviceTypeListFromEndpoint(chip::Endp * @param index The index of the tag, with 0 representing the first tag. * @param tag The SemanticTagStruct is filled. */ -CHIP_ERROR GetTagListFromEndpointAtIndex(chip::EndpointId endpoint, size_t index, chip::app::Clusters::Descriptor::Structs::SemanticTagStruct::Type & tag); +CHIP_ERROR GetTagListFromEndpointAtIndex(chip::EndpointId endpoint, size_t index, + chip::app::Clusters::Descriptor::Structs::SemanticTagStruct::Type & tag); // // Over-ride the device type list current associated with an endpoint with a user-provided list. The buffers backing @@ -227,7 +228,7 @@ CHIP_ERROR emberAfSetDeviceTypeList(chip::EndpointId endpoint, chip::Span tagList); + chip::Span tagList); // Register a dynamic endpoint. This involves registering descriptors that describe // the composition of the endpoint (encapsulated in the 'ep' argument) as well as providing From 056f8bfbac4b769d517f5ed65d7ad8c022c2bc44 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Thu, 24 Aug 2023 14:03:34 +0000 Subject: [PATCH 16/25] Restyled by prettier-yaml --- src/app/tests/suites/TestDescriptorCluster.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app/tests/suites/TestDescriptorCluster.yaml b/src/app/tests/suites/TestDescriptorCluster.yaml index f2662e9ede8973..977bb385d90504 100644 --- a/src/app/tests/suites/TestDescriptorCluster.yaml +++ b/src/app/tests/suites/TestDescriptorCluster.yaml @@ -90,7 +90,10 @@ tests: attribute: "TagList" response: value: - [{ MfgCode: null, NamespaceID: 7, Tag: 0 }, { MfgCode: null, NamespaceID: 8, Tag: 2 }] + [ + { MfgCode: null, NamespaceID: 7, Tag: 0 }, + { MfgCode: null, NamespaceID: 8, Tag: 2 }, + ] - label: "Read feature map Attribute" command: "readAttribute" From 2d4f4f6991117d92f2a10b271a1a2ff065aac196 Mon Sep 17 00:00:00 2001 From: mideayanghui Date: Fri, 25 Aug 2023 09:35:54 +0800 Subject: [PATCH 17/25] Add advice of review --- examples/all-clusters-app/linux/main-common.cpp | 10 +++++----- src/app/clusters/descriptor/descriptor.cpp | 2 +- src/app/util/af-types.h | 2 +- src/app/util/attribute-storage.cpp | 7 +------ src/app/util/attribute-storage.h | 2 +- 5 files changed, 9 insertions(+), 14 deletions(-) diff --git a/examples/all-clusters-app/linux/main-common.cpp b/examples/all-clusters-app/linux/main-common.cpp index b9065404d9fbeb..77eca7de21a2f0 100644 --- a/examples/all-clusters-app/linux/main-common.cpp +++ b/examples/all-clusters-app/linux/main-common.cpp @@ -63,13 +63,13 @@ Clusters::TemperatureControl::AppSupportedTemperatureLevelsDelegate sAppSupporte // Please refer to https://github.com/CHIP-Specifications/connectedhomeip-spec/blob/master/src/namespaces // Common Number Namespace: 7, tag 0 (Zero) -constexpr const uint8_t CommonNumNamespace = 7; -constexpr const uint8_t TagNumZero = 0; +constexpr const uint8_t kNamespaceCommon = 7; +constexpr const uint8_t kTagCommonZero = 0; // Common Position Namespace: 8, tag: 2 (Top) -constexpr const uint8_t CommonPositionNamespace = 8; -constexpr const uint8_t TagNumTop = 2; +constexpr const uint8_t kNamespacePosition = 8; +constexpr const uint8_t kTagPositionTop = 2; const Clusters::Descriptor::Structs::SemanticTagStruct::Type gTagList[] = { - { .namespaceID = CommonNumNamespace, .tag = TagNumZero }, { .namespaceID = CommonPositionNamespace, .tag = TagNumTop } + { .namespaceID = kNamespaceCommon, .tag = kTagCommonZero }, { .namespaceID = kNamespacePosition, .tag = kTagPositionTop } }; } // namespace diff --git a/src/app/clusters/descriptor/descriptor.cpp b/src/app/clusters/descriptor/descriptor.cpp index 0b112a0d2f5efd..9d530b4f0f6df2 100644 --- a/src/app/clusters/descriptor/descriptor.cpp +++ b/src/app/clusters/descriptor/descriptor.cpp @@ -82,7 +82,7 @@ CHIP_ERROR DescriptorAttrAccess::ReadTagAttribute(EndpointId endpoint, Attribute ReturnErrorOnFailure(encoder.Encode(tag)); index++; } - if (err == CHIP_ERROR_NOT_FOUND || err == CHIP_ERROR_INVALID_ARGUMENT) + if (err == CHIP_ERROR_NOT_FOUND) { return CHIP_NO_ERROR; } diff --git a/src/app/util/af-types.h b/src/app/util/af-types.h index 71fdccbc8f251c..7f0a785493c264 100644 --- a/src/app/util/af-types.h +++ b/src/app/util/af-types.h @@ -224,7 +224,7 @@ struct EmberAfDefinedEndpoint chip::EndpointId parentEndpointId = chip::kInvalidEndpointId; /** - * Span pointing to a list of tag + * Span pointing to a list of tag. Lifetime has to outlive usage, and data is owned by callers. */ chip::Span tagList; }; diff --git a/src/app/util/attribute-storage.cpp b/src/app/util/attribute-storage.cpp index e01d5faf7ec23e..f124f74583b6fa 100644 --- a/src/app/util/attribute-storage.cpp +++ b/src/app/util/attribute-storage.cpp @@ -1093,12 +1093,7 @@ CHIP_ERROR GetTagListFromEndpointAtIndex(EndpointId endpoint, size_t index, { uint16_t endpointIndex = emberAfIndexFromEndpoint(endpoint); - if (endpointIndex == 0xFFFF) - { - return CHIP_ERROR_INVALID_ARGUMENT; - } - - if (index >= emAfEndpoints[endpointIndex].tagList.size()) + if (endpointIndex == 0xFFFF || index >= emAfEndpoints[endpointIndex].tagList.size()) { return CHIP_ERROR_NOT_FOUND; } diff --git a/src/app/util/attribute-storage.h b/src/app/util/attribute-storage.h index ca7cb326e228cf..c33103de7443bd 100644 --- a/src/app/util/attribute-storage.h +++ b/src/app/util/attribute-storage.h @@ -205,7 +205,7 @@ chip::Span emberAfDeviceTypeListFromEndpoint(chip::Endp * 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, - * or returns CHIP_ERROR_INVALID_ARGUMENT if the endpoint is invalid. + * or returns CHIP_ERROR_NOT_FOUND if the endpoint is invalid. * @param endpoint The target endpoint. * @param index The index of the tag, with 0 representing the first tag. * @param tag The SemanticTagStruct is filled. From 89f5c22a08c834635c437f8a5ac123cf040cedbb Mon Sep 17 00:00:00 2001 From: mideayanghui Date: Fri, 25 Aug 2023 09:58:15 +0800 Subject: [PATCH 18/25] update TestScript for descriptor cluster --- .../all-clusters-app.matter | 12 +++-- .../all-clusters-common/all-clusters-app.zap | 18 +++---- .../all-clusters-app/linux/main-common.cpp | 29 +++++++++--- .../tests/suites/TestDescriptorCluster.yaml | 10 +++- .../zap-generated/test/Commands.h | 47 +++++++++++++++---- 5 files changed, 87 insertions(+), 29 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 47d33df0cc3188..f94f79f525b00f 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -6131,12 +6131,13 @@ endpoint 0 { callback attribute serverList; callback attribute clientList; callback attribute partsList; + callback attribute tagList; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 0; - callback attribute clusterRevision default = 1; + ram attribute featureMap default = 1; + callback attribute clusterRevision default = 2; } server cluster Binding { @@ -7648,12 +7649,13 @@ endpoint 2 { callback attribute serverList; callback attribute clientList; callback attribute partsList; + callback attribute tagList; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 0; - callback attribute clusterRevision default = 1; + ram attribute featureMap default = 1; + callback attribute clusterRevision default = 2; } server cluster PowerSource { @@ -7690,7 +7692,7 @@ endpoint 65534 { callback attribute clientList; callback attribute partsList; ram attribute featureMap default = 0; - callback attribute clusterRevision default = 1; + callback attribute clusterRevision default = 2; } server cluster NetworkCommissioning { diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index ac3c5e94ffdf95..ee4721d9cd5a23 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -948,7 +948,7 @@ "mfgCode": null, "side": "server", "type": "array", - "included": 0, + "included": 1, "storageOption": "External", "singleton": 0, "bounded": 0, @@ -1032,7 +1032,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": "1", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -1048,7 +1048,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -10512,7 +10512,7 @@ ] }, { - "id": 8, + "id": 6, "name": "MA-onofflight", "deviceTypeRef": { "id": 8, @@ -30613,7 +30613,7 @@ ] }, { - "id": 6, + "id": 8, "name": "MA-onofflight", "deviceTypeRef": { "id": 8, @@ -32064,7 +32064,7 @@ "mfgCode": null, "side": "server", "type": "array", - "included": 0, + "included": 1, "storageOption": "External", "singleton": 0, "bounded": 0, @@ -32148,7 +32148,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": "1", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -32164,7 +32164,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -35052,7 +35052,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/all-clusters-app/linux/main-common.cpp b/examples/all-clusters-app/linux/main-common.cpp index 77eca7de21a2f0..5d372b86efd546 100644 --- a/examples/all-clusters-app/linux/main-common.cpp +++ b/examples/all-clusters-app/linux/main-common.cpp @@ -62,14 +62,29 @@ Clusters::WindowCovering::WindowCoveringManager sWindowCoveringManager; Clusters::TemperatureControl::AppSupportedTemperatureLevelsDelegate sAppSupportedTemperatureLevelsDelegate; // Please refer to https://github.com/CHIP-Specifications/connectedhomeip-spec/blob/master/src/namespaces +constexpr const uint8_t kNamespaceCommon = 7; // Common Number Namespace: 7, tag 0 (Zero) -constexpr const uint8_t kNamespaceCommon = 7; constexpr const uint8_t kTagCommonZero = 0; -// Common Position Namespace: 8, tag: 2 (Top) +// Common Number Namespace: 7, tag 1 (One) +constexpr const uint8_t kTagCommonOne = 1; +// Common Number Namespace: 7, tag 2 (Two) +constexpr const uint8_t kTagCommonTwo = 2; + constexpr const uint8_t kNamespacePosition = 8; -constexpr const uint8_t kTagPositionTop = 2; -const Clusters::Descriptor::Structs::SemanticTagStruct::Type gTagList[] = { - { .namespaceID = kNamespaceCommon, .tag = kTagCommonZero }, { .namespaceID = kNamespacePosition, .tag = kTagPositionTop } +// Common Position Namespace: 8, tag: 0 (Left) +constexpr const uint8_t kTagPositionLeft = 0; +// Common Position Namespace: 8, tag: 1 (Right) +constexpr const uint8_t kTagPositionRight = 1; +// Common Position Namespace: 8, tag: 3 (Buttom) +constexpr const uint8_t kTagPositionButtom = 3; +const Clusters::Descriptor::Structs::SemanticTagStruct::Type gEp0TagList[] = { + { .namespaceID = kNamespaceCommon, .tag = kTagCommonZero }, { .namespaceID = kNamespacePosition, .tag = kTagPositionButtom } +}; +const Clusters::Descriptor::Structs::SemanticTagStruct::Type gEp1TagList[] = { + { .namespaceID = kNamespaceCommon, .tag = kTagCommonOne }, { .namespaceID = kNamespacePosition, .tag = kTagPositionLeft } +}; +const Clusters::Descriptor::Structs::SemanticTagStruct::Type gEp2TagList[] = { + { .namespaceID = kNamespaceCommon, .tag = kTagCommonTwo }, { .namespaceID = kNamespacePosition, .tag = kTagPositionRight } }; } // namespace @@ -199,7 +214,9 @@ void ApplicationInit() #endif Clusters::TemperatureControl::SetInstance(&sAppSupportedTemperatureLevelsDelegate); - SetTagList(/* endpoint= */ 1, Span(gTagList)); + SetTagList(/* endpoint= */ 0, Span(gEp0TagList)); + SetTagList(/* endpoint= */ 1, Span(gEp1TagList)); + SetTagList(/* endpoint= */ 2, Span(gEp2TagList)); } void ApplicationShutdown() diff --git a/src/app/tests/suites/TestDescriptorCluster.yaml b/src/app/tests/suites/TestDescriptorCluster.yaml index 977bb385d90504..56b63a9d385cfe 100644 --- a/src/app/tests/suites/TestDescriptorCluster.yaml +++ b/src/app/tests/suites/TestDescriptorCluster.yaml @@ -85,6 +85,14 @@ tests: response: value: [1, 2] + - label: "Read attribute ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + value: 2 + constraints: + type: int16u + - label: "Read attribute Tag list" command: "readAttribute" attribute: "TagList" @@ -92,7 +100,7 @@ tests: value: [ { MfgCode: null, NamespaceID: 7, Tag: 0 }, - { MfgCode: null, NamespaceID: 8, Tag: 2 }, + { MfgCode: null, NamespaceID: 8, Tag: 3 }, ] - label: "Read feature map Attribute" diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index 934edd367ea73e..bc354ad82e5660 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -138850,12 +138850,16 @@ class TestDescriptorCluster : public TestCommandBridge { err = TestReadAttributePartsList_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read attribute Tag list\n"); - err = TestReadAttributeTagList_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Read attribute ClusterRevision\n"); + err = TestReadAttributeClusterRevision_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Read feature map Attribute\n"); - err = TestReadFeatureMapAttribute_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Read attribute Tag list\n"); + err = TestReadAttributeTagList_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read feature map Attribute\n"); + err = TestReadFeatureMapAttribute_7(); break; } @@ -138889,6 +138893,9 @@ class TestDescriptorCluster : public TestCommandBridge { case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -138902,7 +138909,7 @@ class TestDescriptorCluster : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 7; + const uint16_t mTestCount = 8; chip::Optional mNodeId; chip::Optional mCluster; @@ -139047,7 +139054,31 @@ class TestDescriptorCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeTagList_5() + CHIP_ERROR TestReadAttributeClusterRevision_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterDescriptor alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 2U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeTagList_6() { MTRBaseDevice * device = GetDevice("alpha"); @@ -139069,7 +139100,7 @@ class TestDescriptorCluster : public TestCommandBridge { VerifyOrReturn(CheckValueNull("MfgCode", ((MTRDescriptorClusterSemanticTagStruct *) actualValue[1]).mfgCode)); VerifyOrReturn( CheckValue("NamespaceID", ((MTRDescriptorClusterSemanticTagStruct *) actualValue[1]).namespaceID, 8U)); - VerifyOrReturn(CheckValue("Tag", ((MTRDescriptorClusterSemanticTagStruct *) actualValue[1]).tag, 2U)); + VerifyOrReturn(CheckValue("Tag", ((MTRDescriptorClusterSemanticTagStruct *) actualValue[1]).tag, 3U)); } NextTest(); @@ -139078,7 +139109,7 @@ class TestDescriptorCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadFeatureMapAttribute_6() + CHIP_ERROR TestReadFeatureMapAttribute_7() { MTRBaseDevice * device = GetDevice("alpha"); From ea5a65457427ddd25a562d3f44533b0c4bd6247b Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Fri, 25 Aug 2023 02:16:24 +0000 Subject: [PATCH 19/25] Restyled by clang-format --- examples/all-clusters-app/linux/main-common.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/all-clusters-app/linux/main-common.cpp b/examples/all-clusters-app/linux/main-common.cpp index 5d372b86efd546..3428749bc64e36 100644 --- a/examples/all-clusters-app/linux/main-common.cpp +++ b/examples/all-clusters-app/linux/main-common.cpp @@ -62,21 +62,21 @@ Clusters::WindowCovering::WindowCoveringManager sWindowCoveringManager; Clusters::TemperatureControl::AppSupportedTemperatureLevelsDelegate sAppSupportedTemperatureLevelsDelegate; // Please refer to https://github.com/CHIP-Specifications/connectedhomeip-spec/blob/master/src/namespaces -constexpr const uint8_t kNamespaceCommon = 7; +constexpr const uint8_t kNamespaceCommon = 7; // Common Number Namespace: 7, tag 0 (Zero) -constexpr const uint8_t kTagCommonZero = 0; +constexpr const uint8_t kTagCommonZero = 0; // Common Number Namespace: 7, tag 1 (One) -constexpr const uint8_t kTagCommonOne = 1; +constexpr const uint8_t kTagCommonOne = 1; // Common Number Namespace: 7, tag 2 (Two) -constexpr const uint8_t kTagCommonTwo = 2; +constexpr const uint8_t kTagCommonTwo = 2; -constexpr const uint8_t kNamespacePosition = 8; +constexpr const uint8_t kNamespacePosition = 8; // Common Position Namespace: 8, tag: 0 (Left) -constexpr const uint8_t kTagPositionLeft = 0; +constexpr const uint8_t kTagPositionLeft = 0; // Common Position Namespace: 8, tag: 1 (Right) -constexpr const uint8_t kTagPositionRight = 1; +constexpr const uint8_t kTagPositionRight = 1; // Common Position Namespace: 8, tag: 3 (Buttom) -constexpr const uint8_t kTagPositionButtom = 3; +constexpr const uint8_t kTagPositionButtom = 3; const Clusters::Descriptor::Structs::SemanticTagStruct::Type gEp0TagList[] = { { .namespaceID = kNamespaceCommon, .tag = kTagCommonZero }, { .namespaceID = kNamespacePosition, .tag = kTagPositionButtom } }; From 2cb01b6b32b6d9e8c66253679826fc248ea4fc77 Mon Sep 17 00:00:00 2001 From: mideayanghui Date: Fri, 25 Aug 2023 10:24:51 +0800 Subject: [PATCH 20/25] update read tagList step in Test_TC_DESC_2_1.yaml --- .../suites/certification/Test_TC_DESC_2_1.yaml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/app/tests/suites/certification/Test_TC_DESC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_DESC_2_1.yaml index 04ffc88831b5d4..5e44da54ce977c 100644 --- a/src/app/tests/suites/certification/Test_TC_DESC_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DESC_2_1.yaml @@ -246,5 +246,20 @@ tests: - label: "Step 5: TH reads from the DUT the 'TagList' attribute." PICS: DESC.S.A0004 verification: | - SDK has to implement the Taglist attribute + ./chip-tool descriptor read parts-list 1 0 + + Verify that the DUT response contains a TagList and SHALL contain at least one element: + + [1692930031.171338][161314:161316] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0004 DataVersion: 3040764429 + [1692930031.171357][161314:161316] CHIP:TOO: TagList: 2 entries + [1692930031.171384][161314:161316] CHIP:TOO: [1]: { + [1692930031.171389][161314:161316] CHIP:TOO: MfgCode: null + [1692930031.171392][161314:161316] CHIP:TOO: NamespaceID: 7 + [1692930031.171394][161314:161316] CHIP:TOO: Tag: 0 + [1692930031.171396][161314:161316] CHIP:TOO: } + [1692930031.171399][161314:161316] CHIP:TOO: [2]: { + [1692930031.171410][161314:161316] CHIP:TOO: MfgCode: null + [1692930031.171413][161314:161316] CHIP:TOO: NamespaceID: 8 + [1692930031.171425][161314:161316] CHIP:TOO: Tag: 3 + [1692930031.171427][161314:161316] CHIP:TOO: } disabled: true From f78d338e521dcfd2e17aea9aae7c01c4b0a779fb Mon Sep 17 00:00:00 2001 From: mideayanghui Date: Fri, 25 Aug 2023 10:28:04 +0800 Subject: [PATCH 21/25] fixes spelling --- examples/all-clusters-app/linux/main-common.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/all-clusters-app/linux/main-common.cpp b/examples/all-clusters-app/linux/main-common.cpp index 3428749bc64e36..eaa3fad8c2b8b4 100644 --- a/examples/all-clusters-app/linux/main-common.cpp +++ b/examples/all-clusters-app/linux/main-common.cpp @@ -75,10 +75,10 @@ constexpr const uint8_t kNamespacePosition = 8; constexpr const uint8_t kTagPositionLeft = 0; // Common Position Namespace: 8, tag: 1 (Right) constexpr const uint8_t kTagPositionRight = 1; -// Common Position Namespace: 8, tag: 3 (Buttom) -constexpr const uint8_t kTagPositionButtom = 3; +// Common Position Namespace: 8, tag: 3 (Bottom) +constexpr const uint8_t kTagPositionBottom = 3; const Clusters::Descriptor::Structs::SemanticTagStruct::Type gEp0TagList[] = { - { .namespaceID = kNamespaceCommon, .tag = kTagCommonZero }, { .namespaceID = kNamespacePosition, .tag = kTagPositionButtom } + { .namespaceID = kNamespaceCommon, .tag = kTagCommonZero }, { .namespaceID = kNamespacePosition, .tag = kTagPositionBottom } }; const Clusters::Descriptor::Structs::SemanticTagStruct::Type gEp1TagList[] = { { .namespaceID = kNamespaceCommon, .tag = kTagCommonOne }, { .namespaceID = kNamespacePosition, .tag = kTagPositionLeft } From 367bbe6509cd057b11fbe3751ff3d78267535331 Mon Sep 17 00:00:00 2001 From: mideayanghui Date: Fri, 25 Aug 2023 10:31:46 +0800 Subject: [PATCH 22/25] resume featureMap setting in zap, set while set taglist --- .../all-clusters-common/all-clusters-app.matter | 6 +++--- .../all-clusters-common/all-clusters-app.zap | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index f94f79f525b00f..13caede03b2814 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -6136,7 +6136,7 @@ endpoint 0 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 1; + ram attribute featureMap default = 0; callback attribute clusterRevision default = 2; } @@ -6641,7 +6641,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 1; + ram attribute featureMap default = 0; callback attribute clusterRevision default = 2; } @@ -7654,7 +7654,7 @@ endpoint 2 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 1; + ram attribute featureMap default = 0; callback attribute clusterRevision default = 2; } diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index ee4721d9cd5a23..9ab2cbb930fb48 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -33,7 +33,7 @@ ], "endpointTypes": [ { - "id": 5, + "id": 13, "name": "MA-rootdevice", "deviceTypeRef": { "id": 3, @@ -1032,7 +1032,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -10512,7 +10512,7 @@ ] }, { - "id": 6, + "id": 14, "name": "MA-onofflight", "deviceTypeRef": { "id": 8, @@ -12487,7 +12487,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -30613,7 +30613,7 @@ ] }, { - "id": 8, + "id": 15, "name": "MA-onofflight", "deviceTypeRef": { "id": 8, @@ -32148,7 +32148,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -34897,7 +34897,7 @@ ] }, { - "id": 7, + "id": 16, "name": "Anonymous Endpoint Type", "deviceTypeRef": { "id": 53, From 3e46fc1c9b83ddc26ba97c86e9bbc46541d1dff4 Mon Sep 17 00:00:00 2001 From: mideayanghui Date: Fri, 25 Aug 2023 10:34:52 +0800 Subject: [PATCH 23/25] fix read tagList step in Test_TC_DESC_2_1.yaml --- src/app/tests/suites/certification/Test_TC_DESC_2_1.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/tests/suites/certification/Test_TC_DESC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_DESC_2_1.yaml index 5e44da54ce977c..123fcda3674535 100644 --- a/src/app/tests/suites/certification/Test_TC_DESC_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DESC_2_1.yaml @@ -246,7 +246,7 @@ tests: - label: "Step 5: TH reads from the DUT the 'TagList' attribute." PICS: DESC.S.A0004 verification: | - ./chip-tool descriptor read parts-list 1 0 + ./chip-tool descriptor read tag-list 1 0 Verify that the DUT response contains a TagList and SHALL contain at least one element: From f61f576e009c51d855f43506e5d8a8087301042c Mon Sep 17 00:00:00 2001 From: mideayanghui Date: Fri, 25 Aug 2023 13:39:44 +0800 Subject: [PATCH 24/25] fix CI error --- src/app/tests/suites/certification/Test_TC_DESC_1_1.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/tests/suites/certification/Test_TC_DESC_1_1.yaml b/src/app/tests/suites/certification/Test_TC_DESC_1_1.yaml index 59afd050075034..a1cbdcc1b0e90b 100644 --- a/src/app/tests/suites/certification/Test_TC_DESC_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DESC_1_1.yaml @@ -56,9 +56,9 @@ tests: command: "readAttribute" attribute: "FeatureMap" response: - value: 0 constraints: type: bitmap32 + hasMasksSet: [0x1] - label: "Step 4a: Read the global attribute: AttributeList" PICS: PICS_EVENT_LIST_ENABLED From 141dd00766880d033adf4861f3dd1873fc15e784 Mon Sep 17 00:00:00 2001 From: mideayanghui Date: Fri, 25 Aug 2023 13:45:47 +0800 Subject: [PATCH 25/25] fix CI error --- .../darwin-framework-tool/zap-generated/test/Commands.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index bc354ad82e5660..502eecf7d8a33a 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -47449,11 +47449,6 @@ class Test_TC_DESC_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); - } - VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); NextTest(); }];