From 11013568bd97d3f555eb55535f0ee73b875f1070 Mon Sep 17 00:00:00 2001 From: mkardous-silabs <84793247+mkardous-silabs@users.noreply.github.com> Date: Tue, 16 May 2023 16:51:28 -0400 Subject: [PATCH] [ICD] Update ICD Management XML to match specification (#26587) * Update ICD management cluster xml * generated files * Enable ICDM for controller * generated files * update files cm -> icdm * enable CheckIn features * generated files * fix comments * Address PR review comments * Fix ESP build * Fix typo * generated files * change featuremap default * regen * Encode empty list --- .../all-clusters-app.matter | 62 + .../all-clusters-common/all-clusters-app.zap | 292 +++- .../esp32/main/CMakeLists.txt | 4 +- .../data_model/lighting-thread-app.matter | 62 + .../efr32/data_model/lighting-thread-app.zap | 292 +++- src/app/chip_data_model.gni | 2 +- .../client-monitoring-server.cpp | 216 --- .../icd-management-server.cpp | 152 ++ .../icd-management-server.h} | 17 +- .../tests/suites/TestDescriptorCluster.yaml | 4 +- src/app/zap-templates/zcl/data-model/all.xml | 2 +- ...cluster.xml => icd-management-cluster.xml} | 60 +- .../zcl/zcl-with-test-extensions.json | 2 +- src/app/zap-templates/zcl/zcl.json | 2 +- src/app/zap_cluster_list.json | 4 +- src/controller/data_model/BUILD.gn | 7 +- .../data_model/controller-clusters.matter | 51 + .../data_model/controller-clusters.zap | 280 +++ .../devicecontroller/ClusterReadMapping.java | 172 ++ .../devicecontroller/ClusterWriteMapping.java | 2 + .../CHIPAttributeTLVValueDecoder.cpp | 276 +++ .../CHIPEventTLVValueDecoder.cpp | 10 + .../zap-generated/CHIPInvokeCallbacks.cpp | 61 + .../java/zap-generated/CHIPInvokeCallbacks.h | 15 + .../java/zap-generated/CHIPReadCallbacks.cpp | 395 +++++ .../chip/devicecontroller/ChipClusters.java | 320 ++++ .../chip/devicecontroller/ChipIdLookup.java | 45 + .../chip/devicecontroller/ChipStructs.java | 35 + .../devicecontroller/ClusterInfoMapping.java | 229 +++ .../python/chip/clusters/CHIPClusters.py | 106 ++ .../python/chip/clusters/Objects.py | 614 +++---- .../MTRAttributeTLVValueDecoder.mm | 227 +++ .../CHIP/zap-generated/MTRBaseClusters.h | 190 ++ .../CHIP/zap-generated/MTRBaseClusters.mm | 670 ++++++++ .../zap-generated/MTRBaseClusters_Internal.h | 5 + .../CHIP/zap-generated/MTRCallbackBridge.h | 193 +++ .../CHIP/zap-generated/MTRCallbackBridge.mm | 205 +++ .../CHIP/zap-generated/MTRClusterConstants.h | 24 + .../CHIP/zap-generated/MTRClusters.h | 56 + .../CHIP/zap-generated/MTRClusters.mm | 329 ++++ .../CHIP/zap-generated/MTRClusters_Internal.h | 5 + .../zap-generated/MTRCommandPayloadsObjc.h | 102 ++ .../zap-generated/MTRCommandPayloadsObjc.mm | 130 ++ .../zap-generated/MTREventTLVValueDecoder.mm | 15 + .../CHIP/zap-generated/MTRStructsObjc.h | 8 + .../CHIP/zap-generated/MTRStructsObjc.mm | 38 + .../zap-generated/attributes/Accessors.cpp | 415 ++--- .../zap-generated/attributes/Accessors.h | 77 +- .../app-common/zap-generated/callback.h | 208 +-- .../app-common/zap-generated/cluster-enums.h | 11 +- .../zap-generated/cluster-objects.cpp | 1528 +++++++++-------- .../zap-generated/cluster-objects.h | 660 +++---- .../app-common/zap-generated/ids/Attributes.h | 104 +- .../app-common/zap-generated/ids/Clusters.h | 6 +- .../app-common/zap-generated/ids/Commands.h | 44 +- .../app-common/zap-generated/print-cluster.h | 14 +- .../zap-generated/cluster/Commands.h | 398 ++--- .../cluster/ComplexArgumentParser.cpp | 88 +- .../cluster/ComplexArgumentParser.h | 12 +- .../cluster/logging/DataModelLogger.cpp | 246 +-- .../cluster/logging/DataModelLogger.h | 12 +- .../chip-tool/zap-generated/test/Commands.h | 8 +- .../zap-generated/cluster/Commands.h | 1069 +++++++++++- .../zap-generated/test/Commands.h | 7 +- .../zap-generated/CHIPClientCallbacks.h | 12 + .../zap-generated/CHIPClusters.h | 9 + .../zap-generated/endpoint_config.h | 13 + .../zap-generated/gen_config.h | 5 + 68 files changed, 8501 insertions(+), 2433 deletions(-) delete mode 100644 src/app/clusters/client-monitoring-server/client-monitoring-server.cpp create mode 100644 src/app/clusters/icd-management-server/icd-management-server.cpp rename src/app/clusters/{client-monitoring-server/client-monitoring-server.h => icd-management-server/icd-management-server.h} (53%) rename src/app/zap-templates/zcl/data-model/chip/{client-monitoring-cluster.xml => icd-management-cluster.xml} (50%) 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 e57aaf1f464ec4..9d76c360803f43 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 @@ -2238,6 +2238,53 @@ server cluster BooleanState = 69 { readonly attribute int16u clusterRevision = 65533; } +/** Allows servers to ensure that listed clients are notified when a server is available for communication. */ +server cluster IcdManagement = 70 { + bitmap ICDManagementFeature : BITMAP32 { + kCheckInProtocolSupport = 0x1; + } + + fabric_scoped struct MonitoringRegistrationStruct { + fabric_sensitive node_id checkInNodeID = 1; + fabric_sensitive int64u monitoredSubject = 2; + fabric_sensitive octet_string<16> key = 3; + fabric_idx fabricIndex = 254; + } + + readonly attribute int32u idleModeInterval = 0; + readonly attribute int32u activeModeInterval = 1; + readonly attribute int16u activeModeThreshold = 2; + readonly attribute access(read: administer) MonitoringRegistrationStruct registeredClients[] = 3; + readonly attribute access(read: administer) int32u ICDCounter = 4; + readonly attribute int16u clientsSupportedPerFabric = 5; + 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; + + request struct RegisterClientRequest { + node_id checkInNodeID = 0; + INT64U monitoredSubject = 1; + OCTET_STRING<16> key = 2; + optional OCTET_STRING<16> verificationKey = 3; + } + + request struct UnregisterClientRequest { + node_id checkInNodeID = 0; + optional OCTET_STRING<16> key = 1; + } + + response struct RegisterClientResponse = 1 { + INT32U ICDCounter = 0; + } + + fabric command access(invoke: manage) RegisterClient(RegisterClientRequest): RegisterClientResponse = 0; + fabric command access(invoke: manage) UnregisterClient(UnregisterClientRequest): DefaultSuccess = 2; + command access(invoke: manage) StayActiveRequest(): DefaultSuccess = 3; +} + /** Attributes and commands for selecting a mode from a list of supported options. */ server cluster ModeSelect = 80 { bitmap ModeSelectFeature : BITMAP32 { @@ -4908,6 +4955,21 @@ endpoint 0 { ram attribute clusterRevision default = 1; } + server cluster IcdManagement { + ram attribute idleModeInterval default = 500; + ram attribute activeModeInterval default = 300; + ram attribute activeModeThreshold default = 300; + callback attribute registeredClients; + ram attribute ICDCounter default = 0; + ram attribute clientsSupportedPerFabric default = 1; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 1; + ram attribute clusterRevision default = 1; + } + server cluster RelativeHumidityMeasurement { ram attribute measuredValue; ram attribute minMeasuredValue default = 0; 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 55a6cb9995e1e1..518a2fedd0f0a6 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,6 +23,12 @@ "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": [ @@ -6256,6 +6256,286 @@ } ] }, + { + "name": "ICD Management", + "code": 70, + "mfgCode": null, + "define": "ICD_MANAGEMENT_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "RegisterClient", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "UnregisterClient", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StayActiveRequest", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "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": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "ICD Management", + "code": 70, + "mfgCode": null, + "define": "ICD_MANAGEMENT_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "RegisterClientResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "IdleModeInterval", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "500", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveModeInterval", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "300", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveModeThreshold", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "300", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "RegisteredClients", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ICDCounter", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientsSupportedPerFabric", + "code": 5, + "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": "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": "1", + "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": "Door Lock", "code": 257, diff --git a/examples/all-clusters-app/esp32/main/CMakeLists.txt b/examples/all-clusters-app/esp32/main/CMakeLists.txt index c004e3f5dffb42..a2f72015840bae 100644 --- a/examples/all-clusters-app/esp32/main/CMakeLists.txt +++ b/examples/all-clusters-app/esp32/main/CMakeLists.txt @@ -77,9 +77,7 @@ set(SRC_DIRS_LIST "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/group-key-mgmt-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/basic-information" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/bindings" - # Disable Client Monitoring cluster until update is done - # https://github.com/project-chip/connectedhomeip/issues/24425 - # "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/client-monitoring-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/icd-management-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/diagnostic-logs-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/door-lock-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/occupancy-sensor-server" diff --git a/examples/lighting-app/silabs/efr32/data_model/lighting-thread-app.matter b/examples/lighting-app/silabs/efr32/data_model/lighting-thread-app.matter index 26d34db585312b..2bf7df26909899 100644 --- a/examples/lighting-app/silabs/efr32/data_model/lighting-thread-app.matter +++ b/examples/lighting-app/silabs/efr32/data_model/lighting-thread-app.matter @@ -1477,6 +1477,53 @@ server cluster UserLabel = 65 { readonly attribute int16u clusterRevision = 65533; } +/** Allows servers to ensure that listed clients are notified when a server is available for communication. */ +server cluster IcdManagement = 70 { + bitmap ICDManagementFeature : BITMAP32 { + kCheckInProtocolSupport = 0x1; + } + + fabric_scoped struct MonitoringRegistrationStruct { + fabric_sensitive node_id checkInNodeID = 1; + fabric_sensitive int64u monitoredSubject = 2; + fabric_sensitive octet_string<16> key = 3; + fabric_idx fabricIndex = 254; + } + + readonly attribute int32u idleModeInterval = 0; + readonly attribute int32u activeModeInterval = 1; + readonly attribute int16u activeModeThreshold = 2; + readonly attribute access(read: administer) MonitoringRegistrationStruct registeredClients[] = 3; + readonly attribute access(read: administer) int32u ICDCounter = 4; + readonly attribute int16u clientsSupportedPerFabric = 5; + 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; + + request struct RegisterClientRequest { + node_id checkInNodeID = 0; + INT64U monitoredSubject = 1; + OCTET_STRING<16> key = 2; + optional OCTET_STRING<16> verificationKey = 3; + } + + request struct UnregisterClientRequest { + node_id checkInNodeID = 0; + optional OCTET_STRING<16> key = 1; + } + + response struct RegisterClientResponse = 1 { + INT32U ICDCounter = 0; + } + + fabric command access(invoke: manage) RegisterClient(RegisterClientRequest): RegisterClientResponse = 0; + fabric command access(invoke: manage) UnregisterClient(UnregisterClientRequest): DefaultSuccess = 2; + command access(invoke: manage) StayActiveRequest(): DefaultSuccess = 3; +} + /** Attributes and commands for controlling the color properties of a color-capable light. */ server cluster ColorControl = 768 { enum ColorLoopAction : ENUM8 { @@ -1975,6 +2022,21 @@ endpoint 0 { ram attribute featureMap default = 0; ram attribute clusterRevision default = 1; } + + server cluster IcdManagement { + ram attribute idleModeInterval default = 500; + ram attribute activeModeInterval default = 300; + ram attribute activeModeThreshold default = 300; + callback attribute registeredClients; + ram attribute ICDCounter; + ram attribute clientsSupportedPerFabric default = 1; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 1; + ram attribute clusterRevision default = 1; + } } endpoint 1 { device type dimmablelight = 257, version 1; diff --git a/examples/lighting-app/silabs/efr32/data_model/lighting-thread-app.zap b/examples/lighting-app/silabs/efr32/data_model/lighting-thread-app.zap index 60a5e50ba52621..a301ef4c0d33cf 100644 --- a/examples/lighting-app/silabs/efr32/data_model/lighting-thread-app.zap +++ b/examples/lighting-app/silabs/efr32/data_model/lighting-thread-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.json", @@ -23,12 +29,6 @@ "category": "matter", "version": 1, "description": "Matter SDK ZCL data" - }, - { - "pathRelativity": "relativeToZap", - "path": "../../../../../src/app/zap-templates/app-templates.json", - "type": "gen-templates-json", - "version": "chip-v1" } ], "endpointTypes": [ @@ -5261,6 +5261,286 @@ "reportableChange": 0 } ] + }, + { + "name": "ICD Management", + "code": 70, + "mfgCode": null, + "define": "ICD_MANAGEMENT_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "RegisterClient", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "UnregisterClient", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StayActiveRequest", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "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": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "ICD Management", + "code": 70, + "mfgCode": null, + "define": "ICD_MANAGEMENT_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "RegisterClientResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "IdleModeInterval", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "500", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveModeInterval", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "300", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveModeThreshold", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "300", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "RegisteredClients", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ICDCounter", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientsSupportedPerFabric", + "code": 5, + "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": "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": "1", + "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 + } + ] } ] }, diff --git a/src/app/chip_data_model.gni b/src/app/chip_data_model.gni index 4fff92c4eaf5ff..c2026f61f50f08 100644 --- a/src/app/chip_data_model.gni +++ b/src/app/chip_data_model.gni @@ -153,10 +153,10 @@ template("chip_data_model") { sources += [ "${_app_root}/clusters/barrier-control-server/barrier-control-server.h", "${_app_root}/clusters/basic-information/basic-information.h", - "${_app_root}/clusters/client-monitoring-server/client-monitoring-server.h", "${_app_root}/clusters/color-control-server/color-control-server.h", "${_app_root}/clusters/door-lock-server/door-lock-server.h", "${_app_root}/clusters/groups-server/groups-server.h", + "${_app_root}/clusters/icd-management-server/icd-management-server.h", "${_app_root}/clusters/identify-server/identify-server.h", "${_app_root}/clusters/level-control/level-control.h", "${_app_root}/clusters/on-off-server/on-off-server.h", diff --git a/src/app/clusters/client-monitoring-server/client-monitoring-server.cpp b/src/app/clusters/client-monitoring-server/client-monitoring-server.cpp deleted file mode 100644 index d0c99e5f3453b1..00000000000000 --- a/src/app/clusters/client-monitoring-server/client-monitoring-server.cpp +++ /dev/null @@ -1,216 +0,0 @@ -/** - * - * Copyright (c) 2022 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "client-monitoring-server.h" - -#include "app/server/Server.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace chip; -using namespace chip::app; -using namespace chip::app::Clusters; -using namespace chip::app::Clusters::ClientMonitoring; -using namespace Protocols; - -namespace { - -/************************************************************ - * ClientMonitoringAttributeAccess Implementation - ************************************************************/ - -/** - * @brief Implementation of attribute access for ClientMonitoring cluster - */ -class ClientMonitoringAttributeAccess : public app::AttributeAccessInterface -{ -public: - ClientMonitoringAttributeAccess() : AttributeAccessInterface(MakeOptional(kRootEndpointId), ClientMonitoring::Id) {} - - CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; - CHIP_ERROR Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override; - -private: - CHIP_ERROR ReadExpectedClients(EndpointId endpoint, AttributeValueEncoder & encoder); -}; - -CHIP_ERROR ClientMonitoringAttributeAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) -{ - VerifyOrDie(aPath.mClusterId == ClientMonitoring::Id); - - switch (aPath.mAttributeId) - { - case ClientMonitoring::Attributes::ExpectedClients::Id: - return ReadExpectedClients(aPath.mEndpointId, aEncoder); - - default: - break; - } - - return CHIP_NO_ERROR; -} - -CHIP_ERROR ClientMonitoringAttributeAccess::Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) -{ - return CHIP_IM_GLOBAL_STATUS(UnsupportedWrite); -} - -CHIP_ERROR ClientMonitoringAttributeAccess::ReadExpectedClients(EndpointId endpoint, AttributeValueEncoder & encoder) -{ - FabricIndex fabric = encoder.AccessingFabricIndex(); - - return encoder.EncodeList([fabric](const auto & subEncoder) -> CHIP_ERROR { - // TODO : https://github.com/project-chip/connectedhomeip/issues/24289 - ClientMonitoringRegistrationTable clientMonitoringRegistrationTable(chip::Server::GetInstance().GetPersistentStorage()); - CHIP_ERROR err = clientMonitoringRegistrationTable.LoadFromStorage(fabric); - - if (err == CHIP_NO_ERROR) - { - ReturnErrorOnFailure(subEncoder.Encode(clientMonitoringRegistrationTable.GetClientRegistrationEntry())); - } - else if (err == CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND) - { - // No Entries saved for this fabric. Return empty list - err = CHIP_NO_ERROR; - } - - return err; - }); -} - -ClientMonitoringAttributeAccess gAttribute; - -} // namespace - -/********************************************************** - * ClientMonitoringServer Implementation - *********************************************************/ - -InteractionModel::Status ClientMonitoringServer::StayAwakeRequestCommand(const ConcreteCommandPath & commandPath) -{ - // TODO: Implementent stay awake logic for end device - return InteractionModel::Status::UnsupportedCommand; -} - -InteractionModel::Status -ClientMonitoringServer::RegisterClientMonitoringCommand(CommandHandler * commandObj, const ConcreteCommandPath & commandPath, - const Commands::RegisterClientMonitoring::DecodableType & commandData) -{ - FabricIndex fabric = commandObj->GetAccessingFabricIndex(); - - // TODO : https://github.com/project-chip/connectedhomeip/issues/24289 - ClientMonitoringRegistrationTable table(chip::Server::GetInstance().GetPersistentStorage()); - - VerifyOrReturnError(!table.HasValueForFabric(fabric), InteractionModel::Status::ResourceExhausted); - - table.GetClientRegistrationEntry().fabricIndex = fabric; - table.GetClientRegistrationEntry().clientNodeId = commandData.clientNodeId; - table.GetClientRegistrationEntry().ICid = commandData.ICid; - - VerifyOrReturnError(table.SaveToStorage() == CHIP_NO_ERROR, InteractionModel::Status::Failure); - - return InteractionModel::Status::Success; -} - -InteractionModel::Status -ClientMonitoringServer::UnregisterClientMonitoringCommand(CommandHandler * commandObj, const ConcreteCommandPath & commandPath, - const Commands::UnregisterClientMonitoring::DecodableType & commandData) -{ - FabricIndex fabric = commandObj->GetAccessingFabricIndex(); - - // TODO : https://github.com/project-chip/connectedhomeip/issues/24289 - ClientMonitoringRegistrationTable table(chip::Server::GetInstance().GetPersistentStorage()); - - CHIP_ERROR err = table.LoadFromStorage(fabric); - - if (err == CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND) - { - // Success if there was no key - return InteractionModel::Status::Success; - } - - VerifyOrReturnError(err == CHIP_NO_ERROR, InteractionModel::Status::Failure); - - // Check if initiator has the token and the correct node id - VerifyOrReturnError(table.GetClientRegistrationEntry().clientNodeId == commandData.clientNodeId, - InteractionModel::Status::Failure); - VerifyOrReturnError(table.GetClientRegistrationEntry().ICid == commandData.ICid, InteractionModel::Status::Failure); - - // Delete Key from storage afters checks - VerifyOrReturnError(table.DeleteFromStorage(fabric) == CHIP_NO_ERROR, InteractionModel::Status::Failure); - - return InteractionModel::Status::Success; -} - -/********************************************************** - * Callbacks Implementation - *********************************************************/ - -/** - * @brief Client Monitoring Cluster RegisterClientMonitoring Command callback (from client) - * - */ -bool emberAfClientMonitoringClusterRegisterClientMonitoringCallback( - CommandHandler * commandObj, const ConcreteCommandPath & commandPath, - const Commands::RegisterClientMonitoring::DecodableType & commandData) -{ - ClientMonitoringServer server; - InteractionModel::Status status = server.RegisterClientMonitoringCommand(commandObj, commandPath, commandData); - - commandObj->AddStatus(commandPath, status); - return true; -} - -/** - * @brief Client Monitoring Cluster UregisterClientMonitoring Command callback (from client) - * - */ -bool emberAfClientMonitoringClusterUnregisterClientMonitoringCallback( - CommandHandler * commandObj, const ConcreteCommandPath & commandPath, - const Commands::UnregisterClientMonitoring::DecodableType & commandData) -{ - ClientMonitoringServer server; - InteractionModel::Status status = server.UnregisterClientMonitoringCommand(commandObj, commandPath, commandData); - - commandObj->AddStatus(commandPath, status); - return true; -} - -/** - * @brief Client Monitoring Cluster StayAwakeRequest Command callback (from client) - */ -bool emberAfClientMonitoringClusterStayAwakeRequestCallback(CommandHandler * commandObj, const ConcreteCommandPath & commandPath, - const Commands::StayAwakeRequest::DecodableType & commandData) -{ - ClientMonitoringServer server; - InteractionModel::Status status = server.StayAwakeRequestCommand(commandPath); - - commandObj->AddStatus(commandPath, status); - return true; -} - -void MatterClientMonitoringPluginServerInitCallback() -{ - registerAttributeAccessOverride(&gAttribute); -} diff --git a/src/app/clusters/icd-management-server/icd-management-server.cpp b/src/app/clusters/icd-management-server/icd-management-server.cpp new file mode 100644 index 00000000000000..0855514da8449a --- /dev/null +++ b/src/app/clusters/icd-management-server/icd-management-server.cpp @@ -0,0 +1,152 @@ +/** + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "icd-management-server.h" + +#include "app/server/Server.h" +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::IcdManagement; +using namespace Protocols; + +//============================================================================== + +namespace { + +/** + * @brief Implementation of attribute access for IcdManagement cluster + */ +class IcdManagementAttributeAccess : public app::AttributeAccessInterface +{ +public: + IcdManagementAttributeAccess() : AttributeAccessInterface(MakeOptional(kRootEndpointId), IcdManagement::Id) {} + + CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; + +private: + CHIP_ERROR ReadRegisteredClients(EndpointId endpoint, AttributeValueEncoder & encoder); +}; + +CHIP_ERROR IcdManagementAttributeAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) +{ + VerifyOrDie(aPath.mClusterId == IcdManagement::Id); + + switch (aPath.mAttributeId) + { + case IcdManagement::Attributes::RegisteredClients::Id: + return ReadRegisteredClients(aPath.mEndpointId, aEncoder); + + default: + break; + } + + return CHIP_NO_ERROR; +} + +CHIP_ERROR IcdManagementAttributeAccess::ReadRegisteredClients(EndpointId endpoint, AttributeValueEncoder & encoder) +{ + return encoder.EncodeEmptyList(); +} + +IcdManagementAttributeAccess gAttribute; + +} // namespace + +//============================================================================== + +InteractionModel::Status +IcdManagementServer::RegisterClient(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::IcdManagement::Commands::RegisterClient::DecodableType & commandData) +{ + // TODO: Implementent logic for end device + return InteractionModel::Status::UnsupportedCommand; +} + +InteractionModel::Status IcdManagementServer::UnregisterClient( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::IcdManagement::Commands::UnregisterClient::DecodableType & commandData) +{ + // TODO: Implementent logic for end device + return InteractionModel::Status::UnsupportedCommand; +} + +InteractionModel::Status IcdManagementServer::StayActiveRequest(const chip::app::ConcreteCommandPath & commandPath) +{ + // TODO: Implementent logic for end device + return InteractionModel::Status::UnsupportedCommand; +} + +//============================================================================== + +/** + * @brief ICD Management Cluster RegisterClient Command callback (from client) + * + */ +bool emberAfIcdManagementClusterRegisterClientCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::IcdManagement::Commands::RegisterClient::DecodableType & commandData) +{ + IcdManagementServer server; + InteractionModel::Status status = server.RegisterClient(commandObj, commandPath, commandData); + + commandObj->AddStatus(commandPath, status); + return true; +} + +/** + * @brief ICD Management Cluster UnregisterClient Command callback (from client) + * + */ +bool emberAfIcdManagementClusterUnregisterClientCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::IcdManagement::Commands::UnregisterClient::DecodableType & commandData) +{ + IcdManagementServer server; + InteractionModel::Status status = server.UnregisterClient(commandObj, commandPath, commandData); + + commandObj->AddStatus(commandPath, status); + return true; +} + +/** + * @brief ICD Management Cluster StayActiveRequest Command callback (from client) + */ +bool emberAfIcdManagementClusterStayActiveRequestCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::IcdManagement::Commands::StayActiveRequest::DecodableType & commandData) +{ + IcdManagementServer server; + InteractionModel::Status status = server.StayActiveRequest(commandPath); + + commandObj->AddStatus(commandPath, status); + return true; +} + +void MatterIcdManagementPluginServerInitCallback() +{ + registerAttributeAccessOverride(&gAttribute); +} diff --git a/src/app/clusters/client-monitoring-server/client-monitoring-server.h b/src/app/clusters/icd-management-server/icd-management-server.h similarity index 53% rename from src/app/clusters/client-monitoring-server/client-monitoring-server.h rename to src/app/clusters/icd-management-server/icd-management-server.h index 4cc0ffa517eb4e..1534ac86543d87 100644 --- a/src/app/clusters/client-monitoring-server/client-monitoring-server.h +++ b/src/app/clusters/icd-management-server/icd-management-server.h @@ -23,15 +23,16 @@ #include #include -class ClientMonitoringServer +using chip::Protocols::InteractionModel::Status; + +class IcdManagementServer { public: - chip::Protocols::InteractionModel::Status StayAwakeRequestCommand(const chip::app::ConcreteCommandPath & commandPath); - chip::Protocols::InteractionModel::Status RegisterClientMonitoringCommand( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::ClientMonitoring::Commands::RegisterClientMonitoring::DecodableType & commandData); + Status RegisterClient(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::IcdManagement::Commands::RegisterClient::DecodableType & commandData); + + Status UnregisterClient(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::IcdManagement::Commands::UnregisterClient::DecodableType & commandData); - chip::Protocols::InteractionModel::Status UnregisterClientMonitoringCommand( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::ClientMonitoring::Commands::UnregisterClientMonitoring::DecodableType & commandData); + Status StayActiveRequest(const chip::app::ConcreteCommandPath & commandPath); }; diff --git a/src/app/tests/suites/TestDescriptorCluster.yaml b/src/app/tests/suites/TestDescriptorCluster.yaml index 803f8507b92f1d..7fa7c7ee79aa0f 100644 --- a/src/app/tests/suites/TestDescriptorCluster.yaml +++ b/src/app/tests/suites/TestDescriptorCluster.yaml @@ -64,10 +64,8 @@ tests: 0x003F, # Group Key Management 0x0040, # Fixed Label 0x0041, # User Label + 0x0046, # ICD Management 0x0405, # Relative Humidity Measurement (why on EP0?) - # Disable CM cluster table tests until update is done - # https://github.com/project-chip/connectedhomeip/issues/24425 - # 0x1046, # Client Monitoring 0xFFF1FC06, # Fault Injection ] diff --git a/src/app/zap-templates/zcl/data-model/all.xml b/src/app/zap-templates/zcl/data-model/all.xml index df0f6cc9d553b6..f9e4c95dd141eb 100644 --- a/src/app/zap-templates/zcl/data-model/all.xml +++ b/src/app/zap-templates/zcl/data-model/all.xml @@ -15,7 +15,6 @@ - @@ -32,6 +31,7 @@ + diff --git a/src/app/zap-templates/zcl/data-model/chip/client-monitoring-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/icd-management-cluster.xml similarity index 50% rename from src/app/zap-templates/zcl/data-model/chip/client-monitoring-cluster.xml rename to src/app/zap-templates/zcl/data-model/chip/icd-management-cluster.xml index 7b9fdae8a919cf..e4be4a7b8745b4 100644 --- a/src/app/zap-templates/zcl/data-model/chip/client-monitoring-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/icd-management-cluster.xml @@ -16,55 +16,67 @@ limitations under the License. --> - + + + + + + - - - + + + + General - Client Monitoring - 0x1046 - CLIENT_MONITORING_CLUSTER - Client Monitoring allows servers to ensure that listed clients are notified when a server is available for communication. + ICD Management + 0x0046 + ICD_MANAGEMENT_CLUSTER + Allows servers to ensure that listed clients are notified when a server is available for communication. + + + + + + IdleModeInterval ActiveModeInterval ActiveModeThreshold - - - ExpectedClients + + RegisteredClients - - + ICDCounter + ClientsSupportedPerFabric - - + Register a client to the end device - - + + + + - - RegisterClientMonitoring response command - - + + RegisterClient response command + - + Unregister a client from an end device - + + - + Request the end device to stay in Active Mode for an additional ActiveModeThreshold diff --git a/src/app/zap-templates/zcl/zcl-with-test-extensions.json b/src/app/zap-templates/zcl/zcl-with-test-extensions.json index 787f4b14f07b05..45ed3306e821e0 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -29,7 +29,6 @@ "bridged-device-basic-information.xml", "chip-ota.xml", "channel-cluster.xml", - "client-monitoring-cluster.xml", "clusters-extensions.xml", "color-control-cluster.xml", "content-launch-cluster.xml", @@ -47,6 +46,7 @@ "global-attributes.xml", "groups-cluster.xml", "group-key-mgmt-cluster.xml", + "icd-management-cluster.xml", "identify-cluster.xml", "illuminance-measurement-cluster.xml", "input-output-value-clusters.xml", diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index 87fc7363570e4b..4d3e4348ae18c0 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -28,7 +28,6 @@ "bridged-device-basic-information.xml", "chip-ota.xml", "channel-cluster.xml", - "client-monitoring-cluster.xml", "clusters-extensions.xml", "color-control-cluster.xml", "content-launch-cluster.xml", @@ -46,6 +45,7 @@ "global-attributes.xml", "groups-cluster.xml", "group-key-mgmt-cluster.xml", + "icd-management-cluster.xml", "identify-cluster.xml", "illuminance-measurement-cluster.xml", "input-output-value-clusters.xml", diff --git a/src/app/zap_cluster_list.json b/src/app/zap_cluster_list.json index 576f0ce109251c..333d629bc21e1f 100644 --- a/src/app/zap_cluster_list.json +++ b/src/app/zap_cluster_list.json @@ -19,7 +19,7 @@ "BRIDGED_DEVICE_BASIC_INFORMATION_CLUSTER": [], "CERAMIC_FILTER_MONITORING_CLUSTER": [], "CHANNEL_CLUSTER": [], - "CLIENT_MONITORING_CLUSTER": [], + "ICD_MANAGEMENT_CLUSTER": [], "COLOR_CONTROL_CLUSTER": [], "COMMISSIONING_CLUSTER": [], "CONTENT_LAUNCHER_CLUSTER": [], @@ -120,7 +120,6 @@ "bridged-device-basic-information-server" ], "CHANNEL_CLUSTER": ["channel-server"], - "CLIENT_MONITORING_CLUSTER": ["client-monitoring-server"], "COLOR_CONTROL_CLUSTER": ["color-control-server"], "COMMISSIONING_CLUSTER": [], "CONTENT_LAUNCHER_CLUSTER": ["content-launch-server"], @@ -141,6 +140,7 @@ "GROUP_KEY_MANAGEMENT_CLUSTER": ["group-key-mgmt-server"], "GROUPS_CLUSTER": ["groups-server"], "IAS_ZONE_CLUSTER": [], + "ICD_MANAGEMENT_CLUSTER": ["icd-management-server"], "IDENTIFY_CLUSTER": ["identify-server"], "ILLUMINANCE_MEASUREMENT_CLUSTER": [], "KEYPAD_INPUT_CLUSTER": ["keypad-input-server"], diff --git a/src/controller/data_model/BUILD.gn b/src/controller/data_model/BUILD.gn index 63e7f575ada88b..e3359d83d369df 100644 --- a/src/controller/data_model/BUILD.gn +++ b/src/controller/data_model/BUILD.gn @@ -200,11 +200,8 @@ if (current_os == "android" || build_java_matter_controller) { "jni/UvFilterMonitoringClient-InvokeSubscribeImpl.cpp", "jni/TonerCartridgeMonitoringClient-ReadImpl.cpp", "jni/TonerCartridgeMonitoringClient-InvokeSubscribeImpl.cpp", - - # Disable CM cluster table tests until update is done - # https://github.com/project-chip/connectedhomeip/issues/24425 - #"jni/ClientMonitoringClient-ReadImpl.cpp", - #"jni/ClientMonitoringClient-InvokeSubscribeImpl.cpp", + "jni/IcdManagementClient-ReadImpl.cpp", + "jni/IcdManagementClient-InvokeSubscribeImpl.cpp", ] deps = [ diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 5188a7979cd8c5..0f3d32506f0216 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -2498,6 +2498,56 @@ client cluster BooleanState = 69 { readonly attribute int16u clusterRevision = 65533; } +/** Allows servers to ensure that listed clients are notified when a server is available for communication. */ +client cluster IcdManagement = 70 { + bitmap ICDManagementFeature : BITMAP32 { + kCheckInProtocolSupport = 0x1; + } + + fabric_scoped struct MonitoringRegistrationStruct { + fabric_sensitive node_id checkInNodeID = 1; + fabric_sensitive int64u monitoredSubject = 2; + fabric_sensitive octet_string<16> key = 3; + fabric_idx fabricIndex = 254; + } + + readonly attribute int32u idleModeInterval = 0; + readonly attribute int32u activeModeInterval = 1; + readonly attribute int16u activeModeThreshold = 2; + readonly attribute access(read: administer) optional MonitoringRegistrationStruct registeredClients[] = 3; + readonly attribute access(read: administer) optional int32u ICDCounter = 4; + readonly attribute optional int16u clientsSupportedPerFabric = 5; + 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; + + request struct RegisterClientRequest { + node_id checkInNodeID = 0; + INT64U monitoredSubject = 1; + OCTET_STRING<16> key = 2; + optional OCTET_STRING<16> verificationKey = 3; + } + + response struct RegisterClientResponse = 1 { + INT32U ICDCounter = 0; + } + + request struct UnregisterClientRequest { + node_id checkInNodeID = 0; + optional OCTET_STRING<16> key = 1; + } + + /** Register a client to the end device */ + fabric command access(invoke: manage) RegisterClient(RegisterClientRequest): RegisterClientResponse = 0; + /** Unregister a client from an end device */ + fabric command access(invoke: manage) UnregisterClient(UnregisterClientRequest): DefaultSuccess = 2; + /** Request the end device to stay in Active Mode for an additional ActiveModeThreshold */ + command access(invoke: manage) StayActiveRequest(): DefaultSuccess = 3; +} + /** Attributes and commands for selecting a mode from a list of supported options. */ client cluster ModeSelect = 80 { bitmap ModeSelectFeature : BITMAP32 { @@ -5877,6 +5927,7 @@ endpoint 1 { binding cluster FixedLabel; binding cluster UserLabel; binding cluster BooleanState; + binding cluster IcdManagement; binding cluster ModeSelect; binding cluster AirQuality; binding cluster HepaFilterMonitoring; diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index 367dc52a435806..671ff4fad1ee38 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -9742,6 +9742,286 @@ } ] }, + { + "name": "ICD Management", + "code": 70, + "mfgCode": null, + "define": "ICD_MANAGEMENT_CLUSTER", + "side": "client", + "enabled": 1, + "commands": [ + { + "name": "RegisterClient", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "UnregisterClient", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "StayActiveRequest", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "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": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "ICD Management", + "code": 70, + "mfgCode": null, + "define": "ICD_MANAGEMENT_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "RegisterClientResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "IdleModeInterval", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "500", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveModeInterval", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "300", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveModeThreshold", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "300", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "RegisteredClients", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ICDCounter", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientsSupportedPerFabric", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "RAM", + "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": "RAM", + "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": "RAM", + "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": "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": "0x0001", + "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": "Mode Select", "code": 80, diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java index 6de0eaa11e6452..20574c1135c838 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java @@ -6813,6 +6813,177 @@ private static Map readBooleanStateInteractionInfo() { return result; } + private static Map readIcdManagementInteractionInfo() { + Map result = new LinkedHashMap<>(); + Map readIcdManagementIdleModeIntervalCommandParams = + new LinkedHashMap(); + InteractionInfo readIcdManagementIdleModeIntervalAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.IcdManagementCluster) cluster) + .readIdleModeIntervalAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readIcdManagementIdleModeIntervalCommandParams); + result.put( + "readIdleModeIntervalAttribute", readIcdManagementIdleModeIntervalAttributeInteractionInfo); + Map readIcdManagementActiveModeIntervalCommandParams = + new LinkedHashMap(); + InteractionInfo readIcdManagementActiveModeIntervalAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.IcdManagementCluster) cluster) + .readActiveModeIntervalAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readIcdManagementActiveModeIntervalCommandParams); + result.put( + "readActiveModeIntervalAttribute", + readIcdManagementActiveModeIntervalAttributeInteractionInfo); + Map readIcdManagementActiveModeThresholdCommandParams = + new LinkedHashMap(); + InteractionInfo readIcdManagementActiveModeThresholdAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.IcdManagementCluster) cluster) + .readActiveModeThresholdAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readIcdManagementActiveModeThresholdCommandParams); + result.put( + "readActiveModeThresholdAttribute", + readIcdManagementActiveModeThresholdAttributeInteractionInfo); + Map readIcdManagementRegisteredClientsCommandParams = + new LinkedHashMap(); + InteractionInfo readIcdManagementRegisteredClientsAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.IcdManagementCluster) cluster) + .readRegisteredClientsAttribute( + (ChipClusters.IcdManagementCluster.RegisteredClientsAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedIcdManagementClusterRegisteredClientsAttributeCallback(), + readIcdManagementRegisteredClientsCommandParams); + result.put( + "readRegisteredClientsAttribute", + readIcdManagementRegisteredClientsAttributeInteractionInfo); + Map readIcdManagementICDCounterCommandParams = + new LinkedHashMap(); + InteractionInfo readIcdManagementICDCounterAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.IcdManagementCluster) cluster) + .readICDCounterAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readIcdManagementICDCounterCommandParams); + result.put("readICDCounterAttribute", readIcdManagementICDCounterAttributeInteractionInfo); + Map readIcdManagementClientsSupportedPerFabricCommandParams = + new LinkedHashMap(); + InteractionInfo readIcdManagementClientsSupportedPerFabricAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.IcdManagementCluster) cluster) + .readClientsSupportedPerFabricAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readIcdManagementClientsSupportedPerFabricCommandParams); + result.put( + "readClientsSupportedPerFabricAttribute", + readIcdManagementClientsSupportedPerFabricAttributeInteractionInfo); + Map readIcdManagementGeneratedCommandListCommandParams = + new LinkedHashMap(); + InteractionInfo readIcdManagementGeneratedCommandListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.IcdManagementCluster) cluster) + .readGeneratedCommandListAttribute( + (ChipClusters.IcdManagementCluster.GeneratedCommandListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedIcdManagementClusterGeneratedCommandListAttributeCallback(), + readIcdManagementGeneratedCommandListCommandParams); + result.put( + "readGeneratedCommandListAttribute", + readIcdManagementGeneratedCommandListAttributeInteractionInfo); + Map readIcdManagementAcceptedCommandListCommandParams = + new LinkedHashMap(); + InteractionInfo readIcdManagementAcceptedCommandListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.IcdManagementCluster) cluster) + .readAcceptedCommandListAttribute( + (ChipClusters.IcdManagementCluster.AcceptedCommandListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedIcdManagementClusterAcceptedCommandListAttributeCallback(), + readIcdManagementAcceptedCommandListCommandParams); + result.put( + "readAcceptedCommandListAttribute", + readIcdManagementAcceptedCommandListAttributeInteractionInfo); + Map readIcdManagementEventListCommandParams = + new LinkedHashMap(); + InteractionInfo readIcdManagementEventListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.IcdManagementCluster) cluster) + .readEventListAttribute( + (ChipClusters.IcdManagementCluster.EventListAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIcdManagementClusterEventListAttributeCallback(), + readIcdManagementEventListCommandParams); + result.put("readEventListAttribute", readIcdManagementEventListAttributeInteractionInfo); + Map readIcdManagementAttributeListCommandParams = + new LinkedHashMap(); + InteractionInfo readIcdManagementAttributeListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.IcdManagementCluster) cluster) + .readAttributeListAttribute( + (ChipClusters.IcdManagementCluster.AttributeListAttributeCallback) callback); + }, + () -> + new ClusterInfoMapping + .DelegatedIcdManagementClusterAttributeListAttributeCallback(), + readIcdManagementAttributeListCommandParams); + result.put( + "readAttributeListAttribute", readIcdManagementAttributeListAttributeInteractionInfo); + Map readIcdManagementFeatureMapCommandParams = + new LinkedHashMap(); + InteractionInfo readIcdManagementFeatureMapAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.IcdManagementCluster) cluster) + .readFeatureMapAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readIcdManagementFeatureMapCommandParams); + result.put("readFeatureMapAttribute", readIcdManagementFeatureMapAttributeInteractionInfo); + Map readIcdManagementClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readIcdManagementClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.IcdManagementCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readIcdManagementClusterRevisionCommandParams); + result.put( + "readClusterRevisionAttribute", readIcdManagementClusterRevisionAttributeInteractionInfo); + + return result; + } + private static Map readModeSelectInteractionInfo() { Map result = new LinkedHashMap<>(); Map readModeSelectDescriptionCommandParams = @@ -18385,6 +18556,7 @@ public Map> getReadAttributeMap() { put("fixedLabel", readFixedLabelInteractionInfo()); put("userLabel", readUserLabelInteractionInfo()); put("booleanState", readBooleanStateInteractionInfo()); + put("icdManagement", readIcdManagementInteractionInfo()); put("modeSelect", readModeSelectInteractionInfo()); put("airQuality", readAirQualityInteractionInfo()); put("hepaFilterMonitoring", readHepaFilterMonitoringInteractionInfo()); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java index a94bc8f142ead1..c3d7038d4358b6 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java @@ -591,6 +591,8 @@ public Map> getWriteAttributeMap() { writeAttributeMap.put("userLabel", writeUserLabelInteractionInfo); Map writeBooleanStateInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("booleanState", writeBooleanStateInteractionInfo); + Map writeIcdManagementInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("icdManagement", writeIcdManagementInteractionInfo); Map writeModeSelectInteractionInfo = new LinkedHashMap<>(); Map writeModeSelectStartUpModeCommandParams = new LinkedHashMap(); diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index e56aebdb0549bf..f8a1f257a0af6b 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -10550,6 +10550,282 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } + case app::Clusters::IcdManagement::Id: { + using namespace app::Clusters::IcdManagement; + switch (aPath.mAttributeId) + { + case Attributes::IdleModeInterval::Id: { + using TypeInfo = Attributes::IdleModeInterval::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::ActiveModeInterval::Id: { + using TypeInfo = Attributes::ActiveModeInterval::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::ActiveModeThreshold::Id: { + using TypeInfo = Attributes::ActiveModeThreshold::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::RegisteredClients::Id: { + using TypeInfo = Attributes::RegisteredClients::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + jobject newElement_0_checkInNodeID; + std::string newElement_0_checkInNodeIDClassName = "java/lang/Long"; + std::string newElement_0_checkInNodeIDCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_checkInNodeIDClassName.c_str(), + newElement_0_checkInNodeIDCtorSignature.c_str(), + entry_0.checkInNodeID, newElement_0_checkInNodeID); + jobject newElement_0_monitoredSubject; + std::string newElement_0_monitoredSubjectClassName = "java/lang/Long"; + std::string newElement_0_monitoredSubjectCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_monitoredSubjectClassName.c_str(), newElement_0_monitoredSubjectCtorSignature.c_str(), + entry_0.monitoredSubject, newElement_0_monitoredSubject); + jobject newElement_0_key; + jbyteArray newElement_0_keyByteArray = env->NewByteArray(static_cast(entry_0.key.size())); + env->SetByteArrayRegion(newElement_0_keyByteArray, 0, static_cast(entry_0.key.size()), + reinterpret_cast(entry_0.key.data())); + newElement_0_key = newElement_0_keyByteArray; + jobject newElement_0_fabricIndex; + std::string newElement_0_fabricIndexClassName = "java/lang/Integer"; + std::string newElement_0_fabricIndexCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_fabricIndexClassName.c_str(), + newElement_0_fabricIndexCtorSignature.c_str(), + entry_0.fabricIndex, newElement_0_fabricIndex); + + jclass monitoringRegistrationStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$IcdManagementClusterMonitoringRegistrationStruct", + monitoringRegistrationStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$IcdManagementClusterMonitoringRegistrationStruct"); + return nullptr; + } + jmethodID monitoringRegistrationStructStructCtor_1 = + env->GetMethodID(monitoringRegistrationStructStructClass_1, "", + "(Ljava/lang/Long;Ljava/lang/Long;[BLjava/lang/Integer;)V"); + if (monitoringRegistrationStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$IcdManagementClusterMonitoringRegistrationStruct constructor"); + return nullptr; + } + + newElement_0 = env->NewObject(monitoringRegistrationStructStructClass_1, monitoringRegistrationStructStructCtor_1, + newElement_0_checkInNodeID, newElement_0_monitoredSubject, newElement_0_key, + newElement_0_fabricIndex); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::ICDCounter::Id: { + using TypeInfo = Attributes::ICDCounter::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::ClientsSupportedPerFabric::Id: { + using TypeInfo = Attributes::ClientsSupportedPerFabric::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::GeneratedCommandList::Id: { + using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AcceptedCommandList::Id: { + using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::EventList::Id: { + using TypeInfo = Attributes::EventList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AttributeList::Id: { + using TypeInfo = Attributes::AttributeList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::FeatureMap::Id: { + using TypeInfo = Attributes::FeatureMap::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::ClusterRevision::Id: { + using TypeInfo = Attributes::ClusterRevision::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + break; + } + break; + } case app::Clusters::ModeSelect::Id: { using namespace app::Clusters::ModeSelect; switch (aPath.mAttributeId) diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp index b48d7341ae548a..ecbffc60ee818b 100644 --- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp @@ -2191,6 +2191,16 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } + case app::Clusters::IcdManagement::Id: { + using namespace app::Clusters::IcdManagement; + switch (aPath.mEventId) + { + default: + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + break; + } + break; + } case app::Clusters::ModeSelect::Id: { using namespace app::Clusters::ModeSelect; switch (aPath.mEventId) diff --git a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp index 2fb5e13227f298..0c1c13cfef0297 100644 --- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp @@ -2702,6 +2702,67 @@ void CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback::Callback env->CallVoidMethod(javaCallbackRef, javaMethod, GroupKeySetIDs); } +CHIPIcdManagementClusterRegisterClientResponseCallback::CHIPIcdManagementClusterRegisterClientResponseCallback( + jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPIcdManagementClusterRegisterClientResponseCallback::~CHIPIcdManagementClusterRegisterClientResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPIcdManagementClusterRegisterClientResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::IcdManagement::Commands::RegisterClientResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Long;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject ICDCounter; + std::string ICDCounterClassName = "java/lang/Long"; + std::string ICDCounterCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(ICDCounterClassName.c_str(), ICDCounterCtorSignature.c_str(), + dataResponse.ICDCounter, ICDCounter); + + env->CallVoidMethod(javaCallbackRef, javaMethod, ICDCounter); +} CHIPDoorLockClusterGetWeekDayScheduleResponseCallback::CHIPDoorLockClusterGetWeekDayScheduleResponseCallback(jobject javaCallback) : Callback::Callback(CallbackFn, this) { diff --git a/src/controller/java/zap-generated/CHIPInvokeCallbacks.h b/src/controller/java/zap-generated/CHIPInvokeCallbacks.h index 5a264fb1994368..1c0c13df135b5c 100644 --- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.h +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.h @@ -434,6 +434,21 @@ class CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback jobject javaCallbackRef; }; +class CHIPIcdManagementClusterRegisterClientResponseCallback + : public Callback::Callback +{ +public: + CHIPIcdManagementClusterRegisterClientResponseCallback(jobject javaCallback); + + ~CHIPIcdManagementClusterRegisterClientResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::IcdManagement::Commands::RegisterClientResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + class CHIPDoorLockClusterGetWeekDayScheduleResponseCallback : public Callback::Callback { diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index b8730ef9149910..a46f9158eff9fd 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -17395,6 +17395,401 @@ void CHIPBooleanStateAttributeListAttributeCallback::CallbackFn(void * context, env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } +CHIPIcdManagementRegisteredClientsAttributeCallback::CHIPIcdManagementRegisteredClientsAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPIcdManagementRegisteredClientsAttributeCallback::~CHIPIcdManagementRegisteredClientsAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPIcdManagementRegisteredClientsAttributeCallback::CallbackFn( + void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::IcdManagement::Structs::MonitoringRegistrationStruct::DecodableType> & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + jobject newElement_0_checkInNodeID; + std::string newElement_0_checkInNodeIDClassName = "java/lang/Long"; + std::string newElement_0_checkInNodeIDCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_checkInNodeIDClassName.c_str(), + newElement_0_checkInNodeIDCtorSignature.c_str(), + entry_0.checkInNodeID, newElement_0_checkInNodeID); + jobject newElement_0_monitoredSubject; + std::string newElement_0_monitoredSubjectClassName = "java/lang/Long"; + std::string newElement_0_monitoredSubjectCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_monitoredSubjectClassName.c_str(), + newElement_0_monitoredSubjectCtorSignature.c_str(), + entry_0.monitoredSubject, newElement_0_monitoredSubject); + jobject newElement_0_key; + jbyteArray newElement_0_keyByteArray = env->NewByteArray(static_cast(entry_0.key.size())); + env->SetByteArrayRegion(newElement_0_keyByteArray, 0, static_cast(entry_0.key.size()), + reinterpret_cast(entry_0.key.data())); + newElement_0_key = newElement_0_keyByteArray; + jobject newElement_0_fabricIndex; + std::string newElement_0_fabricIndexClassName = "java/lang/Integer"; + std::string newElement_0_fabricIndexCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_fabricIndexClassName.c_str(), + newElement_0_fabricIndexCtorSignature.c_str(), + entry_0.fabricIndex, newElement_0_fabricIndex); + + jclass monitoringRegistrationStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$IcdManagementClusterMonitoringRegistrationStruct", + monitoringRegistrationStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$IcdManagementClusterMonitoringRegistrationStruct"); + return; + } + jmethodID monitoringRegistrationStructStructCtor_1 = env->GetMethodID( + monitoringRegistrationStructStructClass_1, "", "(Ljava/lang/Long;Ljava/lang/Long;[BLjava/lang/Integer;)V"); + if (monitoringRegistrationStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$IcdManagementClusterMonitoringRegistrationStruct constructor"); + return; + } + + newElement_0 = + env->NewObject(monitoringRegistrationStructStructClass_1, monitoringRegistrationStructStructCtor_1, + newElement_0_checkInNodeID, newElement_0_monitoredSubject, newElement_0_key, newElement_0_fabricIndex); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPIcdManagementGeneratedCommandListAttributeCallback::CHIPIcdManagementGeneratedCommandListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPIcdManagementGeneratedCommandListAttributeCallback::~CHIPIcdManagementGeneratedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPIcdManagementGeneratedCommandListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPIcdManagementAcceptedCommandListAttributeCallback::CHIPIcdManagementAcceptedCommandListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPIcdManagementAcceptedCommandListAttributeCallback::~CHIPIcdManagementAcceptedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPIcdManagementAcceptedCommandListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPIcdManagementEventListAttributeCallback::CHIPIcdManagementEventListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPIcdManagementEventListAttributeCallback::~CHIPIcdManagementEventListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPIcdManagementEventListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPIcdManagementAttributeListAttributeCallback::CHIPIcdManagementAttributeListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPIcdManagementAttributeListAttributeCallback::~CHIPIcdManagementAttributeListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPIcdManagementAttributeListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + CHIPModeSelectStandardNamespaceAttributeCallback::CHIPModeSelectStandardNamespaceAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java index 5ddcab18c1db4a..e03fffda2bed94 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java @@ -12310,6 +12310,326 @@ private native void subscribeClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } + public static class IcdManagementCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 70L; + + public IcdManagementCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId); + } + + @Override + public native long initWithDevice(long devicePtr, int endpointId); + + public void registerClient( + RegisterClientResponseCallback callback, + Long checkInNodeID, + Long monitoredSubject, + byte[] key, + Optional verificationKey) { + registerClient( + chipClusterPtr, callback, checkInNodeID, monitoredSubject, key, verificationKey, null); + } + + public void registerClient( + RegisterClientResponseCallback callback, + Long checkInNodeID, + Long monitoredSubject, + byte[] key, + Optional verificationKey, + int timedInvokeTimeoutMs) { + registerClient( + chipClusterPtr, + callback, + checkInNodeID, + monitoredSubject, + key, + verificationKey, + timedInvokeTimeoutMs); + } + + public void unregisterClient( + DefaultClusterCallback callback, Long checkInNodeID, Optional key) { + unregisterClient(chipClusterPtr, callback, checkInNodeID, key, null); + } + + public void unregisterClient( + DefaultClusterCallback callback, + Long checkInNodeID, + Optional key, + int timedInvokeTimeoutMs) { + unregisterClient(chipClusterPtr, callback, checkInNodeID, key, timedInvokeTimeoutMs); + } + + public void stayActiveRequest(DefaultClusterCallback callback) { + stayActiveRequest(chipClusterPtr, callback, null); + } + + public void stayActiveRequest(DefaultClusterCallback callback, int timedInvokeTimeoutMs) { + + stayActiveRequest(chipClusterPtr, callback, timedInvokeTimeoutMs); + } + + private native void registerClient( + long chipClusterPtr, + RegisterClientResponseCallback Callback, + Long checkInNodeID, + Long monitoredSubject, + byte[] key, + Optional verificationKey, + @Nullable Integer timedInvokeTimeoutMs); + + private native void unregisterClient( + long chipClusterPtr, + DefaultClusterCallback Callback, + Long checkInNodeID, + Optional key, + @Nullable Integer timedInvokeTimeoutMs); + + private native void stayActiveRequest( + long chipClusterPtr, + DefaultClusterCallback Callback, + @Nullable Integer timedInvokeTimeoutMs); + + public interface RegisterClientResponseCallback { + void onSuccess(Long ICDCounter); + + void onError(Exception error); + } + + public interface RegisteredClientsAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface GeneratedCommandListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface AcceptedCommandListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface EventListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface AttributeListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public void readIdleModeIntervalAttribute(LongAttributeCallback callback) { + readIdleModeIntervalAttribute(chipClusterPtr, callback); + } + + public void subscribeIdleModeIntervalAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + subscribeIdleModeIntervalAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readActiveModeIntervalAttribute(LongAttributeCallback callback) { + readActiveModeIntervalAttribute(chipClusterPtr, callback); + } + + public void subscribeActiveModeIntervalAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + subscribeActiveModeIntervalAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readActiveModeThresholdAttribute(IntegerAttributeCallback callback) { + readActiveModeThresholdAttribute(chipClusterPtr, callback); + } + + public void subscribeActiveModeThresholdAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeActiveModeThresholdAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readRegisteredClientsAttribute(RegisteredClientsAttributeCallback callback) { + readRegisteredClientsAttribute(chipClusterPtr, callback); + } + + public void subscribeRegisteredClientsAttribute( + RegisteredClientsAttributeCallback callback, int minInterval, int maxInterval) { + subscribeRegisteredClientsAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readICDCounterAttribute(LongAttributeCallback callback) { + readICDCounterAttribute(chipClusterPtr, callback); + } + + public void subscribeICDCounterAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + subscribeICDCounterAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readClientsSupportedPerFabricAttribute(IntegerAttributeCallback callback) { + readClientsSupportedPerFabricAttribute(chipClusterPtr, callback); + } + + public void subscribeClientsSupportedPerFabricAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeClientsSupportedPerFabricAttribute( + chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readGeneratedCommandListAttribute(GeneratedCommandListAttributeCallback callback) { + readGeneratedCommandListAttribute(chipClusterPtr, callback); + } + + public void subscribeGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeGeneratedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAcceptedCommandListAttribute(AcceptedCommandListAttributeCallback callback) { + readAcceptedCommandListAttribute(chipClusterPtr, callback); + } + + public void subscribeAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeAcceptedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readEventListAttribute(EventListAttributeCallback callback) { + readEventListAttribute(chipClusterPtr, callback); + } + + public void subscribeEventListAttribute( + EventListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeEventListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAttributeListAttribute(AttributeListAttributeCallback callback) { + readAttributeListAttribute(chipClusterPtr, callback); + } + + public void subscribeAttributeListAttribute( + AttributeListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeAttributeListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readFeatureMapAttribute(LongAttributeCallback callback) { + readFeatureMapAttribute(chipClusterPtr, callback); + } + + public void subscribeFeatureMapAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + subscribeFeatureMapAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { + readClusterRevisionAttribute(chipClusterPtr, callback); + } + + public void subscribeClusterRevisionAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + private native void readIdleModeIntervalAttribute( + long chipClusterPtr, LongAttributeCallback callback); + + private native void subscribeIdleModeIntervalAttribute( + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); + + private native void readActiveModeIntervalAttribute( + long chipClusterPtr, LongAttributeCallback callback); + + private native void subscribeActiveModeIntervalAttribute( + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); + + private native void readActiveModeThresholdAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeActiveModeThresholdAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readRegisteredClientsAttribute( + long chipClusterPtr, RegisteredClientsAttributeCallback callback); + + private native void subscribeRegisteredClientsAttribute( + long chipClusterPtr, + RegisteredClientsAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readICDCounterAttribute( + long chipClusterPtr, LongAttributeCallback callback); + + private native void subscribeICDCounterAttribute( + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); + + private native void readClientsSupportedPerFabricAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeClientsSupportedPerFabricAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readGeneratedCommandListAttribute( + long chipClusterPtr, GeneratedCommandListAttributeCallback callback); + + private native void subscribeGeneratedCommandListAttribute( + long chipClusterPtr, + GeneratedCommandListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readAcceptedCommandListAttribute( + long chipClusterPtr, AcceptedCommandListAttributeCallback callback); + + private native void subscribeAcceptedCommandListAttribute( + long chipClusterPtr, + AcceptedCommandListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readEventListAttribute( + long chipClusterPtr, EventListAttributeCallback callback); + + private native void subscribeEventListAttribute( + long chipClusterPtr, EventListAttributeCallback callback, int minInterval, int maxInterval); + + private native void readAttributeListAttribute( + long chipClusterPtr, AttributeListAttributeCallback callback); + + private native void subscribeAttributeListAttribute( + long chipClusterPtr, + AttributeListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readFeatureMapAttribute( + long chipClusterPtr, LongAttributeCallback callback); + + private native void subscribeFeatureMapAttribute( + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); + + private native void readClusterRevisionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeClusterRevisionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + } + public static class ModeSelectCluster extends BaseChipCluster { public static final long CLUSTER_ID = 80L; diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java index 0e15357779be0a..2d67c350f0886c 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java @@ -130,6 +130,9 @@ public static String clusterIdToName(long clusterId) { if (clusterId == 69L) { return "BooleanState"; } + if (clusterId == 70L) { + return "IcdManagement"; + } if (clusterId == 80L) { return "ModeSelect"; } @@ -1785,6 +1788,45 @@ public static String attributeIdToName(long clusterId, long attributeId) { } return ""; } + if (clusterId == 70L) { + if (attributeId == 0L) { + return "IdleModeInterval"; + } + if (attributeId == 1L) { + return "ActiveModeInterval"; + } + if (attributeId == 2L) { + return "ActiveModeThreshold"; + } + if (attributeId == 3L) { + return "RegisteredClients"; + } + if (attributeId == 4L) { + return "ICDCounter"; + } + if (attributeId == 5L) { + return "ClientsSupportedPerFabric"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } if (clusterId == 80L) { if (attributeId == 0L) { return "Description"; @@ -4565,6 +4607,9 @@ public static String eventIdToName(long clusterId, long eventId) { } return ""; } + if (clusterId == 70L) { + return ""; + } if (clusterId == 80L) { return ""; } diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java index 18d55b362c7b68..238ab930c6f0cb 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java @@ -1312,6 +1312,41 @@ public String toString() { } } + public static class IcdManagementClusterMonitoringRegistrationStruct { + public Long checkInNodeID; + public Long monitoredSubject; + public byte[] key; + public Integer fabricIndex; + + public IcdManagementClusterMonitoringRegistrationStruct( + Long checkInNodeID, Long monitoredSubject, byte[] key, Integer fabricIndex) { + this.checkInNodeID = checkInNodeID; + this.monitoredSubject = monitoredSubject; + this.key = key; + this.fabricIndex = fabricIndex; + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("IcdManagementClusterMonitoringRegistrationStruct {\n"); + output.append("\tcheckInNodeID: "); + output.append(checkInNodeID); + output.append("\n"); + output.append("\tmonitoredSubject: "); + output.append(monitoredSubject); + output.append("\n"); + output.append("\tkey: "); + output.append(Arrays.toString(key)); + output.append("\n"); + output.append("\tfabricIndex: "); + output.append(fabricIndex); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } + } + public static class ModeSelectClusterSemanticTagStruct { public Integer mfgCode; public Integer value; diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java index aff2421d4fd800..bb0c456fba3fe9 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java @@ -6422,6 +6422,153 @@ public void onError(Exception ex) { } } + public static class DelegatedIcdManagementClusterRegisterClientResponseCallback + implements ChipClusters.IcdManagementCluster.RegisterClientResponseCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(Long ICDCounter) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo ICDCounterResponseValue = new CommandResponseInfo("ICDCounter", "Long"); + responseValues.put(ICDCounterResponseValue, ICDCounter); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } + + public static class DelegatedIcdManagementClusterRegisteredClientsAttributeCallback + implements ChipClusters.IcdManagementCluster.RegisteredClientsAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess( + List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = + new CommandResponseInfo( + "valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedIcdManagementClusterGeneratedCommandListAttributeCallback + implements ChipClusters.IcdManagementCluster.GeneratedCommandListAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedIcdManagementClusterAcceptedCommandListAttributeCallback + implements ChipClusters.IcdManagementCluster.AcceptedCommandListAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedIcdManagementClusterEventListAttributeCallback + implements ChipClusters.IcdManagementCluster.EventListAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedIcdManagementClusterAttributeListAttributeCallback + implements ChipClusters.IcdManagementCluster.AttributeListAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + public static class DelegatedModeSelectClusterStandardNamespaceAttributeCallback implements ChipClusters.ModeSelectCluster.StandardNamespaceAttributeCallback, DelegatedClusterCallback { @@ -14568,6 +14715,11 @@ public Map initializeClusterMap() { (ptr, endpointId) -> new ChipClusters.BooleanStateCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("booleanState", booleanStateClusterInfo); + ClusterInfo icdManagementClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.IcdManagementCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("icdManagement", icdManagementClusterInfo); ClusterInfo modeSelectClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.ModeSelectCluster(ptr, endpointId), @@ -14846,6 +14998,7 @@ public void combineCommand( destination.get("fixedLabel").combineCommands(source.get("fixedLabel")); destination.get("userLabel").combineCommands(source.get("userLabel")); destination.get("booleanState").combineCommands(source.get("booleanState")); + destination.get("icdManagement").combineCommands(source.get("icdManagement")); destination.get("modeSelect").combineCommands(source.get("modeSelect")); destination.get("airQuality").combineCommands(source.get("airQuality")); destination.get("hepaFilterMonitoring").combineCommands(source.get("hepaFilterMonitoring")); @@ -16896,6 +17049,82 @@ public Map> getCommandMap() { commandMap.put("userLabel", userLabelClusterInteractionInfoMap); Map booleanStateClusterInteractionInfoMap = new LinkedHashMap<>(); commandMap.put("booleanState", booleanStateClusterInteractionInfoMap); + Map icdManagementClusterInteractionInfoMap = new LinkedHashMap<>(); + Map icdManagementregisterClientCommandParams = + new LinkedHashMap(); + CommandParameterInfo icdManagementregisterClientcheckInNodeIDCommandParameterInfo = + new CommandParameterInfo("checkInNodeID", Long.class, Long.class); + icdManagementregisterClientCommandParams.put( + "checkInNodeID", icdManagementregisterClientcheckInNodeIDCommandParameterInfo); + + CommandParameterInfo icdManagementregisterClientmonitoredSubjectCommandParameterInfo = + new CommandParameterInfo("monitoredSubject", Long.class, Long.class); + icdManagementregisterClientCommandParams.put( + "monitoredSubject", icdManagementregisterClientmonitoredSubjectCommandParameterInfo); + + CommandParameterInfo icdManagementregisterClientkeyCommandParameterInfo = + new CommandParameterInfo("key", byte[].class, byte[].class); + icdManagementregisterClientCommandParams.put( + "key", icdManagementregisterClientkeyCommandParameterInfo); + + CommandParameterInfo icdManagementregisterClientverificationKeyCommandParameterInfo = + new CommandParameterInfo("verificationKey", Optional.class, byte[].class); + icdManagementregisterClientCommandParams.put( + "verificationKey", icdManagementregisterClientverificationKeyCommandParameterInfo); + + InteractionInfo icdManagementregisterClientInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.IcdManagementCluster) cluster) + .registerClient( + (ChipClusters.IcdManagementCluster.RegisterClientResponseCallback) callback, + (Long) commandArguments.get("checkInNodeID"), + (Long) commandArguments.get("monitoredSubject"), + (byte[]) commandArguments.get("key"), + (Optional) commandArguments.get("verificationKey")); + }, + () -> new DelegatedIcdManagementClusterRegisterClientResponseCallback(), + icdManagementregisterClientCommandParams); + icdManagementClusterInteractionInfoMap.put( + "registerClient", icdManagementregisterClientInteractionInfo); + Map icdManagementunregisterClientCommandParams = + new LinkedHashMap(); + CommandParameterInfo icdManagementunregisterClientcheckInNodeIDCommandParameterInfo = + new CommandParameterInfo("checkInNodeID", Long.class, Long.class); + icdManagementunregisterClientCommandParams.put( + "checkInNodeID", icdManagementunregisterClientcheckInNodeIDCommandParameterInfo); + + CommandParameterInfo icdManagementunregisterClientkeyCommandParameterInfo = + new CommandParameterInfo("key", Optional.class, byte[].class); + icdManagementunregisterClientCommandParams.put( + "key", icdManagementunregisterClientkeyCommandParameterInfo); + + InteractionInfo icdManagementunregisterClientInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.IcdManagementCluster) cluster) + .unregisterClient( + (DefaultClusterCallback) callback, + (Long) commandArguments.get("checkInNodeID"), + (Optional) commandArguments.get("key")); + }, + () -> new DelegatedDefaultClusterCallback(), + icdManagementunregisterClientCommandParams); + icdManagementClusterInteractionInfoMap.put( + "unregisterClient", icdManagementunregisterClientInteractionInfo); + Map icdManagementstayActiveRequestCommandParams = + new LinkedHashMap(); + InteractionInfo icdManagementstayActiveRequestInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.IcdManagementCluster) cluster) + .stayActiveRequest((DefaultClusterCallback) callback); + }, + () -> new DelegatedDefaultClusterCallback(), + icdManagementstayActiveRequestCommandParams); + icdManagementClusterInteractionInfoMap.put( + "stayActiveRequest", icdManagementstayActiveRequestInteractionInfo); + commandMap.put("icdManagement", icdManagementClusterInteractionInfoMap); Map modeSelectClusterInteractionInfoMap = new LinkedHashMap<>(); Map modeSelectchangeToModeCommandParams = new LinkedHashMap(); diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 9c5aee22039a6f..16a413ea55902b 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -3783,6 +3783,110 @@ class ChipClusters: }, }, } + _ICD_MANAGEMENT_CLUSTER_INFO = { + "clusterName": "IcdManagement", + "clusterId": 0x00000046, + "commands": { + 0x00000000: { + "commandId": 0x00000000, + "commandName": "RegisterClient", + "args": { + "checkInNodeID": "int", + "monitoredSubject": "int", + "key": "bytes", + "verificationKey": "bytes", + }, + }, + 0x00000002: { + "commandId": 0x00000002, + "commandName": "UnregisterClient", + "args": { + "checkInNodeID": "int", + "key": "bytes", + }, + }, + 0x00000003: { + "commandId": 0x00000003, + "commandName": "StayActiveRequest", + "args": { + }, + }, + }, + "attributes": { + 0x00000000: { + "attributeName": "IdleModeInterval", + "attributeId": 0x00000000, + "type": "int", + "reportable": True, + }, + 0x00000001: { + "attributeName": "ActiveModeInterval", + "attributeId": 0x00000001, + "type": "int", + "reportable": True, + }, + 0x00000002: { + "attributeName": "ActiveModeThreshold", + "attributeId": 0x00000002, + "type": "int", + "reportable": True, + }, + 0x00000003: { + "attributeName": "RegisteredClients", + "attributeId": 0x00000003, + "type": "", + "reportable": True, + }, + 0x00000004: { + "attributeName": "ICDCounter", + "attributeId": 0x00000004, + "type": "int", + "reportable": True, + }, + 0x00000005: { + "attributeName": "ClientsSupportedPerFabric", + "attributeId": 0x00000005, + "type": "int", + "reportable": True, + }, + 0x0000FFF8: { + "attributeName": "GeneratedCommandList", + "attributeId": 0x0000FFF8, + "type": "int", + "reportable": True, + }, + 0x0000FFF9: { + "attributeName": "AcceptedCommandList", + "attributeId": 0x0000FFF9, + "type": "int", + "reportable": True, + }, + 0x0000FFFA: { + "attributeName": "EventList", + "attributeId": 0x0000FFFA, + "type": "int", + "reportable": True, + }, + 0x0000FFFB: { + "attributeName": "AttributeList", + "attributeId": 0x0000FFFB, + "type": "int", + "reportable": True, + }, + 0x0000FFFC: { + "attributeName": "FeatureMap", + "attributeId": 0x0000FFFC, + "type": "int", + "reportable": True, + }, + 0x0000FFFD: { + "attributeName": "ClusterRevision", + "attributeId": 0x0000FFFD, + "type": "int", + "reportable": True, + }, + }, + } _MODE_SELECT_CLUSTER_INFO = { "clusterName": "ModeSelect", "clusterId": 0x00000050, @@ -10060,6 +10164,7 @@ class ChipClusters: 0x00000040: _FIXED_LABEL_CLUSTER_INFO, 0x00000041: _USER_LABEL_CLUSTER_INFO, 0x00000045: _BOOLEAN_STATE_CLUSTER_INFO, + 0x00000046: _ICD_MANAGEMENT_CLUSTER_INFO, 0x00000050: _MODE_SELECT_CLUSTER_INFO, 0x0000005B: _AIR_QUALITY_CLUSTER_INFO, 0x00000071: _HEPA_FILTER_MONITORING_CLUSTER_INFO, @@ -10141,6 +10246,7 @@ class ChipClusters: "FixedLabel": _FIXED_LABEL_CLUSTER_INFO, "UserLabel": _USER_LABEL_CLUSTER_INFO, "BooleanState": _BOOLEAN_STATE_CLUSTER_INFO, + "IcdManagement": _ICD_MANAGEMENT_CLUSTER_INFO, "ModeSelect": _MODE_SELECT_CLUSTER_INFO, "AirQuality": _AIR_QUALITY_CLUSTER_INFO, "HepaFilterMonitoring": _HEPA_FILTER_MONITORING_CLUSTER_INFO, diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index a52bf5a47df793..e1c7392971e3b3 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -14501,6 +14501,327 @@ def descriptor(cls) -> ClusterObjectDescriptor: stateValue: 'bool' = False +@dataclass +class IcdManagement(Cluster): + id: typing.ClassVar[int] = 0x0046 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="idleModeInterval", Tag=0x00000000, Type=uint), + ClusterObjectFieldDescriptor(Label="activeModeInterval", Tag=0x00000001, Type=uint), + ClusterObjectFieldDescriptor(Label="activeModeThreshold", Tag=0x00000002, Type=uint), + ClusterObjectFieldDescriptor(Label="registeredClients", Tag=0x00000003, Type=typing.Optional[typing.List[IcdManagement.Structs.MonitoringRegistrationStruct]]), + ClusterObjectFieldDescriptor(Label="ICDCounter", Tag=0x00000004, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="clientsSupportedPerFabric", Tag=0x00000005, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="featureMap", Tag=0x0000FFFC, Type=uint), + ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), + ]) + + idleModeInterval: 'uint' = None + activeModeInterval: 'uint' = None + activeModeThreshold: 'uint' = None + registeredClients: 'typing.Optional[typing.List[IcdManagement.Structs.MonitoringRegistrationStruct]]' = None + ICDCounter: 'typing.Optional[uint]' = None + clientsSupportedPerFabric: 'typing.Optional[uint]' = None + generatedCommandList: 'typing.List[uint]' = None + acceptedCommandList: 'typing.List[uint]' = None + eventList: 'typing.List[uint]' = None + attributeList: 'typing.List[uint]' = None + featureMap: 'uint' = None + clusterRevision: 'uint' = None + + class Bitmaps: + class ICDManagementFeature(IntFlag): + kCheckInProtocolSupport = 0x1 + + class Structs: + @dataclass + class MonitoringRegistrationStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="checkInNodeID", Tag=1, Type=uint), + ClusterObjectFieldDescriptor(Label="monitoredSubject", Tag=2, Type=uint), + ClusterObjectFieldDescriptor(Label="key", Tag=3, Type=bytes), + ClusterObjectFieldDescriptor(Label="fabricIndex", Tag=254, Type=uint), + ]) + + checkInNodeID: 'uint' = 0 + monitoredSubject: 'uint' = 0 + key: 'bytes' = b"" + fabricIndex: 'uint' = 0 + + class Commands: + @dataclass + class RegisterClient(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x0046 + command_id: typing.ClassVar[int] = 0x00000000 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = 'RegisterClientResponse' + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="checkInNodeID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="monitoredSubject", Tag=1, Type=uint), + ClusterObjectFieldDescriptor(Label="key", Tag=2, Type=bytes), + ClusterObjectFieldDescriptor(Label="verificationKey", Tag=3, Type=typing.Optional[bytes]), + ]) + + checkInNodeID: 'uint' = 0 + monitoredSubject: 'uint' = 0 + key: 'bytes' = b"" + verificationKey: 'typing.Optional[bytes]' = None + + @dataclass + class RegisterClientResponse(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x0046 + command_id: typing.ClassVar[int] = 0x00000001 + is_client: typing.ClassVar[bool] = False + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="ICDCounter", Tag=0, Type=uint), + ]) + + ICDCounter: 'uint' = 0 + + @dataclass + class UnregisterClient(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x0046 + command_id: typing.ClassVar[int] = 0x00000002 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="checkInNodeID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="key", Tag=1, Type=typing.Optional[bytes]), + ]) + + checkInNodeID: 'uint' = 0 + key: 'typing.Optional[bytes]' = None + + @dataclass + class StayActiveRequest(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x0046 + command_id: typing.ClassVar[int] = 0x00000003 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ]) + + class Attributes: + @dataclass + class IdleModeInterval(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0046 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000000 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass + class ActiveModeInterval(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0046 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000001 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass + class ActiveModeThreshold(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0046 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000002 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass + class RegisteredClients(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0046 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000003 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[typing.List[IcdManagement.Structs.MonitoringRegistrationStruct]]) + + value: 'typing.Optional[typing.List[IcdManagement.Structs.MonitoringRegistrationStruct]]' = None + + @dataclass + class ICDCounter(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0046 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000004 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + + @dataclass + class ClientsSupportedPerFabric(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0046 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000005 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + + @dataclass + class GeneratedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0046 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFF8 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class AcceptedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0046 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFF9 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class EventList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0046 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFA + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class AttributeList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0046 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFB + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class FeatureMap(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0046 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFC + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass + class ClusterRevision(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0046 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFD + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass class ModeSelect(Cluster): id: typing.ClassVar[int] = 0x0050 @@ -32246,299 +32567,6 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: 'uint' = 0 -@dataclass -class ClientMonitoring(Cluster): - id: typing.ClassVar[int] = 0x1046 - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="idleModeInterval", Tag=0x00000000, Type=uint), - ClusterObjectFieldDescriptor(Label="activeModeInterval", Tag=0x00000001, Type=uint), - ClusterObjectFieldDescriptor(Label="activeModeThreshold", Tag=0x00000002, Type=uint), - ClusterObjectFieldDescriptor(Label="expectedClients", Tag=0x00000003, Type=typing.List[ClientMonitoring.Structs.MonitoringRegistrationStruct]), - ClusterObjectFieldDescriptor(Label="ICDCounter", Tag=0x00000004, Type=uint), - ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), - ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), - ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), - ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), - ClusterObjectFieldDescriptor(Label="featureMap", Tag=0x0000FFFC, Type=uint), - ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), - ]) - - idleModeInterval: 'uint' = None - activeModeInterval: 'uint' = None - activeModeThreshold: 'uint' = None - expectedClients: 'typing.List[ClientMonitoring.Structs.MonitoringRegistrationStruct]' = None - ICDCounter: 'uint' = None - generatedCommandList: 'typing.List[uint]' = None - acceptedCommandList: 'typing.List[uint]' = None - eventList: 'typing.List[uint]' = None - attributeList: 'typing.List[uint]' = None - featureMap: 'uint' = None - clusterRevision: 'uint' = None - - class Structs: - @dataclass - class MonitoringRegistrationStruct(ClusterObject): - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="clientNodeID", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="key", Tag=2, Type=bytes), - ClusterObjectFieldDescriptor(Label="fabricIndex", Tag=254, Type=uint), - ]) - - clientNodeID: 'uint' = 0 - key: 'bytes' = b"" - fabricIndex: 'uint' = 0 - - class Commands: - @dataclass - class RegisterClientMonitoring(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x1046 - command_id: typing.ClassVar[int] = 0x00000000 - is_client: typing.ClassVar[bool] = True - response_type: typing.ClassVar[str] = 'RegisterClientMonitoringResponse' - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="clientNodeID", Tag=0, Type=uint), - ClusterObjectFieldDescriptor(Label="key", Tag=1, Type=bytes), - ]) - - clientNodeID: 'uint' = 0 - key: 'bytes' = b"" - - @dataclass - class RegisterClientMonitoringResponse(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x1046 - command_id: typing.ClassVar[int] = 0x00000001 - is_client: typing.ClassVar[bool] = False - response_type: typing.ClassVar[str] = None - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="status", Tag=0, Type=uint), - ClusterObjectFieldDescriptor(Label="ICDCounter", Tag=1, Type=typing.Union[Nullable, uint]), - ]) - - status: 'uint' = 0 - ICDCounter: 'typing.Union[Nullable, uint]' = NullValue - - @dataclass - class UnregisterClientMonitoring(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x1046 - command_id: typing.ClassVar[int] = 0x00000002 - is_client: typing.ClassVar[bool] = True - response_type: typing.ClassVar[str] = None - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="clientNodeID", Tag=0, Type=uint), - ]) - - clientNodeID: 'uint' = 0 - - @dataclass - class StayAwakeRequest(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x1046 - command_id: typing.ClassVar[int] = 0x00000003 - is_client: typing.ClassVar[bool] = True - response_type: typing.ClassVar[str] = None - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ]) - - class Attributes: - @dataclass - class IdleModeInterval(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x1046 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000000 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - value: 'uint' = 0 - - @dataclass - class ActiveModeInterval(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x1046 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000001 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - value: 'uint' = 0 - - @dataclass - class ActiveModeThreshold(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x1046 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000002 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - value: 'uint' = 0 - - @dataclass - class ExpectedClients(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x1046 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000003 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[ClientMonitoring.Structs.MonitoringRegistrationStruct]) - - value: 'typing.List[ClientMonitoring.Structs.MonitoringRegistrationStruct]' = field(default_factory=lambda: []) - - @dataclass - class ICDCounter(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x1046 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000004 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - value: 'uint' = 0 - - @dataclass - class GeneratedCommandList(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x1046 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFF8 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[uint]) - - value: 'typing.List[uint]' = field(default_factory=lambda: []) - - @dataclass - class AcceptedCommandList(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x1046 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFF9 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[uint]) - - value: 'typing.List[uint]' = field(default_factory=lambda: []) - - @dataclass - class EventList(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x1046 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFFA - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[uint]) - - value: 'typing.List[uint]' = field(default_factory=lambda: []) - - @dataclass - class AttributeList(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x1046 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFFB - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[uint]) - - value: 'typing.List[uint]' = field(default_factory=lambda: []) - - @dataclass - class FeatureMap(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x1046 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFFC - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - value: 'uint' = 0 - - @dataclass - class ClusterRevision(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x1046 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFFD - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - value: 'uint' = 0 - - @dataclass class UnitTesting(Cluster): id: typing.ClassVar[int] = 0xFFF1FC05 diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index ee2eb58f053e8d..6649be74bab271 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -7858,6 +7858,230 @@ static id _Nullable DecodeAttributeValueForBooleanStateCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } +static id _Nullable DecodeAttributeValueForICDManagementCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::IcdManagement; + switch (aAttributeId) { + case Attributes::IdleModeInterval::Id: { + using TypeInfo = Attributes::IdleModeInterval::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; + return value; + } + case Attributes::ActiveModeInterval::Id: { + using TypeInfo = Attributes::ActiveModeInterval::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; + return value; + } + case Attributes::ActiveModeThreshold::Id: { + using TypeInfo = Attributes::ActiveModeThreshold::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } + case Attributes::RegisteredClients::Id: { + using TypeInfo = Attributes::RegisteredClients::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRICDManagementClusterMonitoringRegistrationStruct * newElement_0; + newElement_0 = [MTRICDManagementClusterMonitoringRegistrationStruct new]; + newElement_0.checkInNodeID = [NSNumber numberWithUnsignedLongLong:entry_0.checkInNodeID]; + newElement_0.monitoredSubject = [NSNumber numberWithUnsignedLongLong:entry_0.monitoredSubject]; + newElement_0.key = [NSData dataWithBytes:entry_0.key.data() length:entry_0.key.size()]; + newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::ICDCounter::Id: { + using TypeInfo = Attributes::ICDCounter::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; + return value; + } + case Attributes::ClientsSupportedPerFabric::Id: { + using TypeInfo = Attributes::ClientsSupportedPerFabric::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } + case Attributes::GeneratedCommandList::Id: { + using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::AcceptedCommandList::Id: { + using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::EventList::Id: { + using TypeInfo = Attributes::EventList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::AttributeList::Id: { + using TypeInfo = Attributes::AttributeList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::FeatureMap::Id: { + using TypeInfo = Attributes::FeatureMap::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; + return value; + } + case Attributes::ClusterRevision::Id: { + using TypeInfo = Attributes::ClusterRevision::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} static id _Nullable DecodeAttributeValueForModeSelectCluster( AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { @@ -20295,6 +20519,9 @@ id _Nullable MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::T case Clusters::BooleanState::Id: { return DecodeAttributeValueForBooleanStateCluster(aPath.mAttributeId, aReader, aError); } + case Clusters::IcdManagement::Id: { + return DecodeAttributeValueForICDManagementCluster(aPath.mAttributeId, aReader, aError); + } case Clusters::ModeSelect::Id: { return DecodeAttributeValueForModeSelectCluster(aPath.mAttributeId, aReader, aError); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 63fe82af85971b..3f9dd4a0ed5593 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -7259,6 +7259,192 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @end +/** + * Cluster ICD Management + * + * Allows servers to ensure that listed clients are notified when a server is available for communication. + */ +MTR_NEWLY_AVAILABLE +@interface MTRBaseClusterICDManagement : MTRCluster + +- (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_NEWLY_AVAILABLE; + +/** + * Command RegisterClient + * + * Register a client to the end device + */ +- (void)registerClientWithParams:(MTRICDManagementClusterRegisterClientParams *)params + completion:(void (^)(MTRICDManagementClusterRegisterClientResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +/** + * Command UnregisterClient + * + * Unregister a client from an end device + */ +- (void)unregisterClientWithParams:(MTRICDManagementClusterUnregisterClientParams *)params + completion:(MTRStatusCompletion)completion MTR_NEWLY_AVAILABLE; +/** + * Command StayActiveRequest + * + * Request the end device to stay in Active Mode for an additional ActiveModeThreshold + */ +- (void)stayActiveRequestWithParams:(MTRICDManagementClusterStayActiveRequestParams * _Nullable)params + completion:(MTRStatusCompletion)completion MTR_NEWLY_AVAILABLE; +- (void)stayActiveRequestWithCompletion:(MTRStatusCompletion)completion MTR_NEWLY_AVAILABLE; + +- (void)readAttributeIdleModeIntervalWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeIdleModeIntervalWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler + MTR_NEWLY_AVAILABLE; ++ (void)readAttributeIdleModeIntervalWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; + +- (void)readAttributeActiveModeIntervalWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeActiveModeIntervalWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeActiveModeIntervalWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; + +- (void)readAttributeActiveModeThresholdWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeActiveModeThresholdWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeActiveModeThresholdWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; + +- (void)readAttributeRegisteredClientsWithParams:(MTRReadParams * _Nullable)params + completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeRegisteredClientsWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler + MTR_NEWLY_AVAILABLE; ++ (void)readAttributeRegisteredClientsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; + +- (void)readAttributeICDCounterWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeICDCounterWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler + MTR_NEWLY_AVAILABLE; ++ (void)readAttributeICDCounterWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; + +- (void)readAttributeClientsSupportedPerFabricWithCompletion:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeClientsSupportedPerFabricWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeClientsSupportedPerFabricWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; + +- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; + +- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; + +- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler + MTR_NEWLY_AVAILABLE; ++ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; + +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler + MTR_NEWLY_AVAILABLE; ++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; + +- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler + MTR_NEWLY_AVAILABLE; ++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; + +- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler + MTR_NEWLY_AVAILABLE; ++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + /** * Cluster Mode Select * @@ -21985,6 +22171,10 @@ typedef NS_ENUM(uint8_t, MTRGroupKeyManagementGroupKeySecurityPolicy) { MTRGroupKeyManagementGroupKeySecurityPolicyCacheAndSync API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x01, } API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +typedef NS_OPTIONS(uint32_t, MTRICDManagementFeature) { + MTRICDManagementFeatureCheckInProtocolSupport MTR_NEWLY_AVAILABLE = 0x1, +} MTR_NEWLY_AVAILABLE; + typedef NS_OPTIONS(uint32_t, MTRModeSelectFeature) { MTRModeSelectFeatureDEPONOFF API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x1, } API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index 3fb77bd7a850d8..aaba46525c57ea 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -45127,6 +45127,676 @@ - (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16 @end +@implementation MTRBaseClusterICDManagement + +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _device = device; + _endpoint = [endpointID unsignedShortValue]; + } + return self; +} + +- (void)registerClientWithParams:(MTRICDManagementClusterRegisterClientParams *)params + completion:(void (^)(MTRICDManagementClusterRegisterClientResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + // Make a copy of params before we go async. + params = [params copy]; + auto * bridge = new MTRICDManagementClusterRegisterClientResponseCallbackBridge(self.callbackQueue, completion, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, + ICDManagementClusterRegisterClientResponseCallbackType successCb, MTRErrorCallback failureCb, + MTRCallbackBridgeBase * bridge) { + auto * typedBridge = static_cast(bridge); + Optional timedInvokeTimeoutMs; + Optional invokeTimeout; + ListFreer listFreer; + IcdManagement::Commands::RegisterClient::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + if (params.serverSideProcessingTimeout != nil) { + // Clamp to a number of seconds that will not overflow 32-bit + // int when converted to ms. + auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); + invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); + } + } + request.checkInNodeID = params.checkInNodeID.unsignedLongLongValue; + request.monitoredSubject = params.monitoredSubject.unsignedLongLongValue; + request.key = [self asByteSpan:params.key]; + if (params.verificationKey != nil) { + auto & definedValue_0 = request.verificationKey.Emplace(); + definedValue_0 = [self asByteSpan:params.verificationKey]; + } + + return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self->_endpoint, + timedInvokeTimeoutMs, invokeTimeout); + }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)unregisterClientWithParams:(MTRICDManagementClusterUnregisterClientParams *)params + completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + auto * bridge = new MTRCommandSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, + MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + auto * typedBridge = static_cast(bridge); + Optional timedInvokeTimeoutMs; + Optional invokeTimeout; + ListFreer listFreer; + IcdManagement::Commands::UnregisterClient::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + if (params.serverSideProcessingTimeout != nil) { + // Clamp to a number of seconds that will not overflow 32-bit + // int when converted to ms. + auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); + invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); + } + } + request.checkInNodeID = params.checkInNodeID.unsignedLongLongValue; + if (params.key != nil) { + auto & definedValue_0 = request.key.Emplace(); + definedValue_0 = [self asByteSpan:params.key]; + } + + return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self->_endpoint, + timedInvokeTimeoutMs, invokeTimeout); + }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)stayActiveRequestWithCompletion:(MTRStatusCompletion)completion +{ + [self stayActiveRequestWithParams:nil completion:completion]; +} +- (void)stayActiveRequestWithParams:(MTRICDManagementClusterStayActiveRequestParams * _Nullable)params + completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + auto * bridge = new MTRCommandSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, + MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + auto * typedBridge = static_cast(bridge); + Optional timedInvokeTimeoutMs; + Optional invokeTimeout; + ListFreer listFreer; + IcdManagement::Commands::StayActiveRequest::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + if (params.serverSideProcessingTimeout != nil) { + // Clamp to a number of seconds that will not overflow 32-bit + // int when converted to ms. + auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); + invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); + } + } + + return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self->_endpoint, + timedInvokeTimeoutMs, invokeTimeout); + }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)readAttributeIdleModeIntervalWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = IcdManagement::Attributes::IdleModeInterval::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeIdleModeIntervalWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = IcdManagement::Attributes::IdleModeInterval::TypeInfo; + MTRSubscribeAttribute(params, + subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), + TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeIdleModeIntervalWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = IcdManagement::Attributes::IdleModeInterval::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeActiveModeIntervalWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = IcdManagement::Attributes::ActiveModeInterval::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeActiveModeIntervalWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = IcdManagement::Attributes::ActiveModeInterval::TypeInfo; + MTRSubscribeAttribute(params, + subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), + TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeActiveModeIntervalWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = IcdManagement::Attributes::ActiveModeInterval::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeActiveModeThresholdWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = IcdManagement::Attributes::ActiveModeThreshold::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeActiveModeThresholdWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = IcdManagement::Attributes::ActiveModeThreshold::TypeInfo; + MTRSubscribeAttribute(params, + subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), + TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeActiveModeThresholdWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = IcdManagement::Attributes::ActiveModeThreshold::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeRegisteredClientsWithParams:(MTRReadParams * _Nullable)params + completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ // Make a copy of params before we go async. + params = [params copy]; + using TypeInfo = IcdManagement::Attributes::RegisteredClients::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeRegisteredClientsWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = IcdManagement::Attributes::RegisteredClients::TypeInfo; + MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, + TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeRegisteredClientsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRICDManagementRegisteredClientsListAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(ICDManagementRegisteredClientsListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = IcdManagement::Attributes::RegisteredClients::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeICDCounterWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = IcdManagement::Attributes::ICDCounter::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeICDCounterWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = IcdManagement::Attributes::ICDCounter::TypeInfo; + MTRSubscribeAttribute(params, + subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), + TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeICDCounterWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = IcdManagement::Attributes::ICDCounter::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeClientsSupportedPerFabricWithCompletion:(void (^)( + NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = IcdManagement::Attributes::ClientsSupportedPerFabric::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeClientsSupportedPerFabricWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = IcdManagement::Attributes::ClientsSupportedPerFabric::TypeInfo; + MTRSubscribeAttribute(params, + subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), + TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeClientsSupportedPerFabricWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completion +{ + auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = IcdManagement::Attributes::ClientsSupportedPerFabric::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = IcdManagement::Attributes::GeneratedCommandList::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = IcdManagement::Attributes::GeneratedCommandList::TypeInfo; + MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, + TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRICDManagementGeneratedCommandListListAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(ICDManagementGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = IcdManagement::Attributes::GeneratedCommandList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = IcdManagement::Attributes::AcceptedCommandList::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = IcdManagement::Attributes::AcceptedCommandList::TypeInfo; + MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, + TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRICDManagementAcceptedCommandListListAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(ICDManagementAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = IcdManagement::Attributes::AcceptedCommandList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = IcdManagement::Attributes::EventList::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = IcdManagement::Attributes::EventList::TypeInfo; + MTRSubscribeAttribute( + params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), + TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRICDManagementEventListListAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(ICDManagementEventListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = IcdManagement::Attributes::EventList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = IcdManagement::Attributes::AttributeList::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = IcdManagement::Attributes::AttributeList::TypeInfo; + MTRSubscribeAttribute( + params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), + TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRICDManagementAttributeListListAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(ICDManagementAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = IcdManagement::Attributes::AttributeList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = IcdManagement::Attributes::FeatureMap::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = IcdManagement::Attributes::FeatureMap::TypeInfo; + MTRSubscribeAttribute(params, + subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), + TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = IcdManagement::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = IcdManagement::Attributes::ClusterRevision::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = IcdManagement::Attributes::ClusterRevision::TypeInfo; + MTRSubscribeAttribute(params, + subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), + TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = IcdManagement::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +@end + @implementation MTRBaseClusterModeSelect - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h index a6f1fd5cb10125..ffb8c6ad980b59 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h @@ -197,6 +197,11 @@ @property (nonatomic, assign, readonly) chip::EndpointId endpoint; @end +@interface MTRBaseClusterICDManagement () +@property (nonatomic, strong, readonly) MTRBaseDevice * device; +@property (nonatomic, assign, readonly) chip::EndpointId endpoint; +@end + @interface MTRBaseClusterModeSelect () @property (nonatomic, strong, readonly) MTRBaseDevice * device; @property (nonatomic, assign, readonly) chip::EndpointId endpoint; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h index 05341035e14323..ac4e67a13f4ac2 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h @@ -85,6 +85,8 @@ typedef void (*GroupKeyManagementClusterKeySetReadResponseCallbackType)( void *, const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadResponse::DecodableType &); typedef void (*GroupKeyManagementClusterKeySetReadAllIndicesResponseCallbackType)( void *, const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndicesResponse::DecodableType &); +typedef void (*ICDManagementClusterRegisterClientResponseCallbackType)( + void *, const chip::app::Clusters::IcdManagement::Commands::RegisterClientResponse::DecodableType &); typedef void (*DoorLockClusterGetWeekDayScheduleResponseCallbackType)( void *, const chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType &); typedef void (*DoorLockClusterGetYearDayScheduleResponseCallbackType)( @@ -984,6 +986,18 @@ typedef void (*BooleanStateAcceptedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*BooleanStateAttributeListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*ICDManagementRegisteredClientsListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::IcdManagement::Structs::MonitoringRegistrationStruct::DecodableType> & data); +typedef void (*ICDManagementGeneratedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*ICDManagementAcceptedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*ICDManagementEventListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +typedef void (*ICDManagementAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); typedef void (*ModeSelectSupportedModesListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); @@ -6968,6 +6982,170 @@ class MTRBooleanStateAttributeListListAttributeCallbackSubscriptionBridge MTRSubscriptionEstablishedHandler mEstablishedHandler; }; +class MTRICDManagementRegisteredClientsListAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRICDManagementRegisteredClientsListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRICDManagementRegisteredClientsListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::IcdManagement::Structs::MonitoringRegistrationStruct::DecodableType> & value); +}; + +class MTRICDManagementRegisteredClientsListAttributeCallbackSubscriptionBridge + : public MTRICDManagementRegisteredClientsListAttributeCallbackBridge +{ +public: + MTRICDManagementRegisteredClientsListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRICDManagementRegisteredClientsListAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRICDManagementRegisteredClientsListAttributeCallbackBridge::KeepAliveOnCallback; + using MTRICDManagementRegisteredClientsListAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRICDManagementGeneratedCommandListListAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRICDManagementGeneratedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRICDManagementGeneratedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); +}; + +class MTRICDManagementGeneratedCommandListListAttributeCallbackSubscriptionBridge + : public MTRICDManagementGeneratedCommandListListAttributeCallbackBridge +{ +public: + MTRICDManagementGeneratedCommandListListAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRICDManagementGeneratedCommandListListAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRICDManagementGeneratedCommandListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTRICDManagementGeneratedCommandListListAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRICDManagementAcceptedCommandListListAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRICDManagementAcceptedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRICDManagementAcceptedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); +}; + +class MTRICDManagementAcceptedCommandListListAttributeCallbackSubscriptionBridge + : public MTRICDManagementAcceptedCommandListListAttributeCallbackBridge +{ +public: + MTRICDManagementAcceptedCommandListListAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRICDManagementAcceptedCommandListListAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRICDManagementAcceptedCommandListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTRICDManagementAcceptedCommandListListAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRICDManagementEventListListAttributeCallbackBridge : public MTRCallbackBridge +{ +public: + MTRICDManagementEventListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRICDManagementEventListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); +}; + +class MTRICDManagementEventListListAttributeCallbackSubscriptionBridge : public MTRICDManagementEventListListAttributeCallbackBridge +{ +public: + MTRICDManagementEventListListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRICDManagementEventListListAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRICDManagementEventListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTRICDManagementEventListListAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRICDManagementAttributeListListAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRICDManagementAttributeListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRICDManagementAttributeListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); +}; + +class MTRICDManagementAttributeListListAttributeCallbackSubscriptionBridge + : public MTRICDManagementAttributeListListAttributeCallbackBridge +{ +public: + MTRICDManagementAttributeListListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRICDManagementAttributeListListAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRICDManagementAttributeListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTRICDManagementAttributeListListAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + class MTRModeSelectSupportedModesListAttributeCallbackBridge : public MTRCallbackBridge { @@ -13361,6 +13539,21 @@ class MTRGroupKeyManagementClusterKeySetReadAllIndicesResponseCallbackBridge const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndicesResponse::DecodableType & data); }; +class MTRICDManagementClusterRegisterClientResponseCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRICDManagementClusterRegisterClientResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRICDManagementClusterRegisterClientResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, + const chip::app::Clusters::IcdManagement::Commands::RegisterClientResponse::DecodableType & data); +}; + class MTRDoorLockClusterGetWeekDayScheduleResponseCallbackBridge : public MTRCallbackBridge { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm index 1898dfe6d2911a..d73e63b714b634 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm @@ -6400,6 +6400,201 @@ } } +void MTRICDManagementRegisteredClientsListAttributeCallbackBridge::OnSuccessFn(void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::IcdManagement::Structs::MonitoringRegistrationStruct::DecodableType> & value) +{ + NSArray * _Nonnull objCValue; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = value.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRICDManagementClusterMonitoringRegistrationStruct * newElement_0; + newElement_0 = [MTRICDManagementClusterMonitoringRegistrationStruct new]; + newElement_0.checkInNodeID = [NSNumber numberWithUnsignedLongLong:entry_0.checkInNodeID]; + newElement_0.monitoredSubject = [NSNumber numberWithUnsignedLongLong:entry_0.monitoredSubject]; + newElement_0.key = [NSData dataWithBytes:entry_0.key.data() length:entry_0.key.size()]; + newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; + } + objCValue = array_0; + } + DispatchSuccess(context, objCValue); +}; + +void MTRICDManagementRegisteredClientsListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + +void MTRICDManagementGeneratedCommandListListAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::DecodableList & value) +{ + NSArray * _Nonnull objCValue; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = value.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; + } + objCValue = array_0; + } + DispatchSuccess(context, objCValue); +}; + +void MTRICDManagementGeneratedCommandListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + +void MTRICDManagementAcceptedCommandListListAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::DecodableList & value) +{ + NSArray * _Nonnull objCValue; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = value.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; + } + objCValue = array_0; + } + DispatchSuccess(context, objCValue); +}; + +void MTRICDManagementAcceptedCommandListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + +void MTRICDManagementEventListListAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::DecodableList & value) +{ + NSArray * _Nonnull objCValue; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = value.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; + } + objCValue = array_0; + } + DispatchSuccess(context, objCValue); +}; + +void MTRICDManagementEventListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + +void MTRICDManagementAttributeListListAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::DecodableList & value) +{ + NSArray * _Nonnull objCValue; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = value.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; + } + objCValue = array_0; + } + DispatchSuccess(context, objCValue); +}; + +void MTRICDManagementAttributeListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + void MTRModeSelectSupportedModesListAttributeCallbackBridge::OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value) { @@ -14150,6 +14345,16 @@ DispatchSuccess(context, response); }; +void MTRICDManagementClusterRegisterClientResponseCallbackBridge::OnSuccessFn( + void * context, const chip::app::Clusters::IcdManagement::Commands::RegisterClientResponse::DecodableType & data) +{ + auto * response = [MTRICDManagementClusterRegisterClientResponseParams new]; + { + response.icdCounter = [NSNumber numberWithUnsignedInt:data.ICDCounter]; + } + DispatchSuccess(context, response); +}; + void MTRDoorLockClusterGetWeekDayScheduleResponseCallbackBridge::OnSuccessFn( void * context, const chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType & data) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index cb390c88dc7b25..78253abfaa839a 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -275,6 +275,7 @@ typedef NS_ENUM(uint32_t, MTRClusterIDType) { MTRClusterIDTypeProxyDiscoveryID API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000043, MTRClusterIDTypeProxyValidID API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000044, MTRClusterIDTypeBooleanStateID API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000045, + MTRClusterIDTypeICDManagementID MTR_NEWLY_AVAILABLE = 0x00000046, MTRClusterIDTypeModeSelectID API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000050, MTRClusterIDTypeAirQualityID MTR_NEWLY_AVAILABLE = 0x0000005B, MTRClusterIDTypeHEPAFilterMonitoringID MTR_NEWLY_AVAILABLE = 0x00000071, @@ -3591,6 +3592,23 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRAttributeIDTypeClusterBooleanStateAttributeClusterRevisionID API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster ICDManagement attributes + MTRAttributeIDTypeClusterICDManagementAttributeIdleModeIntervalID MTR_NEWLY_AVAILABLE = 0x00000000, + MTRAttributeIDTypeClusterICDManagementAttributeActiveModeIntervalID MTR_NEWLY_AVAILABLE = 0x00000001, + MTRAttributeIDTypeClusterICDManagementAttributeActiveModeThresholdID MTR_NEWLY_AVAILABLE = 0x00000002, + MTRAttributeIDTypeClusterICDManagementAttributeRegisteredClientsID MTR_NEWLY_AVAILABLE = 0x00000003, + MTRAttributeIDTypeClusterICDManagementAttributeICDCounterID MTR_NEWLY_AVAILABLE = 0x00000004, + MTRAttributeIDTypeClusterICDManagementAttributeClientsSupportedPerFabricID MTR_NEWLY_AVAILABLE = 0x00000005, + MTRAttributeIDTypeClusterICDManagementAttributeGeneratedCommandListID MTR_NEWLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, + MTRAttributeIDTypeClusterICDManagementAttributeAcceptedCommandListID MTR_NEWLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, + MTRAttributeIDTypeClusterICDManagementAttributeAttributeListID MTR_NEWLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeAttributeListID, + MTRAttributeIDTypeClusterICDManagementAttributeFeatureMapID MTR_NEWLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeFeatureMapID, + MTRAttributeIDTypeClusterICDManagementAttributeClusterRevisionID MTR_NEWLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster ModeSelect deprecated attribute names MTRClusterModeSelectAttributeDescriptionID MTR_DEPRECATED( "Please use MTRAttributeIDTypeClusterModeSelectAttributeDescriptionID", ios(16.1, 16.4), macos(13.0, 13.3), @@ -8942,6 +8960,12 @@ typedef NS_ENUM(uint32_t, MTRCommandIDType) { ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000005, + // Cluster ICDManagement commands + MTRCommandIDTypeClusterICDManagementCommandRegisterClientID MTR_NEWLY_AVAILABLE = 0x00000000, + MTRCommandIDTypeClusterICDManagementCommandRegisterClientResponseID MTR_NEWLY_AVAILABLE = 0x00000001, + MTRCommandIDTypeClusterICDManagementCommandUnregisterClientID MTR_NEWLY_AVAILABLE = 0x00000002, + MTRCommandIDTypeClusterICDManagementCommandStayActiveRequestID MTR_NEWLY_AVAILABLE = 0x00000003, + // Cluster ModeSelect deprecated command id names MTRClusterModeSelectCommandChangeToModeID MTR_DEPRECATED("Please use MTRCommandIDTypeClusterModeSelectCommandChangeToModeID", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)) diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index ece7422921c04a..53e7fefd1af627 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -2653,6 +2653,62 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @end +/** + * Cluster ICD Management + * Allows servers to ensure that listed clients are notified when a server is available for communication. + */ +MTR_NEWLY_AVAILABLE +@interface MTRClusterICDManagement : MTRCluster + +- (instancetype _Nullable)initWithDevice:(MTRDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_NEWLY_AVAILABLE; + +- (void)registerClientWithParams:(MTRICDManagementClusterRegisterClientParams *)params + expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries + expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs + completion:(void (^)(MTRICDManagementClusterRegisterClientResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)unregisterClientWithParams:(MTRICDManagementClusterUnregisterClientParams *)params + expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries + expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs + completion:(MTRStatusCompletion)completion MTR_NEWLY_AVAILABLE; +- (void)stayActiveRequestWithParams:(MTRICDManagementClusterStayActiveRequestParams * _Nullable)params + expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries + expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs + completion:(MTRStatusCompletion)completion MTR_NEWLY_AVAILABLE; +- (void)stayActiveRequestWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(MTRStatusCompletion)completion MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeIdleModeIntervalWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeActiveModeIntervalWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeActiveModeThresholdWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeRegisteredClientsWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeICDCounterWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeClientsSupportedPerFabricWithParams:(MTRReadParams * _Nullable)params + MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + /** * Cluster Mode Select * Attributes and commands for selecting a mode from a list of supported options. diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index 6bb2a75441c7d4..c207093eb0f115 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -12419,6 +12419,335 @@ - (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint q @end +@implementation MTRClusterICDManagement + +- (instancetype)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = [endpointID unsignedShortValue]; + _device = device; + } + return self; +} + +- (void)registerClientWithParams:(MTRICDManagementClusterRegisterClientParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(void (^)(MTRICDManagementClusterRegisterClientResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + NSString * logPrefix = [NSString stringWithFormat:@"MTRDevice command %u %u %u %u", self.device.deviceController.fabricIndex, + _endpoint, (unsigned int) MTRClusterIDTypeICDManagementID, + (unsigned int) MTRCommandIDTypeClusterICDManagementCommandRegisterClientID]; + // Make a copy of params before we go async. + params = [params copy]; + NSNumber * timedInvokeTimeoutMsParam = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMsParam) { + timedInvokeTimeoutMsParam = MTRClampedNumber(timedInvokeTimeoutMsParam, @(1), @(UINT16_MAX)); + } + MTRAsyncCallbackQueueWorkItem * workItem = [[MTRAsyncCallbackQueueWorkItem alloc] initWithQueue:self.device.queue]; + MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { + MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID + controller:self.device.deviceController]; + auto * bridge = new MTRICDManagementClusterRegisterClientResponseCallbackBridge( + self.device.queue, + ^(id _Nullable value, NSError * _Nullable error) { + MTRClustersLogCompletion(logPrefix, value, error); + dispatch_async(self.callbackQueue, ^{ + completion(value, error); + }); + [workItem endWork]; + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, + ICDManagementClusterRegisterClientResponseCallbackType successCb, MTRErrorCallback failureCb, + MTRCallbackBridgeBase * bridge) { + auto * typedBridge = static_cast(bridge); + Optional timedInvokeTimeoutMs; + Optional invokeTimeout; + ListFreer listFreer; + IcdManagement::Commands::RegisterClient::Type request; + if (timedInvokeTimeoutMsParam != nil) { + timedInvokeTimeoutMs.SetValue(timedInvokeTimeoutMsParam.unsignedShortValue); + } + if (params != nil) { + if (params.serverSideProcessingTimeout != nil) { + // Clamp to a number of seconds that will not overflow 32-bit + // int when converted to ms. + auto * serverSideProcessingTimeout + = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); + invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); + } + } + request.checkInNodeID = params.checkInNodeID.unsignedLongLongValue; + request.monitoredSubject = params.monitoredSubject.unsignedLongLongValue; + request.key = [self asByteSpan:params.key]; + if (params.verificationKey != nil) { + auto & definedValue_0 = request.verificationKey.Emplace(); + definedValue_0 = [self asByteSpan:params.verificationKey]; + } + + return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, + self->_endpoint, timedInvokeTimeoutMs, invokeTimeout); + }); + std::move(*bridge).DispatchAction(baseDevice); + }; + workItem.readyHandler = readyHandler; + MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); + [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + + if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { + expectedValues = nil; + } else { + expectedValueIntervalMs = MTRClampedNumber(expectedValueIntervalMs, @(1), @(UINT32_MAX)); + } + if (expectedValues) { + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; + } +} + +- (void)unregisterClientWithParams:(MTRICDManagementClusterUnregisterClientParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(MTRStatusCompletion)completion +{ + NSString * logPrefix = [NSString stringWithFormat:@"MTRDevice command %u %u %u %u", self.device.deviceController.fabricIndex, + _endpoint, (unsigned int) MTRClusterIDTypeICDManagementID, + (unsigned int) MTRCommandIDTypeClusterICDManagementCommandUnregisterClientID]; + // Make a copy of params before we go async. + params = [params copy]; + NSNumber * timedInvokeTimeoutMsParam = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMsParam) { + timedInvokeTimeoutMsParam = MTRClampedNumber(timedInvokeTimeoutMsParam, @(1), @(UINT16_MAX)); + } + MTRAsyncCallbackQueueWorkItem * workItem = [[MTRAsyncCallbackQueueWorkItem alloc] initWithQueue:self.device.queue]; + MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { + MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID + controller:self.device.deviceController]; + auto * bridge = new MTRCommandSuccessCallbackBridge( + self.device.queue, + ^(id _Nullable value, NSError * _Nullable error) { + MTRClustersLogCompletion(logPrefix, value, error); + dispatch_async(self.callbackQueue, ^{ + completion(error); + }); + [workItem endWork]; + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, + MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + auto * typedBridge = static_cast(bridge); + Optional timedInvokeTimeoutMs; + Optional invokeTimeout; + ListFreer listFreer; + IcdManagement::Commands::UnregisterClient::Type request; + if (timedInvokeTimeoutMsParam != nil) { + timedInvokeTimeoutMs.SetValue(timedInvokeTimeoutMsParam.unsignedShortValue); + } + if (params != nil) { + if (params.serverSideProcessingTimeout != nil) { + // Clamp to a number of seconds that will not overflow 32-bit + // int when converted to ms. + auto * serverSideProcessingTimeout + = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); + invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); + } + } + request.checkInNodeID = params.checkInNodeID.unsignedLongLongValue; + if (params.key != nil) { + auto & definedValue_0 = request.key.Emplace(); + definedValue_0 = [self asByteSpan:params.key]; + } + + return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, + self->_endpoint, timedInvokeTimeoutMs, invokeTimeout); + }); + std::move(*bridge).DispatchAction(baseDevice); + }; + workItem.readyHandler = readyHandler; + MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); + [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + + if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { + expectedValues = nil; + } else { + expectedValueIntervalMs = MTRClampedNumber(expectedValueIntervalMs, @(1), @(UINT32_MAX)); + } + if (expectedValues) { + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; + } +} + +- (void)stayActiveRequestWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(MTRStatusCompletion)completion +{ + [self stayActiveRequestWithParams:nil + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + completion:completion]; +} +- (void)stayActiveRequestWithParams:(MTRICDManagementClusterStayActiveRequestParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(MTRStatusCompletion)completion +{ + NSString * logPrefix = [NSString stringWithFormat:@"MTRDevice command %u %u %u %u", self.device.deviceController.fabricIndex, + _endpoint, (unsigned int) MTRClusterIDTypeICDManagementID, + (unsigned int) MTRCommandIDTypeClusterICDManagementCommandStayActiveRequestID]; + // Make a copy of params before we go async. + params = [params copy]; + NSNumber * timedInvokeTimeoutMsParam = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMsParam) { + timedInvokeTimeoutMsParam = MTRClampedNumber(timedInvokeTimeoutMsParam, @(1), @(UINT16_MAX)); + } + MTRAsyncCallbackQueueWorkItem * workItem = [[MTRAsyncCallbackQueueWorkItem alloc] initWithQueue:self.device.queue]; + MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { + MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID + controller:self.device.deviceController]; + auto * bridge = new MTRCommandSuccessCallbackBridge( + self.device.queue, + ^(id _Nullable value, NSError * _Nullable error) { + MTRClustersLogCompletion(logPrefix, value, error); + dispatch_async(self.callbackQueue, ^{ + completion(error); + }); + [workItem endWork]; + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, + MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + auto * typedBridge = static_cast(bridge); + Optional timedInvokeTimeoutMs; + Optional invokeTimeout; + ListFreer listFreer; + IcdManagement::Commands::StayActiveRequest::Type request; + if (timedInvokeTimeoutMsParam != nil) { + timedInvokeTimeoutMs.SetValue(timedInvokeTimeoutMsParam.unsignedShortValue); + } + if (params != nil) { + if (params.serverSideProcessingTimeout != nil) { + // Clamp to a number of seconds that will not overflow 32-bit + // int when converted to ms. + auto * serverSideProcessingTimeout + = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); + invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); + } + } + + return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, + self->_endpoint, timedInvokeTimeoutMs, invokeTimeout); + }); + std::move(*bridge).DispatchAction(baseDevice); + }; + workItem.readyHandler = readyHandler; + MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); + [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + + if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { + expectedValues = nil; + } else { + expectedValueIntervalMs = MTRClampedNumber(expectedValueIntervalMs, @(1), @(UINT32_MAX)); + } + if (expectedValues) { + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; + } +} + +- (NSDictionary *)readAttributeIdleModeIntervalWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeICDManagementID) + attributeID:@(MTRAttributeIDTypeClusterICDManagementAttributeIdleModeIntervalID) + params:params]; +} + +- (NSDictionary *)readAttributeActiveModeIntervalWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeICDManagementID) + attributeID:@(MTRAttributeIDTypeClusterICDManagementAttributeActiveModeIntervalID) + params:params]; +} + +- (NSDictionary *)readAttributeActiveModeThresholdWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeICDManagementID) + attributeID:@(MTRAttributeIDTypeClusterICDManagementAttributeActiveModeThresholdID) + params:params]; +} + +- (NSDictionary *)readAttributeRegisteredClientsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeICDManagementID) + attributeID:@(MTRAttributeIDTypeClusterICDManagementAttributeRegisteredClientsID) + params:params]; +} + +- (NSDictionary *)readAttributeICDCounterWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeICDManagementID) + attributeID:@(MTRAttributeIDTypeClusterICDManagementAttributeICDCounterID) + params:params]; +} + +- (NSDictionary *)readAttributeClientsSupportedPerFabricWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeICDManagementID) + attributeID:@(MTRAttributeIDTypeClusterICDManagementAttributeClientsSupportedPerFabricID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeICDManagementID) + attributeID:@(MTRAttributeIDTypeClusterICDManagementAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeICDManagementID) + attributeID:@(MTRAttributeIDTypeClusterICDManagementAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeICDManagementID) + attributeID:@(MTRAttributeIDTypeClusterICDManagementAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeICDManagementID) + attributeID:@(MTRAttributeIDTypeClusterICDManagementAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeICDManagementID) + attributeID:@(MTRAttributeIDTypeClusterICDManagementAttributeClusterRevisionID) + params:params]; +} + +@end + @implementation MTRClusterModeSelect - (instancetype)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h index f5fa1c36720734..402c2b067e3644 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h @@ -198,6 +198,11 @@ @property (nonatomic, readonly) MTRDevice * device; @end +@interface MTRClusterICDManagement () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + @interface MTRClusterModeSelect () @property (nonatomic, readonly) uint16_t endpoint; @property (nonatomic, readonly) MTRDevice * device; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h index c0fc5850b09365..2f013bf34bde32 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h @@ -3682,6 +3682,108 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); @end +MTR_NEWLY_AVAILABLE +@interface MTRICDManagementClusterRegisterClientParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull checkInNodeID MTR_NEWLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull monitoredSubject MTR_NEWLY_AVAILABLE; + +@property (nonatomic, copy) NSData * _Nonnull key MTR_NEWLY_AVAILABLE; + +@property (nonatomic, copy) NSData * _Nullable verificationKey MTR_NEWLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_NEWLY_AVAILABLE +@interface MTRICDManagementClusterRegisterClientResponseParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull icdCounter MTR_NEWLY_AVAILABLE; +@end + +MTR_NEWLY_AVAILABLE +@interface MTRICDManagementClusterUnregisterClientParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull checkInNodeID MTR_NEWLY_AVAILABLE; + +@property (nonatomic, copy) NSData * _Nullable key MTR_NEWLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_NEWLY_AVAILABLE +@interface MTRICDManagementClusterStayActiveRequestParams : NSObject +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRModeSelectClusterChangeToModeParams : NSObject diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index 2e86fa59c6f6bb..4c3db3c2c0b2dc 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -4439,6 +4439,136 @@ - (NSString *)description return descriptionString; } +@end +@implementation MTRICDManagementClusterRegisterClientParams +- (instancetype)init +{ + if (self = [super init]) { + + _checkInNodeID = @(0); + + _monitoredSubject = @(0); + + _key = [NSData data]; + + _verificationKey = nil; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRICDManagementClusterRegisterClientParams alloc] init]; + + other.checkInNodeID = self.checkInNodeID; + other.monitoredSubject = self.monitoredSubject; + other.key = self.key; + other.verificationKey = self.verificationKey; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = + [NSString stringWithFormat:@"<%@: checkInNodeID:%@; monitoredSubject:%@; key:%@; verificationKey:%@; >", + NSStringFromClass([self class]), _checkInNodeID, _monitoredSubject, [_key base64EncodedStringWithOptions:0], + [_verificationKey base64EncodedStringWithOptions:0]]; + return descriptionString; +} + +@end +@implementation MTRICDManagementClusterRegisterClientResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _icdCounter = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRICDManagementClusterRegisterClientResponseParams alloc] init]; + + other.icdCounter = self.icdCounter; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = + [NSString stringWithFormat:@"<%@: icdCounter:%@; >", NSStringFromClass([self class]), _icdCounter]; + return descriptionString; +} + +@end +@implementation MTRICDManagementClusterUnregisterClientParams +- (instancetype)init +{ + if (self = [super init]) { + + _checkInNodeID = @(0); + + _key = nil; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRICDManagementClusterUnregisterClientParams alloc] init]; + + other.checkInNodeID = self.checkInNodeID; + other.key = self.key; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: checkInNodeID:%@; key:%@; >", NSStringFromClass([self class]), + _checkInNodeID, [_key base64EncodedStringWithOptions:0]]; + return descriptionString; +} + +@end +@implementation MTRICDManagementClusterStayActiveRequestParams +- (instancetype)init +{ + if (self = [super init]) { + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRICDManagementClusterStayActiveRequestParams alloc] init]; + + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + @end @implementation MTRModeSelectClusterChangeToModeParams - (instancetype)init diff --git a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm index c2f6412ab9a110..967b27ba74c634 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm @@ -1539,6 +1539,18 @@ static id _Nullable DecodeEventPayloadForBooleanStateCluster(EventId aEventId, T *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; return nil; } +static id _Nullable DecodeEventPayloadForICDManagementCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::IcdManagement; + switch (aEventId) { + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + return nil; +} static id _Nullable DecodeEventPayloadForModeSelectCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { using namespace Clusters::ModeSelect; @@ -2738,6 +2750,9 @@ id _Nullable MTRDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVRead case Clusters::BooleanState::Id: { return DecodeEventPayloadForBooleanStateCluster(aPath.mEventId, aReader, aError); } + case Clusters::IcdManagement::Id: { + return DecodeEventPayloadForICDManagementCluster(aPath.mEventId, aReader, aError); + } case Clusters::ModeSelect::Id: { return DecodeEventPayloadForModeSelectCluster(aPath.mEventId, aReader, aError); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index 77be660c039fb5..1f827875b5c47c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -658,6 +658,14 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy) NSNumber * _Nonnull stateValue API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); @end +MTR_NEWLY_AVAILABLE +@interface MTRICDManagementClusterMonitoringRegistrationStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull checkInNodeID MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull monitoredSubject MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSData * _Nonnull key MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull fabricIndex MTR_NEWLY_AVAILABLE; +@end + API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @interface MTRModeSelectClusterSemanticTagStruct : NSObject @property (nonatomic, copy) NSNumber * _Nonnull mfgCode API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index bc26064a203a12..e41cdd2999bb55 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -2599,6 +2599,44 @@ - (NSString *)description @end +@implementation MTRICDManagementClusterMonitoringRegistrationStruct +- (instancetype)init +{ + if (self = [super init]) { + + _checkInNodeID = @(0); + + _monitoredSubject = @(0); + + _key = [NSData data]; + + _fabricIndex = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRICDManagementClusterMonitoringRegistrationStruct alloc] init]; + + other.checkInNodeID = self.checkInNodeID; + other.monitoredSubject = self.monitoredSubject; + other.key = self.key; + other.fabricIndex = self.fabricIndex; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString + stringWithFormat:@"<%@: checkInNodeID:%@; monitoredSubject:%@; key:%@; fabricIndex:%@; >", NSStringFromClass([self class]), + _checkInNodeID, _monitoredSubject, [_key base64EncodedStringWithOptions:0], _fabricIndex]; + return descriptionString; +} + +@end + @implementation MTRModeSelectClusterSemanticTagStruct - (instancetype)init { diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp index bd92a614275fbf..fcab59c1d2814c 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp @@ -6699,6 +6699,229 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) } // namespace Attributes } // namespace BooleanState +namespace IcdManagement { +namespace Attributes { + +namespace IdleModeInterval { + +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::IcdManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::IcdManagement::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); +} + +} // namespace IdleModeInterval + +namespace ActiveModeInterval { + +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::IcdManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::IcdManagement::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); +} + +} // namespace ActiveModeInterval + +namespace ActiveModeThreshold { + +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::IcdManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::IcdManagement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +} // namespace ActiveModeThreshold + +namespace ICDCounter { + +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::IcdManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::IcdManagement::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); +} + +} // namespace ICDCounter + +namespace ClientsSupportedPerFabric { + +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::IcdManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::IcdManagement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +} // namespace ClientsSupportedPerFabric + +namespace FeatureMap { + +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::IcdManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::IcdManagement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); +} + +} // namespace FeatureMap + +namespace ClusterRevision { + +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::IcdManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::IcdManagement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace IcdManagement + namespace ModeSelect { namespace Attributes { @@ -25561,198 +25784,6 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) } // namespace Attributes } // namespace ElectricalMeasurement -namespace ClientMonitoring { -namespace Attributes { - -namespace IdleModeInterval { - -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::ClientMonitoring::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - *value = Traits::StorageToWorking(temp); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ClientMonitoring::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); -} - -} // namespace IdleModeInterval - -namespace ActiveModeInterval { - -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::ClientMonitoring::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - *value = Traits::StorageToWorking(temp); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ClientMonitoring::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); -} - -} // namespace ActiveModeInterval - -namespace ActiveModeThreshold { - -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::ClientMonitoring::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - *value = Traits::StorageToWorking(temp); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ClientMonitoring::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace ActiveModeThreshold - -namespace ICDCounter { - -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::ClientMonitoring::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - *value = Traits::StorageToWorking(temp); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ClientMonitoring::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); -} - -} // namespace ICDCounter - -namespace FeatureMap { - -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::ClientMonitoring::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - *value = Traits::StorageToWorking(temp); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ClientMonitoring::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); -} - -} // namespace FeatureMap - -namespace ClusterRevision { - -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::ClientMonitoring::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - *value = Traits::StorageToWorking(temp); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ClientMonitoring::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace ClusterRevision - -} // namespace Attributes -} // namespace ClientMonitoring - namespace UnitTesting { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index 816f59f08bcf14..9faa978c32e8c7 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h @@ -1293,6 +1293,47 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Attributes } // namespace BooleanState +namespace IcdManagement { +namespace Attributes { + +namespace IdleModeInterval { +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); +} // namespace IdleModeInterval + +namespace ActiveModeInterval { +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); +} // namespace ActiveModeInterval + +namespace ActiveModeThreshold { +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); +} // namespace ActiveModeThreshold + +namespace ICDCounter { +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); +} // namespace ICDCounter + +namespace ClientsSupportedPerFabric { +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); +} // namespace ClientsSupportedPerFabric + +namespace FeatureMap { +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // bitmap32 +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); +} // namespace FeatureMap + +namespace ClusterRevision { +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace IcdManagement + namespace ModeSelect { namespace Attributes { @@ -4465,42 +4506,6 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Attributes } // namespace ElectricalMeasurement -namespace ClientMonitoring { -namespace Attributes { - -namespace IdleModeInterval { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); -} // namespace IdleModeInterval - -namespace ActiveModeInterval { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); -} // namespace ActiveModeInterval - -namespace ActiveModeThreshold { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); -} // namespace ActiveModeThreshold - -namespace ICDCounter { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); -} // namespace ICDCounter - -namespace FeatureMap { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // bitmap32 -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); -} // namespace FeatureMap - -namespace ClusterRevision { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); -} // namespace ClusterRevision - -} // namespace Attributes -} // namespace ClientMonitoring - namespace UnitTesting { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/callback.h b/zzz_generated/app-common/app-common/zap-generated/callback.h index 05beef889691ef..48fd55330a58fb 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -353,6 +353,14 @@ void emberAfProxyValidClusterInitCallback(chip::EndpointId endpoint); */ void emberAfBooleanStateClusterInitCallback(chip::EndpointId endpoint); +/** @brief ICD Management Cluster Init + * + * Cluster Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfIcdManagementClusterInitCallback(chip::EndpointId endpoint); + /** @brief Mode Select Cluster Init * * Cluster Init @@ -689,14 +697,6 @@ void emberAfAccountLoginClusterInitCallback(chip::EndpointId endpoint); */ void emberAfElectricalMeasurementClusterInitCallback(chip::EndpointId endpoint); -/** @brief Client Monitoring Cluster Init - * - * Cluster Init - * - * @param endpoint Endpoint that is being initialized - */ -void emberAfClientMonitoringClusterInitCallback(chip::EndpointId endpoint); - /** @brief Unit Testing Cluster Init * * Cluster Init @@ -3796,6 +3796,84 @@ void emberAfBooleanStateClusterServerTickCallback(chip::EndpointId endpoint); */ void emberAfBooleanStateClusterClientTickCallback(chip::EndpointId endpoint); +// +// ICD Management Cluster +// + +/** @brief ICD Management Cluster Server Init + * + * Server Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfIcdManagementClusterServerInitCallback(chip::EndpointId endpoint); + +/** @brief ICD Management Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterIcdManagementClusterServerShutdownCallback(chip::EndpointId endpoint); + +/** @brief ICD Management Cluster Client Init + * + * Client Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfIcdManagementClusterClientInitCallback(chip::EndpointId endpoint); + +/** @brief ICD Management Cluster Server Attribute Changed + * + * Server Attribute Changed + * + * @param attributePath Concrete attribute path that changed + */ +void MatterIcdManagementClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); + +/** @brief ICD Management Cluster Server Pre Attribute Changed + * + * Server Pre Attribute Changed + * + * @param attributePath Concrete attribute path to be changed + * @param attributeType Attribute type + * @param size Attribute size + * @param value Attribute value + */ +chip::Protocols::InteractionModel::Status +MatterIcdManagementClusterServerPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); + +/** @brief ICD Management Cluster Client Pre Attribute Changed + * + * Client Pre Attribute Changed + * + * @param attributePath Concrete attribute path to be changed + * @param attributeType Attribute type + * @param size Attribute size + * @param value Attribute value + */ +chip::Protocols::InteractionModel::Status +MatterIcdManagementClusterClientPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); + +/** @brief ICD Management Cluster Server Tick + * + * Server Tick + * + * @param endpoint Endpoint that is being served + */ +void emberAfIcdManagementClusterServerTickCallback(chip::EndpointId endpoint); + +/** @brief ICD Management Cluster Client Tick + * + * Client Tick + * + * @param endpoint Endpoint that is being served + */ +void emberAfIcdManagementClusterClientTickCallback(chip::EndpointId endpoint); + // // Mode Select Cluster // @@ -7033,84 +7111,6 @@ void emberAfElectricalMeasurementClusterServerTickCallback(chip::EndpointId endp */ void emberAfElectricalMeasurementClusterClientTickCallback(chip::EndpointId endpoint); -// -// Client Monitoring Cluster -// - -/** @brief Client Monitoring Cluster Server Init - * - * Server Init - * - * @param endpoint Endpoint that is being initialized - */ -void emberAfClientMonitoringClusterServerInitCallback(chip::EndpointId endpoint); - -/** @brief Client Monitoring Cluster Server Shutdown - * - * Server Shutdown - * - * @param endpoint Endpoint that is being shutdown - */ -void MatterClientMonitoringClusterServerShutdownCallback(chip::EndpointId endpoint); - -/** @brief Client Monitoring Cluster Client Init - * - * Client Init - * - * @param endpoint Endpoint that is being initialized - */ -void emberAfClientMonitoringClusterClientInitCallback(chip::EndpointId endpoint); - -/** @brief Client Monitoring Cluster Server Attribute Changed - * - * Server Attribute Changed - * - * @param attributePath Concrete attribute path that changed - */ -void MatterClientMonitoringClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); - -/** @brief Client Monitoring Cluster Server Pre Attribute Changed - * - * Server Pre Attribute Changed - * - * @param attributePath Concrete attribute path to be changed - * @param attributeType Attribute type - * @param size Attribute size - * @param value Attribute value - */ -chip::Protocols::InteractionModel::Status -MatterClientMonitoringClusterServerPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, - EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); - -/** @brief Client Monitoring Cluster Client Pre Attribute Changed - * - * Client Pre Attribute Changed - * - * @param attributePath Concrete attribute path to be changed - * @param attributeType Attribute type - * @param size Attribute size - * @param value Attribute value - */ -chip::Protocols::InteractionModel::Status -MatterClientMonitoringClusterClientPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, - EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); - -/** @brief Client Monitoring Cluster Server Tick - * - * Server Tick - * - * @param endpoint Endpoint that is being served - */ -void emberAfClientMonitoringClusterServerTickCallback(chip::EndpointId endpoint); - -/** @brief Client Monitoring Cluster Client Tick - * - * Client Tick - * - * @param endpoint Endpoint that is being served - */ -void emberAfClientMonitoringClusterClientTickCallback(chip::EndpointId endpoint); - // // Unit Testing Cluster // @@ -7740,6 +7740,24 @@ bool emberAfGroupKeyManagementClusterKeySetRemoveCallback( bool emberAfGroupKeyManagementClusterKeySetReadAllIndicesCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndices::DecodableType & commandData); +/** + * @brief ICD Management Cluster RegisterClient Command callback (from client) + */ +bool emberAfIcdManagementClusterRegisterClientCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::IcdManagement::Commands::RegisterClient::DecodableType & commandData); +/** + * @brief ICD Management Cluster UnregisterClient Command callback (from client) + */ +bool emberAfIcdManagementClusterUnregisterClientCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::IcdManagement::Commands::UnregisterClient::DecodableType & commandData); +/** + * @brief ICD Management Cluster StayActiveRequest Command callback (from client) + */ +bool emberAfIcdManagementClusterStayActiveRequestCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::IcdManagement::Commands::StayActiveRequest::DecodableType & commandData); /** * @brief Mode Select Cluster ChangeToMode Command callback (from client) */ @@ -8315,24 +8333,6 @@ bool emberAfElectricalMeasurementClusterGetProfileInfoCommandCallback( bool emberAfElectricalMeasurementClusterGetMeasurementProfileCommandCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::ElectricalMeasurement::Commands::GetMeasurementProfileCommand::DecodableType & commandData); -/** - * @brief Client Monitoring Cluster RegisterClientMonitoring Command callback (from client) - */ -bool emberAfClientMonitoringClusterRegisterClientMonitoringCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::ClientMonitoring::Commands::RegisterClientMonitoring::DecodableType & commandData); -/** - * @brief Client Monitoring Cluster UnregisterClientMonitoring Command callback (from client) - */ -bool emberAfClientMonitoringClusterUnregisterClientMonitoringCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::ClientMonitoring::Commands::UnregisterClientMonitoring::DecodableType & commandData); -/** - * @brief Client Monitoring Cluster StayAwakeRequest Command callback (from client) - */ -bool emberAfClientMonitoringClusterStayAwakeRequestCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::ClientMonitoring::Commands::StayAwakeRequest::DecodableType & commandData); /** * @brief Unit Testing Cluster Test Command callback (from client) */ diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h index 6073f309c75b6b..7ba17464cb84f9 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h @@ -1486,6 +1486,15 @@ namespace ProxyValid {} // namespace ProxyValid namespace BooleanState {} // namespace BooleanState +namespace IcdManagement { + +// Bitmap for ICDManagementFeature +enum class ICDManagementFeature : uint32_t +{ + kCheckInProtocolSupport = 0x1, +}; +} // namespace IcdManagement + namespace ModeSelect { // Bitmap for ModeSelectFeature @@ -3371,8 +3380,6 @@ namespace AccountLogin {} // namespace AccountLogin namespace ElectricalMeasurement {} // namespace ElectricalMeasurement -namespace ClientMonitoring {} // namespace ClientMonitoring - namespace UnitTesting { // Enum for SimpleEnum diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp index eae10bbcda189a..75506b25fbd873 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp @@ -10942,15 +10942,40 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } // namespace Events } // namespace BooleanState -namespace ModeSelect { +namespace IcdManagement { namespace Structs { -namespace SemanticTagStruct { -CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +namespace MonitoringRegistrationStruct { +CHIP_ERROR Type::EncodeForWrite(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + return DoEncode(writer, tag, NullOptional); +} + +CHIP_ERROR Type::EncodeForRead(TLV::TLVWriter & writer, TLV::Tag tag, FabricIndex accessingFabricIndex) const +{ + return DoEncode(writer, tag, MakeOptional(accessingFabricIndex)); +} + +CHIP_ERROR Type::DoEncode(TLV::TLVWriter & writer, TLV::Tag tag, const Optional & accessingFabricIndex) const { + bool includeSensitive = !accessingFabricIndex.HasValue() || (accessingFabricIndex.Value() == fabricIndex); TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kMfgCode), mfgCode)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kValue), value)); + if (includeSensitive) + { + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kCheckInNodeID), checkInNodeID)); + } + if (includeSensitive) + { + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kMonitoredSubject), monitoredSubject)); + } + if (includeSensitive) + { + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kKey), key)); + } + if (accessingFabricIndex.HasValue()) + { + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kFabricIndex), fabricIndex)); + } ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -10970,11 +10995,17 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kMfgCode): - ReturnErrorOnFailure(DataModel::Decode(reader, mfgCode)); + case to_underlying(Fields::kCheckInNodeID): + ReturnErrorOnFailure(DataModel::Decode(reader, checkInNodeID)); break; - case to_underlying(Fields::kValue): - ReturnErrorOnFailure(DataModel::Decode(reader, value)); + case to_underlying(Fields::kMonitoredSubject): + ReturnErrorOnFailure(DataModel::Decode(reader, monitoredSubject)); + break; + case to_underlying(Fields::kKey): + ReturnErrorOnFailure(DataModel::Decode(reader, key)); + break; + case to_underlying(Fields::kFabricIndex): + ReturnErrorOnFailure(DataModel::Decode(reader, fabricIndex)); break; default: break; @@ -10987,15 +11018,19 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) return CHIP_NO_ERROR; } -} // namespace SemanticTagStruct -namespace ModeOptionStruct { +} // namespace MonitoringRegistrationStruct +} // namespace Structs + +namespace Commands { +namespace RegisterClient { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kLabel), label)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kMode), mode)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kSemanticTags), semanticTags)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kCheckInNodeID), checkInNodeID)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kMonitoredSubject), monitoredSubject)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kKey), key)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kVerificationKey), verificationKey)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -11005,8 +11040,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVType outer; VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - err = reader.EnterContainer(outer); - ReturnErrorOnFailure(err); + ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { if (!TLV::IsContextTag(reader.GetTag())) @@ -11015,14 +11049,17 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kLabel): - ReturnErrorOnFailure(DataModel::Decode(reader, label)); + case to_underlying(Fields::kCheckInNodeID): + ReturnErrorOnFailure(DataModel::Decode(reader, checkInNodeID)); break; - case to_underlying(Fields::kMode): - ReturnErrorOnFailure(DataModel::Decode(reader, mode)); + case to_underlying(Fields::kMonitoredSubject): + ReturnErrorOnFailure(DataModel::Decode(reader, monitoredSubject)); break; - case to_underlying(Fields::kSemanticTags): - ReturnErrorOnFailure(DataModel::Decode(reader, semanticTags)); + case to_underlying(Fields::kKey): + ReturnErrorOnFailure(DataModel::Decode(reader, key)); + break; + case to_underlying(Fields::kVerificationKey): + ReturnErrorOnFailure(DataModel::Decode(reader, verificationKey)); break; default: break; @@ -11031,20 +11068,15 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(err == CHIP_END_OF_TLV, err); ReturnErrorOnFailure(reader.ExitContainer(outer)); - return CHIP_NO_ERROR; } - -} // namespace ModeOptionStruct -} // namespace Structs - -namespace Commands { -namespace ChangeToMode { +} // namespace RegisterClient. +namespace RegisterClientResponse { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kNewMode), newMode)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kICDCounter), ICDCounter)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -11063,8 +11095,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kNewMode): - ReturnErrorOnFailure(DataModel::Decode(reader, newMode)); + case to_underlying(Fields::kICDCounter): + ReturnErrorOnFailure(DataModel::Decode(reader, ICDCounter)); break; default: break; @@ -11075,106 +11107,49 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace ChangeToMode. -} // namespace Commands - -namespace Attributes { -CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +} // namespace RegisterClientResponse. +namespace UnregisterClient { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { - switch (path.mAttributeId) - { - case Attributes::Description::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, description)); - break; - case Attributes::StandardNamespace::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, standardNamespace)); - break; - case Attributes::SupportedModes::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, supportedModes)); - break; - case Attributes::CurrentMode::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, currentMode)); - break; - case Attributes::StartUpMode::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, startUpMode)); - break; - case Attributes::OnMode::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, onMode)); - break; - case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, generatedCommandList)); - break; - case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, acceptedCommandList)); - break; - case Attributes::EventList::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, eventList)); - break; - case Attributes::AttributeList::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); - break; - case Attributes::FeatureMap::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); - break; - case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); - break; - default: - break; - } - + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kCheckInNodeID), checkInNodeID)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kKey), key)); + ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } -} // namespace Attributes - -namespace Events {} // namespace Events - -} // namespace ModeSelect -namespace AirQuality { - -namespace Commands {} // namespace Commands -namespace Attributes { -CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) { - switch (path.mAttributeId) + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) { - case Attributes::AirQuality::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, airQuality)); - break; - case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, generatedCommandList)); - break; - case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, acceptedCommandList)); - break; - case Attributes::EventList::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, eventList)); - break; - case Attributes::AttributeList::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); - break; - case Attributes::FeatureMap::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); - break; - case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); - break; - default: - break; + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kCheckInNodeID): + ReturnErrorOnFailure(DataModel::Decode(reader, checkInNodeID)); + break; + case to_underlying(Fields::kKey): + ReturnErrorOnFailure(DataModel::Decode(reader, key)); + break; + default: + break; + } } + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace Attributes - -namespace Events {} // namespace Events - -} // namespace AirQuality -namespace HepaFilterMonitoring { - -namespace Commands { -namespace ResetCondition { +} // namespace UnregisterClient. +namespace StayActiveRequest { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; @@ -11206,7 +11181,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace ResetCondition. +} // namespace StayActiveRequest. } // namespace Commands namespace Attributes { @@ -11214,17 +11189,23 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre { switch (path.mAttributeId) { - case Attributes::Condition::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, condition)); + case Attributes::IdleModeInterval::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, idleModeInterval)); break; - case Attributes::DegradationDirection::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, degradationDirection)); + case Attributes::ActiveModeInterval::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, activeModeInterval)); break; - case Attributes::ChangeIndication::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, changeIndication)); + case Attributes::ActiveModeThreshold::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, activeModeThreshold)); break; - case Attributes::InPlaceIndicator::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, inPlaceIndicator)); + case Attributes::RegisteredClients::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, registeredClients)); + break; + case Attributes::ICDCounter::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, ICDCounter)); + break; + case Attributes::ClientsSupportedPerFabric::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, clientsSupportedPerFabric)); break; case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, generatedCommandList)); @@ -11254,15 +11235,16 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events {} // namespace Events -} // namespace HepaFilterMonitoring -namespace ActivatedCarbonFilterMonitoring { - -namespace Commands { -namespace ResetCondition { +} // namespace IcdManagement +namespace ModeSelect { +namespace Structs { +namespace SemanticTagStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kMfgCode), mfgCode)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kValue), value)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -11272,7 +11254,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVType outer; VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(reader.EnterContainer(outer)); + err = reader.EnterContainer(outer); + ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { if (!TLV::IsContextTag(reader.GetTag())) @@ -11281,6 +11264,12 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } switch (TLV::TagNumFromTag(reader.GetTag())) { + case to_underlying(Fields::kMfgCode): + ReturnErrorOnFailure(DataModel::Decode(reader, mfgCode)); + break; + case to_underlying(Fields::kValue): + ReturnErrorOnFailure(DataModel::Decode(reader, value)); + break; default: break; } @@ -11288,65 +11277,68 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(err == CHIP_END_OF_TLV, err); ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; } -} // namespace ResetCondition. -} // namespace Commands -namespace Attributes { -CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +} // namespace SemanticTagStruct +namespace ModeOptionStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { - switch (path.mAttributeId) - { - case Attributes::Condition::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, condition)); - break; - case Attributes::DegradationDirection::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, degradationDirection)); - break; - case Attributes::ChangeIndication::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, changeIndication)); - break; - case Attributes::InPlaceIndicator::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, inPlaceIndicator)); - break; - case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, generatedCommandList)); - break; - case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, acceptedCommandList)); - break; - case Attributes::EventList::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, eventList)); - break; - case Attributes::AttributeList::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); - break; - case Attributes::FeatureMap::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); - break; - case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); - break; - default: - break; + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kLabel), label)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kMode), mode)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kSemanticTags), semanticTags)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + err = reader.EnterContainer(outer); + ReturnErrorOnFailure(err); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kLabel): + ReturnErrorOnFailure(DataModel::Decode(reader, label)); + break; + case to_underlying(Fields::kMode): + ReturnErrorOnFailure(DataModel::Decode(reader, mode)); + break; + case to_underlying(Fields::kSemanticTags): + ReturnErrorOnFailure(DataModel::Decode(reader, semanticTags)); + break; + default: + break; + } } + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; } -} // namespace Attributes - -namespace Events {} // namespace Events -} // namespace ActivatedCarbonFilterMonitoring -namespace CeramicFilterMonitoring { +} // namespace ModeOptionStruct +} // namespace Structs namespace Commands { -namespace ResetCondition { +namespace ChangeToMode { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kNewMode), newMode)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -11365,6 +11357,9 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } switch (TLV::TagNumFromTag(reader.GetTag())) { + case to_underlying(Fields::kNewMode): + ReturnErrorOnFailure(DataModel::Decode(reader, newMode)); + break; default: break; } @@ -11374,7 +11369,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace ResetCondition. +} // namespace ChangeToMode. } // namespace Commands namespace Attributes { @@ -11382,17 +11377,23 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre { switch (path.mAttributeId) { - case Attributes::Condition::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, condition)); + case Attributes::Description::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, description)); break; - case Attributes::DegradationDirection::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, degradationDirection)); + case Attributes::StandardNamespace::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, standardNamespace)); break; - case Attributes::ChangeIndication::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, changeIndication)); + case Attributes::SupportedModes::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, supportedModes)); break; - case Attributes::InPlaceIndicator::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, inPlaceIndicator)); + case Attributes::CurrentMode::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, currentMode)); + break; + case Attributes::StartUpMode::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, startUpMode)); + break; + case Attributes::OnMode::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, onMode)); break; case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, generatedCommandList)); @@ -11422,8 +11423,49 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events {} // namespace Events -} // namespace CeramicFilterMonitoring -namespace ElectrostaticFilterMonitoring { +} // namespace ModeSelect +namespace AirQuality { + +namespace Commands {} // namespace Commands + +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::AirQuality::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, airQuality)); + break; + case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, generatedCommandList)); + break; + case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, acceptedCommandList)); + break; + case Attributes::EventList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, eventList)); + break; + case Attributes::AttributeList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); + break; + case Attributes::FeatureMap::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); + break; + case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); + break; + default: + break; + } + + return CHIP_NO_ERROR; +} +} // namespace Attributes + +namespace Events {} // namespace Events + +} // namespace AirQuality +namespace HepaFilterMonitoring { namespace Commands { namespace ResetCondition { @@ -11506,8 +11548,8 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events {} // namespace Events -} // namespace ElectrostaticFilterMonitoring -namespace UvFilterMonitoring { +} // namespace HepaFilterMonitoring +namespace ActivatedCarbonFilterMonitoring { namespace Commands { namespace ResetCondition { @@ -11590,8 +11632,8 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events {} // namespace Events -} // namespace UvFilterMonitoring -namespace IonizingFilterMonitoring { +} // namespace ActivatedCarbonFilterMonitoring +namespace CeramicFilterMonitoring { namespace Commands { namespace ResetCondition { @@ -11674,8 +11716,8 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events {} // namespace Events -} // namespace IonizingFilterMonitoring -namespace ZeoliteFilterMonitoring { +} // namespace CeramicFilterMonitoring +namespace ElectrostaticFilterMonitoring { namespace Commands { namespace ResetCondition { @@ -11758,8 +11800,8 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events {} // namespace Events -} // namespace ZeoliteFilterMonitoring -namespace OzoneFilterMonitoring { +} // namespace ElectrostaticFilterMonitoring +namespace UvFilterMonitoring { namespace Commands { namespace ResetCondition { @@ -11842,8 +11884,8 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events {} // namespace Events -} // namespace OzoneFilterMonitoring -namespace WaterTankMonitoring { +} // namespace UvFilterMonitoring +namespace IonizingFilterMonitoring { namespace Commands { namespace ResetCondition { @@ -11926,8 +11968,8 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events {} // namespace Events -} // namespace WaterTankMonitoring -namespace FuelTankMonitoring { +} // namespace IonizingFilterMonitoring +namespace ZeoliteFilterMonitoring { namespace Commands { namespace ResetCondition { @@ -12010,8 +12052,8 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events {} // namespace Events -} // namespace FuelTankMonitoring -namespace InkCartridgeMonitoring { +} // namespace ZeoliteFilterMonitoring +namespace OzoneFilterMonitoring { namespace Commands { namespace ResetCondition { @@ -12094,8 +12136,8 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events {} // namespace Events -} // namespace InkCartridgeMonitoring -namespace TonerCartridgeMonitoring { +} // namespace OzoneFilterMonitoring +namespace WaterTankMonitoring { namespace Commands { namespace ResetCondition { @@ -12178,16 +12220,15 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events {} // namespace Events -} // namespace TonerCartridgeMonitoring -namespace DoorLock { -namespace Structs { -namespace CredentialStruct { +} // namespace WaterTankMonitoring +namespace FuelTankMonitoring { + +namespace Commands { +namespace ResetCondition { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kCredentialType), credentialType)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kCredentialIndex), credentialIndex)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -12197,8 +12238,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVType outer; VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - err = reader.EnterContainer(outer); - ReturnErrorOnFailure(err); + ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { if (!TLV::IsContextTag(reader.GetTag())) @@ -12207,12 +12247,6 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kCredentialType): - ReturnErrorOnFailure(DataModel::Decode(reader, credentialType)); - break; - case to_underlying(Fields::kCredentialIndex): - ReturnErrorOnFailure(DataModel::Decode(reader, credentialIndex)); - break; default: break; } @@ -12220,20 +12254,65 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(err == CHIP_END_OF_TLV, err); ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace ResetCondition. +} // namespace Commands + +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::Condition::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, condition)); + break; + case Attributes::DegradationDirection::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, degradationDirection)); + break; + case Attributes::ChangeIndication::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, changeIndication)); + break; + case Attributes::InPlaceIndicator::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, inPlaceIndicator)); + break; + case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, generatedCommandList)); + break; + case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, acceptedCommandList)); + break; + case Attributes::EventList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, eventList)); + break; + case Attributes::AttributeList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); + break; + case Attributes::FeatureMap::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); + break; + case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); + break; + default: + break; + } return CHIP_NO_ERROR; } +} // namespace Attributes -} // namespace CredentialStruct -} // namespace Structs +namespace Events {} // namespace Events + +} // namespace FuelTankMonitoring +namespace InkCartridgeMonitoring { namespace Commands { -namespace LockDoor { +namespace ResetCondition { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kPINCode), PINCode)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -12252,9 +12331,6 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kPINCode): - ReturnErrorOnFailure(DataModel::Decode(reader, PINCode)); - break; default: break; } @@ -12264,12 +12340,230 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace LockDoor. -namespace UnlockDoor { -CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +} // namespace ResetCondition. +} // namespace Commands + +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) { - TLV::TLVType outer; - ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + switch (path.mAttributeId) + { + case Attributes::Condition::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, condition)); + break; + case Attributes::DegradationDirection::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, degradationDirection)); + break; + case Attributes::ChangeIndication::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, changeIndication)); + break; + case Attributes::InPlaceIndicator::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, inPlaceIndicator)); + break; + case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, generatedCommandList)); + break; + case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, acceptedCommandList)); + break; + case Attributes::EventList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, eventList)); + break; + case Attributes::AttributeList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); + break; + case Attributes::FeatureMap::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); + break; + case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); + break; + default: + break; + } + + return CHIP_NO_ERROR; +} +} // namespace Attributes + +namespace Events {} // namespace Events + +} // namespace InkCartridgeMonitoring +namespace TonerCartridgeMonitoring { + +namespace Commands { +namespace ResetCondition { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } + switch (TLV::TagNumFromTag(reader.GetTag())) + { + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace ResetCondition. +} // namespace Commands + +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::Condition::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, condition)); + break; + case Attributes::DegradationDirection::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, degradationDirection)); + break; + case Attributes::ChangeIndication::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, changeIndication)); + break; + case Attributes::InPlaceIndicator::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, inPlaceIndicator)); + break; + case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, generatedCommandList)); + break; + case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, acceptedCommandList)); + break; + case Attributes::EventList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, eventList)); + break; + case Attributes::AttributeList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); + break; + case Attributes::FeatureMap::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); + break; + case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); + break; + default: + break; + } + + return CHIP_NO_ERROR; +} +} // namespace Attributes + +namespace Events {} // namespace Events + +} // namespace TonerCartridgeMonitoring +namespace DoorLock { +namespace Structs { +namespace CredentialStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kCredentialType), credentialType)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kCredentialIndex), credentialIndex)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + err = reader.EnterContainer(outer); + ReturnErrorOnFailure(err); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kCredentialType): + ReturnErrorOnFailure(DataModel::Decode(reader, credentialType)); + break; + case to_underlying(Fields::kCredentialIndex): + ReturnErrorOnFailure(DataModel::Decode(reader, credentialIndex)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + + return CHIP_NO_ERROR; +} + +} // namespace CredentialStruct +} // namespace Structs + +namespace Commands { +namespace LockDoor { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kPINCode), PINCode)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kPINCode): + ReturnErrorOnFailure(DataModel::Decode(reader, PINCode)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace LockDoor. +namespace UnlockDoor { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kPINCode), PINCode)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; @@ -20043,518 +20337,242 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre case Attributes::RmsVoltageMax::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, rmsVoltageMax)); break; - case Attributes::RmsCurrent::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, rmsCurrent)); - break; - case Attributes::RmsCurrentMin::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, rmsCurrentMin)); - break; - case Attributes::RmsCurrentMax::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, rmsCurrentMax)); - break; - case Attributes::ActivePower::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, activePower)); - break; - case Attributes::ActivePowerMin::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, activePowerMin)); - break; - case Attributes::ActivePowerMax::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, activePowerMax)); - break; - case Attributes::ReactivePower::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, reactivePower)); - break; - case Attributes::ApparentPower::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, apparentPower)); - break; - case Attributes::PowerFactor::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, powerFactor)); - break; - case Attributes::AverageRmsVoltageMeasurementPeriod::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, averageRmsVoltageMeasurementPeriod)); - break; - case Attributes::AverageRmsUnderVoltageCounter::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, averageRmsUnderVoltageCounter)); - break; - case Attributes::RmsExtremeOverVoltagePeriod::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, rmsExtremeOverVoltagePeriod)); - break; - case Attributes::RmsExtremeUnderVoltagePeriod::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, rmsExtremeUnderVoltagePeriod)); - break; - case Attributes::RmsVoltageSagPeriod::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, rmsVoltageSagPeriod)); - break; - case Attributes::RmsVoltageSwellPeriod::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, rmsVoltageSwellPeriod)); - break; - case Attributes::AcVoltageMultiplier::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, acVoltageMultiplier)); - break; - case Attributes::AcVoltageDivisor::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, acVoltageDivisor)); - break; - case Attributes::AcCurrentMultiplier::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, acCurrentMultiplier)); - break; - case Attributes::AcCurrentDivisor::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, acCurrentDivisor)); - break; - case Attributes::AcPowerMultiplier::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, acPowerMultiplier)); - break; - case Attributes::AcPowerDivisor::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, acPowerDivisor)); - break; - case Attributes::OverloadAlarmsMask::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, overloadAlarmsMask)); - break; - case Attributes::VoltageOverload::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, voltageOverload)); - break; - case Attributes::CurrentOverload::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, currentOverload)); - break; - case Attributes::AcOverloadAlarmsMask::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, acOverloadAlarmsMask)); - break; - case Attributes::AcVoltageOverload::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, acVoltageOverload)); - break; - case Attributes::AcCurrentOverload::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, acCurrentOverload)); - break; - case Attributes::AcActivePowerOverload::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, acActivePowerOverload)); - break; - case Attributes::AcReactivePowerOverload::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, acReactivePowerOverload)); - break; - case Attributes::AverageRmsOverVoltage::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, averageRmsOverVoltage)); - break; - case Attributes::AverageRmsUnderVoltage::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, averageRmsUnderVoltage)); - break; - case Attributes::RmsExtremeOverVoltage::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, rmsExtremeOverVoltage)); - break; - case Attributes::RmsExtremeUnderVoltage::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, rmsExtremeUnderVoltage)); - break; - case Attributes::RmsVoltageSag::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, rmsVoltageSag)); - break; - case Attributes::RmsVoltageSwell::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, rmsVoltageSwell)); - break; - case Attributes::LineCurrentPhaseB::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, lineCurrentPhaseB)); - break; - case Attributes::ActiveCurrentPhaseB::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, activeCurrentPhaseB)); - break; - case Attributes::ReactiveCurrentPhaseB::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, reactiveCurrentPhaseB)); - break; - case Attributes::RmsVoltagePhaseB::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, rmsVoltagePhaseB)); - break; - case Attributes::RmsVoltageMinPhaseB::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, rmsVoltageMinPhaseB)); - break; - case Attributes::RmsVoltageMaxPhaseB::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, rmsVoltageMaxPhaseB)); - break; - case Attributes::RmsCurrentPhaseB::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, rmsCurrentPhaseB)); - break; - case Attributes::RmsCurrentMinPhaseB::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, rmsCurrentMinPhaseB)); - break; - case Attributes::RmsCurrentMaxPhaseB::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, rmsCurrentMaxPhaseB)); - break; - case Attributes::ActivePowerPhaseB::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, activePowerPhaseB)); - break; - case Attributes::ActivePowerMinPhaseB::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, activePowerMinPhaseB)); - break; - case Attributes::ActivePowerMaxPhaseB::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, activePowerMaxPhaseB)); - break; - case Attributes::ReactivePowerPhaseB::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, reactivePowerPhaseB)); - break; - case Attributes::ApparentPowerPhaseB::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, apparentPowerPhaseB)); - break; - case Attributes::PowerFactorPhaseB::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, powerFactorPhaseB)); - break; - case Attributes::AverageRmsVoltageMeasurementPeriodPhaseB::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, averageRmsVoltageMeasurementPeriodPhaseB)); - break; - case Attributes::AverageRmsOverVoltageCounterPhaseB::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, averageRmsOverVoltageCounterPhaseB)); - break; - case Attributes::AverageRmsUnderVoltageCounterPhaseB::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, averageRmsUnderVoltageCounterPhaseB)); - break; - case Attributes::RmsExtremeOverVoltagePeriodPhaseB::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, rmsExtremeOverVoltagePeriodPhaseB)); - break; - case Attributes::RmsExtremeUnderVoltagePeriodPhaseB::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, rmsExtremeUnderVoltagePeriodPhaseB)); - break; - case Attributes::RmsVoltageSagPeriodPhaseB::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, rmsVoltageSagPeriodPhaseB)); - break; - case Attributes::RmsVoltageSwellPeriodPhaseB::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, rmsVoltageSwellPeriodPhaseB)); - break; - case Attributes::LineCurrentPhaseC::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, lineCurrentPhaseC)); - break; - case Attributes::ActiveCurrentPhaseC::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, activeCurrentPhaseC)); - break; - case Attributes::ReactiveCurrentPhaseC::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, reactiveCurrentPhaseC)); - break; - case Attributes::RmsVoltagePhaseC::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, rmsVoltagePhaseC)); - break; - case Attributes::RmsVoltageMinPhaseC::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, rmsVoltageMinPhaseC)); - break; - case Attributes::RmsVoltageMaxPhaseC::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, rmsVoltageMaxPhaseC)); - break; - case Attributes::RmsCurrentPhaseC::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, rmsCurrentPhaseC)); - break; - case Attributes::RmsCurrentMinPhaseC::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, rmsCurrentMinPhaseC)); - break; - case Attributes::RmsCurrentMaxPhaseC::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, rmsCurrentMaxPhaseC)); - break; - case Attributes::ActivePowerPhaseC::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, activePowerPhaseC)); - break; - case Attributes::ActivePowerMinPhaseC::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, activePowerMinPhaseC)); - break; - case Attributes::ActivePowerMaxPhaseC::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, activePowerMaxPhaseC)); - break; - case Attributes::ReactivePowerPhaseC::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, reactivePowerPhaseC)); - break; - case Attributes::ApparentPowerPhaseC::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, apparentPowerPhaseC)); - break; - case Attributes::PowerFactorPhaseC::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, powerFactorPhaseC)); - break; - case Attributes::AverageRmsVoltageMeasurementPeriodPhaseC::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, averageRmsVoltageMeasurementPeriodPhaseC)); - break; - case Attributes::AverageRmsOverVoltageCounterPhaseC::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, averageRmsOverVoltageCounterPhaseC)); - break; - case Attributes::AverageRmsUnderVoltageCounterPhaseC::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, averageRmsUnderVoltageCounterPhaseC)); - break; - case Attributes::RmsExtremeOverVoltagePeriodPhaseC::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, rmsExtremeOverVoltagePeriodPhaseC)); - break; - case Attributes::RmsExtremeUnderVoltagePeriodPhaseC::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, rmsExtremeUnderVoltagePeriodPhaseC)); - break; - case Attributes::RmsVoltageSagPeriodPhaseC::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, rmsVoltageSagPeriodPhaseC)); - break; - case Attributes::RmsVoltageSwellPeriodPhaseC::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, rmsVoltageSwellPeriodPhaseC)); - break; - case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, generatedCommandList)); - break; - case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, acceptedCommandList)); - break; - case Attributes::EventList::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, eventList)); - break; - case Attributes::AttributeList::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); - break; - case Attributes::FeatureMap::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); - break; - case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); - break; - default: - break; - } - - return CHIP_NO_ERROR; -} -} // namespace Attributes - -namespace Events {} // namespace Events - -} // namespace ElectricalMeasurement -namespace ClientMonitoring { -namespace Structs { -namespace MonitoringRegistrationStruct { -CHIP_ERROR Type::EncodeForWrite(TLV::TLVWriter & writer, TLV::Tag tag) const -{ - return DoEncode(writer, tag, NullOptional); -} - -CHIP_ERROR Type::EncodeForRead(TLV::TLVWriter & writer, TLV::Tag tag, FabricIndex accessingFabricIndex) const -{ - return DoEncode(writer, tag, MakeOptional(accessingFabricIndex)); -} - -CHIP_ERROR Type::DoEncode(TLV::TLVWriter & writer, TLV::Tag tag, const Optional & accessingFabricIndex) const -{ - bool includeSensitive = !accessingFabricIndex.HasValue() || (accessingFabricIndex.Value() == fabricIndex); - TLV::TLVType outer; - ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - if (includeSensitive) - { - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kClientNodeID), clientNodeID)); - } - if (includeSensitive) - { - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kKey), key)); - } - if (accessingFabricIndex.HasValue()) - { - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kFabricIndex), fabricIndex)); - } - ReturnErrorOnFailure(writer.EndContainer(outer)); - return CHIP_NO_ERROR; -} - -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVType outer; - VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - err = reader.EnterContainer(outer); - ReturnErrorOnFailure(err); - while ((err = reader.Next()) == CHIP_NO_ERROR) - { - if (!TLV::IsContextTag(reader.GetTag())) - { - continue; - } - switch (TLV::TagNumFromTag(reader.GetTag())) - { - case to_underlying(Fields::kClientNodeID): - ReturnErrorOnFailure(DataModel::Decode(reader, clientNodeID)); - break; - case to_underlying(Fields::kKey): - ReturnErrorOnFailure(DataModel::Decode(reader, key)); - break; - case to_underlying(Fields::kFabricIndex): - ReturnErrorOnFailure(DataModel::Decode(reader, fabricIndex)); - break; - default: - break; - } - } - - VerifyOrReturnError(err == CHIP_END_OF_TLV, err); - ReturnErrorOnFailure(reader.ExitContainer(outer)); - - return CHIP_NO_ERROR; -} - -} // namespace MonitoringRegistrationStruct -} // namespace Structs - -namespace Commands { -namespace RegisterClientMonitoring { -CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const -{ - TLV::TLVType outer; - ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kClientNodeID), clientNodeID)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kKey), key)); - ReturnErrorOnFailure(writer.EndContainer(outer)); - return CHIP_NO_ERROR; -} - -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVType outer; - VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(reader.EnterContainer(outer)); - while ((err = reader.Next()) == CHIP_NO_ERROR) - { - if (!TLV::IsContextTag(reader.GetTag())) - { - continue; - } - switch (TLV::TagNumFromTag(reader.GetTag())) - { - case to_underlying(Fields::kClientNodeID): - ReturnErrorOnFailure(DataModel::Decode(reader, clientNodeID)); - break; - case to_underlying(Fields::kKey): - ReturnErrorOnFailure(DataModel::Decode(reader, key)); - break; - default: - break; - } - } - - VerifyOrReturnError(err == CHIP_END_OF_TLV, err); - ReturnErrorOnFailure(reader.ExitContainer(outer)); - return CHIP_NO_ERROR; -} -} // namespace RegisterClientMonitoring. -namespace RegisterClientMonitoringResponse { -CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const -{ - TLV::TLVType outer; - ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kStatus), status)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kICDCounter), ICDCounter)); - ReturnErrorOnFailure(writer.EndContainer(outer)); - return CHIP_NO_ERROR; -} - -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVType outer; - VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(reader.EnterContainer(outer)); - while ((err = reader.Next()) == CHIP_NO_ERROR) - { - if (!TLV::IsContextTag(reader.GetTag())) - { - continue; - } - switch (TLV::TagNumFromTag(reader.GetTag())) - { - case to_underlying(Fields::kStatus): - ReturnErrorOnFailure(DataModel::Decode(reader, status)); - break; - case to_underlying(Fields::kICDCounter): - ReturnErrorOnFailure(DataModel::Decode(reader, ICDCounter)); - break; - default: - break; - } - } - - VerifyOrReturnError(err == CHIP_END_OF_TLV, err); - ReturnErrorOnFailure(reader.ExitContainer(outer)); - return CHIP_NO_ERROR; -} -} // namespace RegisterClientMonitoringResponse. -namespace UnregisterClientMonitoring { -CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const -{ - TLV::TLVType outer; - ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kClientNodeID), clientNodeID)); - ReturnErrorOnFailure(writer.EndContainer(outer)); - return CHIP_NO_ERROR; -} - -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVType outer; - VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(reader.EnterContainer(outer)); - while ((err = reader.Next()) == CHIP_NO_ERROR) - { - if (!TLV::IsContextTag(reader.GetTag())) - { - continue; - } - switch (TLV::TagNumFromTag(reader.GetTag())) - { - case to_underlying(Fields::kClientNodeID): - ReturnErrorOnFailure(DataModel::Decode(reader, clientNodeID)); - break; - default: - break; - } - } - - VerifyOrReturnError(err == CHIP_END_OF_TLV, err); - ReturnErrorOnFailure(reader.ExitContainer(outer)); - return CHIP_NO_ERROR; -} -} // namespace UnregisterClientMonitoring. -namespace StayAwakeRequest { -CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const -{ - TLV::TLVType outer; - ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(writer.EndContainer(outer)); - return CHIP_NO_ERROR; -} - -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVType outer; - VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(reader.EnterContainer(outer)); - while ((err = reader.Next()) == CHIP_NO_ERROR) - { - if (!TLV::IsContextTag(reader.GetTag())) - { - continue; - } - switch (TLV::TagNumFromTag(reader.GetTag())) - { - default: - break; - } - } - - VerifyOrReturnError(err == CHIP_END_OF_TLV, err); - ReturnErrorOnFailure(reader.ExitContainer(outer)); - return CHIP_NO_ERROR; -} -} // namespace StayAwakeRequest. -} // namespace Commands - -namespace Attributes { -CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) -{ - switch (path.mAttributeId) - { - case Attributes::IdleModeInterval::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, idleModeInterval)); - break; - case Attributes::ActiveModeInterval::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, activeModeInterval)); + case Attributes::RmsCurrent::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, rmsCurrent)); break; - case Attributes::ActiveModeThreshold::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, activeModeThreshold)); + case Attributes::RmsCurrentMin::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, rmsCurrentMin)); break; - case Attributes::ExpectedClients::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, expectedClients)); + case Attributes::RmsCurrentMax::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, rmsCurrentMax)); break; - case Attributes::ICDCounter::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, ICDCounter)); + case Attributes::ActivePower::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, activePower)); + break; + case Attributes::ActivePowerMin::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, activePowerMin)); + break; + case Attributes::ActivePowerMax::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, activePowerMax)); + break; + case Attributes::ReactivePower::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, reactivePower)); + break; + case Attributes::ApparentPower::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, apparentPower)); + break; + case Attributes::PowerFactor::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, powerFactor)); + break; + case Attributes::AverageRmsVoltageMeasurementPeriod::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, averageRmsVoltageMeasurementPeriod)); + break; + case Attributes::AverageRmsUnderVoltageCounter::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, averageRmsUnderVoltageCounter)); + break; + case Attributes::RmsExtremeOverVoltagePeriod::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, rmsExtremeOverVoltagePeriod)); + break; + case Attributes::RmsExtremeUnderVoltagePeriod::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, rmsExtremeUnderVoltagePeriod)); + break; + case Attributes::RmsVoltageSagPeriod::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, rmsVoltageSagPeriod)); + break; + case Attributes::RmsVoltageSwellPeriod::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, rmsVoltageSwellPeriod)); + break; + case Attributes::AcVoltageMultiplier::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, acVoltageMultiplier)); + break; + case Attributes::AcVoltageDivisor::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, acVoltageDivisor)); + break; + case Attributes::AcCurrentMultiplier::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, acCurrentMultiplier)); + break; + case Attributes::AcCurrentDivisor::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, acCurrentDivisor)); + break; + case Attributes::AcPowerMultiplier::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, acPowerMultiplier)); + break; + case Attributes::AcPowerDivisor::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, acPowerDivisor)); + break; + case Attributes::OverloadAlarmsMask::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, overloadAlarmsMask)); + break; + case Attributes::VoltageOverload::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, voltageOverload)); + break; + case Attributes::CurrentOverload::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, currentOverload)); + break; + case Attributes::AcOverloadAlarmsMask::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, acOverloadAlarmsMask)); + break; + case Attributes::AcVoltageOverload::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, acVoltageOverload)); + break; + case Attributes::AcCurrentOverload::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, acCurrentOverload)); + break; + case Attributes::AcActivePowerOverload::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, acActivePowerOverload)); + break; + case Attributes::AcReactivePowerOverload::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, acReactivePowerOverload)); + break; + case Attributes::AverageRmsOverVoltage::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, averageRmsOverVoltage)); + break; + case Attributes::AverageRmsUnderVoltage::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, averageRmsUnderVoltage)); + break; + case Attributes::RmsExtremeOverVoltage::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, rmsExtremeOverVoltage)); + break; + case Attributes::RmsExtremeUnderVoltage::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, rmsExtremeUnderVoltage)); + break; + case Attributes::RmsVoltageSag::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, rmsVoltageSag)); + break; + case Attributes::RmsVoltageSwell::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, rmsVoltageSwell)); + break; + case Attributes::LineCurrentPhaseB::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, lineCurrentPhaseB)); + break; + case Attributes::ActiveCurrentPhaseB::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, activeCurrentPhaseB)); + break; + case Attributes::ReactiveCurrentPhaseB::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, reactiveCurrentPhaseB)); + break; + case Attributes::RmsVoltagePhaseB::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, rmsVoltagePhaseB)); + break; + case Attributes::RmsVoltageMinPhaseB::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, rmsVoltageMinPhaseB)); + break; + case Attributes::RmsVoltageMaxPhaseB::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, rmsVoltageMaxPhaseB)); + break; + case Attributes::RmsCurrentPhaseB::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, rmsCurrentPhaseB)); + break; + case Attributes::RmsCurrentMinPhaseB::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, rmsCurrentMinPhaseB)); + break; + case Attributes::RmsCurrentMaxPhaseB::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, rmsCurrentMaxPhaseB)); + break; + case Attributes::ActivePowerPhaseB::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, activePowerPhaseB)); + break; + case Attributes::ActivePowerMinPhaseB::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, activePowerMinPhaseB)); + break; + case Attributes::ActivePowerMaxPhaseB::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, activePowerMaxPhaseB)); + break; + case Attributes::ReactivePowerPhaseB::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, reactivePowerPhaseB)); + break; + case Attributes::ApparentPowerPhaseB::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, apparentPowerPhaseB)); + break; + case Attributes::PowerFactorPhaseB::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, powerFactorPhaseB)); + break; + case Attributes::AverageRmsVoltageMeasurementPeriodPhaseB::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, averageRmsVoltageMeasurementPeriodPhaseB)); + break; + case Attributes::AverageRmsOverVoltageCounterPhaseB::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, averageRmsOverVoltageCounterPhaseB)); + break; + case Attributes::AverageRmsUnderVoltageCounterPhaseB::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, averageRmsUnderVoltageCounterPhaseB)); + break; + case Attributes::RmsExtremeOverVoltagePeriodPhaseB::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, rmsExtremeOverVoltagePeriodPhaseB)); + break; + case Attributes::RmsExtremeUnderVoltagePeriodPhaseB::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, rmsExtremeUnderVoltagePeriodPhaseB)); + break; + case Attributes::RmsVoltageSagPeriodPhaseB::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, rmsVoltageSagPeriodPhaseB)); + break; + case Attributes::RmsVoltageSwellPeriodPhaseB::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, rmsVoltageSwellPeriodPhaseB)); + break; + case Attributes::LineCurrentPhaseC::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, lineCurrentPhaseC)); + break; + case Attributes::ActiveCurrentPhaseC::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, activeCurrentPhaseC)); + break; + case Attributes::ReactiveCurrentPhaseC::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, reactiveCurrentPhaseC)); + break; + case Attributes::RmsVoltagePhaseC::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, rmsVoltagePhaseC)); + break; + case Attributes::RmsVoltageMinPhaseC::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, rmsVoltageMinPhaseC)); + break; + case Attributes::RmsVoltageMaxPhaseC::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, rmsVoltageMaxPhaseC)); + break; + case Attributes::RmsCurrentPhaseC::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, rmsCurrentPhaseC)); + break; + case Attributes::RmsCurrentMinPhaseC::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, rmsCurrentMinPhaseC)); + break; + case Attributes::RmsCurrentMaxPhaseC::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, rmsCurrentMaxPhaseC)); + break; + case Attributes::ActivePowerPhaseC::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, activePowerPhaseC)); + break; + case Attributes::ActivePowerMinPhaseC::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, activePowerMinPhaseC)); + break; + case Attributes::ActivePowerMaxPhaseC::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, activePowerMaxPhaseC)); + break; + case Attributes::ReactivePowerPhaseC::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, reactivePowerPhaseC)); + break; + case Attributes::ApparentPowerPhaseC::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, apparentPowerPhaseC)); + break; + case Attributes::PowerFactorPhaseC::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, powerFactorPhaseC)); + break; + case Attributes::AverageRmsVoltageMeasurementPeriodPhaseC::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, averageRmsVoltageMeasurementPeriodPhaseC)); + break; + case Attributes::AverageRmsOverVoltageCounterPhaseC::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, averageRmsOverVoltageCounterPhaseC)); + break; + case Attributes::AverageRmsUnderVoltageCounterPhaseC::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, averageRmsUnderVoltageCounterPhaseC)); + break; + case Attributes::RmsExtremeOverVoltagePeriodPhaseC::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, rmsExtremeOverVoltagePeriodPhaseC)); + break; + case Attributes::RmsExtremeUnderVoltagePeriodPhaseC::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, rmsExtremeUnderVoltagePeriodPhaseC)); + break; + case Attributes::RmsVoltageSagPeriodPhaseC::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, rmsVoltageSagPeriodPhaseC)); + break; + case Attributes::RmsVoltageSwellPeriodPhaseC::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, rmsVoltageSwellPeriodPhaseC)); break; case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, generatedCommandList)); @@ -20584,7 +20602,7 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events {} // namespace Events -} // namespace ClientMonitoring +} // namespace ElectricalMeasurement namespace UnitTesting { namespace Structs { namespace SimpleStruct { @@ -23295,6 +23313,17 @@ bool CommandIsFabricScoped(ClusterId aCluster, CommandId aCommand) return false; } } + case Clusters::IcdManagement::Id: { + switch (aCommand) + { + case Clusters::IcdManagement::Commands::RegisterClient::Id: + return true; + case Clusters::IcdManagement::Commands::UnregisterClient::Id: + return true; + default: + return false; + } + } case Clusters::ModeSelect::Id: { switch (aCommand) { @@ -23498,17 +23527,6 @@ bool CommandIsFabricScoped(ClusterId aCluster, CommandId aCommand) return false; } } - case Clusters::ClientMonitoring::Id: { - switch (aCommand) - { - case Clusters::ClientMonitoring::Commands::RegisterClientMonitoring::Id: - return true; - case Clusters::ClientMonitoring::Commands::UnregisterClientMonitoring::Id: - return true; - default: - return false; - } - } case Clusters::UnitTesting::Id: { switch (aCommand) { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 4419502101e575..4549b4ff4b6873 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -13609,6 +13609,346 @@ struct DecodableType } // namespace StateChange } // namespace Events } // namespace BooleanState +namespace IcdManagement { +namespace Structs { +namespace MonitoringRegistrationStruct { +enum class Fields : uint8_t +{ + kCheckInNodeID = 1, + kMonitoredSubject = 2, + kKey = 3, + kFabricIndex = 254, +}; + +struct Type +{ +public: + chip::NodeId checkInNodeID = static_cast(0); + uint64_t monitoredSubject = static_cast(0); + chip::ByteSpan key; + chip::FabricIndex fabricIndex = static_cast(0); + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = true; + + auto GetFabricIndex() const { return fabricIndex; } + + void SetFabricIndex(chip::FabricIndex fabricIndex_) { fabricIndex = fabricIndex_; } + + CHIP_ERROR EncodeForWrite(TLV::TLVWriter & writer, TLV::Tag tag) const; + CHIP_ERROR EncodeForRead(TLV::TLVWriter & writer, TLV::Tag tag, FabricIndex accessingFabricIndex) const; + +private: + CHIP_ERROR DoEncode(TLV::TLVWriter & writer, TLV::Tag tag, const Optional & accessingFabricIndex) const; +}; + +using DecodableType = Type; + +} // namespace MonitoringRegistrationStruct +} // namespace Structs + +namespace Commands { +// Forward-declarations so we can reference these later. + +namespace RegisterClient { +struct Type; +struct DecodableType; +} // namespace RegisterClient + +namespace RegisterClientResponse { +struct Type; +struct DecodableType; +} // namespace RegisterClientResponse + +namespace UnregisterClient { +struct Type; +struct DecodableType; +} // namespace UnregisterClient + +namespace StayActiveRequest { +struct Type; +struct DecodableType; +} // namespace StayActiveRequest + +} // namespace Commands + +namespace Commands { +namespace RegisterClient { +enum class Fields : uint8_t +{ + kCheckInNodeID = 0, + kMonitoredSubject = 1, + kKey = 2, + kVerificationKey = 3, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::RegisterClient::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IcdManagement::Id; } + + chip::NodeId checkInNodeID = static_cast(0); + uint64_t monitoredSubject = static_cast(0); + chip::ByteSpan key; + Optional verificationKey; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + + using ResponseType = Clusters::IcdManagement::Commands::RegisterClientResponse::DecodableType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::RegisterClient::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IcdManagement::Id; } + + chip::NodeId checkInNodeID = static_cast(0); + uint64_t monitoredSubject = static_cast(0); + chip::ByteSpan key; + Optional verificationKey; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace RegisterClient +namespace RegisterClientResponse { +enum class Fields : uint8_t +{ + kICDCounter = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::RegisterClientResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IcdManagement::Id; } + + uint32_t ICDCounter = static_cast(0); + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::RegisterClientResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IcdManagement::Id; } + + uint32_t ICDCounter = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace RegisterClientResponse +namespace UnregisterClient { +enum class Fields : uint8_t +{ + kCheckInNodeID = 0, + kKey = 1, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::UnregisterClient::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IcdManagement::Id; } + + chip::NodeId checkInNodeID = static_cast(0); + Optional key; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::UnregisterClient::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IcdManagement::Id; } + + chip::NodeId checkInNodeID = static_cast(0); + Optional key; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace UnregisterClient +namespace StayActiveRequest { +enum class Fields : uint8_t +{ +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::StayActiveRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IcdManagement::Id; } + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::StayActiveRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IcdManagement::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace StayActiveRequest +} // namespace Commands + +namespace Attributes { + +namespace IdleModeInterval { +struct TypeInfo +{ + using Type = uint32_t; + using DecodableType = uint32_t; + using DecodableArgType = uint32_t; + + static constexpr ClusterId GetClusterId() { return Clusters::IcdManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::IdleModeInterval::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace IdleModeInterval +namespace ActiveModeInterval { +struct TypeInfo +{ + using Type = uint32_t; + using DecodableType = uint32_t; + using DecodableArgType = uint32_t; + + static constexpr ClusterId GetClusterId() { return Clusters::IcdManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::ActiveModeInterval::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace ActiveModeInterval +namespace ActiveModeThreshold { +struct TypeInfo +{ + using Type = uint16_t; + using DecodableType = uint16_t; + using DecodableArgType = uint16_t; + + static constexpr ClusterId GetClusterId() { return Clusters::IcdManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::ActiveModeThreshold::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace ActiveModeThreshold +namespace RegisteredClients { +struct TypeInfo +{ + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList< + chip::app::Clusters::IcdManagement::Structs::MonitoringRegistrationStruct::DecodableType>; + using DecodableArgType = const chip::app::DataModel::DecodableList< + chip::app::Clusters::IcdManagement::Structs::MonitoringRegistrationStruct::DecodableType> &; + + static constexpr ClusterId GetClusterId() { return Clusters::IcdManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::RegisteredClients::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace RegisteredClients +namespace ICDCounter { +struct TypeInfo +{ + using Type = uint32_t; + using DecodableType = uint32_t; + using DecodableArgType = uint32_t; + + static constexpr ClusterId GetClusterId() { return Clusters::IcdManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::ICDCounter::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace ICDCounter +namespace ClientsSupportedPerFabric { +struct TypeInfo +{ + using Type = uint16_t; + using DecodableType = uint16_t; + using DecodableArgType = uint16_t; + + static constexpr ClusterId GetClusterId() { return Clusters::IcdManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::ClientsSupportedPerFabric::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace ClientsSupportedPerFabric +namespace GeneratedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::IcdManagement::Id; } +}; +} // namespace GeneratedCommandList +namespace AcceptedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::IcdManagement::Id; } +}; +} // namespace AcceptedCommandList +namespace EventList { +struct TypeInfo : public Clusters::Globals::Attributes::EventList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::IcdManagement::Id; } +}; +} // namespace EventList +namespace AttributeList { +struct TypeInfo : public Clusters::Globals::Attributes::AttributeList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::IcdManagement::Id; } +}; +} // namespace AttributeList +namespace FeatureMap { +struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::IcdManagement::Id; } +}; +} // namespace FeatureMap +namespace ClusterRevision { +struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::IcdManagement::Id; } +}; +} // namespace ClusterRevision + +struct TypeInfo +{ + struct DecodableType + { + static constexpr ClusterId GetClusterId() { return Clusters::IcdManagement::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); + + Attributes::IdleModeInterval::TypeInfo::DecodableType idleModeInterval = static_cast(0); + Attributes::ActiveModeInterval::TypeInfo::DecodableType activeModeInterval = static_cast(0); + Attributes::ActiveModeThreshold::TypeInfo::DecodableType activeModeThreshold = static_cast(0); + Attributes::RegisteredClients::TypeInfo::DecodableType registeredClients; + Attributes::ICDCounter::TypeInfo::DecodableType ICDCounter = static_cast(0); + Attributes::ClientsSupportedPerFabric::TypeInfo::DecodableType clientsSupportedPerFabric = static_cast(0); + Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; + Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; + Attributes::EventList::TypeInfo::DecodableType eventList; + Attributes::AttributeList::TypeInfo::DecodableType attributeList; + Attributes::FeatureMap::TypeInfo::DecodableType featureMap = static_cast(0); + Attributes::ClusterRevision::TypeInfo::DecodableType clusterRevision = static_cast(0); + }; +}; +} // namespace Attributes +} // namespace IcdManagement namespace ModeSelect { namespace Structs { namespace SemanticTagStruct { @@ -28208,326 +28548,6 @@ struct TypeInfo }; } // namespace Attributes } // namespace ElectricalMeasurement -namespace ClientMonitoring { -namespace Structs { -namespace MonitoringRegistrationStruct { -enum class Fields : uint8_t -{ - kClientNodeID = 1, - kKey = 2, - kFabricIndex = 254, -}; - -struct Type -{ -public: - chip::NodeId clientNodeID = static_cast(0); - chip::ByteSpan key; - chip::FabricIndex fabricIndex = static_cast(0); - - CHIP_ERROR Decode(TLV::TLVReader & reader); - - static constexpr bool kIsFabricScoped = true; - - auto GetFabricIndex() const { return fabricIndex; } - - void SetFabricIndex(chip::FabricIndex fabricIndex_) { fabricIndex = fabricIndex_; } - - CHIP_ERROR EncodeForWrite(TLV::TLVWriter & writer, TLV::Tag tag) const; - CHIP_ERROR EncodeForRead(TLV::TLVWriter & writer, TLV::Tag tag, FabricIndex accessingFabricIndex) const; - -private: - CHIP_ERROR DoEncode(TLV::TLVWriter & writer, TLV::Tag tag, const Optional & accessingFabricIndex) const; -}; - -using DecodableType = Type; - -} // namespace MonitoringRegistrationStruct -} // namespace Structs - -namespace Commands { -// Forward-declarations so we can reference these later. - -namespace RegisterClientMonitoring { -struct Type; -struct DecodableType; -} // namespace RegisterClientMonitoring - -namespace RegisterClientMonitoringResponse { -struct Type; -struct DecodableType; -} // namespace RegisterClientMonitoringResponse - -namespace UnregisterClientMonitoring { -struct Type; -struct DecodableType; -} // namespace UnregisterClientMonitoring - -namespace StayAwakeRequest { -struct Type; -struct DecodableType; -} // namespace StayAwakeRequest - -} // namespace Commands - -namespace Commands { -namespace RegisterClientMonitoring { -enum class Fields : uint8_t -{ - kClientNodeID = 0, - kKey = 1, -}; - -struct Type -{ -public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::RegisterClientMonitoring::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::ClientMonitoring::Id; } - - chip::NodeId clientNodeID = static_cast(0); - chip::ByteSpan key; - - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - - using ResponseType = Clusters::ClientMonitoring::Commands::RegisterClientMonitoringResponse::DecodableType; - - static constexpr bool MustUseTimedInvoke() { return false; } -}; - -struct DecodableType -{ -public: - static constexpr CommandId GetCommandId() { return Commands::RegisterClientMonitoring::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::ClientMonitoring::Id; } - - chip::NodeId clientNodeID = static_cast(0); - chip::ByteSpan key; - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace RegisterClientMonitoring -namespace RegisterClientMonitoringResponse { -enum class Fields : uint8_t -{ - kStatus = 0, - kICDCounter = 1, -}; - -struct Type -{ -public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::RegisterClientMonitoringResponse::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::ClientMonitoring::Id; } - - uint8_t status = static_cast(0); - DataModel::Nullable ICDCounter; - - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - - using ResponseType = DataModel::NullObjectType; - - static constexpr bool MustUseTimedInvoke() { return false; } -}; - -struct DecodableType -{ -public: - static constexpr CommandId GetCommandId() { return Commands::RegisterClientMonitoringResponse::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::ClientMonitoring::Id; } - - uint8_t status = static_cast(0); - DataModel::Nullable ICDCounter; - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace RegisterClientMonitoringResponse -namespace UnregisterClientMonitoring { -enum class Fields : uint8_t -{ - kClientNodeID = 0, -}; - -struct Type -{ -public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::UnregisterClientMonitoring::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::ClientMonitoring::Id; } - - chip::NodeId clientNodeID = static_cast(0); - - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - - using ResponseType = DataModel::NullObjectType; - - static constexpr bool MustUseTimedInvoke() { return false; } -}; - -struct DecodableType -{ -public: - static constexpr CommandId GetCommandId() { return Commands::UnregisterClientMonitoring::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::ClientMonitoring::Id; } - - chip::NodeId clientNodeID = static_cast(0); - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace UnregisterClientMonitoring -namespace StayAwakeRequest { -enum class Fields : uint8_t -{ -}; - -struct Type -{ -public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::StayAwakeRequest::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::ClientMonitoring::Id; } - - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - - using ResponseType = DataModel::NullObjectType; - - static constexpr bool MustUseTimedInvoke() { return false; } -}; - -struct DecodableType -{ -public: - static constexpr CommandId GetCommandId() { return Commands::StayAwakeRequest::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::ClientMonitoring::Id; } - - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace StayAwakeRequest -} // namespace Commands - -namespace Attributes { - -namespace IdleModeInterval { -struct TypeInfo -{ - using Type = uint32_t; - using DecodableType = uint32_t; - using DecodableArgType = uint32_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ClientMonitoring::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::IdleModeInterval::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace IdleModeInterval -namespace ActiveModeInterval { -struct TypeInfo -{ - using Type = uint32_t; - using DecodableType = uint32_t; - using DecodableArgType = uint32_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ClientMonitoring::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::ActiveModeInterval::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace ActiveModeInterval -namespace ActiveModeThreshold { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ClientMonitoring::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::ActiveModeThreshold::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace ActiveModeThreshold -namespace ExpectedClients { -struct TypeInfo -{ - using Type = - chip::app::DataModel::List; - using DecodableType = chip::app::DataModel::DecodableList< - chip::app::Clusters::ClientMonitoring::Structs::MonitoringRegistrationStruct::DecodableType>; - using DecodableArgType = const chip::app::DataModel::DecodableList< - chip::app::Clusters::ClientMonitoring::Structs::MonitoringRegistrationStruct::DecodableType> &; - - static constexpr ClusterId GetClusterId() { return Clusters::ClientMonitoring::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::ExpectedClients::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace ExpectedClients -namespace ICDCounter { -struct TypeInfo -{ - using Type = uint32_t; - using DecodableType = uint32_t; - using DecodableArgType = uint32_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ClientMonitoring::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::ICDCounter::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace ICDCounter -namespace GeneratedCommandList { -struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo -{ - static constexpr ClusterId GetClusterId() { return Clusters::ClientMonitoring::Id; } -}; -} // namespace GeneratedCommandList -namespace AcceptedCommandList { -struct TypeInfo : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo -{ - static constexpr ClusterId GetClusterId() { return Clusters::ClientMonitoring::Id; } -}; -} // namespace AcceptedCommandList -namespace EventList { -struct TypeInfo : public Clusters::Globals::Attributes::EventList::TypeInfo -{ - static constexpr ClusterId GetClusterId() { return Clusters::ClientMonitoring::Id; } -}; -} // namespace EventList -namespace AttributeList { -struct TypeInfo : public Clusters::Globals::Attributes::AttributeList::TypeInfo -{ - static constexpr ClusterId GetClusterId() { return Clusters::ClientMonitoring::Id; } -}; -} // namespace AttributeList -namespace FeatureMap { -struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo -{ - static constexpr ClusterId GetClusterId() { return Clusters::ClientMonitoring::Id; } -}; -} // namespace FeatureMap -namespace ClusterRevision { -struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo -{ - static constexpr ClusterId GetClusterId() { return Clusters::ClientMonitoring::Id; } -}; -} // namespace ClusterRevision - -struct TypeInfo -{ - struct DecodableType - { - static constexpr ClusterId GetClusterId() { return Clusters::ClientMonitoring::Id; } - - CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); - - Attributes::IdleModeInterval::TypeInfo::DecodableType idleModeInterval = static_cast(0); - Attributes::ActiveModeInterval::TypeInfo::DecodableType activeModeInterval = static_cast(0); - Attributes::ActiveModeThreshold::TypeInfo::DecodableType activeModeThreshold = static_cast(0); - Attributes::ExpectedClients::TypeInfo::DecodableType expectedClients; - Attributes::ICDCounter::TypeInfo::DecodableType ICDCounter = static_cast(0); - Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; - Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; - Attributes::EventList::TypeInfo::DecodableType eventList; - Attributes::AttributeList::TypeInfo::DecodableType attributeList; - Attributes::FeatureMap::TypeInfo::DecodableType featureMap = static_cast(0); - Attributes::ClusterRevision::TypeInfo::DecodableType clusterRevision = static_cast(0); - }; -}; -} // namespace Attributes -} // namespace ClientMonitoring namespace UnitTesting { namespace Structs { namespace SimpleStruct { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h index 1464b6f2e41397..282b181c00dbac 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h @@ -2351,6 +2351,60 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace Attributes } // namespace BooleanState +namespace IcdManagement { +namespace Attributes { + +namespace IdleModeInterval { +static constexpr AttributeId Id = 0x00000000; +} // namespace IdleModeInterval + +namespace ActiveModeInterval { +static constexpr AttributeId Id = 0x00000001; +} // namespace ActiveModeInterval + +namespace ActiveModeThreshold { +static constexpr AttributeId Id = 0x00000002; +} // namespace ActiveModeThreshold + +namespace RegisteredClients { +static constexpr AttributeId Id = 0x00000003; +} // namespace RegisteredClients + +namespace ICDCounter { +static constexpr AttributeId Id = 0x00000004; +} // namespace ICDCounter + +namespace ClientsSupportedPerFabric { +static constexpr AttributeId Id = 0x00000005; +} // namespace ClientsSupportedPerFabric + +namespace GeneratedCommandList { +static constexpr AttributeId Id = Globals::Attributes::GeneratedCommandList::Id; +} // namespace GeneratedCommandList + +namespace AcceptedCommandList { +static constexpr AttributeId Id = Globals::Attributes::AcceptedCommandList::Id; +} // namespace AcceptedCommandList + +namespace EventList { +static constexpr AttributeId Id = Globals::Attributes::EventList::Id; +} // namespace EventList + +namespace AttributeList { +static constexpr AttributeId Id = Globals::Attributes::AttributeList::Id; +} // namespace AttributeList + +namespace FeatureMap { +static constexpr AttributeId Id = Globals::Attributes::FeatureMap::Id; +} // namespace FeatureMap + +namespace ClusterRevision { +static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace IcdManagement + namespace ModeSelect { namespace Attributes { @@ -5491,56 +5545,6 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace Attributes } // namespace ElectricalMeasurement -namespace ClientMonitoring { -namespace Attributes { - -namespace IdleModeInterval { -static constexpr AttributeId Id = 0x00000000; -} // namespace IdleModeInterval - -namespace ActiveModeInterval { -static constexpr AttributeId Id = 0x00000001; -} // namespace ActiveModeInterval - -namespace ActiveModeThreshold { -static constexpr AttributeId Id = 0x00000002; -} // namespace ActiveModeThreshold - -namespace ExpectedClients { -static constexpr AttributeId Id = 0x00000003; -} // namespace ExpectedClients - -namespace ICDCounter { -static constexpr AttributeId Id = 0x00000004; -} // namespace ICDCounter - -namespace GeneratedCommandList { -static constexpr AttributeId Id = Globals::Attributes::GeneratedCommandList::Id; -} // namespace GeneratedCommandList - -namespace AcceptedCommandList { -static constexpr AttributeId Id = Globals::Attributes::AcceptedCommandList::Id; -} // namespace AcceptedCommandList - -namespace EventList { -static constexpr AttributeId Id = Globals::Attributes::EventList::Id; -} // namespace EventList - -namespace AttributeList { -static constexpr AttributeId Id = Globals::Attributes::AttributeList::Id; -} // namespace AttributeList - -namespace FeatureMap { -static constexpr AttributeId Id = Globals::Attributes::FeatureMap::Id; -} // namespace FeatureMap - -namespace ClusterRevision { -static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; -} // namespace ClusterRevision - -} // namespace Attributes -} // namespace ClientMonitoring - namespace UnitTesting { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h index ceebe9b2a08c01..fc795276405b35 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h @@ -145,6 +145,9 @@ static constexpr ClusterId Id = 0x00000044; namespace BooleanState { static constexpr ClusterId Id = 0x00000045; } // namespace BooleanState +namespace IcdManagement { +static constexpr ClusterId Id = 0x00000046; +} // namespace IcdManagement namespace ModeSelect { static constexpr ClusterId Id = 0x00000050; } // namespace ModeSelect @@ -271,9 +274,6 @@ static constexpr ClusterId Id = 0x0000050E; namespace ElectricalMeasurement { static constexpr ClusterId Id = 0x00000B04; } // namespace ElectricalMeasurement -namespace ClientMonitoring { -static constexpr ClusterId Id = 0x00001046; -} // namespace ClientMonitoring namespace UnitTesting { static constexpr ClusterId Id = 0xFFF1FC05; } // namespace UnitTesting diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h index 6e5e25c960b61c..db687d7b7f512f 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h @@ -609,6 +609,28 @@ static constexpr CommandId Id = 0x00000005; } // namespace Commands } // namespace GroupKeyManagement +namespace IcdManagement { +namespace Commands { + +namespace RegisterClient { +static constexpr CommandId Id = 0x00000000; +} // namespace RegisterClient + +namespace RegisterClientResponse { +static constexpr CommandId Id = 0x00000001; +} // namespace RegisterClientResponse + +namespace UnregisterClient { +static constexpr CommandId Id = 0x00000002; +} // namespace UnregisterClient + +namespace StayActiveRequest { +static constexpr CommandId Id = 0x00000003; +} // namespace StayActiveRequest + +} // namespace Commands +} // namespace IcdManagement + namespace ModeSelect { namespace Commands { @@ -1231,28 +1253,6 @@ static constexpr CommandId Id = 0x00000001; } // namespace Commands } // namespace ElectricalMeasurement -namespace ClientMonitoring { -namespace Commands { - -namespace RegisterClientMonitoring { -static constexpr CommandId Id = 0x00000000; -} // namespace RegisterClientMonitoring - -namespace RegisterClientMonitoringResponse { -static constexpr CommandId Id = 0x00000001; -} // namespace RegisterClientMonitoringResponse - -namespace UnregisterClientMonitoring { -static constexpr CommandId Id = 0x00000002; -} // namespace UnregisterClientMonitoring - -namespace StayAwakeRequest { -static constexpr CommandId Id = 0x00000003; -} // namespace StayAwakeRequest - -} // namespace Commands -} // namespace ClientMonitoring - namespace UnitTesting { namespace Commands { diff --git a/zzz_generated/app-common/app-common/zap-generated/print-cluster.h b/zzz_generated/app-common/app-common/zap-generated/print-cluster.h index 9730bc8b3f0182..d70d6320348c88 100644 --- a/zzz_generated/app-common/app-common/zap-generated/print-cluster.h +++ b/zzz_generated/app-common/app-common/zap-generated/print-cluster.h @@ -280,6 +280,12 @@ #define CHIP_PRINTCLUSTER_BOOLEAN_STATE_CLUSTER #endif +#if defined(ZCL_USING_ICD_MANAGEMENT_CLUSTER_SERVER) || defined(ZCL_USING_ICD_MANAGEMENT_CLUSTER_CLIENT) +#define CHIP_PRINTCLUSTER_ICD_MANAGEMENT_CLUSTER { chip::app::Clusters::IcdManagement::Id, "ICD Management" }, +#else +#define CHIP_PRINTCLUSTER_ICD_MANAGEMENT_CLUSTER +#endif + #if defined(ZCL_USING_MODE_SELECT_CLUSTER_SERVER) || defined(ZCL_USING_MODE_SELECT_CLUSTER_CLIENT) #define CHIP_PRINTCLUSTER_MODE_SELECT_CLUSTER { chip::app::Clusters::ModeSelect::Id, "Mode Select" }, #else @@ -551,12 +557,6 @@ #define CHIP_PRINTCLUSTER_ELECTRICAL_MEASUREMENT_CLUSTER #endif -#if defined(ZCL_USING_CLIENT_MONITORING_CLUSTER_SERVER) || defined(ZCL_USING_CLIENT_MONITORING_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_CLIENT_MONITORING_CLUSTER { chip::app::Clusters::ClientMonitoring::Id, "Client Monitoring" }, -#else -#define CHIP_PRINTCLUSTER_CLIENT_MONITORING_CLUSTER -#endif - #if defined(ZCL_USING_UNIT_TESTING_CLUSTER_SERVER) || defined(ZCL_USING_UNIT_TESTING_CLUSTER_CLIENT) #define CHIP_PRINTCLUSTER_UNIT_TESTING_CLUSTER { chip::app::Clusters::UnitTesting::Id, "Unit Testing" }, #else @@ -610,6 +610,7 @@ CHIP_PRINTCLUSTER_PROXY_DISCOVERY_CLUSTER \ CHIP_PRINTCLUSTER_PROXY_VALID_CLUSTER \ CHIP_PRINTCLUSTER_BOOLEAN_STATE_CLUSTER \ + CHIP_PRINTCLUSTER_ICD_MANAGEMENT_CLUSTER \ CHIP_PRINTCLUSTER_MODE_SELECT_CLUSTER \ CHIP_PRINTCLUSTER_AIR_QUALITY_CLUSTER \ CHIP_PRINTCLUSTER_HEPA_FILTER_MONITORING_CLUSTER \ @@ -652,7 +653,6 @@ CHIP_PRINTCLUSTER_APPLICATION_BASIC_CLUSTER \ CHIP_PRINTCLUSTER_ACCOUNT_LOGIN_CLUSTER \ CHIP_PRINTCLUSTER_ELECTRICAL_MEASUREMENT_CLUSTER \ - CHIP_PRINTCLUSTER_CLIENT_MONITORING_CLUSTER \ CHIP_PRINTCLUSTER_UNIT_TESTING_CLUSTER \ CHIP_PRINTCLUSTER_FAULT_INJECTION_CLUSTER diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 7759a821fd0340..d8513c0fbb762d 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -72,6 +72,7 @@ | ProxyDiscovery | 0x0043 | | ProxyValid | 0x0044 | | BooleanState | 0x0045 | +| IcdManagement | 0x0046 | | ModeSelect | 0x0050 | | AirQuality | 0x005B | | HepaFilterMonitoring | 0x0071 | @@ -114,7 +115,6 @@ | ApplicationBasic | 0x050D | | AccountLogin | 0x050E | | ElectricalMeasurement | 0x0B04 | -| ClientMonitoring | 0x1046 | | UnitTesting | 0xFFF1FC05| | FaultInjection | 0xFFF1FC06| \*----------------------------------------------------------------------------*/ @@ -3863,6 +3863,126 @@ class GroupKeyManagementKeySetReadAllIndices : public ClusterCommand | * StateChange | 0x0000 | \*----------------------------------------------------------------------------*/ +/*----------------------------------------------------------------------------*\ +| Cluster IcdManagement | 0x0046 | +|------------------------------------------------------------------------------| +| Commands: | | +| * RegisterClient | 0x00 | +| * UnregisterClient | 0x02 | +| * StayActiveRequest | 0x03 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * IdleModeInterval | 0x0000 | +| * ActiveModeInterval | 0x0001 | +| * ActiveModeThreshold | 0x0002 | +| * RegisteredClients | 0x0003 | +| * ICDCounter | 0x0004 | +| * ClientsSupportedPerFabric | 0x0005 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + +/* + * Command RegisterClient + */ +class IcdManagementRegisterClient : public ClusterCommand +{ +public: + IcdManagementRegisterClient(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("register-client", credsIssuerConfig) + { + AddArgument("CheckInNodeID", 0, UINT64_MAX, &mRequest.checkInNodeID); + AddArgument("MonitoredSubject", 0, UINT64_MAX, &mRequest.monitoredSubject); + AddArgument("Key", &mRequest.key); + AddArgument("VerificationKey", &mRequest.verificationKey); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000046) command (0x00000000) on endpoint %u", endpointIds.at(0)); + + return ClusterCommand::SendCommand(device, endpointIds.at(0), 0x00000046, 0x00000000, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000046) command (0x00000000) on Group %u", groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, 0x00000046, 0x00000000, mRequest); + } + +private: + chip::app::Clusters::IcdManagement::Commands::RegisterClient::Type mRequest; +}; + +/* + * Command UnregisterClient + */ +class IcdManagementUnregisterClient : public ClusterCommand +{ +public: + IcdManagementUnregisterClient(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("unregister-client", credsIssuerConfig) + { + AddArgument("CheckInNodeID", 0, UINT64_MAX, &mRequest.checkInNodeID); + AddArgument("Key", &mRequest.key); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000046) command (0x00000002) on endpoint %u", endpointIds.at(0)); + + return ClusterCommand::SendCommand(device, endpointIds.at(0), 0x00000046, 0x00000002, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000046) command (0x00000002) on Group %u", groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, 0x00000046, 0x00000002, mRequest); + } + +private: + chip::app::Clusters::IcdManagement::Commands::UnregisterClient::Type mRequest; +}; + +/* + * Command StayActiveRequest + */ +class IcdManagementStayActiveRequest : public ClusterCommand +{ +public: + IcdManagementStayActiveRequest(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("stay-active-request", credsIssuerConfig) + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000046) command (0x00000003) on endpoint %u", endpointIds.at(0)); + + return ClusterCommand::SendCommand(device, endpointIds.at(0), 0x00000046, 0x00000003, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000046) command (0x00000003) on Group %u", groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, 0x00000046, 0x00000003, mRequest); + } + +private: + chip::app::Clusters::IcdManagement::Commands::StayActiveRequest::Type mRequest; +}; + /*----------------------------------------------------------------------------*\ | Cluster ModeSelect | 0x0050 | |------------------------------------------------------------------------------| @@ -8159,123 +8279,6 @@ class ElectricalMeasurementGetMeasurementProfileCommand : public ClusterCommand chip::app::Clusters::ElectricalMeasurement::Commands::GetMeasurementProfileCommand::Type mRequest; }; -/*----------------------------------------------------------------------------*\ -| Cluster ClientMonitoring | 0x1046 | -|------------------------------------------------------------------------------| -| Commands: | | -| * RegisterClientMonitoring | 0x00 | -| * UnregisterClientMonitoring | 0x02 | -| * StayAwakeRequest | 0x03 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * IdleModeInterval | 0x0000 | -| * ActiveModeInterval | 0x0001 | -| * ActiveModeThreshold | 0x0002 | -| * ExpectedClients | 0x0003 | -| * ICDCounter | 0x0004 | -| * GeneratedCommandList | 0xFFF8 | -| * AcceptedCommandList | 0xFFF9 | -| * EventList | 0xFFFA | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Command RegisterClientMonitoring - */ -class ClientMonitoringRegisterClientMonitoring : public ClusterCommand -{ -public: - ClientMonitoringRegisterClientMonitoring(CredentialIssuerCommands * credsIssuerConfig) : - ClusterCommand("register-client-monitoring", credsIssuerConfig) - { - AddArgument("ClientNodeID", 0, UINT64_MAX, &mRequest.clientNodeID); - AddArgument("Key", &mRequest.key); - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00001046) command (0x00000000) on endpoint %u", endpointIds.at(0)); - - return ClusterCommand::SendCommand(device, endpointIds.at(0), 0x00001046, 0x00000000, mRequest); - } - - CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00001046) command (0x00000000) on Group %u", groupId); - - return ClusterCommand::SendGroupCommand(groupId, fabricIndex, 0x00001046, 0x00000000, mRequest); - } - -private: - chip::app::Clusters::ClientMonitoring::Commands::RegisterClientMonitoring::Type mRequest; -}; - -/* - * Command UnregisterClientMonitoring - */ -class ClientMonitoringUnregisterClientMonitoring : public ClusterCommand -{ -public: - ClientMonitoringUnregisterClientMonitoring(CredentialIssuerCommands * credsIssuerConfig) : - ClusterCommand("unregister-client-monitoring", credsIssuerConfig) - { - AddArgument("ClientNodeID", 0, UINT64_MAX, &mRequest.clientNodeID); - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00001046) command (0x00000002) on endpoint %u", endpointIds.at(0)); - - return ClusterCommand::SendCommand(device, endpointIds.at(0), 0x00001046, 0x00000002, mRequest); - } - - CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00001046) command (0x00000002) on Group %u", groupId); - - return ClusterCommand::SendGroupCommand(groupId, fabricIndex, 0x00001046, 0x00000002, mRequest); - } - -private: - chip::app::Clusters::ClientMonitoring::Commands::UnregisterClientMonitoring::Type mRequest; -}; - -/* - * Command StayAwakeRequest - */ -class ClientMonitoringStayAwakeRequest : public ClusterCommand -{ -public: - ClientMonitoringStayAwakeRequest(CredentialIssuerCommands * credsIssuerConfig) : - ClusterCommand("stay-awake-request", credsIssuerConfig) - { - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00001046) command (0x00000003) on endpoint %u", endpointIds.at(0)); - - return ClusterCommand::SendCommand(device, endpointIds.at(0), 0x00001046, 0x00000003, mRequest); - } - - CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00001046) command (0x00000003) on Group %u", groupId); - - return ClusterCommand::SendGroupCommand(groupId, fabricIndex, 0x00001046, 0x00000003, mRequest); - } - -private: - chip::app::Clusters::ClientMonitoring::Commands::StayAwakeRequest::Type mRequest; -}; - /*----------------------------------------------------------------------------*\ | Cluster UnitTesting | 0xFFF1FC05| |------------------------------------------------------------------------------| @@ -12657,6 +12660,88 @@ void registerClusterBooleanState(Commands & commands, CredentialIssuerCommands * commands.Register(clusterName, clusterCommands); } +void registerClusterIcdManagement(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) +{ + using namespace chip::app::Clusters::IcdManagement; + + const char * clusterName = "IcdManagement"; + + commands_list clusterCommands = { + // + // Commands + // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + // + // Attributes + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "idle-mode-interval", Attributes::IdleModeInterval::Id, credsIssuerConfig), // + make_unique(Id, "active-mode-interval", Attributes::ActiveModeInterval::Id, credsIssuerConfig), // + make_unique(Id, "active-mode-threshold", Attributes::ActiveModeThreshold::Id, credsIssuerConfig), // + make_unique(Id, "registered-clients", Attributes::RegisteredClients::Id, credsIssuerConfig), // + make_unique(Id, "icdcounter", Attributes::ICDCounter::Id, credsIssuerConfig), // + make_unique(Id, "clients-supported-per-fabric", Attributes::ClientsSupportedPerFabric::Id, + credsIssuerConfig), // + make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + make_unique>(Id, credsIssuerConfig), // + make_unique>(Id, "idle-mode-interval", 0, UINT32_MAX, Attributes::IdleModeInterval::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "active-mode-interval", 0, UINT32_MAX, Attributes::ActiveModeInterval::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "active-mode-threshold", 0, UINT16_MAX, Attributes::ActiveModeThreshold::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "registered-clients", Attributes::RegisteredClients::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "icdcounter", 0, UINT32_MAX, Attributes::ICDCounter::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "clients-supported-per-fabric", 0, UINT16_MAX, + Attributes::ClientsSupportedPerFabric::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>>( + Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>>( + Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "event-list", Attributes::EventList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "attribute-list", Attributes::AttributeList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "feature-map", 0, UINT32_MAX, Attributes::FeatureMap::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "cluster-revision", 0, UINT16_MAX, Attributes::ClusterRevision::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "idle-mode-interval", Attributes::IdleModeInterval::Id, credsIssuerConfig), // + make_unique(Id, "active-mode-interval", Attributes::ActiveModeInterval::Id, credsIssuerConfig), // + make_unique(Id, "active-mode-threshold", Attributes::ActiveModeThreshold::Id, credsIssuerConfig), // + make_unique(Id, "registered-clients", Attributes::RegisteredClients::Id, credsIssuerConfig), // + make_unique(Id, "icdcounter", Attributes::ICDCounter::Id, credsIssuerConfig), // + make_unique(Id, "clients-supported-per-fabric", Attributes::ClientsSupportedPerFabric::Id, + credsIssuerConfig), // + make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + // + // Events + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + }; + + commands.Register(clusterName, clusterCommands); +} void registerClusterModeSelect(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) { using namespace chip::app::Clusters::ModeSelect; @@ -17237,81 +17322,6 @@ void registerClusterElectricalMeasurement(Commands & commands, CredentialIssuerC commands.Register(clusterName, clusterCommands); } -void registerClusterClientMonitoring(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) -{ - using namespace chip::app::Clusters::ClientMonitoring; - - const char * clusterName = "ClientMonitoring"; - - commands_list clusterCommands = { - // - // Commands - // - make_unique(Id, credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // - // - // Attributes - // - make_unique(Id, credsIssuerConfig), // - make_unique(Id, "idle-mode-interval", Attributes::IdleModeInterval::Id, credsIssuerConfig), // - make_unique(Id, "active-mode-interval", Attributes::ActiveModeInterval::Id, credsIssuerConfig), // - make_unique(Id, "active-mode-threshold", Attributes::ActiveModeThreshold::Id, credsIssuerConfig), // - make_unique(Id, "expected-clients", Attributes::ExpectedClients::Id, credsIssuerConfig), // - make_unique(Id, "icdcounter", Attributes::ICDCounter::Id, credsIssuerConfig), // - make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // - make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // - make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // - make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // - make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // - make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // - make_unique>(Id, credsIssuerConfig), // - make_unique>(Id, "idle-mode-interval", 0, UINT32_MAX, Attributes::IdleModeInterval::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "active-mode-interval", 0, UINT32_MAX, Attributes::ActiveModeInterval::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "active-mode-threshold", 0, UINT16_MAX, Attributes::ActiveModeThreshold::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>>( - Id, "expected-clients", Attributes::ExpectedClients::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "icdcounter", 0, UINT32_MAX, Attributes::ICDCounter::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>>( - Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>>( - Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>>( - Id, "event-list", Attributes::EventList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>>( - Id, "attribute-list", Attributes::AttributeList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "feature-map", 0, UINT32_MAX, Attributes::FeatureMap::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "cluster-revision", 0, UINT16_MAX, Attributes::ClusterRevision::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique(Id, credsIssuerConfig), // - make_unique(Id, "idle-mode-interval", Attributes::IdleModeInterval::Id, credsIssuerConfig), // - make_unique(Id, "active-mode-interval", Attributes::ActiveModeInterval::Id, credsIssuerConfig), // - make_unique(Id, "active-mode-threshold", Attributes::ActiveModeThreshold::Id, credsIssuerConfig), // - make_unique(Id, "expected-clients", Attributes::ExpectedClients::Id, credsIssuerConfig), // - make_unique(Id, "icdcounter", Attributes::ICDCounter::Id, credsIssuerConfig), // - make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // - make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // - make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // - make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // - make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // - make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // - // - // Events - // - make_unique(Id, credsIssuerConfig), // - make_unique(Id, credsIssuerConfig), // - }; - - commands.Register(clusterName, clusterCommands); -} void registerClusterUnitTesting(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) { using namespace chip::app::Clusters::UnitTesting; @@ -17872,6 +17882,7 @@ void registerClusters(Commands & commands, CredentialIssuerCommands * credsIssue registerClusterProxyDiscovery(commands, credsIssuerConfig); registerClusterProxyValid(commands, credsIssuerConfig); registerClusterBooleanState(commands, credsIssuerConfig); + registerClusterIcdManagement(commands, credsIssuerConfig); registerClusterModeSelect(commands, credsIssuerConfig); registerClusterAirQuality(commands, credsIssuerConfig); registerClusterHepaFilterMonitoring(commands, credsIssuerConfig); @@ -17914,7 +17925,6 @@ void registerClusters(Commands & commands, CredentialIssuerCommands * credsIssue registerClusterApplicationBasic(commands, credsIssuerConfig); registerClusterAccountLogin(commands, credsIssuerConfig); registerClusterElectricalMeasurement(commands, credsIssuerConfig); - registerClusterClientMonitoring(commands, credsIssuerConfig); registerClusterUnitTesting(commands, credsIssuerConfig); registerClusterFaultInjection(commands, credsIssuerConfig); } diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp index 5ce59a33759a42..57b7ee1203a6f8 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp @@ -1766,6 +1766,53 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::GroupKeyManagement::St ComplexArgumentParser::Finalize(request.epochStartTime2); } +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::IcdManagement::Structs::MonitoringRegistrationStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("MonitoringRegistrationStruct.checkInNodeID", "checkInNodeID", + value.isMember("checkInNodeID"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("MonitoringRegistrationStruct.monitoredSubject", + "monitoredSubject", value.isMember("monitoredSubject"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("MonitoringRegistrationStruct.key", "key", value.isMember("key"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "checkInNodeID"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.checkInNodeID, value["checkInNodeID"])); + valueCopy.removeMember("checkInNodeID"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "monitoredSubject"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.monitoredSubject, value["monitoredSubject"])); + valueCopy.removeMember("monitoredSubject"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "key"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.key, value["key"])); + valueCopy.removeMember("key"); + + if (value.isMember("fabricIndex")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "fabricIndex"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.fabricIndex, value["fabricIndex"])); + } + valueCopy.removeMember("fabricIndex"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::IcdManagement::Structs::MonitoringRegistrationStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.checkInNodeID); + ComplexArgumentParser::Finalize(request.monitoredSubject); + ComplexArgumentParser::Finalize(request.key); + ComplexArgumentParser::Finalize(request.fabricIndex); +} + CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::ModeSelect::Structs::SemanticTagStruct::Type & request, Json::Value & value) @@ -2420,47 +2467,6 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::ApplicationLauncher::S ComplexArgumentParser::Finalize(request.endpoint); } -CHIP_ERROR -ComplexArgumentParser::Setup(const char * label, - chip::app::Clusters::ClientMonitoring::Structs::MonitoringRegistrationStruct::Type & request, - Json::Value & value) -{ - VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); - - // Copy to track which members we already processed. - Json::Value valueCopy(value); - - ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("MonitoringRegistrationStruct.clientNodeID", "clientNodeID", - value.isMember("clientNodeID"))); - ReturnErrorOnFailure( - ComplexArgumentParser::EnsureMemberExist("MonitoringRegistrationStruct.key", "key", value.isMember("key"))); - - char labelWithMember[kMaxLabelLength]; - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "clientNodeID"); - ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.clientNodeID, value["clientNodeID"])); - valueCopy.removeMember("clientNodeID"); - - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "key"); - ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.key, value["key"])); - valueCopy.removeMember("key"); - - if (value.isMember("fabricIndex")) - { - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "fabricIndex"); - ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.fabricIndex, value["fabricIndex"])); - } - valueCopy.removeMember("fabricIndex"); - - return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); -} - -void ComplexArgumentParser::Finalize(chip::app::Clusters::ClientMonitoring::Structs::MonitoringRegistrationStruct::Type & request) -{ - ComplexArgumentParser::Finalize(request.clientNodeID); - ComplexArgumentParser::Finalize(request.key); - ComplexArgumentParser::Finalize(request.fabricIndex); -} - CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::UnitTesting::Structs::SimpleStruct::Type & request, Json::Value & value) { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h index 38c67265a1bbc5..6d5368acc56cfa 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h @@ -216,6 +216,12 @@ static CHIP_ERROR Setup(const char * label, chip::app::Clusters::GroupKeyManagem static void Finalize(chip::app::Clusters::GroupKeyManagement::Structs::GroupKeySetStruct::Type & request); +static CHIP_ERROR Setup(const char * label, + chip::app::Clusters::IcdManagement::Structs::MonitoringRegistrationStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::IcdManagement::Structs::MonitoringRegistrationStruct::Type & request); + static CHIP_ERROR Setup(const char * label, chip::app::Clusters::ModeSelect::Structs::SemanticTagStruct::Type & request, Json::Value & value); @@ -302,12 +308,6 @@ static CHIP_ERROR Setup(const char * label, chip::app::Clusters::ApplicationLaun static void Finalize(chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEPStruct::Type & request); -static CHIP_ERROR Setup(const char * label, - chip::app::Clusters::ClientMonitoring::Structs::MonitoringRegistrationStruct::Type & request, - Json::Value & value); - -static void Finalize(chip::app::Clusters::ClientMonitoring::Structs::MonitoringRegistrationStruct::Type & request); - static CHIP_ERROR Setup(const char * label, chip::app::Clusters::UnitTesting::Structs::SimpleStruct::Type & request, Json::Value & value); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index ebe8bfa670870d..596663cfbc6c31 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -1609,6 +1609,48 @@ DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } +CHIP_ERROR +DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::IcdManagement::Structs::MonitoringRegistrationStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("CheckInNodeID", indent + 1, value.checkInNodeID); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'CheckInNodeID'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("MonitoredSubject", indent + 1, value.monitoredSubject); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MonitoredSubject'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("Key", indent + 1, value.key); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Key'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("FabricIndex", indent + 1, value.fabricIndex); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'FabricIndex'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const chip::app::Clusters::ModeSelect::Structs::SemanticTagStruct::DecodableType & value) { @@ -2169,40 +2211,6 @@ DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } -CHIP_ERROR -DataModelLogger::LogValue(const char * label, size_t indent, - const chip::app::Clusters::ClientMonitoring::Structs::MonitoringRegistrationStruct::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - { - CHIP_ERROR err = LogValue("ClientNodeID", indent + 1, value.clientNodeID); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ClientNodeID'"); - return err; - } - } - { - CHIP_ERROR err = LogValue("Key", indent + 1, value.key); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Key'"); - return err; - } - } - { - CHIP_ERROR err = LogValue("FabricIndex", indent + 1, value.fabricIndex); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'FabricIndex'"); - return err; - } - } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} - CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const chip::app::Clusters::UnitTesting::Structs::SimpleStruct::DecodableType & value) { @@ -4172,6 +4180,14 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; } +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const IcdManagement::Commands::RegisterClientResponse::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + ReturnErrorOnFailure(DataModelLogger::LogValue("ICDCounter", indent + 1, value.ICDCounter)); + DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; +} CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType & value) { @@ -4348,15 +4364,6 @@ DataModelLogger::LogValue(const char * label, size_t indent, DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; } -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const ClientMonitoring::Commands::RegisterClientMonitoringResponse::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - ReturnErrorOnFailure(DataModelLogger::LogValue("status", indent + 1, value.status)); - ReturnErrorOnFailure(DataModelLogger::LogValue("ICDCounter", indent + 1, value.ICDCounter)); - DataModelLogger::LogString(indent, "}"); - return CHIP_NO_ERROR; -} CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const UnitTesting::Commands::TestSpecificResponse::DecodableType & value) { @@ -7339,6 +7346,74 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } + case IcdManagement::Id: { + switch (path.mAttributeId) + { + case IcdManagement::Attributes::IdleModeInterval::Id: { + uint32_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("IdleModeInterval", 1, value); + } + case IcdManagement::Attributes::ActiveModeInterval::Id: { + uint32_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ActiveModeInterval", 1, value); + } + case IcdManagement::Attributes::ActiveModeThreshold::Id: { + uint16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ActiveModeThreshold", 1, value); + } + case IcdManagement::Attributes::RegisteredClients::Id: { + chip::app::DataModel::DecodableList< + chip::app::Clusters::IcdManagement::Structs::MonitoringRegistrationStruct::DecodableType> + value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("RegisteredClients", 1, value); + } + case IcdManagement::Attributes::ICDCounter::Id: { + uint32_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ICDCounter", 1, value); + } + case IcdManagement::Attributes::ClientsSupportedPerFabric::Id: { + uint16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ClientsSupportedPerFabric", 1, value); + } + case IcdManagement::Attributes::GeneratedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + } + case IcdManagement::Attributes::AcceptedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + } + case IcdManagement::Attributes::EventList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("EventList", 1, value); + } + case IcdManagement::Attributes::AttributeList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AttributeList", 1, value); + } + case IcdManagement::Attributes::FeatureMap::Id: { + uint32_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("FeatureMap", 1, value); + } + case IcdManagement::Attributes::ClusterRevision::Id: { + uint16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ClusterRevision", 1, value); + } + } + break; + } case ModeSelect::Id: { switch (path.mAttributeId) { @@ -11204,69 +11279,6 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case ClientMonitoring::Id: { - switch (path.mAttributeId) - { - case ClientMonitoring::Attributes::IdleModeInterval::Id: { - uint32_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("IdleModeInterval", 1, value); - } - case ClientMonitoring::Attributes::ActiveModeInterval::Id: { - uint32_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ActiveModeInterval", 1, value); - } - case ClientMonitoring::Attributes::ActiveModeThreshold::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ActiveModeThreshold", 1, value); - } - case ClientMonitoring::Attributes::ExpectedClients::Id: { - chip::app::DataModel::DecodableList< - chip::app::Clusters::ClientMonitoring::Structs::MonitoringRegistrationStruct::DecodableType> - value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ExpectedClients", 1, value); - } - case ClientMonitoring::Attributes::ICDCounter::Id: { - uint32_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ICDCounter", 1, value); - } - case ClientMonitoring::Attributes::GeneratedCommandList::Id: { - chip::app::DataModel::DecodableList value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); - } - case ClientMonitoring::Attributes::AcceptedCommandList::Id: { - chip::app::DataModel::DecodableList value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); - } - case ClientMonitoring::Attributes::EventList::Id: { - chip::app::DataModel::DecodableList value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("EventList", 1, value); - } - case ClientMonitoring::Attributes::AttributeList::Id: { - chip::app::DataModel::DecodableList value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); - } - case ClientMonitoring::Attributes::FeatureMap::Id: { - uint32_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("FeatureMap", 1, value); - } - case ClientMonitoring::Attributes::ClusterRevision::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ClusterRevision", 1, value); - } - } - break; - } case UnitTesting::Id: { switch (path.mAttributeId) { @@ -11965,6 +11977,17 @@ CHIP_ERROR DataModelLogger::LogCommand(const chip::app::ConcreteCommandPath & pa } break; } + case IcdManagement::Id: { + switch (path.mCommandId) + { + case IcdManagement::Commands::RegisterClientResponse::Id: { + IcdManagement::Commands::RegisterClientResponse::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("RegisterClientResponse", 1, value); + } + } + break; + } case DoorLock::Id: { switch (path.mCommandId) { @@ -12105,17 +12128,6 @@ CHIP_ERROR DataModelLogger::LogCommand(const chip::app::ConcreteCommandPath & pa } break; } - case ClientMonitoring::Id: { - switch (path.mCommandId) - { - case ClientMonitoring::Commands::RegisterClientMonitoringResponse::Id: { - ClientMonitoring::Commands::RegisterClientMonitoringResponse::DecodableType value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("RegisterClientMonitoringResponse", 1, value); - } - } - break; - } case UnitTesting::Id: { switch (path.mCommandId) { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h index 56b6d369f2984a..4ca2cb87965695 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h @@ -137,6 +137,9 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::GroupKeyManagement::Structs::GroupKeySetStruct::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::IcdManagement::Structs::MonitoringRegistrationStruct::DecodableType & value); + static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::ModeSelect::Structs::SemanticTagStruct::DecodableType & value); @@ -188,10 +191,6 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEPStruct::DecodableType & value); -static CHIP_ERROR -LogValue(const char * label, size_t indent, - const chip::app::Clusters::ClientMonitoring::Structs::MonitoringRegistrationStruct::DecodableType & value); - static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::UnitTesting::Structs::SimpleStruct::DecodableType & value); @@ -419,6 +418,8 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndicesResponse::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::IcdManagement::Commands::RegisterClientResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, @@ -453,9 +454,6 @@ LogValue(const char * label, size_t indent, static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::ElectricalMeasurement::Commands::GetMeasurementProfileResponseCommand::DecodableType & value); -static CHIP_ERROR -LogValue(const char * label, size_t indent, - const chip::app::Clusters::ClientMonitoring::Commands::RegisterClientMonitoringResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::UnitTesting::Commands::TestSpecificResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index fa2779748c7e6d..5fc50d4dcd1cb8 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -70510,10 +70510,12 @@ class TestDescriptorClusterSuite : public TestCommand VerifyOrReturn(CheckNextListItemDecodes("serverList", iter_0, 24)); VerifyOrReturn(CheckValue("serverList[24]", iter_0.GetValue(), 65UL)); VerifyOrReturn(CheckNextListItemDecodes("serverList", iter_0, 25)); - VerifyOrReturn(CheckValue("serverList[25]", iter_0.GetValue(), 1029UL)); + VerifyOrReturn(CheckValue("serverList[25]", iter_0.GetValue(), 70UL)); VerifyOrReturn(CheckNextListItemDecodes("serverList", iter_0, 26)); - VerifyOrReturn(CheckValue("serverList[26]", iter_0.GetValue(), 4294048774UL)); - VerifyOrReturn(CheckNoMoreListItems("serverList", iter_0, 27)); + VerifyOrReturn(CheckValue("serverList[26]", iter_0.GetValue(), 1029UL)); + VerifyOrReturn(CheckNextListItemDecodes("serverList", iter_0, 27)); + VerifyOrReturn(CheckValue("serverList[27]", iter_0.GetValue(), 4294048774UL)); + VerifyOrReturn(CheckNoMoreListItems("serverList", iter_0, 28)); } } break; diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index 8f3f5bcbdd574b..edb6697390f6f9 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -75,6 +75,7 @@ | ProxyDiscovery | 0x0043 | | ProxyValid | 0x0044 | | BooleanState | 0x0045 | +| IcdManagement | 0x0046 | | ModeSelect | 0x0050 | | AirQuality | 0x005B | | HepaFilterMonitoring | 0x0071 | @@ -117,7 +118,6 @@ | ApplicationBasic | 0x050D | | AccountLogin | 0x050E | | ElectricalMeasurement | 0x0B04 | -| ClientMonitoring | 0x1046 | | UnitTesting | 0xFFF1FC05| | FaultInjection | 0xFFF1FC06| \*----------------------------------------------------------------------------*/ @@ -37031,6 +37031,1030 @@ class SubscribeAttributeBooleanStateClusterRevision : public SubscribeAttribute } }; +/*----------------------------------------------------------------------------*\ +| Cluster IcdManagement | 0x0046 | +|------------------------------------------------------------------------------| +| Commands: | | +| * RegisterClient | 0x00 | +| * UnregisterClient | 0x02 | +| * StayActiveRequest | 0x03 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * IdleModeInterval | 0x0000 | +| * ActiveModeInterval | 0x0001 | +| * ActiveModeThreshold | 0x0002 | +| * RegisteredClients | 0x0003 | +| * ICDCounter | 0x0004 | +| * ClientsSupportedPerFabric | 0x0005 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + +/* + * Command RegisterClient + */ +class IcdManagementRegisterClient : public ClusterCommand { +public: + IcdManagementRegisterClient() + : ClusterCommand("register-client") + { + AddArgument("CheckInNodeID", 0, UINT64_MAX, &mRequest.checkInNodeID); + AddArgument("MonitoredSubject", 0, UINT64_MAX, &mRequest.monitoredSubject); + AddArgument("Key", &mRequest.key); + AddArgument("VerificationKey", &mRequest.verificationKey); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000046) command (0x00000000) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRICDManagementClusterRegisterClientParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.checkInNodeID = [NSNumber numberWithUnsignedLongLong:mRequest.checkInNodeID]; + params.monitoredSubject = [NSNumber numberWithUnsignedLongLong:mRequest.monitoredSubject]; + params.key = [NSData dataWithBytes:mRequest.key.data() length:mRequest.key.size()]; + if (mRequest.verificationKey.HasValue()) { + params.verificationKey = [NSData dataWithBytes:mRequest.verificationKey.Value().data() + length:mRequest.verificationKey.Value().size()]; + } else { + params.verificationKey = nil; + } + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster registerClientWithParams:params + completion:^(MTRICDManagementClusterRegisterClientResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::IcdManagement::Commands::RegisterClient::Type mRequest; +}; + +/* + * Command UnregisterClient + */ +class IcdManagementUnregisterClient : public ClusterCommand { +public: + IcdManagementUnregisterClient() + : ClusterCommand("unregister-client") + { + AddArgument("CheckInNodeID", 0, UINT64_MAX, &mRequest.checkInNodeID); + AddArgument("Key", &mRequest.key); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000046) command (0x00000002) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRICDManagementClusterUnregisterClientParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.checkInNodeID = [NSNumber numberWithUnsignedLongLong:mRequest.checkInNodeID]; + if (mRequest.key.HasValue()) { + params.key = [NSData dataWithBytes:mRequest.key.Value().data() length:mRequest.key.Value().size()]; + } else { + params.key = nil; + } + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster unregisterClientWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::IcdManagement::Commands::UnregisterClient::Type mRequest; +}; + +/* + * Command StayActiveRequest + */ +class IcdManagementStayActiveRequest : public ClusterCommand { +public: + IcdManagementStayActiveRequest() + : ClusterCommand("stay-active-request") + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000046) command (0x00000003) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRICDManagementClusterStayActiveRequestParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster stayActiveRequestWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: +}; + +/* + * Attribute IdleModeInterval + */ +class ReadIcdManagementIdleModeInterval : public ReadAttribute { +public: + ReadIcdManagementIdleModeInterval() + : ReadAttribute("idle-mode-interval") + { + } + + ~ReadIcdManagementIdleModeInterval() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReadAttribute (0x00000000) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeIdleModeIntervalWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ICDManagement.IdleModeInterval response %@", [value description]); + if (error != nil) { + LogNSError("ICDManagement IdleModeInterval read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeIcdManagementIdleModeInterval : public SubscribeAttribute { +public: + SubscribeAttributeIcdManagementIdleModeInterval() + : SubscribeAttribute("idle-mode-interval") + { + } + + ~SubscribeAttributeIcdManagementIdleModeInterval() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReportAttribute (0x00000000) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeIdleModeIntervalWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ICDManagement.IdleModeInterval response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute ActiveModeInterval + */ +class ReadIcdManagementActiveModeInterval : public ReadAttribute { +public: + ReadIcdManagementActiveModeInterval() + : ReadAttribute("active-mode-interval") + { + } + + ~ReadIcdManagementActiveModeInterval() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReadAttribute (0x00000001) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeActiveModeIntervalWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ICDManagement.ActiveModeInterval response %@", [value description]); + if (error != nil) { + LogNSError("ICDManagement ActiveModeInterval read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeIcdManagementActiveModeInterval : public SubscribeAttribute { +public: + SubscribeAttributeIcdManagementActiveModeInterval() + : SubscribeAttribute("active-mode-interval") + { + } + + ~SubscribeAttributeIcdManagementActiveModeInterval() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReportAttribute (0x00000001) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeActiveModeIntervalWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ICDManagement.ActiveModeInterval response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute ActiveModeThreshold + */ +class ReadIcdManagementActiveModeThreshold : public ReadAttribute { +public: + ReadIcdManagementActiveModeThreshold() + : ReadAttribute("active-mode-threshold") + { + } + + ~ReadIcdManagementActiveModeThreshold() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReadAttribute (0x00000002) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeActiveModeThresholdWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ICDManagement.ActiveModeThreshold response %@", [value description]); + if (error != nil) { + LogNSError("ICDManagement ActiveModeThreshold read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeIcdManagementActiveModeThreshold : public SubscribeAttribute { +public: + SubscribeAttributeIcdManagementActiveModeThreshold() + : SubscribeAttribute("active-mode-threshold") + { + } + + ~SubscribeAttributeIcdManagementActiveModeThreshold() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReportAttribute (0x00000002) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeActiveModeThresholdWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ICDManagement.ActiveModeThreshold response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute RegisteredClients + */ +class ReadIcdManagementRegisteredClients : public ReadAttribute { +public: + ReadIcdManagementRegisteredClients() + : ReadAttribute("registered-clients") + { + } + + ~ReadIcdManagementRegisteredClients() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReadAttribute (0x00000003) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRReadParams alloc] init]; + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + [cluster readAttributeRegisteredClientsWithParams:params + completion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ICDManagement.RegisteredClients response %@", [value description]); + if (error != nil) { + LogNSError("ICDManagement RegisteredClients read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeIcdManagementRegisteredClients : public SubscribeAttribute { +public: + SubscribeAttributeIcdManagementRegisteredClients() + : SubscribeAttribute("registered-clients") + { + } + + ~SubscribeAttributeIcdManagementRegisteredClients() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReportAttribute (0x00000003) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeRegisteredClientsWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ICDManagement.RegisteredClients response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute ICDCounter + */ +class ReadIcdManagementICDCounter : public ReadAttribute { +public: + ReadIcdManagementICDCounter() + : ReadAttribute("icdcounter") + { + } + + ~ReadIcdManagementICDCounter() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReadAttribute (0x00000004) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeICDCounterWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ICDManagement.ICDCounter response %@", [value description]); + if (error != nil) { + LogNSError("ICDManagement ICDCounter read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeIcdManagementICDCounter : public SubscribeAttribute { +public: + SubscribeAttributeIcdManagementICDCounter() + : SubscribeAttribute("icdcounter") + { + } + + ~SubscribeAttributeIcdManagementICDCounter() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReportAttribute (0x00000004) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeICDCounterWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ICDManagement.ICDCounter response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute ClientsSupportedPerFabric + */ +class ReadIcdManagementClientsSupportedPerFabric : public ReadAttribute { +public: + ReadIcdManagementClientsSupportedPerFabric() + : ReadAttribute("clients-supported-per-fabric") + { + } + + ~ReadIcdManagementClientsSupportedPerFabric() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReadAttribute (0x00000005) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeClientsSupportedPerFabricWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ICDManagement.ClientsSupportedPerFabric response %@", [value description]); + if (error != nil) { + LogNSError("ICDManagement ClientsSupportedPerFabric read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeIcdManagementClientsSupportedPerFabric : public SubscribeAttribute { +public: + SubscribeAttributeIcdManagementClientsSupportedPerFabric() + : SubscribeAttribute("clients-supported-per-fabric") + { + } + + ~SubscribeAttributeIcdManagementClientsSupportedPerFabric() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReportAttribute (0x00000005) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeClientsSupportedPerFabricWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ICDManagement.ClientsSupportedPerFabric response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute GeneratedCommandList + */ +class ReadIcdManagementGeneratedCommandList : public ReadAttribute { +public: + ReadIcdManagementGeneratedCommandList() + : ReadAttribute("generated-command-list") + { + } + + ~ReadIcdManagementGeneratedCommandList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ICDManagement.GeneratedCommandList response %@", [value description]); + if (error != nil) { + LogNSError("ICDManagement GeneratedCommandList read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeIcdManagementGeneratedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeIcdManagementGeneratedCommandList() + : SubscribeAttribute("generated-command-list") + { + } + + ~SubscribeAttributeIcdManagementGeneratedCommandList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeGeneratedCommandListWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ICDManagement.GeneratedCommandList response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute AcceptedCommandList + */ +class ReadIcdManagementAcceptedCommandList : public ReadAttribute { +public: + ReadIcdManagementAcceptedCommandList() + : ReadAttribute("accepted-command-list") + { + } + + ~ReadIcdManagementAcceptedCommandList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ICDManagement.AcceptedCommandList response %@", [value description]); + if (error != nil) { + LogNSError("ICDManagement AcceptedCommandList read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeIcdManagementAcceptedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeIcdManagementAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") + { + } + + ~SubscribeAttributeIcdManagementAcceptedCommandList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeAcceptedCommandListWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ICDManagement.AcceptedCommandList response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute EventList + */ +class ReadIcdManagementEventList : public ReadAttribute { +public: + ReadIcdManagementEventList() + : ReadAttribute("event-list") + { + } + + ~ReadIcdManagementEventList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReadAttribute (0x0000FFFA) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ICDManagement.EventList response %@", [value description]); + if (error != nil) { + LogNSError("ICDManagement EventList read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeIcdManagementEventList : public SubscribeAttribute { +public: + SubscribeAttributeIcdManagementEventList() + : SubscribeAttribute("event-list") + { + } + + ~SubscribeAttributeIcdManagementEventList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReportAttribute (0x0000FFFA) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeEventListWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ICDManagement.EventList response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute AttributeList + */ +class ReadIcdManagementAttributeList : public ReadAttribute { +public: + ReadIcdManagementAttributeList() + : ReadAttribute("attribute-list") + { + } + + ~ReadIcdManagementAttributeList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ICDManagement.AttributeList response %@", [value description]); + if (error != nil) { + LogNSError("ICDManagement AttributeList read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeIcdManagementAttributeList : public SubscribeAttribute { +public: + SubscribeAttributeIcdManagementAttributeList() + : SubscribeAttribute("attribute-list") + { + } + + ~SubscribeAttributeIcdManagementAttributeList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeAttributeListWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ICDManagement.AttributeList response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute FeatureMap + */ +class ReadIcdManagementFeatureMap : public ReadAttribute { +public: + ReadIcdManagementFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadIcdManagementFeatureMap() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ICDManagement.FeatureMap response %@", [value description]); + if (error != nil) { + LogNSError("ICDManagement FeatureMap read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeIcdManagementFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeIcdManagementFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeIcdManagementFeatureMap() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeFeatureMapWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ICDManagement.FeatureMap response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute ClusterRevision + */ +class ReadIcdManagementClusterRevision : public ReadAttribute { +public: + ReadIcdManagementClusterRevision() + : ReadAttribute("cluster-revision") + { + } + + ~ReadIcdManagementClusterRevision() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ICDManagement.ClusterRevision response %@", [value description]); + if (error != nil) { + LogNSError("ICDManagement ClusterRevision read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeIcdManagementClusterRevision : public SubscribeAttribute { +public: + SubscribeAttributeIcdManagementClusterRevision() + : SubscribeAttribute("cluster-revision") + { + } + + ~SubscribeAttributeIcdManagementClusterRevision() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeClusterRevisionWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ICDManagement.ClusterRevision response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + /*----------------------------------------------------------------------------*\ | Cluster ModeSelect | 0x0050 | |------------------------------------------------------------------------------| @@ -108893,6 +109917,48 @@ void registerClusterBooleanState(Commands & commands) commands.Register(clusterName, clusterCommands); } +void registerClusterIcdManagement(Commands & commands) +{ + using namespace chip::app::Clusters::IcdManagement; + + const char * clusterName = "IcdManagement"; + + commands_list clusterCommands = { + make_unique(Id), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(Id), // + make_unique(), // + make_unique(Id), // + make_unique(Id), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + }; + + commands.Register(clusterName, clusterCommands); +} void registerClusterModeSelect(Commands & commands) { using namespace chip::app::Clusters::ModeSelect; @@ -111469,6 +112535,7 @@ void registerClusters(Commands & commands) registerClusterFixedLabel(commands); registerClusterUserLabel(commands); registerClusterBooleanState(commands); + registerClusterIcdManagement(commands); registerClusterModeSelect(commands); registerClusterAirQuality(commands); registerClusterHepaFilterMonitoring(commands); 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 93478f10d4b8d6..897b0061706c85 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -102353,7 +102353,7 @@ class TestDescriptorCluster : public TestCommandBridge { { id actualValue = value; - VerifyOrReturn(CheckValue("ServerList", [actualValue count], static_cast(27))); + VerifyOrReturn(CheckValue("ServerList", [actualValue count], static_cast(28))); VerifyOrReturn(CheckValue("", actualValue[0], 3UL)); VerifyOrReturn(CheckValue("", actualValue[1], 4UL)); VerifyOrReturn(CheckValue("", actualValue[2], 29UL)); @@ -102379,8 +102379,9 @@ class TestDescriptorCluster : public TestCommandBridge { VerifyOrReturn(CheckValue("", actualValue[22], 63UL)); VerifyOrReturn(CheckValue("", actualValue[23], 64UL)); VerifyOrReturn(CheckValue("", actualValue[24], 65UL)); - VerifyOrReturn(CheckValue("", actualValue[25], 1029UL)); - VerifyOrReturn(CheckValue("", actualValue[26], 4294048774UL)); + VerifyOrReturn(CheckValue("", actualValue[25], 70UL)); + VerifyOrReturn(CheckValue("", actualValue[26], 1029UL)); + VerifyOrReturn(CheckValue("", actualValue[27], 4294048774UL)); } NextTest(); diff --git a/zzz_generated/darwin/controller-clusters/zap-generated/CHIPClientCallbacks.h b/zzz_generated/darwin/controller-clusters/zap-generated/CHIPClientCallbacks.h index bce76e5a47b7dd..86b32af0a2a6a4 100644 --- a/zzz_generated/darwin/controller-clusters/zap-generated/CHIPClientCallbacks.h +++ b/zzz_generated/darwin/controller-clusters/zap-generated/CHIPClientCallbacks.h @@ -404,6 +404,18 @@ typedef void (*BooleanStateEventListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); typedef void (*BooleanStateAttributeListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*IcdManagementRegisteredClientsListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::IcdManagement::Structs::MonitoringRegistrationStruct::DecodableType> & data); +typedef void (*IcdManagementGeneratedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*IcdManagementAcceptedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*IcdManagementEventListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +typedef void (*IcdManagementAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); typedef void (*ModeSelectSupportedModesListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); diff --git a/zzz_generated/darwin/controller-clusters/zap-generated/CHIPClusters.h b/zzz_generated/darwin/controller-clusters/zap-generated/CHIPClusters.h index 784393e1ba2f96..3917b0f4fb2f56 100644 --- a/zzz_generated/darwin/controller-clusters/zap-generated/CHIPClusters.h +++ b/zzz_generated/darwin/controller-clusters/zap-generated/CHIPClusters.h @@ -357,6 +357,15 @@ class DLL_EXPORT BooleanStateCluster : public ClusterBase ~BooleanStateCluster() {} }; +class DLL_EXPORT IcdManagementCluster : public ClusterBase +{ +public: + IcdManagementCluster(Messaging::ExchangeManager & exchangeManager, const SessionHandle & session, EndpointId endpoint) : + ClusterBase(exchangeManager, session, endpoint) + {} + ~IcdManagementCluster() {} +}; + class DLL_EXPORT ModeSelectCluster : public ClusterBase { public: diff --git a/zzz_generated/darwin/controller-clusters/zap-generated/endpoint_config.h b/zzz_generated/darwin/controller-clusters/zap-generated/endpoint_config.h index b403334f1b49c5..82be9738bd6ee4 100644 --- a/zzz_generated/darwin/controller-clusters/zap-generated/endpoint_config.h +++ b/zzz_generated/darwin/controller-clusters/zap-generated/endpoint_config.h @@ -517,6 +517,19 @@ .eventList = nullptr, \ .eventCount = 0, \ },\ + { \ + /* Endpoint: 1, Cluster: ICD Management (client) */ \ + .clusterId = 0x00000046, \ + .attributes = ZAP_ATTRIBUTE_INDEX(0), \ + .attributeCount = 0, \ + .clusterSize = 0, \ + .mask = ZAP_CLUSTER_MASK(CLIENT), \ + .functions = NULL, \ + .acceptedCommandList = nullptr, \ + .generatedCommandList = nullptr, \ + .eventList = nullptr, \ + .eventCount = 0, \ + },\ { \ /* Endpoint: 1, Cluster: Mode Select (client) */ \ .clusterId = 0x00000050, \ diff --git a/zzz_generated/darwin/controller-clusters/zap-generated/gen_config.h b/zzz_generated/darwin/controller-clusters/zap-generated/gen_config.h index af8b036a142b27..38138d04bea7da 100644 --- a/zzz_generated/darwin/controller-clusters/zap-generated/gen_config.h +++ b/zzz_generated/darwin/controller-clusters/zap-generated/gen_config.h @@ -56,6 +56,7 @@ #define EMBER_AF_FIXED_LABEL_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_USER_LABEL_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_BOOLEAN_STATE_CLUSTER_CLIENT_ENDPOINT_COUNT (1) +#define EMBER_AF_ICD_MANAGEMENT_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_MODE_SELECT_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_AIR_QUALITY_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_HEPA_FILTER_MONITORING_CLUSTER_CLIENT_ENDPOINT_COUNT (1) @@ -242,6 +243,10 @@ #define ZCL_USING_BOOLEAN_STATE_CLUSTER_CLIENT #define EMBER_AF_PLUGIN_BOOLEAN_STATE_CLIENT +// Use this macro to check if the client side of the ICD Management cluster is included +#define ZCL_USING_ICD_MANAGEMENT_CLUSTER_CLIENT +#define EMBER_AF_PLUGIN_ICD_MANAGEMENT_CLIENT + // Use this macro to check if the client side of the Mode Select cluster is included #define ZCL_USING_MODE_SELECT_CLUSTER_CLIENT #define EMBER_AF_PLUGIN_MODE_SELECT_CLIENT