diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index d6c580e643e9ff..120f69be6c3077 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -114,6 +114,7 @@ jobs: src/app/zap-templates/zcl/data-model/chip/diagnostic-logs-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/dishwasher-alarm-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/dishwasher-mode-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/microwave-oven-control-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/door-lock-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/ethernet-network-diagnostics-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/fan-control-cluster.xml \ diff --git a/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter b/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter index 1f912fcd64e643..4607a5f5f21274 100644 --- a/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter +++ b/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter @@ -739,7 +739,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ @@ -1183,7 +1189,7 @@ server cluster TemperatureMeasurement = 1026 { readonly attribute nullable temperature measuredValue = 0; readonly attribute nullable temperature minMeasuredValue = 1; readonly attribute nullable temperature maxMeasuredValue = 2; - readonly attribute temperature tolerance = 3; + readonly attribute int16u tolerance = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1883,9 +1889,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster AdministratorCommissioning { diff --git a/examples/air-purifier-app/air-purifier-common/air-purifier-app.zap b/examples/air-purifier-app/air-purifier-common/air-purifier-app.zap index c1f47b4d162a51..62293622ef43db 100644 --- a/examples/air-purifier-app/air-purifier-common/air-purifier-app.zap +++ b/examples/air-purifier-app/air-purifier-common/air-purifier-app.zap @@ -1379,6 +1379,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1552,7 +1568,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -6822,7 +6838,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -6838,7 +6854,7 @@ "code": 1, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -6854,7 +6870,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -6870,7 +6886,7 @@ "code": 3, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7543,6 +7559,5 @@ "endpointId": 4, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter b/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter index 736803eaad9c70..ca74840f26cdd7 100644 --- a/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter +++ b/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter @@ -696,7 +696,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1886,9 +1892,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.zap b/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.zap index 13bfc7a3777a90..23d2555a8ead16 100644 --- a/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.zap +++ b/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.zap @@ -1327,6 +1327,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1500,7 +1516,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3992,7 +4008,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4008,7 +4024,7 @@ "code": 1, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4024,7 +4040,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5845,6 +5861,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file 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 a27629bc4da66d..48fdd6adb10f6f 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 @@ -118,6 +118,10 @@ server cluster Groups = 4 { /** Attributes and commands for scene configuration and manipulation. */ provisional server cluster Scenes = 5 { + bitmap CopyModeBitmap : bitmap8 { + kCopyAllScenes = 0x1; + } + bitmap Feature : bitmap32 { kSceneNames = 0x1; kExplicit = 0x2; @@ -125,8 +129,8 @@ provisional server cluster Scenes = 5 { kFabricScenes = 0x8; } - bitmap ScenesCopyMode : bitmap8 { - kCopyAllScenes = 0x1; + bitmap NameSupportBitmap : bitmap8 { + kSceneNames = 0x80; } struct AttributeValuePair { @@ -143,7 +147,7 @@ provisional server cluster Scenes = 5 { readonly attribute int8u currentScene = 1; readonly attribute group_id currentGroup = 2; readonly attribute boolean sceneValid = 3; - readonly attribute bitmap8 nameSupport = 4; + readonly attribute NameSupportBitmap nameSupport = 4; readonly attribute nullable node_id lastConfiguredBy = 5; readonly attribute int16u sceneTableSize = 6; readonly attribute int8u remainingCapacity = 7; @@ -205,7 +209,7 @@ provisional server cluster Scenes = 5 { } request struct CopySceneRequest { - ScenesCopyMode mode = 0; + CopyModeBitmap mode = 0; group_id groupIdentifierFrom = 1; int8u sceneIdentifierFrom = 2; group_id groupIdentifierTo = 3; @@ -1669,7 +1673,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -4120,7 +4130,7 @@ server cluster TemperatureMeasurement = 1026 { readonly attribute nullable temperature measuredValue = 0; readonly attribute nullable temperature minMeasuredValue = 1; readonly attribute nullable temperature maxMeasuredValue = 2; - readonly attribute temperature tolerance = 3; + readonly attribute int16u tolerance = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -5399,9 +5409,11 @@ endpoint 0 { callback attribute eventList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { 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 24e0df516f1b12..f2272fbee91295 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 @@ -2695,6 +2695,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -2932,7 +2948,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -14792,7 +14808,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -14808,7 +14824,7 @@ "code": 1, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -14824,7 +14840,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -14840,7 +14856,7 @@ "code": 3, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -21885,6 +21901,5 @@ "endpointId": 65534, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter index 5a4a521d090db2..8a69d89ed9222d 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter @@ -118,6 +118,10 @@ server cluster Groups = 4 { /** Attributes and commands for scene configuration and manipulation. */ provisional server cluster Scenes = 5 { + bitmap CopyModeBitmap : bitmap8 { + kCopyAllScenes = 0x1; + } + bitmap Feature : bitmap32 { kSceneNames = 0x1; kExplicit = 0x2; @@ -125,8 +129,8 @@ provisional server cluster Scenes = 5 { kFabricScenes = 0x8; } - bitmap ScenesCopyMode : bitmap8 { - kCopyAllScenes = 0x1; + bitmap NameSupportBitmap : bitmap8 { + kSceneNames = 0x80; } struct AttributeValuePair { @@ -143,7 +147,7 @@ provisional server cluster Scenes = 5 { readonly attribute int8u currentScene = 1; readonly attribute group_id currentGroup = 2; readonly attribute boolean sceneValid = 3; - readonly attribute bitmap8 nameSupport = 4; + readonly attribute NameSupportBitmap nameSupport = 4; readonly attribute nullable node_id lastConfiguredBy = 5; readonly attribute int16u sceneTableSize = 6; readonly attribute int8u remainingCapacity = 7; @@ -1475,6 +1479,7 @@ server cluster GeneralDiagnostics = 51 { readonly attribute NetworkInterface networkInterfaces[] = 0; readonly attribute int16u rebootCount = 1; + readonly attribute int64u upTime = 2; readonly attribute boolean testEventTriggersEnabled = 8; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -1488,7 +1493,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -4189,15 +4200,18 @@ endpoint 0 { server cluster GeneralDiagnostics { callback attribute networkInterfaces; callback attribute rebootCount default = 0x0000; + callback attribute upTime default = 0x0000000000000000; callback attribute testEventTriggersEnabled; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap index b5931df6f9ca27..4d7eeff57bcfc4 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap @@ -2368,6 +2368,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -2403,6 +2419,22 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "UpTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "TestEventTriggersEnabled", "code": 8, @@ -2509,7 +2541,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -7521,7 +7553,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7537,7 +7569,7 @@ "code": 1, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7553,7 +7585,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12316,6 +12348,5 @@ "endpointId": 65534, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/bridge-app/bridge-common/bridge-app.matter b/examples/bridge-app/bridge-common/bridge-app.matter index 63f5eb56aa9021..694b7de74c9f38 100644 --- a/examples/bridge-app/bridge-common/bridge-app.matter +++ b/examples/bridge-app/bridge-common/bridge-app.matter @@ -1006,7 +1006,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1787,9 +1793,11 @@ endpoint 0 { callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/bridge-app/bridge-common/bridge-app.zap b/examples/bridge-app/bridge-common/bridge-app.zap index a317c4f078917e..90eed8842cbc4f 100644 --- a/examples/bridge-app/bridge-common/bridge-app.zap +++ b/examples/bridge-app/bridge-common/bridge-app.zap @@ -1797,6 +1797,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -2018,7 +2034,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5555,7 +5571,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "External", "singleton": 0, @@ -5571,7 +5587,7 @@ "code": 1, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "External", "singleton": 0, @@ -5587,7 +5603,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "External", "singleton": 0, @@ -5705,6 +5721,5 @@ "endpointId": 2, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter index 35637f909cfcd7..8dfc00959b33d3 100644 --- a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter @@ -878,7 +878,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1599,9 +1605,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.zap b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.zap index 25ac5369207196..37c35471f5c872 100644 --- a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.zap +++ b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.zap @@ -1299,6 +1299,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1472,7 +1488,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4779,6 +4795,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter index 7e202205baad3c..a44002cc3ca5e6 100644 --- a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter +++ b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter @@ -659,7 +659,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ @@ -1848,9 +1854,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster AdministratorCommissioning { diff --git a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.zap b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.zap index 972a203fbb2822..ec3dcd931353d7 100644 --- a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.zap +++ b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.zap @@ -1172,6 +1172,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1345,7 +1361,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -6565,7 +6581,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -6581,7 +6597,7 @@ "code": 1, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -6597,7 +6613,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7828,6 +7844,5 @@ "endpointId": 5, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter index 25c89264dc5cc4..39e54e141b921d 100644 --- a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter +++ b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter @@ -788,7 +788,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1108,7 +1114,7 @@ server cluster TemperatureMeasurement = 1026 { readonly attribute nullable temperature measuredValue = 0; readonly attribute nullable temperature minMeasuredValue = 1; readonly attribute nullable temperature maxMeasuredValue = 2; - readonly attribute temperature tolerance = 3; + readonly attribute int16u tolerance = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1823,9 +1829,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.zap b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.zap index 9bcbe3d733ef4d..8b9d43e1c969d5 100644 --- a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.zap +++ b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.zap @@ -1543,6 +1543,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1716,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2897,7 +2913,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "NVM", "singleton": 0, @@ -2913,7 +2929,7 @@ "code": 1, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "NVM", "singleton": 0, @@ -2929,7 +2945,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "NVM", "singleton": 0, @@ -2945,7 +2961,7 @@ "code": 3, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "temperature", "included": 1, "storageOption": "NVM", "singleton": 0, @@ -6062,6 +6078,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter index 552d72bad13b31..a9e79fa2f29573 100644 --- a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter +++ b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter @@ -793,7 +793,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1593,9 +1599,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.zap b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.zap index 5f7070767c1420..333dbf4d9fa34f 100644 --- a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.zap +++ b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.zap @@ -1543,6 +1543,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1716,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3922,6 +3938,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter index f34d41305c3231..05203e0729239f 100644 --- a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter +++ b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter @@ -970,7 +970,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1644,9 +1650,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.zap b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.zap index 54a5668ca54ea3..2c06878eb0fd64 100644 --- a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.zap +++ b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.zap @@ -1379,6 +1379,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1552,7 +1568,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3902,6 +3918,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter index 1f48ef322092f0..39ac6b08dba8f3 100644 --- a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter +++ b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter @@ -876,7 +876,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1320,9 +1326,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.zap b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.zap index 57d85478f48039..5d66b2b8710794 100644 --- a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.zap +++ b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.zap @@ -1543,6 +1543,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1716,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3084,6 +3100,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter index 590adf953259f3..f503073da064bb 100644 --- a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter @@ -1026,7 +1026,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1496,9 +1502,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.zap b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.zap index b5d2ed8cfb1508..a910fd9b245a2e 100644 --- a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.zap +++ b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.zap @@ -1575,6 +1575,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1748,7 +1764,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3516,6 +3532,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter b/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter index b3273daa5b68c6..45c904f19f693a 100644 --- a/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter +++ b/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter @@ -631,7 +631,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1165,9 +1171,11 @@ endpoint 0 { callback attribute acceptedCommandList default = 0; callback attribute attributeList default = 0; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster WiFiNetworkDiagnostics { diff --git a/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap b/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap index e50c640463cb6d..ba944f48bbd683 100644 --- a/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap +++ b/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap @@ -1786,6 +1786,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -2007,7 +2023,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3517,6 +3533,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter index db8fafe7e33ab9..ab0f572eb982ad 100644 --- a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter +++ b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter @@ -876,7 +876,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1792,9 +1798,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.zap b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.zap index 6e55ee26b2f95c..a759e3d7c11b16 100644 --- a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.zap +++ b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.zap @@ -1543,6 +1543,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1716,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3413,6 +3429,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter index 4055d3f91948f7..5502974d07c632 100644 --- a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter +++ b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter @@ -1026,7 +1026,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1723,9 +1729,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.zap b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.zap index 5d3000d8b3ab71..ced7051c1f78ba 100644 --- a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.zap +++ b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.zap @@ -1543,6 +1543,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1716,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4006,6 +4022,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter b/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter index 37361893fd2449..bb154d3af5b762 100644 --- a/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter +++ b/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter @@ -863,7 +863,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1363,9 +1369,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/chef/devices/rootnode_fan_7N2TobIlOX.zap b/examples/chef/devices/rootnode_fan_7N2TobIlOX.zap index 6d93d50076731c..c40b276cc84f5c 100644 --- a/examples/chef/devices/rootnode_fan_7N2TobIlOX.zap +++ b/examples/chef/devices/rootnode_fan_7N2TobIlOX.zap @@ -1559,6 +1559,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1732,7 +1748,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3227,6 +3243,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter index 430af0dd820338..2ddd9204315b8e 100644 --- a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter +++ b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter @@ -882,7 +882,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1325,9 +1331,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.zap b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.zap index 3ad57c090834ff..a88c76d6957e95 100644 --- a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.zap +++ b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.zap @@ -1543,6 +1543,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1716,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2986,6 +3002,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter b/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter index 3305b751649ce5..de09288e6eaf13 100644 --- a/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter +++ b/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter @@ -590,7 +590,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** This cluster exposes interactions with a switch device, for the purpose of using those interactions by other devices. @@ -990,9 +996,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster AdministratorCommissioning { diff --git a/examples/chef/devices/rootnode_genericswitch_9866e35d0b.zap b/examples/chef/devices/rootnode_genericswitch_9866e35d0b.zap index 1f3613a429ed18..8e509727894bf5 100644 --- a/examples/chef/devices/rootnode_genericswitch_9866e35d0b.zap +++ b/examples/chef/devices/rootnode_genericswitch_9866e35d0b.zap @@ -1172,6 +1172,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1345,7 +1361,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2390,6 +2406,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter index 08aa21400773f2..03c9febba23c21 100644 --- a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter +++ b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter @@ -1020,7 +1020,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1672,9 +1678,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.zap b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.zap index 3995dfe9782e6a..681fd3d7ba8fee 100644 --- a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.zap +++ b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.zap @@ -1543,6 +1543,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1716,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3591,6 +3607,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter index 3078ca5196ed87..a3c8e66c387718 100644 --- a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter +++ b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter @@ -882,7 +882,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1325,9 +1331,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.zap b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.zap index 0e56fbaa2449b8..4b66c78c1a73cc 100644 --- a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.zap +++ b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.zap @@ -1543,6 +1543,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1716,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2986,6 +3002,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter index 2e9b45c1f90b23..9657c9b28e6909 100644 --- a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter +++ b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter @@ -631,7 +631,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1163,9 +1169,11 @@ endpoint 0 { callback attribute acceptedCommandList default = 0; callback attribute attributeList default = 0; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster WiFiNetworkDiagnostics { diff --git a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap index 798ae3307bd2e0..d0766a02e2dec8 100644 --- a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap +++ b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap @@ -1786,6 +1786,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -2007,7 +2023,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3353,6 +3369,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter index 6a9dd8678eaf30..3110d0f02c255d 100644 --- a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter +++ b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter @@ -882,7 +882,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1330,9 +1336,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.zap b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.zap index a33119d44de291..53edd8abd939df 100644 --- a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.zap +++ b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.zap @@ -1543,6 +1543,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1716,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2954,6 +2970,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter index 14000155c0a0bc..17d359a6a8e4cc 100644 --- a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter +++ b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter @@ -882,7 +882,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1341,9 +1347,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.zap b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.zap index 6646443a09e65b..70dcd3fa601752 100644 --- a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.zap +++ b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.zap @@ -1543,6 +1543,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1716,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2970,6 +2986,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter index ca7dd727790bcc..fb6bcf3d62788d 100644 --- a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter +++ b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter @@ -1026,7 +1026,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1455,9 +1461,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.zap b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.zap index e89d7311babe0a..0d48f3a2efe8bb 100644 --- a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.zap +++ b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.zap @@ -1543,6 +1543,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1716,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3426,6 +3442,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_onofflight_samplemei.matter b/examples/chef/devices/rootnode_onofflight_samplemei.matter index 85933c93474d4b..69ee3097aba335 100644 --- a/examples/chef/devices/rootnode_onofflight_samplemei.matter +++ b/examples/chef/devices/rootnode_onofflight_samplemei.matter @@ -1026,7 +1026,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1478,9 +1484,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/chef/devices/rootnode_onofflight_samplemei.zap b/examples/chef/devices/rootnode_onofflight_samplemei.zap index 5b983849ca4f2f..57669126a8386d 100644 --- a/examples/chef/devices/rootnode_onofflight_samplemei.zap +++ b/examples/chef/devices/rootnode_onofflight_samplemei.zap @@ -1543,6 +1543,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1716,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3558,6 +3574,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter index e226808c56b944..da912ef77108a1 100644 --- a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter +++ b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter @@ -990,7 +990,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1419,9 +1425,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.zap b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.zap index e2e1d77b241f90..3d7196817f51fa 100644 --- a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.zap +++ b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.zap @@ -1543,6 +1543,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1716,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3146,6 +3162,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter index 0a7f8aabd6adc2..08003bcfe2384a 100644 --- a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter +++ b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter @@ -925,7 +925,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1354,9 +1360,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.zap b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.zap index 24052570e77c22..c000d81688d972 100644 --- a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.zap +++ b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.zap @@ -1543,6 +1543,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1716,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3174,6 +3190,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter index dd1a2f16349f05..eb125b89e48971 100644 --- a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter +++ b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter @@ -882,7 +882,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1344,9 +1350,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.zap b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.zap index 1b0028275e2b40..c57e7287d9b850 100644 --- a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.zap +++ b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.zap @@ -1543,6 +1543,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1716,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2996,6 +3012,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_pump_5f904818cc.matter b/examples/chef/devices/rootnode_pump_5f904818cc.matter index a5bd2bf03297bb..a28ab46f769944 100644 --- a/examples/chef/devices/rootnode_pump_5f904818cc.matter +++ b/examples/chef/devices/rootnode_pump_5f904818cc.matter @@ -648,6 +648,7 @@ server cluster GeneralDiagnostics = 51 { readonly attribute NetworkInterface networkInterfaces[] = 0; readonly attribute int16u rebootCount = 1; + readonly attribute int64u upTime = 2; readonly attribute boolean testEventTriggersEnabled = 8; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -661,7 +662,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ @@ -1176,14 +1183,17 @@ endpoint 0 { server cluster GeneralDiagnostics { callback attribute networkInterfaces; callback attribute rebootCount default = 0x0000; + callback attribute upTime default = 0x0000000000000000; callback attribute testEventTriggersEnabled default = false; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster AdministratorCommissioning { diff --git a/examples/chef/devices/rootnode_pump_5f904818cc.zap b/examples/chef/devices/rootnode_pump_5f904818cc.zap index 131da70f467974..4d2ca2a38f6ea6 100644 --- a/examples/chef/devices/rootnode_pump_5f904818cc.zap +++ b/examples/chef/devices/rootnode_pump_5f904818cc.zap @@ -1511,6 +1511,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1546,6 +1562,22 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "UpTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "TestEventTriggersEnabled", "code": 8, @@ -1636,7 +1668,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3046,7 +3078,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3062,7 +3094,7 @@ "code": 1, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3078,7 +3110,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3513,6 +3545,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_pump_a811bb33a0.matter b/examples/chef/devices/rootnode_pump_a811bb33a0.matter index 44e81fb472dc0c..ed9c708770e43f 100644 --- a/examples/chef/devices/rootnode_pump_a811bb33a0.matter +++ b/examples/chef/devices/rootnode_pump_a811bb33a0.matter @@ -648,6 +648,7 @@ server cluster GeneralDiagnostics = 51 { readonly attribute NetworkInterface networkInterfaces[] = 0; readonly attribute int16u rebootCount = 1; + readonly attribute int64u upTime = 2; readonly attribute boolean testEventTriggersEnabled = 8; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -661,7 +662,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ @@ -1128,14 +1135,17 @@ endpoint 0 { server cluster GeneralDiagnostics { callback attribute networkInterfaces; callback attribute rebootCount default = 0x0000; + callback attribute upTime default = 0x0000000000000000; callback attribute testEventTriggersEnabled default = false; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster AdministratorCommissioning { diff --git a/examples/chef/devices/rootnode_pump_a811bb33a0.zap b/examples/chef/devices/rootnode_pump_a811bb33a0.zap index 49a4e51fd9a20e..c6ed1ed214c31d 100644 --- a/examples/chef/devices/rootnode_pump_a811bb33a0.zap +++ b/examples/chef/devices/rootnode_pump_a811bb33a0.zap @@ -1511,6 +1511,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1546,6 +1562,22 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "UpTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "TestEventTriggersEnabled", "code": 8, @@ -1636,7 +1668,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2971,6 +3003,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter index 745eb917c8b8bd..789ab736372331 100644 --- a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter +++ b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter @@ -631,7 +631,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1130,9 +1136,11 @@ endpoint 0 { callback attribute acceptedCommandList default = 0; callback attribute attributeList default = 0; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster WiFiNetworkDiagnostics { diff --git a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap index 6d0189f25a769a..f90591eef0a0d6 100644 --- a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap +++ b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap @@ -1786,6 +1786,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -2007,7 +2023,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3777,6 +3793,5 @@ "endpointId": 3, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter b/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter index a5a8b6afc1c7a0..b776749b7e2699 100644 --- a/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter +++ b/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter @@ -659,7 +659,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ @@ -1172,9 +1178,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster AdministratorCommissioning { diff --git a/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.zap b/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.zap index dad96cd186033a..8d10ab99962f47 100644 --- a/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.zap +++ b/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.zap @@ -1172,6 +1172,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1345,7 +1361,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3035,6 +3051,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter index 3f2fb5857276cc..6a2b4649a021c0 100644 --- a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter +++ b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter @@ -704,7 +704,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ @@ -1217,9 +1223,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster AdministratorCommissioning { diff --git a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.zap b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.zap index 81b7dd94bb90f1..401800be09fd61 100644 --- a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.zap +++ b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.zap @@ -1172,6 +1172,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1345,7 +1361,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3132,6 +3148,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter b/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter index 1c026bb8c31c30..2742d918b4aa9d 100644 --- a/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter +++ b/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter @@ -891,7 +891,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ @@ -1348,9 +1354,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster AdministratorCommissioning { diff --git a/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.zap b/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.zap index ac52e9a00e295e..bb3717d00bda33 100644 --- a/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.zap +++ b/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.zap @@ -1172,6 +1172,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1345,7 +1361,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3069,6 +3085,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter index 5fc393ff48f607..c2a65154372e18 100644 --- a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter +++ b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter @@ -951,7 +951,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1380,9 +1386,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.zap b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.zap index dd5e63a06d5bfd..b5d0e9eeb514f5 100644 --- a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.zap +++ b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.zap @@ -1543,6 +1543,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1716,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3158,6 +3174,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter index 8eb9c77b6fc45e..7c3771e7222915 100644 --- a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter +++ b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter @@ -882,7 +882,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1324,9 +1330,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.zap b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.zap index 28e1691e0d9387..0c4c5c17c371f9 100644 --- a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.zap +++ b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.zap @@ -1543,6 +1543,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1716,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2827,7 +2843,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -2843,7 +2859,7 @@ "code": 1, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -2859,7 +2875,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -2970,6 +2986,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter index 73d5d7df7262a2..d4bd76b4f7a695 100644 --- a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter +++ b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter @@ -876,7 +876,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1369,7 +1375,7 @@ client cluster TemperatureMeasurement = 1026 { readonly attribute nullable temperature measuredValue = 0; readonly attribute nullable temperature minMeasuredValue = 1; readonly attribute nullable temperature maxMeasuredValue = 2; - readonly attribute optional temperature tolerance = 3; + readonly attribute optional int16u tolerance = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1573,9 +1579,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.zap b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.zap index fc6192274b30ac..42a23375c9ec67 100644 --- a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.zap +++ b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.zap @@ -1543,6 +1543,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1716,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3801,6 +3817,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter index 7a1f5a750e1747..7b2e347b0ed662 100644 --- a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter +++ b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter @@ -876,7 +876,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1449,9 +1455,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.zap b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.zap index 981a417a84f735..992590ceb2d483 100644 --- a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.zap +++ b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.zap @@ -1543,6 +1543,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1716,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3462,6 +3478,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/template.zap b/examples/chef/devices/template.zap index 0f7cf1a1d63a13..87c7e61ab964d9 100644 --- a/examples/chef/devices/template.zap +++ b/examples/chef/devices/template.zap @@ -1172,6 +1172,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1345,7 +1361,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2772,6 +2788,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/sample_app_util/test_files/sample_zap_file.zap b/examples/chef/sample_app_util/test_files/sample_zap_file.zap index eff6a00671d5b0..1359eea30b9791 100644 --- a/examples/chef/sample_app_util/test_files/sample_zap_file.zap +++ b/examples/chef/sample_app_util/test_files/sample_zap_file.zap @@ -1830,7 +1830,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter index 2d0308f0c81741..847c827d4fe086 100644 --- a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter +++ b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter @@ -863,7 +863,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1646,9 +1652,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.zap b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.zap index 0fa6b11ed229eb..5d739897104e04 100644 --- a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.zap +++ b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.zap @@ -1683,6 +1683,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1856,7 +1872,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4698,6 +4714,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/darwin-framework-tool/templates/commands.zapt b/examples/darwin-framework-tool/templates/commands.zapt index 9d1c98e1d1d06f..241a75bd33ecc6 100644 --- a/examples/darwin-framework-tool/templates/commands.zapt +++ b/examples/darwin-framework-tool/templates/commands.zapt @@ -312,10 +312,10 @@ public: {{/if}} {{/if}} {{/zcl_attributes_server}} -{{/if}} {{#if (isProvisional (asUpperCamelCase name preserveAcronyms=true))}} #endif // MTR_ENABLE_PROVISIONAL {{/if}} +{{/if}} {{/zcl_clusters}} /*----------------------------------------------------------------------------*\ diff --git a/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter b/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter index 1cac116c4efef6..fa10fd83dd7c77 100644 --- a/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter +++ b/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter @@ -719,7 +719,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1270,9 +1276,11 @@ endpoint 0 { callback attribute acceptedCommandList default = 0; callback attribute attributeList default = 0; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster WiFiNetworkDiagnostics { diff --git a/examples/dishwasher-app/dishwasher-common/dishwasher-app.zap b/examples/dishwasher-app/dishwasher-common/dishwasher-app.zap index 35e670751458f5..6296916227604a 100644 --- a/examples/dishwasher-app/dishwasher-common/dishwasher-app.zap +++ b/examples/dishwasher-app/dishwasher-common/dishwasher-app.zap @@ -1926,6 +1926,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -2147,7 +2163,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3903,6 +3919,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/light-switch-app/light-switch-common/light-switch-app.matter b/examples/light-switch-app/light-switch-common/light-switch-app.matter index f8962a2ac437d7..868aa36967f642 100644 --- a/examples/light-switch-app/light-switch-common/light-switch-app.matter +++ b/examples/light-switch-app/light-switch-common/light-switch-app.matter @@ -166,6 +166,10 @@ server cluster Groups = 4 { /** Attributes and commands for scene configuration and manipulation. */ provisional client cluster Scenes = 5 { + bitmap CopyModeBitmap : bitmap8 { + kCopyAllScenes = 0x1; + } + bitmap Feature : bitmap32 { kSceneNames = 0x1; kExplicit = 0x2; @@ -173,8 +177,8 @@ provisional client cluster Scenes = 5 { kFabricScenes = 0x8; } - bitmap ScenesCopyMode : bitmap8 { - kCopyAllScenes = 0x1; + bitmap NameSupportBitmap : bitmap8 { + kSceneNames = 0x80; } struct AttributeValuePair { @@ -191,7 +195,7 @@ provisional client cluster Scenes = 5 { readonly attribute int8u currentScene = 1; readonly attribute group_id currentGroup = 2; readonly attribute boolean sceneValid = 3; - readonly attribute bitmap8 nameSupport = 4; + readonly attribute NameSupportBitmap nameSupport = 4; readonly attribute optional nullable node_id lastConfiguredBy = 5; readonly attribute int16u sceneTableSize = 6; readonly attribute int8u remainingCapacity = 7; @@ -307,7 +311,7 @@ provisional client cluster Scenes = 5 { } request struct CopySceneRequest { - ScenesCopyMode mode = 0; + CopyModeBitmap mode = 0; group_id groupIdentifierFrom = 1; int8u sceneIdentifierFrom = 2; group_id groupIdentifierTo = 3; @@ -1177,7 +1181,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -2459,9 +2469,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/light-switch-app/light-switch-common/light-switch-app.zap b/examples/light-switch-app/light-switch-common/light-switch-app.zap index a92321ae63ca0c..9d57c838c576ee 100644 --- a/examples/light-switch-app/light-switch-common/light-switch-app.zap +++ b/examples/light-switch-app/light-switch-common/light-switch-app.zap @@ -1601,6 +1601,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1774,7 +1790,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5832,6 +5848,5 @@ "endpointId": 2, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter index 8ab0257efa2b41..7a3be88505e300 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter @@ -1034,7 +1034,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1797,9 +1803,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.zap b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.zap index 3fbf144422e576..83336230621679 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.zap +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.zap @@ -1437,6 +1437,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1610,7 +1626,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4277,6 +4293,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter index f7bb7e5544d04e..3475808b741751 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter @@ -1034,7 +1034,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1929,9 +1935,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap index cb06c41a042700..61d2547e67729e 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap @@ -1543,6 +1543,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1716,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5253,6 +5269,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter index 98e9f875aebe99..c389aafb01efc5 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter @@ -1034,7 +1034,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1839,9 +1845,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap index c24ec8d3bc8eaf..d0caac0d852db9 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap @@ -1543,6 +1543,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1716,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4460,6 +4476,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index f39d6580d31f65..7874b41f683300 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -118,6 +118,10 @@ server cluster Groups = 4 { /** Attributes and commands for scene configuration and manipulation. */ provisional server cluster Scenes = 5 { + bitmap CopyModeBitmap : bitmap8 { + kCopyAllScenes = 0x1; + } + bitmap Feature : bitmap32 { kSceneNames = 0x1; kExplicit = 0x2; @@ -125,8 +129,8 @@ provisional server cluster Scenes = 5 { kFabricScenes = 0x8; } - bitmap ScenesCopyMode : bitmap8 { - kCopyAllScenes = 0x1; + bitmap NameSupportBitmap : bitmap8 { + kSceneNames = 0x80; } struct AttributeValuePair { @@ -143,7 +147,7 @@ provisional server cluster Scenes = 5 { readonly attribute int8u currentScene = 1; readonly attribute group_id currentGroup = 2; readonly attribute boolean sceneValid = 3; - readonly attribute bitmap8 nameSupport = 4; + readonly attribute NameSupportBitmap nameSupport = 4; readonly attribute nullable node_id lastConfiguredBy = 5; readonly attribute int16u sceneTableSize = 6; readonly attribute int8u remainingCapacity = 7; @@ -205,7 +209,7 @@ provisional server cluster Scenes = 5 { } request struct CopySceneRequest { - ScenesCopyMode mode = 0; + CopyModeBitmap mode = 0; group_id groupIdentifierFrom = 1; int8u sceneIdentifierFrom = 2; group_id groupIdentifierTo = 3; @@ -1181,7 +1185,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -2255,9 +2265,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/lighting-app/lighting-common/lighting-app.zap b/examples/lighting-app/lighting-common/lighting-app.zap index c4f3572ec96857..cb6181d2277fd6 100644 --- a/examples/lighting-app/lighting-common/lighting-app.zap +++ b/examples/lighting-app/lighting-common/lighting-app.zap @@ -1543,6 +1543,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1716,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5976,6 +5992,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/lighting-app/nxp/zap/lighting-on-off.matter b/examples/lighting-app/nxp/zap/lighting-on-off.matter index 879cdadd19a22f..4ac1ee3eca2f63 100644 --- a/examples/lighting-app/nxp/zap/lighting-on-off.matter +++ b/examples/lighting-app/nxp/zap/lighting-on-off.matter @@ -901,6 +901,7 @@ server cluster GeneralDiagnostics = 51 { readonly attribute NetworkInterface networkInterfaces[] = 0; readonly attribute int16u rebootCount = 1; + readonly attribute int64u upTime = 2; readonly attribute boolean testEventTriggersEnabled = 8; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -914,7 +915,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1442,11 +1449,14 @@ endpoint 0 { emits event BootReason; callback attribute networkInterfaces; callback attribute rebootCount default = 0x0000; + callback attribute upTime default = 0x0000000000000000; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/lighting-app/nxp/zap/lighting-on-off.zap b/examples/lighting-app/nxp/zap/lighting-on-off.zap index 4da6db3bf6d93b..fd414f8267f4c5 100644 --- a/examples/lighting-app/nxp/zap/lighting-on-off.zap +++ b/examples/lighting-app/nxp/zap/lighting-on-off.zap @@ -1191,6 +1191,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1226,6 +1242,22 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "UpTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "TestEventTriggersEnabled", "code": 8, @@ -1268,7 +1300,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3930,6 +3962,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/lighting-app/qpg/args.gni b/examples/lighting-app/qpg/args.gni index e19f57f7d483d6..ea22dfd187fbb2 100644 --- a/examples/lighting-app/qpg/args.gni +++ b/examples/lighting-app/qpg/args.gni @@ -29,8 +29,6 @@ chip_stack_lock_tracking = "none" matter_device_vid = "0xFFF1" matter_device_pid = "0x8005" -matter_device_software_version = "0x0001" -matter_device_software_version_string = "1.0" pw_log_BACKEND = "${chip_root}/src/lib/support/pw_log_chip" pw_assert_BACKEND = "$dir_pw_assert_log:check_backend" diff --git a/examples/lighting-app/qpg/src/AppTask.cpp b/examples/lighting-app/qpg/src/AppTask.cpp index c4fe7ff0c06e91..5781e4069ad1eb 100644 --- a/examples/lighting-app/qpg/src/AppTask.cpp +++ b/examples/lighting-app/qpg/src/AppTask.cpp @@ -257,15 +257,23 @@ void AppTask::InitServer(intptr_t arg) // Open commissioning after boot if no fabric was available if (chip::Server::GetInstance().GetFabricTable().FabricCount() == 0) { - PlatformMgr().ScheduleWork(OpenCommissioning, 0); + ChipLogProgress(NotSpecified, "No fabrics, starting commissioning."); + AppTask::OpenCommissioning((intptr_t) 0); } } void AppTask::OpenCommissioning(intptr_t arg) { // Enable BLE advertisements - chip::Server::GetInstance().GetCommissioningWindowManager().OpenBasicCommissioningWindow(); - ChipLogProgress(NotSpecified, "BLE advertising started. Waiting for Pairing."); + + SystemLayer().ScheduleLambda([] { + CHIP_ERROR err; + err = chip::Server::GetInstance().GetCommissioningWindowManager().OpenBasicCommissioningWindow(); + if (err == CHIP_NO_ERROR) + { + ChipLogProgress(NotSpecified, "BLE advertising started. Waiting for Pairing."); + } + }); } CHIP_ERROR AppTask::Init() @@ -486,10 +494,8 @@ void AppTask::FunctionHandler(AppEvent * aEvent) else { // Enable BLE advertisements and pairing window - if (chip::Server::GetInstance().GetCommissioningWindowManager().OpenBasicCommissioningWindow() == CHIP_NO_ERROR) - { - ChipLogProgress(NotSpecified, "BLE advertising started. Waiting for Pairing."); - } + AppTask::OpenCommissioning((intptr_t) 0); + ChipLogProgress(NotSpecified, "BLE advertising started. Waiting for Pairing."); } } else if (sAppTask.mFunctionTimerActive && sAppTask.mFunction == kFunction_SoftwareUpdate) diff --git a/examples/lighting-app/qpg/zap/light.matter b/examples/lighting-app/qpg/zap/light.matter index 7c055058372faf..61efe83c64c161 100644 --- a/examples/lighting-app/qpg/zap/light.matter +++ b/examples/lighting-app/qpg/zap/light.matter @@ -206,9 +206,6 @@ server cluster LevelControl = 8 { readonly attribute int16u remainingTime = 1; readonly attribute int8u minLevel = 2; readonly attribute int8u maxLevel = 3; - readonly attribute int16u currentFrequency = 4; - readonly attribute int16u minFrequency = 5; - readonly attribute int16u maxFrequency = 6; attribute LevelControlOptions options = 15; attribute nullable int8u onLevel = 17; attribute access(write: manage) nullable int8u startUpCurrentLevel = 16384; @@ -957,7 +954,6 @@ server cluster GeneralDiagnostics = 51 { readonly attribute NetworkInterface networkInterfaces[] = 0; readonly attribute int16u rebootCount = 1; readonly attribute int64u upTime = 2; - readonly attribute int32u totalOperationalHours = 3; readonly attribute BootReasonEnum bootReason = 4; readonly attribute HardwareFaultEnum activeHardwareFaults[] = 5; readonly attribute RadioFaultEnum activeRadioFaults[] = 6; @@ -975,7 +971,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1867,7 +1869,6 @@ endpoint 0 { callback attribute networkInterfaces; callback attribute rebootCount default = 0x0000; callback attribute upTime default = 0x0000000000000000; - callback attribute totalOperationalHours default = 0x00000000; callback attribute bootReason; callback attribute activeHardwareFaults; callback attribute activeRadioFaults; @@ -1877,9 +1878,11 @@ endpoint 0 { callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { @@ -2107,9 +2110,6 @@ endpoint 1 { ram attribute remainingTime default = 0x0000; ram attribute minLevel default = 0x01; ram attribute maxLevel default = 0xFE; - ram attribute currentFrequency default = 0x0000; - ram attribute minFrequency default = 0x0000; - ram attribute maxFrequency default = 0x0000; ram attribute options default = 0x00; ram attribute onLevel default = 0xFF; persist attribute startUpCurrentLevel default = 255; @@ -2141,24 +2141,6 @@ endpoint 1 { callback attribute clusterRevision default = 1; } - server cluster FixedLabel { - callback attribute labelList; - callback attribute generatedCommandList; - callback attribute acceptedCommandList; - callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - - server cluster UserLabel { - callback attribute labelList; - callback attribute generatedCommandList; - callback attribute acceptedCommandList; - callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - server cluster ColorControl { ram attribute currentHue default = 0x00; ram attribute currentSaturation default = 0x00; diff --git a/examples/lighting-app/qpg/zap/light.zap b/examples/lighting-app/qpg/zap/light.zap index ffd306791f7f40..897774c9d8167a 100644 --- a/examples/lighting-app/qpg/zap/light.zap +++ b/examples/lighting-app/qpg/zap/light.zap @@ -1715,6 +1715,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1766,22 +1782,6 @@ "maxInterval": 65534, "reportableChange": 0 }, - { - "name": "TotalOperationalHours", - "code": 3, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00000000", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, { "name": "BootReason", "code": 4, @@ -1936,7 +1936,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4777,54 +4777,6 @@ "maxInterval": 65534, "reportableChange": 0 }, - { - "name": "CurrentFrequency", - "code": 4, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "MinFrequency", - "code": 5, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "MaxFrequency", - "code": 6, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, { "name": "Options", "code": 15, @@ -5109,218 +5061,6 @@ } ] }, - { - "name": "Fixed Label", - "code": 64, - "mfgCode": null, - "define": "FIXED_LABEL_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "LabelList", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "GeneratedCommandList", - "code": 65528, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AcceptedCommandList", - "code": 65529, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AttributeList", - "code": 65531, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, - { - "name": "User Label", - "code": 65, - "mfgCode": null, - "define": "USER_LABEL_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "LabelList", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "GeneratedCommandList", - "code": 65528, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AcceptedCommandList", - "code": 65529, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AttributeList", - "code": 65531, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, { "name": "Color Control", "code": 768, @@ -6207,6 +5947,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter index 31c6acf21d6c38..8c228875e3e8eb 100644 --- a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter @@ -118,6 +118,10 @@ server cluster Groups = 4 { /** Attributes and commands for scene configuration and manipulation. */ provisional server cluster Scenes = 5 { + bitmap CopyModeBitmap : bitmap8 { + kCopyAllScenes = 0x1; + } + bitmap Feature : bitmap32 { kSceneNames = 0x1; kExplicit = 0x2; @@ -125,8 +129,8 @@ provisional server cluster Scenes = 5 { kFabricScenes = 0x8; } - bitmap ScenesCopyMode : bitmap8 { - kCopyAllScenes = 0x1; + bitmap NameSupportBitmap : bitmap8 { + kSceneNames = 0x80; } struct AttributeValuePair { @@ -143,7 +147,7 @@ provisional server cluster Scenes = 5 { readonly attribute int8u currentScene = 1; readonly attribute group_id currentGroup = 2; readonly attribute boolean sceneValid = 3; - readonly attribute bitmap8 nameSupport = 4; + readonly attribute NameSupportBitmap nameSupport = 4; readonly attribute nullable node_id lastConfiguredBy = 5; readonly attribute int16u sceneTableSize = 6; readonly attribute int8u remainingCapacity = 7; @@ -205,7 +209,7 @@ provisional server cluster Scenes = 5 { } request struct CopySceneRequest { - ScenesCopyMode mode = 0; + CopyModeBitmap mode = 0; group_id groupIdentifierFrom = 1; int8u sceneIdentifierFrom = 2; group_id groupIdentifierTo = 3; @@ -1438,7 +1442,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -2308,9 +2318,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/lighting-app/silabs/data_model/lighting-thread-app.zap b/examples/lighting-app/silabs/data_model/lighting-thread-app.zap index 00e4fc3dc68664..ba891a5419f952 100644 --- a/examples/lighting-app/silabs/data_model/lighting-thread-app.zap +++ b/examples/lighting-app/silabs/data_model/lighting-thread-app.zap @@ -1497,6 +1497,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1670,7 +1686,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5916,6 +5932,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter index 293faf071dbb16..144717de3cf5f4 100644 --- a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter @@ -118,6 +118,10 @@ server cluster Groups = 4 { /** Attributes and commands for scene configuration and manipulation. */ provisional server cluster Scenes = 5 { + bitmap CopyModeBitmap : bitmap8 { + kCopyAllScenes = 0x1; + } + bitmap Feature : bitmap32 { kSceneNames = 0x1; kExplicit = 0x2; @@ -125,8 +129,8 @@ provisional server cluster Scenes = 5 { kFabricScenes = 0x8; } - bitmap ScenesCopyMode : bitmap8 { - kCopyAllScenes = 0x1; + bitmap NameSupportBitmap : bitmap8 { + kSceneNames = 0x80; } struct AttributeValuePair { @@ -143,7 +147,7 @@ provisional server cluster Scenes = 5 { readonly attribute int8u currentScene = 1; readonly attribute group_id currentGroup = 2; readonly attribute boolean sceneValid = 3; - readonly attribute bitmap8 nameSupport = 4; + readonly attribute NameSupportBitmap nameSupport = 4; readonly attribute nullable node_id lastConfiguredBy = 5; readonly attribute int16u sceneTableSize = 6; readonly attribute int8u remainingCapacity = 7; @@ -205,7 +209,7 @@ provisional server cluster Scenes = 5 { } request struct CopySceneRequest { - ScenesCopyMode mode = 0; + CopyModeBitmap mode = 0; group_id groupIdentifierFrom = 1; int8u sceneIdentifierFrom = 2; group_id groupIdentifierTo = 3; @@ -1417,7 +1421,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -2198,9 +2208,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/lighting-app/silabs/data_model/lighting-wifi-app.zap b/examples/lighting-app/silabs/data_model/lighting-wifi-app.zap index 76f4fde26b1b09..2af72278d94d61 100644 --- a/examples/lighting-app/silabs/data_model/lighting-wifi-app.zap +++ b/examples/lighting-app/silabs/data_model/lighting-wifi-app.zap @@ -1497,6 +1497,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1670,7 +1686,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5092,6 +5108,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/lock-app/lock-common/lock-app.matter b/examples/lock-app/lock-common/lock-app.matter index b3f6f1c74593a3..ea7d73c4282cb2 100644 --- a/examples/lock-app/lock-common/lock-app.matter +++ b/examples/lock-app/lock-common/lock-app.matter @@ -1100,7 +1100,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -2516,9 +2522,11 @@ endpoint 0 { callback attribute eventList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/lock-app/lock-common/lock-app.zap b/examples/lock-app/lock-common/lock-app.zap index e079f41ed81adf..82c7bbe7268baf 100644 --- a/examples/lock-app/lock-common/lock-app.zap +++ b/examples/lock-app/lock-common/lock-app.zap @@ -2284,6 +2284,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -2521,7 +2537,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -6644,6 +6660,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/lock-app/nxp/zap/lock-app.matter b/examples/lock-app/nxp/zap/lock-app.matter index 9b030c237fb074..9481cb27c858d3 100644 --- a/examples/lock-app/nxp/zap/lock-app.matter +++ b/examples/lock-app/nxp/zap/lock-app.matter @@ -519,6 +519,7 @@ server cluster GeneralDiagnostics = 51 { readonly attribute NetworkInterface networkInterfaces[] = 0; readonly attribute int16u rebootCount = 1; + readonly attribute int64u upTime = 2; readonly attribute boolean testEventTriggersEnabled = 8; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -532,7 +533,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1515,11 +1522,14 @@ endpoint 0 { emits event BootReason; callback attribute networkInterfaces; callback attribute rebootCount default = 0x0000; + callback attribute upTime default = 0x0000000000000000; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/lock-app/nxp/zap/lock-app.zap b/examples/lock-app/nxp/zap/lock-app.zap index 103c17087eccfd..b672e0c2b5a7ec 100644 --- a/examples/lock-app/nxp/zap/lock-app.zap +++ b/examples/lock-app/nxp/zap/lock-app.zap @@ -984,6 +984,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1019,6 +1035,22 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "UpTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "TestEventTriggersEnabled", "code": 8, @@ -1061,7 +1093,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3393,6 +3425,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/lock-app/qpg/args.gni b/examples/lock-app/qpg/args.gni index 9a51da863c921f..d5dcdfe217c635 100644 --- a/examples/lock-app/qpg/args.gni +++ b/examples/lock-app/qpg/args.gni @@ -22,6 +22,7 @@ qpg_sdk_target = get_label_info(":sdk", "label_no_toolchain") chip_enable_ota_requestor = true chip_openthread_ftd = false enable_sleepy_device = true +chip_enable_icd_server = true # Disable lock tracking, since our FreeRTOS configuration does not set # INCLUDE_xSemaphoreGetMutexHolder @@ -29,8 +30,6 @@ chip_stack_lock_tracking = "none" matter_device_vid = "0xFFF1" matter_device_pid = "0x8006" -matter_device_software_version = "0x0001" -matter_device_software_version_string = "1.0" pw_log_BACKEND = "${chip_root}/src/lib/support/pw_log_chip" pw_assert_BACKEND = "$dir_pw_assert_log:check_backend" diff --git a/examples/lock-app/qpg/include/AppConfig.h b/examples/lock-app/qpg/include/AppConfig.h index 2f2cb7cd385cf3..b5947d8641bad6 100644 --- a/examples/lock-app/qpg/include/AppConfig.h +++ b/examples/lock-app/qpg/include/AppConfig.h @@ -23,6 +23,7 @@ #define APP_TASK_NAME "APP" #define APP_LOCK_BUTTON BTN_SW4 #define APP_FUNCTION_BUTTON BTN_SW5 +#define APP_LOCK_JAMMED_BUTTON BTN_SW1 #define SYSTEM_STATE_LED LED_GREEN #define LOCK_STATE_LED LED_WHITE diff --git a/examples/lock-app/qpg/include/AppTask.h b/examples/lock-app/qpg/include/AppTask.h index 3219c5676036f9..3734eeadeef816 100644 --- a/examples/lock-app/qpg/include/AppTask.h +++ b/examples/lock-app/qpg/include/AppTask.h @@ -66,6 +66,7 @@ class AppTask static void FunctionTimerEventHandler(AppEvent * aEvent); static void FunctionHandler(AppEvent * aEvent); static void LockActionEventHandler(AppEvent * aEvent); + static void JammedLockEventHandler(AppEvent * aEvent); static void TimerEventHandler(chip::System::Layer * aLayer, void * aAppState); static void MatterEventHandler(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg); @@ -86,6 +87,7 @@ class AppTask Function_t mFunction; bool mFunctionTimerActive; bool mSyncClusterToButtonAction; + bool mNotifyState; chip::DeviceLayer::FactoryDataProvider mFactoryDataProvider; diff --git a/examples/lock-app/qpg/include/BoltLockManager.h b/examples/lock-app/qpg/include/BoltLockManager.h index c80e3555fc8d3d..0afef972db93b4 100644 --- a/examples/lock-app/qpg/include/BoltLockManager.h +++ b/examples/lock-app/qpg/include/BoltLockManager.h @@ -65,8 +65,6 @@ class BoltLockManager CHIP_ERROR Init(); bool IsUnlocked(); - void EnableAutoRelock(bool aOn); - void SetAutoLockDuration(uint32_t aDurationInSecs); bool IsActionInProgress(); bool InitiateAction(int32_t aActor, Action_t aAction); @@ -92,15 +90,10 @@ class BoltLockManager Callback_fn_initiated mActionInitiated_CB; Callback_fn_completed mActionCompleted_CB; - bool mAutoRelock; - uint32_t mAutoLockDuration; - bool mAutoLockTimerArmed; - void CancelTimer(void); void StartTimer(uint32_t aTimeoutMs); static void TimerEventHandler(TimerHandle_t xTimer); - static void AutoReLockTimerEventHandler(AppEvent * aEvent); static void ActuatorMovementTimerEventHandler(AppEvent * aEvent); static BoltLockManager sLock; diff --git a/examples/lock-app/qpg/src/AppTask.cpp b/examples/lock-app/qpg/src/AppTask.cpp index 3466d8c4a4c395..8bbd6b7ce19a8a 100644 --- a/examples/lock-app/qpg/src/AppTask.cpp +++ b/examples/lock-app/qpg/src/AppTask.cpp @@ -260,6 +260,23 @@ void AppTask::AppTaskMain(void * pvParameter) } } +void AppTask::JammedLockEventHandler(AppEvent * aEvent) +{ + SystemLayer().ScheduleLambda([] { + bool retVal; + + retVal = DoorLockServer::Instance().SendLockAlarmEvent(QPG_LOCK_ENDPOINT_ID, AlarmCodeEnum::kLockJammed); + if (!retVal) + { + ChipLogProgress(NotSpecified, "[BTN] Lock jammed event send failed"); + } + else + { + ChipLogProgress(NotSpecified, "[BTN] Lock jammed event sent"); + } + }); +} + void AppTask::LockActionEventHandler(AppEvent * aEvent) { bool initiated = false; @@ -302,7 +319,7 @@ void AppTask::LockActionEventHandler(AppEvent * aEvent) void AppTask::ButtonEventHandler(uint8_t btnIdx, bool btnPressed) { - if (btnIdx != APP_LOCK_BUTTON && btnIdx != APP_FUNCTION_BUTTON) + if (btnIdx != APP_LOCK_BUTTON && btnIdx != APP_FUNCTION_BUTTON && btnIdx != APP_LOCK_JAMMED_BUTTON) { return; } @@ -316,6 +333,10 @@ void AppTask::ButtonEventHandler(uint8_t btnIdx, bool btnPressed) { button_event.Handler = LockActionEventHandler; } + else if (btnIdx == APP_LOCK_JAMMED_BUTTON && btnPressed == true) + { + button_event.Handler = JammedLockEventHandler; + } else if (btnIdx == APP_FUNCTION_BUTTON) { // Hand off to Functionality handler - depends on duration of press @@ -511,6 +532,11 @@ void AppTask::ActionInitiated(BoltLockManager::Action_t aAction, int32_t aActor) sAppTask.mSyncClusterToButtonAction = true; } + if (aActor == AppEvent::kEventType_Lock) + { + sAppTask.mNotifyState = true; + } + qvIO_LedBlink(LOCK_STATE_LED, 50, 50); } @@ -532,10 +558,11 @@ void AppTask::ActionCompleted(BoltLockManager::Action_t aAction) qvIO_LedSet(LOCK_STATE_LED, false); } - if (sAppTask.mSyncClusterToButtonAction) + if (sAppTask.mSyncClusterToButtonAction || sAppTask.mNotifyState) { sAppTask.UpdateClusterState(); sAppTask.mSyncClusterToButtonAction = false; + sAppTask.mNotifyState = false; } } @@ -585,6 +612,7 @@ void AppTask::UpdateClusterState(void) auto newValue = BoltLockMgr().IsUnlocked() ? DoorLock::DlLockState::kUnlocked : DoorLock::DlLockState::kLocked; SystemLayer().ScheduleLambda([newValue] { + bool retVal = true; chip::app::DataModel::Nullable currentLockState; chip::app::Clusters::DoorLock::Attributes::LockState::Get(QPG_LOCK_ENDPOINT_ID, currentLockState); @@ -599,7 +627,17 @@ void AppTask::UpdateClusterState(void) else { ChipLogProgress(NotSpecified, "Updating LockState attribute"); - if (!DoorLockServer::Instance().SetLockState(QPG_LOCK_ENDPOINT_ID, newValue)) + if (sAppTask.mSyncClusterToButtonAction) + { + retVal = DoorLockServer::Instance().SetLockState(QPG_LOCK_ENDPOINT_ID, newValue, OperationSourceEnum::kManual); + } + + if (retVal && sAppTask.mNotifyState) + { + retVal = DoorLockServer::Instance().SetLockState(QPG_LOCK_ENDPOINT_ID, newValue, OperationSourceEnum::kRemote); + } + + if (!retVal) { ChipLogError(NotSpecified, "ERR: updating DoorLock"); } diff --git a/examples/lock-app/qpg/src/BoltLockManager.cpp b/examples/lock-app/qpg/src/BoltLockManager.cpp index 44bb81abaebdc8..e06c34535238c7 100644 --- a/examples/lock-app/qpg/src/BoltLockManager.cpp +++ b/examples/lock-app/qpg/src/BoltLockManager.cpp @@ -58,10 +58,7 @@ CHIP_ERROR BoltLockManager::Init() return APP_ERROR_CREATE_TIMER_FAILED; } - mState = kState_LockingCompleted; - mAutoLockTimerArmed = false; - mAutoRelock = false; - mAutoLockDuration = 0; + mState = kState_LockingCompleted; return CHIP_NO_ERROR; } @@ -82,16 +79,6 @@ bool BoltLockManager::IsUnlocked() return (mState == kState_UnlockingCompleted); } -void BoltLockManager::EnableAutoRelock(bool aOn) -{ - mAutoRelock = aOn; -} - -void BoltLockManager::SetAutoLockDuration(uint32_t aDurationInSecs) -{ - mAutoLockDuration = aDurationInSecs; -} - bool BoltLockManager::GetUser(uint16_t userIndex, EmberAfPluginDoorLockUserInfo & user) const { user = mUsers[userIndex - 1]; @@ -224,15 +211,6 @@ bool BoltLockManager::InitiateAction(int32_t aActor, Action_t aAction) if (action_initiated) { - if (mAutoLockTimerArmed && new_state == kState_LockingInitiated) - { - // If auto lock timer has been armed and someone initiates locking, - // cancel the timer and continue as normal. - mAutoLockTimerArmed = false; - - CancelTimer(); - } - StartTimer(ACTUATOR_MOVEMENT_PERIOS_MS); // Since the timer started successfully, update the state and trigger callback @@ -285,35 +263,10 @@ void BoltLockManager::TimerEventHandler(TimerHandle_t xTimer) AppEvent event; event.Type = AppEvent::kEventType_Timer; event.TimerEvent.Context = lock; - if (lock->mAutoLockTimerArmed) - { - event.Handler = AutoReLockTimerEventHandler; - } - else - { - event.Handler = ActuatorMovementTimerEventHandler; - } + event.Handler = ActuatorMovementTimerEventHandler; GetAppTask().PostEvent(&event); } -void BoltLockManager::AutoReLockTimerEventHandler(AppEvent * aEvent) -{ - BoltLockManager * lock = static_cast(aEvent->TimerEvent.Context); - int32_t actor = 0; - - // Make sure auto lock timer is still armed. - if (!lock->mAutoLockTimerArmed) - { - return; - } - - lock->mAutoLockTimerArmed = false; - - ChipLogProgress(NotSpecified, "Auto Re-Lock has been triggered!"); - - lock->InitiateAction(actor, LOCK_ACTION); -} - void BoltLockManager::ActuatorMovementTimerEventHandler(AppEvent * aEvent) { Action_t actionCompleted = INVALID_ACTION; @@ -337,16 +290,5 @@ void BoltLockManager::ActuatorMovementTimerEventHandler(AppEvent * aEvent) { lock->mActionCompleted_CB(actionCompleted); } - - if (lock->mAutoRelock && actionCompleted == UNLOCK_ACTION) - { - // Start the timer for auto relock - lock->StartTimer(lock->mAutoLockDuration * 1000); - - lock->mAutoLockTimerArmed = true; - - ChipLogProgress(NotSpecified, "Auto Re-lock enabled. Will be triggered in %" PRIu32 " seconds", - lock->mAutoLockDuration); - } } } diff --git a/examples/lock-app/qpg/src/ZclCallbacks.cpp b/examples/lock-app/qpg/src/ZclCallbacks.cpp index 25a06b533c5cad..51751c43ed4058 100644 --- a/examples/lock-app/qpg/src/ZclCallbacks.cpp +++ b/examples/lock-app/qpg/src/ZclCallbacks.cpp @@ -40,10 +40,10 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & switch (*value) { case to_underlying(DlLockState::kLocked): - BoltLockMgr().InitiateAction(0, BoltLockManager::LOCK_ACTION); + // BoltLockMgr().InitiateAction(0, BoltLockManager::LOCK_ACTION); break; case to_underlying(DlLockState::kUnlocked): - BoltLockMgr().InitiateAction(0, BoltLockManager::UNLOCK_ACTION); + // BoltLockMgr().InitiateAction(0, BoltLockManager::UNLOCK_ACTION); break; default: break; @@ -82,9 +82,11 @@ bool emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, const N { bool returnValue = false; + ChipLogProgress(Zcl, "Door Lock App: Lock Command endpoint=%d", endpointId); + if (BoltLockMgr().ValidatePIN(pinCode, err)) { - BoltLockMgr().InitiateAction(0, BoltLockManager::LOCK_ACTION); + BoltLockMgr().InitiateAction(AppEvent::kEventType_Lock, BoltLockManager::LOCK_ACTION); returnValue = true; } @@ -97,9 +99,11 @@ bool emberAfPluginDoorLockOnDoorUnlockCommand(chip::EndpointId endpointId, const { bool returnValue = false; + ChipLogProgress(Zcl, "Door Lock App: UnLock Command endpoint=%d", endpointId); + if (BoltLockMgr().ValidatePIN(pinCode, err)) { - BoltLockMgr().InitiateAction(0, BoltLockManager::UNLOCK_ACTION); + BoltLockMgr().InitiateAction(AppEvent::kEventType_Lock, BoltLockManager::UNLOCK_ACTION); returnValue = true; } @@ -123,3 +127,9 @@ void emberAfDoorLockClusterInitCallback(EndpointId endpoint) logOnFailure(DoorLock::Attributes::NumberOfCredentialsSupportedPerUser::Set(endpoint, CONFIG_LOCK_NUM_CREDENTIALS_PER_USER), "number of credentials per user"); } + +void emberAfPluginDoorLockOnAutoRelock(chip::EndpointId endpointId) +{ + // Apply the relock state in the application control + BoltLockMgr().InitiateAction(AppEvent::kEventType_Timer, BoltLockManager::LOCK_ACTION); +} diff --git a/examples/lock-app/qpg/zap/lock.matter b/examples/lock-app/qpg/zap/lock.matter index 5b67875cce9279..bb64f66facd5b1 100644 --- a/examples/lock-app/qpg/zap/lock.matter +++ b/examples/lock-app/qpg/zap/lock.matter @@ -790,7 +790,6 @@ server cluster GeneralDiagnostics = 51 { readonly attribute NetworkInterface networkInterfaces[] = 0; readonly attribute int16u rebootCount = 1; readonly attribute int64u upTime = 2; - readonly attribute int32u totalOperationalHours = 3; readonly attribute BootReasonEnum bootReason = 4; readonly attribute HardwareFaultEnum activeHardwareFaults[] = 5; readonly attribute RadioFaultEnum activeRadioFaults[] = 6; @@ -808,7 +807,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1271,6 +1276,51 @@ 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 Feature : bitmap32 { + kCheckInProtocolSupport = 0x1; + kUserActiveModeTrigger = 0x2; + kLongIdleTimeSupport = 0x4; + } + + bitmap UserActiveModeTriggerBitmap : bitmap32 { + kPowerCycle = 0x1; + kSettingsMenu = 0x2; + kCustomInstruction = 0x4; + kDeviceManual = 0x8; + kActuateSensor = 0x10; + kActuateSensorSeconds = 0x20; + kActuateSensorTimes = 0x40; + kActuateSensorLightsBlink = 0x80; + kResetButton = 0x100; + kResetButtonLightsBlink = 0x200; + kResetButtonSeconds = 0x400; + kResetButtonTimes = 0x800; + kSetupButton = 0x1000; + kSetupButtonSeconds = 0x2000; + kSetupButtonLightsBlink = 0x4000; + kSetupButtonTimes = 0x8000; + kAppDefinedButton = 0x10000; + } + + fabric_scoped struct MonitoringRegistrationStruct { + fabric_sensitive node_id checkInNodeID = 1; + fabric_sensitive int64u monitoredSubject = 2; + fabric_idx fabricIndex = 254; + } + + readonly attribute int32u idleModeDuration = 0; + readonly attribute int32u activeModeDuration = 1; + readonly attribute int16u activeModeThreshold = 2; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + /** An interface to a generic way to secure a door */ server cluster DoorLock = 257 { enum AlarmCodeEnum : enum8 { @@ -1901,7 +1951,6 @@ endpoint 0 { callback attribute networkInterfaces; callback attribute rebootCount default = 0x0000; callback attribute upTime default = 0x0000000000000000; - callback attribute totalOperationalHours default = 0x00000000; callback attribute bootReason; callback attribute activeHardwareFaults; callback attribute activeRadioFaults; @@ -1911,9 +1960,11 @@ endpoint 0 { callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { @@ -2078,6 +2129,18 @@ endpoint 0 { ram attribute featureMap default = 0; ram attribute clusterRevision default = 1; } + + server cluster IcdManagement { + callback attribute idleModeDuration default = 1; + callback attribute activeModeDuration default = 300; + callback attribute activeModeThreshold default = 300; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0x0001; + ram attribute clusterRevision default = 2; + } } endpoint 1 { device type ma_doorlock = 10, version 1; @@ -2128,24 +2191,6 @@ endpoint 1 { callback attribute clusterRevision default = 1; } - server cluster FixedLabel { - callback attribute labelList; - callback attribute generatedCommandList; - callback attribute acceptedCommandList; - callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - - server cluster UserLabel { - callback attribute labelList; - callback attribute generatedCommandList; - callback attribute acceptedCommandList; - callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - server cluster DoorLock { emits event DoorLockAlarm; emits event DoorStateChange; diff --git a/examples/lock-app/qpg/zap/lock.zap b/examples/lock-app/qpg/zap/lock.zap index e66ddc5a32eac5..ed241d2ab91866 100644 --- a/examples/lock-app/qpg/zap/lock.zap +++ b/examples/lock-app/qpg/zap/lock.zap @@ -1715,6 +1715,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1766,22 +1782,6 @@ "maxInterval": 65534, "reportableChange": 0 }, - { - "name": "TotalOperationalHours", - "code": 3, - "mfgCode": null, - "side": "server", - "type": "int32u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00000000", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, { "name": "BootReason", "code": 4, @@ -1936,7 +1936,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4061,6 +4061,160 @@ "reportableChange": 0 } ] + }, + { + "name": "ICD Management", + "code": 70, + "mfgCode": null, + "define": "ICD_MANAGEMENT_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "IdleModeDuration", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveModeDuration", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "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": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "300", + "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": "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": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] } ] }, @@ -4573,218 +4727,6 @@ } ] }, - { - "name": "Fixed Label", - "code": 64, - "mfgCode": null, - "define": "FIXED_LABEL_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "LabelList", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "GeneratedCommandList", - "code": 65528, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AcceptedCommandList", - "code": 65529, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AttributeList", - "code": 65531, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, - { - "name": "User Label", - "code": 65, - "mfgCode": null, - "define": "USER_LABEL_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "LabelList", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "GeneratedCommandList", - "code": 65528, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AcceptedCommandList", - "code": 65529, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AttributeList", - "code": 65531, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, { "name": "Door Lock", "code": 257, @@ -5268,6 +5210,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/log-source-app/log-source-common/log-source-app.zap b/examples/log-source-app/log-source-common/log-source-app.zap index 4be1a514aea258..f24d8dc8c4c007 100644 --- a/examples/log-source-app/log-source-common/log-source-app.zap +++ b/examples/log-source-app/log-source-common/log-source-app.zap @@ -737,6 +737,5 @@ "endpointId": 0, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter b/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter index e5187ffa74eefb..fe849962ec5103 100644 --- a/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter +++ b/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter @@ -706,7 +706,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ @@ -1110,9 +1116,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster AdministratorCommissioning { diff --git a/examples/ota-provider-app/ota-provider-common/ota-provider-app.zap b/examples/ota-provider-app/ota-provider-common/ota-provider-app.zap index 3776092d0b62dd..534246e46c8c30 100644 --- a/examples/ota-provider-app/ota-provider-common/ota-provider-app.zap +++ b/examples/ota-provider-app/ota-provider-common/ota-provider-app.zap @@ -1442,6 +1442,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1615,7 +1631,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2267,6 +2283,5 @@ "endpointId": 0, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter index 583331cd2a86ee..8b95001f4e391b 100644 --- a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter +++ b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter @@ -889,7 +889,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ @@ -1293,9 +1299,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster AdministratorCommissioning { diff --git a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.zap b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.zap index e36f3b95848231..fb1913ba066f28 100644 --- a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.zap +++ b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.zap @@ -1491,6 +1491,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1664,7 +1680,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3424,6 +3440,5 @@ "endpointId": 65534, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index 1040513cc7c557..9c8f973de9a8f1 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -166,6 +166,10 @@ server cluster Groups = 4 { /** Attributes and commands for scene configuration and manipulation. */ provisional server cluster Scenes = 5 { + bitmap CopyModeBitmap : bitmap8 { + kCopyAllScenes = 0x1; + } + bitmap Feature : bitmap32 { kSceneNames = 0x1; kExplicit = 0x2; @@ -173,8 +177,8 @@ provisional server cluster Scenes = 5 { kFabricScenes = 0x8; } - bitmap ScenesCopyMode : bitmap8 { - kCopyAllScenes = 0x1; + bitmap NameSupportBitmap : bitmap8 { + kSceneNames = 0x80; } struct AttributeValuePair { @@ -191,7 +195,7 @@ provisional server cluster Scenes = 5 { readonly attribute int8u currentScene = 1; readonly attribute group_id currentGroup = 2; readonly attribute boolean sceneValid = 3; - readonly attribute bitmap8 nameSupport = 4; + readonly attribute NameSupportBitmap nameSupport = 4; readonly attribute int16u sceneTableSize = 6; readonly attribute int8u remainingCapacity = 7; readonly attribute command_id generatedCommandList[] = 65528; @@ -1683,7 +1687,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -5173,7 +5183,7 @@ client cluster TemperatureMeasurement = 1026 { readonly attribute nullable temperature measuredValue = 0; readonly attribute nullable temperature minMeasuredValue = 1; readonly attribute nullable temperature maxMeasuredValue = 2; - readonly attribute optional temperature tolerance = 3; + readonly attribute optional int16u tolerance = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -5187,7 +5197,7 @@ server cluster TemperatureMeasurement = 1026 { readonly attribute nullable temperature measuredValue = 0; readonly attribute nullable temperature minMeasuredValue = 1; readonly attribute nullable temperature maxMeasuredValue = 2; - readonly attribute temperature tolerance = 3; + readonly attribute int16u tolerance = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -6734,9 +6744,11 @@ endpoint 0 { callback attribute eventList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/placeholder/linux/apps/app1/config.zap b/examples/placeholder/linux/apps/app1/config.zap index c1166d993338fd..a4822b8fe9da04 100644 --- a/examples/placeholder/linux/apps/app1/config.zap +++ b/examples/placeholder/linux/apps/app1/config.zap @@ -2599,6 +2599,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -2836,7 +2852,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -9030,7 +9046,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -9046,7 +9062,7 @@ "code": 1, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -9062,7 +9078,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -9078,7 +9094,7 @@ "code": 3, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -15189,6 +15205,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index a2662b804165b9..b6de3ec30f2df4 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -166,6 +166,10 @@ server cluster Groups = 4 { /** Attributes and commands for scene configuration and manipulation. */ provisional server cluster Scenes = 5 { + bitmap CopyModeBitmap : bitmap8 { + kCopyAllScenes = 0x1; + } + bitmap Feature : bitmap32 { kSceneNames = 0x1; kExplicit = 0x2; @@ -173,8 +177,8 @@ provisional server cluster Scenes = 5 { kFabricScenes = 0x8; } - bitmap ScenesCopyMode : bitmap8 { - kCopyAllScenes = 0x1; + bitmap NameSupportBitmap : bitmap8 { + kSceneNames = 0x80; } struct AttributeValuePair { @@ -191,7 +195,7 @@ provisional server cluster Scenes = 5 { readonly attribute int8u currentScene = 1; readonly attribute group_id currentGroup = 2; readonly attribute boolean sceneValid = 3; - readonly attribute bitmap8 nameSupport = 4; + readonly attribute NameSupportBitmap nameSupport = 4; readonly attribute int16u sceneTableSize = 6; readonly attribute int8u remainingCapacity = 7; readonly attribute command_id generatedCommandList[] = 65528; @@ -1642,7 +1646,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -5132,7 +5142,7 @@ client cluster TemperatureMeasurement = 1026 { readonly attribute nullable temperature measuredValue = 0; readonly attribute nullable temperature minMeasuredValue = 1; readonly attribute nullable temperature maxMeasuredValue = 2; - readonly attribute optional temperature tolerance = 3; + readonly attribute optional int16u tolerance = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -5146,7 +5156,7 @@ server cluster TemperatureMeasurement = 1026 { readonly attribute nullable temperature measuredValue = 0; readonly attribute nullable temperature minMeasuredValue = 1; readonly attribute nullable temperature maxMeasuredValue = 2; - readonly attribute temperature tolerance = 3; + readonly attribute int16u tolerance = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -6694,9 +6704,11 @@ endpoint 0 { callback attribute eventList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/placeholder/linux/apps/app2/config.zap b/examples/placeholder/linux/apps/app2/config.zap index 88191b28ef9110..f65aa2068700bb 100644 --- a/examples/placeholder/linux/apps/app2/config.zap +++ b/examples/placeholder/linux/apps/app2/config.zap @@ -2615,6 +2615,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -2852,7 +2868,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -9104,7 +9120,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -9120,7 +9136,7 @@ "code": 1, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -9136,7 +9152,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -9152,7 +9168,7 @@ "code": 3, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -14981,6 +14997,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/pump-app/pump-common/pump-app.matter b/examples/pump-app/pump-common/pump-app.matter index 97ece6ceda452c..6c26c5b6079ea6 100644 --- a/examples/pump-app/pump-common/pump-app.matter +++ b/examples/pump-app/pump-common/pump-app.matter @@ -831,6 +831,7 @@ server cluster GeneralDiagnostics = 51 { readonly attribute NetworkInterface networkInterfaces[] = 0; readonly attribute int16u rebootCount = 1; + readonly attribute int64u upTime = 2; readonly attribute boolean testEventTriggersEnabled = 8; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -844,7 +845,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */ @@ -1324,7 +1331,7 @@ server cluster TemperatureMeasurement = 1026 { readonly attribute nullable temperature measuredValue = 0; readonly attribute nullable temperature minMeasuredValue = 1; readonly attribute nullable temperature maxMeasuredValue = 2; - readonly attribute temperature tolerance = 3; + readonly attribute int16u tolerance = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1535,14 +1542,17 @@ endpoint 0 { emits event BootReason; callback attribute networkInterfaces; callback attribute rebootCount default = 0x0000; + callback attribute upTime default = 0x0000000000000000; callback attribute testEventTriggersEnabled default = false; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster ThreadNetworkDiagnostics { diff --git a/examples/pump-app/pump-common/pump-app.zap b/examples/pump-app/pump-common/pump-app.zap index 6e21cc9d3de2cf..b982bfd166c7f3 100644 --- a/examples/pump-app/pump-common/pump-app.zap +++ b/examples/pump-app/pump-common/pump-app.zap @@ -1575,6 +1575,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1610,6 +1626,22 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "UpTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "TestEventTriggersEnabled", "code": 8, @@ -1700,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4001,7 +4033,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4017,7 +4049,7 @@ "code": 1, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4033,7 +4065,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4049,7 +4081,7 @@ "code": 3, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4590,6 +4622,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/pump-app/silabs/data_model/pump-thread-app.matter b/examples/pump-app/silabs/data_model/pump-thread-app.matter index 8112f63eebb16f..25a99c27a8d8c2 100644 --- a/examples/pump-app/silabs/data_model/pump-thread-app.matter +++ b/examples/pump-app/silabs/data_model/pump-thread-app.matter @@ -831,6 +831,7 @@ server cluster GeneralDiagnostics = 51 { readonly attribute NetworkInterface networkInterfaces[] = 0; readonly attribute int16u rebootCount = 1; + readonly attribute int64u upTime = 2; readonly attribute boolean testEventTriggersEnabled = 8; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -844,7 +845,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */ @@ -1324,7 +1331,7 @@ server cluster TemperatureMeasurement = 1026 { readonly attribute nullable temperature measuredValue = 0; readonly attribute nullable temperature minMeasuredValue = 1; readonly attribute nullable temperature maxMeasuredValue = 2; - readonly attribute temperature tolerance = 3; + readonly attribute int16u tolerance = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1535,14 +1542,17 @@ endpoint 0 { emits event BootReason; callback attribute networkInterfaces; callback attribute rebootCount default = 0x0000; + callback attribute upTime default = 0x0000000000000000; callback attribute testEventTriggersEnabled default = false; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster ThreadNetworkDiagnostics { diff --git a/examples/pump-app/silabs/data_model/pump-thread-app.zap b/examples/pump-app/silabs/data_model/pump-thread-app.zap index 30e326a3bf068c..ca953399539dc7 100644 --- a/examples/pump-app/silabs/data_model/pump-thread-app.zap +++ b/examples/pump-app/silabs/data_model/pump-thread-app.zap @@ -1575,6 +1575,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1610,6 +1626,22 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "UpTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "TestEventTriggersEnabled", "code": 8, @@ -1700,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4001,7 +4033,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4017,7 +4049,7 @@ "code": 1, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4033,7 +4065,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4049,7 +4081,7 @@ "code": 3, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4590,6 +4622,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/pump-app/silabs/data_model/pump-wifi-app.matter b/examples/pump-app/silabs/data_model/pump-wifi-app.matter index 8112f63eebb16f..25a99c27a8d8c2 100644 --- a/examples/pump-app/silabs/data_model/pump-wifi-app.matter +++ b/examples/pump-app/silabs/data_model/pump-wifi-app.matter @@ -831,6 +831,7 @@ server cluster GeneralDiagnostics = 51 { readonly attribute NetworkInterface networkInterfaces[] = 0; readonly attribute int16u rebootCount = 1; + readonly attribute int64u upTime = 2; readonly attribute boolean testEventTriggersEnabled = 8; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -844,7 +845,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */ @@ -1324,7 +1331,7 @@ server cluster TemperatureMeasurement = 1026 { readonly attribute nullable temperature measuredValue = 0; readonly attribute nullable temperature minMeasuredValue = 1; readonly attribute nullable temperature maxMeasuredValue = 2; - readonly attribute temperature tolerance = 3; + readonly attribute int16u tolerance = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1535,14 +1542,17 @@ endpoint 0 { emits event BootReason; callback attribute networkInterfaces; callback attribute rebootCount default = 0x0000; + callback attribute upTime default = 0x0000000000000000; callback attribute testEventTriggersEnabled default = false; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster ThreadNetworkDiagnostics { diff --git a/examples/pump-app/silabs/data_model/pump-wifi-app.zap b/examples/pump-app/silabs/data_model/pump-wifi-app.zap index 30e326a3bf068c..ca953399539dc7 100644 --- a/examples/pump-app/silabs/data_model/pump-wifi-app.zap +++ b/examples/pump-app/silabs/data_model/pump-wifi-app.zap @@ -1575,6 +1575,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1610,6 +1626,22 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "UpTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "TestEventTriggersEnabled", "code": 8, @@ -1700,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4001,7 +4033,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4017,7 +4049,7 @@ "code": 1, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4033,7 +4065,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4049,7 +4081,7 @@ "code": 3, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4590,6 +4622,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter index fd542a29b72f78..7dabd7f444c97f 100644 --- a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter +++ b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter @@ -756,6 +756,7 @@ server cluster GeneralDiagnostics = 51 { readonly attribute NetworkInterface networkInterfaces[] = 0; readonly attribute int16u rebootCount = 1; + readonly attribute int64u upTime = 2; readonly attribute boolean testEventTriggersEnabled = 8; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -769,7 +770,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */ @@ -1249,7 +1256,7 @@ client cluster TemperatureMeasurement = 1026 { readonly attribute nullable temperature measuredValue = 0; readonly attribute nullable temperature minMeasuredValue = 1; readonly attribute nullable temperature maxMeasuredValue = 2; - readonly attribute optional temperature tolerance = 3; + readonly attribute optional int16u tolerance = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1421,14 +1428,17 @@ endpoint 0 { emits event BootReason; callback attribute networkInterfaces; callback attribute rebootCount default = 0x0000; + callback attribute upTime default = 0x0000000000000000; callback attribute testEventTriggersEnabled default = false; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster ThreadNetworkDiagnostics { diff --git a/examples/pump-controller-app/pump-controller-common/pump-controller-app.zap b/examples/pump-controller-app/pump-controller-common/pump-controller-app.zap index cb7f4b298c5fbb..db4f39092d7d56 100644 --- a/examples/pump-controller-app/pump-controller-common/pump-controller-app.zap +++ b/examples/pump-controller-app/pump-controller-common/pump-controller-app.zap @@ -1575,6 +1575,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1610,6 +1626,22 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "UpTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "TestEventTriggersEnabled", "code": 8, @@ -1700,7 +1732,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3416,6 +3448,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter b/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter index d9bc12cf315e95..dbbe4fc7142fdc 100644 --- a/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter +++ b/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter @@ -586,7 +586,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1075,9 +1081,11 @@ endpoint 0 { callback attribute acceptedCommandList default = 0; callback attribute attributeList default = 0; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster WiFiNetworkDiagnostics { diff --git a/examples/refrigerator-app/refrigerator-common/refrigerator-app.zap b/examples/refrigerator-app/refrigerator-common/refrigerator-app.zap index b772acad198770..0d4058a623ed3b 100644 --- a/examples/refrigerator-app/refrigerator-common/refrigerator-app.zap +++ b/examples/refrigerator-app/refrigerator-common/refrigerator-app.zap @@ -1694,6 +1694,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1915,7 +1931,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3717,6 +3733,5 @@ "endpointId": 3, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.matter b/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.matter index e8ad6f4689e6d9..4bf471ffc11107 100644 --- a/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.matter +++ b/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.matter @@ -863,7 +863,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1815,9 +1821,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.zap b/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.zap index f9ec6ae993d322..316b31550d4dd1 100644 --- a/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.zap +++ b/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.zap @@ -1683,6 +1683,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1856,7 +1872,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5323,6 +5339,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/rvc-app/rvc-common/rvc-app.matter b/examples/rvc-app/rvc-common/rvc-app.matter index 4822febc1d0239..9be857b09ec61b 100644 --- a/examples/rvc-app/rvc-common/rvc-app.matter +++ b/examples/rvc-app/rvc-common/rvc-app.matter @@ -590,7 +590,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** Commands to trigger a Node to allow a new Administrator to commission it. */ @@ -1100,9 +1106,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 0x0001; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster AdministratorCommissioning { diff --git a/examples/rvc-app/rvc-common/rvc-app.zap b/examples/rvc-app/rvc-common/rvc-app.zap index a9f67c56bd7bc8..2a5e70c15e6899 100644 --- a/examples/rvc-app/rvc-common/rvc-app.zap +++ b/examples/rvc-app/rvc-common/rvc-app.zap @@ -1172,6 +1172,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1345,7 +1361,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2783,6 +2799,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter index 48642e7abbf947..b8fcae541ac10c 100644 --- a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter +++ b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter @@ -1095,7 +1095,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1871,9 +1877,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.zap b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.zap index b5fe6c12387788..9f908ddc467eb1 100644 --- a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.zap +++ b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.zap @@ -1481,6 +1481,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1654,7 +1670,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4833,6 +4849,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter index 187f8d14112801..2f492c5c2b031d 100644 --- a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter +++ b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter @@ -617,7 +617,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1171,9 +1177,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.zap b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.zap index 7845ed393315aa..d30f78430de90d 100644 --- a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.zap +++ b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.zap @@ -1386,6 +1386,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1559,7 +1575,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2875,7 +2891,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -2891,7 +2907,7 @@ "code": 1, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -2907,7 +2923,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -2970,6 +2986,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/thermostat/nxp/zap/thermostat_matter_thread.matter b/examples/thermostat/nxp/zap/thermostat_matter_thread.matter index a581f1f70d285d..aeb41da2c13fe0 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_thread.matter +++ b/examples/thermostat/nxp/zap/thermostat_matter_thread.matter @@ -160,6 +160,10 @@ server cluster Groups = 4 { /** Attributes and commands for scene configuration and manipulation. */ provisional server cluster Scenes = 5 { + bitmap CopyModeBitmap : bitmap8 { + kCopyAllScenes = 0x1; + } + bitmap Feature : bitmap32 { kSceneNames = 0x1; kExplicit = 0x2; @@ -167,8 +171,8 @@ provisional server cluster Scenes = 5 { kFabricScenes = 0x8; } - bitmap ScenesCopyMode : bitmap8 { - kCopyAllScenes = 0x1; + bitmap NameSupportBitmap : bitmap8 { + kSceneNames = 0x80; } struct AttributeValuePair { @@ -185,7 +189,7 @@ provisional server cluster Scenes = 5 { readonly attribute int8u currentScene = 1; readonly attribute group_id currentGroup = 2; readonly attribute boolean sceneValid = 3; - readonly attribute bitmap8 nameSupport = 4; + readonly attribute NameSupportBitmap nameSupport = 4; readonly attribute int16u sceneTableSize = 6; readonly attribute int8u remainingCapacity = 7; readonly attribute command_id generatedCommandList[] = 65528; @@ -1264,7 +1268,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */ @@ -1941,9 +1951,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster ThreadNetworkDiagnostics { diff --git a/examples/thermostat/nxp/zap/thermostat_matter_thread.zap b/examples/thermostat/nxp/zap/thermostat_matter_thread.zap index ec8baf4d992228..fc4fcab08daeb0 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_thread.zap +++ b/examples/thermostat/nxp/zap/thermostat_matter_thread.zap @@ -1626,6 +1626,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1799,7 +1815,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4934,6 +4950,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter b/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter index ede88c2f5677f3..d58570d607ab75 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter +++ b/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter @@ -160,6 +160,10 @@ server cluster Groups = 4 { /** Attributes and commands for scene configuration and manipulation. */ provisional server cluster Scenes = 5 { + bitmap CopyModeBitmap : bitmap8 { + kCopyAllScenes = 0x1; + } + bitmap Feature : bitmap32 { kSceneNames = 0x1; kExplicit = 0x2; @@ -167,8 +171,8 @@ provisional server cluster Scenes = 5 { kFabricScenes = 0x8; } - bitmap ScenesCopyMode : bitmap8 { - kCopyAllScenes = 0x1; + bitmap NameSupportBitmap : bitmap8 { + kSceneNames = 0x80; } struct AttributeValuePair { @@ -185,7 +189,7 @@ provisional server cluster Scenes = 5 { readonly attribute int8u currentScene = 1; readonly attribute group_id currentGroup = 2; readonly attribute boolean sceneValid = 3; - readonly attribute bitmap8 nameSupport = 4; + readonly attribute NameSupportBitmap nameSupport = 4; readonly attribute int16u sceneTableSize = 6; readonly attribute int8u remainingCapacity = 7; readonly attribute command_id generatedCommandList[] = 65528; @@ -1264,7 +1268,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1850,9 +1860,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster WiFiNetworkDiagnostics { diff --git a/examples/thermostat/nxp/zap/thermostat_matter_wifi.zap b/examples/thermostat/nxp/zap/thermostat_matter_wifi.zap index fcc14df85255d3..4f547325082971 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_wifi.zap +++ b/examples/thermostat/nxp/zap/thermostat_matter_wifi.zap @@ -1626,6 +1626,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1799,7 +1815,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4076,6 +4092,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/thermostat/thermostat-common/thermostat.matter b/examples/thermostat/thermostat-common/thermostat.matter index be2a7be5dacc50..d5ed36f49349b8 100644 --- a/examples/thermostat/thermostat-common/thermostat.matter +++ b/examples/thermostat/thermostat-common/thermostat.matter @@ -954,7 +954,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -1799,9 +1805,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/thermostat/thermostat-common/thermostat.zap b/examples/thermostat/thermostat-common/thermostat.zap index 74262e2093f6b1..15089b3ab63025 100644 --- a/examples/thermostat/thermostat-common/thermostat.zap +++ b/examples/thermostat/thermostat-common/thermostat.zap @@ -1727,6 +1727,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1900,7 +1916,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -5043,6 +5059,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter index 5d7764d71f36c8..f33bd7a4b364a1 100644 --- a/examples/tv-app/tv-common/tv-app.matter +++ b/examples/tv-app/tv-common/tv-app.matter @@ -1109,7 +1109,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -2601,9 +2607,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/tv-app/tv-common/tv-app.zap b/examples/tv-app/tv-common/tv-app.zap index 58a0b469101460..dfb855bbc4182f 100644 --- a/examples/tv-app/tv-common/tv-app.zap +++ b/examples/tv-app/tv-common/tv-app.zap @@ -1754,6 +1754,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1927,7 +1943,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -7621,6 +7637,5 @@ "endpointId": 3, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter index a98c4dbf1b207e..88b8b3574f7f48 100644 --- a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter +++ b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter @@ -950,7 +950,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -2129,9 +2135,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap b/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap index b231ccb0ec904f..fdcfe88813b957 100644 --- a/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap +++ b/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap @@ -1400,6 +1400,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1573,7 +1589,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4366,6 +4382,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter b/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter index 0c56f79c581271..984821d90c715c 100644 --- a/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter +++ b/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter @@ -118,6 +118,10 @@ server cluster Groups = 4 { /** Attributes and commands for scene configuration and manipulation. */ provisional server cluster Scenes = 5 { + bitmap CopyModeBitmap : bitmap8 { + kCopyAllScenes = 0x1; + } + bitmap Feature : bitmap32 { kSceneNames = 0x1; kExplicit = 0x2; @@ -125,8 +129,8 @@ provisional server cluster Scenes = 5 { kFabricScenes = 0x8; } - bitmap ScenesCopyMode : bitmap8 { - kCopyAllScenes = 0x1; + bitmap NameSupportBitmap : bitmap8 { + kSceneNames = 0x80; } struct AttributeValuePair { @@ -143,7 +147,7 @@ provisional server cluster Scenes = 5 { readonly attribute int8u currentScene = 1; readonly attribute group_id currentGroup = 2; readonly attribute boolean sceneValid = 3; - readonly attribute bitmap8 nameSupport = 4; + readonly attribute NameSupportBitmap nameSupport = 4; readonly attribute int16u sceneTableSize = 6; readonly attribute int8u remainingCapacity = 7; readonly attribute command_id generatedCommandList[] = 65528; @@ -1244,7 +1248,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -2660,9 +2670,11 @@ endpoint 0 { callback attribute activeNetworkFaults; callback attribute testEventTriggersEnabled default = false; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/virtual-device-app/virtual-device-common/virtual-device-app.zap b/examples/virtual-device-app/virtual-device-common/virtual-device-app.zap index ea5776de0b3587..2de2594f69d319 100644 --- a/examples/virtual-device-app/virtual-device-common/virtual-device-app.zap +++ b/examples/virtual-device-app/virtual-device-common/virtual-device-app.zap @@ -1552,6 +1552,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -1725,7 +1741,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -6122,6 +6138,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/window-app/common/window-app.matter b/examples/window-app/common/window-app.matter index f997baf66cfc98..6b5f06125fcf6e 100644 --- a/examples/window-app/common/window-app.matter +++ b/examples/window-app/common/window-app.matter @@ -1084,7 +1084,13 @@ server cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -2000,9 +2006,11 @@ endpoint 0 { callback attribute eventList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 0x0002; handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; } server cluster SoftwareDiagnostics { diff --git a/examples/window-app/common/window-app.zap b/examples/window-app/common/window-app.zap index a5dcb3b1a3bc2e..62335819c78496 100644 --- a/examples/window-app/common/window-app.zap +++ b/examples/window-app/common/window-app.zap @@ -2303,6 +2303,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -2540,7 +2556,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0x0002", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -7057,6 +7073,5 @@ "endpointId": 2, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index 2160af0d1e0322..3a29eed2ffcfc3 100755 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -576,6 +576,8 @@ def BuildQorvoTarget(): TargetPart('persistent-storage', app=QpgApp.PERSISTENT_STORAGE), ]) + target.AppendModifier('updateimage', update_image=True) + return target diff --git a/scripts/build/builders/android.py b/scripts/build/builders/android.py index b5d2f1834c5ddb..19080a52f90027 100644 --- a/scripts/build/builders/android.py +++ b/scripts/build/builders/android.py @@ -237,8 +237,8 @@ def copyToSrcAndroid(self): "CHIPController.jar": "src/controller/java/CHIPController.jar", "OnboardingPayload.jar": "src/controller/java/OnboardingPayload.jar", "AndroidPlatform.jar": "src/platform/android/AndroidPlatform.jar", - "libCHIPJson.jar": "src/controller/java/libCHIPJson.jar", - "libCHIPTlv.jar": "src/controller/java/libCHIPTlv.jar", + "libMatterJson.jar": "src/controller/java/libMatterJson.jar", + "libMatterTlv.jar": "src/controller/java/libMatterTlv.jar", "CHIPClusters.jar": "src/controller/java/CHIPClusters.jar", "CHIPClusterID.jar": "src/controller/java/CHIPClusterID.jar", } @@ -568,8 +568,8 @@ def build_outputs(self): "CHIPController.jar": os.path.join( self.output_dir, "lib", "src/controller/java/CHIPController.jar" ), - "libCHIPTlv.jar": os.path.join( - self.output_dir, "lib", "src/controller/java/libCHIPTlv.jar" + "libMatterTlv.jar": os.path.join( + self.output_dir, "lib", "src/controller/java/libMatterTlv.jar" ), "AndroidPlatform.jar": os.path.join( self.output_dir, "lib", "src/platform/android/AndroidPlatform.jar" diff --git a/scripts/build/builders/qpg.py b/scripts/build/builders/qpg.py index 2c4f3ebf2e4884..67f224b80a4657 100644 --- a/scripts/build/builders/qpg.py +++ b/scripts/build/builders/qpg.py @@ -81,18 +81,22 @@ def __init__(self, runner, app: QpgApp = QpgApp.LIGHT, board: QpgBoard = QpgBoard.QPG6105, - enable_rpcs: bool = False): + enable_rpcs: bool = False, + update_image: bool = False): super(QpgBuilder, self).__init__( root=app.BuildRoot(root), runner=runner) self.app = app self.board = board self.enable_rpcs = enable_rpcs + self.update_image = update_image def GnBuildArgs(self): args = ['qpg_target_ic=\"%s\"' % self.board.GnArgName()] if self.enable_rpcs: args.append('import("//with_pw_rpc.gni")') + if self.update_image: + args.append('matter_device_software_version_string=\"1.1_OTA_TEST\" matter_device_software_version=4') return args def build_outputs(self): diff --git a/scripts/build/testdata/all_targets_linux_x64.txt b/scripts/build/testdata/all_targets_linux_x64.txt index b5402ab140189a..b5f8ad99719433 100644 --- a/scripts/build/testdata/all_targets_linux_x64.txt +++ b/scripts/build/testdata/all_targets_linux_x64.txt @@ -19,7 +19,7 @@ mbed-cy8cproto_062_4343w-{lock,light,all-clusters,all-clusters-minimal,pigweed,o mw320-all-clusters-app nrf-{nrf5340dk,nrf52840dk,nrf52840dongle}-{all-clusters,all-clusters-minimal,lock,light,light-switch,shell,pump,pump-controller,window-covering}[-rpc] nrf-native-posix-64-tests -qpg-qpg6105-{lock,light,shell,persistent-storage} +qpg-qpg6105-{lock,light,shell,persistent-storage}[-updateimage] stm32-stm32wb5mm-dk-light tizen-arm-{all-clusters,all-clusters-minimal,chip-tool,light,tests}[-no-ble][-no-thread][-no-wifi][-asan][-ubsan][-with-ui] telink-{tlsr9518adk80d,tlsr9528a}-{air-quality-sensor,all-clusters,all-clusters-minimal,bridge,contact-sensor,light,light-switch,lock,ota-requestor,pump,pump-controller,resource-monitoring,shell,smoke-co-alarm,temperature-measurement,thermostat,window-covering}[-ota][-dfu][-shell][-rpc][-factory-data][-4mb] diff --git a/scripts/build/testdata/dry_run_android-arm64-chip-tool.txt b/scripts/build/testdata/dry_run_android-arm64-chip-tool.txt index c2810269aa0f57..8ff2afd8d8bb76 100644 --- a/scripts/build/testdata/dry_run_android-arm64-chip-tool.txt +++ b/scripts/build/testdata/dry_run_android-arm64-chip-tool.txt @@ -29,9 +29,9 @@ cp {out}/android-arm64-chip-tool/lib/src/controller/java/OnboardingPayload.jar { cp {out}/android-arm64-chip-tool/lib/src/platform/android/AndroidPlatform.jar {root}/examples/android/CHIPTool/app/libs/AndroidPlatform.jar -cp {out}/android-arm64-chip-tool/lib/src/controller/java/libCHIPJson.jar {root}/examples/android/CHIPTool/app/libs/libCHIPJson.jar +cp {out}/android-arm64-chip-tool/lib/src/controller/java/libMatterJson.jar {root}/examples/android/CHIPTool/app/libs/libMatterJson.jar -cp {out}/android-arm64-chip-tool/lib/src/controller/java/libCHIPTlv.jar {root}/examples/android/CHIPTool/app/libs/libCHIPTlv.jar +cp {out}/android-arm64-chip-tool/lib/src/controller/java/libMatterTlv.jar {root}/examples/android/CHIPTool/app/libs/libMatterTlv.jar cp {out}/android-arm64-chip-tool/lib/src/controller/java/CHIPClusters.jar {root}/examples/android/CHIPTool/app/libs/CHIPClusters.jar diff --git a/scripts/rules.matterlint b/scripts/rules.matterlint index 3892736a0da7fa..0a63eeecf0a4f2 100644 --- a/scripts/rules.matterlint +++ b/scripts/rules.matterlint @@ -25,6 +25,7 @@ load "../src/app/zap-templates/zcl/data-model/chip/descriptor-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/diagnostic-logs-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/dishwasher-alarm-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/dishwasher-mode-cluster.xml"; +load "../src/app/zap-templates/zcl/data-model/chip/microwave-oven-control-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/door-lock-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/ethernet-network-diagnostics-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/fan-control-cluster.xml"; diff --git a/scripts/setup/zap.json b/scripts/setup/zap.json index b9e8e18016cd31..94d4799af8f241 100644 --- a/scripts/setup/zap.json +++ b/scripts/setup/zap.json @@ -8,13 +8,13 @@ "mac-amd64", "windows-amd64" ], - "tags": ["version:2@v2023.10.24-nightly.1"] + "tags": ["version:2@v2023.10.30-nightly.1"] }, { "_comment": "Always get the amd64 version on mac until usable arm64 zap build is available", "path": "fuchsia/third_party/zap/mac-amd64", "platforms": ["mac-arm64"], - "tags": ["version:2@v2023.10.24-nightly.1"] + "tags": ["version:2@v2023.10.30-nightly.1"] } ] } diff --git a/scripts/setup/zap.version b/scripts/setup/zap.version index c26dc3f85a55d8..7cea852e9c90f1 100644 --- a/scripts/setup/zap.version +++ b/scripts/setup/zap.version @@ -1 +1 @@ -v2023.10.24-nightly +v2023.10.30-nightly diff --git a/scripts/tools/zap/tests/inputs/all-clusters-app.zap b/scripts/tools/zap/tests/inputs/all-clusters-app.zap index 12d89a5da8d510..97bea16a06f3a2 100644 --- a/scripts/tools/zap/tests/inputs/all-clusters-app.zap +++ b/scripts/tools/zap/tests/inputs/all-clusters-app.zap @@ -11586,7 +11586,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11602,7 +11602,7 @@ "code": 1, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11618,7 +11618,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11634,7 +11634,7 @@ "code": 3, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -16797,6 +16797,5 @@ "endpointId": 65534, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/scripts/tools/zap/tests/inputs/lighting-app.zap b/scripts/tools/zap/tests/inputs/lighting-app.zap index 7fbcb784bfd527..e2d343dc413e5f 100644 --- a/scripts/tools/zap/tests/inputs/lighting-app.zap +++ b/scripts/tools/zap/tests/inputs/lighting-app.zap @@ -5742,6 +5742,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h index 16e6c92fe83576..f4cdf85102f119 100644 --- a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h +++ b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h @@ -1148,10 +1148,10 @@ { ZAP_SIMPLE_DEFAULT(0x8000), 0x00000001, 2, ZAP_TYPE(TEMPERATURE), \ ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* MinMeasuredValue */ \ { ZAP_SIMPLE_DEFAULT(0x8000), 0x00000002, 2, ZAP_TYPE(TEMPERATURE), \ - ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* MaxMeasuredValue */ \ - { ZAP_EMPTY_DEFAULT(), 0x00000003, 2, ZAP_TYPE(TEMPERATURE), 0 }, /* Tolerance */ \ - { ZAP_SIMPLE_DEFAULT(0), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ - { ZAP_SIMPLE_DEFAULT(4), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ + ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* MaxMeasuredValue */ \ + { ZAP_EMPTY_DEFAULT(), 0x00000003, 2, ZAP_TYPE(INT16U), 0 }, /* Tolerance */ \ + { ZAP_SIMPLE_DEFAULT(0), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ + { ZAP_SIMPLE_DEFAULT(4), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Pressure Measurement (server) */ \ { ZAP_SIMPLE_DEFAULT(0x0000), 0x00000000, 2, ZAP_TYPE(INT16S), ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* MeasuredValue */ \ diff --git a/scripts/tools/zap/zap_execution.py b/scripts/tools/zap/zap_execution.py index 60e861d28cd926..4aa1eac29d4bed 100644 --- a/scripts/tools/zap/zap_execution.py +++ b/scripts/tools/zap/zap_execution.py @@ -23,7 +23,7 @@ # Use scripts/tools/zap/version_update.py to manage ZAP versioning as many # files may need updating for versions # -MIN_ZAP_VERSION = '2023.10.24' +MIN_ZAP_VERSION = '2023.10.28' class ZapTool: diff --git a/src/app/OperationalSessionSetup.cpp b/src/app/OperationalSessionSetup.cpp index 7b5d70919f2a8a..0b68c12c96a7dd 100644 --- a/src/app/OperationalSessionSetup.cpp +++ b/src/app/OperationalSessionSetup.cpp @@ -702,10 +702,43 @@ void OperationalSessionSetup::NotifyRetryHandlers(CHIP_ERROR error, const Reliab void OperationalSessionSetup::NotifyRetryHandlers(CHIP_ERROR error, System::Clock::Seconds16 timeoutEstimate) { - for (auto * item = mConnectionRetry.First(); item && item != &mConnectionRetry; item = item->mNext) + // We have to be very careful here: Calling into these handlers might in + // theory destroy the Callback objects involved, but unlike the + // succcess/failure cases we don't want to just clear the handlers from our + // list when we are calling them, because we might need to call a given + // handler more than once. + // + // To handle this we: + // + // 1) Snapshot the list of handlers up front, so if any of the handlers + // triggers an AddRetryHandler with some other handler that does not + // affect the list we plan to notify here. + // + // 2) When planning to notify a handler move it to a new list that contains + // just that handler. This way if it gets canceled as part of the + // notification we can tell it has been canceled. + // + // 3) If notifying the handler does not cancel it, add it back to our list + // of handlers so we will notify it on future retries. + + Cancelable retryHandlerListSnapshot; + mConnectionRetry.DequeueAll(retryHandlerListSnapshot); + + while (retryHandlerListSnapshot.mNext != &retryHandlerListSnapshot) { - auto cb = Callback::Callback::FromCancelable(item); + auto * cb = Callback::Callback::FromCancelable(retryHandlerListSnapshot.mNext); + + Callback::CallbackDeque currentCallbackHolder; + currentCallbackHolder.Enqueue(cb->Cancel()); + cb->mCall(cb->mContext, mPeerId, error, timeoutEstimate); + + if (currentCallbackHolder.mNext != ¤tCallbackHolder) + { + // Callback has not been canceled as part of the call, so is still + // supposed to be registered with us. + AddRetryHandler(cb); + } } } #endif // CHIP_DEVICE_CONFIG_ENABLE_AUTOMATIC_CASE_RETRIES diff --git a/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp b/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp index 994104abf22a75..0ea54f2e2c96b6 100644 --- a/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp +++ b/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp @@ -384,6 +384,15 @@ bool emberAfGeneralDiagnosticsClusterTestEventTriggerCallback(CommandHandler * c return true; } +bool emberAfGeneralDiagnosticsClusterTimeSnapshotCallback(CommandHandler * commandObj, ConcreteCommandPath const & commandPath, + Commands::TimeSnapshot::DecodableType const & commandData) +{ + // TODO(#30096): Command needs to be implemented. + ChipLogError(Zcl, "TimeSnapshot not yet supported!"); + commandObj->AddStatus(commandPath, Status::InvalidCommand); + return true; +} + void MatterGeneralDiagnosticsPluginServerInitCallback() { BootReasonEnum bootReason; diff --git a/src/app/clusters/scenes-server/SceneTableImpl.cpp b/src/app/clusters/scenes-server/SceneTableImpl.cpp index f1900416c4499b..7f5870f0ecf2b3 100644 --- a/src/app/clusters/scenes-server/SceneTableImpl.cpp +++ b/src/app/clusters/scenes-server/SceneTableImpl.cpp @@ -284,7 +284,7 @@ struct FabricSceneData : public PersistentData uint8_t scene_count = 0; uint16_t max_scenes_per_fabric; uint16_t max_scenes_per_endpoint; - SceneStorageId scene_map[kMaxScenesPerFabric]; + SceneStorageId scene_map[CHIP_CONFIG_MAX_SCENES_TABLE_SIZE]; FabricSceneData(EndpointId endpoint = kInvalidEndpointId, FabricIndex fabric = kUndefinedFabricIndex, uint16_t maxScenesPerFabric = kMaxScenesPerFabric, uint16_t maxScenesPerEndpoint = kMaxScenesPerEndpoint) : diff --git a/src/app/clusters/scenes-server/SceneTableImpl.h b/src/app/clusters/scenes-server/SceneTableImpl.h index 60a378f43c3ce8..9f659fab068f50 100644 --- a/src/app/clusters/scenes-server/SceneTableImpl.h +++ b/src/app/clusters/scenes-server/SceneTableImpl.h @@ -28,8 +28,17 @@ namespace chip { namespace scenes { -static constexpr uint16_t kMaxScenesPerFabric = (MATTER_SCENES_TABLE_SIZE - 1) / 2; +#ifdef MATTER_SCENES_TABLE_SIZE static constexpr uint16_t kMaxScenesPerEndpoint = MATTER_SCENES_TABLE_SIZE; +#else +static constexpr uint16_t kMaxScenesPerEndpoint = CHIP_CONFIG_MAX_SCENES_TABLE_SIZE; +#endif + +static_assert(kMaxScenesPerEndpoint <= CHIP_CONFIG_MAX_SCENES_TABLE_SIZE, + "CHIP_CONFIG_MAX_SCENES_TABLE_SIZE is smaller than the zap configuration, please increase " + "CHIP_CONFIG_MAX_SCENES_TABLE_SIZE in CHIPConfig.h if you really need more scenes"); +static_assert(kMaxScenesPerEndpoint >= 16, "Per spec, kMaxScenesPerEndpoint must be at least 16"); +static constexpr uint16_t kMaxScenesPerFabric = (kMaxScenesPerEndpoint - 1) / 2; using clusterId = chip::ClusterId; diff --git a/src/app/clusters/scenes-server/scenes-server.cpp b/src/app/clusters/scenes-server/scenes-server.cpp index 2386e2155d6722..08f92596757309 100644 --- a/src/app/clusters/scenes-server/scenes-server.cpp +++ b/src/app/clusters/scenes-server/scenes-server.cpp @@ -119,13 +119,11 @@ CHIP_ERROR ScenesServer::Init() EmberAfStatus status = Attributes::FeatureMap::Get(endpoint, &featureMap); if (EMBER_ZCL_STATUS_SUCCESS == status) { - // Setting NameSupport attribute value to 0x80 if the feature bit is set - // The bit of 7 (0x80) the NameSupport attribute indicates whether or not scene names are supported - // - // According to spec, bit 7 (Scene Names) MUST match feature bit 0 (Scene Names) - uint8_t nameSupport = - (featureMap & to_underlying(Feature::kSceneNames)) ? static_cast(0x80) : static_cast(0x00); - status = Attributes::NameSupport::Set(endpoint, nameSupport); + // According to spec, bit 7 MUST match feature bit 0 (SceneNames) + BitMask nameSupport = (featureMap & to_underlying(Feature::kSceneNames)) + ? BitMask(NameSupportBitmap::kSceneNames) + : BitMask(); + status = Attributes::NameSupport::Set(endpoint, nameSupport); if (EMBER_ZCL_STATUS_SUCCESS != status) { ChipLogDetail(Zcl, "ERR: setting NameSupport on Endpoint %hu Status: %x", endpoint, status); @@ -851,7 +849,7 @@ void ScenesServer::HandleCopyScene(HandlerContext & ctx, const Commands::CopySce sceneTable->GetRemainingCapacity(ctx.mCommandHandler.GetAccessingFabricIndex(), capacity))); // Checks if we copy a single scene or all of them - if (req.mode.GetField(app::Clusters::Scenes::ScenesCopyMode::kCopyAllScenes)) + if (req.mode.GetField(app::Clusters::Scenes::CopyModeBitmap::kCopyAllScenes)) { // Scene Table interface data SceneId scenesInGroup[scenes::kMaxScenesPerFabric]; diff --git a/src/app/tests/suites/certification/Test_TC_DGGEN_1_1.yaml b/src/app/tests/suites/certification/Test_TC_DGGEN_1_1.yaml index 1fdcfce09d47ee..147242c5db841e 100644 --- a/src/app/tests/suites/certification/Test_TC_DGGEN_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DGGEN_1_1.yaml @@ -35,7 +35,7 @@ tests: command: "readAttribute" attribute: "ClusterRevision" response: - value: 1 + value: 2 constraints: type: int16u @@ -65,8 +65,9 @@ tests: type: list contains: [0, 1, 8, 65528, 65529, 65531, 65532, 65533] - - label: "Step 4b: Read optional attribute(UpTime) in AttributeList" - PICS: DGGEN.S.A0002 + - label: + "Step 4b: Validate presence of mandatory attribute(UpTime) in + AttributeList" command: "readAttribute" attribute: "AttributeList" response: @@ -168,12 +169,12 @@ tests: response: constraints: type: list - contains: [0] + contains: [0, 1] - label: "Step 7: TH reads GeneratedCommandList from DUT" command: "readAttribute" attribute: "GeneratedCommandList" response: - value: [] + value: [2] constraints: type: list diff --git a/src/app/tests/suites/certification/Test_TC_DGGEN_2_1.yaml b/src/app/tests/suites/certification/Test_TC_DGGEN_2_1.yaml index 22a222055e689f..5b4e7a489a613f 100644 --- a/src/app/tests/suites/certification/Test_TC_DGGEN_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DGGEN_2_1.yaml @@ -183,7 +183,6 @@ tests: - label: "Step 4a: TH reads the Uptime attribute value of DUT. Store the value in uptime1" - PICS: DGGEN.S.A0002 command: "readAttribute" attribute: "UpTime" response: @@ -192,7 +191,6 @@ tests: type: int64u - label: "Wait 10 seconds" - PICS: DGGEN.S.A0002 cluster: "DelayCommands" command: "WaitForMs" arguments: @@ -203,7 +201,6 @@ tests: - label: "Step 4b: TH reads a Uptime attribute value of DUT. Store the value in uptime2. Verify that uptime2 is greater than uptime1." - PICS: DGGEN.S.A0002 command: "readAttribute" attribute: "UpTime" response: @@ -241,7 +238,6 @@ tests: - label: "Step 4c: TH reads a Uptime attribute value of DUT. Store the value in uptime3. Verify that uptime3 is lesser than uptime2." - PICS: DGGEN.S.A0003 command: "readAttribute" attribute: "UpTime" response: diff --git a/src/app/zap-templates/zcl/data-model/all.xml b/src/app/zap-templates/zcl/data-model/all.xml index 211fed5581d049..2ec5c1a47500ca 100644 --- a/src/app/zap-templates/zcl/data-model/all.xml +++ b/src/app/zap-templates/zcl/data-model/all.xml @@ -23,6 +23,7 @@ + diff --git a/src/app/zap-templates/zcl/data-model/chip/general-diagnostics-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/general-diagnostics-cluster.xml index 4e0e9b5cafdfe2..0a3c0f12ffd783 100644 --- a/src/app/zap-templates/zcl/data-model/chip/general-diagnostics-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/general-diagnostics-cluster.xml @@ -38,7 +38,7 @@ limitations under the License. - + @@ -56,7 +56,7 @@ limitations under the License. - + @@ -67,15 +67,15 @@ limitations under the License. - - - - + + + + - - - - + + + + General @@ -83,8 +83,9 @@ limitations under the License. 0x0033 GENERAL_DIAGNOSTICS_CLUSTER The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. - NetworkInterfaces + NetworkInterfaces RebootCount + UpTime TotalOperationalHours BootReason @@ -92,6 +93,7 @@ limitations under the License. ActiveRadioFaults ActiveNetworkFaults TestEventTriggersEnabled + AverageWearCount @@ -101,6 +103,16 @@ limitations under the License. + + Take a snapshot of system time and epoch time. + + + + Response for the TimeSnapshot command. + + + + Indicate a change in the set of hardware faults currently detected by the Node. diff --git a/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml b/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml index c84b6db29c83aa..b88f9cd12943cb 100644 --- a/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml +++ b/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml @@ -84,6 +84,7 @@ limitations under the License. + diff --git a/src/app/zap-templates/zcl/data-model/chip/microwave-oven-control-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/microwave-oven-control-cluster.xml new file mode 100644 index 00000000000000..e6cb38e39a1efc --- /dev/null +++ b/src/app/zap-templates/zcl/data-model/chip/microwave-oven-control-cluster.xml @@ -0,0 +1,45 @@ + + + + + + + Microwave Oven Control + Appliances + Attributes and commands for configuring the microwave oven control, and reporting cooking stats. + 0x005F + MICROWAVE_OVEN_CONTROL_CLUSTER + true + true + CookTime + PowerSetting + MinPower + MaxPower + PowerStep + + + Set Cooking Parameters + + + + + + Add More Cooking Time + + + + diff --git a/src/app/zap-templates/zcl/data-model/chip/scene.xml b/src/app/zap-templates/zcl/data-model/chip/scene.xml index 43b63e67409b37..69455e4de08469 100644 --- a/src/app/zap-templates/zcl/data-model/chip/scene.xml +++ b/src/app/zap-templates/zcl/data-model/chip/scene.xml @@ -15,7 +15,12 @@ See the License for the specific language governing permissions and limitations under the License. --> - + + + + + + @@ -47,7 +52,7 @@ limitations under the License. CurrentScene CurrentGroup SceneValid - NameSupport + NameSupport LastConfiguredBy SceneTableSize RemainingCapacity @@ -134,7 +139,7 @@ limitations under the License. Allows a client to efficiently copy scenes from one group/scene identifier pair to another group/scene identifier pair. - + diff --git a/src/app/zap-templates/zcl/data-model/chip/temperature-measurement-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/temperature-measurement-cluster.xml index aee79b86eea3c0..d141743fafde56 100644 --- a/src/app/zap-templates/zcl/data-model/chip/temperature-measurement-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/temperature-measurement-cluster.xml @@ -27,6 +27,6 @@ limitations under the License. MeasuredValue MinMeasuredValue MaxMeasuredValue - Tolerance + Tolerance 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 543a902517da97..1c2b767a7c5fd4 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -37,6 +37,7 @@ "diagnostic-logs-cluster.xml", "dishwasher-alarm-cluster.xml", "dishwasher-mode-cluster.xml", + "microwave-oven-control-cluster.xml", "door-lock-cluster.xml", "electrical-measurement-cluster.xml", "ethernet-network-diagnostics-cluster.xml", diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index c047c56557e2fa..db14ae2f939221 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -89,6 +89,7 @@ "switch-cluster.xml", "target-navigator-cluster.xml", "temperature-control-cluster.xml", + "microwave-oven-control-cluster.xml", "temperature-measurement-cluster.xml", "test-cluster.xml", "thermostat-cluster.xml", diff --git a/src/app/zap_cluster_list.json b/src/app/zap_cluster_list.json index 61b2d99f5433e0..bd4228a001522a 100644 --- a/src/app/zap_cluster_list.json +++ b/src/app/zap_cluster_list.json @@ -53,6 +53,7 @@ "LOW_POWER_CLUSTER": [], "MEDIA_INPUT_CLUSTER": [], "MEDIA_PLAYBACK_CLUSTER": [], + "MICROWAVE_OVEN_CONTROL_CLUSTER": [], "MODE_SELECT_CLUSTER": [], "NETWORK_COMMISSIONING_CLUSTER": [], "SAMPLE_MEI_CLUSTER": [], @@ -182,6 +183,7 @@ "LOW_POWER_CLUSTER": ["low-power-server"], "MEDIA_INPUT_CLUSTER": ["media-input-server"], "MEDIA_PLAYBACK_CLUSTER": ["media-playback-server"], + "MICROWAVE_OVEN_CONTROL_CLUSTER": ["microwave-oven-control-server"], "MODE_SELECT_CLUSTER": ["mode-select-server"], "NETWORK_COMMISSIONING_CLUSTER": ["network-commissioning"], "NITROGEN_DIOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER": [ diff --git a/src/controller/data_model/BUILD.gn b/src/controller/data_model/BUILD.gn index f5044d61711df8..445d2b264e3516 100644 --- a/src/controller/data_model/BUILD.gn +++ b/src/controller/data_model/BUILD.gn @@ -114,6 +114,8 @@ if (current_os == "android" || matter_enable_java_compilation) { "jni/DishwasherAlarmClient-ReadImpl.cpp", "jni/DishwasherModeClient-InvokeSubscribeImpl.cpp", "jni/DishwasherModeClient-ReadImpl.cpp", + "jni/MicrowaveOvenControlClient-InvokeSubscribeImpl.cpp", + "jni/MicrowaveOvenControlClient-ReadImpl.cpp", "jni/DoorLockClient-InvokeSubscribeImpl.cpp", "jni/DoorLockClient-ReadImpl.cpp", "jni/ElectricalMeasurementClient-InvokeSubscribeImpl.cpp", diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index d5b1691dc9eb9f..ae8aed40bf7e40 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -126,6 +126,10 @@ client cluster Groups = 4 { /** Attributes and commands for scene configuration and manipulation. */ provisional client cluster Scenes = 5 { + bitmap CopyModeBitmap : bitmap8 { + kCopyAllScenes = 0x1; + } + bitmap Feature : bitmap32 { kSceneNames = 0x1; kExplicit = 0x2; @@ -133,8 +137,8 @@ provisional client cluster Scenes = 5 { kFabricScenes = 0x8; } - bitmap ScenesCopyMode : bitmap8 { - kCopyAllScenes = 0x1; + bitmap NameSupportBitmap : bitmap8 { + kSceneNames = 0x80; } struct AttributeValuePair { @@ -151,7 +155,7 @@ provisional client cluster Scenes = 5 { readonly attribute int8u currentScene = 1; readonly attribute group_id currentGroup = 2; readonly attribute boolean sceneValid = 3; - readonly attribute bitmap8 nameSupport = 4; + readonly attribute NameSupportBitmap nameSupport = 4; readonly attribute optional nullable node_id lastConfiguredBy = 5; readonly attribute int16u sceneTableSize = 6; readonly attribute int8u remainingCapacity = 7; @@ -267,7 +271,7 @@ provisional client cluster Scenes = 5 { } request struct CopySceneRequest { - ScenesCopyMode mode = 0; + CopyModeBitmap mode = 0; group_id groupIdentifierFrom = 1; int8u sceneIdentifierFrom = 2; group_id groupIdentifierTo = 3; @@ -1795,8 +1799,15 @@ client cluster GeneralDiagnostics = 51 { int64u eventTrigger = 1; } + response struct TimeSnapshotResponse = 2 { + systime_us systemTimeUs = 0; + nullable epoch_us UTCTimeUs = 1; + } + /** Provide a means for certification tests to trigger some test-plan-specific events */ command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + /** Take a snapshot of system time and epoch time. */ + command TimeSnapshot(): TimeSnapshotResponse = 1; } /** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ @@ -3347,6 +3358,36 @@ client cluster DishwasherAlarm = 93 { command ModifyEnabledAlarms(ModifyEnabledAlarmsRequest): DefaultSuccess = 1; } +/** Attributes and commands for configuring the microwave oven control, and reporting cooking stats. */ +provisional client cluster MicrowaveOvenControl = 95 { + readonly attribute elapsed_s cookTime = 1; + readonly attribute int8u powerSetting = 2; + readonly attribute optional int8u minPower = 3; + readonly attribute optional int8u maxPower = 4; + readonly attribute optional int8u powerStep = 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 SetCookingParametersRequest { + optional int8u cookMode = 0; + optional elapsed_s cookTime = 1; + optional int8u powerSetting = 2; + } + + request struct AddMoreTimeRequest { + elapsed_s timeToAdd = 0; + } + + /** Set Cooking Parameters */ + command SetCookingParameters(SetCookingParametersRequest): DefaultSuccess = 0; + /** Add More Cooking Time */ + command AddMoreTime(AddMoreTimeRequest): DefaultSuccess = 1; +} + /** This cluster supports remotely monitoring and, where supported, changing the operational state of any device where a state machine is a part of the operation. */ client cluster OperationalState = 96 { enum ErrorStateEnum : enum8 { @@ -5135,7 +5176,7 @@ client cluster TemperatureMeasurement = 1026 { readonly attribute nullable temperature measuredValue = 0; readonly attribute nullable temperature minMeasuredValue = 1; readonly attribute nullable temperature maxMeasuredValue = 2; - readonly attribute optional temperature tolerance = 3; + readonly attribute optional int16u tolerance = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index 69823c343442e1..6705edcaded561 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -4739,6 +4739,58 @@ } ] }, + { + "name": "Microwave Oven Control", + "code": 1295, + "mfgCode": null, + "define": "MICROWAVE_OVEN_CONTROL_CLUSTER", + "side": "client", + "enabled": 1, + "commands": [ + { + "name": "SetCookingParameters", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "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": "Electrical Measurement", "code": 2820, @@ -5081,6 +5133,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/src/controller/java/BUILD.gn b/src/controller/java/BUILD.gn index 71c2a8b07bcbf5..5dbd5c90ff8ca3 100644 --- a/src/controller/java/BUILD.gn +++ b/src/controller/java/BUILD.gn @@ -177,7 +177,7 @@ if (chip_link_tests) { } kotlin_library("tlv") { - output_name = "libCHIPTlv.jar" + output_name = "libMatterTlv.jar" sources = [ "src/matter/tlv/Element.kt", @@ -236,7 +236,7 @@ kotlin_library("tlv_read_write_test") { } kotlin_library("jsontlv") { - output_name = "libCHIPJson.jar" + output_name = "libMatterJson.jar" deps = [ ":tlv", diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java index 62c12f62001130..23afc530dd458b 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java @@ -6062,8 +6062,23 @@ public void testEventTrigger(DefaultClusterCallback callback, byte[] enableKey, testEventTrigger(chipClusterPtr, callback, enableKey, eventTrigger, timedInvokeTimeoutMs); } + public void timeSnapshot(TimeSnapshotResponseCallback callback) { + timeSnapshot(chipClusterPtr, callback, null); + } + + public void timeSnapshot(TimeSnapshotResponseCallback callback, int timedInvokeTimeoutMs) { + timeSnapshot(chipClusterPtr, callback, timedInvokeTimeoutMs); + } + private native void testEventTrigger(long chipClusterPtr, DefaultClusterCallback callback, byte[] enableKey, Long eventTrigger, @Nullable Integer timedInvokeTimeoutMs); + private native void timeSnapshot(long chipClusterPtr, TimeSnapshotResponseCallback callback, @Nullable Integer timedInvokeTimeoutMs); + + public interface TimeSnapshotResponseCallback { + void onSuccess(Long systemTimeUs, @Nullable Long UTCTimeUs); + void onError(Exception error); + } + public interface NetworkInterfacesAttributeCallback { void onSuccess(List value); void onError(Exception ex); @@ -13654,6 +13669,215 @@ public void subscribeClusterRevisionAttribute( private native void subscribeClusterRevisionAttribute(long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } + public static class MicrowaveOvenControlCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 95L; + + public MicrowaveOvenControlCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId); + } + + @Override + public native long initWithDevice(long devicePtr, int endpointId); + + public void setCookingParameters(DefaultClusterCallback callback, Optional cookMode, Optional cookTime, Optional powerSetting) { + setCookingParameters(chipClusterPtr, callback, cookMode, cookTime, powerSetting, null); + } + + public void setCookingParameters(DefaultClusterCallback callback, Optional cookMode, Optional cookTime, Optional powerSetting, int timedInvokeTimeoutMs) { + setCookingParameters(chipClusterPtr, callback, cookMode, cookTime, powerSetting, timedInvokeTimeoutMs); + } + + public void addMoreTime(DefaultClusterCallback callback, Long timeToAdd) { + addMoreTime(chipClusterPtr, callback, timeToAdd, null); + } + + public void addMoreTime(DefaultClusterCallback callback, Long timeToAdd, int timedInvokeTimeoutMs) { + addMoreTime(chipClusterPtr, callback, timeToAdd, timedInvokeTimeoutMs); + } + + private native void setCookingParameters(long chipClusterPtr, DefaultClusterCallback callback, Optional cookMode, Optional cookTime, Optional powerSetting, @Nullable Integer timedInvokeTimeoutMs); + + private native void addMoreTime(long chipClusterPtr, DefaultClusterCallback callback, Long timeToAdd, @Nullable Integer timedInvokeTimeoutMs); + + public interface GeneratedCommandListAttributeCallback { + void onSuccess(List value); + void onError(Exception ex); + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface AcceptedCommandListAttributeCallback { + void onSuccess(List value); + void onError(Exception ex); + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface EventListAttributeCallback { + void onSuccess(List value); + void onError(Exception ex); + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface AttributeListAttributeCallback { + void onSuccess(List value); + void onError(Exception ex); + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public void readCookTimeAttribute( + LongAttributeCallback callback) { + readCookTimeAttribute(chipClusterPtr, callback); + } + + public void subscribeCookTimeAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + subscribeCookTimeAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readPowerSettingAttribute( + IntegerAttributeCallback callback) { + readPowerSettingAttribute(chipClusterPtr, callback); + } + + public void subscribePowerSettingAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribePowerSettingAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readMinPowerAttribute( + IntegerAttributeCallback callback) { + readMinPowerAttribute(chipClusterPtr, callback); + } + + public void subscribeMinPowerAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeMinPowerAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readMaxPowerAttribute( + IntegerAttributeCallback callback) { + readMaxPowerAttribute(chipClusterPtr, callback); + } + + public void subscribeMaxPowerAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeMaxPowerAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readPowerStepAttribute( + IntegerAttributeCallback callback) { + readPowerStepAttribute(chipClusterPtr, callback); + } + + public void subscribePowerStepAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribePowerStepAttribute(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 readCookTimeAttribute(long chipClusterPtr, LongAttributeCallback callback); + + private native void subscribeCookTimeAttribute(long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); + + private native void readPowerSettingAttribute(long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribePowerSettingAttribute(long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readMinPowerAttribute(long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeMinPowerAttribute(long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readMaxPowerAttribute(long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeMaxPowerAttribute(long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readPowerStepAttribute(long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribePowerStepAttribute(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 OperationalStateCluster extends BaseChipCluster { public static final long CLUSTER_ID = 96L; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java index 413541bdf799b4..792350d7595992 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java @@ -187,6 +187,9 @@ public static BaseCluster getCluster(long clusterId) { if (clusterId == DishwasherAlarm.ID) { return new DishwasherAlarm(); } + if (clusterId == MicrowaveOvenControl.ID) { + return new MicrowaveOvenControl(); + } if (clusterId == OperationalState.ID) { return new OperationalState(); } @@ -3800,7 +3803,8 @@ public static Event value(long id) throws NoSuchFieldError { } public enum Command { - TestEventTrigger(0L),; + TestEventTrigger(0L), + TimeSnapshot(1L),; private final long id; Command(long id) { this.id = id; @@ -7531,6 +7535,147 @@ public long getCommandID(String name) throws IllegalArgumentException { return Command.valueOf(name).getID(); } } + public static class MicrowaveOvenControl implements BaseCluster { + public static final long ID = 95L; + public long getID() { + return ID; + } + + public enum Attribute { + CookTime(1L), + PowerSetting(2L), + MinPower(3L), + MaxPower(4L), + PowerStep(5L), + GeneratedCommandList(65528L), + AcceptedCommandList(65529L), + EventList(65530L), + AttributeList(65531L), + FeatureMap(65532L), + ClusterRevision(65533L),; + private final long id; + Attribute(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Attribute value(long id) throws NoSuchFieldError { + for (Attribute attribute : Attribute.values()) { + if (attribute.getID() == id) { + return attribute; + } + } + throw new NoSuchFieldError(); + } + } + + public enum Event {; + private final long id; + Event(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Event value(long id) throws NoSuchFieldError { + for (Event event : Event.values()) { + if (event.getID() == id) { + return event; + } + } + throw new NoSuchFieldError(); + } + } + + public enum Command { + SetCookingParameters(0L), + AddMoreTime(1L),; + private final long id; + Command(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Command value(long id) throws NoSuchFieldError { + for (Command command : Command.values()) { + if (command.getID() == id) { + return command; + } + } + throw new NoSuchFieldError(); + } + }public enum SetCookingParametersCommandField {CookMode(0),CookTime(1),PowerSetting(2),; + private final int id; + SetCookingParametersCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static SetCookingParametersCommandField value(int id) throws NoSuchFieldError { + for (SetCookingParametersCommandField field : SetCookingParametersCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum AddMoreTimeCommandField {TimeToAdd(0),; + private final int id; + AddMoreTimeCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static AddMoreTimeCommandField value(int id) throws NoSuchFieldError { + for (AddMoreTimeCommandField field : AddMoreTimeCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }@Override + public String getAttributeName(long id) throws NoSuchFieldError { + return Attribute.value(id).toString(); + } + + @Override + public String getEventName(long id) throws NoSuchFieldError { + return Event.value(id).toString(); + } + + @Override + public String getCommandName(long id) throws NoSuchFieldError { + return Command.value(id).toString(); + } + + @Override + public long getAttributeID(String name) throws IllegalArgumentException { + return Attribute.valueOf(name).getID(); + } + + @Override + public long getEventID(String name) throws IllegalArgumentException { + return Event.valueOf(name).getID(); + } + + @Override + public long getCommandID(String name) throws IllegalArgumentException { + return Command.valueOf(name).getID(); + } + } public static class OperationalState implements BaseCluster { public static final long ID = 96L; public long getID() { diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java index a051e4d5b071b8..340add6c45dd40 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java @@ -3638,6 +3638,30 @@ public void onError(Exception ex) { } } + + public static class DelegatedGeneralDiagnosticsClusterTimeSnapshotResponseCallback implements ChipClusters.GeneralDiagnosticsCluster.TimeSnapshotResponseCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(Long systemTimeUs, @Nullable Long UTCTimeUs) { + Map responseValues = new LinkedHashMap<>(); + + CommandResponseInfo systemTimeUsResponseValue = new CommandResponseInfo("systemTimeUs", "Long"); + responseValues.put(systemTimeUsResponseValue, systemTimeUs); + CommandResponseInfo UTCTimeUsResponseValue = new CommandResponseInfo("UTCTimeUs", "Long"); + responseValues.put(UTCTimeUsResponseValue, UTCTimeUs); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } public static class DelegatedGeneralDiagnosticsClusterNetworkInterfacesAttributeCallback implements ChipClusters.GeneralDiagnosticsCluster.NetworkInterfacesAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override @@ -8122,6 +8146,90 @@ public void onError(Exception ex) { } } + public static class DelegatedMicrowaveOvenControlClusterGeneratedCommandListAttributeCallback implements ChipClusters.MicrowaveOvenControlCluster.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 DelegatedMicrowaveOvenControlClusterAcceptedCommandListAttributeCallback implements ChipClusters.MicrowaveOvenControlCluster.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 DelegatedMicrowaveOvenControlClusterEventListAttributeCallback implements ChipClusters.MicrowaveOvenControlCluster.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 DelegatedMicrowaveOvenControlClusterAttributeListAttributeCallback implements ChipClusters.MicrowaveOvenControlCluster.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 DelegatedOperationalStateClusterOperationalCommandResponseCallback implements ChipClusters.OperationalStateCluster.OperationalCommandResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -17041,6 +17149,10 @@ public Map initializeClusterMap() { (ptr, endpointId) -> new ChipClusters.DishwasherAlarmCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("dishwasherAlarm", dishwasherAlarmClusterInfo); + ClusterInfo microwaveOvenControlClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.MicrowaveOvenControlCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("microwaveOvenControl", microwaveOvenControlClusterInfo); + ClusterInfo operationalStateClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.OperationalStateCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("operationalState", operationalStateClusterInfo); @@ -17278,6 +17390,7 @@ public void combineCommand(Map destination, Map> getCommandMap() { ); generalDiagnosticsClusterInteractionInfoMap.put("testEventTrigger", generalDiagnosticstestEventTriggerInteractionInfo); + Map generalDiagnosticstimeSnapshotCommandParams = new LinkedHashMap(); + InteractionInfo generalDiagnosticstimeSnapshotInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.GeneralDiagnosticsCluster) cluster) + .timeSnapshot((ChipClusters.GeneralDiagnosticsCluster.TimeSnapshotResponseCallback) callback + ); + }, + () -> new DelegatedGeneralDiagnosticsClusterTimeSnapshotResponseCallback(), + generalDiagnosticstimeSnapshotCommandParams + ); + generalDiagnosticsClusterInteractionInfoMap.put("timeSnapshot", generalDiagnosticstimeSnapshotInteractionInfo); + commandMap.put("generalDiagnostics", generalDiagnosticsClusterInteractionInfoMap); Map softwareDiagnosticsClusterInteractionInfoMap = new LinkedHashMap<>(); @@ -19741,6 +19866,54 @@ public Map> getCommandMap() { commandMap.put("dishwasherAlarm", dishwasherAlarmClusterInteractionInfoMap); + Map microwaveOvenControlClusterInteractionInfoMap = new LinkedHashMap<>(); + + Map microwaveOvenControlsetCookingParametersCommandParams = new LinkedHashMap(); + + CommandParameterInfo microwaveOvenControlsetCookingParameterscookModeCommandParameterInfo = new CommandParameterInfo("cookMode", Optional.class, Integer.class); + microwaveOvenControlsetCookingParametersCommandParams.put("cookMode",microwaveOvenControlsetCookingParameterscookModeCommandParameterInfo); + + CommandParameterInfo microwaveOvenControlsetCookingParameterscookTimeCommandParameterInfo = new CommandParameterInfo("cookTime", Optional.class, Long.class); + microwaveOvenControlsetCookingParametersCommandParams.put("cookTime",microwaveOvenControlsetCookingParameterscookTimeCommandParameterInfo); + + CommandParameterInfo microwaveOvenControlsetCookingParameterspowerSettingCommandParameterInfo = new CommandParameterInfo("powerSetting", Optional.class, Integer.class); + microwaveOvenControlsetCookingParametersCommandParams.put("powerSetting",microwaveOvenControlsetCookingParameterspowerSettingCommandParameterInfo); + InteractionInfo microwaveOvenControlsetCookingParametersInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MicrowaveOvenControlCluster) cluster) + .setCookingParameters((DefaultClusterCallback) callback + , (Optional) + commandArguments.get("cookMode") + , (Optional) + commandArguments.get("cookTime") + , (Optional) + commandArguments.get("powerSetting") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + microwaveOvenControlsetCookingParametersCommandParams + ); + microwaveOvenControlClusterInteractionInfoMap.put("setCookingParameters", microwaveOvenControlsetCookingParametersInteractionInfo); + + Map microwaveOvenControladdMoreTimeCommandParams = new LinkedHashMap(); + + CommandParameterInfo microwaveOvenControladdMoreTimetimeToAddCommandParameterInfo = new CommandParameterInfo("timeToAdd", Long.class, Long.class); + microwaveOvenControladdMoreTimeCommandParams.put("timeToAdd",microwaveOvenControladdMoreTimetimeToAddCommandParameterInfo); + InteractionInfo microwaveOvenControladdMoreTimeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MicrowaveOvenControlCluster) cluster) + .addMoreTime((DefaultClusterCallback) callback + , (Long) + commandArguments.get("timeToAdd") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + microwaveOvenControladdMoreTimeCommandParams + ); + microwaveOvenControlClusterInteractionInfoMap.put("addMoreTime", microwaveOvenControladdMoreTimeInteractionInfo); + + commandMap.put("microwaveOvenControl", microwaveOvenControlClusterInteractionInfoMap); + Map operationalStateClusterInteractionInfoMap = new LinkedHashMap<>(); Map operationalStatepauseCommandParams = new LinkedHashMap(); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java index 8fc29e53155f78..a8c56baddaa892 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java @@ -7453,6 +7453,131 @@ private static Map readDishwasherAlarmInteractionInfo() return result; } + private static Map readMicrowaveOvenControlInteractionInfo() { + Map result = new LinkedHashMap<>();Map readMicrowaveOvenControlCookTimeCommandParams = new LinkedHashMap(); + InteractionInfo readMicrowaveOvenControlCookTimeAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MicrowaveOvenControlCluster) cluster).readCookTimeAttribute( + (ChipClusters.LongAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readMicrowaveOvenControlCookTimeCommandParams + ); + result.put("readCookTimeAttribute", readMicrowaveOvenControlCookTimeAttributeInteractionInfo); + Map readMicrowaveOvenControlPowerSettingCommandParams = new LinkedHashMap(); + InteractionInfo readMicrowaveOvenControlPowerSettingAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MicrowaveOvenControlCluster) cluster).readPowerSettingAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readMicrowaveOvenControlPowerSettingCommandParams + ); + result.put("readPowerSettingAttribute", readMicrowaveOvenControlPowerSettingAttributeInteractionInfo); + Map readMicrowaveOvenControlMinPowerCommandParams = new LinkedHashMap(); + InteractionInfo readMicrowaveOvenControlMinPowerAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MicrowaveOvenControlCluster) cluster).readMinPowerAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readMicrowaveOvenControlMinPowerCommandParams + ); + result.put("readMinPowerAttribute", readMicrowaveOvenControlMinPowerAttributeInteractionInfo); + Map readMicrowaveOvenControlMaxPowerCommandParams = new LinkedHashMap(); + InteractionInfo readMicrowaveOvenControlMaxPowerAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MicrowaveOvenControlCluster) cluster).readMaxPowerAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readMicrowaveOvenControlMaxPowerCommandParams + ); + result.put("readMaxPowerAttribute", readMicrowaveOvenControlMaxPowerAttributeInteractionInfo); + Map readMicrowaveOvenControlPowerStepCommandParams = new LinkedHashMap(); + InteractionInfo readMicrowaveOvenControlPowerStepAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MicrowaveOvenControlCluster) cluster).readPowerStepAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readMicrowaveOvenControlPowerStepCommandParams + ); + result.put("readPowerStepAttribute", readMicrowaveOvenControlPowerStepAttributeInteractionInfo); + Map readMicrowaveOvenControlGeneratedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readMicrowaveOvenControlGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MicrowaveOvenControlCluster) cluster).readGeneratedCommandListAttribute( + (ChipClusters.MicrowaveOvenControlCluster.GeneratedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedMicrowaveOvenControlClusterGeneratedCommandListAttributeCallback(), + readMicrowaveOvenControlGeneratedCommandListCommandParams + ); + result.put("readGeneratedCommandListAttribute", readMicrowaveOvenControlGeneratedCommandListAttributeInteractionInfo); + Map readMicrowaveOvenControlAcceptedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readMicrowaveOvenControlAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MicrowaveOvenControlCluster) cluster).readAcceptedCommandListAttribute( + (ChipClusters.MicrowaveOvenControlCluster.AcceptedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedMicrowaveOvenControlClusterAcceptedCommandListAttributeCallback(), + readMicrowaveOvenControlAcceptedCommandListCommandParams + ); + result.put("readAcceptedCommandListAttribute", readMicrowaveOvenControlAcceptedCommandListAttributeInteractionInfo); + Map readMicrowaveOvenControlEventListCommandParams = new LinkedHashMap(); + InteractionInfo readMicrowaveOvenControlEventListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MicrowaveOvenControlCluster) cluster).readEventListAttribute( + (ChipClusters.MicrowaveOvenControlCluster.EventListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedMicrowaveOvenControlClusterEventListAttributeCallback(), + readMicrowaveOvenControlEventListCommandParams + ); + result.put("readEventListAttribute", readMicrowaveOvenControlEventListAttributeInteractionInfo); + Map readMicrowaveOvenControlAttributeListCommandParams = new LinkedHashMap(); + InteractionInfo readMicrowaveOvenControlAttributeListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MicrowaveOvenControlCluster) cluster).readAttributeListAttribute( + (ChipClusters.MicrowaveOvenControlCluster.AttributeListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedMicrowaveOvenControlClusterAttributeListAttributeCallback(), + readMicrowaveOvenControlAttributeListCommandParams + ); + result.put("readAttributeListAttribute", readMicrowaveOvenControlAttributeListAttributeInteractionInfo); + Map readMicrowaveOvenControlFeatureMapCommandParams = new LinkedHashMap(); + InteractionInfo readMicrowaveOvenControlFeatureMapAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MicrowaveOvenControlCluster) cluster).readFeatureMapAttribute( + (ChipClusters.LongAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readMicrowaveOvenControlFeatureMapCommandParams + ); + result.put("readFeatureMapAttribute", readMicrowaveOvenControlFeatureMapAttributeInteractionInfo); + Map readMicrowaveOvenControlClusterRevisionCommandParams = new LinkedHashMap(); + InteractionInfo readMicrowaveOvenControlClusterRevisionAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MicrowaveOvenControlCluster) cluster).readClusterRevisionAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readMicrowaveOvenControlClusterRevisionCommandParams + ); + result.put("readClusterRevisionAttribute", readMicrowaveOvenControlClusterRevisionAttributeInteractionInfo); + + return result; + } private static Map readOperationalStateInteractionInfo() { Map result = new LinkedHashMap<>();Map readOperationalStatePhaseListCommandParams = new LinkedHashMap(); InteractionInfo readOperationalStatePhaseListAttributeInteractionInfo = new InteractionInfo( @@ -17524,6 +17649,7 @@ public Map> getReadAttributeMap() { put("airQuality", readAirQualityInteractionInfo()); put("smokeCoAlarm", readSmokeCoAlarmInteractionInfo()); put("dishwasherAlarm", readDishwasherAlarmInteractionInfo()); + put("microwaveOvenControl", readMicrowaveOvenControlInteractionInfo()); put("operationalState", readOperationalStateInteractionInfo()); put("rvcOperationalState", readRvcOperationalStateInteractionInfo()); 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 eaf536bf0f76cd..4631e7a257cf35 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java @@ -1034,6 +1034,8 @@ public Map> getWriteAttributeMap() { writeAttributeMap.put("smokeCoAlarm", writeSmokeCoAlarmInteractionInfo); Map writeDishwasherAlarmInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("dishwasherAlarm", writeDishwasherAlarmInteractionInfo); + Map writeMicrowaveOvenControlInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("microwaveOvenControl", writeMicrowaveOvenControlInteractionInfo); Map writeOperationalStateInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("operationalState", writeOperationalStateInteractionInfo); Map writeRvcOperationalStateInteractionInfo = new LinkedHashMap<>(); diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index a6d9ea102648fb..b78186b015e332 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -448,7 +448,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jobject value; std::string valueClassName = "java/lang/Integer"; std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); + jint jnivalue = static_cast(cppValue.Raw()); chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, value); return value; @@ -15859,6 +15859,228 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } + case app::Clusters::MicrowaveOvenControl::Id: { + using namespace app::Clusters::MicrowaveOvenControl; + switch (aPath.mAttributeId) + { + case Attributes::CookTime::Id: { + using TypeInfo = Attributes::CookTime::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"; + jlong jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::PowerSetting::Id: { + using TypeInfo = Attributes::PowerSetting::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"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + case Attributes::MinPower::Id: { + using TypeInfo = Attributes::MinPower::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"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + case Attributes::MaxPower::Id: { + using TypeInfo = Attributes::MaxPower::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"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + case Attributes::PowerStep::Id: { + using TypeInfo = Attributes::PowerStep::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"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + 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"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_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"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_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"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_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"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_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"; + jlong jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, 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"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + break; + } + break; + } case app::Clusters::OperationalState::Id: { using namespace app::Clusters::OperationalState; switch (aPath.mAttributeId) diff --git a/src/controller/java/zap-generated/CHIPClientCallbacks.h b/src/controller/java/zap-generated/CHIPClientCallbacks.h index 30c2b580433cd9..ed4ee39880b20d 100644 --- a/src/controller/java/zap-generated/CHIPClientCallbacks.h +++ b/src/controller/java/zap-generated/CHIPClientCallbacks.h @@ -595,6 +595,14 @@ typedef void (*DishwasherAlarmEventListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); typedef void (*DishwasherAlarmAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*MicrowaveOvenControlGeneratedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*MicrowaveOvenControlAcceptedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*MicrowaveOvenControlEventListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +typedef void (*MicrowaveOvenControlAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); typedef void (*OperationalStatePhaseListListAttributeCallback)( void * context, const chip::app::DataModel::Nullable> & data); typedef void (*OperationalStateOperationalStateListListAttributeCallback)( diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp index 0a096db6a8e36c..a5ae8d8871b781 100644 --- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp @@ -3043,6 +3043,16 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } + case app::Clusters::MicrowaveOvenControl::Id: { + using namespace app::Clusters::MicrowaveOvenControl; + switch (aPath.mEventId) + { + default: + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + break; + } + break; + } case app::Clusters::OperationalState::Id: { using namespace app::Clusters::OperationalState; switch (aPath.mEventId) diff --git a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp index f2a81f98fc819b..6c7d8b46e8a37d 100644 --- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp @@ -2202,6 +2202,81 @@ void CHIPDiagnosticLogsClusterRetrieveLogsResponseCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, Status, LogContent, UTCTimeStamp, TimeSinceBoot); } +CHIPGeneralDiagnosticsClusterTimeSnapshotResponseCallback::CHIPGeneralDiagnosticsClusterTimeSnapshotResponseCallback( + 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"); + } +} + +CHIPGeneralDiagnosticsClusterTimeSnapshotResponseCallback::~CHIPGeneralDiagnosticsClusterTimeSnapshotResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPGeneralDiagnosticsClusterTimeSnapshotResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::GeneralDiagnostics::Commands::TimeSnapshotResponse::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;Ljava/lang/Long;)V", + &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject SystemTimeUs; + std::string SystemTimeUsClassName = "java/lang/Long"; + std::string SystemTimeUsCtorSignature = "(J)V"; + jlong jniSystemTimeUs = static_cast(dataResponse.systemTimeUs); + chip::JniReferences::GetInstance().CreateBoxedObject(SystemTimeUsClassName.c_str(), SystemTimeUsCtorSignature.c_str(), + jniSystemTimeUs, SystemTimeUs); + jobject UTCTimeUs; + if (dataResponse.UTCTimeUs.IsNull()) + { + UTCTimeUs = nullptr; + } + else + { + std::string UTCTimeUsClassName = "java/lang/Long"; + std::string UTCTimeUsCtorSignature = "(J)V"; + jlong jniUTCTimeUs = static_cast(dataResponse.UTCTimeUs.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject(UTCTimeUsClassName.c_str(), UTCTimeUsCtorSignature.c_str(), + jniUTCTimeUs, UTCTimeUs); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, SystemTimeUs, UTCTimeUs); +} CHIPTimeSynchronizationClusterSetTimeZoneResponseCallback::CHIPTimeSynchronizationClusterSetTimeZoneResponseCallback( 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 4bb4afe2fe72ba..c6afa9916c41fa 100644 --- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.h +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.h @@ -342,6 +342,21 @@ class CHIPDiagnosticLogsClusterRetrieveLogsResponseCallback jobject javaCallbackRef; }; +class CHIPGeneralDiagnosticsClusterTimeSnapshotResponseCallback + : public Callback::Callback +{ +public: + CHIPGeneralDiagnosticsClusterTimeSnapshotResponseCallback(jobject javaCallback); + + ~CHIPGeneralDiagnosticsClusterTimeSnapshotResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::GeneralDiagnostics::Commands::TimeSnapshotResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + class CHIPTimeSynchronizationClusterSetTimeZoneResponseCallback : public Callback::Callback { diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index f71fce0e5c8de4..f9194b8b06d9eb 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -24823,6 +24823,293 @@ void CHIPDishwasherAlarmAttributeListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } +CHIPMicrowaveOvenControlGeneratedCommandListAttributeCallback::CHIPMicrowaveOvenControlGeneratedCommandListAttributeCallback( + 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"); + } +} + +CHIPMicrowaveOvenControlGeneratedCommandListAttributeCallback::~CHIPMicrowaveOvenControlGeneratedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPMicrowaveOvenControlGeneratedCommandListAttributeCallback::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"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPMicrowaveOvenControlAcceptedCommandListAttributeCallback::CHIPMicrowaveOvenControlAcceptedCommandListAttributeCallback( + 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"); + } +} + +CHIPMicrowaveOvenControlAcceptedCommandListAttributeCallback::~CHIPMicrowaveOvenControlAcceptedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPMicrowaveOvenControlAcceptedCommandListAttributeCallback::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"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPMicrowaveOvenControlEventListAttributeCallback::CHIPMicrowaveOvenControlEventListAttributeCallback(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"); + } +} + +CHIPMicrowaveOvenControlEventListAttributeCallback::~CHIPMicrowaveOvenControlEventListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPMicrowaveOvenControlEventListAttributeCallback::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"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPMicrowaveOvenControlAttributeListAttributeCallback::CHIPMicrowaveOvenControlAttributeListAttributeCallback(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"); + } +} + +CHIPMicrowaveOvenControlAttributeListAttributeCallback::~CHIPMicrowaveOvenControlAttributeListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPMicrowaveOvenControlAttributeListAttributeCallback::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"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + CHIPOperationalStatePhaseListAttributeCallback::CHIPOperationalStatePhaseListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index efa9adc53cfdab..4946c669d88dab 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -2397,6 +2397,12 @@ class ChipClusters: "eventTrigger": "int", }, }, + 0x00000001: { + "commandId": 0x00000001, + "commandName": "TimeSnapshot", + "args": { + }, + }, }, "attributes": { 0x00000000: { @@ -5257,6 +5263,96 @@ class ChipClusters: }, }, } + _MICROWAVE_OVEN_CONTROL_CLUSTER_INFO = { + "clusterName": "MicrowaveOvenControl", + "clusterId": 0x0000005F, + "commands": { + 0x00000000: { + "commandId": 0x00000000, + "commandName": "SetCookingParameters", + "args": { + "cookMode": "int", + "cookTime": "int", + "powerSetting": "int", + }, + }, + 0x00000001: { + "commandId": 0x00000001, + "commandName": "AddMoreTime", + "args": { + "timeToAdd": "int", + }, + }, + }, + "attributes": { + 0x00000001: { + "attributeName": "CookTime", + "attributeId": 0x00000001, + "type": "int", + "reportable": True, + }, + 0x00000002: { + "attributeName": "PowerSetting", + "attributeId": 0x00000002, + "type": "int", + "reportable": True, + }, + 0x00000003: { + "attributeName": "MinPower", + "attributeId": 0x00000003, + "type": "int", + "reportable": True, + }, + 0x00000004: { + "attributeName": "MaxPower", + "attributeId": 0x00000004, + "type": "int", + "reportable": True, + }, + 0x00000005: { + "attributeName": "PowerStep", + "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, + }, + }, + } _OPERATIONAL_STATE_CLUSTER_INFO = { "clusterName": "OperationalState", "clusterId": 0x00000060, @@ -12242,6 +12338,7 @@ class ChipClusters: 0x0000005B: _AIR_QUALITY_CLUSTER_INFO, 0x0000005C: _SMOKE_CO_ALARM_CLUSTER_INFO, 0x0000005D: _DISHWASHER_ALARM_CLUSTER_INFO, + 0x0000005F: _MICROWAVE_OVEN_CONTROL_CLUSTER_INFO, 0x00000060: _OPERATIONAL_STATE_CLUSTER_INFO, 0x00000061: _RVC_OPERATIONAL_STATE_CLUSTER_INFO, 0x00000071: _HEPA_FILTER_MONITORING_CLUSTER_INFO, @@ -12343,6 +12440,7 @@ class ChipClusters: "AirQuality": _AIR_QUALITY_CLUSTER_INFO, "SmokeCoAlarm": _SMOKE_CO_ALARM_CLUSTER_INFO, "DishwasherAlarm": _DISHWASHER_ALARM_CLUSTER_INFO, + "MicrowaveOvenControl": _MICROWAVE_OVEN_CONTROL_CLUSTER_INFO, "OperationalState": _OPERATIONAL_STATE_CLUSTER_INFO, "RvcOperationalState": _RVC_OPERATIONAL_STATE_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 38c92ee15ed234..216dde98086885 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -622,14 +622,17 @@ def descriptor(cls) -> ClusterObjectDescriptor: clusterRevision: 'uint' = None class Bitmaps: + class CopyModeBitmap(IntFlag): + kCopyAllScenes = 0x1 + class Feature(IntFlag): kSceneNames = 0x1 kExplicit = 0x2 kTableSize = 0x4 kFabricScenes = 0x8 - class ScenesCopyMode(IntFlag): - kCopyAllScenes = 0x1 + class NameSupportBitmap(IntFlag): + kSceneNames = 0x80 class Structs: @dataclass @@ -8346,6 +8349,37 @@ def descriptor(cls) -> ClusterObjectDescriptor: enableKey: 'bytes' = b"" eventTrigger: 'uint' = 0 + @dataclass + class TimeSnapshot(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000033 + command_id: typing.ClassVar[int] = 0x00000001 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = 'TimeSnapshotResponse' + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ]) + + @dataclass + class TimeSnapshotResponse(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000033 + command_id: typing.ClassVar[int] = 0x00000002 + is_client: typing.ClassVar[bool] = False + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="systemTimeUs", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="UTCTimeUs", Tag=1, Type=typing.Union[Nullable, uint]), + ]) + + systemTimeUs: 'uint' = 0 + UTCTimeUs: 'typing.Union[Nullable, uint]' = NullValue + class Attributes: @dataclass class NetworkInterfaces(ClusterAttributeDescriptor): @@ -18418,6 +18452,254 @@ def descriptor(cls) -> ClusterObjectDescriptor: mask: 'uint' = 0 +@dataclass +class MicrowaveOvenControl(Cluster): + id: typing.ClassVar[int] = 0x0000005F + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="cookTime", Tag=0x00000001, Type=uint), + ClusterObjectFieldDescriptor(Label="powerSetting", Tag=0x00000002, Type=uint), + ClusterObjectFieldDescriptor(Label="minPower", Tag=0x00000003, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="maxPower", Tag=0x00000004, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="powerStep", 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), + ]) + + cookTime: 'uint' = None + powerSetting: 'uint' = None + minPower: 'typing.Optional[uint]' = None + maxPower: 'typing.Optional[uint]' = None + powerStep: '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 Commands: + @dataclass + class SetCookingParameters(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x0000005F + command_id: typing.ClassVar[int] = 0x00000000 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="cookMode", Tag=0, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="cookTime", Tag=1, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="powerSetting", Tag=2, Type=typing.Optional[uint]), + ]) + + cookMode: 'typing.Optional[uint]' = None + cookTime: 'typing.Optional[uint]' = None + powerSetting: 'typing.Optional[uint]' = None + + @dataclass + class AddMoreTime(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x0000005F + command_id: typing.ClassVar[int] = 0x00000001 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="timeToAdd", Tag=0, Type=uint), + ]) + + timeToAdd: 'uint' = 0 + + class Attributes: + @dataclass + class CookTime(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0000005F + + @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 PowerSetting(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0000005F + + @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 MinPower(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0000005F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000003 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + + @dataclass + class MaxPower(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0000005F + + @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 PowerStep(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0000005F + + @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 0x0000005F + + @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 0x0000005F + + @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 0x0000005F + + @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 0x0000005F + + @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 0x0000005F + + @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 0x0000005F + + @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 OperationalState(Cluster): id: typing.ClassVar[int] = 0x00000060 @@ -27573,7 +27855,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="measuredValue", Tag=0x00000000, Type=typing.Union[Nullable, int]), ClusterObjectFieldDescriptor(Label="minMeasuredValue", Tag=0x00000001, Type=typing.Union[Nullable, int]), ClusterObjectFieldDescriptor(Label="maxMeasuredValue", Tag=0x00000002, Type=typing.Union[Nullable, int]), - ClusterObjectFieldDescriptor(Label="tolerance", Tag=0x00000003, Type=typing.Optional[int]), + ClusterObjectFieldDescriptor(Label="tolerance", Tag=0x00000003, 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]), @@ -27585,7 +27867,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: measuredValue: 'typing.Union[Nullable, int]' = None minMeasuredValue: 'typing.Union[Nullable, int]' = None maxMeasuredValue: 'typing.Union[Nullable, int]' = None - tolerance: 'typing.Optional[int]' = None + tolerance: 'typing.Optional[uint]' = None generatedCommandList: 'typing.List[uint]' = None acceptedCommandList: 'typing.List[uint]' = None eventList: 'typing.List[uint]' = None @@ -27654,9 +27936,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - value: 'typing.Optional[int]' = None + value: 'typing.Optional[uint]' = None @dataclass class GeneratedCommandList(ClusterAttributeDescriptor): diff --git a/src/credentials/CHIPCert.cpp b/src/credentials/CHIPCert.cpp index 425d30a2d9a396..93f924f42051a7 100644 --- a/src/credentials/CHIPCert.cpp +++ b/src/credentials/CHIPCert.cpp @@ -31,7 +31,7 @@ #include -#include +#include #include #include #include @@ -468,6 +468,7 @@ ChipCertificateData::~ChipCertificateData() {} void ChipCertificateData::Clear() { + mSerialNumber = ByteSpan(); mSubjectDN.Clear(); mIssuerDN.Clear(); mSubjectKeyId = CertificateKeyId(); @@ -612,6 +613,13 @@ CHIP_ERROR ChipDN::GetCertType(CertType & certType) const bool catsPresent = false; uint8_t rdnCount = RDNCount(); + if (rdnCount == 1 && rdn[0].mAttrOID == kOID_AttributeType_CommonName && !rdn[0].mAttrIsPrintableString && + rdn[0].mString.data_equal(kNetworkIdentityCN)) + { + certType = CertType::kNetworkIdentity; + return CHIP_NO_ERROR; + } + certType = CertType::kNotSpecified; for (uint8_t i = 0; i < rdnCount; i++) @@ -672,6 +680,7 @@ CHIP_ERROR ChipDN::GetCertType(CertType & certType) const CHIP_ERROR ChipDN::GetCertChipId(uint64_t & chipId) const { uint8_t rdnCount = RDNCount(); + bool foundId = false; chipId = 0; @@ -683,15 +692,17 @@ CHIP_ERROR ChipDN::GetCertChipId(uint64_t & chipId) const case kOID_AttributeType_MatterICACId: case kOID_AttributeType_MatterNodeId: case kOID_AttributeType_MatterFirmwareSigningId: - VerifyOrReturnError(chipId == 0, CHIP_ERROR_WRONG_CERT_DN); + VerifyOrReturnError(!foundId, CHIP_ERROR_WRONG_CERT_DN); - chipId = rdn[i].mChipVal; + chipId = rdn[i].mChipVal; + foundId = true; break; default: break; } } + VerifyOrReturnError(foundId, CHIP_ERROR_WRONG_CERT_DN); return CHIP_NO_ERROR; } @@ -1304,78 +1315,48 @@ CHIP_ERROR ExtractCATsFromOpCert(const ChipCertificateData & opcert, CATValues & CHIP_ERROR ExtractFabricIdFromCert(const ByteSpan & opcert, FabricId * fabricId) { - ChipCertificateSet certSet; ChipCertificateData certData; - ReturnErrorOnFailure(certSet.Init(&certData, 1)); - ReturnErrorOnFailure(certSet.LoadCert(opcert, BitFlags())); + ReturnErrorOnFailure(DecodeChipCert(opcert, certData)); return ExtractFabricIdFromCert(certData, fabricId); } CHIP_ERROR ExtractNodeIdFabricIdFromOpCert(const ByteSpan & opcert, NodeId * nodeId, FabricId * fabricId) { - ChipCertificateSet certSet; ChipCertificateData certData; - - ReturnErrorOnFailure(certSet.Init(&certData, 1)); - - ReturnErrorOnFailure(certSet.LoadCert(opcert, BitFlags())); - + ReturnErrorOnFailure(DecodeChipCert(opcert, certData)); return ExtractNodeIdFabricIdFromOpCert(certData, nodeId, fabricId); } CHIP_ERROR ExtractPublicKeyFromChipCert(const ByteSpan & chipCert, P256PublicKeySpan & publicKey) { - ChipCertificateSet certSet; ChipCertificateData certData; - - ReturnErrorOnFailure(certSet.Init(&certData, 1)); - - ReturnErrorOnFailure(certSet.LoadCert(chipCert, BitFlags())); - + ReturnErrorOnFailure(DecodeChipCert(chipCert, certData)); publicKey = certData.mPublicKey; - return CHIP_NO_ERROR; } CHIP_ERROR ExtractNotBeforeFromChipCert(const ByteSpan & chipCert, chip::System::Clock::Seconds32 & notBeforeChipEpochTime) { - ChipCertificateSet certSet; ChipCertificateData certData; - - ReturnErrorOnFailure(certSet.Init(&certData, 1)); - - ReturnErrorOnFailure(certSet.LoadCert(chipCert, BitFlags())); - + ReturnErrorOnFailure(DecodeChipCert(chipCert, certData)); notBeforeChipEpochTime = chip::System::Clock::Seconds32(certData.mNotBeforeTime); - return CHIP_NO_ERROR; } CHIP_ERROR ExtractSKIDFromChipCert(const ByteSpan & chipCert, CertificateKeyId & skid) { - ChipCertificateSet certSet; ChipCertificateData certData; - - ReturnErrorOnFailure(certSet.Init(&certData, 1)); - - ReturnErrorOnFailure(certSet.LoadCert(chipCert, BitFlags())); - + ReturnErrorOnFailure(DecodeChipCert(chipCert, certData)); + VerifyOrReturnError(certData.mCertFlags.Has(CertFlags::kExtPresent_AuthKeyId), CHIP_ERROR_NOT_FOUND); skid = certData.mSubjectKeyId; - return CHIP_NO_ERROR; } CHIP_ERROR ExtractSubjectDNFromChipCert(const ByteSpan & chipCert, ChipDN & dn) { - ChipCertificateSet certSet; ChipCertificateData certData; - - ReturnErrorOnFailure(certSet.Init(&certData, 1)); - - ReturnErrorOnFailure(certSet.LoadCert(chipCert, BitFlags())); - + ReturnErrorOnFailure(DecodeChipCert(chipCert, certData)); dn = certData.mSubjectDN; - return CHIP_NO_ERROR; } @@ -1446,5 +1427,33 @@ CHIP_ERROR CertificateValidityPolicy::ApplyDefaultPolicy(const ChipCertificateDa } } +CHIP_ERROR ValidateChipNetworkIdentity(const ByteSpan & cert) +{ + ChipCertificateData certData; + ReturnErrorOnFailure(DecodeChipCert(cert, certData, CertDecodeFlags::kGenerateTBSHash)); + + CertType certType; + ReturnErrorOnFailure(certData.mSubjectDN.GetCertType(certType)); + VerifyOrReturnError(certType == CertType::kNetworkIdentity, CHIP_ERROR_WRONG_CERT_TYPE); + + VerifyOrReturnError(certData.mSerialNumber.data_equal(kNetworkIdentitySerialNumber), CHIP_ERROR_WRONG_CERT_TYPE); + VerifyOrReturnError(certData.mNotBeforeTime == kNetworkIdentityNotBeforeTime, CHIP_ERROR_WRONG_CERT_TYPE); + VerifyOrReturnError(certData.mNotAfterTime == kNetworkIdentityNotAfterTime, CHIP_ERROR_WRONG_CERT_TYPE); + VerifyOrReturnError(certData.mIssuerDN.IsEqual(certData.mSubjectDN), CHIP_ERROR_WRONG_CERT_TYPE); + + VerifyOrReturnError(certData.mCertFlags.Has(CertFlags::kExtPresent_BasicConstraints) && + !certData.mCertFlags.Has(CertFlags::kIsCA), + CHIP_ERROR_WRONG_CERT_TYPE); + VerifyOrReturnError(certData.mCertFlags.Has(CertFlags::kExtPresent_KeyUsage) && + certData.mKeyUsageFlags == kNetworkIdentityKeyUsage, + CHIP_ERROR_WRONG_CERT_TYPE); + VerifyOrReturnError(certData.mCertFlags.Has(CertFlags::kExtPresent_ExtendedKeyUsage) && + certData.mKeyPurposeFlags == kNetworkIdentityKeyPurpose, + CHIP_ERROR_WRONG_CERT_TYPE); + + ReturnErrorOnFailure(VerifyCertSignature(certData, certData)); + return CHIP_NO_ERROR; +} + } // namespace Credentials } // namespace chip diff --git a/src/credentials/CHIPCert.h b/src/credentials/CHIPCert.h index 69041f018d773d..0f8ba1df4b2955 100644 --- a/src/credentials/CHIPCert.h +++ b/src/credentials/CHIPCert.h @@ -112,6 +112,7 @@ enum class CertType : uint8_t firmware image signing is manufacturer-specific. The CHIP certificate format supports encoding of firmware signing certificates if chosen by the manufacturer to use them. */ + kNetworkIdentity = 0x05, /**< A CHIP Network (Client) Identity. */ }; /** X.509 Certificate Key Purpose Flags @@ -428,7 +429,7 @@ struct ChipCertificateData void Clear(); bool IsEqual(const ChipCertificateData & other) const; - ByteSpan mCertificate; /**< Original raw buffer data. */ + ByteSpan mSerialNumber; /**< Certificate Serial Number. */ ChipDN mSubjectDN; /**< Certificate Subject DN. */ ChipDN mIssuerDN; /**< Certificate Issuer DN. */ CertificateKeyId mSubjectKeyId; /**< Certificate Subject public key identifier. */ @@ -529,6 +530,20 @@ CHIP_ERROR VerifyCertSignature(const ChipCertificateData & cert, const ChipCerti */ CHIP_ERROR ValidateChipRCAC(const ByteSpan & rcac); +/** + * Validates a Network (Client) Identity in TLV-encoded form. + * + * This function parses the certificate, ensures the rigid fields have the values mandated by the + * specification, and validates the certificate signature. + * + * @return CHIP_NO_ERROR on success, CHIP_ERROR_WRONG_CERT_TYPE if the certificate does + * not conform to the requirements for a Network Identity, CHIP_ERROR_INVALID_SIGNATURE + * if the certificate has an invalid signature, or another CHIP_ERROR. + * + * @see section 11.24 (Wi-Fi Authentication with Per-Device Credentials) of the Matter spec + */ +CHIP_ERROR ValidateChipNetworkIdentity(const ByteSpan & cert); + struct FutureExtension { ByteSpan OID; diff --git a/src/credentials/CHIPCertToX509.cpp b/src/credentials/CHIPCertToX509.cpp index 228aaf276796bf..47781c59d57eec 100644 --- a/src/credentials/CHIPCertToX509.cpp +++ b/src/credentials/CHIPCertToX509.cpp @@ -511,11 +511,12 @@ static CHIP_ERROR DecodeConvertTBSCert(TLVReader & reader, ASN1Writer & writer, } ASN1_END_CONSTRUCTED; - ReturnErrorOnFailure(reader.Next(kTLVType_ByteString, ContextTag(kTag_SerialNumber))); - // serialNumber CertificateSerialNumber // CertificateSerialNumber ::= INTEGER - ReturnErrorOnFailure(writer.PutValue(kASN1TagClass_Universal, kASN1UniversalTag_Integer, false, reader)); + ReturnErrorOnFailure(reader.Next(kTLVType_ByteString, ContextTag(kTag_SerialNumber))); + ReturnErrorOnFailure(reader.Get(certData.mSerialNumber)); + ReturnErrorOnFailure(writer.PutValue(kASN1TagClass_Universal, kASN1UniversalTag_Integer, false, + certData.mSerialNumber.data(), static_cast(certData.mSerialNumber.size()))); // signature AlgorithmIdentifier // AlgorithmIdentifier ::= SEQUENCE diff --git a/src/credentials/CHIPCert_Internal.h b/src/credentials/CHIPCert_Internal.h new file mode 100644 index 00000000000000..9e61905b538c6f --- /dev/null +++ b/src/credentials/CHIPCert_Internal.h @@ -0,0 +1,39 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * 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. + */ + +#pragma once + +#include + +namespace chip { +namespace Credentials { + +// Constants for Network (Client) Identities as per section 11.24 (Wi-Fi +// Authentication with Per-Device Credentials) of the Matter spec. +inline constexpr CharSpan kNetworkIdentityCN = "*"_span; +inline constexpr ByteSpan kNetworkIdentitySerialNumber = ByteSpan((uint8_t[1]){ 1 }); + +inline constexpr uint32_t kNetworkIdentityNotBeforeTime = 1; +inline constexpr uint32_t kNetworkIdentityNotAfterTime = kNullCertTime; + +inline constexpr auto kNetworkIdentityKeyUsage = BitFlags(KeyUsageFlags::kDigitalSignature); +inline constexpr auto kNetworkIdentityKeyPurpose = + BitFlags(KeyPurposeFlags::kClientAuth, KeyPurposeFlags::kServerAuth); + +} // namespace Credentials +} // namespace chip diff --git a/src/credentials/tests/CHIPCert_test_vectors.cpp b/src/credentials/tests/CHIPCert_test_vectors.cpp index eb84e7d3dabb11..4d457551110e04 100644 --- a/src/credentials/tests/CHIPCert_test_vectors.cpp +++ b/src/credentials/tests/CHIPCert_test_vectors.cpp @@ -50,6 +50,7 @@ extern const TestCert gTestCerts[] = { TestCert::kNode02_06, TestCert::kNode02_07, TestCert::kNode02_08, + TestCert::kPDCID01, }; // clang-format on @@ -87,6 +88,7 @@ CHIP_ERROR GetTestCert(TestCert certType, BitFlags certLoadFl SELECT_CERT(Node02_06); SELECT_CERT(Node02_07); SELECT_CERT(Node02_08); + SELECT_CERT(PDCID01); #undef SELECT_CERT @@ -123,6 +125,7 @@ const char * GetTestCertName(TestCert certType) NAME_CERT(Node02_06); NAME_CERT(Node02_07); NAME_CERT(Node02_08); + NAME_CERT(PDCID01); #undef NAME_CERT @@ -160,6 +163,7 @@ CHIP_ERROR GetTestCertPubkey(TestCert certType, ByteSpan & pubkey) SELECT_PUBKEY(Node02_06); SELECT_PUBKEY(Node02_07); SELECT_PUBKEY(Node02_08); + SELECT_PUBKEY(PDCID01); #undef SELECT_PUBKEY @@ -200,6 +204,7 @@ CHIP_ERROR GetTestCertSKID(TestCert certType, ByteSpan & skid) SELECT_SKID(Node02_06); SELECT_SKID(Node02_07); SELECT_SKID(Node02_08); + SELECT_SKID(PDCID01); #undef SELECT_SKID @@ -240,6 +245,7 @@ CHIP_ERROR GetTestCertAKID(TestCert certType, ByteSpan & akid) SELECT_AKID(Node02_06); SELECT_AKID(Node02_07); SELECT_AKID(Node02_08); + SELECT_AKID(PDCID01); #undef SELECT_AKID @@ -249,6 +255,14 @@ CHIP_ERROR GetTestCertAKID(TestCert certType, ByteSpan & akid) return err; } +CHIP_ERROR DecodeTestCert(ChipCertificateData & certData, TestCert certType) +{ + ByteSpan cert; + ReturnErrorOnFailure(GetTestCert(certType, {}, cert)); + ReturnErrorOnFailure(DecodeChipCert(cert, certData)); + return CHIP_NO_ERROR; +} + CHIP_ERROR LoadTestCert(ChipCertificateSet & certSet, TestCert certType, BitFlags certLoadFlags, BitFlags decodeFlags) { @@ -2450,5 +2464,104 @@ extern constexpr ByteSpan sTestCert_Node02_08_AuthorityKeyId((const uint8_t[]){ 0xE1, 0xE7, 0x6E, 0x67, 0x77, 0x85, 0x1D, 0xD7, 0x74, 0x16, 0xBD, 0xDD, 0x35, 0xEC, 0x3C, 0x13, 0x7C, 0x47, 0x29, 0xDC, }); +/************** Test PDCID01 Certificate ************** +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 1 (0x1) + Signature Algorithm: ecdsa-with-SHA256 + Issuer: CN=* + Validity + Not Before: Jan 1 00:00:01 2000 GMT + Not After : Dec 31 23:59:59 9999 GMT + Subject: CN=* + Subject Public Key Info: + Public Key Algorithm: id-ecPublicKey + Public-Key: (256 bit) + pub: + 04:39:cc:d4:ac:7e:59:68:bd:f1:b0:80:11:1d:92: + 53:64:94:fc:51:62:4c:70:aa:6d:73:08:da:ed:f3: + a1:5e:38:69:17:7b:1b:f3:d0:90:47:eb:f0:6b:e8: + dd:17:be:23:f2:fb:3d:63:90:c6:cf:82:80:2f:62: + d0:53:62:c0:08 + ASN1 OID: prime256v1 + NIST CURVE: P-256 + X509v3 extensions: + X509v3 Basic Constraints: critical + CA:FALSE + X509v3 Key Usage: critical + Digital Signature + X509v3 Extended Key Usage: critical + TLS Web Client Authentication, TLS Web Server Authentication + Signature Algorithm: ecdsa-with-SHA256 + 30:45:02:21:00:e9:43:b6:16:f3:1a:f3:81:52:e7:37:41:f7: + 47:28:db:7d:56:87:b5:94:c0:2e:0f:5f:ee:3a:60:bf:36:44: + a9:02:20:1c:85:2c:fd:6b:15:d8:f8:fe:19:93:4d:af:2f:91: + 93:fd:2c:bc:4e:23:50:0a:31:7d:a4:a0:79:b2:db:69:42 + +-----BEGIN CERTIFICATE----- +MIIBSjCB8aADAgECAgEBMAoGCCqGSM49BAMCMAwxCjAIBgNVBAMMASowIBcNMDAw +MTAxMDAwMDAxWhgPOTk5OTEyMzEyMzU5NTlaMAwxCjAIBgNVBAMMASowWTATBgcq +hkjOPQIBBggqhkjOPQMBBwNCAAQ5zNSsfllovfGwgBEdklNklPxRYkxwqm1zCNrt +86FeOGkXexvz0JBH6/Br6N0XviPy+z1jkMbPgoAvYtBTYsAIo0IwQDAMBgNVHRMB +Af8EAjAAMA4GA1UdDwEB/wQEAwIHgDAgBgNVHSUBAf8EFjAUBggrBgEFBQcDAgYI +KwYBBQUHAwEwCgYIKoZIzj0EAwIDSAAwRQIhAOlDthbzGvOBUuc3QfdHKNt9Voe1 +lMAuD1/uOmC/NkSpAiAchSz9axXY+P4Zk02vL5GT/Sy8TiNQCjF9pKB5sttpQg== +-----END CERTIFICATE----- + +-----BEGIN EC PRIVATE KEY----- +MHcCAQEEIAgMqGL8i1LKFupDgkl42mQgn1XS3oMd7nCENcUEwV6roAoGCCqGSM49 +AwEHoUQDQgAEOczUrH5ZaL3xsIARHZJTZJT8UWJMcKptcwja7fOhXjhpF3sb89CQ +R+vwa+jdF74j8vs9Y5DGz4KAL2LQU2LACA== +-----END EC PRIVATE KEY----- +*/ + +extern constexpr ByteSpan sTestCert_PDCID01_Chip((const uint8_t[]){ + 0x15, 0x30, 0x01, 0x01, 0x01, 0x24, 0x02, 0x01, 0x37, 0x03, 0x2c, 0x01, 0x01, 0x2a, 0x18, 0x24, 0x04, 0x01, 0x24, 0x05, 0x00, + 0x37, 0x06, 0x2c, 0x01, 0x01, 0x2a, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, 0x39, 0xcc, 0xd4, 0xac, + 0x7e, 0x59, 0x68, 0xbd, 0xf1, 0xb0, 0x80, 0x11, 0x1d, 0x92, 0x53, 0x64, 0x94, 0xfc, 0x51, 0x62, 0x4c, 0x70, 0xaa, 0x6d, 0x73, + 0x08, 0xda, 0xed, 0xf3, 0xa1, 0x5e, 0x38, 0x69, 0x17, 0x7b, 0x1b, 0xf3, 0xd0, 0x90, 0x47, 0xeb, 0xf0, 0x6b, 0xe8, 0xdd, 0x17, + 0xbe, 0x23, 0xf2, 0xfb, 0x3d, 0x63, 0x90, 0xc6, 0xcf, 0x82, 0x80, 0x2f, 0x62, 0xd0, 0x53, 0x62, 0xc0, 0x08, 0x37, 0x0a, 0x35, + 0x01, 0x28, 0x01, 0x18, 0x24, 0x02, 0x01, 0x36, 0x03, 0x04, 0x02, 0x04, 0x01, 0x18, 0x18, 0x30, 0x0b, 0x40, 0xe9, 0x43, 0xb6, + 0x16, 0xf3, 0x1a, 0xf3, 0x81, 0x52, 0xe7, 0x37, 0x41, 0xf7, 0x47, 0x28, 0xdb, 0x7d, 0x56, 0x87, 0xb5, 0x94, 0xc0, 0x2e, 0x0f, + 0x5f, 0xee, 0x3a, 0x60, 0xbf, 0x36, 0x44, 0xa9, 0x1c, 0x85, 0x2c, 0xfd, 0x6b, 0x15, 0xd8, 0xf8, 0xfe, 0x19, 0x93, 0x4d, 0xaf, + 0x2f, 0x91, 0x93, 0xfd, 0x2c, 0xbc, 0x4e, 0x23, 0x50, 0x0a, 0x31, 0x7d, 0xa4, 0xa0, 0x79, 0xb2, 0xdb, 0x69, 0x42, 0x18, +}); + +extern constexpr ByteSpan sTestCert_PDCID01_DER((const uint8_t[]){ + 0x30, 0x82, 0x01, 0x4a, 0x30, 0x81, 0xf1, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x01, 0x01, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, + 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x0c, 0x31, 0x0a, 0x30, 0x08, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x01, 0x2a, 0x30, + 0x20, 0x17, 0x0d, 0x30, 0x30, 0x30, 0x31, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x5a, 0x18, 0x0f, 0x39, 0x39, 0x39, + 0x39, 0x31, 0x32, 0x33, 0x31, 0x32, 0x33, 0x35, 0x39, 0x35, 0x39, 0x5a, 0x30, 0x0c, 0x31, 0x0a, 0x30, 0x08, 0x06, 0x03, 0x55, + 0x04, 0x03, 0x0c, 0x01, 0x2a, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, + 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0x39, 0xcc, 0xd4, 0xac, 0x7e, 0x59, 0x68, 0xbd, 0xf1, 0xb0, + 0x80, 0x11, 0x1d, 0x92, 0x53, 0x64, 0x94, 0xfc, 0x51, 0x62, 0x4c, 0x70, 0xaa, 0x6d, 0x73, 0x08, 0xda, 0xed, 0xf3, 0xa1, 0x5e, + 0x38, 0x69, 0x17, 0x7b, 0x1b, 0xf3, 0xd0, 0x90, 0x47, 0xeb, 0xf0, 0x6b, 0xe8, 0xdd, 0x17, 0xbe, 0x23, 0xf2, 0xfb, 0x3d, 0x63, + 0x90, 0xc6, 0xcf, 0x82, 0x80, 0x2f, 0x62, 0xd0, 0x53, 0x62, 0xc0, 0x08, 0xa3, 0x42, 0x30, 0x40, 0x30, 0x0c, 0x06, 0x03, 0x55, + 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x02, 0x30, 0x00, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, + 0x03, 0x02, 0x07, 0x80, 0x30, 0x20, 0x06, 0x03, 0x55, 0x1d, 0x25, 0x01, 0x01, 0xff, 0x04, 0x16, 0x30, 0x14, 0x06, 0x08, 0x2b, + 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x02, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, 0x30, 0x0a, 0x06, 0x08, + 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x48, 0x00, 0x30, 0x45, 0x02, 0x21, 0x00, 0xe9, 0x43, 0xb6, 0x16, 0xf3, + 0x1a, 0xf3, 0x81, 0x52, 0xe7, 0x37, 0x41, 0xf7, 0x47, 0x28, 0xdb, 0x7d, 0x56, 0x87, 0xb5, 0x94, 0xc0, 0x2e, 0x0f, 0x5f, 0xee, + 0x3a, 0x60, 0xbf, 0x36, 0x44, 0xa9, 0x02, 0x20, 0x1c, 0x85, 0x2c, 0xfd, 0x6b, 0x15, 0xd8, 0xf8, 0xfe, 0x19, 0x93, 0x4d, 0xaf, + 0x2f, 0x91, 0x93, 0xfd, 0x2c, 0xbc, 0x4e, 0x23, 0x50, 0x0a, 0x31, 0x7d, 0xa4, 0xa0, 0x79, 0xb2, 0xdb, 0x69, 0x42, +}); + +extern constexpr ByteSpan sTestCert_PDCID01_PublicKey((const uint8_t[]){ + 0x04, 0x39, 0xcc, 0xd4, 0xac, 0x7e, 0x59, 0x68, 0xbd, 0xf1, 0xb0, 0x80, 0x11, 0x1d, 0x92, 0x53, 0x64, + 0x94, 0xfc, 0x51, 0x62, 0x4c, 0x70, 0xaa, 0x6d, 0x73, 0x08, 0xda, 0xed, 0xf3, 0xa1, 0x5e, 0x38, 0x69, + 0x17, 0x7b, 0x1b, 0xf3, 0xd0, 0x90, 0x47, 0xeb, 0xf0, 0x6b, 0xe8, 0xdd, 0x17, 0xbe, 0x23, 0xf2, 0xfb, + 0x3d, 0x63, 0x90, 0xc6, 0xcf, 0x82, 0x80, 0x2f, 0x62, 0xd0, 0x53, 0x62, 0xc0, 0x08, +}); + +extern constexpr ByteSpan sTestCert_PDCID01_PrivateKey((const uint8_t[]){ + 0x08, 0x0c, 0xa8, 0x62, 0xfc, 0x8b, 0x52, 0xca, 0x16, 0xea, 0x43, 0x82, 0x49, 0x78, 0xda, 0x64, + 0x20, 0x9f, 0x55, 0xd2, 0xde, 0x83, 0x1d, 0xee, 0x70, 0x84, 0x35, 0xc5, 0x04, 0xc1, 0x5e, 0xab, +}); + +extern constexpr ByteSpan sTestCert_PDCID01_SubjectKeyId{}; + +extern constexpr ByteSpan sTestCert_PDCID01_AuthorityKeyId{}; + } // namespace TestCerts } // namespace chip diff --git a/src/credentials/tests/CHIPCert_test_vectors.h b/src/credentials/tests/CHIPCert_test_vectors.h index 521426ee3e5084..d14cad56ffcab0 100644 --- a/src/credentials/tests/CHIPCert_test_vectors.h +++ b/src/credentials/tests/CHIPCert_test_vectors.h @@ -55,6 +55,7 @@ enum TestCert kNode02_07 = 15, kNode02_08 = 16, kRoot03 = 17, + kPDCID01 = 18, }; // Special flags to alter how certificates are fetched/loaded. @@ -73,6 +74,8 @@ extern const char * GetTestCertName(TestCert certType); extern CHIP_ERROR GetTestCertPubkey(TestCert certType, ByteSpan & pubkey); extern CHIP_ERROR GetTestCertSKID(TestCert certType, ByteSpan & skid); extern CHIP_ERROR GetTestCertAKID(TestCert certType, ByteSpan & akid); + +extern CHIP_ERROR DecodeTestCert(ChipCertificateData & certData, TestCert certType); extern CHIP_ERROR LoadTestCert(ChipCertificateSet & certSet, TestCert certType, BitFlags certLoadFlags, BitFlags decodeFlags); @@ -202,5 +205,12 @@ extern const ByteSpan sTestCert_Node02_08_PrivateKey; extern const ByteSpan sTestCert_Node02_08_SubjectKeyId; extern const ByteSpan sTestCert_Node02_08_AuthorityKeyId; +extern const ByteSpan sTestCert_PDCID01_Chip; +extern const ByteSpan sTestCert_PDCID01_DER; +extern const ByteSpan sTestCert_PDCID01_PublicKey; +extern const ByteSpan sTestCert_PDCID01_PrivateKey; +extern const ByteSpan sTestCert_PDCID01_SubjectKeyId; +extern const ByteSpan sTestCert_PDCID01_AuthorityKeyId; + } // namespace TestCerts } // namespace chip diff --git a/src/credentials/tests/TestChipCert.cpp b/src/credentials/tests/TestChipCert.cpp index ff79157815a79e..d16cd7efc26231 100644 --- a/src/credentials/tests/TestChipCert.cpp +++ b/src/credentials/tests/TestChipCert.cpp @@ -52,55 +52,55 @@ enum kStandardCertsCount = 3, }; -static const BitFlags sNullDecodeFlag; -static const BitFlags sGenTBSHashFlag(CertDecodeFlags::kGenerateTBSHash); -static const BitFlags sTrustAnchorFlag(CertDecodeFlags::kIsTrustAnchor); - -static const BitFlags sNullLoadFlag; -static const BitFlags sDerFormFlag(TestCertLoadFlags::kDERForm); -static const BitFlags sSupIsCAFlag(TestCertLoadFlags::kSuppressIsCA); -static const BitFlags sSupKeyUsageFlag(TestCertLoadFlags::kSuppressKeyUsage); -static const BitFlags sSupKeyCertSignFlag(TestCertLoadFlags::kSuppressKeyCertSign); -static const BitFlags sPathLenZeroFlag(TestCertLoadFlags::kSetPathLenConstZero); - -static const BitFlags sNullKPFlag; -static const BitFlags sSA(KeyPurposeFlags::kServerAuth); -static const BitFlags sCA(KeyPurposeFlags::kClientAuth); -static const BitFlags sCS(KeyPurposeFlags::kCodeSigning); -static const BitFlags sEP(KeyPurposeFlags::kEmailProtection); -static const BitFlags sTS(KeyPurposeFlags::kTimeStamping); -static const BitFlags sOS(KeyPurposeFlags::kOCSPSigning); -static const BitFlags sSAandCA(sSA, sCA); -static const BitFlags sSAandCS(sSA, sCS); -static const BitFlags sSAandEP(sSA, sEP); -static const BitFlags sSAandTS(sSA, sTS); - -static const BitFlags sNullKUFlag; -static const BitFlags sDS(KeyUsageFlags::kDigitalSignature); -static const BitFlags sNR(KeyUsageFlags::kNonRepudiation); -static const BitFlags sKE(KeyUsageFlags::kKeyEncipherment); -static const BitFlags sDE(KeyUsageFlags::kDataEncipherment); -static const BitFlags sKA(KeyUsageFlags::kKeyAgreement); -static const BitFlags sKC(KeyUsageFlags::kKeyCertSign); -static const BitFlags sCR(KeyUsageFlags::kCRLSign); -static const BitFlags sEO(KeyUsageFlags::kEncipherOnly); -static const BitFlags sDO(KeyUsageFlags::kDecipherOnly); -static const BitFlags sDSandNR(sDS, sNR); -static const BitFlags sDSandKE(sDS, sKE); -static const BitFlags sDSandDE(sDS, sDE); -static const BitFlags sDSandKA(sDS, sKA); -static const BitFlags sDSandKC(sDS, sKC); -static const BitFlags sDSandCR(sDS, sCR); -static const BitFlags sDSandEO(sDS, sEO); -static const BitFlags sDSandDO(sDS, sDO); -static const BitFlags sKCandDS(sKC, sDS); -static const BitFlags sKCandNR(sKC, sNR); -static const BitFlags sKCandKE(sKC, sKE); -static const BitFlags sKCandDE(sKC, sDE); -static const BitFlags sKCandKA(sKC, sKA); -static const BitFlags sKCandCR(sKC, sCR); -static const BitFlags sKCandEO(sKC, sEO); -static const BitFlags sKCandDO(sKC, sDO); +static constexpr BitFlags sNullDecodeFlag; +static constexpr BitFlags sGenTBSHashFlag(CertDecodeFlags::kGenerateTBSHash); +static constexpr BitFlags sTrustAnchorFlag(CertDecodeFlags::kIsTrustAnchor); + +static constexpr BitFlags sNullLoadFlag; +static constexpr BitFlags sDerFormFlag(TestCertLoadFlags::kDERForm); +static constexpr BitFlags sSupIsCAFlag(TestCertLoadFlags::kSuppressIsCA); +static constexpr BitFlags sSupKeyUsageFlag(TestCertLoadFlags::kSuppressKeyUsage); +static constexpr BitFlags sSupKeyCertSignFlag(TestCertLoadFlags::kSuppressKeyCertSign); +static constexpr BitFlags sPathLenZeroFlag(TestCertLoadFlags::kSetPathLenConstZero); + +static constexpr BitFlags sNullKPFlag; +static constexpr BitFlags sSA(KeyPurposeFlags::kServerAuth); +static constexpr BitFlags sCA(KeyPurposeFlags::kClientAuth); +static constexpr BitFlags sCS(KeyPurposeFlags::kCodeSigning); +static constexpr BitFlags sEP(KeyPurposeFlags::kEmailProtection); +static constexpr BitFlags sTS(KeyPurposeFlags::kTimeStamping); +// static constexpr BitFlags sOS(KeyPurposeFlags::kOCSPSigning); // unused +static constexpr BitFlags sSAandCA(sSA, sCA); +static constexpr BitFlags sSAandCS(sSA, sCS); +static constexpr BitFlags sSAandEP(sSA, sEP); +static constexpr BitFlags sSAandTS(sSA, sTS); + +static constexpr BitFlags sNullKUFlag; +static constexpr BitFlags sDS(KeyUsageFlags::kDigitalSignature); +static constexpr BitFlags sNR(KeyUsageFlags::kNonRepudiation); +static constexpr BitFlags sKE(KeyUsageFlags::kKeyEncipherment); +static constexpr BitFlags sDE(KeyUsageFlags::kDataEncipherment); +static constexpr BitFlags sKA(KeyUsageFlags::kKeyAgreement); +static constexpr BitFlags sKC(KeyUsageFlags::kKeyCertSign); +static constexpr BitFlags sCR(KeyUsageFlags::kCRLSign); +static constexpr BitFlags sEO(KeyUsageFlags::kEncipherOnly); +static constexpr BitFlags sDO(KeyUsageFlags::kDecipherOnly); +static constexpr BitFlags sDSandNR(sDS, sNR); +static constexpr BitFlags sDSandKE(sDS, sKE); +static constexpr BitFlags sDSandDE(sDS, sDE); +static constexpr BitFlags sDSandKA(sDS, sKA); +static constexpr BitFlags sDSandKC(sDS, sKC); +static constexpr BitFlags sDSandCR(sDS, sCR); +static constexpr BitFlags sDSandEO(sDS, sEO); +static constexpr BitFlags sDSandDO(sDS, sDO); +static constexpr BitFlags sKCandDS(sKC, sDS); +static constexpr BitFlags sKCandNR(sKC, sNR); +static constexpr BitFlags sKCandKE(sKC, sKE); +static constexpr BitFlags sKCandDE(sKC, sDE); +static constexpr BitFlags sKCandKA(sKC, sKA); +static constexpr BitFlags sKCandCR(sKC, sCR); +static constexpr BitFlags sKCandEO(sKC, sEO); +static constexpr BitFlags sKCandDO(sKC, sDO); constexpr uint8_t sOID_Extension_SubjectAltName[] = { 0x55, 0x1d, 0x11 }; constexpr char kExtension_SubjectAltName[] = "test@example.com"; @@ -1187,7 +1187,7 @@ static void TestChipCert_CertUsage(nlTestSuite * inSuite, void * inContext) static void TestChipCert_CertType(nlTestSuite * inSuite, void * inContext) { CHIP_ERROR err; - ChipCertificateSet certSet; + ChipCertificateData certData; struct TestCase { @@ -1209,31 +1209,27 @@ static void TestChipCert_CertType(nlTestSuite * inSuite, void * inContext) { TestCert::kNode01_02, CertType::kNode }, { TestCert::kNode02_01, CertType::kNode }, { TestCert::kNode02_02, CertType::kNode }, + { TestCert::kPDCID01, CertType::kNetworkIdentity }, }; // clang-format on for (const auto & testCase : sTestCases) { CertType certType; - err = certSet.Init(1); + err = DecodeTestCert(certData, testCase.Cert); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = LoadTestCert(certSet, testCase.Cert, sNullLoadFlag, sNullDecodeFlag); - NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - - err = certSet.GetCertSet()->mSubjectDN.GetCertType(certType); + err = certData.mSubjectDN.GetCertType(certType); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); NL_TEST_ASSERT(inSuite, certType == testCase.ExpectedCertType); - certSet.Release(); } } static void TestChipCert_CertId(nlTestSuite * inSuite, void * inContext) { CHIP_ERROR err; - ChipCertificateSet certSet; - ChipCertificateData certData[1]; + ChipCertificateData certData; struct TestCase { @@ -1255,23 +1251,26 @@ static void TestChipCert_CertId(nlTestSuite * inSuite, void * inContext) { TestCert::kNode01_02, 0xDEDEDEDE00010002 }, { TestCert::kNode02_01, 0xDEDEDEDE00020001 }, { TestCert::kNode02_02, 0xDEDEDEDE00020002 }, + { TestCert::kPDCID01, 0 }, }; // clang-format on for (const auto & testCase : sTestCases) { uint64_t chipId; - err = certSet.Init(certData, 1); + err = DecodeTestCert(certData, testCase.Cert); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = LoadTestCert(certSet, testCase.Cert, sNullLoadFlag, sNullDecodeFlag); - NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - - err = certSet.GetCertSet()->mSubjectDN.GetCertChipId(chipId); - NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - - NL_TEST_ASSERT(inSuite, chipId == testCase.ExpectedCertId); - certSet.Release(); + err = certData.mSubjectDN.GetCertChipId(chipId); + if (testCase.ExpectedCertId != 0) + { + NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + NL_TEST_ASSERT(inSuite, chipId == testCase.ExpectedCertId); + } + else + { + NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_WRONG_CERT_DN); + } } } @@ -2052,6 +2051,7 @@ static void TestChipCert_ExtractSubjectDNFromChipCert(nlTestSuite * inSuite, voi { TestCert::kICA02, expectedSubjectDN_ICA02 }, { TestCert::kNode01_01, expectedSubjectDN_Node01_01 }, { TestCert::kNode02_03, expectedSubjectDN_Node02_03 }, + { TestCert::kPDCID01, {} }, }; // clang-format on @@ -2065,7 +2065,11 @@ static void TestChipCert_ExtractSubjectDNFromChipCert(nlTestSuite * inSuite, voi ChipDN subjectDN; err = ExtractSubjectDNFromChipCert(cert, subjectDN); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - NL_TEST_ASSERT(inSuite, subjectDN.IsEqual(testCase.ExpectedSubjectDN)); + + if (!testCase.ExpectedSubjectDN.IsEmpty()) + { + NL_TEST_ASSERT(inSuite, subjectDN.IsEqual(testCase.ExpectedSubjectDN)); + } } // Test extraction from the X509 ByteSpan form. @@ -2078,7 +2082,11 @@ static void TestChipCert_ExtractSubjectDNFromChipCert(nlTestSuite * inSuite, voi ChipDN subjectDN; err = ExtractSubjectDNFromX509Cert(cert, subjectDN); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - NL_TEST_ASSERT(inSuite, subjectDN.IsEqual(testCase.ExpectedSubjectDN)); + + if (!testCase.ExpectedSubjectDN.IsEmpty()) + { + NL_TEST_ASSERT(inSuite, subjectDN.IsEqual(testCase.ExpectedSubjectDN)); + } } } @@ -2110,6 +2118,7 @@ static void TestChipCert_ExtractPublicKeyAndSKID(nlTestSuite * inSuite, void * i { TestCert::kNode02_06, sTestCert_Node02_06_PublicKey, sTestCert_Node02_06_SubjectKeyId }, { TestCert::kNode02_07, sTestCert_Node02_07_PublicKey, sTestCert_Node02_07_SubjectKeyId }, { TestCert::kNode02_08, sTestCert_Node02_08_PublicKey, sTestCert_Node02_08_SubjectKeyId }, + { TestCert::kPDCID01, sTestCert_PDCID01_PublicKey, ByteSpan() }, }; // clang-format on @@ -2126,11 +2135,26 @@ static void TestChipCert_ExtractPublicKeyAndSKID(nlTestSuite * inSuite, void * i CertificateKeyId skid; err = ExtractSKIDFromChipCert(cert, skid); - NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - NL_TEST_ASSERT(inSuite, skid.data_equal(testCase.ExpectedSKID)); + if (!testCase.ExpectedSKID.empty()) + { + NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + NL_TEST_ASSERT(inSuite, skid.data_equal(testCase.ExpectedSKID)); + } + else + { + NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_NOT_FOUND); + } } } +static void TestChipCert_PDCIdentityValidation(nlTestSuite * inSuite, void * inContext) +{ + CHIP_ERROR err; + + err = ValidateChipNetworkIdentity(sTestCert_PDCID01_Chip); + NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); +} + /** * Set up the test suite. */ @@ -2189,6 +2213,7 @@ static const nlTest sTests[] = { NL_TEST_DEF("Test extracting and validating CASE Authenticated Tags from NOC", TestChipCert_ExtractAndValidateCATsFromOpCert), NL_TEST_DEF("Test extracting Subject DN from chip certificate", TestChipCert_ExtractSubjectDNFromChipCert), NL_TEST_DEF("Test extracting PublicKey and SKID from chip certificate", TestChipCert_ExtractPublicKeyAndSKID), + NL_TEST_DEF("Test PDC Identity Validation", TestChipCert_PDCIdentityValidation), NL_TEST_SENTINEL() }; // clang-format on diff --git a/src/crypto/tests/CHIPCryptoPALTest.cpp b/src/crypto/tests/CHIPCryptoPALTest.cpp index a79961dbe07c99..38343a60d52e5c 100644 --- a/src/crypto/tests/CHIPCryptoPALTest.cpp +++ b/src/crypto/tests/CHIPCryptoPALTest.cpp @@ -2201,8 +2201,15 @@ static void TestSKID_x509Extraction(nlTestSuite * inSuite, void * inContext) NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); err = ExtractSKIDFromX509Cert(cert, skidOut); - NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - NL_TEST_ASSERT(inSuite, skidSpan.data_equal(skidOut)); + if (!skidSpan.empty()) + { + NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + NL_TEST_ASSERT(inSuite, skidSpan.data_equal(skidOut)); + } + else + { + NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_NOT_FOUND); + } } } @@ -2228,8 +2235,15 @@ static void TestAKID_x509Extraction(nlTestSuite * inSuite, void * inContext) NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); err = ExtractAKIDFromX509Cert(cert, akidOut); - NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - NL_TEST_ASSERT(inSuite, akidSpan.data_equal(akidOut)); + if (!akidSpan.empty()) + { + NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + NL_TEST_ASSERT(inSuite, akidSpan.data_equal(akidOut)); + } + else + { + NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_NOT_FOUND); + } } } diff --git a/src/darwin/Framework/CHIP/templates/availability.yaml b/src/darwin/Framework/CHIP/templates/availability.yaml index 50dd02c4952444..d7b9f200956d9e 100644 --- a/src/darwin/Framework/CHIP/templates/availability.yaml +++ b/src/darwin/Framework/CHIP/templates/availability.yaml @@ -7729,14 +7729,31 @@ - release: "Future" versions: "future" introduced: + bitmaps: + Scenes: + - CopyModeBitmap + - NameSupportBitmap + AdministratorCommissioning: + - Feature bitmap values: PumpConfigurationAndControl: PumpStatusBitmap: - SupplyFault + Scenes: + CopyModeBitmap: + - CopyAllScenes + NameSupportBitmap: + - SceneNames SoftwareDiagnostics: Feature: - Watermarks + AdministratorCommissioning: + Feature: + - Basic deprecated: + bitmaps: + Scenes: + - ScenesCopyMode bitmap values: PumpConfigurationAndControl: PumpStatusBitmap: @@ -7744,7 +7761,26 @@ SoftwareDiagnostics: Feature: - WaterMarks + provisional: + attributes: + NetworkCommissioning: + # Targeting Spring 2024 Matter release + - SupportedWiFiBands + - SupportedThreadFeatures + - ThreadVersion + commands: + GeneralDiagnostics: + # Targeting Spring 2024 Matter release + - TimeSnapshot + - TimeSnapshotResponse + bitmaps: + NetworkCommissioning: + # Targeting Spring 2024 Matter release + - ThreadCapabilitiesBitmap renames: + bitmaps: + Scenes: + CopyModeBitmap: ScenesCopyMode bitmap values: PumpConfigurationAndControl: PumpStatusBitmap: diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm index 6400bbbdf26e85..d9682c0187ce3b 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm @@ -2408,6 +2408,48 @@ static BOOL AttributeIsSpecifiedInDishwasherAlarmCluster(AttributeId aAttributeI } } } +static BOOL AttributeIsSpecifiedInMicrowaveOvenControlCluster(AttributeId aAttributeId) +{ + using namespace Clusters::MicrowaveOvenControl; + switch (aAttributeId) { + case Attributes::CookTime::Id: { + return YES; + } + case Attributes::PowerSetting::Id: { + return YES; + } + case Attributes::MinPower::Id: { + return YES; + } + case Attributes::MaxPower::Id: { + return YES; + } + case Attributes::PowerStep::Id: { + return YES; + } + case Attributes::GeneratedCommandList::Id: { + return YES; + } + case Attributes::AcceptedCommandList::Id: { + return YES; + } + case Attributes::EventList::Id: { + return YES; + } + case Attributes::AttributeList::Id: { + return YES; + } + case Attributes::FeatureMap::Id: { + return YES; + } + case Attributes::ClusterRevision::Id: { + return YES; + } + default: { + return NO; + } + } +} static BOOL AttributeIsSpecifiedInOperationalStateCluster(AttributeId aAttributeId) { using namespace Clusters::OperationalState; @@ -5649,6 +5691,9 @@ BOOL MTRAttributeIsSpecified(ClusterId aClusterId, AttributeId aAttributeId) case Clusters::DishwasherAlarm::Id: { return AttributeIsSpecifiedInDishwasherAlarmCluster(aAttributeId); } + case Clusters::MicrowaveOvenControl::Id: { + return AttributeIsSpecifiedInMicrowaveOvenControlCluster(aAttributeId); + } case Clusters::OperationalState::Id: { return AttributeIsSpecifiedInOperationalStateCluster(aAttributeId); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index 4aaa93b2fc98c9..80e2bed641acef 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -286,7 +286,7 @@ static id _Nullable DecodeAttributeValueForScenesCluster(AttributeId aAttributeI return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; return value; } case Attributes::LastConfiguredBy::Id: { @@ -2518,6 +2518,7 @@ static id _Nullable DecodeAttributeValueForNetworkCommissioningCluster(Attribute } return value; } +#if MTR_ENABLE_PROVISIONAL case Attributes::SupportedWiFiBands::Id: { using TypeInfo = Attributes::SupportedWiFiBands::TypeInfo; TypeInfo::DecodableType cppValue; @@ -2544,6 +2545,8 @@ static id _Nullable DecodeAttributeValueForNetworkCommissioningCluster(Attribute } return value; } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL case Attributes::SupportedThreadFeatures::Id: { using TypeInfo = Attributes::SupportedThreadFeatures::TypeInfo; TypeInfo::DecodableType cppValue; @@ -2555,6 +2558,8 @@ static id _Nullable DecodeAttributeValueForNetworkCommissioningCluster(Attribute value = [NSNumber numberWithUnsignedShort:cppValue.Raw()]; return value; } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL case Attributes::ThreadVersion::Id: { using TypeInfo = Attributes::ThreadVersion::TypeInfo; TypeInfo::DecodableType cppValue; @@ -2566,6 +2571,7 @@ static id _Nullable DecodeAttributeValueForNetworkCommissioningCluster(Attribute value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } +#endif // MTR_ENABLE_PROVISIONAL default: { break; } @@ -6453,6 +6459,83 @@ static id _Nullable DecodeAttributeValueForDishwasherAlarmCluster(AttributeId aA *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } +static id _Nullable DecodeAttributeValueForMicrowaveOvenControlCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::MicrowaveOvenControl; + switch (aAttributeId) { +#if MTR_ENABLE_PROVISIONAL + case Attributes::CookTime::Id: { + using TypeInfo = Attributes::CookTime::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; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::PowerSetting::Id: { + using TypeInfo = Attributes::PowerSetting::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MinPower::Id: { + using TypeInfo = Attributes::MinPower::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MaxPower::Id: { + using TypeInfo = Attributes::MaxPower::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::PowerStep::Id: { + using TypeInfo = Attributes::PowerStep::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } +#endif // MTR_ENABLE_PROVISIONAL + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} static id _Nullable DecodeAttributeValueForOperationalStateCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { using namespace Clusters::OperationalState; @@ -9952,7 +10035,7 @@ static id _Nullable DecodeAttributeValueForTemperatureMeasurementCluster(Attribu return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithShort:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } default: { @@ -15913,6 +15996,9 @@ id _Nullable MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::T case Clusters::DishwasherAlarm::Id: { return DecodeAttributeValueForDishwasherAlarmCluster(aPath.mAttributeId, aReader, aError); } + case Clusters::MicrowaveOvenControl::Id: { + return DecodeAttributeValueForMicrowaveOvenControlCluster(aPath.mAttributeId, aReader, aError); + } case Clusters::OperationalState::Id: { return DecodeAttributeValueForOperationalStateCluster(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 7a6c820b64fc67..7e4cd17bf0cf57 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -2619,6 +2619,14 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) * Provide a means for certification tests to trigger some test-plan-specific events */ - (void)testEventTriggerWithParams:(MTRGeneralDiagnosticsClusterTestEventTriggerParams *)params completion:(MTRStatusCompletion)completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); +/** + * Command TimeSnapshot + * + * Take a snapshot of system time and epoch time. + */ +- (void)timeSnapshotWithParams:(MTRGeneralDiagnosticsClusterTimeSnapshotParams * _Nullable)params completion:(void (^)(MTRGeneralDiagnosticsClusterTimeSnapshotResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)timeSnapshotWithCompletion:(void (^)(MTRGeneralDiagnosticsClusterTimeSnapshotResponseParams * _Nullable data, NSError * _Nullable error))completion + MTR_PROVISIONALLY_AVAILABLE; - (void)readAttributeNetworkInterfacesWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (void)subscribeAttributeNetworkInterfacesWithParams:(MTRSubscribeParams *)params @@ -5702,6 +5710,106 @@ MTR_PROVISIONALLY_AVAILABLE @end +/** + * Cluster Microwave Oven Control + * + * Attributes and commands for configuring the microwave oven control, and reporting cooking stats. + */ +MTR_PROVISIONALLY_AVAILABLE +@interface MTRBaseClusterMicrowaveOvenControl : MTRCluster + +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ +- (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; + +/** + * Command SetCookingParameters + * + * Set Cooking Parameters + */ +- (void)setCookingParametersWithParams:(MTRMicrowaveOvenControlClusterSetCookingParametersParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command AddMoreTime + * + * Add More Cooking Time + */ +- (void)addMoreTimeWithParams:(MTRMicrowaveOvenControlClusterAddMoreTimeParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeCookTimeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeCookTimeWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeCookTimeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributePowerSettingWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributePowerSettingWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributePowerSettingWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeMinPowerWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeMinPowerWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeMinPowerWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeMaxPowerWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeMaxPowerWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeMaxPowerWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributePowerStepWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributePowerStepWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributePowerStepWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + /** * Cluster Operational State * @@ -13280,6 +13388,17 @@ typedef NS_OPTIONS(uint8_t, MTRGroupsNameSupportBitmap) { MTRGroupsNameSupportBitmapGroupNames MTR_AVAILABLE(ios(17.0), macos(14.0), watchos(10.0), tvos(17.0)) = 0x80, } MTR_AVAILABLE(ios(17.0), macos(14.0), watchos(10.0), tvos(17.0)); +typedef NS_OPTIONS(uint8_t, MTRScenesCopyModeBitmap) { + MTRScenesCopyModeBitmapCopyAllScenes MTR_NEWLY_AVAILABLE = 0x1, +} MTR_NEWLY_AVAILABLE; + +typedef NS_OPTIONS(uint8_t, MTRScenesCopyMode) { + MTRScenesCopyModeCopyAllScenes MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRScenesCopyModeBitmapCopyAllScenes") + = 0x1, +} MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRScenesCopyModeBitmap"); + typedef NS_OPTIONS(uint32_t, MTRScenesFeature) { MTRScenesFeatureSceneNames MTR_AVAILABLE(ios(17.0), macos(14.0), watchos(10.0), tvos(17.0)) = 0x1, MTRScenesFeatureExplicit MTR_PROVISIONALLY_AVAILABLE = 0x2, @@ -13287,9 +13406,9 @@ typedef NS_OPTIONS(uint32_t, MTRScenesFeature) { MTRScenesFeatureFabricScenes MTR_PROVISIONALLY_AVAILABLE = 0x8, } MTR_AVAILABLE(ios(17.0), macos(14.0), watchos(10.0), tvos(17.0)); -typedef NS_OPTIONS(uint8_t, MTRScenesCopyMode) { - MTRScenesCopyModeCopyAllScenes MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x1, -} MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +typedef NS_OPTIONS(uint8_t, MTRScenesNameSupportBitmap) { + MTRScenesNameSupportBitmapSceneNames MTR_NEWLY_AVAILABLE = 0x80, +} MTR_NEWLY_AVAILABLE; typedef NS_ENUM(uint8_t, MTROnOffDelayedAllOffEffectVariant) { MTROnOffDelayedAllOffEffectVariantDelayedOffFastFade MTR_AVAILABLE(ios(17.2), macos(14.2), watchos(10.2), tvos(17.2)) = 0x00, @@ -14222,8 +14341,8 @@ typedef NS_ENUM(uint8_t, MTRAdministratorCommissioningStatusCode) { } MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); typedef NS_OPTIONS(uint32_t, MTRAdministratorCommissioningFeature) { - MTRAdministratorCommissioningFeatureBasic MTR_PROVISIONALLY_AVAILABLE = 0x1, -} MTR_PROVISIONALLY_AVAILABLE; + MTRAdministratorCommissioningFeatureBasic MTR_NEWLY_AVAILABLE = 0x1, +} MTR_NEWLY_AVAILABLE; typedef NS_ENUM(uint8_t, MTROperationalCredentialsCertificateChainType) { MTROperationalCredentialsCertificateChainTypeDACCertificate MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x01, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index ec55b1beca255a..c947aaff946788 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -22057,6 +22057,34 @@ - (void)testEventTriggerWithParams:(MTRGeneralDiagnosticsClusterTestEventTrigger queue:self.callbackQueue completion:responseHandler]; } +- (void)timeSnapshotWithCompletion:(void (^)(MTRGeneralDiagnosticsClusterTimeSnapshotResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + [self timeSnapshotWithParams:nil completion:completion]; +} +- (void)timeSnapshotWithParams:(MTRGeneralDiagnosticsClusterTimeSnapshotParams * _Nullable)params completion:(void (^)(MTRGeneralDiagnosticsClusterTimeSnapshotResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + if (params == nil) { + params = [[MTRGeneralDiagnosticsClusterTimeSnapshotParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = GeneralDiagnostics::Commands::TimeSnapshot::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRGeneralDiagnosticsClusterTimeSnapshotResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)readAttributeNetworkInterfacesWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { @@ -45001,6 +45029,467 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC @end +@implementation MTRBaseClusterMicrowaveOvenControl + +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue +{ + if (self = [super initWithEndpointID:endpointID queue:queue]) { + if (device == nil) { + return nil; + } + + _device = device; + } + return self; +} + +- (void)setCookingParametersWithParams:(MTRMicrowaveOvenControlClusterSetCookingParametersParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRMicrowaveOvenControlClusterSetCookingParametersParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = MicrowaveOvenControl::Commands::SetCookingParameters::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)addMoreTimeWithParams:(MTRMicrowaveOvenControlClusterAddMoreTimeParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRMicrowaveOvenControlClusterAddMoreTimeParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = MicrowaveOvenControl::Commands::AddMoreTime::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)readAttributeCookTimeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MicrowaveOvenControl::Attributes::CookTime::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeCookTimeWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = MicrowaveOvenControl::Attributes::CookTime::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeCookTimeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MicrowaveOvenControl::Attributes::CookTime::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributePowerSettingWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MicrowaveOvenControl::Attributes::PowerSetting::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributePowerSettingWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = MicrowaveOvenControl::Attributes::PowerSetting::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributePowerSettingWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MicrowaveOvenControl::Attributes::PowerSetting::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeMinPowerWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MicrowaveOvenControl::Attributes::MinPower::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeMinPowerWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = MicrowaveOvenControl::Attributes::MinPower::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeMinPowerWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MicrowaveOvenControl::Attributes::MinPower::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeMaxPowerWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MicrowaveOvenControl::Attributes::MaxPower::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeMaxPowerWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = MicrowaveOvenControl::Attributes::MaxPower::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeMaxPowerWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MicrowaveOvenControl::Attributes::MaxPower::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributePowerStepWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MicrowaveOvenControl::Attributes::PowerStep::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributePowerStepWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = MicrowaveOvenControl::Attributes::PowerStep::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributePowerStepWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MicrowaveOvenControl::Attributes::PowerStep::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MicrowaveOvenControl::Attributes::GeneratedCommandList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = MicrowaveOvenControl::Attributes::GeneratedCommandList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MicrowaveOvenControl::Attributes::GeneratedCommandList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MicrowaveOvenControl::Attributes::AcceptedCommandList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = MicrowaveOvenControl::Attributes::AcceptedCommandList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MicrowaveOvenControl::Attributes::AcceptedCommandList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MicrowaveOvenControl::Attributes::EventList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = MicrowaveOvenControl::Attributes::EventList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MicrowaveOvenControl::Attributes::EventList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MicrowaveOvenControl::Attributes::AttributeList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = MicrowaveOvenControl::Attributes::AttributeList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MicrowaveOvenControl::Attributes::AttributeList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MicrowaveOvenControl::Attributes::FeatureMap::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = MicrowaveOvenControl::Attributes::FeatureMap::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MicrowaveOvenControl::Attributes::FeatureMap::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MicrowaveOvenControl::Attributes::ClusterRevision::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = MicrowaveOvenControl::Attributes::ClusterRevision::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = MicrowaveOvenControl::Attributes::ClusterRevision::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +@end + @implementation MTRBaseClusterOperationalState - (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 29f0d7e466b672..fdb2f4f4517955 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h @@ -220,6 +220,10 @@ @property (nonatomic, strong, readonly) MTRBaseDevice * device; @end +@interface MTRBaseClusterMicrowaveOvenControl () +@property (nonatomic, strong, readonly) MTRBaseDevice * device; +@end + @interface MTRBaseClusterOperationalState () @property (nonatomic, strong, readonly) MTRBaseDevice * device; @end diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index c42739771e0925..a14a13f4496c75 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -138,6 +138,7 @@ typedef NS_ENUM(uint32_t, MTRClusterIDType) { MTRClusterIDTypeAirQualityID MTR_PROVISIONALLY_AVAILABLE = 0x0000005B, MTRClusterIDTypeSmokeCOAlarmID MTR_PROVISIONALLY_AVAILABLE = 0x0000005C, MTRClusterIDTypeDishwasherAlarmID MTR_PROVISIONALLY_AVAILABLE = 0x0000005D, + MTRClusterIDTypeMicrowaveOvenControlID MTR_PROVISIONALLY_AVAILABLE = 0x0000005F, MTRClusterIDTypeOperationalStateID MTR_PROVISIONALLY_AVAILABLE = 0x00000060, MTRClusterIDTypeRVCOperationalStateID MTR_PROVISIONALLY_AVAILABLE = 0x00000061, MTRClusterIDTypeHEPAFilterMonitoringID MTR_PROVISIONALLY_AVAILABLE = 0x00000071, @@ -2435,6 +2436,19 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRAttributeIDTypeClusterDishwasherAlarmAttributeFeatureMapID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeFeatureMapID, MTRAttributeIDTypeClusterDishwasherAlarmAttributeClusterRevisionID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster MicrowaveOvenControl attributes + MTRAttributeIDTypeClusterMicrowaveOvenControlAttributeCookTimeID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + MTRAttributeIDTypeClusterMicrowaveOvenControlAttributePowerSettingID MTR_PROVISIONALLY_AVAILABLE = 0x00000002, + MTRAttributeIDTypeClusterMicrowaveOvenControlAttributeMinPowerID MTR_PROVISIONALLY_AVAILABLE = 0x00000003, + MTRAttributeIDTypeClusterMicrowaveOvenControlAttributeMaxPowerID MTR_PROVISIONALLY_AVAILABLE = 0x00000004, + MTRAttributeIDTypeClusterMicrowaveOvenControlAttributePowerStepID MTR_PROVISIONALLY_AVAILABLE = 0x00000005, + MTRAttributeIDTypeClusterMicrowaveOvenControlAttributeGeneratedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, + MTRAttributeIDTypeClusterMicrowaveOvenControlAttributeAcceptedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, + MTRAttributeIDTypeClusterMicrowaveOvenControlAttributeEventListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeEventListID, + MTRAttributeIDTypeClusterMicrowaveOvenControlAttributeAttributeListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAttributeListID, + MTRAttributeIDTypeClusterMicrowaveOvenControlAttributeFeatureMapID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeFeatureMapID, + MTRAttributeIDTypeClusterMicrowaveOvenControlAttributeClusterRevisionID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster OperationalState attributes MTRAttributeIDTypeClusterOperationalStateAttributePhaseListID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, MTRAttributeIDTypeClusterOperationalStateAttributeCurrentPhaseID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, @@ -5792,6 +5806,8 @@ typedef NS_ENUM(uint32_t, MTRCommandIDType) { // Cluster GeneralDiagnostics commands MTRCommandIDTypeClusterGeneralDiagnosticsCommandTestEventTriggerID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000000, + MTRCommandIDTypeClusterGeneralDiagnosticsCommandTimeSnapshotID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + MTRCommandIDTypeClusterGeneralDiagnosticsCommandTimeSnapshotResponseID MTR_PROVISIONALLY_AVAILABLE = 0x00000002, // Cluster SoftwareDiagnostics deprecated command id names MTRClusterSoftwareDiagnosticsCommandResetWatermarksID @@ -5979,6 +5995,10 @@ typedef NS_ENUM(uint32_t, MTRCommandIDType) { MTRCommandIDTypeClusterDishwasherAlarmCommandResetID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, MTRCommandIDTypeClusterDishwasherAlarmCommandModifyEnabledAlarmsID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + // Cluster MicrowaveOvenControl commands + MTRCommandIDTypeClusterMicrowaveOvenControlCommandSetCookingParametersID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + MTRCommandIDTypeClusterMicrowaveOvenControlCommandAddMoreTimeID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + // Cluster OperationalState commands MTRCommandIDTypeClusterOperationalStateCommandPauseID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, MTRCommandIDTypeClusterOperationalStateCommandStopID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index bbc0a86180ec83..d1b3725e829164 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -1323,6 +1323,9 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, readonly) MTRDevice * device MTR_NEWLY_AVAILABLE; - (void)testEventTriggerWithParams:(MTRGeneralDiagnosticsClusterTestEventTriggerParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); +- (void)timeSnapshotWithParams:(MTRGeneralDiagnosticsClusterTimeSnapshotParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRGeneralDiagnosticsClusterTimeSnapshotResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)timeSnapshotWithExpectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRGeneralDiagnosticsClusterTimeSnapshotResponseParams * _Nullable data, NSError * _Nullable error))completion + MTR_PROVISIONALLY_AVAILABLE; - (NSDictionary * _Nullable)readAttributeNetworkInterfacesWithParams:(MTRReadParams * _Nullable)params MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); @@ -2832,6 +2835,56 @@ MTR_PROVISIONALLY_AVAILABLE @end +/** + * Cluster Microwave Oven Control + * Attributes and commands for configuring the microwave oven control, and reporting cooking stats. + */ +MTR_PROVISIONALLY_AVAILABLE +@interface MTRClusterMicrowaveOvenControl : MTRCluster + +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ +- (instancetype _Nullable)initWithDevice:(MTRDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; + +/** + * The device this cluster object is associated with. + */ +@property (nonatomic, readonly) MTRDevice * device MTR_PROVISIONALLY_AVAILABLE; + +- (void)setCookingParametersWithParams:(MTRMicrowaveOvenControlClusterSetCookingParametersParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)addMoreTimeWithParams:(MTRMicrowaveOvenControlClusterAddMoreTimeParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeCookTimeWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributePowerSettingWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeMinPowerWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeMaxPowerWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributePowerStepWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + /** * Cluster Operational State * This cluster supports remotely monitoring and, where supported, changing the operational state of any device where a state machine is a part of the operation. diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index 9650aaf7d0e7a6..acc0dbd3f888e7 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -4440,6 +4440,37 @@ - (void)testEventTriggerWithParams:(MTRGeneralDiagnosticsClusterTestEventTrigger completion:responseHandler]; } +- (void)timeSnapshotWithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completion:(void (^)(MTRGeneralDiagnosticsClusterTimeSnapshotResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + [self timeSnapshotWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; +} +- (void)timeSnapshotWithParams:(MTRGeneralDiagnosticsClusterTimeSnapshotParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRGeneralDiagnosticsClusterTimeSnapshotResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + if (params == nil) { + params = [[MTRGeneralDiagnosticsClusterTimeSnapshotParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = GeneralDiagnostics::Commands::TimeSnapshot::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRGeneralDiagnosticsClusterTimeSnapshotResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} + - (NSDictionary * _Nullable)readAttributeNetworkInterfacesWithParams:(MTRReadParams * _Nullable)params { return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeGeneralDiagnosticsID) attributeID:@(MTRAttributeIDTypeClusterGeneralDiagnosticsAttributeNetworkInterfacesID) params:params]; @@ -8234,6 +8265,131 @@ - (void)modifyEnabledAlarmsWithParams:(MTRDishwasherAlarmClusterModifyEnabledAla @end +@implementation MTRClusterMicrowaveOvenControl + +- (instancetype)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue +{ + if (self = [super initWithEndpointID:endpointID queue:queue]) { + if (device == nil) { + return nil; + } + + _device = device; + } + return self; +} + +- (void)setCookingParametersWithParams:(MTRMicrowaveOvenControlClusterSetCookingParametersParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRMicrowaveOvenControlClusterSetCookingParametersParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = MicrowaveOvenControl::Commands::SetCookingParameters::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)addMoreTimeWithParams:(MTRMicrowaveOvenControlClusterAddMoreTimeParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRMicrowaveOvenControlClusterAddMoreTimeParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = MicrowaveOvenControl::Commands::AddMoreTime::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (NSDictionary * _Nullable)readAttributeCookTimeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeMicrowaveOvenControlID) attributeID:@(MTRAttributeIDTypeClusterMicrowaveOvenControlAttributeCookTimeID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributePowerSettingWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeMicrowaveOvenControlID) attributeID:@(MTRAttributeIDTypeClusterMicrowaveOvenControlAttributePowerSettingID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeMinPowerWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeMicrowaveOvenControlID) attributeID:@(MTRAttributeIDTypeClusterMicrowaveOvenControlAttributeMinPowerID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeMaxPowerWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeMicrowaveOvenControlID) attributeID:@(MTRAttributeIDTypeClusterMicrowaveOvenControlAttributeMaxPowerID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributePowerStepWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeMicrowaveOvenControlID) attributeID:@(MTRAttributeIDTypeClusterMicrowaveOvenControlAttributePowerStepID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeMicrowaveOvenControlID) attributeID:@(MTRAttributeIDTypeClusterMicrowaveOvenControlAttributeGeneratedCommandListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeMicrowaveOvenControlID) attributeID:@(MTRAttributeIDTypeClusterMicrowaveOvenControlAttributeAcceptedCommandListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeMicrowaveOvenControlID) attributeID:@(MTRAttributeIDTypeClusterMicrowaveOvenControlAttributeEventListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeMicrowaveOvenControlID) attributeID:@(MTRAttributeIDTypeClusterMicrowaveOvenControlAttributeAttributeListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeMicrowaveOvenControlID) attributeID:@(MTRAttributeIDTypeClusterMicrowaveOvenControlAttributeFeatureMapID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeMicrowaveOvenControlID) attributeID:@(MTRAttributeIDTypeClusterMicrowaveOvenControlAttributeClusterRevisionID) params:params]; +} + +@end + @implementation MTRClusterOperationalState - (instancetype)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.swift b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.swift index 22ff7e4fd07c90..e8691c021be3d4 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.swift +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.swift @@ -368,6 +368,13 @@ extension MTRClusterDishwasherAlarm { } } +@available(iOS, unavailable) @available(macOS, unavailable) @available(tvOS, unavailable) @available(watchOS, unavailable) +extension MTRClusterMicrowaveOvenControl { + public convenience init(device : MTRDevice, endpointID: UInt) { + self.init(device: device, endpointID: endpointID as NSNumber, queue: clusterQueue)! + } +} + @available(iOS, unavailable) @available(macOS, unavailable) @available(tvOS, unavailable) @available(watchOS, unavailable) extension MTRClusterOperationalState { public convenience init(device : MTRDevice, endpointID: UInt) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h index 3f1e00bc19794b..9e6b0e19d006a4 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h @@ -3250,6 +3250,55 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTRGeneralDiagnosticsClusterTimeSnapshotParams : 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 + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRGeneralDiagnosticsClusterTimeSnapshotResponseParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull systemTimeUs MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nullable utcTimeUs MTR_PROVISIONALLY_AVAILABLE; + +/** + * Initialize an MTRGeneralDiagnosticsClusterTimeSnapshotResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_PROVISIONALLY_AVAILABLE; +@end + MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRSoftwareDiagnosticsClusterResetWatermarksParams : NSObject /** @@ -4782,6 +4831,70 @@ MTR_PROVISIONALLY_AVAILABLE @property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTRMicrowaveOvenControlClusterSetCookingParametersParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nullable cookMode MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nullable cookTime MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nullable powerSetting MTR_PROVISIONALLY_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_PROVISIONALLY_AVAILABLE +@interface MTRMicrowaveOvenControlClusterAddMoreTimeParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull timeToAdd MTR_PROVISIONALLY_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_PROVISIONALLY_AVAILABLE @interface MTROperationalStateClusterPauseParams : NSObject /** diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index 6ffbc9daaa07ae..8828803e61d273 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -8529,6 +8529,168 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end +@implementation MTRGeneralDiagnosticsClusterTimeSnapshotParams +- (instancetype)init +{ + if (self = [super init]) { + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRGeneralDiagnosticsClusterTimeSnapshotParams 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 MTRGeneralDiagnosticsClusterTimeSnapshotParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::GeneralDiagnostics::Commands::TimeSnapshot::Type encodableStruct; + ListFreer listFreer; + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRGeneralDiagnosticsClusterTimeSnapshotResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _systemTimeUs = @(0); + + _utcTimeUs = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRGeneralDiagnosticsClusterTimeSnapshotResponseParams alloc] init]; + + other.systemTimeUs = self.systemTimeUs; + other.utcTimeUs = self.utcTimeUs; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: systemTimeUs:%@; utcTimeUs:%@; >", NSStringFromClass([self class]), _systemTimeUs, _utcTimeUs]; + return descriptionString; +} + +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::GeneralDiagnostics::Commands::TimeSnapshotResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRGeneralDiagnosticsClusterTimeSnapshotResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::GeneralDiagnostics::Commands::TimeSnapshotResponse::DecodableType &)decodableStruct +{ + { + self.systemTimeUs = [NSNumber numberWithUnsignedLongLong:decodableStruct.systemTimeUs]; + } + { + if (decodableStruct.UTCTimeUs.IsNull()) { + self.utcTimeUs = nil; + } else { + self.utcTimeUs = [NSNumber numberWithUnsignedLongLong:decodableStruct.UTCTimeUs.Value()]; + } + } + return CHIP_NO_ERROR; +} + +@end + @implementation MTRSoftwareDiagnosticsClusterResetWatermarksParams - (instancetype)init { @@ -12940,6 +13102,185 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end +@implementation MTRMicrowaveOvenControlClusterSetCookingParametersParams +- (instancetype)init +{ + if (self = [super init]) { + + _cookMode = nil; + + _cookTime = nil; + + _powerSetting = nil; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRMicrowaveOvenControlClusterSetCookingParametersParams alloc] init]; + + other.cookMode = self.cookMode; + other.cookTime = self.cookTime; + other.powerSetting = self.powerSetting; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: cookMode:%@; cookTime:%@; powerSetting:%@; >", NSStringFromClass([self class]), _cookMode, _cookTime, _powerSetting]; + return descriptionString; +} + +@end + +@implementation MTRMicrowaveOvenControlClusterSetCookingParametersParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::MicrowaveOvenControl::Commands::SetCookingParameters::Type encodableStruct; + ListFreer listFreer; + { + if (self.cookMode != nil) { + auto & definedValue_0 = encodableStruct.cookMode.Emplace(); + definedValue_0 = self.cookMode.unsignedCharValue; + } + } + { + if (self.cookTime != nil) { + auto & definedValue_0 = encodableStruct.cookTime.Emplace(); + definedValue_0 = self.cookTime.unsignedIntValue; + } + } + { + if (self.powerSetting != nil) { + auto & definedValue_0 = encodableStruct.powerSetting.Emplace(); + definedValue_0 = self.powerSetting.unsignedCharValue; + } + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRMicrowaveOvenControlClusterAddMoreTimeParams +- (instancetype)init +{ + if (self = [super init]) { + + _timeToAdd = @(0); + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRMicrowaveOvenControlClusterAddMoreTimeParams alloc] init]; + + other.timeToAdd = self.timeToAdd; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: timeToAdd:%@; >", NSStringFromClass([self class]), _timeToAdd]; + return descriptionString; +} + +@end + +@implementation MTRMicrowaveOvenControlClusterAddMoreTimeParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::MicrowaveOvenControl::Commands::AddMoreTime::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.timeToAdd = self.timeToAdd.unsignedIntValue; + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + @implementation MTROperationalStateClusterPauseParams - (instancetype)init { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h index c00abea960dec0..0698f0c97c7a3b 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h @@ -514,6 +514,18 @@ NS_ASSUME_NONNULL_BEGIN @end +@interface MTRGeneralDiagnosticsClusterTimeSnapshotParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRGeneralDiagnosticsClusterTimeSnapshotResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::GeneralDiagnostics::Commands::TimeSnapshotResponse::DecodableType &)decodableStruct; + +@end + @interface MTRSoftwareDiagnosticsClusterResetWatermarksParams (InternalMethods) - (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; @@ -814,6 +826,18 @@ NS_ASSUME_NONNULL_BEGIN @end +@interface MTRMicrowaveOvenControlClusterSetCookingParametersParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRMicrowaveOvenControlClusterAddMoreTimeParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + @interface MTROperationalStateClusterPauseParams (InternalMethods) - (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm index 9bfe9808a3d775..176f814e1f2695 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm @@ -482,6 +482,15 @@ static BOOL CommandNeedsTimedInvokeInDishwasherAlarmCluster(AttributeId aAttribu } } } +static BOOL CommandNeedsTimedInvokeInMicrowaveOvenControlCluster(AttributeId aAttributeId) +{ + using namespace Clusters::MicrowaveOvenControl; + switch (aAttributeId) { + default: { + return NO; + } + } +} static BOOL CommandNeedsTimedInvokeInOperationalStateCluster(AttributeId aAttributeId) { using namespace Clusters::OperationalState; @@ -1071,6 +1080,9 @@ BOOL MTRCommandNeedsTimedInvoke(NSNumber * _Nonnull aClusterID, NSNumber * _Nonn case Clusters::DishwasherAlarm::Id: { return CommandNeedsTimedInvokeInDishwasherAlarmCluster(commandID); } + case Clusters::MicrowaveOvenControl::Id: { + return CommandNeedsTimedInvokeInMicrowaveOvenControlCluster(commandID); + } case Clusters::OperationalState::Id: { return CommandNeedsTimedInvokeInOperationalStateCluster(commandID); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm index 62d6915ce98264..a99f502e7ef567 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm @@ -2039,6 +2039,18 @@ static id _Nullable DecodeEventPayloadForDishwasherAlarmCluster(EventId aEventId *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; return nil; } +static id _Nullable DecodeEventPayloadForMicrowaveOvenControlCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::MicrowaveOvenControl; + switch (aEventId) { + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + return nil; +} static id _Nullable DecodeEventPayloadForOperationalStateCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { using namespace Clusters::OperationalState; @@ -3453,6 +3465,9 @@ id _Nullable MTRDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVRead case Clusters::DishwasherAlarm::Id: { return DecodeEventPayloadForDishwasherAlarmCluster(aPath.mEventId, aReader, aError); } + case Clusters::MicrowaveOvenControl::Id: { + return DecodeEventPayloadForMicrowaveOvenControlCluster(aPath.mEventId, aReader, aError); + } case Clusters::OperationalState::Id: { return DecodeEventPayloadForOperationalStateCluster(aPath.mEventId, aReader, aError); } diff --git a/src/lib/core/CHIPConfig.h b/src/lib/core/CHIPConfig.h index 60efb7118bb72f..2024f9dab62591 100644 --- a/src/lib/core/CHIPConfig.h +++ b/src/lib/core/CHIPConfig.h @@ -1443,6 +1443,20 @@ extern const char CHIP_NON_PRODUCTION_MARKER[]; #define CHIP_CONFIG_MAX_SCENES_CONCURRENT_ITERATORS 2 #endif +/** + * @ def CHIP_CONFIG_MAX_SCENES_TABLE_SIZE + * + * @brief This defines how many scenes a single endpoint is allowed to allocate in flash memory. This value MUST at least 16 + * per spec and MUST be increased to allow for configuring a greater scene table size from Zap. + */ +#ifndef CHIP_CONFIG_MAX_SCENES_TABLE_SIZE +#if CHIP_CONFIG_TEST +#define CHIP_CONFIG_MAX_SCENES_TABLE_SIZE 24 +#else +#define CHIP_CONFIG_MAX_SCENES_TABLE_SIZE 16 +#endif // CHIP_CONFIG_TEST +#endif // CHIP_CONFIG_MAX_SCENES_TABLE_SIZE + /** * @def CHIP_CONFIG_TIME_ZONE_LIST_MAX_SIZE * diff --git a/src/lib/support/BitFlags.h b/src/lib/support/BitFlags.h index ec64f19f5f9676..3cc7dc4a24fdb2 100644 --- a/src/lib/support/BitFlags.h +++ b/src/lib/support/BitFlags.h @@ -50,19 +50,19 @@ class BitFlags BitFlags(const BitFlags & other) = default; BitFlags & operator=(const BitFlags &) = default; - explicit BitFlags(FlagsEnum value) : mValue(static_cast(value)) {} - explicit BitFlags(IntegerType value) : mValue(value) {} + explicit constexpr BitFlags(FlagsEnum value) : mValue(static_cast(value)) {} + explicit constexpr BitFlags(IntegerType value) : mValue(value) {} template - BitFlags(FlagsEnum flag, Args &&... args) : mValue(Or(flag, std::forward(args)...)) + constexpr BitFlags(FlagsEnum flag, Args &&... args) : mValue(Or(flag, std::forward(args)...)) {} template - BitFlags(const BitFlags & flags, Args &&... args) : mValue(Or(flags, std::forward(args)...)) + constexpr BitFlags(const BitFlags & flags, Args &&... args) : mValue(Or(flags, std::forward(args)...)) {} template - BitFlags(IntegerType value, Args &&... args) : mValue(value | Or(std::forward(args)...)) + constexpr BitFlags(IntegerType value, Args &&... args) : mValue(value | Or(std::forward(args)...)) {} /** @@ -221,7 +221,7 @@ class BitFlags * * @note This is intended to be used only to store flags into a raw binary record. */ - IntegerType Raw() const { return mValue; } + constexpr IntegerType Raw() const { return mValue; } /** * Get the address of the flags as a pointer to the underlying integer type. diff --git a/src/lib/support/JniReferences.cpp b/src/lib/support/JniReferences.cpp index f07837ade467bd..b6919f8c076b4a 100644 --- a/src/lib/support/JniReferences.cpp +++ b/src/lib/support/JniReferences.cpp @@ -21,6 +21,7 @@ #include #include #include +#include namespace chip { @@ -35,7 +36,7 @@ void JniReferences::SetJavaVm(JavaVM * jvm, const char * clsType) JNIEnv * env = GetEnvForCurrentThread(); // Any chip.devicecontroller.* class will work here - just need something to call getClassLoader() on. jclass chipClass = env->FindClass(clsType); - VerifyOrReturn(chipClass != nullptr, ChipLogError(Support, "clsType can not found")); + VerifyOrReturn(chipClass != nullptr, ChipLogError(Support, "clsType can not be found")); jclass classClass = env->FindClass("java/lang/Class"); jclass classLoaderClass = env->FindClass("java/lang/ClassLoader"); @@ -47,6 +48,36 @@ void JniReferences::SetJavaVm(JavaVM * jvm, const char * clsType) chip::JniReferences::GetInstance().GetClassRef(env, "java/util/List", mListClass); chip::JniReferences::GetInstance().GetClassRef(env, "java/util/ArrayList", mArrayListClass); chip::JniReferences::GetInstance().GetClassRef(env, "java/util/HashMap", mHashMapClass); + + // Determine if the Java code has proper Java 8 support or not. + // The class and method chosen here are arbitrary, all we care about is + // looking up any method that has an Optional parameter. + jclass controllerParamsClass = env->FindClass("chip/devicecontroller/ControllerParams"); + VerifyOrReturn(controllerParamsClass != nullptr, ChipLogError(Support, "controllerParamsClass is nullptr")); + + jmethodID getCountryCodeMethod = env->GetMethodID(controllerParamsClass, "getCountryCode", "()Ljava/util/Optional;"); + if (getCountryCodeMethod == nullptr) + { + // GetMethodID will have thrown an exception previously if it returned nullptr. + env->ExceptionClear(); + VerifyOrReturn(env->GetMethodID(controllerParamsClass, "getCountryCode", "()Lj$/util/Optional;") != nullptr, + ChipLogError(Support, "Method getCountryCode can not be found")); + use_java8_optional = false; + } + else + { + use_java8_optional = true; + } + + if (use_java8_optional) + { + chip::JniReferences::GetInstance().GetClassRef(env, "java/util/Optional", mOptionalClass); + } + else + { + chip::JniReferences::GetInstance().GetClassRef(env, "j$/util/Optional", mOptionalClass); + } + VerifyOrReturn(mOptionalClass != nullptr, ChipLogError(Support, "mOptionalClass is nullptr")); } JNIEnv * JniReferences::GetEnvForCurrentThread() @@ -90,11 +121,11 @@ CHIP_ERROR JniReferences::GetLocalClassRef(JNIEnv * env, const char * clsType, j { jclass cls = nullptr; - // Try `j$/util/Optional` when enabling Java8. - if (strcmp(clsType, "java/util/Optional") == 0) + // Try `j$/util/Optional` when enabling Java8. Check whether mOptionalClass + // is null because this method is used to originally set mOptionalClass. + if (mOptionalClass != nullptr && (strcmp(clsType, "java/util/Optional") == 0 || strcmp(clsType, "j$/util/Optional") == 0)) { - cls = env->FindClass("j$/util/Optional"); - env->ExceptionClear(); + cls = mOptionalClass; } if (cls == nullptr) @@ -129,6 +160,18 @@ CHIP_ERROR JniReferences::N2J_ByteArray(JNIEnv * env, const uint8_t * inArray, j return err; } +static std::string StrReplaceAll(const std::string & source, const std::string & from, const std::string & to) +{ + std::string newString = source; + size_t pos = 0; + while ((pos = newString.find(from, pos)) != std::string::npos) + { + newString.replace(pos, from.length(), to); + pos += to.length(); + } + return newString; +} + CHIP_ERROR JniReferences::FindMethod(JNIEnv * env, jobject object, const char * methodName, const char * methodSignature, jmethodID * methodId) { @@ -146,21 +189,14 @@ CHIP_ERROR JniReferences::FindMethod(JNIEnv * env, jobject object, const char * return CHIP_NO_ERROR; } - // Try `j$` when enabling Java8. - std::string methodSignature_java8_str(methodSignature); - size_t pos = methodSignature_java8_str.find("java/util/Optional"); - if (pos != std::string::npos) + std::string method_signature = methodSignature; + if (!use_java8_optional) { - // Replace all "java/util/Optional" with "j$/util/Optional". - while (pos != std::string::npos) - { - methodSignature_java8_str.replace(pos, strlen("java/util/Optional"), "j$/util/Optional"); - pos = methodSignature_java8_str.find("java/util/Optional"); - } - *methodId = env->GetMethodID(javaClass, methodName, methodSignature_java8_str.c_str()); - env->ExceptionClear(); + method_signature = StrReplaceAll(method_signature, "java/util/Optional", "j$/util/Optional"); } + *methodId = env->GetMethodID(javaClass, methodName, method_signature.data()); + VerifyOrReturnError(*methodId != nullptr, CHIP_JNI_ERROR_METHOD_NOT_FOUND); return CHIP_NO_ERROR; @@ -226,24 +262,23 @@ void JniReferences::ThrowError(JNIEnv * env, jclass exceptionCls, CHIP_ERROR err CHIP_ERROR JniReferences::CreateOptional(jobject objectToWrap, jobject & outOptional) { - JNIEnv * env = GetEnvForCurrentThread(); - jclass optionalCls; - chip::JniReferences::GetInstance().GetClassRef(env, "java/util/Optional", optionalCls); - VerifyOrReturnError(optionalCls != nullptr, CHIP_JNI_ERROR_TYPE_NOT_FOUND); - chip::JniClass jniClass(optionalCls); + VerifyOrReturnError(mOptionalClass != nullptr, CHIP_JNI_ERROR_TYPE_NOT_FOUND); - jmethodID ofMethod = env->GetStaticMethodID(optionalCls, "ofNullable", "(Ljava/lang/Object;)Ljava/util/Optional;"); - env->ExceptionClear(); + JNIEnv * const env = GetEnvForCurrentThread(); + VerifyOrReturnError(env != nullptr, CHIP_JNI_ERROR_NO_ENV); - // Try `Lj$/util/Optional;` when enabling Java8. - if (ofMethod == nullptr) + jmethodID ofMethod = nullptr; + if (use_java8_optional) { - ofMethod = env->GetStaticMethodID(optionalCls, "ofNullable", "(Ljava/lang/Object;)Lj$/util/Optional;"); - env->ExceptionClear(); + ofMethod = env->GetStaticMethodID(mOptionalClass, "ofNullable", "(Ljava/lang/Object;)Ljava/util/Optional;"); + } + else + { + ofMethod = env->GetStaticMethodID(mOptionalClass, "ofNullable", "(Ljava/lang/Object;)Lj$/util/Optional;"); } - VerifyOrReturnError(ofMethod != nullptr, CHIP_JNI_ERROR_METHOD_NOT_FOUND); - outOptional = env->CallStaticObjectMethod(optionalCls, ofMethod, objectToWrap); + + outOptional = env->CallStaticObjectMethod(mOptionalClass, ofMethod, objectToWrap); VerifyOrReturnError(!env->ExceptionCheck(), CHIP_JNI_ERROR_EXCEPTION_THROWN); @@ -252,13 +287,12 @@ CHIP_ERROR JniReferences::CreateOptional(jobject objectToWrap, jobject & outOpti CHIP_ERROR JniReferences::GetOptionalValue(jobject optionalObj, jobject & optionalValue) { - JNIEnv * env = GetEnvForCurrentThread(); - jclass optionalCls; - chip::JniReferences::GetInstance().GetClassRef(env, "java/util/Optional", optionalCls); - VerifyOrReturnError(optionalCls != nullptr, CHIP_JNI_ERROR_TYPE_NOT_FOUND); - chip::JniClass jniClass(optionalCls); + VerifyOrReturnError(mOptionalClass != nullptr, CHIP_JNI_ERROR_TYPE_NOT_FOUND); + + JNIEnv * const env = GetEnvForCurrentThread(); + VerifyOrReturnError(env != nullptr, CHIP_JNI_ERROR_NO_ENV); - jmethodID isPresentMethod = env->GetMethodID(optionalCls, "isPresent", "()Z"); + jmethodID isPresentMethod = env->GetMethodID(mOptionalClass, "isPresent", "()Z"); VerifyOrReturnError(isPresentMethod != nullptr, CHIP_JNI_ERROR_METHOD_NOT_FOUND); jboolean isPresent = optionalObj && env->CallBooleanMethod(optionalObj, isPresentMethod); @@ -268,7 +302,7 @@ CHIP_ERROR JniReferences::GetOptionalValue(jobject optionalObj, jobject & option return CHIP_NO_ERROR; } - jmethodID getMethod = env->GetMethodID(optionalCls, "get", "()Ljava/lang/Object;"); + jmethodID getMethod = env->GetMethodID(mOptionalClass, "get", "()Ljava/lang/Object;"); VerifyOrReturnError(getMethod != nullptr, CHIP_JNI_ERROR_METHOD_NOT_FOUND); optionalValue = env->CallObjectMethod(optionalObj, getMethod); return CHIP_NO_ERROR; diff --git a/src/lib/support/JniReferences.h b/src/lib/support/JniReferences.h index 9a0fea52019040..4abef990822b0c 100644 --- a/src/lib/support/JniReferences.h +++ b/src/lib/support/JniReferences.h @@ -190,8 +190,12 @@ class JniReferences jobject mClassLoader = nullptr; jmethodID mFindClassMethod = nullptr; + // These are global refs and therefore safe to persist. jclass mHashMapClass = nullptr; jclass mListClass = nullptr; jclass mArrayListClass = nullptr; + jclass mOptionalClass = nullptr; + + bool use_java8_optional = false; }; } // namespace chip diff --git a/src/platform/qpg/ConfigurationManagerImpl.cpp b/src/platform/qpg/ConfigurationManagerImpl.cpp index 872b05cc6c08f6..a7a59bf1438483 100644 --- a/src/platform/qpg/ConfigurationManagerImpl.cpp +++ b/src/platform/qpg/ConfigurationManagerImpl.cpp @@ -70,11 +70,6 @@ CHIP_ERROR ConfigurationManagerImpl::Init() err = StoreRebootCount(1); SuccessOrExit(err); } - if (!QPGConfig::ConfigValueExists(QPGConfig::kCounterKey_TotalOperationalHours)) - { - err = StoreTotalOperationalHours(0); - SuccessOrExit(err); - } qvRebootReason = qvCHIP_GetResetReason(); diff --git a/src/platform/qpg/DiagnosticDataProviderImpl.cpp b/src/platform/qpg/DiagnosticDataProviderImpl.cpp index 1afd80c1e5181f..da5435009685cb 100644 --- a/src/platform/qpg/DiagnosticDataProviderImpl.cpp +++ b/src/platform/qpg/DiagnosticDataProviderImpl.cpp @@ -24,6 +24,7 @@ #include #include +#include #include #include @@ -181,5 +182,27 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetActiveNetworkFaults(GeneralFaultsname = Span(threadNetworkName, strlen(threadNetworkName)); + ifp->isOperational = true; + ifp->offPremiseServicesReachableIPv4.SetNull(); + ifp->offPremiseServicesReachableIPv6.SetNull(); + ifp->type = app::Clusters::GeneralDiagnostics::InterfaceTypeEnum::kThread; + uint8_t macBuffer[ConfigurationManager::kPrimaryMACAddressLength]; + ConfigurationMgr().GetPrimary802154MACAddress(macBuffer); + ifp->hardwareAddress = ByteSpan(macBuffer, ConfigurationManager::kPrimaryMACAddressLength); +#else + ifp->isOperational = false; + ifp->type = app::Clusters::GeneralDiagnostics::InterfaceTypeEnum::kUnspecified; +#endif + *netifpp = ifp; + return CHIP_NO_ERROR; +} + } // namespace DeviceLayer } // namespace chip diff --git a/src/platform/qpg/DiagnosticDataProviderImpl.h b/src/platform/qpg/DiagnosticDataProviderImpl.h index 7f0e9147c0b53b..2da5292409021d 100644 --- a/src/platform/qpg/DiagnosticDataProviderImpl.h +++ b/src/platform/qpg/DiagnosticDataProviderImpl.h @@ -54,6 +54,7 @@ class DiagnosticDataProviderImpl : public DiagnosticDataProvider CHIP_ERROR GetActiveHardwareFaults(GeneralFaults & hardwareFaults) override; CHIP_ERROR GetActiveRadioFaults(GeneralFaults & radioFaults) override; CHIP_ERROR GetActiveNetworkFaults(GeneralFaults & networkFaults) override; + CHIP_ERROR GetNetworkInterfaces(NetworkInterface ** netifpp) override; }; /** diff --git a/src/python_testing/matter_testing_support.py b/src/python_testing/matter_testing_support.py index 398a01f6cd9d17..759e6cdf377366 100644 --- a/src/python_testing/matter_testing_support.py +++ b/src/python_testing/matter_testing_support.py @@ -300,6 +300,18 @@ def get_attribute_string(self, cluster_id: int, attribute_id) -> str: return f"Attribute {attribute_name} ({attribute_id}, 0x{attribute_id:04X})" +def id_str(id): + return f'{id} (0x{id:02x})' + + +def cluster_id_str(id): + if id in Clusters.ClusterObjects.ALL_CLUSTERS.keys(): + s = Clusters.ClusterObjects.ALL_CLUSTERS[id].__name__ + else: + s = "Unknown cluster" + return f'{id_str(id)} {s}' + + @dataclass class AttributePathLocation: endpoint_id: int @@ -319,6 +331,11 @@ def as_string(self, mapper: ClusterMapper): return desc + def __str__(self): + return (f'\n Endpoint: {self.endpoint_id},' + f'\n Cluster: {cluster_id_str(self.cluster_id)},' + f'\n Attribute:{id_str(self.attribute_id)}') + @dataclass class EventPathLocation: @@ -326,6 +343,11 @@ class EventPathLocation: cluster_id: int event_id: int + def __str__(self): + return (f'\n Endpoint: {self.endpoint_id},' + f'\n Cluster: {cluster_id_str(self.cluster_id)},' + f'\n Event: {id_str(self.event_id)}') + @dataclass class CommandPathLocation: @@ -333,12 +355,21 @@ class CommandPathLocation: cluster_id: int command_id: int + def __str__(self): + return (f'\n Endpoint: {self.endpoint_id},' + f'\n Cluster: {cluster_id_str(self.cluster_id)},' + f'\n Command: {id_str(self.command_id)}') + @dataclass class ClusterPathLocation: endpoint_id: int cluster_id: int + def __str__(self): + return (f'\n Endpoint: {self.endpoint_id},' + f'\n Cluster: {cluster_id_str(self.cluster_id)}') + @dataclass class FeaturePathLocation: @@ -346,6 +377,11 @@ class FeaturePathLocation: cluster_id: int feature_code: str + def __str__(self): + return (f'\n Endpoint: {self.endpoint_id},' + f'\n Cluster: {cluster_id_str(self.cluster_id)},' + f'\n Feature: {self.feature_code}') + # ProblemSeverity is not using StrEnum, but rather Enum, since StrEnum only # appeared in 3.11. To make it JSON serializable easily, multiple inheritance # from `str` is used. See https://stackoverflow.com/a/51976841. @@ -365,6 +401,13 @@ class ProblemNotice: problem: str spec_location: str = "" + def __str__(self): + return (f'\nProblem: {str(self.severity)}' + f'\n test_name: {self.test_name}' + f'\n location: {str(self.location)}' + f'\n problem: {self.problem}' + f'\n spec_location: {self.spec_location}\n') + @dataclass class SetupPayloadInfo: @@ -498,7 +541,7 @@ def teardown_class(self): logging.info("Problems found:") logging.info("===============") for problem in self.problems: - logging.info(f"- {json.dumps(dataclass_asdict(problem))}") + logging.info(str(problem)) logging.info("###########################################################") super().teardown_class() diff --git a/src/python_testing/spec_parsing_support.py b/src/python_testing/spec_parsing_support.py index 9e014aa95dd2aa..a2a1a09fafa35c 100644 --- a/src/python_testing/spec_parsing_support.py +++ b/src/python_testing/spec_parsing_support.py @@ -126,11 +126,11 @@ def get_conformance(self, element: ElementTree.Element) -> ElementTree.Element: if element.tag == 'feature': location = FeaturePathLocation(endpoint_id=0, cluster_id=self._cluster_id, feature_code=element.attrib['code']) elif element.tag == 'command': - location = CommandPathLocation(endpoint_id=0, cluster_id=self._cluster_id, command_id=element.attrib['id']) + location = CommandPathLocation(endpoint_id=0, cluster_id=self._cluster_id, command_id=int(element.attrib['id'], 0)) elif element.tag == 'attribute': - location = AttributePathLocation(endpoint_id=0, cluster_id=self._cluster_id, attribute_id=element.attrib['id']) + location = AttributePathLocation(endpoint_id=0, cluster_id=self._cluster_id, attribute_id=int(element.attrib['id'], 0)) elif element.tag == 'event': - location = EventPathLocation(endpoint_id=0, cluster_id=self._cluster_id, event_id=element.attrib['id']) + location = EventPathLocation(endpoint_id=0, cluster_id=self._cluster_id, event_id=int(element.attrib['id'], 0)) else: location = ClusterPathLocation(endpoing_id=0, cluster_id=self._cluster_id) self._problems.append(ProblemNotice(test_name='Spec XML parsing', location=location, diff --git a/third_party/qpg_sdk/qpg_executable.gni b/third_party/qpg_sdk/qpg_executable.gni index adfb2550a695ed..f759eddcea21ad 100644 --- a/third_party/qpg_sdk/qpg_executable.gni +++ b/third_party/qpg_sdk/qpg_executable.gni @@ -19,13 +19,6 @@ import("${build_root}/toolchain/flashable_executable.gni") import("${chip_root}/src/platform/device.gni") import("qpg_sdk.gni") -declare_args() { - matter_device_vid = "" - matter_device_pid = "" - matter_device_software_version = "" - matter_device_software_version_string = "" -} - # Run the generator script that takes a .HEX file and adds the OTA header to it. # # This requires a Python script, given by ota_header_generator, @@ -78,20 +71,6 @@ template("qpg_executable") { defines += invoker.defines } - # Overrule CHIPProjectConfig.h settings - if (matter_device_vid != "") { - defines += [ "CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID=${matter_device_vid}" ] - } - if (matter_device_pid != "") { - defines += [ "CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID=${matter_device_pid}" ] - } - if (matter_device_software_version_string != "") { - defines += [ "CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING=\"${matter_device_software_version_string}\"" ] - } - if (matter_device_software_version != "") { - defines += [ "CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION=${matter_device_software_version}" ] - } - # Copy flashing dependencies to the output directory so that the output # is collectively self-contained; this allows flashing to work reliably # even if the build and flashing steps take place on different machines diff --git a/third_party/qpg_sdk/qpg_sdk.gni b/third_party/qpg_sdk/qpg_sdk.gni index 67b0780d8fe731..d8898c3dabcf72 100644 --- a/third_party/qpg_sdk/qpg_sdk.gni +++ b/third_party/qpg_sdk/qpg_sdk.gni @@ -38,6 +38,12 @@ declare_args() { # Enable mbedtls HW acceleration mbedtls_alt_enabled = true + + # OTA parameters + matter_device_vid = "" + matter_device_pid = "" + matter_device_software_version = "" + matter_device_software_version_string = "" } assert(qpg_sdk_root != "", "qpg_sdk_root must be specified") @@ -92,6 +98,26 @@ template("qpg_sdk") { #MBed TLS built from third_party/mbedtls tree - OT config not used defines = [ "MBEDTLS_CONFIG_FILE=\"${qpg_target_ic}-mbedtls-config.h\"" ] + # Overrule CHIPProjectConfig.h settings + if (matter_device_vid != "") { + defines += [ "CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID=${matter_device_vid}" ] + } + if (matter_device_pid != "") { + defines += [ "CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID=${matter_device_pid}" ] + } + if (matter_device_software_version_string != "") { + defines += [ "CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING=\"${matter_device_software_version_string}\"" ] + } + if (matter_device_software_version != "") { + defines += [ "CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION=${matter_device_software_version}" ] + } + + if (qpg_target_ic == "qpg6200") { + defines += [ "QPG_6200" ] + } else { + include_dirs += [ "${qpg_sdk_root}/Components/ThirdParty/Silex/cryptosoc/mbedtls_alt_3.3.0" ] + } + if (mbedtls_alt_enabled) { defines += [ "QORVO_CRYPTO_ENGINE" ] } else { 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 9563ed39d85707..89d6c8f9673530 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 @@ -363,9 +363,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value) namespace NameSupport { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::BitMask * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits>; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::Scenes::Id, Id, readable, sizeof(temp)); @@ -377,9 +377,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) *value = Traits::StorageToWorking(temp); return status; } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits>; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -8316,6 +8316,229 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) } // namespace Attributes } // namespace DishwasherAlarm +namespace MicrowaveOvenControl { +namespace Attributes { + +namespace CookTime { + +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::MicrowaveOvenControl::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::MicrowaveOvenControl::Id, Id, writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE); +} + +} // namespace CookTime + +namespace PowerSetting { + +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::MicrowaveOvenControl::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, uint8_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::MicrowaveOvenControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +} // namespace PowerSetting + +namespace MinPower { + +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::MicrowaveOvenControl::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, uint8_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::MicrowaveOvenControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +} // namespace MinPower + +namespace MaxPower { + +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::MicrowaveOvenControl::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, uint8_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::MicrowaveOvenControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +} // namespace MaxPower + +namespace PowerStep { + +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::MicrowaveOvenControl::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, uint8_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::MicrowaveOvenControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +} // namespace PowerStep + +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::MicrowaveOvenControl::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::MicrowaveOvenControl::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::MicrowaveOvenControl::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::MicrowaveOvenControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace MicrowaveOvenControl + namespace OperationalState { namespace Attributes { @@ -17735,9 +17958,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullabl namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, readable, sizeof(temp)); @@ -17749,9 +17972,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) *value = Traits::StorageToWorking(temp); return status; } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -17759,7 +17982,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace Tolerance 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 e993b63df4c0ea..ab3e2bad0d1cb0 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 @@ -100,8 +100,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value); } // namespace SceneValid namespace NameSupport { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // bitmap8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +EmberAfStatus Get(chip::EndpointId endpoint, + chip::BitMask * value); // NameSupportBitmap +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value); } // namespace NameSupport namespace LastConfiguredBy { @@ -1613,6 +1614,47 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Attributes } // namespace DishwasherAlarm +namespace MicrowaveOvenControl { +namespace Attributes { + +namespace CookTime { +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // elapsed_s +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); +} // namespace CookTime + +namespace PowerSetting { +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +} // namespace PowerSetting + +namespace MinPower { +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +} // namespace MinPower + +namespace MaxPower { +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +} // namespace MaxPower + +namespace PowerStep { +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +} // namespace PowerStep + +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 MicrowaveOvenControl + namespace OperationalState { namespace Attributes { @@ -3128,8 +3170,8 @@ EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullabl } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // temperature -EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Tolerance namespace FeatureMap { 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 9b692fb362815b..8911dd4f10d819 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -457,6 +457,14 @@ void emberAfSmokeCoAlarmClusterInitCallback(chip::EndpointId endpoint); */ void emberAfDishwasherAlarmClusterInitCallback(chip::EndpointId endpoint); +/** @brief Microwave Oven Control Cluster Init + * + * Cluster Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfMicrowaveOvenControlClusterInitCallback(chip::EndpointId endpoint); + /** @brief Operational State Cluster Init * * Cluster Init @@ -4911,6 +4919,82 @@ void emberAfDishwasherAlarmClusterServerTickCallback(chip::EndpointId endpoint); */ void emberAfDishwasherAlarmClusterClientTickCallback(chip::EndpointId endpoint); +// +// Microwave Oven Control Cluster +// + +/** @brief Microwave Oven Control Cluster Server Init + * + * Server Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfMicrowaveOvenControlClusterServerInitCallback(chip::EndpointId endpoint); + +/** @brief Microwave Oven Control Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterMicrowaveOvenControlClusterServerShutdownCallback(chip::EndpointId endpoint); + +/** @brief Microwave Oven Control Cluster Client Init + * + * Client Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfMicrowaveOvenControlClusterClientInitCallback(chip::EndpointId endpoint); + +/** @brief Microwave Oven Control Cluster Server Attribute Changed + * + * Server Attribute Changed + * + * @param attributePath Concrete attribute path that changed + */ +void MatterMicrowaveOvenControlClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); + +/** @brief Microwave Oven Control 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 MatterMicrowaveOvenControlClusterServerPreAttributeChangedCallback( + const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); + +/** @brief Microwave Oven Control 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 MatterMicrowaveOvenControlClusterClientPreAttributeChangedCallback( + const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); + +/** @brief Microwave Oven Control Cluster Server Tick + * + * Server Tick + * + * @param endpoint Endpoint that is being served + */ +void emberAfMicrowaveOvenControlClusterServerTickCallback(chip::EndpointId endpoint); + +/** @brief Microwave Oven Control Cluster Client Tick + * + * Client Tick + * + * @param endpoint Endpoint that is being served + */ +void emberAfMicrowaveOvenControlClusterClientTickCallback(chip::EndpointId endpoint); + // // Operational State Cluster // @@ -8659,6 +8743,12 @@ bool emberAfDiagnosticLogsClusterRetrieveLogsRequestCallback( bool emberAfGeneralDiagnosticsClusterTestEventTriggerCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::DecodableType & commandData); +/** + * @brief General Diagnostics Cluster TimeSnapshot Command callback (from client) + */ +bool emberAfGeneralDiagnosticsClusterTimeSnapshotCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::GeneralDiagnostics::Commands::TimeSnapshot::DecodableType & commandData); /** * @brief Software Diagnostics Cluster ResetWatermarks Command callback (from client) */ @@ -8851,6 +8941,18 @@ bool emberAfDishwasherAlarmClusterResetCallback( bool emberAfDishwasherAlarmClusterModifyEnabledAlarmsCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::DishwasherAlarm::Commands::ModifyEnabledAlarms::DecodableType & commandData); +/** + * @brief Microwave Oven Control Cluster SetCookingParameters Command callback (from client) + */ +bool emberAfMicrowaveOvenControlClusterSetCookingParametersCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::MicrowaveOvenControl::Commands::SetCookingParameters::DecodableType & commandData); +/** + * @brief Microwave Oven Control Cluster AddMoreTime Command callback (from client) + */ +bool emberAfMicrowaveOvenControlClusterAddMoreTimeCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::MicrowaveOvenControl::Commands::AddMoreTime::DecodableType & commandData); /** * @brief Door Lock Cluster LockDoor 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 3c99edccb8242c..1b229194a23e25 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 @@ -90,6 +90,12 @@ enum class NameSupportBitmap : uint8_t namespace Scenes { +// Bitmap for CopyModeBitmap +enum class CopyModeBitmap : uint8_t +{ + kCopyAllScenes = 0x1, +}; + // Bitmap for Feature enum class Feature : uint32_t { @@ -99,10 +105,10 @@ enum class Feature : uint32_t kFabricScenes = 0x8, }; -// Bitmap for ScenesCopyMode -enum class ScenesCopyMode : uint8_t +// Bitmap for NameSupportBitmap +enum class NameSupportBitmap : uint8_t { - kCopyAllScenes = 0x1, + kSceneNames = 0x80, }; } // namespace Scenes @@ -1848,6 +1854,8 @@ enum class Feature : uint32_t }; } // namespace DishwasherAlarm +namespace MicrowaveOvenControl {} // namespace MicrowaveOvenControl + namespace OperationalState { // Enum for ErrorStateEnum 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 139fc46ed756bf..1e1b2bd29c8733 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 @@ -6457,6 +6457,65 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } } } // namespace TestEventTrigger. +namespace TimeSnapshot { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + } +} +} // namespace TimeSnapshot. +namespace TimeSnapshotResponse { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kSystemTimeUs), systemTimeUs); + encoder.Encode(to_underlying(Fields::kUTCTimeUs), UTCTimeUs); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kSystemTimeUs)) + { + err = DataModel::Decode(reader, systemTimeUs); + } + else if (__context_tag == to_underlying(Fields::kUTCTimeUs)) + { + err = DataModel::Decode(reader, UTCTimeUs); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace TimeSnapshotResponse. } // namespace Commands namespace Attributes { @@ -11965,6 +12024,125 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } // namespace Events } // namespace DishwasherAlarm +namespace MicrowaveOvenControl { + +namespace Commands { +namespace SetCookingParameters { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kCookMode), cookMode); + encoder.Encode(to_underlying(Fields::kCookTime), cookTime); + encoder.Encode(to_underlying(Fields::kPowerSetting), powerSetting); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kCookMode)) + { + err = DataModel::Decode(reader, cookMode); + } + else if (__context_tag == to_underlying(Fields::kCookTime)) + { + err = DataModel::Decode(reader, cookTime); + } + else if (__context_tag == to_underlying(Fields::kPowerSetting)) + { + err = DataModel::Decode(reader, powerSetting); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace SetCookingParameters. +namespace AddMoreTime { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kTimeToAdd), timeToAdd); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kTimeToAdd)) + { + err = DataModel::Decode(reader, timeToAdd); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace AddMoreTime. +} // namespace Commands + +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::CookTime::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, cookTime); + case Attributes::PowerSetting::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, powerSetting); + case Attributes::MinPower::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, minPower); + case Attributes::MaxPower::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, maxPower); + case Attributes::PowerStep::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, powerStep); + case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, generatedCommandList); + case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, acceptedCommandList); + case Attributes::EventList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, eventList); + case Attributes::AttributeList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, attributeList); + case Attributes::FeatureMap::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, featureMap); + case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, clusterRevision); + default: + return CHIP_NO_ERROR; + } +} +} // namespace Attributes + +namespace Events {} // namespace Events + +} // namespace MicrowaveOvenControl namespace OperationalState { namespace Structs {} // namespace Structs @@ -22911,6 +23089,13 @@ bool CommandIsFabricScoped(ClusterId aCluster, CommandId aCommand) return false; } } + case Clusters::MicrowaveOvenControl::Id: { + switch (aCommand) + { + default: + return false; + } + } case Clusters::OperationalState::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 ca8a7867870c28..5253bd5eaef4f2 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 @@ -1739,7 +1739,7 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::CopyScene::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Scenes::Id; } - chip::BitMask mode = static_cast>(0); + chip::BitMask mode = static_cast>(0); chip::GroupId groupIdentifierFrom = static_cast(0); uint8_t sceneIdentifierFrom = static_cast(0); chip::GroupId groupIdentifierTo = static_cast(0); @@ -1758,7 +1758,7 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::CopyScene::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Scenes::Id; } - chip::BitMask mode = static_cast>(0); + chip::BitMask mode = static_cast>(0); chip::GroupId groupIdentifierFrom = static_cast(0); uint8_t sceneIdentifierFrom = static_cast(0); chip::GroupId groupIdentifierTo = static_cast(0); @@ -1859,9 +1859,9 @@ struct TypeInfo namespace NameSupport { struct TypeInfo { - using Type = uint8_t; - using DecodableType = uint8_t; - using DecodableArgType = uint8_t; + using Type = chip::BitMask; + using DecodableType = chip::BitMask; + using DecodableArgType = chip::BitMask; static constexpr ClusterId GetClusterId() { return Clusters::Scenes::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::NameSupport::Id; } @@ -1953,7 +1953,8 @@ struct TypeInfo Attributes::CurrentScene::TypeInfo::DecodableType currentScene = static_cast(0); Attributes::CurrentGroup::TypeInfo::DecodableType currentGroup = static_cast(0); Attributes::SceneValid::TypeInfo::DecodableType sceneValid = static_cast(0); - Attributes::NameSupport::TypeInfo::DecodableType nameSupport = static_cast(0); + Attributes::NameSupport::TypeInfo::DecodableType nameSupport = + static_cast>(0); Attributes::LastConfiguredBy::TypeInfo::DecodableType lastConfiguredBy; Attributes::SceneTableSize::TypeInfo::DecodableType sceneTableSize = static_cast(0); Attributes::RemainingCapacity::TypeInfo::DecodableType remainingCapacity = static_cast(0); @@ -8176,6 +8177,16 @@ struct Type; struct DecodableType; } // namespace TestEventTrigger +namespace TimeSnapshot { +struct Type; +struct DecodableType; +} // namespace TimeSnapshot + +namespace TimeSnapshotResponse { +struct Type; +struct DecodableType; +} // namespace TimeSnapshotResponse + } // namespace Commands namespace Commands { @@ -8214,6 +8225,69 @@ struct DecodableType CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace TestEventTrigger +namespace TimeSnapshot { +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::TimeSnapshot::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::GeneralDiagnostics::Id; } + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = Clusters::GeneralDiagnostics::Commands::TimeSnapshotResponse::DecodableType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::TimeSnapshot::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::GeneralDiagnostics::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace TimeSnapshot +namespace TimeSnapshotResponse { +enum class Fields : uint8_t +{ + kSystemTimeUs = 0, + kUTCTimeUs = 1, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::TimeSnapshotResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::GeneralDiagnostics::Id; } + + uint64_t systemTimeUs = static_cast(0); + DataModel::Nullable UTCTimeUs; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::TimeSnapshotResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::GeneralDiagnostics::Id; } + + uint64_t systemTimeUs = static_cast(0); + DataModel::Nullable UTCTimeUs; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace TimeSnapshotResponse } // namespace Commands namespace Attributes { @@ -16803,6 +16877,218 @@ struct DecodableType } // namespace Notify } // namespace Events } // namespace DishwasherAlarm +namespace MicrowaveOvenControl { + +namespace Commands { +// Forward-declarations so we can reference these later. + +namespace SetCookingParameters { +struct Type; +struct DecodableType; +} // namespace SetCookingParameters + +namespace AddMoreTime { +struct Type; +struct DecodableType; +} // namespace AddMoreTime + +} // namespace Commands + +namespace Commands { +namespace SetCookingParameters { +enum class Fields : uint8_t +{ + kCookMode = 0, + kCookTime = 1, + kPowerSetting = 2, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::SetCookingParameters::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MicrowaveOvenControl::Id; } + + Optional cookMode; + Optional cookTime; + Optional powerSetting; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::SetCookingParameters::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MicrowaveOvenControl::Id; } + + Optional cookMode; + Optional cookTime; + Optional powerSetting; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace SetCookingParameters +namespace AddMoreTime { +enum class Fields : uint8_t +{ + kTimeToAdd = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::AddMoreTime::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MicrowaveOvenControl::Id; } + + uint32_t timeToAdd = static_cast(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::AddMoreTime::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MicrowaveOvenControl::Id; } + + uint32_t timeToAdd = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace AddMoreTime +} // namespace Commands + +namespace Attributes { + +namespace CookTime { +struct TypeInfo +{ + using Type = uint32_t; + using DecodableType = uint32_t; + using DecodableArgType = uint32_t; + + static constexpr ClusterId GetClusterId() { return Clusters::MicrowaveOvenControl::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::CookTime::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace CookTime +namespace PowerSetting { +struct TypeInfo +{ + using Type = uint8_t; + using DecodableType = uint8_t; + using DecodableArgType = uint8_t; + + static constexpr ClusterId GetClusterId() { return Clusters::MicrowaveOvenControl::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::PowerSetting::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace PowerSetting +namespace MinPower { +struct TypeInfo +{ + using Type = uint8_t; + using DecodableType = uint8_t; + using DecodableArgType = uint8_t; + + static constexpr ClusterId GetClusterId() { return Clusters::MicrowaveOvenControl::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::MinPower::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace MinPower +namespace MaxPower { +struct TypeInfo +{ + using Type = uint8_t; + using DecodableType = uint8_t; + using DecodableArgType = uint8_t; + + static constexpr ClusterId GetClusterId() { return Clusters::MicrowaveOvenControl::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::MaxPower::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace MaxPower +namespace PowerStep { +struct TypeInfo +{ + using Type = uint8_t; + using DecodableType = uint8_t; + using DecodableArgType = uint8_t; + + static constexpr ClusterId GetClusterId() { return Clusters::MicrowaveOvenControl::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::PowerStep::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace PowerStep +namespace GeneratedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::MicrowaveOvenControl::Id; } +}; +} // namespace GeneratedCommandList +namespace AcceptedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::MicrowaveOvenControl::Id; } +}; +} // namespace AcceptedCommandList +namespace EventList { +struct TypeInfo : public Clusters::Globals::Attributes::EventList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::MicrowaveOvenControl::Id; } +}; +} // namespace EventList +namespace AttributeList { +struct TypeInfo : public Clusters::Globals::Attributes::AttributeList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::MicrowaveOvenControl::Id; } +}; +} // namespace AttributeList +namespace FeatureMap { +struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::MicrowaveOvenControl::Id; } +}; +} // namespace FeatureMap +namespace ClusterRevision { +struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::MicrowaveOvenControl::Id; } +}; +} // namespace ClusterRevision + +struct TypeInfo +{ + struct DecodableType + { + static constexpr ClusterId GetClusterId() { return Clusters::MicrowaveOvenControl::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); + + Attributes::CookTime::TypeInfo::DecodableType cookTime = static_cast(0); + Attributes::PowerSetting::TypeInfo::DecodableType powerSetting = static_cast(0); + Attributes::MinPower::TypeInfo::DecodableType minPower = static_cast(0); + Attributes::MaxPower::TypeInfo::DecodableType maxPower = static_cast(0); + Attributes::PowerStep::TypeInfo::DecodableType powerStep = 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 MicrowaveOvenControl namespace OperationalState { namespace Structs { namespace ErrorStateStruct = Clusters::detail::Structs::ErrorStateStruct; @@ -24992,9 +25278,9 @@ struct TypeInfo namespace Tolerance { struct TypeInfo { - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; + using Type = uint16_t; + using DecodableType = uint16_t; + using DecodableArgType = uint16_t; static constexpr ClusterId GetClusterId() { return Clusters::TemperatureMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::Tolerance::Id; } @@ -25049,7 +25335,7 @@ struct TypeInfo Attributes::MeasuredValue::TypeInfo::DecodableType measuredValue; Attributes::MinMeasuredValue::TypeInfo::DecodableType minMeasuredValue; Attributes::MaxMeasuredValue::TypeInfo::DecodableType maxMeasuredValue; - Attributes::Tolerance::TypeInfo::DecodableType tolerance = static_cast(0); + Attributes::Tolerance::TypeInfo::DecodableType tolerance = static_cast(0); Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; Attributes::EventList::TypeInfo::DecodableType eventList; 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 d58e6eb18dd62a..d6685e05984fe9 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 @@ -3025,6 +3025,56 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace Attributes } // namespace DishwasherAlarm +namespace MicrowaveOvenControl { +namespace Attributes { + +namespace CookTime { +static constexpr AttributeId Id = 0x00000001; +} // namespace CookTime + +namespace PowerSetting { +static constexpr AttributeId Id = 0x00000002; +} // namespace PowerSetting + +namespace MinPower { +static constexpr AttributeId Id = 0x00000003; +} // namespace MinPower + +namespace MaxPower { +static constexpr AttributeId Id = 0x00000004; +} // namespace MaxPower + +namespace PowerStep { +static constexpr AttributeId Id = 0x00000005; +} // namespace PowerStep + +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 MicrowaveOvenControl + namespace OperationalState { 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 903a673b79e570..008cb452bdbe88 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 @@ -184,6 +184,9 @@ static constexpr ClusterId Id = 0x0000005C; namespace DishwasherAlarm { static constexpr ClusterId Id = 0x0000005D; } // namespace DishwasherAlarm +namespace MicrowaveOvenControl { +static constexpr ClusterId Id = 0x0000005F; +} // namespace MicrowaveOvenControl namespace OperationalState { static constexpr ClusterId Id = 0x00000060; } // namespace OperationalState 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 2b957cf72375ed..f8aef6170b41a7 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 @@ -434,6 +434,14 @@ namespace TestEventTrigger { static constexpr CommandId Id = 0x00000000; } // namespace TestEventTrigger +namespace TimeSnapshot { +static constexpr CommandId Id = 0x00000001; +} // namespace TimeSnapshot + +namespace TimeSnapshotResponse { +static constexpr CommandId Id = 0x00000002; +} // namespace TimeSnapshotResponse + } // namespace Commands } // namespace GeneralDiagnostics @@ -745,6 +753,20 @@ static constexpr CommandId Id = 0x00000001; } // namespace Commands } // namespace DishwasherAlarm +namespace MicrowaveOvenControl { +namespace Commands { + +namespace SetCookingParameters { +static constexpr CommandId Id = 0x00000000; +} // namespace SetCookingParameters + +namespace AddMoreTime { +static constexpr CommandId Id = 0x00000001; +} // namespace AddMoreTime + +} // namespace Commands +} // namespace MicrowaveOvenControl + namespace OperationalState { 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 f3dbf7e60bc35d..80240a4c92f836 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 @@ -362,6 +362,13 @@ #define CHIP_PRINTCLUSTER_DISHWASHER_ALARM_CLUSTER #endif +#if defined(ZCL_USING_MICROWAVE_OVEN_CONTROL_CLUSTER_SERVER) || defined(ZCL_USING_MICROWAVE_OVEN_CONTROL_CLUSTER_CLIENT) +#define CHIP_PRINTCLUSTER_MICROWAVE_OVEN_CONTROL_CLUSTER \ + { chip::app::Clusters::MicrowaveOvenControl::Id, "Microwave Oven Control" }, +#else +#define CHIP_PRINTCLUSTER_MICROWAVE_OVEN_CONTROL_CLUSTER +#endif + #if defined(ZCL_USING_OPERATIONAL_STATE_CLUSTER_SERVER) || defined(ZCL_USING_OPERATIONAL_STATE_CLUSTER_CLIENT) #define CHIP_PRINTCLUSTER_OPERATIONAL_STATE_CLUSTER { chip::app::Clusters::OperationalState::Id, "Operational State" }, #else @@ -719,6 +726,7 @@ CHIP_PRINTCLUSTER_AIR_QUALITY_CLUSTER \ CHIP_PRINTCLUSTER_SMOKE_CO_ALARM_CLUSTER \ CHIP_PRINTCLUSTER_DISHWASHER_ALARM_CLUSTER \ + CHIP_PRINTCLUSTER_MICROWAVE_OVEN_CONTROL_CLUSTER \ CHIP_PRINTCLUSTER_OPERATIONAL_STATE_CLUSTER \ CHIP_PRINTCLUSTER_OPERATIONAL_STATE_RVC_CLUSTER \ CHIP_PRINTCLUSTER_HEPA_FILTER_MONITORING_CLUSTER \ diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index f65b3063fba7bd..bc8d7d9586fad8 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -87,6 +87,7 @@ | AirQuality | 0x005B | | SmokeCoAlarm | 0x005C | | DishwasherAlarm | 0x005D | +| MicrowaveOvenControl | 0x005F | | OperationalState | 0x0060 | | RvcOperationalState | 0x0061 | | HepaFilterMonitoring | 0x0071 | @@ -3053,6 +3054,7 @@ class DiagnosticLogsRetrieveLogsRequest : public ClusterCommand |------------------------------------------------------------------------------| | Commands: | | | * TestEventTrigger | 0x00 | +| * TimeSnapshot | 0x01 | |------------------------------------------------------------------------------| | Attributes: | | | * NetworkInterfaces | 0x0000 | @@ -3118,6 +3120,43 @@ class GeneralDiagnosticsTestEventTrigger : public ClusterCommand chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type mRequest; }; +/* + * Command TimeSnapshot + */ +class GeneralDiagnosticsTimeSnapshot : public ClusterCommand +{ +public: + GeneralDiagnosticsTimeSnapshot(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("time-snapshot", credsIssuerConfig) + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::GeneralDiagnostics::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::GeneralDiagnostics::Commands::TimeSnapshot::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::GeneralDiagnostics::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::GeneralDiagnostics::Commands::TimeSnapshot::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::GeneralDiagnostics::Commands::TimeSnapshot::Type mRequest; +}; + /*----------------------------------------------------------------------------*\ | Cluster SoftwareDiagnostics | 0x0034 | |------------------------------------------------------------------------------| @@ -5273,6 +5312,107 @@ class DishwasherAlarmModifyEnabledAlarms : public ClusterCommand chip::app::Clusters::DishwasherAlarm::Commands::ModifyEnabledAlarms::Type mRequest; }; +/*----------------------------------------------------------------------------*\ +| Cluster MicrowaveOvenControl | 0x005F | +|------------------------------------------------------------------------------| +| Commands: | | +| * SetCookingParameters | 0x00 | +| * AddMoreTime | 0x01 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * CookTime | 0x0001 | +| * PowerSetting | 0x0002 | +| * MinPower | 0x0003 | +| * MaxPower | 0x0004 | +| * PowerStep | 0x0005 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + +/* + * Command SetCookingParameters + */ +class MicrowaveOvenControlSetCookingParameters : public ClusterCommand +{ +public: + MicrowaveOvenControlSetCookingParameters(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("set-cooking-parameters", credsIssuerConfig) + { + AddArgument("CookMode", 0, UINT8_MAX, &mRequest.cookMode); + AddArgument("CookTime", 0, UINT32_MAX, &mRequest.cookTime); + AddArgument("PowerSetting", 0, UINT8_MAX, &mRequest.powerSetting); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::MicrowaveOvenControl::Commands::SetCookingParameters::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::MicrowaveOvenControl::Commands::SetCookingParameters::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::MicrowaveOvenControl::Commands::SetCookingParameters::Type mRequest; +}; + +/* + * Command AddMoreTime + */ +class MicrowaveOvenControlAddMoreTime : public ClusterCommand +{ +public: + MicrowaveOvenControlAddMoreTime(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("add-more-time", credsIssuerConfig) + { + AddArgument("TimeToAdd", 0, UINT32_MAX, &mRequest.timeToAdd); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::MicrowaveOvenControl::Commands::AddMoreTime::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::MicrowaveOvenControl::Commands::AddMoreTime::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::MicrowaveOvenControl::Commands::AddMoreTime::Type mRequest; +}; + /*----------------------------------------------------------------------------*\ | Cluster OperationalState | 0x0060 | |------------------------------------------------------------------------------| @@ -11654,8 +11794,8 @@ void registerClusterScenes(Commands & commands, CredentialIssuerCommands * creds WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>(Id, "scene-valid", 0, 1, Attributes::SceneValid::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "name-support", 0, UINT8_MAX, Attributes::NameSupport::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "name-support", 0, UINT8_MAX, Attributes::NameSupport::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>>( Id, "last-configured-by", 0, UINT64_MAX, Attributes::LastConfiguredBy::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // @@ -13365,6 +13505,7 @@ void registerClusterGeneralDiagnostics(Commands & commands, CredentialIssuerComm // make_unique(Id, credsIssuerConfig), // make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // // // Attributes // @@ -15950,6 +16091,79 @@ void registerClusterDishwasherAlarm(Commands & commands, CredentialIssuerCommand commands.RegisterCluster(clusterName, clusterCommands); } +void registerClusterMicrowaveOvenControl(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) +{ + using namespace chip::app::Clusters::MicrowaveOvenControl; + + const char * clusterName = "MicrowaveOvenControl"; + + commands_list clusterCommands = { + // + // Commands + // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + // + // Attributes + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "cook-time", Attributes::CookTime::Id, credsIssuerConfig), // + make_unique(Id, "power-setting", Attributes::PowerSetting::Id, credsIssuerConfig), // + make_unique(Id, "min-power", Attributes::MinPower::Id, credsIssuerConfig), // + make_unique(Id, "max-power", Attributes::MaxPower::Id, credsIssuerConfig), // + make_unique(Id, "power-step", Attributes::PowerStep::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, "cook-time", 0, UINT32_MAX, Attributes::CookTime::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "power-setting", 0, UINT8_MAX, Attributes::PowerSetting::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "min-power", 0, UINT8_MAX, Attributes::MinPower::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>(Id, "max-power", 0, UINT8_MAX, Attributes::MaxPower::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>(Id, "power-step", 0, UINT8_MAX, Attributes::PowerStep::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, "cook-time", Attributes::CookTime::Id, credsIssuerConfig), // + make_unique(Id, "power-setting", Attributes::PowerSetting::Id, credsIssuerConfig), // + make_unique(Id, "min-power", Attributes::MinPower::Id, credsIssuerConfig), // + make_unique(Id, "max-power", Attributes::MaxPower::Id, credsIssuerConfig), // + make_unique(Id, "power-step", Attributes::PowerStep::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.RegisterCluster(clusterName, clusterCommands); +} void registerClusterOperationalState(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) { using namespace chip::app::Clusters::OperationalState; @@ -18036,8 +18250,8 @@ void registerClusterTemperatureMeasurement(Commands & commands, CredentialIssuer make_unique>>(Id, "max-measured-value", INT16_MIN, INT16_MAX, Attributes::MaxMeasuredValue::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "tolerance", INT16_MIN, INT16_MAX, Attributes::Tolerance::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "tolerance", 0, UINT16_MAX, Attributes::Tolerance::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>>( Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // @@ -21618,6 +21832,7 @@ void registerClusters(Commands & commands, CredentialIssuerCommands * credsIssue registerClusterAirQuality(commands, credsIssuerConfig); registerClusterSmokeCoAlarm(commands, credsIssuerConfig); registerClusterDishwasherAlarm(commands, credsIssuerConfig); + registerClusterMicrowaveOvenControl(commands, credsIssuerConfig); registerClusterOperationalState(commands, credsIssuerConfig); registerClusterRvcOperationalState(commands, credsIssuerConfig); registerClusterHepaFilterMonitoring(commands, credsIssuerConfig); 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 f26ae6d1c32025..b745371e19bc0f 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -4625,6 +4625,15 @@ 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 GeneralDiagnostics::Commands::TimeSnapshotResponse::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + ReturnErrorOnFailure(DataModelLogger::LogValue("systemTimeUs", indent + 1, value.systemTimeUs)); + ReturnErrorOnFailure(DataModelLogger::LogValue("UTCTimeUs", indent + 1, value.UTCTimeUs)); + DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; +} CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const TimeSynchronization::Commands::SetTimeZoneResponse::DecodableType & value) { @@ -5197,7 +5206,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP return DataModelLogger::LogValue("SceneValid", 1, value); } case Scenes::Attributes::NameSupport::Id: { - uint8_t value; + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("NameSupport", 1, value); } @@ -8752,6 +8761,67 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } + case MicrowaveOvenControl::Id: { + switch (path.mAttributeId) + { + case MicrowaveOvenControl::Attributes::CookTime::Id: { + uint32_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("CookTime", 1, value); + } + case MicrowaveOvenControl::Attributes::PowerSetting::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("PowerSetting", 1, value); + } + case MicrowaveOvenControl::Attributes::MinPower::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("MinPower", 1, value); + } + case MicrowaveOvenControl::Attributes::MaxPower::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("MaxPower", 1, value); + } + case MicrowaveOvenControl::Attributes::PowerStep::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("PowerStep", 1, value); + } + case MicrowaveOvenControl::Attributes::GeneratedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + } + case MicrowaveOvenControl::Attributes::AcceptedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + } + case MicrowaveOvenControl::Attributes::EventList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("EventList", 1, value); + } + case MicrowaveOvenControl::Attributes::AttributeList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AttributeList", 1, value); + } + case MicrowaveOvenControl::Attributes::FeatureMap::Id: { + uint32_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("FeatureMap", 1, value); + } + case MicrowaveOvenControl::Attributes::ClusterRevision::Id: { + uint16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ClusterRevision", 1, value); + } + } + break; + } case OperationalState::Id: { switch (path.mAttributeId) { @@ -10533,7 +10603,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP return DataModelLogger::LogValue("MaxMeasuredValue", 1, value); } case TemperatureMeasurement::Attributes::Tolerance::Id: { - int16_t value; + uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("Tolerance", 1, value); } @@ -13711,6 +13781,17 @@ CHIP_ERROR DataModelLogger::LogCommand(const chip::app::ConcreteCommandPath & pa } break; } + case GeneralDiagnostics::Id: { + switch (path.mCommandId) + { + case GeneralDiagnostics::Commands::TimeSnapshotResponse::Id: { + GeneralDiagnostics::Commands::TimeSnapshotResponse::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("TimeSnapshotResponse", 1, value); + } + } + break; + } case TimeSynchronization::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 96f8b52b007164..6d2ccf1c0fbc68 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h @@ -460,6 +460,8 @@ LogValue(const char * label, size_t indent, const chip::app::Clusters::NetworkCommissioning::Commands::ConnectNetworkResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::DiagnosticLogs::Commands::RetrieveLogsResponse::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::GeneralDiagnostics::Commands::TimeSnapshotResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::TimeSynchronization::Commands::SetTimeZoneResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, 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 519a27da8c68ba..8886f8061f74eb 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -90,6 +90,7 @@ | AirQuality | 0x005B | | SmokeCoAlarm | 0x005C | | DishwasherAlarm | 0x005D | +| MicrowaveOvenControl | 0x005F | | OperationalState | 0x0060 | | RvcOperationalState | 0x0061 | | HepaFilterMonitoring | 0x0071 | @@ -26609,6 +26610,8 @@ class SubscribeAttributeNetworkCommissioningLastConnectErrorValue : public Subsc } }; +#if MTR_ENABLE_PROVISIONAL + /* * Attribute SupportedWiFiBands */ @@ -26691,6 +26694,9 @@ class SubscribeAttributeNetworkCommissioningSupportedWiFiBands : public Subscrib } }; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + /* * Attribute SupportedThreadFeatures */ @@ -26773,6 +26779,9 @@ class SubscribeAttributeNetworkCommissioningSupportedThreadFeatures : public Sub } }; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + /* * Attribute ThreadVersion */ @@ -26855,6 +26864,8 @@ class SubscribeAttributeNetworkCommissioningThreadVersion : public SubscribeAttr } }; +#endif // MTR_ENABLE_PROVISIONAL + /* * Attribute GeneratedCommandList */ @@ -27930,6 +27941,7 @@ class SubscribeAttributeDiagnosticLogsClusterRevision : public SubscribeAttribut |------------------------------------------------------------------------------| | Commands: | | | * TestEventTrigger | 0x00 | +| * TimeSnapshot | 0x01 | |------------------------------------------------------------------------------| | Attributes: | | | * NetworkInterfaces | 0x0000 | @@ -28005,6 +28017,59 @@ class GeneralDiagnosticsTestEventTrigger : public ClusterCommand { chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Type mRequest; }; +#if MTR_ENABLE_PROVISIONAL +/* + * Command TimeSnapshot + */ +class GeneralDiagnosticsTimeSnapshot : public ClusterCommand { +public: + GeneralDiagnosticsTimeSnapshot() + : ClusterCommand("time-snapshot") + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::GeneralDiagnostics::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::GeneralDiagnostics::Commands::TimeSnapshot::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRGeneralDiagnosticsClusterTimeSnapshotParams 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 timeSnapshotWithParams:params completion: + ^(MTRGeneralDiagnosticsClusterTimeSnapshotResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::GeneralDiagnostics::Commands::TimeSnapshotResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters::GeneralDiagnostics::Commands::TimeSnapshotResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: +}; + +#endif // MTR_ENABLE_PROVISIONAL + /* * Attribute NetworkInterfaces */ @@ -62463,6 +62528,1081 @@ class SubscribeAttributeDishwasherAlarmClusterRevision : public SubscribeAttribu } }; +#endif // MTR_ENABLE_PROVISIONAL +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/*----------------------------------------------------------------------------*\ +| Cluster MicrowaveOvenControl | 0x005F | +|------------------------------------------------------------------------------| +| Commands: | | +| * SetCookingParameters | 0x00 | +| * AddMoreTime | 0x01 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * CookTime | 0x0001 | +| * PowerSetting | 0x0002 | +| * MinPower | 0x0003 | +| * MaxPower | 0x0004 | +| * PowerStep | 0x0005 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + +#if MTR_ENABLE_PROVISIONAL +/* + * Command SetCookingParameters + */ +class MicrowaveOvenControlSetCookingParameters : public ClusterCommand { +public: + MicrowaveOvenControlSetCookingParameters() + : ClusterCommand("set-cooking-parameters") + { + AddArgument("CookMode", 0, UINT8_MAX, &mRequest.cookMode); + AddArgument("CookTime", 0, UINT32_MAX, &mRequest.cookTime); + AddArgument("PowerSetting", 0, UINT8_MAX, &mRequest.powerSetting); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::MicrowaveOvenControl::Commands::SetCookingParameters::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRMicrowaveOvenControlClusterSetCookingParametersParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + if (mRequest.cookMode.HasValue()) { + params.cookMode = [NSNumber numberWithUnsignedChar:mRequest.cookMode.Value()]; + } else { + params.cookMode = nil; + } + if (mRequest.cookTime.HasValue()) { + params.cookTime = [NSNumber numberWithUnsignedInt:mRequest.cookTime.Value()]; + } else { + params.cookTime = nil; + } + if (mRequest.powerSetting.HasValue()) { + params.powerSetting = [NSNumber numberWithUnsignedChar:mRequest.powerSetting.Value()]; + } else { + params.powerSetting = nil; + } + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster setCookingParametersWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::MicrowaveOvenControl::Commands::SetCookingParameters::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command AddMoreTime + */ +class MicrowaveOvenControlAddMoreTime : public ClusterCommand { +public: + MicrowaveOvenControlAddMoreTime() + : ClusterCommand("add-more-time") + { + AddArgument("TimeToAdd", 0, UINT32_MAX, &mRequest.timeToAdd); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::MicrowaveOvenControl::Commands::AddMoreTime::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRMicrowaveOvenControlClusterAddMoreTimeParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.timeToAdd = [NSNumber numberWithUnsignedInt:mRequest.timeToAdd]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster addMoreTimeWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::MicrowaveOvenControl::Commands::AddMoreTime::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL + +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute CookTime + */ +class ReadMicrowaveOvenControlCookTime : public ReadAttribute { +public: + ReadMicrowaveOvenControlCookTime() + : ReadAttribute("cook-time") + { + } + + ~ReadMicrowaveOvenControlCookTime() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::MicrowaveOvenControl::Attributes::CookTime::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeCookTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MicrowaveOvenControl.CookTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("MicrowaveOvenControl CookTime read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeMicrowaveOvenControlCookTime : public SubscribeAttribute { +public: + SubscribeAttributeMicrowaveOvenControlCookTime() + : SubscribeAttribute("cook-time") + { + } + + ~SubscribeAttributeMicrowaveOvenControlCookTime() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::MicrowaveOvenControl::Attributes::CookTime::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl 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 subscribeAttributeCookTimeWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MicrowaveOvenControl.CookTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute PowerSetting + */ +class ReadMicrowaveOvenControlPowerSetting : public ReadAttribute { +public: + ReadMicrowaveOvenControlPowerSetting() + : ReadAttribute("power-setting") + { + } + + ~ReadMicrowaveOvenControlPowerSetting() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::MicrowaveOvenControl::Attributes::PowerSetting::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributePowerSettingWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MicrowaveOvenControl.PowerSetting response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("MicrowaveOvenControl PowerSetting read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeMicrowaveOvenControlPowerSetting : public SubscribeAttribute { +public: + SubscribeAttributeMicrowaveOvenControlPowerSetting() + : SubscribeAttribute("power-setting") + { + } + + ~SubscribeAttributeMicrowaveOvenControlPowerSetting() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::MicrowaveOvenControl::Attributes::PowerSetting::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl 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 subscribeAttributePowerSettingWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MicrowaveOvenControl.PowerSetting response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute MinPower + */ +class ReadMicrowaveOvenControlMinPower : public ReadAttribute { +public: + ReadMicrowaveOvenControlMinPower() + : ReadAttribute("min-power") + { + } + + ~ReadMicrowaveOvenControlMinPower() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::MicrowaveOvenControl::Attributes::MinPower::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeMinPowerWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MicrowaveOvenControl.MinPower response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("MicrowaveOvenControl MinPower read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeMicrowaveOvenControlMinPower : public SubscribeAttribute { +public: + SubscribeAttributeMicrowaveOvenControlMinPower() + : SubscribeAttribute("min-power") + { + } + + ~SubscribeAttributeMicrowaveOvenControlMinPower() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::MicrowaveOvenControl::Attributes::MinPower::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl 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 subscribeAttributeMinPowerWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MicrowaveOvenControl.MinPower response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute MaxPower + */ +class ReadMicrowaveOvenControlMaxPower : public ReadAttribute { +public: + ReadMicrowaveOvenControlMaxPower() + : ReadAttribute("max-power") + { + } + + ~ReadMicrowaveOvenControlMaxPower() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::MicrowaveOvenControl::Attributes::MaxPower::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeMaxPowerWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MicrowaveOvenControl.MaxPower response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("MicrowaveOvenControl MaxPower read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeMicrowaveOvenControlMaxPower : public SubscribeAttribute { +public: + SubscribeAttributeMicrowaveOvenControlMaxPower() + : SubscribeAttribute("max-power") + { + } + + ~SubscribeAttributeMicrowaveOvenControlMaxPower() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::MicrowaveOvenControl::Attributes::MaxPower::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl 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 subscribeAttributeMaxPowerWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MicrowaveOvenControl.MaxPower response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute PowerStep + */ +class ReadMicrowaveOvenControlPowerStep : public ReadAttribute { +public: + ReadMicrowaveOvenControlPowerStep() + : ReadAttribute("power-step") + { + } + + ~ReadMicrowaveOvenControlPowerStep() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::MicrowaveOvenControl::Attributes::PowerStep::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributePowerStepWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MicrowaveOvenControl.PowerStep response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("MicrowaveOvenControl PowerStep read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeMicrowaveOvenControlPowerStep : public SubscribeAttribute { +public: + SubscribeAttributeMicrowaveOvenControlPowerStep() + : SubscribeAttribute("power-step") + { + } + + ~SubscribeAttributeMicrowaveOvenControlPowerStep() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::MicrowaveOvenControl::Attributes::PowerStep::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl 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 subscribeAttributePowerStepWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MicrowaveOvenControl.PowerStep response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute GeneratedCommandList + */ +class ReadMicrowaveOvenControlGeneratedCommandList : public ReadAttribute { +public: + ReadMicrowaveOvenControlGeneratedCommandList() + : ReadAttribute("generated-command-list") + { + } + + ~ReadMicrowaveOvenControlGeneratedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::MicrowaveOvenControl::Attributes::GeneratedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"MicrowaveOvenControl.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("MicrowaveOvenControl GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeMicrowaveOvenControlGeneratedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeMicrowaveOvenControlGeneratedCommandList() + : SubscribeAttribute("generated-command-list") + { + } + + ~SubscribeAttributeMicrowaveOvenControlGeneratedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::MicrowaveOvenControl::Attributes::GeneratedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl 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(@"MicrowaveOvenControl.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute AcceptedCommandList + */ +class ReadMicrowaveOvenControlAcceptedCommandList : public ReadAttribute { +public: + ReadMicrowaveOvenControlAcceptedCommandList() + : ReadAttribute("accepted-command-list") + { + } + + ~ReadMicrowaveOvenControlAcceptedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::MicrowaveOvenControl::Attributes::AcceptedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"MicrowaveOvenControl.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("MicrowaveOvenControl AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeMicrowaveOvenControlAcceptedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeMicrowaveOvenControlAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") + { + } + + ~SubscribeAttributeMicrowaveOvenControlAcceptedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::MicrowaveOvenControl::Attributes::AcceptedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl 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(@"MicrowaveOvenControl.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute EventList + */ +class ReadMicrowaveOvenControlEventList : public ReadAttribute { +public: + ReadMicrowaveOvenControlEventList() + : ReadAttribute("event-list") + { + } + + ~ReadMicrowaveOvenControlEventList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::MicrowaveOvenControl::Attributes::EventList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"MicrowaveOvenControl.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("MicrowaveOvenControl EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeMicrowaveOvenControlEventList : public SubscribeAttribute { +public: + SubscribeAttributeMicrowaveOvenControlEventList() + : SubscribeAttribute("event-list") + { + } + + ~SubscribeAttributeMicrowaveOvenControlEventList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::MicrowaveOvenControl::Attributes::EventList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl 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(@"MicrowaveOvenControl.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute AttributeList + */ +class ReadMicrowaveOvenControlAttributeList : public ReadAttribute { +public: + ReadMicrowaveOvenControlAttributeList() + : ReadAttribute("attribute-list") + { + } + + ~ReadMicrowaveOvenControlAttributeList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::MicrowaveOvenControl::Attributes::AttributeList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"MicrowaveOvenControl.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("MicrowaveOvenControl AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeMicrowaveOvenControlAttributeList : public SubscribeAttribute { +public: + SubscribeAttributeMicrowaveOvenControlAttributeList() + : SubscribeAttribute("attribute-list") + { + } + + ~SubscribeAttributeMicrowaveOvenControlAttributeList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::MicrowaveOvenControl::Attributes::AttributeList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl 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(@"MicrowaveOvenControl.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute FeatureMap + */ +class ReadMicrowaveOvenControlFeatureMap : public ReadAttribute { +public: + ReadMicrowaveOvenControlFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadMicrowaveOvenControlFeatureMap() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::MicrowaveOvenControl::Attributes::FeatureMap::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MicrowaveOvenControl.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("MicrowaveOvenControl FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeMicrowaveOvenControlFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeMicrowaveOvenControlFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeMicrowaveOvenControlFeatureMap() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::MicrowaveOvenControl::Attributes::FeatureMap::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl 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(@"MicrowaveOvenControl.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute ClusterRevision + */ +class ReadMicrowaveOvenControlClusterRevision : public ReadAttribute { +public: + ReadMicrowaveOvenControlClusterRevision() + : ReadAttribute("cluster-revision") + { + } + + ~ReadMicrowaveOvenControlClusterRevision() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::MicrowaveOvenControl::Attributes::ClusterRevision::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"MicrowaveOvenControl.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("MicrowaveOvenControl ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeMicrowaveOvenControlClusterRevision : public SubscribeAttribute { +public: + SubscribeAttributeMicrowaveOvenControlClusterRevision() + : SubscribeAttribute("cluster-revision") + { + } + + ~SubscribeAttributeMicrowaveOvenControlClusterRevision() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::MicrowaveOvenControl::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::MicrowaveOvenControl::Attributes::ClusterRevision::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterMicrowaveOvenControl 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(@"MicrowaveOvenControl.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + #endif // MTR_ENABLE_PROVISIONAL #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL @@ -154514,12 +155654,18 @@ void registerClusterNetworkCommissioning(Commands & commands) make_unique(), // make_unique(), // make_unique(), // +#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // make_unique(), // @@ -154577,6 +155723,9 @@ void registerClusterGeneralDiagnostics(Commands & commands) commands_list clusterCommands = { make_unique(Id), // make_unique(), // +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL make_unique(Id), // make_unique(Id), // make_unique(Id), // @@ -156179,6 +157328,73 @@ void registerClusterDishwasherAlarm(Commands & commands) commands.RegisterCluster(clusterName, clusterCommands); #endif // MTR_ENABLE_PROVISIONAL } +void registerClusterMicrowaveOvenControl(Commands & commands) +{ +#if MTR_ENABLE_PROVISIONAL + using namespace chip::app::Clusters::MicrowaveOvenControl; + + const char * clusterName = "MicrowaveOvenControl"; + + commands_list clusterCommands = { + make_unique(Id), // +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL + make_unique(Id), // + make_unique(Id), // + make_unique(Id), // +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL + }; + + commands.RegisterCluster(clusterName, clusterCommands); +#endif // MTR_ENABLE_PROVISIONAL +} void registerClusterOperationalState(Commands & commands) { #if MTR_ENABLE_PROVISIONAL @@ -159594,6 +160810,7 @@ void registerClusters(Commands & commands) registerClusterAirQuality(commands); registerClusterSmokeCoAlarm(commands); registerClusterDishwasherAlarm(commands); + registerClusterMicrowaveOvenControl(commands); registerClusterOperationalState(commands); registerClusterRvcOperationalState(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 fe9d1ee034da7c..e58522377c8b60 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -49324,12 +49324,8 @@ class Test_TC_DGGEN_1_1 : public TestCommandBridge { err = TestStep4aReadTheGlobalAttributeAttributeList_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Step 4b: Read optional attribute(UpTime) in AttributeList\n"); - if (ShouldSkip("DGGEN.S.A0002")) { - NextTest(); - return; - } - err = TestStep4bReadOptionalAttributeUpTimeInAttributeList_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Step 4b: Validate presence of mandatory attribute(UpTime) in AttributeList\n"); + err = TestStep4bValidatePresenceOfMandatoryAttributeUpTimeInAttributeList_5(); break; case 6: ChipLogProgress(chipTool, " ***** Test Step 6 : Step 4c: Read optional attribute(TotalOperationalHours) in AttributeList\n"); @@ -49512,7 +49508,7 @@ class Test_TC_DGGEN_1_1 : public TestCommandBridge { { id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 2U)); } VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); @@ -49603,7 +49599,7 @@ class Test_TC_DGGEN_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4bReadOptionalAttributeUpTimeInAttributeList_5() + CHIP_ERROR TestStep4bValidatePresenceOfMandatoryAttributeUpTimeInAttributeList_5() { MTRBaseDevice * device = GetDevice("alpha"); @@ -49611,7 +49607,7 @@ class Test_TC_DGGEN_1_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4b: Read optional attribute(UpTime) in AttributeList Error: %@", err); + NSLog(@"Step 4b: Validate presence of mandatory attribute(UpTime) in AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -49743,6 +49739,7 @@ class Test_TC_DGGEN_1_1 : public TestCommandBridge { VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 1UL)); NextTest(); }]; @@ -49764,7 +49761,8 @@ class Test_TC_DGGEN_1_1 : public TestCommandBridge { { id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValue("", actualValue[0], 2UL)); } VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); @@ -93674,9 +93672,9 @@ class Test_TC_TMP_2_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("tolerance", "temperature", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("tolerance", [value shortValue], 0)); - VerifyOrReturn(CheckConstraintMaxValue("tolerance", [value shortValue], 2048)); + VerifyOrReturn(CheckConstraintType("tolerance", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("tolerance", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("tolerance", [value unsignedShortValue], 2048U)); NextTest(); }];