From 5cf8cef4ff04b8e305b003d3d935531b3ed782d8 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Thu, 16 Nov 2023 12:18:37 -0500 Subject: [PATCH 01/27] Define a new constant --- .../zcl/data-model/chip/time-format-localization-cluster.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/zap-templates/zcl/data-model/chip/time-format-localization-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/time-format-localization-cluster.xml index 07b91eb1f60fb0..6d016479ef97b8 100644 --- a/src/app/zap-templates/zcl/data-model/chip/time-format-localization-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/time-format-localization-cluster.xml @@ -41,6 +41,7 @@ limitations under the License. + General From 42099b2344a693bb70f4fdca03e725e457e7fffc Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Thu, 16 Nov 2023 12:20:44 -0500 Subject: [PATCH 02/27] Another constant addition --- .../chip/time-format-localization-cluster.xml | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/src/app/zap-templates/zcl/data-model/chip/time-format-localization-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/time-format-localization-cluster.xml index 6d016479ef97b8..32489dabb89fbd 100644 --- a/src/app/zap-templates/zcl/data-model/chip/time-format-localization-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/time-format-localization-cluster.xml @@ -20,28 +20,29 @@ limitations under the License. + - - + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + General From e828835006322243ff2beaf7de086e34a1448933 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Thu, 16 Nov 2023 12:21:11 -0500 Subject: [PATCH 03/27] Adjust range --- .../zcl/data-model/chip/time-format-localization-cluster.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/zap-templates/zcl/data-model/chip/time-format-localization-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/time-format-localization-cluster.xml index 32489dabb89fbd..f9514981360c83 100644 --- a/src/app/zap-templates/zcl/data-model/chip/time-format-localization-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/time-format-localization-cluster.xml @@ -56,7 +56,7 @@ limitations under the License. or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. - + HourFormat From eaf0e4543ba99868766ac92637f0789a210910ff Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Thu, 16 Nov 2023 12:22:41 -0500 Subject: [PATCH 04/27] Zap regen --- .../all-clusters-app.matter | 2 ++ .../all-clusters-minimal-app.matter | 2 ++ .../bridge-common/bridge-app.matter | 2 ++ ...p_rootnode_dimmablelight_bCwGYSDpoe.matter | 2 ++ ...ootnode_airqualitysensor_e63187f6c9.matter | 2 ++ ...ootnode_basicvideoplayer_0ff86e943b.matter | 2 ++ .../rootnode_contactsensor_lFAGG1bfRO.matter | 2 ++ .../rootnode_dimmablelight_bCwGYSDpoe.matter | 2 ++ .../rootnode_dishwasher_cc105034fe.matter | 2 ++ .../rootnode_doorlock_aNKYAreMXE.matter | 2 ++ ...tnode_extendedcolorlight_8lcaaYJVAa.matter | 2 ++ .../devices/rootnode_fan_7N2TobIlOX.matter | 2 ++ .../rootnode_flowsensor_1zVxHedlaV.matter | 2 ++ ...tnode_heatingcoolingunit_ncdGai1E5a.matter | 2 ++ .../rootnode_humiditysensor_Xyj4gda6Hb.matter | 2 ++ .../rootnode_laundrywasher_fb10d238c8.matter | 2 ++ .../rootnode_lightsensor_lZQycTFcJK.matter | 2 ++ ...rootnode_occupancysensor_iHyVgifZuo.matter | 2 ++ .../rootnode_onofflight_bbs1b7IaOV.matter | 2 ++ .../rootnode_onofflight_samplemei.matter | 2 ++ ...ootnode_onofflightswitch_FsPlMr090Q.matter | 2 ++ ...rootnode_onoffpluginunit_Wtf8ss5EBY.matter | 2 ++ .../rootnode_pressuresensor_s0qC9wLH4k.matter | 2 ++ .../devices/rootnode_pump_5f904818cc.matter | 2 ++ .../devices/rootnode_pump_a811bb33a0.matter | 2 ++ ...eraturecontrolledcabinet_ffdb696680.matter | 2 ++ .../rootnode_speaker_RpzeXdimqA.matter | 2 ++ ...otnode_temperaturesensor_Qy1zkNW7c3.matter | 2 ++ .../rootnode_thermostat_bm3fb8dhYi.matter | 2 ++ .../rootnode_windowcovering_RLCxaGi9Yx.matter | 2 ++ .../contact-sensor-app.matter | 2 ++ .../dishwasher-common/dishwasher-app.matter | 2 ++ .../light-switch-app.matter | 2 ++ .../data_model/lighting-app-ethernet.matter | 2 ++ .../data_model/lighting-app-thread.matter | 2 ++ .../data_model/lighting-app-wifi.matter | 2 ++ .../lighting-common/lighting-app.matter | 2 ++ .../data_model/lighting-thread-app.matter | 2 ++ .../data_model/lighting-wifi-app.matter | 2 ++ .../ota-provider-app.matter | 2 ++ .../ota-requestor-app.matter | 2 ++ .../placeholder/linux/apps/app1/config.matter | 2 ++ .../placeholder/linux/apps/app2/config.matter | 2 ++ .../refrigerator-app.matter | 2 ++ .../resource-monitoring-app.matter | 2 ++ .../smoke-co-alarm-app.matter | 2 ++ .../temperature-measurement.matter | 2 ++ .../nxp/zap/thermostat_matter_thread.matter | 2 ++ .../nxp/zap/thermostat_matter_wifi.matter | 2 ++ .../thermostat-common/thermostat.matter | 2 ++ examples/tv-app/tv-common/tv-app.matter | 2 ++ .../tv-casting-common/tv-casting-app.matter | 2 ++ .../virtual-device-app.matter | 2 ++ examples/window-app/common/window-app.matter | 2 ++ .../app-templates/endpoint_config.h | 2 +- .../app-templates/endpoint_config.h | 2 +- .../data_model/controller-clusters.matter | 2 ++ .../python/chip/clusters/Objects.py | 2 ++ .../CHIP/zap-generated/MTRBaseClusters.h | 2 ++ .../zap-generated/cluster-enums-check.h | 2 ++ .../app-common/zap-generated/cluster-enums.h | 30 ++++++++++--------- 61 files changed, 134 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 913ee8f94361eb..5b83498e8bd2ec 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 @@ -1037,11 +1037,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { 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 392b37d411a586..f9a4e6353e469e 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 @@ -878,11 +878,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { diff --git a/examples/bridge-app/bridge-common/bridge-app.matter b/examples/bridge-app/bridge-common/bridge-app.matter index 9ecbdb2e53c637..f0ff3e115e32b8 100644 --- a/examples/bridge-app/bridge-common/bridge-app.matter +++ b/examples/bridge-app/bridge-common/bridge-app.matter @@ -612,11 +612,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { diff --git a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter index 6643553b596f33..e79b38089d9b34 100644 --- a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter @@ -656,11 +656,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { diff --git a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter index c97039eead045e..b2106b08ef353b 100644 --- a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter +++ b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter @@ -417,11 +417,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { diff --git a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter index cd96025bb67eb3..c69c1d6335ad73 100644 --- a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter +++ b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter @@ -423,11 +423,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { diff --git a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter index 1cd605c3038367..e24f3be9b27b5d 100644 --- a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter +++ b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter @@ -505,11 +505,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { diff --git a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter index 3bb21cad2c8fd2..51cf6792a01d27 100644 --- a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter @@ -656,11 +656,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { diff --git a/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter b/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter index d6f7642b2e2d85..308eeec3a37641 100644 --- a/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter +++ b/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter @@ -275,11 +275,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { diff --git a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter index a1dca12a7c3b68..d608399e3647a7 100644 --- a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter +++ b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter @@ -505,11 +505,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { diff --git a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter index 167e1986118ac9..76a54583742468 100644 --- a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter +++ b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter @@ -656,11 +656,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { diff --git a/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter b/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter index fb585469387214..469851a2a0ff51 100644 --- a/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter +++ b/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter @@ -492,11 +492,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { diff --git a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter index ef5bcab551a4db..f3bebd6e437934 100644 --- a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter +++ b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter @@ -511,11 +511,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { diff --git a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter index 634539605ed12a..3316dcf75cec1e 100644 --- a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter +++ b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter @@ -650,11 +650,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { diff --git a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter index 19f61d9c984d74..1f523e92f51c49 100644 --- a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter +++ b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter @@ -511,11 +511,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { diff --git a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter index 0ec432e3e20dad..b354ef35d4aae9 100644 --- a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter +++ b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter @@ -275,11 +275,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { diff --git a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter index 6d2c02333f1d73..4fd28e444ed5b8 100644 --- a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter +++ b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter @@ -511,11 +511,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { diff --git a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter index 8cb041c2b970f1..9e024823a4ec26 100644 --- a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter +++ b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter @@ -511,11 +511,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { diff --git a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter index 491e50edea3090..2057b0381774e4 100644 --- a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter +++ b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter @@ -656,11 +656,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { diff --git a/examples/chef/devices/rootnode_onofflight_samplemei.matter b/examples/chef/devices/rootnode_onofflight_samplemei.matter index bb63561efae3a3..23316de5456e7a 100644 --- a/examples/chef/devices/rootnode_onofflight_samplemei.matter +++ b/examples/chef/devices/rootnode_onofflight_samplemei.matter @@ -656,11 +656,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { diff --git a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter index 7990f876ec47ff..344472748cd2b3 100644 --- a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter +++ b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter @@ -621,11 +621,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { diff --git a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter index 4aa4c41a77e0dc..70287810a79b5a 100644 --- a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter +++ b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter @@ -555,11 +555,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { diff --git a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter index b28c2b6286477d..a9ded7c0a8828b 100644 --- a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter +++ b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter @@ -511,11 +511,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { diff --git a/examples/chef/devices/rootnode_pump_5f904818cc.matter b/examples/chef/devices/rootnode_pump_5f904818cc.matter index 374b98fddf442c..4690b4608724b6 100644 --- a/examples/chef/devices/rootnode_pump_5f904818cc.matter +++ b/examples/chef/devices/rootnode_pump_5f904818cc.matter @@ -313,11 +313,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { diff --git a/examples/chef/devices/rootnode_pump_a811bb33a0.matter b/examples/chef/devices/rootnode_pump_a811bb33a0.matter index a8c27e6215c259..b71b1b8b2bf03e 100644 --- a/examples/chef/devices/rootnode_pump_a811bb33a0.matter +++ b/examples/chef/devices/rootnode_pump_a811bb33a0.matter @@ -313,11 +313,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { diff --git a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter index 9a087e66d8fb00..c1b445b4c3e7c4 100644 --- a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter +++ b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter @@ -275,11 +275,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { diff --git a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter index c3330f7e5eaba7..d262e66cdd12bb 100644 --- a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter +++ b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter @@ -581,11 +581,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { diff --git a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter index c438d63c55ef0e..14a2adf5bd43f6 100644 --- a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter +++ b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter @@ -511,11 +511,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { diff --git a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter index 2f3880ebf8bad4..1297c83f0797f0 100644 --- a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter +++ b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter @@ -505,11 +505,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { diff --git a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter index 8273d1559a610e..a76970f93c2e62 100644 --- a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter +++ b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter @@ -505,11 +505,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { 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 0e6f9891abfc4d..96a49cf4429c62 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 @@ -492,11 +492,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { diff --git a/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter b/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter index edba1ad9aea96e..73c66318fdc317 100644 --- a/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter +++ b/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter @@ -363,11 +363,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { 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 c7476b3a6a752a..caf7be55186584 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 @@ -811,11 +811,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { 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 3b9aead26244af..3ff23f039c463f 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter @@ -664,11 +664,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { 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 cddc0928db536d..b730572d3b4a25 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter @@ -664,11 +664,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { 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 8a89f166b8f693..37ce1137dba645 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter @@ -664,11 +664,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index 5fb2132362fdf5..785a8db22f69a8 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -815,11 +815,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { 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 61289243f3e194..ad444016d68f82 100644 --- a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter @@ -836,11 +836,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { 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 a27bc1c315dbe6..3116b4aea35d6e 100644 --- a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter @@ -815,11 +815,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { 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 694d7dfd23db47..a3c6603a732996 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 @@ -372,11 +372,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { 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 a0016dd0adca29..1dd68a9262de97 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 @@ -556,11 +556,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index 479a2afde597a9..9165d1f817e572 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -981,11 +981,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index 7e769bff6bca25..c11256f9776ade 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -964,11 +964,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { diff --git a/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter b/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter index cdc214bc3ddc4c..4a8a4cb802a037 100644 --- a/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter +++ b/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter @@ -230,11 +230,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { 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 b5f769892d1dbe..653b0e2cc55159 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 @@ -492,11 +492,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { 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 e9fb02dfd0c51e..c1c8fda5ac74d8 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 @@ -492,11 +492,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { 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 fbbef00508c2e9..ac68573d801c08 100644 --- a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter +++ b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter @@ -377,11 +377,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { diff --git a/examples/thermostat/nxp/zap/thermostat_matter_thread.matter b/examples/thermostat/nxp/zap/thermostat_matter_thread.matter index ccdf315a7bc2e3..263171632fdfbf 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_thread.matter +++ b/examples/thermostat/nxp/zap/thermostat_matter_thread.matter @@ -680,11 +680,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { diff --git a/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter b/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter index bfc51fd9e47895..aecbd4a6ab2d21 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter +++ b/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter @@ -680,11 +680,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { diff --git a/examples/thermostat/thermostat-common/thermostat.matter b/examples/thermostat/thermostat-common/thermostat.matter index 0d67cab366993b..c65f74887a49c2 100644 --- a/examples/thermostat/thermostat-common/thermostat.matter +++ b/examples/thermostat/thermostat-common/thermostat.matter @@ -559,11 +559,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter index b8b3d3e3e3fb12..c95de6b4caa093 100644 --- a/examples/tv-app/tv-common/tv-app.matter +++ b/examples/tv-app/tv-common/tv-app.matter @@ -491,11 +491,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { 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 89c8d5a41a4902..ec0c6cb803551e 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 @@ -593,11 +593,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { 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 7e602e50d5cc4d..0c30d0266a07c5 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 @@ -624,11 +624,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { diff --git a/examples/window-app/common/window-app.matter b/examples/window-app/common/window-app.matter index 7d67b87aadcb3e..708f118a870cec 100644 --- a/examples/window-app/common/window-app.matter +++ b/examples/window-app/common/window-app.matter @@ -492,11 +492,13 @@ server cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { 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 dd8fd1525e0d67..bd6370ca9cf402 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 @@ -274,7 +274,7 @@ { \ \ /* Endpoint: 0, Cluster: Time Format Localization (server) */ \ - { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x1 }, /* HourFormat */ \ + { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFF }, /* HourFormat */ \ \ /* Endpoint: 0, Cluster: Unit Localization (server) */ \ { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x2 }, /* TemperatureUnit */ \ diff --git a/scripts/tools/zap/tests/outputs/lighting-app/app-templates/endpoint_config.h b/scripts/tools/zap/tests/outputs/lighting-app/app-templates/endpoint_config.h index 7093ce3c63732b..9663fb0e866ff0 100644 --- a/scripts/tools/zap/tests/outputs/lighting-app/app-templates/endpoint_config.h +++ b/scripts/tools/zap/tests/outputs/lighting-app/app-templates/endpoint_config.h @@ -66,7 +66,7 @@ { \ \ /* Endpoint: 0, Cluster: Time Format Localization (server) */ \ - { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x1 }, /* HourFormat */ \ + { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFF }, /* HourFormat */ \ \ /* Endpoint: 1, Cluster: On/Off (server) */ \ { (uint16_t) 0xFF, (uint16_t) 0x0, (uint16_t) 0x2 }, /* StartUpOnOff */ \ diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 1d8863d0470b01..fb87485f559a92 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -1116,11 +1116,13 @@ client cluster TimeFormatLocalization = 44 { kKorean = 9; kPersian = 10; kTaiwanese = 11; + kUseActiveLocale = 255; } enum HourFormatEnum : enum8 { k12hr = 0; k24hr = 1; + kUseActiveLocale = 255; } bitmap Feature : bitmap32 { diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 9aec0d59bc78ec..fc14c208f0a6ad 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -5585,6 +5585,7 @@ class CalendarTypeEnum(MatterIntEnum): kKorean = 0x09 kPersian = 0x0A kTaiwanese = 0x0B + kUseActiveLocale = 0xFF # All received enum values that are not listed above will be mapped # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving and unknown @@ -5594,6 +5595,7 @@ class CalendarTypeEnum(MatterIntEnum): class HourFormatEnum(MatterIntEnum): k12hr = 0x00 k24hr = 0x01 + kUseActiveLocale = 0xFF # All received enum values that are not listed above will be mapped # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving and unknown diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 2ce81e7b652e39..eea862f63f1a5e 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -14673,11 +14673,13 @@ typedef NS_ENUM(uint8_t, MTRTimeFormatLocalizationCalendarType) { MTRTimeFormatLocalizationCalendarTypeKorean MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x09, MTRTimeFormatLocalizationCalendarTypePersian MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x0A, MTRTimeFormatLocalizationCalendarTypeTaiwanese MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x0B, + MTRTimeFormatLocalizationCalendarTypeUseActiveLocale MTR_PROVISIONALLY_AVAILABLE = 0xFF, } MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); typedef NS_ENUM(uint8_t, MTRTimeFormatLocalizationHourFormat) { MTRTimeFormatLocalizationHourFormat12hr MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x00, MTRTimeFormatLocalizationHourFormat24hr MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x01, + MTRTimeFormatLocalizationHourFormatUseActiveLocale MTR_PROVISIONALLY_AVAILABLE = 0xFF, } MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); typedef NS_OPTIONS(uint32_t, MTRTimeFormatLocalizationFeature) { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h index 8fead3064af24a..bd7f002b6469e6 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h @@ -397,6 +397,7 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(TimeFormatLocalization: case EnumType::kKorean: case EnumType::kPersian: case EnumType::kTaiwanese: + case EnumType::kUseActiveLocale: return val; default: return static_cast(12); @@ -409,6 +410,7 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(TimeFormatLocalization: { case EnumType::k12hr: case EnumType::k24hr: + case EnumType::kUseActiveLocale: return val; default: return static_cast(2); 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 2a6125ed5310c9..91a5f901e9fbc7 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 @@ -508,18 +508,19 @@ namespace TimeFormatLocalization { // Enum for CalendarTypeEnum enum class CalendarTypeEnum : uint8_t { - kBuddhist = 0x00, - kChinese = 0x01, - kCoptic = 0x02, - kEthiopian = 0x03, - kGregorian = 0x04, - kHebrew = 0x05, - kIndian = 0x06, - kIslamic = 0x07, - kJapanese = 0x08, - kKorean = 0x09, - kPersian = 0x0A, - kTaiwanese = 0x0B, + kBuddhist = 0x00, + kChinese = 0x01, + kCoptic = 0x02, + kEthiopian = 0x03, + kGregorian = 0x04, + kHebrew = 0x05, + kIndian = 0x06, + kIslamic = 0x07, + kJapanese = 0x08, + kKorean = 0x09, + kPersian = 0x0A, + kTaiwanese = 0x0B, + kUseActiveLocale = 0xFF, // All received enum values that are not listed above will be mapped // to kUnknownEnumValue. This is a helper enum value that should only // be used by code to process how it handles receiving and unknown @@ -530,8 +531,9 @@ enum class CalendarTypeEnum : uint8_t // Enum for HourFormatEnum enum class HourFormatEnum : uint8_t { - k12hr = 0x00, - k24hr = 0x01, + k12hr = 0x00, + k24hr = 0x01, + kUseActiveLocale = 0xFF, // All received enum values that are not listed above will be mapped // to kUnknownEnumValue. This is a helper enum value that should only // be used by code to process how it handles receiving and unknown From 30986dfab7e8212c1ab690c291a59e5fdc1d0d18 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Thu, 16 Nov 2023 12:25:39 -0500 Subject: [PATCH 05/27] Undo my editor auto-format, to make diff easier to read --- .../chip/time-format-localization-cluster.xml | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/app/zap-templates/zcl/data-model/chip/time-format-localization-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/time-format-localization-cluster.xml index f9514981360c83..9131ba51385dc7 100644 --- a/src/app/zap-templates/zcl/data-model/chip/time-format-localization-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/time-format-localization-cluster.xml @@ -24,25 +24,25 @@ limitations under the License. - - + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + General From 4b11783f27aef362400c304e845767b7dcb4854f Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 17 Nov 2023 01:56:25 -0500 Subject: [PATCH 06/27] Update Darwin availability annotations. --- src/darwin/Framework/CHIP/templates/availability.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/darwin/Framework/CHIP/templates/availability.yaml b/src/darwin/Framework/CHIP/templates/availability.yaml index 6ac6a560fc9b89..e3d47954311f71 100644 --- a/src/darwin/Framework/CHIP/templates/availability.yaml +++ b/src/darwin/Framework/CHIP/templates/availability.yaml @@ -7890,6 +7890,13 @@ NetworkInfoStruct: - networkIdentifier - clientIdentifier + enum values: + # Targeting Spring 2024 Matter release + TimeFormatLocalization: + CalendarTypeEnum: + - UseActiveLocale + HourFormatEnum: + - UseActiveLocale bitmaps: NetworkCommissioning: # Targeting Spring 2024 Matter release From ba67c1a1ec9efe3f86ca68306a170f63e8e9d2bd Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 17 Nov 2023 11:13:27 -0500 Subject: [PATCH 07/27] Add extra validation for calendar locales --- .../time-format-localization-server.cpp | 105 +++++++++++------- 1 file changed, 62 insertions(+), 43 deletions(-) diff --git a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp index f4eb458a0a8313..f94146fe4223b1 100644 --- a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp +++ b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp @@ -47,49 +47,47 @@ class TimeFormatLocalizationAttrAccess : public AttributeAccessInterface TimeFormatLocalizationAttrAccess() : AttributeAccessInterface(Optional::Missing(), TimeFormatLocalization::Id) {} CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; + CHIP_ERROR Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override; private: CHIP_ERROR ReadSupportedCalendarTypes(AttributeValueEncoder & aEncoder); }; +class AutoReleaseIterator +{ +public: + using Iterator = DeviceLayer::DeviceInfoProvider::SupportedCalendarTypesIterator; + + AutoReleaseIterator(Iterator * value) : mIterator(value) {} + ~AutoReleaseIterator() { mIterator->Release(); } + + bool IsValid() const { return mIterator != nullptr; } + bool Next(CalendarTypeEnum & value) { return mIterator->Next(value); } + +private: + Iterator * mIterator; +}; + TimeFormatLocalizationAttrAccess gAttrAccess; CHIP_ERROR TimeFormatLocalizationAttrAccess::ReadSupportedCalendarTypes(AttributeValueEncoder & aEncoder) { - CHIP_ERROR err = CHIP_NO_ERROR; - DeviceLayer::DeviceInfoProvider * provider = DeviceLayer::GetDeviceInfoProvider(); + VerifyOrReturnValue(provider != nullptr, aEncoder.EncodeEmptyList()); - if (provider) - { - DeviceLayer::DeviceInfoProvider::SupportedCalendarTypesIterator * it = provider->IterateSupportedCalendarTypes(); - - if (it) - { - err = aEncoder.EncodeList([&it](const auto & encoder) -> CHIP_ERROR { - CalendarTypeEnum type; - - while (it->Next(type)) - { - ReturnErrorOnFailure(encoder.Encode(type)); - } + AutoReleaseIterator it(provider->IterateSupportedCalendarTypes()); + VerifyOrReturnValue(it.IsValid(), aEncoder.EncodeEmptyList()); - return CHIP_NO_ERROR; - }); + return aEncoder.EncodeList([&it](const auto & encoder) -> CHIP_ERROR { + CalendarTypeEnum type; - it->Release(); - } - else + while (it.Next(type)) { - err = aEncoder.EncodeEmptyList(); + ReturnErrorOnFailure(encoder.Encode(type)); } - } - else - { - err = aEncoder.EncodeEmptyList(); - } - return err; + return CHIP_NO_ERROR; + }); } CHIP_ERROR TimeFormatLocalizationAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) @@ -114,31 +112,52 @@ bool IsSupportedCalendarType(CalendarTypeEnum newType, CalendarTypeEnum & validT validType = CalendarTypeEnum::kBuddhist; DeviceLayer::DeviceInfoProvider * provider = DeviceLayer::GetDeviceInfoProvider(); + VerifyOrReturnValue(provider != nullptr, false); - if (provider) - { - DeviceLayer::DeviceInfoProvider::SupportedCalendarTypesIterator * it = provider->IterateSupportedCalendarTypes(); + AutoReleaseIterator it(provider->IterateSupportedCalendarTypes()); + VerifyOrReturnValue(it.IsValid(), false); - if (it) + while (it.Next(validType)) + { + if (validType == newType) { - CalendarTypeEnum type; + return true; + } + } - while (it->Next(type)) - { - validType = type; + return false; +} + +CHIP_ERROR TimeFormatLocalizationAttrAccess::Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) +{ + VerifyOrDie(aPath.mClusterId == TimeFormatLocalization::Id); + + switch (aPath.mAttributeId) + { + case ActiveCalendarType::Id: + CalendarTypeEnum value; + ReturnErrorOnFailure(aDecoder.Decode(value)); - if (validType == newType) - { - it->Release(); - return true; - } + if (value != CalendarTypeEnum::kUseActiveLocale) + { + // Valid range is from 0 to unknown. + // This relies that unknown value is the first unused value and values + // increase over time + if (to_underlying(value) >= to_underlying(CalendarTypeEnum::kUnknownEnumValue)) + { + return CHIP_ERROR_INVALID_ARGUMENT; } + } - it->Release(); + if (ActiveCalendarType::Set(aPath.mEndpointId, value) != EMBER_ZCL_STATUS_SUCCESS) + { + return CHIP_ERROR_INTERNAL; } + break; + default: + break; } - - return false; + return CHIP_NO_ERROR; } } // anonymous namespace From bbfeaa03c103e6c0ef550fe939f49a4935f48bc4 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 17 Nov 2023 11:17:18 -0500 Subject: [PATCH 08/27] Always support using active locale (seems like a better default than just Buddhist --- .../time-format-localization-server.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp index f94146fe4223b1..378ce7848a9b1f 100644 --- a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp +++ b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp @@ -109,7 +109,10 @@ CHIP_ERROR TimeFormatLocalizationAttrAccess::Read(const ConcreteReadAttributePat bool IsSupportedCalendarType(CalendarTypeEnum newType, CalendarTypeEnum & validType) { // Reset valid type if no supported calendar types found. - validType = CalendarTypeEnum::kBuddhist; + validType = CalendarTypeEnum::kUseActiveLocale; + if (newType == CalendarTypeEnum::kUseActiveLocale) { + return true; + } DeviceLayer::DeviceInfoProvider * provider = DeviceLayer::GetDeviceInfoProvider(); VerifyOrReturnValue(provider != nullptr, false); @@ -170,7 +173,7 @@ static Protocols::InteractionModel::Status emberAfPluginTimeFormatLocalizationOn CalendarTypeEnum newType) { Protocols::InteractionModel::Status res; - CalendarTypeEnum validType = CalendarTypeEnum::kBuddhist; + CalendarTypeEnum validType = CalendarTypeEnum::kUseActiveLocale; if (IsSupportedCalendarType(newType, validType)) { From 5166ecc90e6669cee232e2bf9db0e3bd53f628f1 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 17 Nov 2023 11:35:45 -0500 Subject: [PATCH 09/27] Set the return value to constraint error on invalid calendar --- .../time-format-localization-server.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp index 378ce7848a9b1f..e94b45f34900aa 100644 --- a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp +++ b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp @@ -148,7 +148,7 @@ CHIP_ERROR TimeFormatLocalizationAttrAccess::Write(const ConcreteDataAttributePa // increase over time if (to_underlying(value) >= to_underlying(CalendarTypeEnum::kUnknownEnumValue)) { - return CHIP_ERROR_INVALID_ARGUMENT; + return CHIP_IM_GLOBAL_STATUS(ConstraintError); } } From fd17608d0e1dea88412d543ae57c60025250dc34 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 17 Nov 2023 11:36:10 -0500 Subject: [PATCH 10/27] Restyle --- .../time-format-localization-server.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp index e94b45f34900aa..03339b90d2709b 100644 --- a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp +++ b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp @@ -110,7 +110,8 @@ bool IsSupportedCalendarType(CalendarTypeEnum newType, CalendarTypeEnum & validT { // Reset valid type if no supported calendar types found. validType = CalendarTypeEnum::kUseActiveLocale; - if (newType == CalendarTypeEnum::kUseActiveLocale) { + if (newType == CalendarTypeEnum::kUseActiveLocale) + { return true; } From c3d39e9681e0e283307f9e82e9e624a04b9c4a0a Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 17 Nov 2023 12:30:51 -0500 Subject: [PATCH 11/27] Use the pre-change callback for validation, less complex than the write interface --- .../time-format-localization-server.cpp | 63 ++++--------------- 1 file changed, 13 insertions(+), 50 deletions(-) diff --git a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp index 03339b90d2709b..55ffa5e8ef31d8 100644 --- a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp +++ b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp @@ -47,7 +47,6 @@ class TimeFormatLocalizationAttrAccess : public AttributeAccessInterface TimeFormatLocalizationAttrAccess() : AttributeAccessInterface(Optional::Missing(), TimeFormatLocalization::Id) {} CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; - CHIP_ERROR Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override; private: CHIP_ERROR ReadSupportedCalendarTypes(AttributeValueEncoder & aEncoder); @@ -132,38 +131,6 @@ bool IsSupportedCalendarType(CalendarTypeEnum newType, CalendarTypeEnum & validT return false; } -CHIP_ERROR TimeFormatLocalizationAttrAccess::Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) -{ - VerifyOrDie(aPath.mClusterId == TimeFormatLocalization::Id); - - switch (aPath.mAttributeId) - { - case ActiveCalendarType::Id: - CalendarTypeEnum value; - ReturnErrorOnFailure(aDecoder.Decode(value)); - - if (value != CalendarTypeEnum::kUseActiveLocale) - { - // Valid range is from 0 to unknown. - // This relies that unknown value is the first unused value and values - // increase over time - if (to_underlying(value) >= to_underlying(CalendarTypeEnum::kUnknownEnumValue)) - { - return CHIP_IM_GLOBAL_STATUS(ConstraintError); - } - } - - if (ActiveCalendarType::Set(aPath.mEndpointId, value) != EMBER_ZCL_STATUS_SUCCESS) - { - return CHIP_ERROR_INTERNAL; - } - break; - default: - break; - } - return CHIP_NO_ERROR; -} - } // anonymous namespace // ============================================================================= @@ -199,28 +166,24 @@ emberAfPluginTimeFormatLocalizationOnUnhandledAttributeChange(EndpointId Endpoin Protocols::InteractionModel::Status MatterTimeFormatLocalizationClusterServerPreAttributeChangedCallback( const ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value) { - Protocols::InteractionModel::Status res; - switch (attributePath.mAttributeId) { - case ActiveCalendarType::Id: - if (sizeof(uint8_t) == size) - { - res = emberAfPluginTimeFormatLocalizationOnCalendarTypeChange(attributePath.mEndpointId, - static_cast(*value)); - } - else - { - res = Protocols::InteractionModel::Status::InvalidValue; - } - break; + case ActiveCalendarType::Id: { + VerifyOrReturnValue(sizeof(uint8_t) == size, Protocols::InteractionModel::Status::InvalidValue); + + CalendarTypeEnum calendarType = static_cast(*value); + // Valid range is from 0 to unknown. This relies that unknown value is + // the first unused value and values increase over time + VerifyOrReturnValue(((calendarType == CalendarTypeEnum::kUseActiveLocale) || + (to_underlying(calendarType) < to_underlying(CalendarTypeEnum::kUnknownEnumValue))), + Protocols::InteractionModel::Status::ConstraintError); + + return emberAfPluginTimeFormatLocalizationOnCalendarTypeChange(attributePath.mEndpointId, calendarType); + } default: - res = emberAfPluginTimeFormatLocalizationOnUnhandledAttributeChange(attributePath.mEndpointId, attributeType, size, value); - break; + return emberAfPluginTimeFormatLocalizationOnUnhandledAttributeChange(attributePath.mEndpointId, attributeType, size, value); } - - return res; } void emberAfTimeFormatLocalizationClusterServerInitCallback(EndpointId endpoint) From 9516af5a38359814e274d85b9275e938737e97cd Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 17 Nov 2023 14:00:17 -0500 Subject: [PATCH 12/27] Fix range for hour format --- .../zcl/data-model/chip/time-format-localization-cluster.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/zap-templates/zcl/data-model/chip/time-format-localization-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/time-format-localization-cluster.xml index 9131ba51385dc7..d4380de2fcbe27 100644 --- a/src/app/zap-templates/zcl/data-model/chip/time-format-localization-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/time-format-localization-cluster.xml @@ -56,7 +56,7 @@ limitations under the License. or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. - + HourFormat From 33e84637b6c3661ead66b7a5fa0fdd42ed69ee1a Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 17 Nov 2023 14:00:53 -0500 Subject: [PATCH 13/27] Revert "Fix range for hour format" This reverts commit 9516af5a38359814e274d85b9275e938737e97cd. --- .../zcl/data-model/chip/time-format-localization-cluster.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/zap-templates/zcl/data-model/chip/time-format-localization-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/time-format-localization-cluster.xml index d4380de2fcbe27..9131ba51385dc7 100644 --- a/src/app/zap-templates/zcl/data-model/chip/time-format-localization-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/time-format-localization-cluster.xml @@ -56,7 +56,7 @@ limitations under the License. or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. - + HourFormat From 84e39177b4ca6a1ebe661aa399b25fc595a929ec Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 17 Nov 2023 14:03:40 -0500 Subject: [PATCH 14/27] Fix hour format ranges as well --- .../time-format-localization-server.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp index 55ffa5e8ef31d8..9cec00b3d02488 100644 --- a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp +++ b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp @@ -181,8 +181,21 @@ Protocols::InteractionModel::Status MatterTimeFormatLocalizationClusterServerPre return emberAfPluginTimeFormatLocalizationOnCalendarTypeChange(attributePath.mEndpointId, calendarType); } + case HourFormat::Id: { + VerifyOrReturnValue(sizeof(uint8_t) == size, Protocols::InteractionModel::Status::InvalidValue); + + HourFormatEnum hourFormat = static_cast(*value); + + // Valid range is from 0 to unknown. This relies that unknown value is + // the first unused value and values increase over time + VerifyOrReturnValue(((hourFormat == HourFormatEnum::kUseActiveLocale) || + (to_underlying(hourFormat) < to_underlying(HourFormatEnum::kUnknownEnumValue))), + Protocols::InteractionModel::Status::ConstraintError); + + return Protocols::InteractionModel::Status::Success; + } default: - return emberAfPluginTimeFormatLocalizationOnUnhandledAttributeChange(attributePath.mEndpointId, attributeType, size, value); + return Protocols::InteractionModel::Status::Success; } } From 40fe67e1ca9439dfce1cf3512c6eee81f04ff6bf Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 17 Nov 2023 14:04:32 -0500 Subject: [PATCH 15/27] make compile happy --- .../time-format-localization-server.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp index 9cec00b3d02488..d22ba014853f7f 100644 --- a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp +++ b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp @@ -156,13 +156,6 @@ static Protocols::InteractionModel::Status emberAfPluginTimeFormatLocalizationOn return res; } -static Protocols::InteractionModel::Status -emberAfPluginTimeFormatLocalizationOnUnhandledAttributeChange(EndpointId EndpointId, EmberAfAttributeType attrType, - uint16_t attrSize, uint8_t * attrValue) -{ - return Protocols::InteractionModel::Status::Success; -} - Protocols::InteractionModel::Status MatterTimeFormatLocalizationClusterServerPreAttributeChangedCallback( const ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value) { From 74e5e006e8617cee3da68b7dddadf6fbc7e65c92 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 17 Nov 2023 14:17:27 -0500 Subject: [PATCH 16/27] Handle null value in autoreleaser --- .../time-format-localization-server.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp index d22ba014853f7f..ea631922475f1c 100644 --- a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp +++ b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp @@ -58,10 +58,16 @@ class AutoReleaseIterator using Iterator = DeviceLayer::DeviceInfoProvider::SupportedCalendarTypesIterator; AutoReleaseIterator(Iterator * value) : mIterator(value) {} - ~AutoReleaseIterator() { mIterator->Release(); } + ~AutoReleaseIterator() + { + if (mIterator != nullptr) + { + mIterator->Release(); + } + } bool IsValid() const { return mIterator != nullptr; } - bool Next(CalendarTypeEnum & value) { return mIterator->Next(value); } + bool Next(CalendarTypeEnum & value) { return (mIterator == nullptr) ? false : mIterator->Next(value); } private: Iterator * mIterator; From 176064b503474b6a7d08a1d7f5e3e217f2035ab9 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 17 Nov 2023 14:20:13 -0500 Subject: [PATCH 17/27] Enforce that validType is ALWAYS a valid type --- .../time-format-localization-server.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp index ea631922475f1c..688363476cff35 100644 --- a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp +++ b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp @@ -126,8 +126,10 @@ bool IsSupportedCalendarType(CalendarTypeEnum newType, CalendarTypeEnum & validT AutoReleaseIterator it(provider->IterateSupportedCalendarTypes()); VerifyOrReturnValue(it.IsValid(), false); - while (it.Next(validType)) + CalendarTypeEnum type; + while (it.Next(type)) { + validType = type; if (validType == newType) { return true; From 90ac9cef65ca2cd719db6625484bf492f032a9ee Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 17 Nov 2023 14:30:23 -0500 Subject: [PATCH 18/27] Undo refactor changes --- .../time-format-localization-server.cpp | 90 ++++++++++--------- 1 file changed, 46 insertions(+), 44 deletions(-) diff --git a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp index 688363476cff35..4ed23cd335f258 100644 --- a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp +++ b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp @@ -52,47 +52,44 @@ class TimeFormatLocalizationAttrAccess : public AttributeAccessInterface CHIP_ERROR ReadSupportedCalendarTypes(AttributeValueEncoder & aEncoder); }; -class AutoReleaseIterator -{ -public: - using Iterator = DeviceLayer::DeviceInfoProvider::SupportedCalendarTypesIterator; - - AutoReleaseIterator(Iterator * value) : mIterator(value) {} - ~AutoReleaseIterator() - { - if (mIterator != nullptr) - { - mIterator->Release(); - } - } - - bool IsValid() const { return mIterator != nullptr; } - bool Next(CalendarTypeEnum & value) { return (mIterator == nullptr) ? false : mIterator->Next(value); } - -private: - Iterator * mIterator; -}; - TimeFormatLocalizationAttrAccess gAttrAccess; CHIP_ERROR TimeFormatLocalizationAttrAccess::ReadSupportedCalendarTypes(AttributeValueEncoder & aEncoder) { + CHIP_ERROR err = CHIP_NO_ERROR; + DeviceLayer::DeviceInfoProvider * provider = DeviceLayer::GetDeviceInfoProvider(); - VerifyOrReturnValue(provider != nullptr, aEncoder.EncodeEmptyList()); - AutoReleaseIterator it(provider->IterateSupportedCalendarTypes()); - VerifyOrReturnValue(it.IsValid(), aEncoder.EncodeEmptyList()); + if (provider) + { + DeviceLayer::DeviceInfoProvider::SupportedCalendarTypesIterator * it = provider->IterateSupportedCalendarTypes(); - return aEncoder.EncodeList([&it](const auto & encoder) -> CHIP_ERROR { - CalendarTypeEnum type; + if (it) + { + err = aEncoder.EncodeList([&it](const auto & encoder) -> CHIP_ERROR { + CalendarTypeEnum type; - while (it.Next(type)) + while (it->Next(type)) + { + ReturnErrorOnFailure(encoder.Encode(type)); + } + + return CHIP_NO_ERROR; + }); + + it->Release(); + } + else { - ReturnErrorOnFailure(encoder.Encode(type)); + err = aEncoder.EncodeEmptyList(); } + } + else + { + err = aEncoder.EncodeEmptyList(); + } - return CHIP_NO_ERROR; - }); + return err; } CHIP_ERROR TimeFormatLocalizationAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) @@ -114,25 +111,30 @@ CHIP_ERROR TimeFormatLocalizationAttrAccess::Read(const ConcreteReadAttributePat bool IsSupportedCalendarType(CalendarTypeEnum newType, CalendarTypeEnum & validType) { // Reset valid type if no supported calendar types found. - validType = CalendarTypeEnum::kUseActiveLocale; - if (newType == CalendarTypeEnum::kUseActiveLocale) - { - return true; - } + validType = CalendarTypeEnum::kBuddhist; DeviceLayer::DeviceInfoProvider * provider = DeviceLayer::GetDeviceInfoProvider(); - VerifyOrReturnValue(provider != nullptr, false); - AutoReleaseIterator it(provider->IterateSupportedCalendarTypes()); - VerifyOrReturnValue(it.IsValid(), false); - - CalendarTypeEnum type; - while (it.Next(type)) + if (provider) { - validType = type; - if (validType == newType) + DeviceLayer::DeviceInfoProvider::SupportedCalendarTypesIterator * it = provider->IterateSupportedCalendarTypes(); + + if (it) { - return true; + CalendarTypeEnum type; + + while (it->Next(type)) + { + validType = type; + + if (validType == newType) + { + it->Release(); + return true; + } + } + + it->Release(); } } From 2f03415bea25a236afa9ae79b4e4abee84e4a55c Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Mon, 20 Nov 2023 09:18:15 -0500 Subject: [PATCH 19/27] Rely on IM logic to detect unknown values and return a correct response --- .../time-format-localization-server.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp index 7439d9e7392b62..2a428b08f8a2e2 100644 --- a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp +++ b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp @@ -170,11 +170,9 @@ Protocols::InteractionModel::Status MatterTimeFormatLocalizationClusterServerPre CalendarTypeEnum calendarType = static_cast(*value); - // Valid range is from 0 to unknown. This relies that unknown value is - // the first unused value and values increase over time - VerifyOrReturnValue(((calendarType == CalendarTypeEnum::kUseActiveLocale) || - (to_underlying(calendarType) < to_underlying(CalendarTypeEnum::kUnknownEnumValue))), - Protocols::InteractionModel::Status::ConstraintError); + // IM logic should convert any unrecognized value to Unknown and we do not allow + // processing those. + VerifyOrReturnValue(calendarType != CalendarTypeEnum::kUnknownEnumValue, Protocols::InteractionModel::Status::ConstraintError); return emberAfPluginTimeFormatLocalizationOnCalendarTypeChange(attributePath.mEndpointId, calendarType); } @@ -183,12 +181,9 @@ Protocols::InteractionModel::Status MatterTimeFormatLocalizationClusterServerPre HourFormatEnum hourFormat = static_cast(*value); - // Valid range is from 0 to unknown. This relies that unknown value is - // the first unused value and values increase over time - VerifyOrReturnValue(((hourFormat == HourFormatEnum::kUseActiveLocale) || - (to_underlying(hourFormat) < to_underlying(HourFormatEnum::kUnknownEnumValue))), - Protocols::InteractionModel::Status::ConstraintError); - + // IM logic should convert any unrecognized value to Unknown and we do not allow + // processing those. + VerifyOrReturnValue(hourFormat != HourFormatEnum::kUnknownEnumValue, Protocols::InteractionModel::Status::ConstraintError); return Protocols::InteractionModel::Status::Success; } default: From 7cd8bfd830dd40b6f7729840c0b25d03b7e1f805 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Mon, 20 Nov 2023 09:19:33 -0500 Subject: [PATCH 20/27] Restyle --- .../time-format-localization-server.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp index 2a428b08f8a2e2..52d45773724c4d 100644 --- a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp +++ b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp @@ -172,7 +172,8 @@ Protocols::InteractionModel::Status MatterTimeFormatLocalizationClusterServerPre // IM logic should convert any unrecognized value to Unknown and we do not allow // processing those. - VerifyOrReturnValue(calendarType != CalendarTypeEnum::kUnknownEnumValue, Protocols::InteractionModel::Status::ConstraintError); + VerifyOrReturnValue(calendarType != CalendarTypeEnum::kUnknownEnumValue, + Protocols::InteractionModel::Status::ConstraintError); return emberAfPluginTimeFormatLocalizationOnCalendarTypeChange(attributePath.mEndpointId, calendarType); } From 07bf1ed676ecd32b2f772f9c364eb8c3e06a0441 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Mon, 20 Nov 2023 16:03:43 -0500 Subject: [PATCH 21/27] More validation logic ... seems it is not automatic after all --- .../app-templates/endpoint_config.h | 103 +++++++++--------- .../app-templates/endpoint_config.h | 19 ++-- .../time-format-localization-server.cpp | 55 ++++++++-- .../chip/time-format-localization-cluster.xml | 2 +- 4 files changed, 103 insertions(+), 76 deletions(-) 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 6ff798033fd84c..b17b1f10b542f0 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 @@ -269,15 +269,12 @@ #define GENERATED_DEFAULTS_COUNT (32) // This is an array of EmberAfAttributeMinMaxValue structures. -#define GENERATED_MIN_MAX_DEFAULT_COUNT 46 +#define GENERATED_MIN_MAX_DEFAULT_COUNT 45 #define GENERATED_MIN_MAX_DEFAULTS \ { \ \ - /* Endpoint: 0, Cluster: Time Format Localization (server) */ \ - { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFF }, /* HourFormat */ \ - \ - /* Endpoint: 0, Cluster: Unit Localization (server) */ \ - { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x2 }, /* TemperatureUnit */ \ + /* Endpoint: 0, Cluster: Unit Localization (server) */ \ + { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x2 }, /* TemperatureUnit */ \ \ /* Endpoint: 1, Cluster: On/Off (server) */ \ { (uint16_t) 0xFF, (uint16_t) 0x0, (uint16_t) 0x2 }, /* StartUpOnOff */ \ @@ -457,8 +454,8 @@ { ZAP_SIMPLE_DEFAULT(1), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Time Format Localization (server) */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(0), 0x00000000, 1, ZAP_TYPE(ENUM8), \ - ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* HourFormat */ \ + { ZAP_SIMPLE_DEFAULT(0), 0x00000000, 1, ZAP_TYPE(ENUM8), \ + ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* HourFormat */ \ { ZAP_SIMPLE_DEFAULT(0), 0x00000001, 1, ZAP_TYPE(ENUM8), \ ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* ActiveCalendarType */ \ { ZAP_EMPTY_DEFAULT(), 0x00000002, 0, ZAP_TYPE(ARRAY), \ @@ -467,7 +464,7 @@ { ZAP_SIMPLE_DEFAULT(1), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Unit Localization (server) */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(1), 0x00000000, 1, ZAP_TYPE(ENUM8), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(0), 0x00000000, 1, ZAP_TYPE(ENUM8), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* TemperatureUnit */ \ { ZAP_SIMPLE_DEFAULT(0x1), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ { ZAP_SIMPLE_DEFAULT(1), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ @@ -768,7 +765,7 @@ { ZAP_SIMPLE_DEFAULT(0x01), 0x00004000, 1, ZAP_TYPE(BOOLEAN), 0 }, /* GlobalSceneControl */ \ { ZAP_SIMPLE_DEFAULT(0x0000), 0x00004001, 2, ZAP_TYPE(INT16U), ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* OnTime */ \ { ZAP_SIMPLE_DEFAULT(0x0000), 0x00004002, 2, ZAP_TYPE(INT16U), ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* OffWaitTime */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(2), 0x00004003, 1, ZAP_TYPE(ENUM8), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(1), 0x00004003, 1, ZAP_TYPE(ENUM8), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE) | \ ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* StartUpOnOff */ \ { ZAP_SIMPLE_DEFAULT(0x0001), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ @@ -776,7 +773,7 @@ \ /* Endpoint: 1, Cluster: On/off Switch Configuration (server) */ \ { ZAP_EMPTY_DEFAULT(), 0x00000000, 1, ZAP_TYPE(ENUM8), 0 }, /* switch type */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(3), 0x00000010, 1, ZAP_TYPE(ENUM8), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(2), 0x00000010, 1, ZAP_TYPE(ENUM8), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* switch actions */ \ { ZAP_SIMPLE_DEFAULT(0), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ { ZAP_SIMPLE_DEFAULT(1), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ @@ -790,7 +787,7 @@ { ZAP_SIMPLE_DEFAULT(0x0000), 0x00000004, 2, ZAP_TYPE(INT16U), 0 }, /* CurrentFrequency */ \ { ZAP_SIMPLE_DEFAULT(0x0000), 0x00000005, 2, ZAP_TYPE(INT16U), 0 }, /* MinFrequency */ \ { ZAP_SIMPLE_DEFAULT(0x0000), 0x00000006, 2, ZAP_TYPE(INT16U), 0 }, /* MaxFrequency */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(4), 0x0000000F, 1, ZAP_TYPE(BITMAP8), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(3), 0x0000000F, 1, ZAP_TYPE(BITMAP8), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* Options */ \ { ZAP_SIMPLE_DEFAULT(0x0000), 0x00000010, 2, ZAP_TYPE(INT16U), \ ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* OnOffTransitionTime */ \ @@ -809,7 +806,7 @@ { ZAP_SIMPLE_DEFAULT(5), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Binary Input (Basic) (server) */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(5), 0x00000051, 1, ZAP_TYPE(BOOLEAN), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(4), 0x00000051, 1, ZAP_TYPE(BOOLEAN), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* out of service */ \ { ZAP_EMPTY_DEFAULT(), 0x00000055, 1, ZAP_TYPE(BOOLEAN), ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* present value */ \ { ZAP_SIMPLE_DEFAULT(0x00), 0x0000006F, 1, ZAP_TYPE(BITMAP8), 0 }, /* status flags */ \ @@ -907,9 +904,9 @@ { ZAP_SIMPLE_DEFAULT(5), 0x0000001C, 1, ZAP_TYPE(INT8U), 0 }, /* NumberOfCredentialsSupportedPerUser */ \ { ZAP_LONG_DEFAULTS_INDEX(27), 0x00000021, 4, ZAP_TYPE(CHAR_STRING), ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* Language */ \ { ZAP_SIMPLE_DEFAULT(60), 0x00000023, 4, ZAP_TYPE(INT32U), ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* AutoRelockTime */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(6), 0x00000024, 1, ZAP_TYPE(INT8U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(5), 0x00000024, 1, ZAP_TYPE(INT8U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* SoundVolume */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(7), 0x00000025, 1, ZAP_TYPE(ENUM8), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(6), 0x00000025, 1, ZAP_TYPE(ENUM8), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* OperatingMode */ \ { ZAP_SIMPLE_DEFAULT(0xFFF6), 0x00000026, 2, ZAP_TYPE(BITMAP16), 0 }, /* SupportedOperatingModes */ \ { ZAP_SIMPLE_DEFAULT(0), 0x00000027, 2, ZAP_TYPE(BITMAP16), 0 }, /* DefaultConfigurationRegister */ \ @@ -918,9 +915,9 @@ { ZAP_SIMPLE_DEFAULT(0), 0x0000002A, 1, ZAP_TYPE(BOOLEAN), ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* EnableInsideStatusLED */ \ { ZAP_SIMPLE_DEFAULT(0x00), 0x0000002B, 1, ZAP_TYPE(BOOLEAN), \ ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* EnablePrivacyModeButton */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(8), 0x00000030, 1, ZAP_TYPE(INT8U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(7), 0x00000030, 1, ZAP_TYPE(INT8U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* WrongCodeEntryLimit */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(9), 0x00000031, 1, ZAP_TYPE(INT8U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(8), 0x00000031, 1, ZAP_TYPE(INT8U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* UserCodeTemporaryDisableTime */ \ { ZAP_SIMPLE_DEFAULT(0), 0x00000033, 1, ZAP_TYPE(BOOLEAN), \ ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* RequirePINforRemoteOperation */ \ @@ -962,7 +959,7 @@ ZAP_ATTRIBUTE_MASK(TOKENIZE) }, /* InstalledOpenLimitTilt */ \ { ZAP_SIMPLE_DEFAULT(0xFFFF), 0x00000013, 2, ZAP_TYPE(INT16U), \ ZAP_ATTRIBUTE_MASK(TOKENIZE) }, /* InstalledClosedLimitTilt */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(10), 0x00000017, 1, ZAP_TYPE(BITMAP8), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(9), 0x00000017, 1, ZAP_TYPE(BITMAP8), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* Mode */ \ { ZAP_SIMPLE_DEFAULT(0x00), 0x0000001A, 2, ZAP_TYPE(BITMAP16), 0 }, /* SafetyStatus */ \ { ZAP_SIMPLE_DEFAULT(0x17), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ @@ -1000,9 +997,9 @@ { ZAP_EMPTY_DEFAULT(), 0x00000016, 3, ZAP_TYPE(INT24U), ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* Power */ \ { ZAP_SIMPLE_DEFAULT(0x00000000), 0x00000017, 4, ZAP_TYPE(INT32U), \ ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* LifetimeEnergyConsumed */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(11), 0x00000020, 1, ZAP_TYPE(ENUM8), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(10), 0x00000020, 1, ZAP_TYPE(ENUM8), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* OperationMode */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(12), 0x00000021, 1, ZAP_TYPE(ENUM8), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(11), 0x00000021, 1, ZAP_TYPE(ENUM8), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* ControlMode */ \ { ZAP_SIMPLE_DEFAULT(0), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ { ZAP_SIMPLE_DEFAULT(3), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ @@ -1013,36 +1010,36 @@ { ZAP_SIMPLE_DEFAULT(0x0BB8), 0x00000004, 2, ZAP_TYPE(INT16S), 0 }, /* AbsMaxHeatSetpointLimit */ \ { ZAP_SIMPLE_DEFAULT(0x0640), 0x00000005, 2, ZAP_TYPE(INT16S), 0 }, /* AbsMinCoolSetpointLimit */ \ { ZAP_SIMPLE_DEFAULT(0x0C80), 0x00000006, 2, ZAP_TYPE(INT16S), 0 }, /* AbsMaxCoolSetpointLimit */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(13), 0x00000011, 2, ZAP_TYPE(INT16S), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(12), 0x00000011, 2, ZAP_TYPE(INT16S), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* OccupiedCoolingSetpoint */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(14), 0x00000012, 2, ZAP_TYPE(INT16S), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(13), 0x00000012, 2, ZAP_TYPE(INT16S), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* OccupiedHeatingSetpoint */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(15), 0x00000015, 2, ZAP_TYPE(INT16S), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(14), 0x00000015, 2, ZAP_TYPE(INT16S), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* MinHeatSetpointLimit */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(16), 0x00000016, 2, ZAP_TYPE(INT16S), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(15), 0x00000016, 2, ZAP_TYPE(INT16S), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* MaxHeatSetpointLimit */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(17), 0x00000017, 2, ZAP_TYPE(INT16S), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(16), 0x00000017, 2, ZAP_TYPE(INT16S), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* MinCoolSetpointLimit */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(18), 0x00000018, 2, ZAP_TYPE(INT16S), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(17), 0x00000018, 2, ZAP_TYPE(INT16S), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* MaxCoolSetpointLimit */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(19), 0x00000019, 1, ZAP_TYPE(INT8S), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(18), 0x00000019, 1, ZAP_TYPE(INT8S), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* MinSetpointDeadBand */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(20), 0x0000001B, 1, ZAP_TYPE(ENUM8), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(19), 0x0000001B, 1, ZAP_TYPE(ENUM8), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* ControlSequenceOfOperation */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(21), 0x0000001C, 1, ZAP_TYPE(ENUM8), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(20), 0x0000001C, 1, ZAP_TYPE(ENUM8), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* SystemMode */ \ { ZAP_SIMPLE_DEFAULT(0x0023), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ { ZAP_SIMPLE_DEFAULT(6), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Fan Control (server) */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(22), 0x00000000, 1, ZAP_TYPE(ENUM8), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(21), 0x00000000, 1, ZAP_TYPE(ENUM8), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* FanMode */ \ { ZAP_SIMPLE_DEFAULT(0x02), 0x00000001, 1, ZAP_TYPE(ENUM8), 0 }, /* FanModeSequence */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(23), 0x00000002, 1, ZAP_TYPE(PERCENT), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(22), 0x00000002, 1, ZAP_TYPE(PERCENT), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* PercentSetting */ \ { ZAP_SIMPLE_DEFAULT(0x00), 0x00000003, 1, ZAP_TYPE(PERCENT), 0 }, /* PercentCurrent */ \ { ZAP_SIMPLE_DEFAULT(100), 0x00000004, 1, ZAP_TYPE(INT8U), 0 }, /* SpeedMax */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(24), 0x00000005, 1, ZAP_TYPE(INT8U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(23), 0x00000005, 1, ZAP_TYPE(INT8U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* SpeedSetting */ \ { ZAP_SIMPLE_DEFAULT(0x00), 0x00000006, 1, ZAP_TYPE(INT8U), 0 }, /* SpeedCurrent */ \ { ZAP_SIMPLE_DEFAULT(0x00), 0x00000007, 1, ZAP_TYPE(BITMAP8), 0 }, /* RockSupport */ \ @@ -1053,11 +1050,11 @@ { ZAP_SIMPLE_DEFAULT(2), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Thermostat User Interface Configuration (server) */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(25), 0x00000000, 1, ZAP_TYPE(ENUM8), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(24), 0x00000000, 1, ZAP_TYPE(ENUM8), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* TemperatureDisplayMode */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(26), 0x00000001, 1, ZAP_TYPE(ENUM8), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(25), 0x00000001, 1, ZAP_TYPE(ENUM8), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* KeypadLockout */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(27), 0x00000002, 1, ZAP_TYPE(ENUM8), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(26), 0x00000002, 1, ZAP_TYPE(ENUM8), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* ScheduleProgrammingVisibility */ \ { ZAP_SIMPLE_DEFAULT(0), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ { ZAP_SIMPLE_DEFAULT(2), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ @@ -1092,25 +1089,25 @@ { ZAP_EMPTY_DEFAULT(), 0x00000028, 2, ZAP_TYPE(INT16U), 0 }, /* Primary6X */ \ { ZAP_EMPTY_DEFAULT(), 0x00000029, 2, ZAP_TYPE(INT16U), 0 }, /* Primary6Y */ \ { ZAP_EMPTY_DEFAULT(), 0x0000002A, 1, ZAP_TYPE(INT8U), ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* Primary6Intensity */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(28), 0x00000030, 2, ZAP_TYPE(INT16U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(27), 0x00000030, 2, ZAP_TYPE(INT16U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* WhitePointX */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(29), 0x00000031, 2, ZAP_TYPE(INT16U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(28), 0x00000031, 2, ZAP_TYPE(INT16U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* WhitePointY */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(30), 0x00000032, 2, ZAP_TYPE(INT16U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(29), 0x00000032, 2, ZAP_TYPE(INT16U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* ColorPointRX */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(31), 0x00000033, 2, ZAP_TYPE(INT16U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(30), 0x00000033, 2, ZAP_TYPE(INT16U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* ColorPointRY */ \ { ZAP_EMPTY_DEFAULT(), 0x00000034, 1, ZAP_TYPE(INT8U), \ ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* ColorPointRIntensity */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(32), 0x00000036, 2, ZAP_TYPE(INT16U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(31), 0x00000036, 2, ZAP_TYPE(INT16U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* ColorPointGX */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(33), 0x00000037, 2, ZAP_TYPE(INT16U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(32), 0x00000037, 2, ZAP_TYPE(INT16U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* ColorPointGY */ \ { ZAP_EMPTY_DEFAULT(), 0x00000038, 1, ZAP_TYPE(INT8U), \ ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* ColorPointGIntensity */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(34), 0x0000003A, 2, ZAP_TYPE(INT16U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(33), 0x0000003A, 2, ZAP_TYPE(INT16U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* ColorPointBX */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(35), 0x0000003B, 2, ZAP_TYPE(INT16U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(34), 0x0000003B, 2, ZAP_TYPE(INT16U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* ColorPointBY */ \ { ZAP_EMPTY_DEFAULT(), 0x0000003C, 1, ZAP_TYPE(INT8U), \ ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* ColorPointBIntensity */ \ @@ -1125,7 +1122,7 @@ { ZAP_SIMPLE_DEFAULT(0x0000), 0x0000400B, 2, ZAP_TYPE(INT16U), 0 }, /* ColorTempPhysicalMinMireds */ \ { ZAP_SIMPLE_DEFAULT(0xFEFF), 0x0000400C, 2, ZAP_TYPE(INT16U), 0 }, /* ColorTempPhysicalMaxMireds */ \ { ZAP_EMPTY_DEFAULT(), 0x0000400D, 2, ZAP_TYPE(INT16U), 0 }, /* CoupleColorTempToLevelMinMireds */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(36), 0x00004010, 2, ZAP_TYPE(INT16U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(35), 0x00004010, 2, ZAP_TYPE(INT16U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) | \ ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* StartUpColorTemperatureMireds */ \ { ZAP_SIMPLE_DEFAULT(0x1F), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ @@ -1314,13 +1311,13 @@ { ZAP_EMPTY_DEFAULT(), 0x00000024, 1, ZAP_TYPE(ENUM8), ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* enum_attr */ \ { ZAP_EMPTY_DEFAULT(), 0x00000025, 0, ZAP_TYPE(STRUCT), \ ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* struct_attr */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(37), 0x00000026, 1, ZAP_TYPE(INT8U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(36), 0x00000026, 1, ZAP_TYPE(INT8U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* range_restricted_int8u */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(38), 0x00000027, 1, ZAP_TYPE(INT8S), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(37), 0x00000027, 1, ZAP_TYPE(INT8S), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* range_restricted_int8s */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(39), 0x00000028, 2, ZAP_TYPE(INT16U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(38), 0x00000028, 2, ZAP_TYPE(INT16U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* range_restricted_int16u */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(40), 0x00000029, 2, ZAP_TYPE(INT16S), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(39), 0x00000029, 2, ZAP_TYPE(INT16S), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* range_restricted_int16s */ \ { ZAP_EMPTY_DEFAULT(), 0x0000002A, 0, ZAP_TYPE(ARRAY), \ ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* list_long_octet_string */ \ @@ -1391,16 +1388,16 @@ { ZAP_EMPTY_DEFAULT(), 0x00004025, 0, ZAP_TYPE(STRUCT), \ ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE) | \ ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* nullable_struct */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(41), 0x00004026, 1, ZAP_TYPE(INT8U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(40), 0x00004026, 1, ZAP_TYPE(INT8U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) | \ ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* nullable_range_restricted_int8u */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(42), 0x00004027, 1, ZAP_TYPE(INT8S), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(41), 0x00004027, 1, ZAP_TYPE(INT8S), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) | \ ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* nullable_range_restricted_int8s */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(43), 0x00004028, 2, ZAP_TYPE(INT16U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(42), 0x00004028, 2, ZAP_TYPE(INT16U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) | \ ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* nullable_range_restricted_int16u */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(44), 0x00004029, 2, ZAP_TYPE(INT16S), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(43), 0x00004029, 2, ZAP_TYPE(INT16S), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) | \ ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* nullable_range_restricted_int16s */ \ { ZAP_EMPTY_DEFAULT(), 0x0000402A, 1, ZAP_TYPE(INT8U), \ @@ -1435,7 +1432,7 @@ { ZAP_SIMPLE_DEFAULT(1), 0x00004000, 1, ZAP_TYPE(BOOLEAN), 0 }, /* GlobalSceneControl */ \ { ZAP_SIMPLE_DEFAULT(0), 0x00004001, 2, ZAP_TYPE(INT16U), ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* OnTime */ \ { ZAP_SIMPLE_DEFAULT(0), 0x00004002, 2, ZAP_TYPE(INT16U), ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* OffWaitTime */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(45), 0x00004003, 1, ZAP_TYPE(ENUM8), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(44), 0x00004003, 1, ZAP_TYPE(ENUM8), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* StartUpOnOff */ \ { ZAP_SIMPLE_DEFAULT(0x0000), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ { ZAP_SIMPLE_DEFAULT(5), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ diff --git a/scripts/tools/zap/tests/outputs/lighting-app/app-templates/endpoint_config.h b/scripts/tools/zap/tests/outputs/lighting-app/app-templates/endpoint_config.h index 9663fb0e866ff0..2995578b503f1c 100644 --- a/scripts/tools/zap/tests/outputs/lighting-app/app-templates/endpoint_config.h +++ b/scripts/tools/zap/tests/outputs/lighting-app/app-templates/endpoint_config.h @@ -61,15 +61,12 @@ #define GENERATED_DEFAULTS_COUNT (2) // This is an array of EmberAfAttributeMinMaxValue structures. -#define GENERATED_MIN_MAX_DEFAULT_COUNT 4 +#define GENERATED_MIN_MAX_DEFAULT_COUNT 3 #define GENERATED_MIN_MAX_DEFAULTS \ { \ \ - /* Endpoint: 0, Cluster: Time Format Localization (server) */ \ - { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFF }, /* HourFormat */ \ - \ - /* Endpoint: 1, Cluster: On/Off (server) */ \ - { (uint16_t) 0xFF, (uint16_t) 0x0, (uint16_t) 0x2 }, /* StartUpOnOff */ \ + /* Endpoint: 1, Cluster: On/Off (server) */ \ + { (uint16_t) 0xFF, (uint16_t) 0x0, (uint16_t) 0x2 }, /* StartUpOnOff */ \ \ /* Endpoint: 1, Cluster: Level Control (server) */ \ { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x3 }, /* Options */ \ @@ -173,8 +170,8 @@ { ZAP_SIMPLE_DEFAULT(1), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Time Format Localization (server) */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(0), 0x00000000, 1, ZAP_TYPE(ENUM8), \ - ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* HourFormat */ \ + { ZAP_SIMPLE_DEFAULT(0), 0x00000000, 1, ZAP_TYPE(ENUM8), \ + ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* HourFormat */ \ { ZAP_SIMPLE_DEFAULT(0), 0x00000001, 1, ZAP_TYPE(ENUM8), \ ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* ActiveCalendarType */ \ { ZAP_EMPTY_DEFAULT(), 0x00000002, 0, ZAP_TYPE(ARRAY), \ @@ -449,7 +446,7 @@ { ZAP_SIMPLE_DEFAULT(0x01), 0x00004000, 1, ZAP_TYPE(BOOLEAN), 0 }, /* GlobalSceneControl */ \ { ZAP_SIMPLE_DEFAULT(0x0000), 0x00004001, 2, ZAP_TYPE(INT16U), ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* OnTime */ \ { ZAP_SIMPLE_DEFAULT(0x0000), 0x00004002, 2, ZAP_TYPE(INT16U), ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* OffWaitTime */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(1), 0x00004003, 1, ZAP_TYPE(ENUM8), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(0), 0x00004003, 1, ZAP_TYPE(ENUM8), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE) | \ ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* StartUpOnOff */ \ { ZAP_SIMPLE_DEFAULT(1), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ @@ -464,7 +461,7 @@ { ZAP_SIMPLE_DEFAULT(0x0000), 0x00000004, 2, ZAP_TYPE(INT16U), 0 }, /* CurrentFrequency */ \ { ZAP_SIMPLE_DEFAULT(0x0000), 0x00000005, 2, ZAP_TYPE(INT16U), 0 }, /* MinFrequency */ \ { ZAP_SIMPLE_DEFAULT(0x0000), 0x00000006, 2, ZAP_TYPE(INT16U), 0 }, /* MaxFrequency */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(2), 0x0000000F, 1, ZAP_TYPE(BITMAP8), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(1), 0x0000000F, 1, ZAP_TYPE(BITMAP8), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* Options */ \ { ZAP_SIMPLE_DEFAULT(0x0000), 0x00000010, 2, ZAP_TYPE(INT16U), \ ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* OnOffTransitionTime */ \ @@ -511,7 +508,7 @@ { ZAP_SIMPLE_DEFAULT(0x0000), 0x0000400B, 2, ZAP_TYPE(INT16U), 0 }, /* ColorTempPhysicalMinMireds */ \ { ZAP_SIMPLE_DEFAULT(0xFEFF), 0x0000400C, 2, ZAP_TYPE(INT16U), 0 }, /* ColorTempPhysicalMaxMireds */ \ { ZAP_EMPTY_DEFAULT(), 0x0000400D, 2, ZAP_TYPE(INT16U), 0 }, /* CoupleColorTempToLevelMinMireds */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(3), 0x00004010, 2, ZAP_TYPE(INT16U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(2), 0x00004010, 2, ZAP_TYPE(INT16U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) | \ ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* StartUpColorTemperatureMireds */ \ { ZAP_SIMPLE_DEFAULT(0x1F), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ diff --git a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp index 52d45773724c4d..037463e12e588c 100644 --- a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp +++ b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp @@ -135,6 +135,42 @@ bool IsSupportedCalendarType(CalendarTypeEnum newType, CalendarTypeEnum & validT return false; } +chip::Optional SafeCastToKnowHourFormat(uint8_t value) +{ + switch (value) + { + case to_underlying(HourFormatEnum::k12hr): + case to_underlying(HourFormatEnum::k24hr): + case to_underlying(HourFormatEnum::kUseActiveLocale): + return chip::MakeOptional(static_cast(value)); + default: + return chip::Optional::Missing(); + } +} + +chip::Optional SafeCastToKnowCalendarType(uint8_t value) +{ + switch (value) + { + case to_underlying(CalendarTypeEnum::kBuddhist): + case to_underlying(CalendarTypeEnum::kChinese): + case to_underlying(CalendarTypeEnum::kCoptic): + case to_underlying(CalendarTypeEnum::kEthiopian): + case to_underlying(CalendarTypeEnum::kGregorian): + case to_underlying(CalendarTypeEnum::kHebrew): + case to_underlying(CalendarTypeEnum::kIndian): + case to_underlying(CalendarTypeEnum::kIslamic): + case to_underlying(CalendarTypeEnum::kJapanese): + case to_underlying(CalendarTypeEnum::kKorean): + case to_underlying(CalendarTypeEnum::kPersian): + case to_underlying(CalendarTypeEnum::kTaiwanese): + case to_underlying(CalendarTypeEnum::kUseActiveLocale): + return chip::MakeOptional(static_cast(value)); + default: + return chip::Optional::Missing(); + } +} + } // anonymous namespace // ============================================================================= @@ -168,23 +204,20 @@ Protocols::InteractionModel::Status MatterTimeFormatLocalizationClusterServerPre case ActiveCalendarType::Id: { VerifyOrReturnValue(sizeof(uint8_t) == size, Protocols::InteractionModel::Status::InvalidValue); - CalendarTypeEnum calendarType = static_cast(*value); + auto calendarType = SafeCastToKnowCalendarType(*value); + VerifyOrReturnValue(calendarType.HasValue(), Protocols::InteractionModel::Status::ConstraintError); - // IM logic should convert any unrecognized value to Unknown and we do not allow - // processing those. - VerifyOrReturnValue(calendarType != CalendarTypeEnum::kUnknownEnumValue, - Protocols::InteractionModel::Status::ConstraintError); - - return emberAfPluginTimeFormatLocalizationOnCalendarTypeChange(attributePath.mEndpointId, calendarType); + return emberAfPluginTimeFormatLocalizationOnCalendarTypeChange(attributePath.mEndpointId, calendarType.Value()); } case HourFormat::Id: { VerifyOrReturnValue(sizeof(uint8_t) == size, Protocols::InteractionModel::Status::InvalidValue); - HourFormatEnum hourFormat = static_cast(*value); + auto hourFormat = SafeCastToKnowHourFormat(*value); + if (!hourFormat.HasValue()) + { + return Protocols::InteractionModel::Status::ConstraintError; + } - // IM logic should convert any unrecognized value to Unknown and we do not allow - // processing those. - VerifyOrReturnValue(hourFormat != HourFormatEnum::kUnknownEnumValue, Protocols::InteractionModel::Status::ConstraintError); return Protocols::InteractionModel::Status::Success; } default: diff --git a/src/app/zap-templates/zcl/data-model/chip/time-format-localization-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/time-format-localization-cluster.xml index 9131ba51385dc7..8f537d8008731c 100644 --- a/src/app/zap-templates/zcl/data-model/chip/time-format-localization-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/time-format-localization-cluster.xml @@ -56,7 +56,7 @@ limitations under the License. or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. - + HourFormat From a1ff69c5aa5522beb1fed0abd1ca3dc2562bc41b Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 1 Dec 2023 16:49:34 -0500 Subject: [PATCH 22/27] Remove some chip namespace and use NullOptional --- .../time-format-localization-server.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp index 037463e12e588c..2ec185d796b83e 100644 --- a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp +++ b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp @@ -135,7 +135,7 @@ bool IsSupportedCalendarType(CalendarTypeEnum newType, CalendarTypeEnum & validT return false; } -chip::Optional SafeCastToKnowHourFormat(uint8_t value) +Optional SafeCastToKnowHourFormat(uint8_t value) { switch (value) { @@ -144,11 +144,10 @@ chip::Optional SafeCastToKnowHourFormat(uint8_t value) case to_underlying(HourFormatEnum::kUseActiveLocale): return chip::MakeOptional(static_cast(value)); default: - return chip::Optional::Missing(); + return NullOptional; } } - -chip::Optional SafeCastToKnowCalendarType(uint8_t value) +Optional SafeCastToKnowCalendarType(uint8_t value) { switch (value) { @@ -167,7 +166,7 @@ chip::Optional SafeCastToKnowCalendarType(uint8_t value) case to_underlying(CalendarTypeEnum::kUseActiveLocale): return chip::MakeOptional(static_cast(value)); default: - return chip::Optional::Missing(); + return NullOptional; } } From 19b3805c359a5e3513621b2cfabc642a32dfb78a Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 1 Dec 2023 16:55:26 -0500 Subject: [PATCH 23/27] Use EnsureKnownEnumValue helper --- .../time-format-localization-server.cpp | 40 ++++--------------- 1 file changed, 8 insertions(+), 32 deletions(-) diff --git a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp index 2ec185d796b83e..20d8e7f969189f 100644 --- a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp +++ b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp @@ -21,6 +21,7 @@ ***************************************************************************/ #include +#include #include #include #include @@ -135,39 +136,14 @@ bool IsSupportedCalendarType(CalendarTypeEnum newType, CalendarTypeEnum & validT return false; } -Optional SafeCastToKnowHourFormat(uint8_t value) +template +Optional SafeCast(uint8_t value) { - switch (value) - { - case to_underlying(HourFormatEnum::k12hr): - case to_underlying(HourFormatEnum::k24hr): - case to_underlying(HourFormatEnum::kUseActiveLocale): - return chip::MakeOptional(static_cast(value)); - default: - return NullOptional; - } -} -Optional SafeCastToKnowCalendarType(uint8_t value) -{ - switch (value) - { - case to_underlying(CalendarTypeEnum::kBuddhist): - case to_underlying(CalendarTypeEnum::kChinese): - case to_underlying(CalendarTypeEnum::kCoptic): - case to_underlying(CalendarTypeEnum::kEthiopian): - case to_underlying(CalendarTypeEnum::kGregorian): - case to_underlying(CalendarTypeEnum::kHebrew): - case to_underlying(CalendarTypeEnum::kIndian): - case to_underlying(CalendarTypeEnum::kIslamic): - case to_underlying(CalendarTypeEnum::kJapanese): - case to_underlying(CalendarTypeEnum::kKorean): - case to_underlying(CalendarTypeEnum::kPersian): - case to_underlying(CalendarTypeEnum::kTaiwanese): - case to_underlying(CalendarTypeEnum::kUseActiveLocale): - return chip::MakeOptional(static_cast(value)); - default: + E val = static_cast(value); + if (EnsureKnownEnumValue(val) == E::kUnknownEnumValue) { return NullOptional; } + return chip::MakeOptional(val); } } // anonymous namespace @@ -203,7 +179,7 @@ Protocols::InteractionModel::Status MatterTimeFormatLocalizationClusterServerPre case ActiveCalendarType::Id: { VerifyOrReturnValue(sizeof(uint8_t) == size, Protocols::InteractionModel::Status::InvalidValue); - auto calendarType = SafeCastToKnowCalendarType(*value); + auto calendarType = SafeCast(*value); VerifyOrReturnValue(calendarType.HasValue(), Protocols::InteractionModel::Status::ConstraintError); return emberAfPluginTimeFormatLocalizationOnCalendarTypeChange(attributePath.mEndpointId, calendarType.Value()); @@ -211,7 +187,7 @@ Protocols::InteractionModel::Status MatterTimeFormatLocalizationClusterServerPre case HourFormat::Id: { VerifyOrReturnValue(sizeof(uint8_t) == size, Protocols::InteractionModel::Status::InvalidValue); - auto hourFormat = SafeCastToKnowHourFormat(*value); + auto hourFormat = SafeCast(*value); if (!hourFormat.HasValue()) { return Protocols::InteractionModel::Status::ConstraintError; From 775e87595653e0fbdbf2d99e390b1879989325a4 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 1 Dec 2023 16:56:05 -0500 Subject: [PATCH 24/27] Restyle --- .../time-format-localization-server.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp index 20d8e7f969189f..be36747dd1f8b0 100644 --- a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp +++ b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp @@ -140,7 +140,8 @@ template Optional SafeCast(uint8_t value) { E val = static_cast(value); - if (EnsureKnownEnumValue(val) == E::kUnknownEnumValue) { + if (EnsureKnownEnumValue(val) == E::kUnknownEnumValue) + { return NullOptional; } return chip::MakeOptional(val); From 4c40df05201c85447a1ff374128109266b5b5d8d Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 1 Dec 2023 16:57:29 -0500 Subject: [PATCH 25/27] make code consistent --- .../time-format-localization-server.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp index be36747dd1f8b0..86fcade14cdd66 100644 --- a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp +++ b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp @@ -189,10 +189,7 @@ Protocols::InteractionModel::Status MatterTimeFormatLocalizationClusterServerPre VerifyOrReturnValue(sizeof(uint8_t) == size, Protocols::InteractionModel::Status::InvalidValue); auto hourFormat = SafeCast(*value); - if (!hourFormat.HasValue()) - { - return Protocols::InteractionModel::Status::ConstraintError; - } + VerifyOrReturnValue(hourFormat.HasValue(), Protocols::InteractionModel::Status::ConstraintError); return Protocols::InteractionModel::Status::Success; } From e483418c53afb15ba2f934ef92d2f43fd60681a4 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Thu, 7 Dec 2023 08:34:07 -0500 Subject: [PATCH 26/27] update based on review --- .../time-format-localization-server.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp index 86fcade14cdd66..8539566e75dece 100644 --- a/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp +++ b/src/app/clusters/time-format-localization-server/time-format-localization-server.cpp @@ -144,7 +144,7 @@ Optional SafeCast(uint8_t value) { return NullOptional; } - return chip::MakeOptional(val); + return MakeOptional(val); } } // anonymous namespace From 5b6d36a7b7b40e6b4ad14d53d99724a5ebc52f56 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Thu, 7 Dec 2023 08:41:54 -0500 Subject: [PATCH 27/27] Fix the merge --- src/darwin/Framework/CHIP/templates/availability.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/src/darwin/Framework/CHIP/templates/availability.yaml b/src/darwin/Framework/CHIP/templates/availability.yaml index a3771469b22828..46b8a46e08f0ac 100644 --- a/src/darwin/Framework/CHIP/templates/availability.yaml +++ b/src/darwin/Framework/CHIP/templates/availability.yaml @@ -8230,7 +8230,6 @@ NetworkInfoStruct: - networkIdentifier - clientIdentifier - enum values: Channel: # Targeting Spring 2024 Matter release ChannelInfoStruct: