From 67cce29e38447233589615943c1d3684b2363893 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 28 Jul 2022 10:53:33 -0400 Subject: [PATCH] Add the spec-required FabricIndex field to Leave event. (#21247) Also fixes up the chip-tool logging for events to not have confusing indents. Fixes https://github.com/project-chip/connectedhomeip/issues/21192 --- .../all-clusters-app.matter | 1 + .../all-clusters-minimal-app.matter | 1 + .../bridge-common/bridge-app.matter | 1 + ...p_rootnode_dimmablelight_bCwGYSDpoe.matter | 1 + .../rootnode_contactsensor_lFAGG1bfRO.matter | 1 + .../rootnode_dimmablelight_bCwGYSDpoe.matter | 1 + .../rootnode_flowsensor_1zVxHedlaV.matter | 1 + ...tnode_heatingcoolingunit_ncdGai1E5a.matter | 1 + .../rootnode_humiditysensor_Xyj4gda6Hb.matter | 1 + .../rootnode_lightsensor_lZQycTFcJK.matter | 1 + ...rootnode_occupancysensor_iHyVgifZuo.matter | 1 + .../rootnode_onofflight_bbs1b7IaOV.matter | 1 + ...ootnode_onofflightswitch_FsPlMr090Q.matter | 1 + ...rootnode_onoffpluginunit_Wtf8ss5EBY.matter | 1 + .../rootnode_pressuresensor_s0qC9wLH4k.matter | 1 + .../rootnode_speaker_RpzeXdimqA.matter | 1 + ...otnode_temperaturesensor_Qy1zkNW7c3.matter | 1 + .../rootnode_thermostat_bm3fb8dhYi.matter | 1 + .../rootnode_windowcovering_RLCxaGi9Yx.matter | 1 + .../logging/DataModelLogger-src.zapt | 12 +++++------ .../light-switch-app.matter | 1 + .../lighting-common/lighting-app.matter | 1 + examples/lock-app/lock-common/lock-app.matter | 1 + .../ota-provider-app.matter | 1 + .../ota-requestor-app.matter | 1 + .../placeholder/linux/apps/app1/config.matter | 1 + .../placeholder/linux/apps/app2/config.matter | 1 + examples/pump-app/pump-common/pump-app.matter | 1 + .../pump-controller-app.matter | 1 + .../esp32/main/temperature-measurement.matter | 1 + .../thermostat-common/thermostat.matter | 1 + examples/tv-app/tv-common/tv-app.matter | 1 + .../tv-casting-common/tv-casting-app.matter | 1 + examples/window-app/common/window-app.matter | 1 + .../operational-credentials-server.cpp | 1 + .../chip/basic-information-cluster.xml | 1 + .../data_model/controller-clusters.matter | 1 + .../CHIPEventTLVValueDecoder.cpp | 11 ++++++++-- .../devicecontroller/ChipEventStructs.java | 8 +++++++- .../python/chip/clusters/Objects.py | 2 ++ .../zap-generated/MTREventTLVValueDecoder.mm | 6 ++++++ .../CHIP/zap-generated/MTRStructsObjc.h | 1 + .../CHIP/zap-generated/MTRStructsObjc.mm | 5 ++++- .../zap-generated/cluster-objects.cpp | 4 ++++ .../zap-generated/cluster-objects.h | 5 +++++ .../cluster/logging/DataModelLogger.cpp | 20 +++++++++++++------ 46 files changed, 94 insertions(+), 16 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 0cd74bf34c9d01..7ab4040486b2bb 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 @@ -565,6 +565,7 @@ server cluster Basic = 40 { } info event Leave = 2 { + fabric_idx fabricIndex = 0; } info event ReachableChanged = 3 { 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 e4f55023f26630..54427b738d1d27 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 @@ -508,6 +508,7 @@ server cluster Basic = 40 { } info event Leave = 2 { + fabric_idx fabricIndex = 0; } info event ReachableChanged = 3 { diff --git a/examples/bridge-app/bridge-common/bridge-app.matter b/examples/bridge-app/bridge-common/bridge-app.matter index c4c5044b104c63..f3deedf8277a72 100644 --- a/examples/bridge-app/bridge-common/bridge-app.matter +++ b/examples/bridge-app/bridge-common/bridge-app.matter @@ -449,6 +449,7 @@ server cluster Basic = 40 { } info event Leave = 2 { + fabric_idx fabricIndex = 0; } info event ReachableChanged = 3 { diff --git a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter index eb21bcaa7acba8..2c6c791fd669d4 100644 --- a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter @@ -456,6 +456,7 @@ server cluster Basic = 40 { } info event Leave = 2 { + fabric_idx fabricIndex = 0; } info event ReachableChanged = 3 { diff --git a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter index 997ee5ae6c3623..208861c334f308 100644 --- a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter +++ b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter @@ -212,6 +212,7 @@ server cluster Basic = 40 { } info event Leave = 2 { + fabric_idx fabricIndex = 0; } info event ReachableChanged = 3 { diff --git a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter index 969e8103b6ee46..cf6eecfc058190 100644 --- a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter @@ -456,6 +456,7 @@ server cluster Basic = 40 { } info event Leave = 2 { + fabric_idx fabricIndex = 0; } info event ReachableChanged = 3 { diff --git a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter index 0f9e97dfb15b59..74cfedb2c235f1 100644 --- a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter +++ b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter @@ -225,6 +225,7 @@ server cluster Basic = 40 { } info event Leave = 2 { + fabric_idx fabricIndex = 0; } info event ReachableChanged = 3 { diff --git a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter index 5cc5836a98e2a7..6ba4cddfeb84f8 100644 --- a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter +++ b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter @@ -449,6 +449,7 @@ server cluster Basic = 40 { } info event Leave = 2 { + fabric_idx fabricIndex = 0; } info event ReachableChanged = 3 { diff --git a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter index 03e46d53c0ba37..4fa09e3ae8a1f1 100644 --- a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter +++ b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter @@ -225,6 +225,7 @@ server cluster Basic = 40 { } info event Leave = 2 { + fabric_idx fabricIndex = 0; } info event ReachableChanged = 3 { diff --git a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter index e93c48144ba999..05810a920c2375 100644 --- a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter +++ b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter @@ -225,6 +225,7 @@ server cluster Basic = 40 { } info event Leave = 2 { + fabric_idx fabricIndex = 0; } info event ReachableChanged = 3 { diff --git a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter index 5809f87e3fefbe..70a2a926513a52 100644 --- a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter +++ b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter @@ -225,6 +225,7 @@ server cluster Basic = 40 { } info event Leave = 2 { + fabric_idx fabricIndex = 0; } info event ReachableChanged = 3 { diff --git a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter index a60c04cf0ec0b6..ba45392030ab15 100644 --- a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter +++ b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter @@ -456,6 +456,7 @@ server cluster Basic = 40 { } info event Leave = 2 { + fabric_idx fabricIndex = 0; } info event ReachableChanged = 3 { diff --git a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter index 9e7649ec408432..d77ed04f6716b1 100644 --- a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter +++ b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter @@ -526,6 +526,7 @@ server cluster Basic = 40 { } info event Leave = 2 { + fabric_idx fabricIndex = 0; } info event ReachableChanged = 3 { diff --git a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter index afedbab26bcaaa..0c4e0bd5a9e870 100644 --- a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter +++ b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter @@ -373,6 +373,7 @@ server cluster Basic = 40 { } info event Leave = 2 { + fabric_idx fabricIndex = 0; } info event ReachableChanged = 3 { diff --git a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter index 77b9f02c35615e..c1085b8fcd4534 100644 --- a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter +++ b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter @@ -225,6 +225,7 @@ server cluster Basic = 40 { } info event Leave = 2 { + fabric_idx fabricIndex = 0; } info event ReachableChanged = 3 { diff --git a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter index 106e7e53e88970..0bd059fd26dfc5 100644 --- a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter +++ b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter @@ -336,6 +336,7 @@ server cluster Basic = 40 { } info event Leave = 2 { + fabric_idx fabricIndex = 0; } info event ReachableChanged = 3 { diff --git a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter index 6da6a13500a737..493113d5f38102 100644 --- a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter +++ b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter @@ -225,6 +225,7 @@ server cluster Basic = 40 { } info event Leave = 2 { + fabric_idx fabricIndex = 0; } info event ReachableChanged = 3 { diff --git a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter index b021ea029e198a..49f626f23559bc 100644 --- a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter +++ b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter @@ -323,6 +323,7 @@ server cluster Basic = 40 { } info event Leave = 2 { + fabric_idx fabricIndex = 0; } info event ReachableChanged = 3 { diff --git a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter index 0c88cc06c66c23..33fc686acfd41a 100644 --- a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter +++ b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter @@ -323,6 +323,7 @@ server cluster Basic = 40 { } info event Leave = 2 { + fabric_idx fabricIndex = 0; } info event ReachableChanged = 3 { diff --git a/examples/chip-tool/templates/logging/DataModelLogger-src.zapt b/examples/chip-tool/templates/logging/DataModelLogger-src.zapt index 1b0092461cde15..474169320f0c29 100644 --- a/examples/chip-tool/templates/logging/DataModelLogger-src.zapt +++ b/examples/chip-tool/templates/logging/DataModelLogger-src.zapt @@ -135,26 +135,26 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip ChipLogProgress(chipTool, "Endpoint: %u Cluster: " ChipLogFormatMEI " Event " ChipLogFormatMEI, header.mPath.mEndpointId, ChipLogValueMEI(header.mPath.mClusterId), ChipLogValueMEI(header.mPath.mEventId)); - ChipLogProgress(chipTool, "\t Event number: %" PRIu64, header.mEventNumber); + ChipLogProgress(chipTool, " Event number: %" PRIu64, header.mEventNumber); if (header.mPriorityLevel == chip::app::PriorityLevel::Info) { - ChipLogProgress(chipTool, "\t Priority: Info"); + ChipLogProgress(chipTool, " Priority: Info"); } else if (header.mPriorityLevel == chip::app::PriorityLevel::Critical) { - ChipLogProgress(chipTool, "\t Priority: Critical"); + ChipLogProgress(chipTool, " Priority: Critical"); } else if (header.mPriorityLevel == chip::app::PriorityLevel::Debug) { - ChipLogProgress(chipTool, "\t Priority: Debug"); + ChipLogProgress(chipTool, " Priority: Debug"); } else { - ChipLogProgress(chipTool, "\t Priority: Unknown"); + ChipLogProgress(chipTool, " Priority: Unknown"); } - ChipLogProgress(chipTool, "\t Timestamp: %" PRIu64, header.mTimestamp.mValue); + ChipLogProgress(chipTool, " Timestamp: %" PRIu64, header.mTimestamp.mValue); switch (header.mPath.mClusterId) { 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 a9206d0e10f0f1..9aaa6b1275064c 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 @@ -409,6 +409,7 @@ server cluster Basic = 40 { } info event Leave = 2 { + fabric_idx fabricIndex = 0; } info event ReachableChanged = 3 { diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index 4d1dfd33db2d9d..9af9d4770e454c 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -349,6 +349,7 @@ server cluster Basic = 40 { } info event Leave = 2 { + fabric_idx fabricIndex = 0; } info event ReachableChanged = 3 { diff --git a/examples/lock-app/lock-common/lock-app.matter b/examples/lock-app/lock-common/lock-app.matter index 1cd3d3edff3648..e83a47caf80c3e 100644 --- a/examples/lock-app/lock-common/lock-app.matter +++ b/examples/lock-app/lock-common/lock-app.matter @@ -242,6 +242,7 @@ server cluster Basic = 40 { } info event Leave = 2 { + fabric_idx fabricIndex = 0; } info event ReachableChanged = 3 { 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 97bddd9057bd8b..7356fef2cc2b99 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 @@ -152,6 +152,7 @@ server cluster Basic = 40 { } info event Leave = 2 { + fabric_idx fabricIndex = 0; } info event ReachableChanged = 3 { 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 43bdbf6fa112ab..0f1ff08464f01c 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 @@ -100,6 +100,7 @@ server cluster Basic = 40 { } info event Leave = 2 { + fabric_idx fabricIndex = 0; } info event ReachableChanged = 3 { diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index 336ec39e569239..cc3324920d34ff 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -508,6 +508,7 @@ server cluster Basic = 40 { } info event Leave = 2 { + fabric_idx fabricIndex = 0; } info event ReachableChanged = 3 { diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index 336ec39e569239..cc3324920d34ff 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -508,6 +508,7 @@ server cluster Basic = 40 { } info event Leave = 2 { + fabric_idx fabricIndex = 0; } info event ReachableChanged = 3 { diff --git a/examples/pump-app/pump-common/pump-app.matter b/examples/pump-app/pump-common/pump-app.matter index 2a8c3d63a8d8c3..8ebcf640f9611d 100644 --- a/examples/pump-app/pump-common/pump-app.matter +++ b/examples/pump-app/pump-common/pump-app.matter @@ -282,6 +282,7 @@ server cluster Basic = 40 { } info event Leave = 2 { + fabric_idx fabricIndex = 0; } info event ReachableChanged = 3 { 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 1f2949b6df4de7..52e33b8bb0a09e 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 @@ -197,6 +197,7 @@ server cluster Basic = 40 { } info event Leave = 2 { + fabric_idx fabricIndex = 0; } info event ReachableChanged = 3 { diff --git a/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter b/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter index 504917871708ca..4b995dd8f784f4 100644 --- a/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter +++ b/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter @@ -100,6 +100,7 @@ server cluster Basic = 40 { } info event Leave = 2 { + fabric_idx fabricIndex = 0; } info event ReachableChanged = 3 { diff --git a/examples/thermostat/thermostat-common/thermostat.matter b/examples/thermostat/thermostat-common/thermostat.matter index feb548c17910ff..ad185bfb472d5f 100644 --- a/examples/thermostat/thermostat-common/thermostat.matter +++ b/examples/thermostat/thermostat-common/thermostat.matter @@ -352,6 +352,7 @@ server cluster Basic = 40 { } info event Leave = 2 { + fabric_idx fabricIndex = 0; } info event ReachableChanged = 3 { diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter index 01006b99277399..3e487d351a53d6 100644 --- a/examples/tv-app/tv-common/tv-app.matter +++ b/examples/tv-app/tv-common/tv-app.matter @@ -258,6 +258,7 @@ server cluster Basic = 40 { } info event Leave = 2 { + fabric_idx fabricIndex = 0; } info event ReachableChanged = 3 { 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 c29c9b4d80cd1b..7a1cdc679f9bff 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 @@ -607,6 +607,7 @@ server cluster Basic = 40 { } info event Leave = 2 { + fabric_idx fabricIndex = 0; } info event ReachableChanged = 3 { diff --git a/examples/window-app/common/window-app.matter b/examples/window-app/common/window-app.matter index 79791b7360761f..8c36f1069f3fec 100644 --- a/examples/window-app/common/window-app.matter +++ b/examples/window-app/common/window-app.matter @@ -323,6 +323,7 @@ server cluster Basic = 40 { } info event Leave = 2 { + fabric_idx fabricIndex = 0; } info event ReachableChanged = 3 { diff --git a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp index ecde4b1615a6af..b2777dff5f338b 100644 --- a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp +++ b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp @@ -355,6 +355,7 @@ class OpCredsFabricTableDelegate : public chip::FabricTable::Delegate { // If Basic cluster is implemented on this endpoint Basic::Events::Leave::Type event; + event.fabricIndex = fabricIndex; EventNumber eventNumber; if (CHIP_NO_ERROR != LogEvent(event, endpoint, eventNumber)) diff --git a/src/app/zap-templates/zcl/data-model/chip/basic-information-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/basic-information-cluster.xml index f6a1ed2b4917f7..b111eaab078639 100644 --- a/src/app/zap-templates/zcl/data-model/chip/basic-information-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/basic-information-cluster.xml @@ -75,6 +75,7 @@ limitations under the License. The Leave event SHOULD be emitted by a Node prior to permanently leaving the Fabric. + This event (when supported) SHALL be generated when there is a change in the Reachable attribute. diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 308ecfa8e6b893..e868756524f783 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -676,6 +676,7 @@ client cluster Basic = 40 { } info event Leave = 2 { + fabric_idx fabricIndex = 0; } info event ReachableChanged = 3 { diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp index 71daf31d9f8617..c51197fc6dd9ae 100644 --- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp @@ -653,6 +653,13 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & { return nullptr; } + jobject value_fabricIndex; + std::string value_fabricIndexClassName = "java/lang/Integer"; + std::string value_fabricIndexCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(value_fabricIndexClassName.c_str(), + value_fabricIndexCtorSignature.c_str(), + cppValue.fabricIndex, value_fabricIndex); + jclass leaveStructClass; err = chip::JniReferences::GetInstance().GetClassRef( env, "chip/devicecontroller/ChipEventStructs$BasicClusterLeaveEvent", leaveStructClass); @@ -661,14 +668,14 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & ChipLogError(Zcl, "Could not find class ChipEventStructs$BasicClusterLeaveEvent"); return nullptr; } - jmethodID leaveStructCtor = env->GetMethodID(leaveStructClass, "", "()V"); + jmethodID leaveStructCtor = env->GetMethodID(leaveStructClass, "", "(Ljava/lang/Integer;)V"); if (leaveStructCtor == nullptr) { ChipLogError(Zcl, "Could not find ChipEventStructs$BasicClusterLeaveEvent constructor"); return nullptr; } - jobject value = env->NewObject(leaveStructClass, leaveStructCtor); + jobject value = env->NewObject(leaveStructClass, leaveStructCtor, value_fabricIndex); return value; } diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java index 35c9fcf7626359..a6468550e3545b 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java @@ -210,13 +210,19 @@ public String toString() { } public static class BasicClusterLeaveEvent { + public Integer fabricIndex; - public BasicClusterLeaveEvent() {} + public BasicClusterLeaveEvent(Integer fabricIndex) { + this.fabricIndex = fabricIndex; + } @Override public String toString() { StringBuilder output = new StringBuilder(); output.append("BasicClusterLeaveEvent {\n"); + output.append("\tfabricIndex: "); + output.append(fabricIndex); + output.append("\n"); output.append("}\n"); return output.toString(); } diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index d2054cc4454748..709299ec06d185 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -4179,8 +4179,10 @@ def event_id(cls) -> int: def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ + ClusterObjectFieldDescriptor(Label="fabricIndex", Tag=0, Type=uint), ]) + fabricIndex: 'uint' = 0 @dataclass class ReachableChanged(ClusterEvent): diff --git a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm index 37267dd5dc387e..98dfb99f3a189f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm @@ -416,6 +416,12 @@ id MTRDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRead MTRBasicClusterLeaveEvent * value = [MTRBasicClusterLeaveEvent new]; + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithUnsignedChar:cppValue.fabricIndex]; + value.fabricIndex = memberValue; + } while (0); + return value; } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index 828bdf0babb0c7..e2fefdf0e06b01 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -141,6 +141,7 @@ NS_ASSUME_NONNULL_BEGIN @end @interface MTRBasicClusterLeaveEvent : NSObject +@property (strong, nonatomic) NSNumber * _Nonnull fabricIndex; @end @interface MTRBasicClusterReachableChangedEvent : NSObject diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index a4e5b887e80bfa..67056218b84ee6 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -402,13 +402,16 @@ @implementation MTRBasicClusterLeaveEvent - (instancetype)init { if (self = [super init]) { + + _fabricIndex = @(0); } return self; } - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + NSString * descriptionString = + [NSString stringWithFormat:@"<%@: fabricIndex:%@; >", NSStringFromClass([self class]), _fabricIndex]; return descriptionString; } 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 dcdb87c0bd91c4..a915098428963d 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 @@ -4106,6 +4106,7 @@ CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kFabricIndex)), fabricIndex)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -4124,6 +4125,9 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } switch (TLV::TagNumFromTag(reader.GetTag())) { + case to_underlying(Fields::kFabricIndex): + ReturnErrorOnFailure(DataModel::Decode(reader, fabricIndex)); + break; default: break; } 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 23e672ef00be1c..1e894a9dfe53a1 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 @@ -4812,6 +4812,7 @@ static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; enum class Fields { + kFabricIndex = 0, }; struct Type @@ -4822,6 +4823,8 @@ struct Type static constexpr ClusterId GetClusterId() { return Clusters::Basic::Id; } static constexpr bool kIsFabricScoped = false; + chip::FabricIndex fabricIndex = static_cast(0); + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -4832,6 +4835,8 @@ struct DecodableType static constexpr EventId GetEventId() { return Events::Leave::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Basic::Id; } + chip::FabricIndex fabricIndex = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); }; } // namespace Leave 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 d1fa65531f150e..295dde68968614 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -2538,6 +2538,14 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const Ba CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const Basic::Events::Leave::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("FabricIndex", indent + 1, value.fabricIndex); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'FabricIndex'"); + return err; + } + } DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; @@ -10329,26 +10337,26 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip ChipLogProgress(chipTool, "Endpoint: %u Cluster: " ChipLogFormatMEI " Event " ChipLogFormatMEI, header.mPath.mEndpointId, ChipLogValueMEI(header.mPath.mClusterId), ChipLogValueMEI(header.mPath.mEventId)); - ChipLogProgress(chipTool, "\t Event number: %" PRIu64, header.mEventNumber); + ChipLogProgress(chipTool, " Event number: %" PRIu64, header.mEventNumber); if (header.mPriorityLevel == chip::app::PriorityLevel::Info) { - ChipLogProgress(chipTool, "\t Priority: Info"); + ChipLogProgress(chipTool, " Priority: Info"); } else if (header.mPriorityLevel == chip::app::PriorityLevel::Critical) { - ChipLogProgress(chipTool, "\t Priority: Critical"); + ChipLogProgress(chipTool, " Priority: Critical"); } else if (header.mPriorityLevel == chip::app::PriorityLevel::Debug) { - ChipLogProgress(chipTool, "\t Priority: Debug"); + ChipLogProgress(chipTool, " Priority: Debug"); } else { - ChipLogProgress(chipTool, "\t Priority: Unknown"); + ChipLogProgress(chipTool, " Priority: Unknown"); } - ChipLogProgress(chipTool, "\t Timestamp: %" PRIu64, header.mTimestamp.mValue); + ChipLogProgress(chipTool, " Timestamp: %" PRIu64, header.mTimestamp.mValue); switch (header.mPath.mClusterId) {