From 11237288aafe82d71c8d9f9f2b9b06b434eacd2a Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Mon, 5 Dec 2022 12:56:51 -0500 Subject: [PATCH] Fix member naming for the MultiPressComplete event. (#23895) It's called PreviousPosition, not NewPosition. Fixes https://github.com/project-chip/connectedhomeip/issues/23872 --- .../all-clusters-app.matter | 2 +- .../all-clusters-minimal-app.matter | 2 +- .../bridge-app/bridge-common/bridge-app.matter | 2 +- ...ip_rootnode_dimmablelight_bCwGYSDpoe.matter | 2 +- .../rootnode_contactsensor_lFAGG1bfRO.matter | 2 +- .../rootnode_dimmablelight_bCwGYSDpoe.matter | 2 +- .../rootnode_doorlock_aNKYAreMXE.matter | 2 +- ...otnode_extendedcolorlight_8lcaaYJVAa.matter | 2 +- .../devices/rootnode_fan_7N2TobIlOX.matter | 2 +- .../rootnode_flowsensor_1zVxHedlaV.matter | 2 +- ...otnode_heatingcoolingunit_ncdGai1E5a.matter | 2 +- .../rootnode_humiditysensor_Xyj4gda6Hb.matter | 2 +- .../rootnode_lightsensor_lZQycTFcJK.matter | 2 +- .../rootnode_occupancysensor_iHyVgifZuo.matter | 2 +- .../rootnode_onofflight_bbs1b7IaOV.matter | 2 +- ...rootnode_onofflightswitch_FsPlMr090Q.matter | 2 +- .../rootnode_onoffpluginunit_Wtf8ss5EBY.matter | 2 +- .../rootnode_pressuresensor_s0qC9wLH4k.matter | 2 +- .../devices/rootnode_speaker_RpzeXdimqA.matter | 2 +- ...ootnode_temperaturesensor_Qy1zkNW7c3.matter | 2 +- .../rootnode_thermostat_bm3fb8dhYi.matter | 2 +- .../rootnode_windowcovering_RLCxaGi9Yx.matter | 2 +- .../bridge-common/bridge-app.matter | 2 +- .../light-switch-app.matter | 2 +- .../lighting-common/lighting-app.matter | 2 +- .../placeholder/linux/apps/app1/config.matter | 4 ++-- .../placeholder/linux/apps/app2/config.matter | 4 ++-- .../tv-casting-common/tv-casting-app.matter | 2 +- .../clusters/switch-server/switch-server.cpp | 4 ++-- .../zcl/data-model/chip/switch-cluster.xml | 2 +- .../data_model/controller-clusters.matter | 2 +- .../zap-generated/CHIPEventTLVValueDecoder.cpp | 14 +++++++------- .../devicecontroller/ChipEventStructs.java | 10 +++++----- src/controller/python/chip/clusters/Objects.py | 4 ++-- .../CHIP/templates/MTRStructsObjc-src.zapt | 15 +++++++++++++++ .../CHIP/templates/MTRStructsObjc.zapt | 12 +++++++++++- .../zap-generated/MTREventTLVValueDecoder.mm | 4 ++-- .../CHIP/zap-generated/MTRStructsObjc.h | 3 ++- .../CHIP/zap-generated/MTRStructsObjc.mm | 18 ++++++++++++++---- .../zap-generated/cluster-objects.cpp | 6 +++--- .../app-common/zap-generated/cluster-objects.h | 6 +++--- .../cluster/logging/DataModelLogger.cpp | 4 ++-- 42 files changed, 100 insertions(+), 64 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 4f87fd2c122da9..e3bb052603f36d 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 @@ -1514,7 +1514,7 @@ server cluster Switch = 59 { } info event MultiPressComplete = 6 { - INT8U newPosition = 0; + INT8U previousPosition = 0; INT8U totalNumberOfPressesCounted = 1; } 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 65d9b42461d81b..d448d6d5459d53 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 @@ -1365,7 +1365,7 @@ server cluster Switch = 59 { } info event MultiPressComplete = 6 { - INT8U newPosition = 0; + INT8U previousPosition = 0; INT8U totalNumberOfPressesCounted = 1; } diff --git a/examples/bridge-app/bridge-common/bridge-app.matter b/examples/bridge-app/bridge-common/bridge-app.matter index 935c1c8077c50b..e73d36dca44370 100644 --- a/examples/bridge-app/bridge-common/bridge-app.matter +++ b/examples/bridge-app/bridge-common/bridge-app.matter @@ -1201,7 +1201,7 @@ server cluster Switch = 59 { } info event MultiPressComplete = 6 { - INT8U newPosition = 0; + INT8U previousPosition = 0; INT8U totalNumberOfPressesCounted = 1; } diff --git a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter index e7583f96de6237..99128b25d80db8 100644 --- a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter @@ -1059,7 +1059,7 @@ server cluster Switch = 59 { } info event MultiPressComplete = 6 { - INT8U newPosition = 0; + INT8U previousPosition = 0; INT8U totalNumberOfPressesCounted = 1; } diff --git a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter index 0177e33ad28d52..13219b599ae780 100644 --- a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter +++ b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter @@ -794,7 +794,7 @@ server cluster Switch = 59 { } info event MultiPressComplete = 6 { - INT8U newPosition = 0; + INT8U previousPosition = 0; INT8U totalNumberOfPressesCounted = 1; } diff --git a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter index 4ef2b98da6868e..b8718a1c3a6a3f 100644 --- a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter @@ -943,7 +943,7 @@ server cluster Switch = 59 { } info event MultiPressComplete = 6 { - INT8U newPosition = 0; + INT8U previousPosition = 0; INT8U totalNumberOfPressesCounted = 1; } diff --git a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter index 6a6bde95c70f18..ebd71721dda2a4 100644 --- a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter +++ b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter @@ -794,7 +794,7 @@ server cluster Switch = 59 { } info event MultiPressComplete = 6 { - INT8U newPosition = 0; + INT8U previousPosition = 0; INT8U totalNumberOfPressesCounted = 1; } diff --git a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter index 6266fa4f203f19..14665ce693bc82 100644 --- a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter +++ b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter @@ -943,7 +943,7 @@ server cluster Switch = 59 { } info event MultiPressComplete = 6 { - INT8U newPosition = 0; + INT8U previousPosition = 0; INT8U totalNumberOfPressesCounted = 1; } diff --git a/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter b/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter index e750f57faebfe3..9d6e2b3b08475a 100644 --- a/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter +++ b/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter @@ -796,7 +796,7 @@ server cluster Switch = 59 { } info event MultiPressComplete = 6 { - INT8U newPosition = 0; + INT8U previousPosition = 0; INT8U totalNumberOfPressesCounted = 1; } diff --git a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter index c3fbdafce95b94..bfe37b564bedc6 100644 --- a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter +++ b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter @@ -807,7 +807,7 @@ server cluster Switch = 59 { } info event MultiPressComplete = 6 { - INT8U newPosition = 0; + INT8U previousPosition = 0; INT8U totalNumberOfPressesCounted = 1; } diff --git a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter index e8b10818ad1ac0..2d6d21cdeb9b6e 100644 --- a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter +++ b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter @@ -936,7 +936,7 @@ server cluster Switch = 59 { } info event MultiPressComplete = 6 { - INT8U newPosition = 0; + INT8U previousPosition = 0; INT8U totalNumberOfPressesCounted = 1; } diff --git a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter index e1227bc1b88212..0095b122628556 100644 --- a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter +++ b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter @@ -807,7 +807,7 @@ server cluster Switch = 59 { } info event MultiPressComplete = 6 { - INT8U newPosition = 0; + INT8U previousPosition = 0; INT8U totalNumberOfPressesCounted = 1; } diff --git a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter index d74341ccf30956..becad306b66a4e 100644 --- a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter +++ b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter @@ -807,7 +807,7 @@ server cluster Switch = 59 { } info event MultiPressComplete = 6 { - INT8U newPosition = 0; + INT8U previousPosition = 0; INT8U totalNumberOfPressesCounted = 1; } diff --git a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter index d266a0ecc47132..ceca13d0794756 100644 --- a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter +++ b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter @@ -807,7 +807,7 @@ server cluster Switch = 59 { } info event MultiPressComplete = 6 { - INT8U newPosition = 0; + INT8U previousPosition = 0; INT8U totalNumberOfPressesCounted = 1; } diff --git a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter index de8ed09da7a047..2ec18df12dc036 100644 --- a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter +++ b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter @@ -943,7 +943,7 @@ server cluster Switch = 59 { } info event MultiPressComplete = 6 { - INT8U newPosition = 0; + INT8U previousPosition = 0; INT8U totalNumberOfPressesCounted = 1; } diff --git a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter index 156646c74843f9..c9fd4e9cea8a53 100644 --- a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter +++ b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter @@ -886,7 +886,7 @@ server cluster Switch = 59 { } info event MultiPressComplete = 6 { - INT8U newPosition = 0; + INT8U previousPosition = 0; INT8U totalNumberOfPressesCounted = 1; } diff --git a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter index 1575d818cff0f3..1da5df855ccc37 100644 --- a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter +++ b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter @@ -844,7 +844,7 @@ server cluster Switch = 59 { } info event MultiPressComplete = 6 { - INT8U newPosition = 0; + INT8U previousPosition = 0; INT8U totalNumberOfPressesCounted = 1; } diff --git a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter index 593a08e39257aa..3130725714eb6d 100644 --- a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter +++ b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter @@ -812,7 +812,7 @@ server cluster Switch = 59 { } info event MultiPressComplete = 6 { - INT8U newPosition = 0; + INT8U previousPosition = 0; INT8U totalNumberOfPressesCounted = 1; } diff --git a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter index acc8ff44a996c7..b2e84bb9ff84cb 100644 --- a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter +++ b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter @@ -934,7 +934,7 @@ server cluster Switch = 59 { } info event MultiPressComplete = 6 { - INT8U newPosition = 0; + INT8U previousPosition = 0; INT8U totalNumberOfPressesCounted = 1; } diff --git a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter index 30796b5c778f38..4fcee16f61ba9a 100644 --- a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter +++ b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter @@ -807,7 +807,7 @@ server cluster Switch = 59 { } info event MultiPressComplete = 6 { - INT8U newPosition = 0; + INT8U previousPosition = 0; INT8U totalNumberOfPressesCounted = 1; } diff --git a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter index 4f58b0042df551..04af5545fe46e2 100644 --- a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter +++ b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter @@ -794,7 +794,7 @@ server cluster Switch = 59 { } info event MultiPressComplete = 6 { - INT8U newPosition = 0; + INT8U previousPosition = 0; INT8U totalNumberOfPressesCounted = 1; } diff --git a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter index 602e899a5534c4..e2096483e4a6ff 100644 --- a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter +++ b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter @@ -794,7 +794,7 @@ server cluster Switch = 59 { } info event MultiPressComplete = 6 { - INT8U newPosition = 0; + INT8U previousPosition = 0; INT8U totalNumberOfPressesCounted = 1; } diff --git a/examples/dynamic-bridge-app/bridge-common/bridge-app.matter b/examples/dynamic-bridge-app/bridge-common/bridge-app.matter index 935c1c8077c50b..e73d36dca44370 100644 --- a/examples/dynamic-bridge-app/bridge-common/bridge-app.matter +++ b/examples/dynamic-bridge-app/bridge-common/bridge-app.matter @@ -1201,7 +1201,7 @@ server cluster Switch = 59 { } info event MultiPressComplete = 6 { - INT8U newPosition = 0; + INT8U previousPosition = 0; INT8U totalNumberOfPressesCounted = 1; } 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 16ed6bc10db317..5a9f7405df62e7 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 @@ -1249,7 +1249,7 @@ server cluster Switch = 59 { } info event MultiPressComplete = 6 { - INT8U newPosition = 0; + INT8U previousPosition = 0; INT8U totalNumberOfPressesCounted = 1; } diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index 68d7564439425b..0c648875428bc9 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -1205,7 +1205,7 @@ server cluster Switch = 59 { } info event MultiPressComplete = 6 { - INT8U newPosition = 0; + INT8U previousPosition = 0; INT8U totalNumberOfPressesCounted = 1; } diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index f6d04ad8886a5a..6aa20f5264cb6b 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -1161,7 +1161,7 @@ client cluster Switch = 59 { } info event MultiPressComplete = 6 { - INT8U newPosition = 0; + INT8U previousPosition = 0; INT8U totalNumberOfPressesCounted = 1; } @@ -1210,7 +1210,7 @@ server cluster Switch = 59 { } info event MultiPressComplete = 6 { - INT8U newPosition = 0; + INT8U previousPosition = 0; INT8U totalNumberOfPressesCounted = 1; } diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index f6d04ad8886a5a..6aa20f5264cb6b 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -1161,7 +1161,7 @@ client cluster Switch = 59 { } info event MultiPressComplete = 6 { - INT8U newPosition = 0; + INT8U previousPosition = 0; INT8U totalNumberOfPressesCounted = 1; } @@ -1210,7 +1210,7 @@ server cluster Switch = 59 { } info event MultiPressComplete = 6 { - INT8U newPosition = 0; + INT8U previousPosition = 0; INT8U totalNumberOfPressesCounted = 1; } 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 0c992d36f94001..172f1c40c3f836 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 @@ -1420,7 +1420,7 @@ server cluster Switch = 59 { } info event MultiPressComplete = 6 { - INT8U newPosition = 0; + INT8U previousPosition = 0; INT8U totalNumberOfPressesCounted = 1; } diff --git a/src/app/clusters/switch-server/switch-server.cpp b/src/app/clusters/switch-server/switch-server.cpp index f74677edf24533..64cce040f0adb3 100644 --- a/src/app/clusters/switch-server/switch-server.cpp +++ b/src/app/clusters/switch-server/switch-server.cpp @@ -135,13 +135,13 @@ void SwitchServer::OnMultiPressOngoing(EndpointId endpoint, uint8_t newPosition, } } -void SwitchServer::OnMultiPressComplete(EndpointId endpoint, uint8_t newPosition, uint8_t count) +void SwitchServer::OnMultiPressComplete(EndpointId endpoint, uint8_t previousPosition, uint8_t count) { ChipLogProgress(Zcl, "SwitchServer: OnMultiPressComplete"); // Record MultiPressComplete event EventNumber eventNumber; - Events::MultiPressComplete::Type event{ newPosition, count }; + Events::MultiPressComplete::Type event{ previousPosition, count }; if (CHIP_NO_ERROR != LogEvent(event, endpoint, eventNumber)) { diff --git a/src/app/zap-templates/zcl/data-model/chip/switch-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/switch-cluster.xml index 512cf5b384d055..8bb770d56a291f 100644 --- a/src/app/zap-templates/zcl/data-model/chip/switch-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/switch-cluster.xml @@ -60,7 +60,7 @@ Interactions with the switch device are exposed as attributes (for the latching MultiPress Complete - + diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index f5d80fdf265ac7..c8b06c66bf3d6d 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -1739,7 +1739,7 @@ client cluster Switch = 59 { } info event MultiPressComplete = 6 { - INT8U newPosition = 0; + INT8U previousPosition = 0; INT8U totalNumberOfPressesCounted = 1; } diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp index cea5d480a81416..eb53f82a2cefd7 100644 --- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp @@ -1879,12 +1879,12 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & { return nullptr; } - jobject value_newPosition; - std::string value_newPositionClassName = "java/lang/Integer"; - std::string value_newPositionCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(value_newPositionClassName.c_str(), - value_newPositionCtorSignature.c_str(), - cppValue.newPosition, value_newPosition); + jobject value_previousPosition; + std::string value_previousPositionClassName = "java/lang/Integer"; + std::string value_previousPositionCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(value_previousPositionClassName.c_str(), + value_previousPositionCtorSignature.c_str(), + cppValue.previousPosition, value_previousPosition); jobject value_totalNumberOfPressesCounted; std::string value_totalNumberOfPressesCountedClassName = "java/lang/Integer"; @@ -1909,7 +1909,7 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & return nullptr; } - jobject value = env->NewObject(multiPressCompleteStructClass, multiPressCompleteStructCtor, value_newPosition, + jobject value = env->NewObject(multiPressCompleteStructClass, multiPressCompleteStructCtor, value_previousPosition, value_totalNumberOfPressesCounted); 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 f2cadefe25e82c..c3068410dcb48a 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java @@ -763,12 +763,12 @@ public String toString() { } public static class SwitchClusterMultiPressCompleteEvent { - public Integer newPosition; + public Integer previousPosition; public Integer totalNumberOfPressesCounted; public SwitchClusterMultiPressCompleteEvent( - Integer newPosition, Integer totalNumberOfPressesCounted) { - this.newPosition = newPosition; + Integer previousPosition, Integer totalNumberOfPressesCounted) { + this.previousPosition = previousPosition; this.totalNumberOfPressesCounted = totalNumberOfPressesCounted; } @@ -776,8 +776,8 @@ public SwitchClusterMultiPressCompleteEvent( public String toString() { StringBuilder output = new StringBuilder(); output.append("SwitchClusterMultiPressCompleteEvent {\n"); - output.append("\tnewPosition: "); - output.append(newPosition); + output.append("\tpreviousPosition: "); + output.append(previousPosition); output.append("\n"); output.append("\ttotalNumberOfPressesCounted: "); output.append(totalNumberOfPressesCounted); diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 84904704965102..1f68a49e4e4244 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -11142,11 +11142,11 @@ def event_id(cls) -> int: def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="newPosition", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="previousPosition", Tag=0, Type=uint), ClusterObjectFieldDescriptor(Label="totalNumberOfPressesCounted", Tag=1, Type=uint), ]) - newPosition: 'uint' = 0 + previousPosition: 'uint' = 0 totalNumberOfPressesCounted: 'uint' = 0 diff --git a/src/darwin/Framework/CHIP/templates/MTRStructsObjc-src.zapt b/src/darwin/Framework/CHIP/templates/MTRStructsObjc-src.zapt index 83f1183648330b..625859d94b92dd 100644 --- a/src/darwin/Framework/CHIP/templates/MTRStructsObjc-src.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRStructsObjc-src.zapt @@ -83,6 +83,21 @@ NS_ASSUME_NONNULL_BEGIN return descriptionString; } +{{#if (isStrEqual (asUpperCamelCase parent.name preserveAcronyms=true) "Switch")}} +{{#if (isStrEqual (asUpperCamelCase name preserveAcronyms=true) "MultiPressComplete")}} +{{! Workaround for the name being mis-spelled in XML previously }} +- (void)setNewPosition:(NSNumber * _Nonnull)newPosition +{ + self.previousPosition = newPosition; +} + +- (NSNumber * _Nonnull)newPosition +{ + return self.previousPosition; +} + +{{/if}} +{{/if}} @end {{#unless (isStrEqual (asUpperCamelCase parent.name preserveAcronyms=true) (compatClusterNameRemapping parent.name))}} diff --git a/src/darwin/Framework/CHIP/templates/MTRStructsObjc.zapt b/src/darwin/Framework/CHIP/templates/MTRStructsObjc.zapt index 7f26306abe1ffd..28ace6abc24779 100644 --- a/src/darwin/Framework/CHIP/templates/MTRStructsObjc.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRStructsObjc.zapt @@ -49,7 +49,17 @@ MTR_NEWLY_AVAILABLE {{/unless}} @interface MTR{{asUpperCamelCase parent.name preserveAcronyms=true}}Cluster{{asUpperCamelCase name preserveAcronyms=true}}Event : NSObject {{#zcl_event_fields}} -@property (nonatomic, copy{{#unless (isStrEqual (asGetterName name) (asStructPropertyName name))}}, getter={{asGetterName name}}{{/unless}}) {{asObjectiveCType type parent.parent.name}} {{asStructPropertyName name}}; +@property (nonatomic, copy{{#unless (isStrEqual (asGetterName name) (asStructPropertyName name))}}, getter={{asGetterName name}}{{/unless}}) {{asObjectiveCType type parent.parent.name}} {{asStructPropertyName name}} +{{#if (isStrEqual (asUpperCamelCase ../parent.name preserveAcronyms=true) "Switch")}} +{{#if (isStrEqual (asUpperCamelCase ../name preserveAcronyms=true) "MultiPressComplete")}} +{{#if (isStrEqual (asStructPropertyName name) "previousPosition")}} +{{! Workaround for the name being mis-spelled in XML previously }} +MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull newPosition MTR_NEWLY_DEPRECATED("Please use previousPosition") +{{/if}} +{{/if}} +{{/if}} +; {{/zcl_event_fields}} @end {{#unless (isStrEqual (asUpperCamelCase parent.name preserveAcronyms=true) (compatClusterNameRemapping parent.name))}} diff --git a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm index f4c013d19930f2..165f07adbea315 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm @@ -1240,8 +1240,8 @@ id MTRDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRead do { NSNumber * _Nonnull memberValue; - memberValue = [NSNumber numberWithUnsignedChar:cppValue.newPosition]; - value.newPosition = memberValue; + memberValue = [NSNumber numberWithUnsignedChar:cppValue.previousPosition]; + value.previousPosition = memberValue; } while (0); do { NSNumber * _Nonnull memberValue; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index 96b8ae47f2b02c..397f744a2b7852 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -390,7 +390,8 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterDownloadErr @end @interface MTRSwitchClusterMultiPressCompleteEvent : NSObject -@property (nonatomic, copy, getter=getNewPosition) NSNumber * _Nonnull newPosition; +@property (nonatomic, copy) NSNumber * _Nonnull previousPosition MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull newPosition MTR_NEWLY_DEPRECATED("Please use previousPosition"); @property (nonatomic, copy) NSNumber * _Nonnull totalNumberOfPressesCounted; @end diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index 07769ead2b09aa..9b69f0d7850cc5 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -2035,7 +2035,7 @@ - (instancetype)init { if (self = [super init]) { - _newPosition = @(0); + _previousPosition = @(0); _totalNumberOfPressesCounted = @(0); } @@ -2046,7 +2046,7 @@ - (id)copyWithZone:(NSZone * _Nullable)zone { auto other = [[MTRSwitchClusterMultiPressCompleteEvent alloc] init]; - other.newPosition = self.newPosition; + other.previousPosition = self.previousPosition; other.totalNumberOfPressesCounted = self.totalNumberOfPressesCounted; return other; @@ -2054,11 +2054,21 @@ - (id)copyWithZone:(NSZone * _Nullable)zone - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: newPosition:%@; totalNumberOfPressesCounted:%@; >", - NSStringFromClass([self class]), _newPosition, _totalNumberOfPressesCounted]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: previousPosition:%@; totalNumberOfPressesCounted:%@; >", + NSStringFromClass([self class]), _previousPosition, _totalNumberOfPressesCounted]; return descriptionString; } +- (void)setNewPosition:(NSNumber * _Nonnull)newPosition +{ + self.previousPosition = newPosition; +} + +- (NSNumber * _Nonnull)newPosition +{ + return self.previousPosition; +} + @end @implementation MTROperationalCredentialsClusterFabricDescriptor 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 51873b26562bcf..b3eec2ebadbf02 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 @@ -8542,7 +8542,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::kNewPosition)), newPosition)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kPreviousPosition)), previousPosition)); ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kTotalNumberOfPressesCounted)), totalNumberOfPressesCounted)); ReturnErrorOnFailure(writer.EndContainer(outer)); @@ -8563,8 +8563,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kNewPosition): - ReturnErrorOnFailure(DataModel::Decode(reader, newPosition)); + case to_underlying(Fields::kPreviousPosition): + ReturnErrorOnFailure(DataModel::Decode(reader, previousPosition)); break; case to_underlying(Fields::kTotalNumberOfPressesCounted): ReturnErrorOnFailure(DataModel::Decode(reader, totalNumberOfPressesCounted)); 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 c08f33b94259ea..61e97cfdc8e3b2 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 @@ -10880,7 +10880,7 @@ static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; enum class Fields { - kNewPosition = 0, + kPreviousPosition = 0, kTotalNumberOfPressesCounted = 1, }; @@ -10892,7 +10892,7 @@ struct Type static constexpr ClusterId GetClusterId() { return Clusters::Switch::Id; } static constexpr bool kIsFabricScoped = false; - uint8_t newPosition = static_cast(0); + uint8_t previousPosition = static_cast(0); uint8_t totalNumberOfPressesCounted = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -10905,7 +10905,7 @@ struct DecodableType static constexpr EventId GetEventId() { return Events::MultiPressComplete::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Switch::Id; } - uint8_t newPosition = static_cast(0); + uint8_t previousPosition = static_cast(0); uint8_t totalNumberOfPressesCounted = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); 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 418d7dfd1b565a..5f6b65a2f5543b 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -3134,10 +3134,10 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("NewPosition", indent + 1, value.newPosition); + CHIP_ERROR err = DataModelLogger::LogValue("PreviousPosition", indent + 1, value.previousPosition); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'NewPosition'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'PreviousPosition'"); return err; } }