From e5eafc1a5461378532aed65f3dcd58f33d669604 Mon Sep 17 00:00:00 2001 From: C Freeman Date: Tue, 14 Nov 2023 06:33:55 +0100 Subject: [PATCH] Door lock: make example conformant (#30297) * Door lock: make example conformant - on off cluster was non-conformant, but also, why was that there? - time localization - same thing, not conformant, but also why did the door lock have this cluster to begin with? - power source - added appropriate attributes for the selected features - admin commissioning - can't have BCW command without the feature * Attempt to fix esp32 * sneaky little thing was in there twice. --- examples/lock-app/esp32/main/CMakeLists.txt | 3 - examples/lock-app/lock-common/lock-app.matter | 126 +------ examples/lock-app/lock-common/lock-app.zap | 342 ++---------------- 3 files changed, 36 insertions(+), 435 deletions(-) diff --git a/examples/lock-app/esp32/main/CMakeLists.txt b/examples/lock-app/esp32/main/CMakeLists.txt index a6aded6af0065c..7efc567f107ffd 100644 --- a/examples/lock-app/esp32/main/CMakeLists.txt +++ b/examples/lock-app/esp32/main/CMakeLists.txt @@ -57,7 +57,6 @@ idf_component_register(INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/bindings" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/descriptor" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/fixed-label-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/on-off-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/operational-credentials-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ota-requestor" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-commissioning-server" @@ -173,7 +172,6 @@ idf_component_register(PRIV_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/diagnostic-logs-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ethernet-network-diagnostics-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/localization-configuration-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/time-format-localization-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/fixed-label-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thread-network-diagnostics-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/wifi-network-diagnostics-server" @@ -182,7 +180,6 @@ idf_component_register(PRIV_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-diagnostics-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/group-key-mgmt-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/on-off-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/operational-credentials-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ota-requestor" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-commissioning-server" diff --git a/examples/lock-app/lock-common/lock-app.matter b/examples/lock-app/lock-common/lock-app.matter index 695efd9787c1f2..1bb5053b7cc4a3 100644 --- a/examples/lock-app/lock-common/lock-app.matter +++ b/examples/lock-app/lock-common/lock-app.matter @@ -47,56 +47,6 @@ server cluster Identify = 3 { command access(invoke: manage) TriggerEffect(TriggerEffectRequest): DefaultSuccess = 64; } -/** Attributes and commands for switching devices between 'On' and 'Off' states. */ -server cluster OnOff = 6 { - enum DelayedAllOffEffectVariantEnum : enum8 { - kDelayedOffFastFade = 0; - kNoFade = 1; - kDelayedOffSlowFade = 2; - } - - enum DyingLightEffectVariantEnum : enum8 { - kDyingLightFadeOff = 0; - } - - enum EffectIdentifierEnum : enum8 { - kDelayedAllOff = 0; - kDyingLight = 1; - } - - enum StartUpOnOffEnum : enum8 { - kOff = 0; - kOn = 1; - kToggle = 2; - } - - bitmap Feature : bitmap32 { - kLighting = 0x1; - kDeadFrontBehavior = 0x2; - kOffOnly = 0x4; - } - - bitmap OnOffControlBitmap : bitmap8 { - kAcceptOnlyWhenOn = 0x1; - } - - readonly attribute boolean onOff = 0; - readonly attribute boolean globalSceneControl = 16384; - attribute int16u onTime = 16385; - attribute int16u offWaitTime = 16386; - attribute access(write: manage) nullable StartUpOnOffEnum startUpOnOff = 16387; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; - - command Off(): DefaultSuccess = 0; - command On(): DefaultSuccess = 1; - command Toggle(): DefaultSuccess = 2; -} - /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { bitmap Feature : bitmap32 { @@ -453,46 +403,6 @@ server cluster LocalizationConfiguration = 43 { readonly attribute int16u clusterRevision = 65533; } -/** Nodes should be expected to be deployed to any and all regions of the world. These global regions - may have differing preferences for how dates and times are conveyed. As such, Nodes that visually - or audibly convey time information need a mechanism by which they can be configured to use a - user’s preferred format. */ -server cluster TimeFormatLocalization = 44 { - enum CalendarTypeEnum : enum8 { - kBuddhist = 0; - kChinese = 1; - kCoptic = 2; - kEthiopian = 3; - kGregorian = 4; - kHebrew = 5; - kIndian = 6; - kIslamic = 7; - kJapanese = 8; - kKorean = 9; - kPersian = 10; - kTaiwanese = 11; - } - - enum HourFormatEnum : enum8 { - k12hr = 0; - k24hr = 1; - } - - bitmap Feature : bitmap32 { - kCalendarFormat = 0x1; - } - - attribute access(write: manage) HourFormatEnum hourFormat = 0; - attribute access(write: manage) CalendarTypeEnum activeCalendarType = 1; - readonly attribute CalendarTypeEnum supportedCalendarTypes[] = 2; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; -} - /** Nodes should be expected to be deployed to any and all regions of the world. These global regions may have differing preferences for the units in which values are conveyed in communication to a user. As such, Nodes that visually or audibly convey measurable values to the user need a @@ -736,11 +646,13 @@ server cluster PowerSource = 47 { readonly attribute PowerSourceStatusEnum status = 0; readonly attribute int8u order = 1; readonly attribute char_string<60> description = 2; + readonly attribute WiredCurrentTypeEnum wiredCurrentType = 5; readonly attribute nullable int32u wiredAssessedCurrent = 6; readonly attribute BatChargeLevelEnum batChargeLevel = 14; readonly attribute boolean batReplacementNeeded = 15; readonly attribute BatReplaceabilityEnum batReplaceability = 16; readonly attribute char_string<60> batReplacementDescription = 19; + readonly attribute int8u batQuantity = 25; readonly attribute endpoint_no endpointList[] = 31; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -1465,12 +1377,7 @@ server cluster AdministratorCommissioning = 60 { octet_string<32> salt = 4; } - request struct OpenBasicCommissioningWindowRequest { - int16u commissioningTimeout = 0; - } - timed command access(invoke: administer) OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0; - timed command access(invoke: administer) OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1; timed command access(invoke: administer) RevokeCommissioning(): DefaultSuccess = 2; } @@ -2422,18 +2329,6 @@ endpoint 0 { ram attribute clusterRevision default = 1; } - server cluster TimeFormatLocalization { - persist attribute hourFormat default = 0; - persist attribute activeCalendarType default = 0; - callback attribute supportedCalendarTypes; - callback attribute generatedCommandList; - callback attribute acceptedCommandList; - callback attribute eventList; - callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - server cluster UnitLocalization { callback attribute generatedCommandList; callback attribute acceptedCommandList; @@ -2448,6 +2343,7 @@ endpoint 0 { ram attribute status default = 1; ram attribute order default = 0; ram attribute description default = "USB"; + ram attribute wiredCurrentType default = 0; ram attribute wiredAssessedCurrent; callback attribute endpointList; callback attribute generatedCommandList; @@ -2671,7 +2567,6 @@ endpoint 0 { ram attribute clusterRevision default = 1; handle command OpenCommissioningWindow; - handle command OpenBasicCommissioningWindow; handle command RevokeCommissioning; } @@ -2762,20 +2657,6 @@ endpoint 1 { handle command TriggerEffect; } - server cluster OnOff { - ram attribute onOff default = 0x00; - ram attribute globalSceneControl default = 1; - ram attribute onTime default = 0; - ram attribute offWaitTime default = 0; - ram attribute startUpOnOff; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 5; - - handle command Off; - handle command On; - handle command Toggle; - } - server cluster Descriptor { callback attribute deviceTypeList; callback attribute serverList; @@ -2797,6 +2678,7 @@ endpoint 1 { ram attribute batReplacementNeeded; ram attribute batReplaceability; ram attribute batReplacementDescription; + ram attribute batQuantity default = 1; callback attribute endpointList; callback attribute generatedCommandList; callback attribute acceptedCommandList; diff --git a/examples/lock-app/lock-common/lock-app.zap b/examples/lock-app/lock-common/lock-app.zap index ea9e37dd690d77..b2ece3bbed1985 100644 --- a/examples/lock-app/lock-common/lock-app.zap +++ b/examples/lock-app/lock-common/lock-app.zap @@ -1218,160 +1218,6 @@ } ] }, - { - "name": "Time Format Localization", - "code": 44, - "mfgCode": null, - "define": "TIME_FORMAT_LOCALIZATION_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "HourFormat", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "HourFormatEnum", - "included": 1, - "storageOption": "NVM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ActiveCalendarType", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "CalendarTypeEnum", - "included": 1, - "storageOption": "NVM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "SupportedCalendarTypes", - "code": 2, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "GeneratedCommandList", - "code": 65528, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AcceptedCommandList", - "code": 65529, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "EventList", - "code": 65530, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AttributeList", - "code": 65531, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, { "name": "Unit Localization", "code": 45, @@ -1534,6 +1380,22 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "WiredCurrentType", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "WiredCurrentTypeEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "WiredAssessedCurrent", "code": 6, @@ -4246,14 +4108,6 @@ "isIncoming": 1, "isEnabled": 1 }, - { - "name": "OpenBasicCommissioningWindow", - "code": 1, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, { "name": "RevokeCommissioning", "code": 2, @@ -5329,154 +5183,6 @@ } ] }, - { - "name": "On/Off", - "code": 6, - "mfgCode": null, - "define": "ON_OFF_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [ - { - "name": "Off", - "code": 0, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "On", - "code": 1, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "Toggle", - "code": 2, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - } - ], - "attributes": [ - { - "name": "OnOff", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "boolean", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "GlobalSceneControl", - "code": 16384, - "mfgCode": null, - "side": "server", - "type": "boolean", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "OnTime", - "code": 16385, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "OffWaitTime", - "code": 16386, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "StartUpOnOff", - "code": 16387, - "mfgCode": null, - "side": "server", - "type": "StartUpOnOffEnum", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "5", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, { "name": "Descriptor", "code": 29, @@ -5767,6 +5473,22 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "BatQuantity", + "code": 25, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "EndpointList", "code": 31,