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 e1d48f4f655e42..5c7bd6a5ff2177 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 @@ -1521,8 +1521,8 @@ server cluster AdministratorCommissioning = 60 { } readonly attribute int8u windowStatus = 0; - readonly attribute fabric_idx adminFabricIndex = 1; - readonly attribute int16u adminVendorId = 2; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable int16u adminVendorId = 2; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; 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 dac16c909b027a..4682f3e7a721b8 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 @@ -1371,8 +1371,8 @@ server cluster AdministratorCommissioning = 60 { } readonly attribute int8u windowStatus = 0; - readonly attribute fabric_idx adminFabricIndex = 1; - readonly attribute int16u adminVendorId = 2; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable int16u adminVendorId = 2; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; diff --git a/examples/bridge-app/bridge-common/bridge-app.matter b/examples/bridge-app/bridge-common/bridge-app.matter index 4d36a1df1105bd..28410d89304ebd 100644 --- a/examples/bridge-app/bridge-common/bridge-app.matter +++ b/examples/bridge-app/bridge-common/bridge-app.matter @@ -1208,8 +1208,8 @@ server cluster AdministratorCommissioning = 60 { } readonly attribute int8u windowStatus = 0; - readonly attribute fabric_idx adminFabricIndex = 1; - readonly attribute int16u adminVendorId = 2; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable int16u adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute attrib_id attributeList[] = 65531; diff --git a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter index cadd67a1fd1247..b9bfeaac36dd12 100644 --- a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter @@ -1179,8 +1179,8 @@ server cluster AdministratorCommissioning = 60 { } readonly attribute int8u windowStatus = 0; - readonly attribute fabric_idx adminFabricIndex = 1; - readonly attribute int16u adminVendorId = 2; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable int16u adminVendorId = 2; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; diff --git a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter index 6bf99cf5abb818..bbaf33eff4ed29 100644 --- a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter +++ b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter @@ -1058,8 +1058,8 @@ server cluster AdministratorCommissioning = 60 { } readonly attribute int8u windowStatus = 0; - readonly attribute fabric_idx adminFabricIndex = 1; - readonly attribute int16u adminVendorId = 2; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable int16u adminVendorId = 2; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; diff --git a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter index d50c2189e0c6dd..15d73205b6b1bd 100644 --- a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter @@ -1313,8 +1313,8 @@ server cluster AdministratorCommissioning = 60 { } readonly attribute int8u windowStatus = 0; - readonly attribute fabric_idx adminFabricIndex = 1; - readonly attribute int16u adminVendorId = 2; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable int16u adminVendorId = 2; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; diff --git a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter index 56866f21823d89..7e9d3973f6b424 100644 --- a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter +++ b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter @@ -1280,8 +1280,8 @@ server cluster AdministratorCommissioning = 60 { } readonly attribute int8u windowStatus = 0; - readonly attribute fabric_idx adminFabricIndex = 1; - readonly attribute int16u adminVendorId = 2; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable int16u adminVendorId = 2; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; diff --git a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter index 8454769e811055..ff08c86811c217 100644 --- a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter +++ b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter @@ -1313,8 +1313,8 @@ server cluster AdministratorCommissioning = 60 { } readonly attribute int8u windowStatus = 0; - readonly attribute fabric_idx adminFabricIndex = 1; - readonly attribute int16u adminVendorId = 2; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable int16u adminVendorId = 2; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; diff --git a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter index 289a20f8500804..815ddf51e270be 100644 --- a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter +++ b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter @@ -1071,8 +1071,8 @@ server cluster AdministratorCommissioning = 60 { } readonly attribute int8u windowStatus = 0; - readonly attribute fabric_idx adminFabricIndex = 1; - readonly attribute int16u adminVendorId = 2; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable int16u adminVendorId = 2; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; diff --git a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter index 1a4a99c3aa7c54..7ee9eb3f8fff59 100644 --- a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter +++ b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter @@ -1306,8 +1306,8 @@ server cluster AdministratorCommissioning = 60 { } readonly attribute int8u windowStatus = 0; - readonly attribute fabric_idx adminFabricIndex = 1; - readonly attribute int16u adminVendorId = 2; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable int16u adminVendorId = 2; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; diff --git a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter index e9ac1fb1890303..dd92b23df5717c 100644 --- a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter +++ b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter @@ -1071,8 +1071,8 @@ server cluster AdministratorCommissioning = 60 { } readonly attribute int8u windowStatus = 0; - readonly attribute fabric_idx adminFabricIndex = 1; - readonly attribute int16u adminVendorId = 2; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable int16u adminVendorId = 2; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; diff --git a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter index 7943d5d9ee76c9..3e6a14e9e22bbf 100644 --- a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter +++ b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter @@ -1071,8 +1071,8 @@ server cluster AdministratorCommissioning = 60 { } readonly attribute int8u windowStatus = 0; - readonly attribute fabric_idx adminFabricIndex = 1; - readonly attribute int16u adminVendorId = 2; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable int16u adminVendorId = 2; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; diff --git a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter index 08f36aa6cf63fc..c21e6bc5236590 100644 --- a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter +++ b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter @@ -1071,8 +1071,8 @@ server cluster AdministratorCommissioning = 60 { } readonly attribute int8u windowStatus = 0; - readonly attribute fabric_idx adminFabricIndex = 1; - readonly attribute int16u adminVendorId = 2; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable int16u adminVendorId = 2; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; diff --git a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter index 0b364eeaa0d0f5..72ffcf3fb717aa 100644 --- a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter +++ b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter @@ -1313,8 +1313,8 @@ server cluster AdministratorCommissioning = 60 { } readonly attribute int8u windowStatus = 0; - readonly attribute fabric_idx adminFabricIndex = 1; - readonly attribute int16u adminVendorId = 2; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable int16u adminVendorId = 2; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; diff --git a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter index c6c4ac7930da4e..04d5afb808c5e8 100644 --- a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter +++ b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter @@ -1372,8 +1372,8 @@ server cluster AdministratorCommissioning = 60 { } readonly attribute int8u windowStatus = 0; - readonly attribute fabric_idx adminFabricIndex = 1; - readonly attribute int16u adminVendorId = 2; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable int16u adminVendorId = 2; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; diff --git a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter index 6654270b576023..703f782066e059 100644 --- a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter +++ b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter @@ -1219,8 +1219,8 @@ server cluster AdministratorCommissioning = 60 { } readonly attribute int8u windowStatus = 0; - readonly attribute fabric_idx adminFabricIndex = 1; - readonly attribute int16u adminVendorId = 2; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable int16u adminVendorId = 2; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; diff --git a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter index 5ea7e699ff4785..e0e99e18de7404 100644 --- a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter +++ b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter @@ -1071,8 +1071,8 @@ server cluster AdministratorCommissioning = 60 { } readonly attribute int8u windowStatus = 0; - readonly attribute fabric_idx adminFabricIndex = 1; - readonly attribute int16u adminVendorId = 2; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable int16u adminVendorId = 2; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; diff --git a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter index 7e7274afe8d39d..87e81970751eb2 100644 --- a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter +++ b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter @@ -1193,8 +1193,8 @@ server cluster AdministratorCommissioning = 60 { } readonly attribute int8u windowStatus = 0; - readonly attribute fabric_idx adminFabricIndex = 1; - readonly attribute int16u adminVendorId = 2; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable int16u adminVendorId = 2; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; diff --git a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter index 62ca53940e28d1..f8db9390ece9fa 100644 --- a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter +++ b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter @@ -1071,8 +1071,8 @@ server cluster AdministratorCommissioning = 60 { } readonly attribute int8u windowStatus = 0; - readonly attribute fabric_idx adminFabricIndex = 1; - readonly attribute int16u adminVendorId = 2; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable int16u adminVendorId = 2; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; diff --git a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter index 15abcd5da025e8..2081d0b9a82d3d 100644 --- a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter +++ b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter @@ -1169,8 +1169,8 @@ server cluster AdministratorCommissioning = 60 { } readonly attribute int8u windowStatus = 0; - readonly attribute fabric_idx adminFabricIndex = 1; - readonly attribute int16u adminVendorId = 2; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable int16u adminVendorId = 2; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; diff --git a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter index 960e33569fac7c..ff69471b9737be 100644 --- a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter +++ b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter @@ -1169,8 +1169,8 @@ server cluster AdministratorCommissioning = 60 { } readonly attribute int8u windowStatus = 0; - readonly attribute fabric_idx adminFabricIndex = 1; - readonly attribute int16u adminVendorId = 2; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable int16u adminVendorId = 2; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; 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 1229fc2c1fce3e..1020d8fa76a83b 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 @@ -1263,8 +1263,8 @@ server cluster AdministratorCommissioning = 60 { } readonly attribute int8u windowStatus = 0; - readonly attribute fabric_idx adminFabricIndex = 1; - readonly attribute int16u adminVendorId = 2; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable int16u adminVendorId = 2; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index 5478b00116e3d5..16d1429bf59184 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -1209,8 +1209,8 @@ server cluster AdministratorCommissioning = 60 { } readonly attribute int8u windowStatus = 0; - readonly attribute fabric_idx adminFabricIndex = 1; - readonly attribute int16u adminVendorId = 2; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable int16u adminVendorId = 2; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; diff --git a/examples/lock-app/lock-common/lock-app.matter b/examples/lock-app/lock-common/lock-app.matter index 1b71ec1e293514..29c7be5c17eed3 100644 --- a/examples/lock-app/lock-common/lock-app.matter +++ b/examples/lock-app/lock-common/lock-app.matter @@ -1140,8 +1140,8 @@ server cluster AdministratorCommissioning = 60 { } readonly attribute int8u windowStatus = 0; - readonly attribute fabric_idx adminFabricIndex = 1; - readonly attribute int16u adminVendorId = 2; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable int16u adminVendorId = 2; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; 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 23aeb22bb00d91..9c754da2cbe516 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 @@ -591,8 +591,8 @@ server cluster AdministratorCommissioning = 60 { } readonly attribute int8u windowStatus = 0; - readonly attribute fabric_idx adminFabricIndex = 1; - readonly attribute int16u adminVendorId = 2; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable int16u adminVendorId = 2; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; 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 b5258a7d8f5dfb..b7b991931328e2 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 @@ -608,8 +608,8 @@ server cluster AdministratorCommissioning = 60 { } readonly attribute int8u windowStatus = 0; - readonly attribute fabric_idx adminFabricIndex = 1; - readonly attribute int16u adminVendorId = 2; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable int16u adminVendorId = 2; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index ca1a1ec46e847d..d0c5617e80b51f 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -1217,8 +1217,8 @@ server cluster AdministratorCommissioning = 60 { } readonly attribute int8u windowStatus = 0; - readonly attribute fabric_idx adminFabricIndex = 1; - readonly attribute int16u adminVendorId = 2; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable int16u adminVendorId = 2; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index ca1a1ec46e847d..d0c5617e80b51f 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -1217,8 +1217,8 @@ server cluster AdministratorCommissioning = 60 { } readonly attribute int8u windowStatus = 0; - readonly attribute fabric_idx adminFabricIndex = 1; - readonly attribute int16u adminVendorId = 2; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable int16u adminVendorId = 2; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; diff --git a/examples/pump-app/pump-common/pump-app.matter b/examples/pump-app/pump-common/pump-app.matter index 0ee873ccb5a72c..d30c3559cd4d03 100644 --- a/examples/pump-app/pump-common/pump-app.matter +++ b/examples/pump-app/pump-common/pump-app.matter @@ -874,8 +874,8 @@ server cluster AdministratorCommissioning = 60 { } readonly attribute int8u windowStatus = 0; - readonly attribute fabric_idx adminFabricIndex = 1; - readonly attribute int16u adminVendorId = 2; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable int16u adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute attrib_id attributeList[] = 65531; diff --git a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter index 7ea1db01b01dd7..6bae1b538f2cc5 100644 --- a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter +++ b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter @@ -778,8 +778,8 @@ server cluster AdministratorCommissioning = 60 { } readonly attribute int8u windowStatus = 0; - readonly attribute fabric_idx adminFabricIndex = 1; - readonly attribute int16u adminVendorId = 2; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable int16u adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute attrib_id attributeList[] = 65531; diff --git a/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter b/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter index 1dd938ce8febaa..6295be401bea36 100644 --- a/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter +++ b/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter @@ -621,8 +621,8 @@ server cluster AdministratorCommissioning = 60 { } readonly attribute int8u windowStatus = 0; - readonly attribute fabric_idx adminFabricIndex = 1; - readonly attribute int16u adminVendorId = 2; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable int16u adminVendorId = 2; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; diff --git a/examples/thermostat/thermostat-common/thermostat.matter b/examples/thermostat/thermostat-common/thermostat.matter index c672a742dfdd51..39fc379bb9b4fb 100644 --- a/examples/thermostat/thermostat-common/thermostat.matter +++ b/examples/thermostat/thermostat-common/thermostat.matter @@ -1175,8 +1175,8 @@ server cluster AdministratorCommissioning = 60 { } readonly attribute int8u windowStatus = 0; - readonly attribute fabric_idx adminFabricIndex = 1; - readonly attribute int16u adminVendorId = 2; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable int16u adminVendorId = 2; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter index a509109ec75045..119ef38935a2e7 100644 --- a/examples/tv-app/tv-common/tv-app.matter +++ b/examples/tv-app/tv-common/tv-app.matter @@ -1217,8 +1217,8 @@ server cluster AdministratorCommissioning = 60 { } readonly attribute int8u windowStatus = 0; - readonly attribute fabric_idx adminFabricIndex = 1; - readonly attribute int16u adminVendorId = 2; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable int16u adminVendorId = 2; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; 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 24841d02cad66a..d400d537630a0d 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 @@ -1421,8 +1421,8 @@ server cluster AdministratorCommissioning = 60 { } readonly attribute int8u windowStatus = 0; - readonly attribute fabric_idx adminFabricIndex = 1; - readonly attribute int16u adminVendorId = 2; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable int16u adminVendorId = 2; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; diff --git a/examples/window-app/common/window-app.matter b/examples/window-app/common/window-app.matter index 23d2eb55874595..cfbb01ed19950c 100644 --- a/examples/window-app/common/window-app.matter +++ b/examples/window-app/common/window-app.matter @@ -1216,8 +1216,8 @@ server cluster AdministratorCommissioning = 60 { } readonly attribute int8u windowStatus = 0; - readonly attribute fabric_idx adminFabricIndex = 1; - readonly attribute int16u adminVendorId = 2; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable int16u adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute attrib_id attributeList[] = 65531; diff --git a/src/app/clusters/administrator-commissioning-server/administrator-commissioning-server.cpp b/src/app/clusters/administrator-commissioning-server/administrator-commissioning-server.cpp index f33fa4c184bded..24d3e37d8635e4 100644 --- a/src/app/clusters/administrator-commissioning-server/administrator-commissioning-server.cpp +++ b/src/app/clusters/administrator-commissioning-server/administrator-commissioning-server.cpp @@ -51,10 +51,6 @@ class AdministratorCommissioningAttrAccess : public AttributeAccessInterface {} CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; - - // Vendor ID and Fabric Index of the admin that has opened the commissioning window - uint16_t mVendorId; - FabricIndex mFabricIndex; }; AdministratorCommissioningAttrAccess gAdminCommissioningAttrAccess; @@ -66,21 +62,13 @@ CHIP_ERROR AdministratorCommissioningAttrAccess::Read(const ConcreteReadAttribut switch (aPath.mAttributeId) { case Attributes::WindowStatus::Id: { - return aEncoder.Encode(Server::GetInstance().GetCommissioningWindowManager().CommissioningWindowStatus()); + return aEncoder.Encode(Server::GetInstance().GetCommissioningWindowManager().CommissioningWindowStatusForCluster()); } case Attributes::AdminFabricIndex::Id: { - FabricIndex fabricIndex = (Server::GetInstance().GetCommissioningWindowManager().CommissioningWindowStatus() == - CommissioningWindowStatus::kWindowNotOpen) - ? 0 - : mFabricIndex; - return aEncoder.Encode(fabricIndex); + return aEncoder.Encode(Server::GetInstance().GetCommissioningWindowManager().GetOpenerFabricIndex()); } case Attributes::AdminVendorId::Id: { - uint16_t vendorId = (Server::GetInstance().GetCommissioningWindowManager().CommissioningWindowStatus() == - CommissioningWindowStatus::kWindowNotOpen) - ? 0 - : mVendorId; - return aEncoder.Encode(vendorId); + return aEncoder.Encode(Server::GetInstance().GetCommissioningWindowManager().GetOpenerVendorId()); } default: break; @@ -113,8 +101,7 @@ bool emberAfAdministratorCommissioningClusterOpenCommissioningWindowCallback( VerifyOrExit(fabricInfo != nullptr, status.Emplace(StatusCode::EMBER_ZCL_STATUS_CODE_PAKE_PARAMETER_ERROR)); VerifyOrExit(failSafeContext.IsFailSafeFullyDisarmed(), status.Emplace(StatusCode::EMBER_ZCL_STATUS_CODE_BUSY)); - VerifyOrExit(commissionMgr.CommissioningWindowStatus() == CommissioningWindowStatus::kWindowNotOpen, - status.Emplace(StatusCode::EMBER_ZCL_STATUS_CODE_BUSY)); + VerifyOrExit(!commissionMgr.IsCommissioningWindowOpen(), status.Emplace(StatusCode::EMBER_ZCL_STATUS_CODE_BUSY)); VerifyOrExit(iterations >= kSpake2p_Min_PBKDF_Iterations, status.Emplace(StatusCode::EMBER_ZCL_STATUS_CODE_PAKE_PARAMETER_ERROR)); VerifyOrExit(iterations <= kSpake2p_Max_PBKDF_Iterations, @@ -131,14 +118,11 @@ bool emberAfAdministratorCommissioningClusterOpenCommissioningWindowCallback( VerifyOrExit(verifier.Deserialize(pakeVerifier) == CHIP_NO_ERROR, status.Emplace(StatusCode::EMBER_ZCL_STATUS_CODE_PAKE_PARAMETER_ERROR)); - VerifyOrExit(commissionMgr.OpenEnhancedCommissioningWindow(commissioningTimeout, discriminator, verifier, iterations, salt) == - CHIP_NO_ERROR, + VerifyOrExit(commissionMgr.OpenEnhancedCommissioningWindow(commissioningTimeout, discriminator, verifier, iterations, salt, + fabricIndex, fabricInfo->GetVendorId()) == CHIP_NO_ERROR, status.Emplace(StatusCode::EMBER_ZCL_STATUS_CODE_PAKE_PARAMETER_ERROR)); ChipLogProgress(Zcl, "Commissioning window is now open"); - gAdminCommissioningAttrAccess.mFabricIndex = fabricIndex; - gAdminCommissioningAttrAccess.mVendorId = fabricInfo->GetVendorId(); - exit: if (status.HasValue()) { @@ -174,21 +158,17 @@ bool emberAfAdministratorCommissioningClusterOpenBasicCommissioningWindowCallbac VerifyOrExit(fabricInfo != nullptr, status.Emplace(StatusCode::EMBER_ZCL_STATUS_CODE_PAKE_PARAMETER_ERROR)); - VerifyOrExit(commissionMgr.CommissioningWindowStatus() == CommissioningWindowStatus::kWindowNotOpen, - status.Emplace(StatusCode::EMBER_ZCL_STATUS_CODE_BUSY)); + VerifyOrExit(!commissionMgr.IsCommissioningWindowOpen(), status.Emplace(StatusCode::EMBER_ZCL_STATUS_CODE_BUSY)); VerifyOrExit(failSafeContext.IsFailSafeFullyDisarmed(), status.Emplace(StatusCode::EMBER_ZCL_STATUS_CODE_BUSY)); VerifyOrExit(commissioningTimeout <= commissionMgr.MaxCommissioningTimeout(), globalStatus = InteractionModel::Status::InvalidCommand); VerifyOrExit(commissioningTimeout >= commissionMgr.MinCommissioningTimeout(), globalStatus = InteractionModel::Status::InvalidCommand); - VerifyOrExit(commissionMgr.OpenBasicCommissioningWindow(commissioningTimeout, CommissioningWindowAdvertisement::kDnssdOnly) == - CHIP_NO_ERROR, + VerifyOrExit(commissionMgr.OpenBasicCommissioningWindowForAdministratorCommissioningCluster( + commissioningTimeout, fabricIndex, fabricInfo->GetVendorId()) == CHIP_NO_ERROR, status.Emplace(StatusCode::EMBER_ZCL_STATUS_CODE_PAKE_PARAMETER_ERROR)); ChipLogProgress(Zcl, "Commissioning window is now open"); - gAdminCommissioningAttrAccess.mFabricIndex = fabricIndex; - gAdminCommissioningAttrAccess.mVendorId = fabricInfo->GetVendorId(); - exit: if (status.HasValue()) { @@ -213,8 +193,7 @@ bool emberAfAdministratorCommissioningClusterRevokeCommissioningCallback( { ChipLogProgress(Zcl, "Received command to close commissioning window"); - if (Server::GetInstance().GetCommissioningWindowManager().CommissioningWindowStatus() == - CommissioningWindowStatus::kWindowNotOpen) + if (!Server::GetInstance().GetCommissioningWindowManager().IsCommissioningWindowOpen()) { ChipLogError(Zcl, "Commissioning window is currently not open"); commandObj->AddClusterSpecificFailure(commandPath, StatusCode::EMBER_ZCL_STATUS_CODE_WINDOW_NOT_OPEN); diff --git a/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp b/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp index a4eddf662406b0..8e31c4ec720ce6 100644 --- a/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp +++ b/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp @@ -178,8 +178,7 @@ bool emberAfGeneralCommissioningClusterArmFailSafeCallback(app::CommandHandler * // We do not allow CASE connections to arm the failsafe for the first time while the commissioning window is open in order // to allow commissioners the opportunity to obtain this failsafe for the purpose of commissioning if (!failSafeContext.IsFailSafeArmed() && - Server::GetInstance().GetCommissioningWindowManager().CommissioningWindowStatus() != - AdministratorCommissioning::CommissioningWindowStatus::kWindowNotOpen && + Server::GetInstance().GetCommissioningWindowManager().IsCommissioningWindowOpen() && commandObj->GetSubjectDescriptor().authMode == Access::AuthMode::kCase) { response.errorCode = CommissioningError::kBusyWithOtherAdmin; diff --git a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp index b2777dff5f338b..a1951498b6a174 100644 --- a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp +++ b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp @@ -177,7 +177,7 @@ CHIP_ERROR OperationalCredentialsAttrAccess::ReadFabricsList(EndpointId endpoint fabricDescriptor.fabricIndex = fabricIndex; fabricDescriptor.nodeId = fabricInfo.GetPeerId().GetNodeId(); - fabricDescriptor.vendorId = static_cast(fabricInfo.GetVendorId()); + fabricDescriptor.vendorId = fabricInfo.GetVendorId(); fabricDescriptor.fabricId = fabricInfo.GetFabricId(); fabricDescriptor.label = fabricInfo.GetFabricLabel(); diff --git a/src/app/server/CommissioningWindowManager.cpp b/src/app/server/CommissioningWindowManager.cpp index eaea53d90ec00d..e9f3ae6350d432 100644 --- a/src/app/server/CommissioningWindowManager.cpp +++ b/src/app/server/CommissioningWindowManager.cpp @@ -27,6 +27,8 @@ using namespace chip::app::Clusters; using namespace chip::System::Clock; +using AdministratorCommissioning::CommissioningWindowStatus; + namespace { // As per specifications (Section 13.3), Nodes SHALL exit commissioning mode after 20 failed commission attempts. @@ -91,7 +93,10 @@ void CommissioningWindowManager::ResetState() mECMDiscriminator = 0; mECMIterations = 0; mECMSaltLength = 0; - mWindowStatus = app::Clusters::AdministratorCommissioning::CommissioningWindowStatus::kWindowNotOpen; + mWindowStatus = CommissioningWindowStatus::kWindowNotOpen; + + mOpenerFabricIndex.SetNull(); + mOpenerVendorId.SetNull(); memset(&mECMPASEVerifier, 0, sizeof(mECMPASEVerifier)); memset(mECMSalt, 0, sizeof(mECMSalt)); @@ -276,9 +281,21 @@ CHIP_ERROR CommissioningWindowManager::OpenBasicCommissioningWindow(Seconds16 co return err; } +CHIP_ERROR +CommissioningWindowManager::OpenBasicCommissioningWindowForAdministratorCommissioningCluster( + System::Clock::Seconds16 commissioningTimeout, FabricIndex fabricIndex, VendorId vendorId) +{ + ReturnErrorOnFailure(OpenBasicCommissioningWindow(commissioningTimeout, CommissioningWindowAdvertisement::kDnssdOnly)); + + mOpenerFabricIndex.SetNonNull(fabricIndex); + mOpenerVendorId.SetNonNull(vendorId); + + return CHIP_NO_ERROR; +} + CHIP_ERROR CommissioningWindowManager::OpenEnhancedCommissioningWindow(Seconds16 commissioningTimeout, uint16_t discriminator, Spake2pVerifier & verifier, uint32_t iterations, - ByteSpan salt) + ByteSpan salt, FabricIndex fabricIndex, VendorId vendorId) { // Once a device is operational, it shall be commissioned into subsequent fabrics using // the operational network only. @@ -303,12 +320,18 @@ CHIP_ERROR CommissioningWindowManager::OpenEnhancedCommissioningWindow(Seconds16 { Cleanup(); } + else + { + mOpenerFabricIndex.SetNonNull(fabricIndex); + mOpenerVendorId.SetNonNull(vendorId); + } + return err; } void CommissioningWindowManager::CloseCommissioningWindow() { - if (mWindowStatus != AdministratorCommissioning::CommissioningWindowStatus::kWindowNotOpen) + if (IsCommissioningWindowOpen()) { #if CONFIG_NETWORK_LAYER_BLE if (mListeningForPASE) @@ -324,6 +347,31 @@ void CommissioningWindowManager::CloseCommissioningWindow() } } +CommissioningWindowStatus CommissioningWindowManager::CommissioningWindowStatusForCluster() const +{ + if (mOpenerVendorId.IsNull()) + { + // Not opened via the cluster. + return CommissioningWindowStatus::kWindowNotOpen; + } + + return mWindowStatus; +} + +bool CommissioningWindowManager::IsCommissioningWindowOpen() const +{ + return mWindowStatus != CommissioningWindowStatus::kWindowNotOpen; +} + +void CommissioningWindowManager::OnFabricRemoved(FabricIndex removedIndex) +{ + if (!mOpenerFabricIndex.IsNull() && mOpenerFabricIndex.Value() == removedIndex) + { + // Per spec, we should clear out the stale fabric index. + mOpenerFabricIndex.SetNull(); + } +} + Dnssd::CommissioningMode CommissioningWindowManager::GetCommissioningMode() const { if (!mListeningForPASE) @@ -336,9 +384,9 @@ Dnssd::CommissioningMode CommissioningWindowManager::GetCommissioningMode() cons switch (mWindowStatus) { - case AdministratorCommissioning::CommissioningWindowStatus::kEnhancedWindowOpen: + case CommissioningWindowStatus::kEnhancedWindowOpen: return Dnssd::CommissioningMode::kEnabledEnhanced; - case AdministratorCommissioning::CommissioningWindowStatus::kBasicWindowOpen: + case CommissioningWindowStatus::kBasicWindowOpen: return Dnssd::CommissioningMode::kEnabledBasic; default: return Dnssd::CommissioningMode::kDisabled; @@ -353,7 +401,7 @@ CHIP_ERROR CommissioningWindowManager::StartAdvertisement() #endif #if CHIP_DEVICE_CONFIG_ENABLE_SED - if (!mIsBLE && mWindowStatus == AdministratorCommissioning::CommissioningWindowStatus::kWindowNotOpen) + if (!mIsBLE && !IsCommissioningWindowOpen()) { DeviceLayer::ConnectivityMgr().RequestSEDActiveMode(true); } @@ -376,11 +424,11 @@ CHIP_ERROR CommissioningWindowManager::StartAdvertisement() if (mUseECM) { - mWindowStatus = AdministratorCommissioning::CommissioningWindowStatus::kEnhancedWindowOpen; + mWindowStatus = CommissioningWindowStatus::kEnhancedWindowOpen; } else { - mWindowStatus = AdministratorCommissioning::CommissioningWindowStatus::kBasicWindowOpen; + mWindowStatus = CommissioningWindowStatus::kBasicWindowOpen; } if (mAppDelegate != nullptr) @@ -403,7 +451,7 @@ CHIP_ERROR CommissioningWindowManager::StopAdvertisement(bool aShuttingDown) mPairingSession.Clear(); #if CHIP_DEVICE_CONFIG_ENABLE_SED - if (!mIsBLE && mWindowStatus != AdministratorCommissioning::CommissioningWindowStatus::kWindowNotOpen) + if (!mIsBLE && IsCommissioningWindowOpen()) { DeviceLayer::ConnectivityMgr().RequestSEDActiveMode(false); } diff --git a/src/app/server/CommissioningWindowManager.h b/src/app/server/CommissioningWindowManager.h index d5a03461de6d18..9381a2c3c653c8 100644 --- a/src/app/server/CommissioningWindowManager.h +++ b/src/app/server/CommissioningWindowManager.h @@ -18,8 +18,11 @@ #pragma once #include +#include #include #include +#include +#include #include #include #include @@ -74,14 +77,31 @@ class CommissioningWindowManager : public SessionEstablishmentDelegate, System::Clock::Seconds16 commissioningTimeout = System::Clock::Seconds16(CHIP_DEVICE_CONFIG_DISCOVERY_TIMEOUT_SECS), CommissioningWindowAdvertisement advertisementMode = chip::CommissioningWindowAdvertisement::kAllSupported); + /** + * Open the pairing window using default configured parameters, triggered by + * the Administrator Commmissioning cluster implementation. + */ + CHIP_ERROR + OpenBasicCommissioningWindowForAdministratorCommissioningCluster(System::Clock::Seconds16 commissioningTimeout, + FabricIndex fabricIndex, VendorId vendorId); + CHIP_ERROR OpenEnhancedCommissioningWindow(System::Clock::Seconds16 commissioningTimeout, uint16_t discriminator, - Spake2pVerifier & verifier, uint32_t iterations, chip::ByteSpan salt); + Spake2pVerifier & verifier, uint32_t iterations, chip::ByteSpan salt, + FabricIndex fabricIndex, VendorId vendorId); void CloseCommissioningWindow(); - app::Clusters::AdministratorCommissioning::CommissioningWindowStatus CommissioningWindowStatus() const { return mWindowStatus; } + app::Clusters::AdministratorCommissioning::CommissioningWindowStatus CommissioningWindowStatusForCluster() const; + + bool IsCommissioningWindowOpen() const; - // CommissioningModeProvider implemetation. + const app::DataModel::Nullable & GetOpenerVendorId() const { return mOpenerVendorId; } + + const app::DataModel::Nullable & GetOpenerFabricIndex() const { return mOpenerFabricIndex; } + + void OnFabricRemoved(FabricIndex removedIndex); + + // CommissioningModeProvider implementation. Dnssd::CommissioningMode GetCommissioningMode() const override; //////////// SessionEstablishmentDelegate Implementation /////////////// @@ -181,6 +201,13 @@ class CommissioningWindowManager : public SessionEstablishmentDelegate, // The PASE session we are using, so we can handle CloseSession properly. SessionHolderWithDelegate mPASESession; + + // Information about who opened the commissioning window. These will only + // be non-null if the window was opened via the operational credentials + // cluster and the fabric index may be null even then if the fabric has been + // removed. + app::DataModel::Nullable mOpenerVendorId; + app::DataModel::Nullable mOpenerFabricIndex; }; } // namespace chip diff --git a/src/app/server/Server.h b/src/app/server/Server.h index 9ef21431d9772b..9f99b32c915124 100644 --- a/src/app/server/Server.h +++ b/src/app/server/Server.h @@ -447,6 +447,8 @@ class Server ChipLogError(AppServer, "Warning, failed to delete access control state for fabric index 0x%x: %" CHIP_ERROR_FORMAT, static_cast(fabricIndex), aclErr.Format()); } + + mServer->GetCommissioningWindowManager().OnFabricRemoved(fabricIndex); } void OnFabricUpdated(const FabricTable & fabricTable, chip::FabricIndex fabricIndex) override diff --git a/src/app/tests/TestCommissionManager.cpp b/src/app/tests/TestCommissionManager.cpp index 159b50b6ba3d49..580b62ef099c35 100644 --- a/src/app/tests/TestCommissionManager.cpp +++ b/src/app/tests/TestCommissionManager.cpp @@ -90,14 +90,15 @@ void CheckCommissioningWindowManagerBasicWindowOpenCloseTask(intptr_t context) CHIP_ERROR err = commissionMgr.OpenBasicCommissioningWindow(commissionMgr.MaxCommissioningTimeout(), CommissioningWindowAdvertisement::kDnssdOnly); NL_TEST_ASSERT(suite, err == CHIP_NO_ERROR); + NL_TEST_ASSERT(suite, commissionMgr.IsCommissioningWindowOpen()); NL_TEST_ASSERT(suite, - commissionMgr.CommissioningWindowStatus() == - chip::app::Clusters::AdministratorCommissioning::CommissioningWindowStatus::kBasicWindowOpen); + commissionMgr.CommissioningWindowStatusForCluster() == + chip::app::Clusters::AdministratorCommissioning::CommissioningWindowStatus::kWindowNotOpen); + NL_TEST_ASSERT(suite, commissionMgr.GetOpenerFabricIndex().IsNull()); + NL_TEST_ASSERT(suite, commissionMgr.GetOpenerVendorId().IsNull()); NL_TEST_ASSERT(suite, !chip::DeviceLayer::ConnectivityMgr().IsBLEAdvertisingEnabled()); commissionMgr.CloseCommissioningWindow(); - NL_TEST_ASSERT(suite, - commissionMgr.CommissioningWindowStatus() == - chip::app::Clusters::AdministratorCommissioning::CommissioningWindowStatus::kWindowNotOpen); + NL_TEST_ASSERT(suite, !commissionMgr.IsCommissioningWindowOpen()); } void CheckCommissioningWindowManagerBasicWindowOpenClose(nlTestSuite * suite, void *) @@ -107,12 +108,44 @@ void CheckCommissioningWindowManagerBasicWindowOpenClose(nlTestSuite * suite, vo sleep(kTestTaskWaitSeconds); } +void CheckCommissioningWindowManagerBasicWindowOpenCloseFromClusterTask(intptr_t context) +{ + nlTestSuite * suite = reinterpret_cast(context); + CommissioningWindowManager & commissionMgr = Server::GetInstance().GetCommissioningWindowManager(); + constexpr auto fabricIndex = static_cast(1); + constexpr auto vendorId = static_cast(0xFFF3); + CHIP_ERROR err = commissionMgr.OpenBasicCommissioningWindowForAdministratorCommissioningCluster( + commissionMgr.MaxCommissioningTimeout(), fabricIndex, vendorId); + NL_TEST_ASSERT(suite, err == CHIP_NO_ERROR); + NL_TEST_ASSERT(suite, commissionMgr.IsCommissioningWindowOpen()); + NL_TEST_ASSERT(suite, + commissionMgr.CommissioningWindowStatusForCluster() == + chip::app::Clusters::AdministratorCommissioning::CommissioningWindowStatus::kBasicWindowOpen); + NL_TEST_ASSERT(suite, !commissionMgr.GetOpenerFabricIndex().IsNull()); + NL_TEST_ASSERT(suite, commissionMgr.GetOpenerFabricIndex().Value() == fabricIndex); + NL_TEST_ASSERT(suite, !commissionMgr.GetOpenerVendorId().IsNull()); + NL_TEST_ASSERT(suite, commissionMgr.GetOpenerVendorId().Value() == vendorId); + NL_TEST_ASSERT(suite, !chip::DeviceLayer::ConnectivityMgr().IsBLEAdvertisingEnabled()); + commissionMgr.CloseCommissioningWindow(); + NL_TEST_ASSERT(suite, !commissionMgr.IsCommissioningWindowOpen()); + NL_TEST_ASSERT(suite, commissionMgr.GetOpenerFabricIndex().IsNull()); + NL_TEST_ASSERT(suite, commissionMgr.GetOpenerVendorId().IsNull()); +} + +void CheckCommissioningWindowManagerBasicWindowOpenCloseFromCluster(nlTestSuite * suite, void *) +{ + chip::DeviceLayer::PlatformMgr().ScheduleWork(CheckCommissioningWindowManagerBasicWindowOpenCloseFromClusterTask, + reinterpret_cast(suite)); + sleep(kTestTaskWaitSeconds); +} + void CheckCommissioningWindowManagerWindowClosedTask(chip::System::Layer *, void * context) { nlTestSuite * suite = static_cast(context); CommissioningWindowManager & commissionMgr = Server::GetInstance().GetCommissioningWindowManager(); + NL_TEST_ASSERT(suite, !commissionMgr.IsCommissioningWindowOpen()); NL_TEST_ASSERT(suite, - commissionMgr.CommissioningWindowStatus() == + commissionMgr.CommissioningWindowStatusForCluster() == chip::app::Clusters::AdministratorCommissioning::CommissioningWindowStatus::kWindowNotOpen); } @@ -126,9 +159,10 @@ void CheckCommissioningWindowManagerWindowTimeoutTask(intptr_t context) commissionMgr.OverrideMinCommissioningTimeout(kTimeoutSeconds); CHIP_ERROR err = commissionMgr.OpenBasicCommissioningWindow(kTimeoutSeconds, CommissioningWindowAdvertisement::kDnssdOnly); NL_TEST_ASSERT(suite, err == CHIP_NO_ERROR); + NL_TEST_ASSERT(suite, commissionMgr.IsCommissioningWindowOpen()); NL_TEST_ASSERT(suite, - commissionMgr.CommissioningWindowStatus() == - chip::app::Clusters::AdministratorCommissioning::CommissioningWindowStatus::kBasicWindowOpen); + commissionMgr.CommissioningWindowStatusForCluster() == + chip::app::Clusters::AdministratorCommissioning::CommissioningWindowStatus::kWindowNotOpen); NL_TEST_ASSERT(suite, !chip::DeviceLayer::ConnectivityMgr().IsBLEAdvertisingEnabled()); chip::DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Milliseconds32(kTimeoutMs + kSleepPadding), CheckCommissioningWindowManagerWindowClosedTask, suite); @@ -145,13 +179,15 @@ void SimulateFailedSessionEstablishmentTask(chip::System::Layer *, void * contex { nlTestSuite * suite = static_cast(context); CommissioningWindowManager & commissionMgr = Server::GetInstance().GetCommissioningWindowManager(); + NL_TEST_ASSERT(suite, commissionMgr.IsCommissioningWindowOpen()); NL_TEST_ASSERT(suite, - commissionMgr.CommissioningWindowStatus() != + commissionMgr.CommissioningWindowStatusForCluster() == chip::app::Clusters::AdministratorCommissioning::CommissioningWindowStatus::kWindowNotOpen); commissionMgr.OnSessionEstablishmentStarted(); commissionMgr.OnSessionEstablishmentError(CHIP_ERROR_INTERNAL); + NL_TEST_ASSERT(suite, commissionMgr.IsCommissioningWindowOpen()); NL_TEST_ASSERT(suite, - commissionMgr.CommissioningWindowStatus() != + commissionMgr.CommissioningWindowStatusForCluster() == chip::app::Clusters::AdministratorCommissioning::CommissioningWindowStatus::kWindowNotOpen); } @@ -164,9 +200,10 @@ void CheckCommissioningWindowManagerWindowTimeoutWithSessionEstablishmentErrorsT constexpr unsigned kSleepPadding = 100; CHIP_ERROR err = commissionMgr.OpenBasicCommissioningWindow(kTimeoutSeconds, CommissioningWindowAdvertisement::kDnssdOnly); NL_TEST_ASSERT(suite, err == CHIP_NO_ERROR); + NL_TEST_ASSERT(suite, commissionMgr.IsCommissioningWindowOpen()); NL_TEST_ASSERT(suite, - commissionMgr.CommissioningWindowStatus() == - chip::app::Clusters::AdministratorCommissioning::CommissioningWindowStatus::kBasicWindowOpen); + commissionMgr.CommissioningWindowStatusForCluster() == + chip::app::Clusters::AdministratorCommissioning::CommissioningWindowStatus::kWindowNotOpen); NL_TEST_ASSERT(suite, !chip::DeviceLayer::ConnectivityMgr().IsBLEAdvertisingEnabled()); chip::DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Milliseconds32(kTimeoutMs + kSleepPadding), CheckCommissioningWindowManagerWindowClosedTask, suite); @@ -196,18 +233,28 @@ void CheckCommissioningWindowManagerEnhancedWindowTask(intptr_t context) uint8_t salt[chip::kSpake2p_Min_PBKDF_Salt_Length]; chip::ByteSpan saltData(salt); + constexpr auto fabricIndex = static_cast(1); + constexpr auto vendorId = static_cast(0xFFF3); err = commissionMgr.OpenEnhancedCommissioningWindow(commissionMgr.MaxCommissioningTimeout(), newDiscriminator, verifier, - kIterations, saltData); + kIterations, saltData, fabricIndex, vendorId); NL_TEST_ASSERT(suite, err == CHIP_NO_ERROR); + NL_TEST_ASSERT(suite, commissionMgr.IsCommissioningWindowOpen()); NL_TEST_ASSERT(suite, - commissionMgr.CommissioningWindowStatus() == + commissionMgr.CommissioningWindowStatusForCluster() == chip::app::Clusters::AdministratorCommissioning::CommissioningWindowStatus::kEnhancedWindowOpen); NL_TEST_ASSERT(suite, !chip::DeviceLayer::ConnectivityMgr().IsBLEAdvertisingEnabled()); + NL_TEST_ASSERT(suite, !commissionMgr.GetOpenerFabricIndex().IsNull()); + NL_TEST_ASSERT(suite, commissionMgr.GetOpenerFabricIndex().Value() == fabricIndex); + NL_TEST_ASSERT(suite, !commissionMgr.GetOpenerVendorId().IsNull()); + NL_TEST_ASSERT(suite, commissionMgr.GetOpenerVendorId().Value() == vendorId); commissionMgr.CloseCommissioningWindow(); + NL_TEST_ASSERT(suite, !commissionMgr.IsCommissioningWindowOpen()); NL_TEST_ASSERT(suite, - commissionMgr.CommissioningWindowStatus() == + commissionMgr.CommissioningWindowStatusForCluster() == chip::app::Clusters::AdministratorCommissioning::CommissioningWindowStatus::kWindowNotOpen); + NL_TEST_ASSERT(suite, commissionMgr.GetOpenerFabricIndex().IsNull()); + NL_TEST_ASSERT(suite, commissionMgr.GetOpenerVendorId().IsNull()); } void CheckCommissioningWindowManagerEnhancedWindow(nlTestSuite * suite, void *) @@ -225,6 +272,8 @@ void TearDownTask(intptr_t context) const nlTest sTests[] = { NL_TEST_DEF("CheckCommissioningWindowManagerEnhancedWindow", CheckCommissioningWindowManagerEnhancedWindow), NL_TEST_DEF("CheckCommissioningWindowManagerBasicWindowOpenClose", CheckCommissioningWindowManagerBasicWindowOpenClose), + NL_TEST_DEF("CheckCommissioningWindowManagerBasicWindowOpenCloseFromCluster", + CheckCommissioningWindowManagerBasicWindowOpenCloseFromCluster), NL_TEST_DEF("CheckCommissioningWindowManagerWindowTimeout", CheckCommissioningWindowManagerWindowTimeout), NL_TEST_DEF("CheckCommissioningWindowManagerWindowTimeoutWithSessionEstablishmentErrors", CheckCommissioningWindowManagerWindowTimeoutWithSessionEstablishmentErrors), diff --git a/src/app/tests/suites/TestCommissioningWindow.yaml b/src/app/tests/suites/TestCommissioningWindow.yaml new file mode 100644 index 00000000000000..bade4a257f8dfb --- /dev/null +++ b/src/app/tests/suites/TestCommissioningWindow.yaml @@ -0,0 +1,233 @@ +# Copyright (c) 2022 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Test Commissioning Window + +config: + nodeId: 0x12344321 + nodeId2: + type: node_id + defaultValue: 0xCAFE + endpoint: 0 + cluster: "AdministratorCommissioning" + discriminator: + type: int16u + defaultValue: 3840 + payload: + type: char_string + defaultValue: "MT:-24J0AFN00KA0648G00" # This value needs to be generated automatically + alphaIndex: + type: int8u + defaultValue: 1 + betaIndex: + type: int8u + defaultValue: 2 + +tests: + - label: "Wait for the commissioned device to be retrieved for alpha" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Get alpha's fabric index" + cluster: "Operational Credentials" + command: "readAttribute" + attribute: "CurrentFabricIndex" + response: + # We could saveAs here, but then when we try to compare to it later + # the nullable-vs-non-nullable compare fails to work right. For now + # just use a config variable. + value: alphaIndex + + - label: "Check that commissioning window is not open" + command: "readAttribute" + attribute: "WindowStatus" + response: + value: 0 + + - label: "Check that there is no AdminFabricIndex" + command: "readAttribute" + attribute: "AdminFabricIndex" + response: + value: null + + - label: "Check that there is no AdminVendorId" + command: "readAttribute" + attribute: "AdminVendorId" + response: + value: null + + - label: "Open Commissioning Window from alpha" + command: "OpenBasicCommissioningWindow" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "CommissioningTimeout" + value: 180 + + - label: "Check that commissioning window is open" + command: "readAttribute" + attribute: "WindowStatus" + response: + value: 2 + + - label: "Check the AdminFabricIndex" + command: "readAttribute" + attribute: "AdminFabricIndex" + response: + value: alphaIndex + + - label: "Check the AdminVendorId is not null" + command: "readAttribute" + attribute: "AdminVendorId" + response: + constraints: + notValue: null + + - label: "Close Commissioning Window" + command: "RevokeCommissioning" + timedInteractionTimeoutMs: 10000 + + - label: "Check that commissioning window is again not open" + command: "readAttribute" + attribute: "WindowStatus" + response: + value: 0 + + - label: "Check that again there is no AdminFabricIndex" + command: "readAttribute" + attribute: "AdminFabricIndex" + response: + value: null + + - label: "Check that again there is no AdminVendorId" + command: "readAttribute" + attribute: "AdminVendorId" + response: + value: null + + - label: "Open Commissioning Window from alpha again" + command: "OpenBasicCommissioningWindow" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "CommissioningTimeout" + value: 180 + + - label: "Commission from beta" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithCode" + arguments: + values: + - name: "nodeId" + value: nodeId2 + - name: "payload" + value: payload + + - label: "Wait for the commissioned device to be retrieved for beta" + identity: "beta" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId2 + + - label: "Check that commissioning window is not open for the third time" + command: "readAttribute" + attribute: "WindowStatus" + response: + value: 0 + + - label: "Check that there is no AdminFabricIndex for the third time" + command: "readAttribute" + attribute: "AdminFabricIndex" + response: + value: null + + - label: "Check that there is no AdminVendorId for the third time" + command: "readAttribute" + attribute: "AdminVendorId" + response: + value: null + + - label: "Get beta's fabric index" + identity: "beta" + cluster: "Operational Credentials" + command: "readAttribute" + attribute: "CurrentFabricIndex" + response: + # We could saveAs here, but then when we try to compare to it later + # the nullable-vs-non-nullable compare fails to work right. For now + # just use a config variable. + value: betaIndex + + - label: "Open Commissioning Window from beta" + identity: "beta" + command: "OpenBasicCommissioningWindow" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "CommissioningTimeout" + value: 180 + + - label: "Check that commissioning window is open again" + command: "readAttribute" + attribute: "WindowStatus" + response: + value: 2 + + - label: "Check the AdminFabricIndex again" + command: "readAttribute" + attribute: "AdminFabricIndex" + response: + value: betaIndex + + - label: "Check the AdminVendorId is not null again" + command: "readAttribute" + attribute: "AdminVendorId" + response: + saveAs: adminVendorId + constraints: + notValue: null + + - label: "Remove beta fabric" + cluster: "Operational Credentials" + command: "RemoveFabric" + arguments: + values: + - name: "FabricIndex" + value: betaIndex + + - label: "Check that commissioning window is still open" + command: "readAttribute" + attribute: "WindowStatus" + response: + value: 2 + + - label: "Check the AdminFabricIndex got reset" + command: "readAttribute" + attribute: "AdminFabricIndex" + response: + value: null + + - label: "Check the AdminVendorId did not get reset" + command: "readAttribute" + attribute: "AdminVendorId" + response: + value: adminVendorId diff --git a/src/app/tests/suites/tests.js b/src/app/tests/suites/tests.js index b869f8db1b4a8e..384d4cb855e5a1 100644 --- a/src/app/tests/suites/tests.js +++ b/src/app/tests/suites/tests.js @@ -838,7 +838,8 @@ function getTests() { "TestArmFailSafe", "TestFanControl", "TestAccessControlConstraints", - "TestLevelControlWithOnOffDependency" + "TestLevelControlWithOnOffDependency", + "TestCommissioningWindow", ]; const MultiAdmin = [ diff --git a/src/app/zap-templates/zcl/data-model/chip/administrator-commissioning-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/administrator-commissioning-cluster.xml index 6f365e2e58fdb8..3f50632bc78ebb 100644 --- a/src/app/zap-templates/zcl/data-model/chip/administrator-commissioning-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/administrator-commissioning-cluster.xml @@ -39,8 +39,8 @@ limitations under the License. Commands to trigger a Node to allow a new Administrator to commission it. WindowStatus - AdminFabricIndex - AdminVendorId + AdminFabricIndex + AdminVendorId This command is used by a current Administrator to instruct a Node to go into commissioning mode using enhanced commissioning method. diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index d423ab0497bdf8..608a505dfba584 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -1749,8 +1749,8 @@ client cluster AdministratorCommissioning = 60 { } readonly attribute int8u windowStatus = 0; - readonly attribute fabric_idx adminFabricIndex = 1; - readonly attribute int16u adminVendorId = 2; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable int16u adminVendorId = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute attrib_id attributeList[] = 65531; diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index c21a0947ccea70..3936870728ecb3 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -8050,10 +8050,17 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - cppValue, value); + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue.Value(), value); + } return value; } case Attributes::AdminVendorId::Id: { @@ -8065,10 +8072,17 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - cppValue, value); + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue.Value(), value); + } return value; } case Attributes::GeneratedCommandList::Id: { diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index 2cf7e3f32c7e26..f961ba0f5f2e4b 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -11699,7 +11699,8 @@ CHIPAdministratorCommissioningAdminFabricIndexAttributeCallback::~CHIPAdministra env->DeleteGlobalRef(javaCallbackRef); } -void CHIPAdministratorCommissioningAdminFabricIndexAttributeCallback::CallbackFn(void * context, chip::FabricIndex value) +void CHIPAdministratorCommissioningAdminFabricIndexAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::Nullable & value) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -11720,10 +11721,84 @@ void CHIPAdministratorCommissioningAdminFabricIndexAttributeCallback::CallbackFn VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); jobject javaValue; - std::string javaValueClassName = "java/lang/Integer"; - std::string javaValueCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), value, - javaValue); + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Integer"; + std::string javaValueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + value.Value(), javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPAdministratorCommissioningAdminVendorIdAttributeCallback::CHIPAdministratorCommissioningAdminVendorIdAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPAdministratorCommissioningAdminVendorIdAttributeCallback::~CHIPAdministratorCommissioningAdminVendorIdAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPAdministratorCommissioningAdminVendorIdAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::Nullable & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Integer"; + std::string javaValueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + value.Value(), javaValue); + } env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); } diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.h b/src/controller/java/zap-generated/CHIPReadCallbacks.h index 992e58ddaf34de..e42488c4ae722b 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.h +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.h @@ -4856,7 +4856,7 @@ class CHIPAdministratorCommissioningAdminFabricIndexAttributeCallback } } - static void CallbackFn(void * context, chip::FabricIndex value); + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); static void OnSubscriptionEstablished(void * context) { CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( @@ -4869,6 +4869,36 @@ class CHIPAdministratorCommissioningAdminFabricIndexAttributeCallback bool keepAlive; }; +class CHIPAdministratorCommissioningAdminVendorIdAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPAdministratorCommissioningAdminVendorIdAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPAdministratorCommissioningAdminVendorIdAttributeCallback(); + + static void maybeDestroy(CHIPAdministratorCommissioningAdminVendorIdAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + class CHIPAdministratorCommissioningGeneratedCommandListAttributeCallback : public chip::Callback::Callback { diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java index 6a3e45eca10dc1..78c06ceffc3f1a 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java @@ -9651,7 +9651,15 @@ private native void revokeCommissioning( @Nullable Integer timedInvokeTimeoutMs); public interface AdminFabricIndexAttributeCallback { - void onSuccess(Integer value); + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + + default void onSubscriptionEstablished() {} + } + + public interface AdminVendorIdAttributeCallback { + void onSuccess(@Nullable Integer value); void onError(Exception ex); @@ -9700,12 +9708,12 @@ public void subscribeAdminFabricIndexAttribute( subscribeAdminFabricIndexAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readAdminVendorIdAttribute(IntegerAttributeCallback callback) { + public void readAdminVendorIdAttribute(AdminVendorIdAttributeCallback callback) { readAdminVendorIdAttribute(chipClusterPtr, callback); } public void subscribeAdminVendorIdAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { + AdminVendorIdAttributeCallback callback, int minInterval, int maxInterval) { subscribeAdminVendorIdAttribute(chipClusterPtr, callback, minInterval, maxInterval); } @@ -9770,10 +9778,13 @@ private native void subscribeAdminFabricIndexAttribute( int maxInterval); private native void readAdminVendorIdAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, AdminVendorIdAttributeCallback callback); private native void subscribeAdminVendorIdAttribute( - long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + long chipClusterPtr, + AdminVendorIdAttributeCallback callback, + int minInterval, + int maxInterval); private native void readGeneratedCommandListAttribute( long chipClusterPtr, GeneratedCommandListAttributeCallback callback); diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java index b38fa1876d9b89..fb456425b3ef85 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java @@ -5263,7 +5263,10 @@ public Map> getReadAttributeMap() { new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.AdministratorCommissioningCluster) cluster) - .readAdminVendorIdAttribute((ChipClusters.IntegerAttributeCallback) callback); + .readAdminVendorIdAttribute( + (ChipClusters.AdministratorCommissioningCluster + .AdminVendorIdAttributeCallback) + callback); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), readAdministratorCommissioningAdminVendorIdCommandParams); diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 4951b401531cdf..405c5d4200e73c 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -10791,8 +10791,8 @@ def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ ClusterObjectFieldDescriptor(Label="windowStatus", Tag=0x00000000, Type=uint), - ClusterObjectFieldDescriptor(Label="adminFabricIndex", Tag=0x00000001, Type=uint), - ClusterObjectFieldDescriptor(Label="adminVendorId", Tag=0x00000002, Type=uint), + ClusterObjectFieldDescriptor(Label="adminFabricIndex", Tag=0x00000001, Type=typing.Union[Nullable, uint]), + ClusterObjectFieldDescriptor(Label="adminVendorId", Tag=0x00000002, Type=typing.Union[Nullable, uint]), ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), @@ -10801,8 +10801,8 @@ def descriptor(cls) -> ClusterObjectDescriptor: ]) windowStatus: 'uint' = None - adminFabricIndex: 'uint' = None - adminVendorId: 'uint' = None + adminFabricIndex: 'typing.Union[Nullable, uint]' = None + adminVendorId: 'typing.Union[Nullable, uint]' = None generatedCommandList: 'typing.List[uint]' = None acceptedCommandList: 'typing.List[uint]' = None attributeList: 'typing.List[uint]' = None @@ -10916,9 +10916,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) + return ClusterObjectFieldDescriptor(Type=typing.Union[Nullable, uint]) - value: 'uint' = 0 + value: 'typing.Union[Nullable, uint]' = NullValue @dataclass class AdminVendorId(ClusterAttributeDescriptor): @@ -10932,9 +10932,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) + return ClusterObjectFieldDescriptor(Type=typing.Union[Nullable, uint]) - value: 'uint' = 0 + value: 'typing.Union[Nullable, uint]' = NullValue @dataclass class GeneratedCommandList(ClusterAttributeDescriptor): diff --git a/src/credentials/FabricTable.cpp b/src/credentials/FabricTable.cpp index b9f4952ed74968..f13a58ccae00f1 100644 --- a/src/credentials/FabricTable.cpp +++ b/src/credentials/FabricTable.cpp @@ -85,7 +85,7 @@ CHIP_ERROR FabricInfo::Init(const FabricInfo::InitParams & initParams) mFabricIndex = initParams.fabricIndex; mCompressedFabricId = initParams.compressedFabricId; mRootPublicKey = initParams.rootPublicKey; - mVendorId = initParams.vendorId; + mVendorId = static_cast(initParams.vendorId); // Deal with externally injected keys if (initParams.operationalKeypair != nullptr) @@ -664,7 +664,8 @@ CHIP_ERROR FabricTable::LoadFromStorage(FabricInfo * fabric, FabricIndex newFabr "Fabric index 0x%x was retrieved from storage. Compressed FabricId 0x" ChipLogFormatX64 ", FabricId 0x" ChipLogFormatX64 ", NodeId 0x" ChipLogFormatX64 ", VendorId 0x%04X", static_cast(fabric->GetFabricIndex()), ChipLogValueX64(fabric->GetCompressedFabricId()), - ChipLogValueX64(fabric->GetFabricId()), ChipLogValueX64(fabric->GetNodeId()), fabric->GetVendorId()); + ChipLogValueX64(fabric->GetFabricId()), ChipLogValueX64(fabric->GetNodeId()), + to_underlying(fabric->GetVendorId())); return CHIP_NO_ERROR; } @@ -788,7 +789,7 @@ FabricTable::AddOrUpdateInner(FabricIndex fabricIndex, bool isAddition, Crypto:: VerifyOrReturnError(fabricEntry != nullptr, CHIP_ERROR_NO_MEMORY); - newFabricInfo.vendorId = vendorId; + newFabricInfo.vendorId = static_cast(vendorId); newFabricInfo.fabricIndex = fabricIndex; } else diff --git a/src/credentials/FabricTable.h b/src/credentials/FabricTable.h index 068c6b98a19359..87988163d00797 100644 --- a/src/credentials/FabricTable.h +++ b/src/credentials/FabricTable.h @@ -104,7 +104,7 @@ class DLL_EXPORT FabricInfo return CHIP_NO_ERROR; } - uint16_t GetVendorId() const { return mVendorId; } + VendorId GetVendorId() const { return mVendorId; } bool IsInitialized() const { return (mFabricIndex != kUndefinedFabricIndex) && IsOperationalNodeId(mNodeId); } @@ -120,7 +120,7 @@ class DLL_EXPORT FabricInfo FabricIndex fabricIndex = kUndefinedFabricIndex; CompressedFabricId compressedFabricId = kUndefinedCompressedFabricId; Crypto::P256PublicKey rootPublicKey; - uint16_t vendorId = VendorId::NotSpecified; /**< Vendor ID for commissioner of fabric */ + VendorId vendorId = VendorId::NotSpecified; /**< Vendor ID for commissioner of fabric */ Crypto::P256Keypair * operationalKeypair = nullptr; bool hasExternallyOwnedKeypair = false; @@ -228,7 +228,7 @@ class DLL_EXPORT FabricInfo // We cache the root public key since it's used so often and costly to get. Crypto::P256PublicKey mRootPublicKey; - uint16_t mVendorId = static_cast(VendorId::NotSpecified); + VendorId mVendorId = VendorId::NotSpecified; char mFabricLabel[kFabricLabelMaxLengthInBytes + 1] = { '\0' }; #ifdef ENABLE_HSM_CASE_OPS_KEY diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index 1e7efee40675ef..2bacad574a93f8 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -6685,8 +6685,12 @@ id MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader & if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } return value; } case Attributes::AdminVendorId::Id: { @@ -6696,8 +6700,12 @@ id MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader & if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; + } return value; } case Attributes::GeneratedCommandList::Id: { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index c34aa77a252490..5b257b946f83c0 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -28821,12 +28821,13 @@ new MTRInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * suc - (void)readAttributeAdminFabricIndexWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new MTRInt8uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = AdministratorCommissioning::Attributes::AdminFabricIndex::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster->ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); - }); + new MTRNullableInt8uAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = AdministratorCommissioning::Attributes::AdminFabricIndex::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); } - (void)subscribeAttributeAdminFabricIndexWithMinInterval:(NSNumber * _Nonnull)minInterval @@ -28836,7 +28837,7 @@ - (void)subscribeAttributeAdminFabricIndexWithMinInterval:(NSNumber * _Nonnull)m reportHandler: (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { - new MTRInt8uAttributeCallbackSubscriptionBridge( + new MTRNullableInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, reportHandler, ^(Cancelable * success, Cancelable * failure) { if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { @@ -28844,11 +28845,11 @@ new MTRInt8uAttributeCallbackSubscriptionBridge( return CHIP_ERROR_INVALID_ARGUMENT; } using TypeInfo = AdministratorCommissioning::Attributes::AdminFabricIndex::TypeInfo; - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster->SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, [minInterval unsignedShortValue], [maxInterval unsignedShortValue], - MTRInt8uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, + MTRNullableInt8uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); }, @@ -28861,7 +28862,7 @@ + (void)readAttributeAdminFabricIndexWithAttributeCache:(MTRAttributeCacheContai completionHandler: (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new MTRInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + new MTRNullableInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { if (attributeCacheContainer.cppAttributeCache) { chip::app::ConcreteAttributePath path; using TypeInfo = AdministratorCommissioning::Attributes::AdminFabricIndex::TypeInfo; @@ -28870,7 +28871,7 @@ new MTRInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * suc path.mAttributeId = TypeInfo::GetAttributeId(); TypeInfo::DecodableType value; CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); if (err == CHIP_NO_ERROR) { successFn->mCall(successFn->mContext, value); } @@ -28883,12 +28884,13 @@ new MTRInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * suc - (void)readAttributeAdminVendorIdWithCompletionHandler:(void (^)( NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new MTRInt16uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = AdministratorCommissioning::Attributes::AdminVendorId::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster->ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); - }); + new MTRNullableInt16uAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = AdministratorCommissioning::Attributes::AdminVendorId::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); } - (void)subscribeAttributeAdminVendorIdWithMinInterval:(NSNumber * _Nonnull)minInterval @@ -28898,7 +28900,7 @@ - (void)subscribeAttributeAdminVendorIdWithMinInterval:(NSNumber * _Nonnull)minI reportHandler: (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { - new MTRInt16uAttributeCallbackSubscriptionBridge( + new MTRNullableInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, reportHandler, ^(Cancelable * success, Cancelable * failure) { if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { @@ -28906,11 +28908,11 @@ new MTRInt16uAttributeCallbackSubscriptionBridge( return CHIP_ERROR_INVALID_ARGUMENT; } using TypeInfo = AdministratorCommissioning::Attributes::AdminVendorId::TypeInfo; - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster->SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, [minInterval unsignedShortValue], [maxInterval unsignedShortValue], - MTRInt16uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, + MTRNullableInt16uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); }, @@ -28923,7 +28925,7 @@ + (void)readAttributeAdminVendorIdWithAttributeCache:(MTRAttributeCacheContainer completionHandler: (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + new MTRNullableInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { if (attributeCacheContainer.cppAttributeCache) { chip::app::ConcreteAttributePath path; using TypeInfo = AdministratorCommissioning::Attributes::AdminVendorId::TypeInfo; @@ -28932,7 +28934,7 @@ new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su path.mAttributeId = TypeInfo::GetAttributeId(); TypeInfo::DecodableType value; CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); if (err == CHIP_NO_ERROR) { successFn->mCall(successFn->mContext, value); } diff --git a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h index c815d6432ffbf9..7548fbe61e304d 100644 --- a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h +++ b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h @@ -707,11 +707,12 @@ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* WindowStatus */ \ - { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ - { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ + { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ diff --git a/zzz_generated/all-clusters-minimal-app/zap-generated/endpoint_config.h b/zzz_generated/all-clusters-minimal-app/zap-generated/endpoint_config.h index ea5df11f3c0d4e..71b0daecd3c834 100644 --- a/zzz_generated/all-clusters-minimal-app/zap-generated/endpoint_config.h +++ b/zzz_generated/all-clusters-minimal-app/zap-generated/endpoint_config.h @@ -513,11 +513,12 @@ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* WindowStatus */ \ - { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ - { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ + { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp index bb816fa71b9696..f1a5cb00b53095 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp @@ -9739,7 +9739,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) namespace AdminFabricIndex { -EmberAfStatus Get(chip::EndpointId endpoint, chip::FabricIndex * value) +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { using Traits = NumericAttributeTraits; Traits::StorageType temp; @@ -9747,17 +9747,20 @@ EmberAfStatus Get(chip::EndpointId endpoint, chip::FabricIndex * value) EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::AdministratorCommissioning::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + if (Traits::IsNullValue(temp)) { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); } - *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::FabricIndex value) { using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } @@ -9768,11 +9771,31 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::FabricIndex value) ZCL_FABRIC_IDX_ATTRIBUTE_TYPE); } +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteServerAttribute(endpoint, Clusters::AdministratorCommissioning::Id, Id, writable, + ZCL_FABRIC_IDX_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + } // namespace AdminFabricIndex namespace AdminVendorId { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { using Traits = NumericAttributeTraits; Traits::StorageType temp; @@ -9780,17 +9803,20 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::AdministratorCommissioning::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + if (Traits::IsNullValue(temp)) { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); } - *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } @@ -9800,6 +9826,25 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) return emberAfWriteServerAttribute(endpoint, Clusters::AdministratorCommissioning::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteServerAttribute(endpoint, Clusters::AdministratorCommissioning::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + } // namespace AdminVendorId namespace FeatureMap { diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index 3223dd34192ddf..0effd1e4216d06 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h @@ -1709,13 +1709,17 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace WindowStatus namespace AdminFabricIndex { -EmberAfStatus Get(chip::EndpointId endpoint, chip::FabricIndex * value); // fabric_idx +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // fabric_idx EmberAfStatus Set(chip::EndpointId endpoint, chip::FabricIndex value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace AdminFabricIndex namespace AdminVendorId { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int16u EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace AdminVendorId namespace FeatureMap { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 69612378441571..d8b7a64b06450c 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -10782,9 +10782,9 @@ struct TypeInfo namespace AdminFabricIndex { struct TypeInfo { - using Type = chip::FabricIndex; - using DecodableType = chip::FabricIndex; - using DecodableArgType = chip::FabricIndex; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::AdministratorCommissioning::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AdminFabricIndex::Id; } @@ -10794,9 +10794,9 @@ struct TypeInfo namespace AdminVendorId { struct TypeInfo { - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::AdministratorCommissioning::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AdminVendorId::Id; } @@ -10842,9 +10842,9 @@ struct TypeInfo CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); - Attributes::WindowStatus::TypeInfo::DecodableType windowStatus = static_cast(0); - Attributes::AdminFabricIndex::TypeInfo::DecodableType adminFabricIndex = static_cast(0); - Attributes::AdminVendorId::TypeInfo::DecodableType adminVendorId = static_cast(0); + Attributes::WindowStatus::TypeInfo::DecodableType windowStatus = static_cast(0); + Attributes::AdminFabricIndex::TypeInfo::DecodableType adminFabricIndex; + Attributes::AdminVendorId::TypeInfo::DecodableType adminVendorId; Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; Attributes::AttributeList::TypeInfo::DecodableType attributeList; diff --git a/zzz_generated/bridge-app/zap-generated/endpoint_config.h b/zzz_generated/bridge-app/zap-generated/endpoint_config.h index 256a3c031378f1..0d077e9b56e153 100644 --- a/zzz_generated/bridge-app/zap-generated/endpoint_config.h +++ b/zzz_generated/bridge-app/zap-generated/endpoint_config.h @@ -400,11 +400,12 @@ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* WindowStatus */ \ - { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ - { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ + { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ diff --git a/zzz_generated/chef-noip_rootnode_dimmablelight_bCwGYSDpoe/zap-generated/endpoint_config.h b/zzz_generated/chef-noip_rootnode_dimmablelight_bCwGYSDpoe/zap-generated/endpoint_config.h index d2cdcf6f8f4f20..ce75db35b2ea5b 100644 --- a/zzz_generated/chef-noip_rootnode_dimmablelight_bCwGYSDpoe/zap-generated/endpoint_config.h +++ b/zzz_generated/chef-noip_rootnode_dimmablelight_bCwGYSDpoe/zap-generated/endpoint_config.h @@ -368,11 +368,12 @@ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* WindowStatus */ \ - { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ - { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ + { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ diff --git a/zzz_generated/chef-rootnode_contactsensor_lFAGG1bfRO/zap-generated/endpoint_config.h b/zzz_generated/chef-rootnode_contactsensor_lFAGG1bfRO/zap-generated/endpoint_config.h index bcc942c9abadf3..e8b412b12c52f1 100644 --- a/zzz_generated/chef-rootnode_contactsensor_lFAGG1bfRO/zap-generated/endpoint_config.h +++ b/zzz_generated/chef-rootnode_contactsensor_lFAGG1bfRO/zap-generated/endpoint_config.h @@ -377,11 +377,12 @@ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* WindowStatus */ \ - { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ - { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ + { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ diff --git a/zzz_generated/chef-rootnode_dimmablelight_bCwGYSDpoe/zap-generated/endpoint_config.h b/zzz_generated/chef-rootnode_dimmablelight_bCwGYSDpoe/zap-generated/endpoint_config.h index 7badcd7019d4dd..1debabeedae3a1 100644 --- a/zzz_generated/chef-rootnode_dimmablelight_bCwGYSDpoe/zap-generated/endpoint_config.h +++ b/zzz_generated/chef-rootnode_dimmablelight_bCwGYSDpoe/zap-generated/endpoint_config.h @@ -380,11 +380,12 @@ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* WindowStatus */ \ - { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ - { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ + { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ diff --git a/zzz_generated/chef-rootnode_doorlock_aNKYAreMXE/zap-generated/endpoint_config.h b/zzz_generated/chef-rootnode_doorlock_aNKYAreMXE/zap-generated/endpoint_config.h index 43306d47bad7d8..de7509b731d4d8 100644 --- a/zzz_generated/chef-rootnode_doorlock_aNKYAreMXE/zap-generated/endpoint_config.h +++ b/zzz_generated/chef-rootnode_doorlock_aNKYAreMXE/zap-generated/endpoint_config.h @@ -382,11 +382,12 @@ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* WindowStatus */ \ - { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ - { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ + { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ diff --git a/zzz_generated/chef-rootnode_extendedcolorlight_8lcaaYJVAa/zap-generated/endpoint_config.h b/zzz_generated/chef-rootnode_extendedcolorlight_8lcaaYJVAa/zap-generated/endpoint_config.h index e29422e7abe6e4..f100a4a282282e 100644 --- a/zzz_generated/chef-rootnode_extendedcolorlight_8lcaaYJVAa/zap-generated/endpoint_config.h +++ b/zzz_generated/chef-rootnode_extendedcolorlight_8lcaaYJVAa/zap-generated/endpoint_config.h @@ -386,11 +386,12 @@ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* WindowStatus */ \ - { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ - { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ + { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ diff --git a/zzz_generated/chef-rootnode_flowsensor_1zVxHedlaV/zap-generated/endpoint_config.h b/zzz_generated/chef-rootnode_flowsensor_1zVxHedlaV/zap-generated/endpoint_config.h index 91350e91ff9f31..f10be1ca8c11b0 100644 --- a/zzz_generated/chef-rootnode_flowsensor_1zVxHedlaV/zap-generated/endpoint_config.h +++ b/zzz_generated/chef-rootnode_flowsensor_1zVxHedlaV/zap-generated/endpoint_config.h @@ -377,11 +377,12 @@ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* WindowStatus */ \ - { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ - { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ + { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ diff --git a/zzz_generated/chef-rootnode_heatingcoolingunit_ncdGai1E5a/zap-generated/endpoint_config.h b/zzz_generated/chef-rootnode_heatingcoolingunit_ncdGai1E5a/zap-generated/endpoint_config.h index 7e8552964f48e3..b25676973f0c0a 100644 --- a/zzz_generated/chef-rootnode_heatingcoolingunit_ncdGai1E5a/zap-generated/endpoint_config.h +++ b/zzz_generated/chef-rootnode_heatingcoolingunit_ncdGai1E5a/zap-generated/endpoint_config.h @@ -383,11 +383,12 @@ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* WindowStatus */ \ - { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ - { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ + { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ diff --git a/zzz_generated/chef-rootnode_humiditysensor_Xyj4gda6Hb/zap-generated/endpoint_config.h b/zzz_generated/chef-rootnode_humiditysensor_Xyj4gda6Hb/zap-generated/endpoint_config.h index b3758058fd10cf..0f2f7167d5fdd2 100644 --- a/zzz_generated/chef-rootnode_humiditysensor_Xyj4gda6Hb/zap-generated/endpoint_config.h +++ b/zzz_generated/chef-rootnode_humiditysensor_Xyj4gda6Hb/zap-generated/endpoint_config.h @@ -377,11 +377,12 @@ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* WindowStatus */ \ - { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ - { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ + { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ diff --git a/zzz_generated/chef-rootnode_lightsensor_lZQycTFcJK/zap-generated/endpoint_config.h b/zzz_generated/chef-rootnode_lightsensor_lZQycTFcJK/zap-generated/endpoint_config.h index 237b41ab14f7f9..713d8d56b83b13 100644 --- a/zzz_generated/chef-rootnode_lightsensor_lZQycTFcJK/zap-generated/endpoint_config.h +++ b/zzz_generated/chef-rootnode_lightsensor_lZQycTFcJK/zap-generated/endpoint_config.h @@ -377,11 +377,12 @@ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* WindowStatus */ \ - { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ - { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ + { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ diff --git a/zzz_generated/chef-rootnode_occupancysensor_iHyVgifZuo/zap-generated/endpoint_config.h b/zzz_generated/chef-rootnode_occupancysensor_iHyVgifZuo/zap-generated/endpoint_config.h index 777e3e925bb60f..064f12e9f0430b 100644 --- a/zzz_generated/chef-rootnode_occupancysensor_iHyVgifZuo/zap-generated/endpoint_config.h +++ b/zzz_generated/chef-rootnode_occupancysensor_iHyVgifZuo/zap-generated/endpoint_config.h @@ -377,11 +377,12 @@ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* WindowStatus */ \ - { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ - { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ + { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ diff --git a/zzz_generated/chef-rootnode_onofflight_bbs1b7IaOV/zap-generated/endpoint_config.h b/zzz_generated/chef-rootnode_onofflight_bbs1b7IaOV/zap-generated/endpoint_config.h index 80ac5467089dad..2d023c881f671b 100644 --- a/zzz_generated/chef-rootnode_onofflight_bbs1b7IaOV/zap-generated/endpoint_config.h +++ b/zzz_generated/chef-rootnode_onofflight_bbs1b7IaOV/zap-generated/endpoint_config.h @@ -380,11 +380,12 @@ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* WindowStatus */ \ - { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ - { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ + { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ diff --git a/zzz_generated/chef-rootnode_onofflightswitch_FsPlMr090Q/zap-generated/endpoint_config.h b/zzz_generated/chef-rootnode_onofflightswitch_FsPlMr090Q/zap-generated/endpoint_config.h index b6c18a45f323e5..b751e7546f6017 100644 --- a/zzz_generated/chef-rootnode_onofflightswitch_FsPlMr090Q/zap-generated/endpoint_config.h +++ b/zzz_generated/chef-rootnode_onofflightswitch_FsPlMr090Q/zap-generated/endpoint_config.h @@ -377,11 +377,12 @@ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* WindowStatus */ \ - { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ - { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ + { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ diff --git a/zzz_generated/chef-rootnode_onoffpluginunit_Wtf8ss5EBY/zap-generated/endpoint_config.h b/zzz_generated/chef-rootnode_onoffpluginunit_Wtf8ss5EBY/zap-generated/endpoint_config.h index bbe523e4b88f85..e7d3b271d9a98e 100644 --- a/zzz_generated/chef-rootnode_onoffpluginunit_Wtf8ss5EBY/zap-generated/endpoint_config.h +++ b/zzz_generated/chef-rootnode_onoffpluginunit_Wtf8ss5EBY/zap-generated/endpoint_config.h @@ -377,11 +377,12 @@ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* WindowStatus */ \ - { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ - { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ + { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ diff --git a/zzz_generated/chef-rootnode_pressuresensor_s0qC9wLH4k/zap-generated/endpoint_config.h b/zzz_generated/chef-rootnode_pressuresensor_s0qC9wLH4k/zap-generated/endpoint_config.h index dc52e758ac44de..e58f6b8995e579 100644 --- a/zzz_generated/chef-rootnode_pressuresensor_s0qC9wLH4k/zap-generated/endpoint_config.h +++ b/zzz_generated/chef-rootnode_pressuresensor_s0qC9wLH4k/zap-generated/endpoint_config.h @@ -377,11 +377,12 @@ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* WindowStatus */ \ - { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ - { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ + { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ diff --git a/zzz_generated/chef-rootnode_speaker_RpzeXdimqA/zap-generated/endpoint_config.h b/zzz_generated/chef-rootnode_speaker_RpzeXdimqA/zap-generated/endpoint_config.h index 4d8abdc6628cae..a448a67008600a 100644 --- a/zzz_generated/chef-rootnode_speaker_RpzeXdimqA/zap-generated/endpoint_config.h +++ b/zzz_generated/chef-rootnode_speaker_RpzeXdimqA/zap-generated/endpoint_config.h @@ -377,11 +377,12 @@ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* WindowStatus */ \ - { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ - { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ + { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ diff --git a/zzz_generated/chef-rootnode_temperaturesensor_Qy1zkNW7c3/zap-generated/endpoint_config.h b/zzz_generated/chef-rootnode_temperaturesensor_Qy1zkNW7c3/zap-generated/endpoint_config.h index 9b53c9f83db383..82ecdce677bd2b 100644 --- a/zzz_generated/chef-rootnode_temperaturesensor_Qy1zkNW7c3/zap-generated/endpoint_config.h +++ b/zzz_generated/chef-rootnode_temperaturesensor_Qy1zkNW7c3/zap-generated/endpoint_config.h @@ -377,11 +377,12 @@ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* WindowStatus */ \ - { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ - { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ + { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ diff --git a/zzz_generated/chef-rootnode_thermostat_bm3fb8dhYi/zap-generated/endpoint_config.h b/zzz_generated/chef-rootnode_thermostat_bm3fb8dhYi/zap-generated/endpoint_config.h index bebb2854973bb1..fdb65f9d29957b 100644 --- a/zzz_generated/chef-rootnode_thermostat_bm3fb8dhYi/zap-generated/endpoint_config.h +++ b/zzz_generated/chef-rootnode_thermostat_bm3fb8dhYi/zap-generated/endpoint_config.h @@ -397,11 +397,12 @@ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* WindowStatus */ \ - { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ - { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ + { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ diff --git a/zzz_generated/chef-rootnode_windowcovering_RLCxaGi9Yx/zap-generated/endpoint_config.h b/zzz_generated/chef-rootnode_windowcovering_RLCxaGi9Yx/zap-generated/endpoint_config.h index a0233a76958356..4489d388a55fc6 100644 --- a/zzz_generated/chef-rootnode_windowcovering_RLCxaGi9Yx/zap-generated/endpoint_config.h +++ b/zzz_generated/chef-rootnode_windowcovering_RLCxaGi9Yx/zap-generated/endpoint_config.h @@ -377,11 +377,12 @@ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* WindowStatus */ \ - { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ - { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ + { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index 56946e74d7efe5..5915af404e2a3e 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -6212,12 +6212,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP return DataModelLogger::LogValue("WindowStatus", 1, value); } case AdministratorCommissioning::Attributes::AdminFabricIndex::Id: { - chip::FabricIndex value; + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AdminFabricIndex", 1, value); } case AdministratorCommissioning::Attributes::AdminVendorId::Id: { - uint16_t value; + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AdminVendorId", 1, value); } diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 8283ef458cfe93..e8059f3333b328 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -210,6 +210,7 @@ class TestList : public Command printf("TestFanControl\n"); printf("TestAccessControlConstraints\n"); printf("TestLevelControlWithOnOffDependency\n"); + printf("TestCommissioningWindow\n"); printf("TestMultiAdmin\n"); printf("Test_TC_DGSW_2_1\n"); printf("Test_TC_DGSW_2_2\n"); @@ -55598,6 +55599,454 @@ class TestLevelControlWithOnOffDependencySuite : public TestCommand } }; +class TestCommissioningWindowSuite : public TestCommand +{ +public: + TestCommissioningWindowSuite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TestCommissioningWindow", 28, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("nodeId2", 0, UINT64_MAX, &mNodeId2); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("cluster", &mCluster); + AddArgument("discriminator", 0, UINT16_MAX, &mDiscriminator); + AddArgument("payload", &mPayload); + AddArgument("alphaIndex", 0, UINT8_MAX, &mAlphaIndex); + AddArgument("betaIndex", 0, UINT8_MAX, &mBetaIndex); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestCommissioningWindowSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mNodeId2; + chip::Optional mEndpoint; + chip::Optional mCluster; + chip::Optional mDiscriminator; + chip::Optional mPayload; + chip::Optional mAlphaIndex; + chip::Optional mBetaIndex; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable adminVendorId; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("currentFabricIndex", value, mAlphaIndex.HasValue() ? mAlphaIndex.Value() : 1U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("windowStatus", value, 0U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("adminFabricIndex", value)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("adminVendorId", value)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("windowStatus", value, 2U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("adminFabricIndex", value)); + VerifyOrReturn( + CheckValue("adminFabricIndex.Value()", value.Value(), mAlphaIndex.HasValue() ? mAlphaIndex.Value() : 1U)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("value", value)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("windowStatus", value, 0U)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("adminFabricIndex", value)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("adminVendorId", value)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("windowStatus", value, 0U)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("adminFabricIndex", value)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("adminVendorId", value)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("currentFabricIndex", value, mBetaIndex.HasValue() ? mBetaIndex.Value() : 2U)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("windowStatus", value, 2U)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("adminFabricIndex", value)); + VerifyOrReturn( + CheckValue("adminFabricIndex.Value()", value.Value(), mBetaIndex.HasValue() ? mBetaIndex.Value() : 2U)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("value", value)); + adminVendorId = value; + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("windowStatus", value, 2U)); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("adminFabricIndex", value)); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + if (adminVendorId.IsNull()) + { + VerifyOrReturn(CheckValueNull("adminVendorId", value)); + } + else + { + VerifyOrReturn(CheckValueNonNull("adminVendorId", value)); + VerifyOrReturn(CheckValue("adminVendorId.Value()", value.Value(), adminVendorId.Value())); + } + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved for alpha"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Get alpha's fabric index"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::CurrentFabricIndex::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Check that commissioning window is not open"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::WindowStatus::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Check that there is no AdminFabricIndex"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::AdminFabricIndex::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Check that there is no AdminVendorId"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::AdminVendorId::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Open Commissioning Window from alpha"); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 6: { + LogStep(6, "Check that commissioning window is open"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::WindowStatus::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Check the AdminFabricIndex"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::AdminFabricIndex::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Check the AdminVendorId is not null"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::AdminVendorId::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Close Commissioning Window"); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::RevokeCommissioning::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::RevokeCommissioning::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 10: { + LogStep(10, "Check that commissioning window is again not open"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::WindowStatus::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Check that again there is no AdminFabricIndex"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::AdminFabricIndex::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Check that again there is no AdminVendorId"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::AdminVendorId::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Open Commissioning Window from alpha again"); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 14: { + LogStep(14, "Commission from beta"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + return PairWithCode(kIdentityBeta, value); + } + case 15: { + LogStep(15, "Wait for the commissioned device to be retrieved for beta"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + return WaitForCommissionee(kIdentityBeta, value); + } + case 16: { + LogStep(16, "Check that commissioning window is not open for the third time"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::WindowStatus::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, "Check that there is no AdminFabricIndex for the third time"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::AdminFabricIndex::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, "Check that there is no AdminVendorId for the third time"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::AdminVendorId::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, "Get beta's fabric index"); + return ReadAttribute(kIdentityBeta, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::CurrentFabricIndex::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, "Open Commissioning Window from beta"); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + return SendCommand(kIdentityBeta, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 21: { + LogStep(21, "Check that commissioning window is open again"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::WindowStatus::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, "Check the AdminFabricIndex again"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::AdminFabricIndex::Id, true, chip::NullOptional); + } + case 23: { + LogStep(23, "Check the AdminVendorId is not null again"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::AdminVendorId::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, "Remove beta fabric"); + ListFreer listFreer; + chip::app::Clusters::OperationalCredentials::Commands::RemoveFabric::Type value; + value.fabricIndex = mBetaIndex.HasValue() ? mBetaIndex.Value() : 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Commands::RemoveFabric::Id, value, chip::NullOptional + + ); + } + case 25: { + LogStep(25, "Check that commissioning window is still open"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::WindowStatus::Id, true, chip::NullOptional); + } + case 26: { + LogStep(26, "Check the AdminFabricIndex got reset"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::AdminFabricIndex::Id, true, chip::NullOptional); + } + case 27: { + LogStep(27, "Check the AdminVendorId did not get reset"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Attributes::AdminVendorId::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + class TestMultiAdminSuite : public TestCommand { public: @@ -93071,6 +93520,7 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index ea566beb398711..1c47e33e36d6f5 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -197,6 +197,7 @@ class TestList : public Command { printf("TestFanControl\n"); printf("TestAccessControlConstraints\n"); printf("TestLevelControlWithOnOffDependency\n"); + printf("TestCommissioningWindow\n"); printf("TestMultiAdmin\n"); printf("Test_TC_DGSW_2_1\n"); printf("Test_TC_DGSW_2_2\n"); @@ -95689,6 +95690,877 @@ class TestLevelControlWithOnOffDependency : public TestCommandBridge { } }; +class TestCommissioningWindow : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TestCommissioningWindow() + : TestCommandBridge("TestCommissioningWindow") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("nodeId2", 0, UINT64_MAX, &mNodeId2); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("cluster", &mCluster); + AddArgument("discriminator", 0, UINT16_MAX, &mDiscriminator); + AddArgument("payload", &mPayload); + AddArgument("alphaIndex", 0, UINT8_MAX, &mAlphaIndex); + AddArgument("betaIndex", 0, UINT8_MAX, &mBetaIndex); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~TestCommissioningWindow() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TestCommissioningWindow\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TestCommissioningWindow\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved for alpha\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrievedForAlpha_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Get alpha's fabric index\n"); + err = TestGetAlphasFabricIndex_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Check that commissioning window is not open\n"); + err = TestCheckThatCommissioningWindowIsNotOpen_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Check that there is no AdminFabricIndex\n"); + err = TestCheckThatThereIsNoAdminFabricIndex_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Check that there is no AdminVendorId\n"); + err = TestCheckThatThereIsNoAdminVendorId_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Open Commissioning Window from alpha\n"); + err = TestOpenCommissioningWindowFromAlpha_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Check that commissioning window is open\n"); + err = TestCheckThatCommissioningWindowIsOpen_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Check the AdminFabricIndex\n"); + err = TestCheckTheAdminFabricIndex_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Check the AdminVendorId is not null\n"); + err = TestCheckTheAdminVendorIdIsNotNull_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Close Commissioning Window\n"); + err = TestCloseCommissioningWindow_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Check that commissioning window is again not open\n"); + err = TestCheckThatCommissioningWindowIsAgainNotOpen_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Check that again there is no AdminFabricIndex\n"); + err = TestCheckThatAgainThereIsNoAdminFabricIndex_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Check that again there is no AdminVendorId\n"); + err = TestCheckThatAgainThereIsNoAdminVendorId_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Open Commissioning Window from alpha again\n"); + err = TestOpenCommissioningWindowFromAlphaAgain_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Commission from beta\n"); + err = TestCommissionFromBeta_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Wait for the commissioned device to be retrieved for beta\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrievedForBeta_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Check that commissioning window is not open for the third time\n"); + err = TestCheckThatCommissioningWindowIsNotOpenForTheThirdTime_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Check that there is no AdminFabricIndex for the third time\n"); + err = TestCheckThatThereIsNoAdminFabricIndexForTheThirdTime_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Check that there is no AdminVendorId for the third time\n"); + err = TestCheckThatThereIsNoAdminVendorIdForTheThirdTime_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Get beta's fabric index\n"); + err = TestGetBetasFabricIndex_19(); + break; + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : Open Commissioning Window from beta\n"); + err = TestOpenCommissioningWindowFromBeta_20(); + break; + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : Check that commissioning window is open again\n"); + err = TestCheckThatCommissioningWindowIsOpenAgain_21(); + break; + case 22: + ChipLogProgress(chipTool, " ***** Test Step 22 : Check the AdminFabricIndex again\n"); + err = TestCheckTheAdminFabricIndexAgain_22(); + break; + case 23: + ChipLogProgress(chipTool, " ***** Test Step 23 : Check the AdminVendorId is not null again\n"); + err = TestCheckTheAdminVendorIdIsNotNullAgain_23(); + break; + case 24: + ChipLogProgress(chipTool, " ***** Test Step 24 : Remove beta fabric\n"); + err = TestRemoveBetaFabric_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : Check that commissioning window is still open\n"); + err = TestCheckThatCommissioningWindowIsStillOpen_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : Check the AdminFabricIndex got reset\n"); + err = TestCheckTheAdminFabricIndexGotReset_26(); + break; + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : Check the AdminVendorId did not get reset\n"); + err = TestCheckTheAdminVendorIdDidNotGetReset_27(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 28; + + chip::Optional mNodeId; + chip::Optional mNodeId2; + chip::Optional mEndpoint; + chip::Optional mCluster; + chip::Optional mDiscriminator; + chip::Optional mPayload; + chip::Optional mAlphaIndex; + chip::Optional mBetaIndex; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrievedForAlpha_0() + { + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestGetAlphasFabricIndex_1() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterOperationalCredentials * cluster = + [[MTRBaseClusterOperationalCredentials alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentFabricIndexWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Get alpha's fabric index Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("CurrentFabricIndex", actualValue, mAlphaIndex.HasValue() ? mAlphaIndex.Value() : 1U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatCommissioningWindowIsNotOpen_2() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterAdministratorCommissioning * cluster = + [[MTRBaseClusterAdministratorCommissioning alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeWindowStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that commissioning window is not open Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("WindowStatus", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatThereIsNoAdminFabricIndex_3() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterAdministratorCommissioning * cluster = + [[MTRBaseClusterAdministratorCommissioning alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAdminFabricIndexWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that there is no AdminFabricIndex Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNull("AdminFabricIndex", actualValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatThereIsNoAdminVendorId_4() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterAdministratorCommissioning * cluster = + [[MTRBaseClusterAdministratorCommissioning alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAdminVendorIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that there is no AdminVendorId Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNull("AdminVendorId", actualValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestOpenCommissioningWindowFromAlpha_5() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterAdministratorCommissioning * cluster = + [[MTRBaseClusterAdministratorCommissioning alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRAdministratorCommissioningClusterOpenBasicCommissioningWindowParams alloc] init]; + params.commissioningTimeout = [NSNumber numberWithUnsignedShort:180U]; + [cluster openBasicCommissioningWindowWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Open Commissioning Window from alpha Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatCommissioningWindowIsOpen_6() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterAdministratorCommissioning * cluster = + [[MTRBaseClusterAdministratorCommissioning alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeWindowStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that commissioning window is open Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("WindowStatus", actualValue, 2U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckTheAdminFabricIndex_7() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterAdministratorCommissioning * cluster = + [[MTRBaseClusterAdministratorCommissioning alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAdminFabricIndexWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check the AdminFabricIndex Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("AdminFabricIndex", actualValue)); + VerifyOrReturn(CheckValue("AdminFabricIndex", actualValue, mAlphaIndex.HasValue() ? mAlphaIndex.Value() : 1U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckTheAdminVendorIdIsNotNull_8() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterAdministratorCommissioning * cluster = + [[MTRBaseClusterAdministratorCommissioning alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAdminVendorIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check the AdminVendorId is not null Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + } + VerifyOrReturn(CheckValueNonNull("adminVendorId", value)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCloseCommissioningWindow_9() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterAdministratorCommissioning * cluster = + [[MTRBaseClusterAdministratorCommissioning alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster revokeCommissioningWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Close Commissioning Window Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatCommissioningWindowIsAgainNotOpen_10() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterAdministratorCommissioning * cluster = + [[MTRBaseClusterAdministratorCommissioning alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeWindowStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that commissioning window is again not open Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("WindowStatus", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatAgainThereIsNoAdminFabricIndex_11() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterAdministratorCommissioning * cluster = + [[MTRBaseClusterAdministratorCommissioning alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAdminFabricIndexWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that again there is no AdminFabricIndex Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNull("AdminFabricIndex", actualValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatAgainThereIsNoAdminVendorId_12() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterAdministratorCommissioning * cluster = + [[MTRBaseClusterAdministratorCommissioning alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAdminVendorIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that again there is no AdminVendorId Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNull("AdminVendorId", actualValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestOpenCommissioningWindowFromAlphaAgain_13() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterAdministratorCommissioning * cluster = + [[MTRBaseClusterAdministratorCommissioning alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRAdministratorCommissioningClusterOpenBasicCommissioningWindowParams alloc] init]; + params.commissioningTimeout = [NSNumber numberWithUnsignedShort:180U]; + [cluster openBasicCommissioningWindowWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Open Commissioning Window from alpha again Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCommissionFromBeta_14() + { + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + return PairWithCode("beta", value); + } + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrievedForBeta_15() + { + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId2.HasValue() ? mNodeId2.Value() : 51966ULL; + return WaitForCommissionee("beta", value); + } + + CHIP_ERROR TestCheckThatCommissioningWindowIsNotOpenForTheThirdTime_16() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterAdministratorCommissioning * cluster = + [[MTRBaseClusterAdministratorCommissioning alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeWindowStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that commissioning window is not open for the third time Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("WindowStatus", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatThereIsNoAdminFabricIndexForTheThirdTime_17() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterAdministratorCommissioning * cluster = + [[MTRBaseClusterAdministratorCommissioning alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAdminFabricIndexWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that there is no AdminFabricIndex for the third time Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNull("AdminFabricIndex", actualValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatThereIsNoAdminVendorIdForTheThirdTime_18() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterAdministratorCommissioning * cluster = + [[MTRBaseClusterAdministratorCommissioning alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAdminVendorIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that there is no AdminVendorId for the third time Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNull("AdminVendorId", actualValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGetBetasFabricIndex_19() + { + MTRBaseDevice * device = GetDevice("beta"); + MTRBaseClusterOperationalCredentials * cluster = + [[MTRBaseClusterOperationalCredentials alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentFabricIndexWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Get beta's fabric index Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("CurrentFabricIndex", actualValue, mBetaIndex.HasValue() ? mBetaIndex.Value() : 2U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestOpenCommissioningWindowFromBeta_20() + { + MTRBaseDevice * device = GetDevice("beta"); + MTRBaseClusterAdministratorCommissioning * cluster = + [[MTRBaseClusterAdministratorCommissioning alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRAdministratorCommissioningClusterOpenBasicCommissioningWindowParams alloc] init]; + params.commissioningTimeout = [NSNumber numberWithUnsignedShort:180U]; + [cluster openBasicCommissioningWindowWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Open Commissioning Window from beta Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatCommissioningWindowIsOpenAgain_21() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterAdministratorCommissioning * cluster = + [[MTRBaseClusterAdministratorCommissioning alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeWindowStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that commissioning window is open again Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("WindowStatus", actualValue, 2U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckTheAdminFabricIndexAgain_22() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterAdministratorCommissioning * cluster = + [[MTRBaseClusterAdministratorCommissioning alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAdminFabricIndexWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check the AdminFabricIndex again Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("AdminFabricIndex", actualValue)); + VerifyOrReturn(CheckValue("AdminFabricIndex", actualValue, mBetaIndex.HasValue() ? mBetaIndex.Value() : 2U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nullable adminVendorId; + + CHIP_ERROR TestCheckTheAdminVendorIdIsNotNullAgain_23() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterAdministratorCommissioning * cluster = + [[MTRBaseClusterAdministratorCommissioning alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAdminVendorIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check the AdminVendorId is not null again Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + } + VerifyOrReturn(CheckValueNonNull("adminVendorId", value)); + { + adminVendorId = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestRemoveBetaFabric_24() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterOperationalCredentials * cluster = + [[MTRBaseClusterOperationalCredentials alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTROperationalCredentialsClusterRemoveFabricParams alloc] init]; + params.fabricIndex + = mBetaIndex.HasValue() ? [NSNumber numberWithUnsignedChar:mBetaIndex.Value()] : [NSNumber numberWithUnsignedChar:2U]; + [cluster removeFabricWithParams:params + completionHandler:^( + MTROperationalCredentialsClusterNOCResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Remove beta fabric Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatCommissioningWindowIsStillOpen_25() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterAdministratorCommissioning * cluster = + [[MTRBaseClusterAdministratorCommissioning alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeWindowStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that commissioning window is still open Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("WindowStatus", actualValue, 2U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckTheAdminFabricIndexGotReset_26() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterAdministratorCommissioning * cluster = + [[MTRBaseClusterAdministratorCommissioning alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAdminFabricIndexWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check the AdminFabricIndex got reset Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNull("AdminFabricIndex", actualValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckTheAdminVendorIdDidNotGetReset_27() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterAdministratorCommissioning * cluster = + [[MTRBaseClusterAdministratorCommissioning alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAdminVendorIdWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check the AdminVendorId did not get reset Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + if (adminVendorId == nil) { + VerifyOrReturn(CheckValueNull("AdminVendorId", actualValue)); + } else { + VerifyOrReturn(CheckValueNonNull("AdminVendorId", actualValue)); + VerifyOrReturn(CheckValue("AdminVendorId", actualValue, adminVendorId)); + } + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + class TestMultiAdmin : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced @@ -115921,6 +116793,7 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), diff --git a/zzz_generated/light-switch-app/zap-generated/endpoint_config.h b/zzz_generated/light-switch-app/zap-generated/endpoint_config.h index 2408c85c1bbf97..f8245f5b9e5f96 100644 --- a/zzz_generated/light-switch-app/zap-generated/endpoint_config.h +++ b/zzz_generated/light-switch-app/zap-generated/endpoint_config.h @@ -384,11 +384,12 @@ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* WindowStatus */ \ - { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ - { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ + { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ diff --git a/zzz_generated/lighting-app/zap-generated/endpoint_config.h b/zzz_generated/lighting-app/zap-generated/endpoint_config.h index d85c3859c69fa8..0eadabd0f7dc57 100644 --- a/zzz_generated/lighting-app/zap-generated/endpoint_config.h +++ b/zzz_generated/lighting-app/zap-generated/endpoint_config.h @@ -407,11 +407,12 @@ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* WindowStatus */ \ - { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ - { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ + { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ diff --git a/zzz_generated/lock-app/zap-generated/endpoint_config.h b/zzz_generated/lock-app/zap-generated/endpoint_config.h index 2d158b3e3bbeae..34765f49c0a8de 100644 --- a/zzz_generated/lock-app/zap-generated/endpoint_config.h +++ b/zzz_generated/lock-app/zap-generated/endpoint_config.h @@ -441,11 +441,12 @@ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* WindowStatus */ \ - { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ - { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ + { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ diff --git a/zzz_generated/ota-provider-app/zap-generated/endpoint_config.h b/zzz_generated/ota-provider-app/zap-generated/endpoint_config.h index 3faf0a9c5e9b87..4c81f82156a228 100644 --- a/zzz_generated/ota-provider-app/zap-generated/endpoint_config.h +++ b/zzz_generated/ota-provider-app/zap-generated/endpoint_config.h @@ -218,11 +218,12 @@ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* WindowStatus */ \ - { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ - { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ + { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ diff --git a/zzz_generated/ota-requestor-app/zap-generated/endpoint_config.h b/zzz_generated/ota-requestor-app/zap-generated/endpoint_config.h index 38f6c3c4da182c..d9496d0d499be2 100644 --- a/zzz_generated/ota-requestor-app/zap-generated/endpoint_config.h +++ b/zzz_generated/ota-requestor-app/zap-generated/endpoint_config.h @@ -231,11 +231,12 @@ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* WindowStatus */ \ - { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ - { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ + { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ diff --git a/zzz_generated/placeholder/app1/zap-generated/endpoint_config.h b/zzz_generated/placeholder/app1/zap-generated/endpoint_config.h index a330207c12c11e..7a3260fdaa55ea 100644 --- a/zzz_generated/placeholder/app1/zap-generated/endpoint_config.h +++ b/zzz_generated/placeholder/app1/zap-generated/endpoint_config.h @@ -326,11 +326,12 @@ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* WindowStatus */ \ - { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ - { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ + { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* Fabrics */ \ diff --git a/zzz_generated/placeholder/app2/zap-generated/endpoint_config.h b/zzz_generated/placeholder/app2/zap-generated/endpoint_config.h index a330207c12c11e..7a3260fdaa55ea 100644 --- a/zzz_generated/placeholder/app2/zap-generated/endpoint_config.h +++ b/zzz_generated/placeholder/app2/zap-generated/endpoint_config.h @@ -326,11 +326,12 @@ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* WindowStatus */ \ - { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ - { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ + { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* Fabrics */ \ diff --git a/zzz_generated/pump-app/zap-generated/endpoint_config.h b/zzz_generated/pump-app/zap-generated/endpoint_config.h index c9df90c80df386..b9414fac8dad1b 100644 --- a/zzz_generated/pump-app/zap-generated/endpoint_config.h +++ b/zzz_generated/pump-app/zap-generated/endpoint_config.h @@ -228,11 +228,12 @@ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* WindowStatus */ \ - { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ - { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(1) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ + { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(1) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ diff --git a/zzz_generated/pump-controller-app/zap-generated/endpoint_config.h b/zzz_generated/pump-controller-app/zap-generated/endpoint_config.h index 90231ad7e23d4a..628c45b4c14669 100644 --- a/zzz_generated/pump-controller-app/zap-generated/endpoint_config.h +++ b/zzz_generated/pump-controller-app/zap-generated/endpoint_config.h @@ -219,11 +219,12 @@ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* WindowStatus */ \ - { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ - { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(1) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ + { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(1) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ diff --git a/zzz_generated/temperature-measurement-app/zap-generated/endpoint_config.h b/zzz_generated/temperature-measurement-app/zap-generated/endpoint_config.h index 59f75101b8ceb3..a1a14b39916beb 100644 --- a/zzz_generated/temperature-measurement-app/zap-generated/endpoint_config.h +++ b/zzz_generated/temperature-measurement-app/zap-generated/endpoint_config.h @@ -284,11 +284,12 @@ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* WindowStatus */ \ - { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ - { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ + { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ diff --git a/zzz_generated/thermostat/zap-generated/endpoint_config.h b/zzz_generated/thermostat/zap-generated/endpoint_config.h index 91d39ce61dd167..fde04426311a87 100644 --- a/zzz_generated/thermostat/zap-generated/endpoint_config.h +++ b/zzz_generated/thermostat/zap-generated/endpoint_config.h @@ -421,11 +421,12 @@ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* WindowStatus */ \ - { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ - { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ + { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ diff --git a/zzz_generated/tv-app/zap-generated/endpoint_config.h b/zzz_generated/tv-app/zap-generated/endpoint_config.h index 5462e18f473393..34443ed18d0c09 100644 --- a/zzz_generated/tv-app/zap-generated/endpoint_config.h +++ b/zzz_generated/tv-app/zap-generated/endpoint_config.h @@ -456,11 +456,12 @@ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* WindowStatus */ \ - { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ - { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ + { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ diff --git a/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h b/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h index a759b637dcc58c..f3a0b889538af3 100644 --- a/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h +++ b/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h @@ -409,11 +409,12 @@ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* WindowStatus */ \ - { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ - { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ + { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ diff --git a/zzz_generated/window-app/zap-generated/endpoint_config.h b/zzz_generated/window-app/zap-generated/endpoint_config.h index a8c2c986a64f1a..3479833bc3ac0a 100644 --- a/zzz_generated/window-app/zap-generated/endpoint_config.h +++ b/zzz_generated/window-app/zap-generated/endpoint_config.h @@ -405,11 +405,12 @@ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* WindowStatus */ \ - { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ - { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x00000001, ZAP_TYPE(FABRIC_IDX), 1, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ + { 0x00000002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \