diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index dbbda0aa36580f..b37ed3c6ca4370 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -485,6 +485,7 @@ jobs: --target linux-x64-energy-management-ipv6only-no-ble-no-wifi-tsan-clang-test \ --target linux-x64-microwave-oven-ipv6only-no-ble-no-wifi-tsan-clang-test \ --target linux-x64-rvc-ipv6only-no-ble-no-wifi-tsan-clang-test \ + --target linux-x64-network-manager-ipv6only-no-ble-no-wifi-tsan-clang-test \ --target linux-x64-python-bindings \ build \ --copy-artifacts-to objdir-clone \ @@ -498,6 +499,7 @@ jobs: echo "LIT_ICD_APP: out/linux-x64-lit-icd-ipv6only-no-ble-no-wifi-tsan-clang-test/lit-icd-app" >> /tmp/test_env.yaml echo "CHIP_MICROWAVE_OVEN_APP: out/linux-x64-microwave-oven-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-microwave-oven-app" >> /tmp/test_env.yaml echo "CHIP_RVC_APP: out/linux-x64-rvc-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-rvc-app" >> /tmp/test_env.yaml + echo "NETWORK_MANAGEMENT_APP: out/linux-x64-network-manager-ipv6only-no-ble-no-wifi-tsan-clang-test/matter-network-manager-app" >> /tmp/test_env.yaml echo "TRACE_APP: out/trace_data/app-{SCRIPT_BASE_NAME}" >> /tmp/test_env.yaml echo "TRACE_TEST_JSON: out/trace_data/test-{SCRIPT_BASE_NAME}" >> /tmp/test_env.yaml echo "TRACE_TEST_PERFETTO: out/trace_data/test-{SCRIPT_BASE_NAME}" >> /tmp/test_env.yaml diff --git a/examples/air-purifier-app/air-purifier-common/air-purifier-app.zap b/examples/air-purifier-app/air-purifier-common/air-purifier-app.zap index 9d65016495b691..0ffbbd01e7c139 100644 --- a/examples/air-purifier-app/air-purifier-common/air-purifier-app.zap +++ b/examples/air-purifier-app/air-purifier-common/air-purifier-app.zap @@ -7970,7 +7970,7 @@ "code": 18, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index cecc10f848c75c..51ea8b7188a96b 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -13445,7 +13445,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "WaterHeaterTypeBitmap", + "type": "WaterHeaterHeatSourceBitmap", "included": 1, "storageOption": "External", "singleton": 0, @@ -13461,7 +13461,7 @@ "code": 1, "mfgCode": null, "side": "server", - "type": "WaterHeaterDemandBitmap", + "type": "WaterHeaterHeatSourceBitmap", "included": 1, "storageOption": "External", "singleton": 0, @@ -17507,7 +17507,7 @@ "code": 5, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "DriftCompensationEnum", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17555,7 +17555,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "ColorModeEnum", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17571,7 +17571,7 @@ "code": 15, "mfgCode": null, "side": "server", - "type": "bitmap8", + "type": "OptionsBitmap", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -18083,7 +18083,7 @@ "code": 16385, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "EnhancedColorModeEnum", "included": 1, "storageOption": "NVM", "singleton": 0, @@ -18179,7 +18179,7 @@ "code": 16394, "mfgCode": null, "side": "server", - "type": "bitmap16", + "type": "ColorCapabilitiesBitmap", "included": 1, "storageOption": "RAM", "singleton": 0, diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap index dbab34c300bd41..528dd80c73bfd2 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap @@ -6932,7 +6932,7 @@ "code": 18, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7202,7 +7202,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "ColorModeEnum", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7218,7 +7218,7 @@ "code": 15, "mfgCode": null, "side": "server", - "type": "bitmap8", + "type": "OptionsBitmap", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7250,7 +7250,7 @@ "code": 16385, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "EnhancedColorModeEnum", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7266,7 +7266,7 @@ "code": 16394, "mfgCode": null, "side": "server", - "type": "bitmap16", + "type": "ColorCapabilitiesBitmap", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7995,10 +7995,10 @@ "side": "server", "type": "bitmap32", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -9965,7 +9965,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -10541,7 +10541,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -11917,10 +11917,10 @@ "side": "server", "type": "bitmap32", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.zap b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.zap index 444408ac97d1ac..ec8d9f537cc5ed 100644 --- a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.zap +++ b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.zap @@ -4783,10 +4783,10 @@ "side": "client", "type": "bitmap32", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.zap b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.zap index 0b88b6a936cad5..0cfb36a59885d7 100644 --- a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.zap +++ b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.zap @@ -7991,7 +7991,7 @@ "code": 18, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -8007,7 +8007,7 @@ "code": 21, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -8023,7 +8023,7 @@ "code": 22, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, diff --git a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.zap b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.zap index c53b6ae30a0c5f..c38b543d1385e9 100644 --- a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.zap +++ b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.zap @@ -19,18 +19,18 @@ "package": [ { "pathRelativity": "relativeToZap", - "path": "../../../src/app/zap-templates/zcl/zcl.json", - "type": "zcl-properties", + "path": "../../../src/app/zap-templates/app-templates.json", + "type": "gen-templates-json", "category": "matter", - "version": 1, - "description": "Matter SDK ZCL data" + "version": "chip-v1" }, { "pathRelativity": "relativeToZap", - "path": "../../../src/app/zap-templates/app-templates.json", - "type": "gen-templates-json", + "path": "../../../src/app/zap-templates/zcl/zcl.json", + "type": "zcl-properties", "category": "matter", - "version": "chip-v1" + "version": 1, + "description": "Matter SDK ZCL data" } ], "endpointTypes": [ @@ -3408,7 +3408,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "ColorModeEnum", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3424,7 +3424,7 @@ "code": 15, "mfgCode": null, "side": "server", - "type": "bitmap8", + "type": "OptionsBitmap", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3760,7 +3760,7 @@ "code": 16385, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "EnhancedColorModeEnum", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3776,7 +3776,7 @@ "code": 16394, "mfgCode": null, "side": "server", - "type": "bitmap16", + "type": "ColorCapabilitiesBitmap", "included": 1, "storageOption": "RAM", "singleton": 0, diff --git a/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.zap b/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.zap index 02a553e03f9cd1..2c65da229ebbe4 100644 --- a/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.zap +++ b/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.zap @@ -4128,7 +4128,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4704,7 +4704,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.zap b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.zap index 3feb19881c6a29..9b755037ba1aa6 100644 --- a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.zap +++ b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.zap @@ -3520,10 +3520,10 @@ "side": "client", "type": "bitmap32", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.zap b/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.zap index 275f5f81144816..94d7fb252c2d68 100644 --- a/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.zap +++ b/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.zap @@ -3813,10 +3813,10 @@ "side": "client", "type": "bitmap32", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.zap b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.zap index 9debf6b9ce30eb..308b192c368ba9 100644 --- a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.zap +++ b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.zap @@ -3720,7 +3720,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "ColorModeEnum", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3736,7 +3736,7 @@ "code": 15, "mfgCode": null, "side": "server", - "type": "bitmap8", + "type": "OptionsBitmap", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3784,7 +3784,7 @@ "code": 16385, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "EnhancedColorModeEnum", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3880,7 +3880,7 @@ "code": 16394, "mfgCode": null, "side": "server", - "type": "bitmap16", + "type": "ColorCapabilitiesBitmap", "included": 1, "storageOption": "RAM", "singleton": 0, diff --git a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.zap b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.zap index 88f0e7a0408646..b3f7ab84762651 100644 --- a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.zap +++ b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.zap @@ -17,13 +17,6 @@ } ], "package": [ - { - "pathRelativity": "relativeToZap", - "path": "../../../src/app/zap-templates/app-templates.json", - "type": "gen-templates-json", - "category": "matter", - "version": "chip-v1" - }, { "pathRelativity": "relativeToZap", "path": "../../../src/app/zap-templates/zcl/zcl.json", @@ -31,6 +24,13 @@ "category": "matter", "version": 1, "description": "Matter SDK ZCL data" + }, + { + "pathRelativity": "relativeToZap", + "path": "../../../src/app/zap-templates/app-templates.json", + "type": "gen-templates-json", + "category": "matter", + "version": "chip-v1" } ], "endpointTypes": [ diff --git a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.zap b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.zap index 3d817ad7191ee9..3f61a61d3c5b58 100644 --- a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.zap +++ b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.zap @@ -2974,10 +2974,10 @@ "side": "server", "type": "bitmap32", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.zap b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.zap index f831de4d5d9a7c..80384bf72b175b 100644 --- a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.zap +++ b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.zap @@ -24,6 +24,13 @@ "category": "matter", "version": 1, "description": "Matter SDK ZCL data" + }, + { + "pathRelativity": "relativeToZap", + "path": "../../../src/app/zap-templates/app-templates.json", + "type": "gen-templates-json", + "category": "matter", + "version": "chip-v1" } ], "endpointTypes": [ @@ -2706,7 +2713,7 @@ "code": 17, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -2722,7 +2729,7 @@ "code": 18, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -2738,7 +2745,7 @@ "code": 21, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -2754,7 +2761,7 @@ "code": 22, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -2770,7 +2777,7 @@ "code": 23, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -2786,7 +2793,7 @@ "code": 24, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, diff --git a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.zap b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.zap index aa5d18f081aa94..c30fe33f9e465c 100644 --- a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.zap +++ b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.zap @@ -3064,7 +3064,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "bitmap8", + "type": "OccupancyBitmap", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3176,7 +3176,7 @@ "code": 9, "mfgCode": null, "side": "server", - "type": "bitmap8", + "type": "HVACSystemTypeBitmap", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3208,7 +3208,7 @@ "code": 17, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3224,7 +3224,7 @@ "code": 18, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3240,7 +3240,7 @@ "code": 19, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3256,7 +3256,7 @@ "code": 20, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3272,7 +3272,7 @@ "code": 21, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3288,7 +3288,7 @@ "code": 22, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3304,7 +3304,7 @@ "code": 23, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3320,7 +3320,7 @@ "code": 24, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3804,10 +3804,10 @@ "side": "client", "type": "bitmap32", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/common/pigweed/protos/fabric_bridge_service.proto b/examples/common/pigweed/protos/fabric_bridge_service.proto index 0de3b3fa243d77..1c699e6942b358 100644 --- a/examples/common/pigweed/protos/fabric_bridge_service.proto +++ b/examples/common/pigweed/protos/fabric_bridge_service.proto @@ -26,8 +26,16 @@ message KeepActiveChanged { uint32 promised_active_duration_ms = 2; } +message AdministratorCommissioningChanged { + uint64 node_id = 1; + uint32 window_status = 2; + optional uint32 opener_fabric_index = 3; + optional uint32 opener_vendor_id = 4; +} + service FabricBridge { rpc AddSynchronizedDevice(SynchronizedDevice) returns (pw.protobuf.Empty){} rpc RemoveSynchronizedDevice(SynchronizedDevice) returns (pw.protobuf.Empty){} rpc ActiveChanged(KeepActiveChanged) returns (pw.protobuf.Empty){} + rpc AdminCommissioningAttributeChanged(AdministratorCommissioningChanged) returns (pw.protobuf.Empty){} } diff --git a/examples/common/pigweed/rpc_services/FabricBridge.h b/examples/common/pigweed/rpc_services/FabricBridge.h index aab714223968df..9bd520278c13b4 100644 --- a/examples/common/pigweed/rpc_services/FabricBridge.h +++ b/examples/common/pigweed/rpc_services/FabricBridge.h @@ -48,6 +48,12 @@ class FabricBridge : public pw_rpc::nanopb::FabricBridge::Service { return pw::Status::Unimplemented(); } + + virtual pw::Status AdminCommissioningAttributeChanged(const chip_rpc_AdministratorCommissioningChanged & request, + pw_protobuf_Empty & response) + { + return pw::Status::Unimplemented(); + } }; } // namespace rpc diff --git a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.zap b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.zap index 0486ab6d328c97..90b0a3cb5de3fe 100644 --- a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.zap +++ b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.zap @@ -4702,10 +4702,10 @@ "side": "server", "type": "bitmap32", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/fabric-admin/BUILD.gn b/examples/fabric-admin/BUILD.gn index 77e851a53c36d2..51e6bc60daa306 100644 --- a/examples/fabric-admin/BUILD.gn +++ b/examples/fabric-admin/BUILD.gn @@ -76,14 +76,14 @@ static_library("fabric-admin-utils") { "commands/common/StayActiveSender.cpp", "commands/common/StayActiveSender.h", "commands/fabric-sync/FabricSyncCommand.cpp", - "commands/pairing/DeviceSynchronization.cpp", - "commands/pairing/DeviceSynchronization.h", "commands/pairing/OpenCommissioningWindowCommand.cpp", "commands/pairing/OpenCommissioningWindowCommand.h", "commands/pairing/PairingCommand.cpp", "commands/pairing/ToTLVCert.cpp", "device_manager/DeviceManager.cpp", "device_manager/DeviceManager.h", + "device_manager/DeviceSynchronization.cpp", + "device_manager/DeviceSynchronization.h", ] deps = [ "${chip_root}/src/app:events" ] diff --git a/examples/fabric-admin/commands/pairing/PairingCommand.cpp b/examples/fabric-admin/commands/pairing/PairingCommand.cpp index aecd259d373d3f..9a7adfa3f910e5 100644 --- a/examples/fabric-admin/commands/pairing/PairingCommand.cpp +++ b/examples/fabric-admin/commands/pairing/PairingCommand.cpp @@ -21,9 +21,9 @@ #include #include #include -#include #include #include +#include #include #include #include diff --git a/examples/fabric-admin/commands/pairing/DeviceSynchronization.cpp b/examples/fabric-admin/device_manager/DeviceSynchronization.cpp similarity index 100% rename from examples/fabric-admin/commands/pairing/DeviceSynchronization.cpp rename to examples/fabric-admin/device_manager/DeviceSynchronization.cpp diff --git a/examples/fabric-admin/commands/pairing/DeviceSynchronization.h b/examples/fabric-admin/device_manager/DeviceSynchronization.h similarity index 100% rename from examples/fabric-admin/commands/pairing/DeviceSynchronization.h rename to examples/fabric-admin/device_manager/DeviceSynchronization.h diff --git a/examples/fabric-admin/rpc/RpcClient.cpp b/examples/fabric-admin/rpc/RpcClient.cpp index f5672fc0bd8f85..29fc2b1ea9d73c 100644 --- a/examples/fabric-admin/rpc/RpcClient.cpp +++ b/examples/fabric-admin/rpc/RpcClient.cpp @@ -180,3 +180,20 @@ CHIP_ERROR ActiveChanged(chip::NodeId nodeId, uint32_t promisedActiveDurationMs) return WaitForResponse(call); } + +CHIP_ERROR AdminCommissioningAttributeChanged(const chip_rpc_AdministratorCommissioningChanged & data) +{ + ChipLogProgress(NotSpecified, "AdminCommissioningAttributeChanged"); + + // The RPC call is kept alive until it completes. When a response is received, it will be logged by the handler + // function and the call will complete. + auto call = fabricBridgeClient.AdminCommissioningAttributeChanged(data, RpcCompletedWithEmptyResponse); + + if (!call.active()) + { + // The RPC call was not sent. This could occur due to, for example, an invalid channel ID. Handle if necessary. + return CHIP_ERROR_INTERNAL; + } + + return WaitForResponse(call); +} diff --git a/examples/fabric-admin/rpc/RpcClient.h b/examples/fabric-admin/rpc/RpcClient.h index 8edee9a3b256ed..6dd2b5b20bbd90 100644 --- a/examples/fabric-admin/rpc/RpcClient.h +++ b/examples/fabric-admin/rpc/RpcClient.h @@ -74,3 +74,14 @@ CHIP_ERROR RemoveSynchronizedDevice(chip::NodeId nodeId); * - CHIP_ERROR_INTERNAL: An internal error occurred while activating the RPC call. */ CHIP_ERROR ActiveChanged(chip::NodeId nodeId, uint32_t promisedActiveDurationMs); + +/** + * @brief CADMIN attribute has changed of one of the bridged devices that was previously added. + * + * @param data information regarding change in AdministratorCommissioning attributes + * @return CHIP_ERROR An error code indicating the success or failure of the operation. + * - CHIP_NO_ERROR: The RPC command was successfully processed. + * - CHIP_ERROR_BUSY: Another operation is currently in progress. + * - CHIP_ERROR_INTERNAL: An internal error occurred while activating the RPC call. + */ +CHIP_ERROR AdminCommissioningAttributeChanged(const chip_rpc_AdministratorCommissioningChanged & data); diff --git a/examples/fabric-bridge-app/fabric-bridge-common/include/BridgedDevice.h b/examples/fabric-bridge-app/fabric-bridge-common/include/BridgedDevice.h index 7081278f4dc0f3..0de35ecbfa32e8 100644 --- a/examples/fabric-bridge-app/fabric-bridge-common/include/BridgedDevice.h +++ b/examples/fabric-bridge-app/fabric-bridge-common/include/BridgedDevice.h @@ -68,7 +68,8 @@ class BridgedDevice [[nodiscard]] const BridgedAttributes & GetBridgedAttributes() const { return mAttributes; } void SetBridgedAttributes(const BridgedAttributes & value) { mAttributes = value; } - // TODO(#35077): Need to allow mAdminCommissioningAttributes to be set from fabric-admin. + + void SetAdminCommissioningAttributes(const AdminCommissioningAttributes & aAdminCommissioningAttributes); const AdminCommissioningAttributes & GetAdminCommissioningAttributes() const { return mAdminCommissioningAttributes; } /// Convenience method to set just the unique id of a bridged device as it diff --git a/examples/fabric-bridge-app/fabric-bridge-common/src/BridgedDevice.cpp b/examples/fabric-bridge-app/fabric-bridge-common/src/BridgedDevice.cpp index 21f19189afefe6..27364976d121f5 100644 --- a/examples/fabric-bridge-app/fabric-bridge-common/src/BridgedDevice.cpp +++ b/examples/fabric-bridge-app/fabric-bridge-common/src/BridgedDevice.cpp @@ -21,6 +21,7 @@ #include #include +#include #include namespace { @@ -31,6 +32,14 @@ struct ActiveChangeEventWorkData uint32_t mPromisedActiveDuration; }; +struct ReportAttributeChangedWorkData +{ + chip::EndpointId mEndpointId; + bool mWindowChanged = false; + bool mFabricIndexChanged = false; + bool mVendorChanged = false; +}; + void ActiveChangeEventWork(intptr_t arg) { ActiveChangeEventWorkData * data = reinterpret_cast(arg); @@ -47,6 +56,28 @@ void ActiveChangeEventWork(intptr_t arg) chip::Platform::Delete(data); } +void ReportAttributeChangedWork(intptr_t arg) +{ + ReportAttributeChangedWorkData * data = reinterpret_cast(arg); + + if (data->mWindowChanged) + { + MatterReportingAttributeChangeCallback(data->mEndpointId, chip::app::Clusters::AdministratorCommissioning::Id, + chip::app::Clusters::AdministratorCommissioning::Attributes::WindowStatus::Id); + } + if (data->mFabricIndexChanged) + { + MatterReportingAttributeChangeCallback(data->mEndpointId, chip::app::Clusters::AdministratorCommissioning::Id, + chip::app::Clusters::AdministratorCommissioning::Attributes::AdminFabricIndex::Id); + } + if (data->mVendorChanged) + { + MatterReportingAttributeChangeCallback(data->mEndpointId, chip::app::Clusters::AdministratorCommissioning::Id, + chip::app::Clusters::AdministratorCommissioning::Attributes::AdminVendorId::Id); + } + chip::Platform::Delete(data); +} + } // namespace using namespace chip::app::Clusters::Actions; @@ -80,3 +111,18 @@ void BridgedDevice::SetReachable(bool reachable) ChipLogProgress(NotSpecified, "BridgedDevice[%s]: OFFLINE", mAttributes.uniqueId.c_str()); } } + +void BridgedDevice::SetAdminCommissioningAttributes(const AdminCommissioningAttributes & aAdminCommissioningAttributes) +{ + ReportAttributeChangedWorkData * workdata = chip::Platform::New(); + + workdata->mEndpointId = mEndpointId; + workdata->mWindowChanged = + (aAdminCommissioningAttributes.commissioningWindowStatus != mAdminCommissioningAttributes.commissioningWindowStatus); + workdata->mFabricIndexChanged = + (aAdminCommissioningAttributes.openerFabricIndex != mAdminCommissioningAttributes.openerFabricIndex); + workdata->mVendorChanged = (aAdminCommissioningAttributes.openerVendorId != mAdminCommissioningAttributes.openerVendorId); + + mAdminCommissioningAttributes = aAdminCommissioningAttributes; + chip::DeviceLayer::PlatformMgr().ScheduleWork(ReportAttributeChangedWork, reinterpret_cast(workdata)); +} diff --git a/examples/fabric-bridge-app/linux/RpcServer.cpp b/examples/fabric-bridge-app/linux/RpcServer.cpp index bae007ed484935..bc8eed5c3dd9f0 100644 --- a/examples/fabric-bridge-app/linux/RpcServer.cpp +++ b/examples/fabric-bridge-app/linux/RpcServer.cpp @@ -46,6 +46,8 @@ class FabricBridge final : public chip::rpc::FabricBridge pw::Status AddSynchronizedDevice(const chip_rpc_SynchronizedDevice & request, pw_protobuf_Empty & response) override; pw::Status RemoveSynchronizedDevice(const chip_rpc_SynchronizedDevice & request, pw_protobuf_Empty & response) override; pw::Status ActiveChanged(const chip_rpc_KeepActiveChanged & request, pw_protobuf_Empty & response) override; + pw::Status AdminCommissioningAttributeChanged(const chip_rpc_AdministratorCommissioningChanged & request, + pw_protobuf_Empty & response) override; }; pw::Status FabricBridge::AddSynchronizedDevice(const chip_rpc_SynchronizedDevice & request, pw_protobuf_Empty & response) @@ -160,6 +162,44 @@ pw::Status FabricBridge::ActiveChanged(const chip_rpc_KeepActiveChanged & reques return pw::OkStatus(); } +pw::Status FabricBridge::AdminCommissioningAttributeChanged(const chip_rpc_AdministratorCommissioningChanged & request, + pw_protobuf_Empty & response) +{ + NodeId nodeId = request.node_id; + ChipLogProgress(NotSpecified, "Received CADMIN attribut change: " ChipLogFormatX64, ChipLogValueX64(nodeId)); + + auto * device = BridgeDeviceMgr().GetDeviceByNodeId(nodeId); + if (device == nullptr) + { + ChipLogError(NotSpecified, "Could not find bridged device associated with nodeId=0x" ChipLogFormatX64, + ChipLogValueX64(nodeId)); + return pw::Status::NotFound(); + } + + BridgedDevice::AdminCommissioningAttributes adminCommissioningAttributes; + + uint32_t max_window_status_value = + static_cast(chip::app::Clusters::AdministratorCommissioning::CommissioningWindowStatusEnum::kUnknownEnumValue); + VerifyOrReturnValue(request.window_status < max_window_status_value, pw::Status::InvalidArgument()); + adminCommissioningAttributes.commissioningWindowStatus = + static_cast(request.window_status); + if (request.has_opener_fabric_index) + { + VerifyOrReturnValue(request.opener_fabric_index >= chip::kMinValidFabricIndex, pw::Status::InvalidArgument()); + VerifyOrReturnValue(request.opener_fabric_index <= chip::kMaxValidFabricIndex, pw::Status::InvalidArgument()); + adminCommissioningAttributes.openerFabricIndex = static_cast(request.opener_fabric_index); + } + + if (request.has_opener_vendor_id) + { + VerifyOrReturnValue(request.opener_vendor_id != chip::VendorId::NotSpecified, pw::Status::InvalidArgument()); + adminCommissioningAttributes.openerVendorId = static_cast(request.opener_vendor_id); + } + + device->SetAdminCommissioningAttributes(adminCommissioningAttributes); + return pw::OkStatus(); +} + FabricBridge fabric_bridge_service; #endif // defined(PW_RPC_FABRIC_BRIDGE_SERVICE) && PW_RPC_FABRIC_BRIDGE_SERVICE diff --git a/examples/light-switch-app/light-switch-common/light-switch-app.zap b/examples/light-switch-app/light-switch-common/light-switch-app.zap index fdeaef99bfcc36..806d45be48fb3c 100644 --- a/examples/light-switch-app/light-switch-common/light-switch-app.zap +++ b/examples/light-switch-app/light-switch-common/light-switch-app.zap @@ -17,13 +17,6 @@ } ], "package": [ - { - "pathRelativity": "relativeToZap", - "path": "../../../src/app/zap-templates/app-templates.json", - "type": "gen-templates-json", - "category": "matter", - "version": "chip-v1" - }, { "pathRelativity": "relativeToZap", "path": "../../../src/app/zap-templates/zcl/zcl.json", @@ -31,6 +24,13 @@ "category": "matter", "version": 1, "description": "Matter SDK ZCL data" + }, + { + "pathRelativity": "relativeToZap", + "path": "../../../src/app/zap-templates/app-templates.json", + "type": "gen-templates-json", + "category": "matter", + "version": "chip-v1" } ], "endpointTypes": [ diff --git a/examples/light-switch-app/qpg/zap/switch.zap b/examples/light-switch-app/qpg/zap/switch.zap index b402b32c960efa..2b36781c42eb18 100644 --- a/examples/light-switch-app/qpg/zap/switch.zap +++ b/examples/light-switch-app/qpg/zap/switch.zap @@ -1379,7 +1379,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -1395,7 +1395,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -1411,7 +1411,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -1427,7 +1427,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -1443,7 +1443,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.zap b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.zap index 933adab3f33f95..1f7f1aa176483b 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.zap +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.zap @@ -3751,7 +3751,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "ColorModeEnum", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3767,7 +3767,7 @@ "code": 15, "mfgCode": null, "side": "server", - "type": "bitmap8", + "type": "OptionsBitmap", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4103,7 +4103,7 @@ "code": 16385, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "EnhancedColorModeEnum", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4199,7 +4199,7 @@ "code": 16394, "mfgCode": null, "side": "server", - "type": "bitmap16", + "type": "ColorCapabilitiesBitmap", "included": 1, "storageOption": "RAM", "singleton": 0, diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap index bac1dcc7b9b50c..b525204ed52d3b 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap @@ -4727,7 +4727,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "ColorModeEnum", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4743,7 +4743,7 @@ "code": 15, "mfgCode": null, "side": "server", - "type": "bitmap8", + "type": "OptionsBitmap", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5079,7 +5079,7 @@ "code": 16385, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "EnhancedColorModeEnum", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5175,7 +5175,7 @@ "code": 16394, "mfgCode": null, "side": "server", - "type": "bitmap16", + "type": "ColorCapabilitiesBitmap", "included": 1, "storageOption": "RAM", "singleton": 0, diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap index 39f1cc21cb92dd..eb23b365d01428 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap @@ -3934,7 +3934,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "ColorModeEnum", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3950,7 +3950,7 @@ "code": 15, "mfgCode": null, "side": "server", - "type": "bitmap8", + "type": "OptionsBitmap", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4286,7 +4286,7 @@ "code": 16385, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "EnhancedColorModeEnum", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4382,7 +4382,7 @@ "code": 16394, "mfgCode": null, "side": "server", - "type": "bitmap16", + "type": "ColorCapabilitiesBitmap", "included": 1, "storageOption": "RAM", "singleton": 0, diff --git a/examples/lighting-app/lighting-common/lighting-app.zap b/examples/lighting-app/lighting-common/lighting-app.zap index acdafaa92ef758..68929e98da0c20 100644 --- a/examples/lighting-app/lighting-common/lighting-app.zap +++ b/examples/lighting-app/lighting-common/lighting-app.zap @@ -17,13 +17,6 @@ } ], "package": [ - { - "pathRelativity": "relativeToZap", - "path": "../../../src/app/zap-templates/app-templates.json", - "type": "gen-templates-json", - "category": "matter", - "version": "chip-v1" - }, { "pathRelativity": "relativeToZap", "path": "../../../src/app/zap-templates/zcl/zcl.json", @@ -31,6 +24,13 @@ "category": "matter", "version": 1, "description": "Matter SDK ZCL data" + }, + { + "pathRelativity": "relativeToZap", + "path": "../../../src/app/zap-templates/app-templates.json", + "type": "gen-templates-json", + "category": "matter", + "version": "chip-v1" } ], "endpointTypes": [ @@ -5552,7 +5552,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "ColorModeEnum", "included": 1, "storageOption": "NVM", "singleton": 0, @@ -5568,7 +5568,7 @@ "code": 15, "mfgCode": null, "side": "server", - "type": "bitmap8", + "type": "OptionsBitmap", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5616,7 +5616,7 @@ "code": 16385, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "EnhancedColorModeEnum", "included": 1, "storageOption": "NVM", "singleton": 0, @@ -5712,7 +5712,7 @@ "code": 16394, "mfgCode": null, "side": "server", - "type": "bitmap16", + "type": "ColorCapabilitiesBitmap", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5884,10 +5884,10 @@ "side": "server", "type": "bitmap32", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/lighting-app/qpg/zap/light.zap b/examples/lighting-app/qpg/zap/light.zap index 35b8f3003423a6..d1d40286f88ac7 100644 --- a/examples/lighting-app/qpg/zap/light.zap +++ b/examples/lighting-app/qpg/zap/light.zap @@ -17,13 +17,6 @@ } ], "package": [ - { - "pathRelativity": "relativeToZap", - "path": "../../../../src/app/zap-templates/app-templates.json", - "type": "gen-templates-json", - "category": "matter", - "version": "chip-v1" - }, { "pathRelativity": "relativeToZap", "path": "../../../../src/app/zap-templates/zcl/zcl.json", @@ -5412,7 +5405,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "ColorModeEnum", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5428,7 +5421,7 @@ "code": 15, "mfgCode": null, "side": "server", - "type": "bitmap8", + "type": "OptionsBitmap", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5764,7 +5757,7 @@ "code": 16385, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "EnhancedColorModeEnum", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5860,7 +5853,7 @@ "code": 16394, "mfgCode": null, "side": "server", - "type": "bitmap16", + "type": "ColorCapabilitiesBitmap", "included": 1, "storageOption": "RAM", "singleton": 0, diff --git a/examples/lighting-app/silabs/data_model/lighting-thread-app.zap b/examples/lighting-app/silabs/data_model/lighting-thread-app.zap index 42b5eb330426a5..89211683435c23 100644 --- a/examples/lighting-app/silabs/data_model/lighting-thread-app.zap +++ b/examples/lighting-app/silabs/data_model/lighting-thread-app.zap @@ -4991,7 +4991,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "ColorModeEnum", "included": 1, "storageOption": "NVM", "singleton": 0, @@ -5007,7 +5007,7 @@ "code": 15, "mfgCode": null, "side": "server", - "type": "bitmap8", + "type": "OptionsBitmap", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5055,7 +5055,7 @@ "code": 16385, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "EnhancedColorModeEnum", "included": 1, "storageOption": "NVM", "singleton": 0, @@ -5151,7 +5151,7 @@ "code": 16394, "mfgCode": null, "side": "server", - "type": "bitmap16", + "type": "ColorCapabilitiesBitmap", "included": 1, "storageOption": "RAM", "singleton": 0, diff --git a/examples/lighting-app/silabs/data_model/lighting-wifi-app.zap b/examples/lighting-app/silabs/data_model/lighting-wifi-app.zap index 92e45461475418..db1f5a39429942 100644 --- a/examples/lighting-app/silabs/data_model/lighting-wifi-app.zap +++ b/examples/lighting-app/silabs/data_model/lighting-wifi-app.zap @@ -4766,7 +4766,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "ColorModeEnum", "included": 1, "storageOption": "NVM", "singleton": 0, @@ -4782,7 +4782,7 @@ "code": 15, "mfgCode": null, "side": "server", - "type": "bitmap8", + "type": "OptionsBitmap", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4830,7 +4830,7 @@ "code": 16385, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "EnhancedColorModeEnum", "included": 1, "storageOption": "NVM", "singleton": 0, @@ -4926,7 +4926,7 @@ "code": 16394, "mfgCode": null, "side": "server", - "type": "bitmap16", + "type": "ColorCapabilitiesBitmap", "included": 1, "storageOption": "RAM", "singleton": 0, diff --git a/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.zap b/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.zap index bc32dbce677fb2..c7354adc058a6f 100644 --- a/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.zap +++ b/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.zap @@ -3562,7 +3562,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/lock-app/lock-common/lock-app.zap b/examples/lock-app/lock-common/lock-app.zap index 30fe0db47c2fa8..4403019057a295 100644 --- a/examples/lock-app/lock-common/lock-app.zap +++ b/examples/lock-app/lock-common/lock-app.zap @@ -6296,7 +6296,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -6312,7 +6312,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -6328,7 +6328,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -6344,7 +6344,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -6360,7 +6360,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -6376,7 +6376,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -6392,7 +6392,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -6408,7 +6408,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -6424,7 +6424,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/microwave-oven-app/microwave-oven-common/microwave-oven-app.zap b/examples/microwave-oven-app/microwave-oven-common/microwave-oven-app.zap index 1df2afdd38fc8a..03113285ad2567 100644 --- a/examples/microwave-oven-app/microwave-oven-common/microwave-oven-app.zap +++ b/examples/microwave-oven-app/microwave-oven-common/microwave-oven-app.zap @@ -17,13 +17,6 @@ } ], "package": [ - { - "pathRelativity": "relativeToZap", - "path": "../../../src/app/zap-templates/app-templates.json", - "type": "gen-templates-json", - "category": "matter", - "version": "chip-v1" - }, { "pathRelativity": "relativeToZap", "path": "../../../src/app/zap-templates/zcl/zcl.json", @@ -31,6 +24,13 @@ "category": "matter", "version": 1, "description": "Matter SDK ZCL data" + }, + { + "pathRelativity": "relativeToZap", + "path": "../../../src/app/zap-templates/app-templates.json", + "type": "gen-templates-json", + "category": "matter", + "version": "chip-v1" } ], "endpointTypes": [ diff --git a/examples/network-manager-app/linux/args.gni b/examples/network-manager-app/linux/args.gni index e97ddb13e7c46e..e463c7d01aaff4 100644 --- a/examples/network-manager-app/linux/args.gni +++ b/examples/network-manager-app/linux/args.gni @@ -25,3 +25,5 @@ chip_config_network_layer_ble = false # This enables AccessRestrictionList (ARL) support used by the NIM sample app chip_enable_access_restrictions = true + +matter_enable_tracing_support = true diff --git a/examples/ota-provider-app/ota-provider-common/ota-provider-app.zap b/examples/ota-provider-app/ota-provider-common/ota-provider-app.zap index b019c91de5ef04..c98b9e661328e5 100644 --- a/examples/ota-provider-app/ota-provider-common/ota-provider-app.zap +++ b/examples/ota-provider-app/ota-provider-common/ota-provider-app.zap @@ -17,13 +17,6 @@ } ], "package": [ - { - "pathRelativity": "relativeToZap", - "path": "../../../src/app/zap-templates/app-templates.json", - "type": "gen-templates-json", - "category": "matter", - "version": "chip-v1" - }, { "pathRelativity": "relativeToZap", "path": "../../../src/app/zap-templates/zcl/zcl.json", @@ -31,6 +24,13 @@ "category": "matter", "version": 1, "description": "Matter SDK ZCL data" + }, + { + "pathRelativity": "relativeToZap", + "path": "../../../src/app/zap-templates/app-templates.json", + "type": "gen-templates-json", + "category": "matter", + "version": "chip-v1" } ], "endpointTypes": [ diff --git a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.zap b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.zap index ce4e60fe260d25..2ae993e399dd18 100644 --- a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.zap +++ b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.zap @@ -17,13 +17,6 @@ } ], "package": [ - { - "pathRelativity": "relativeToZap", - "path": "../../../src/app/zap-templates/app-templates.json", - "type": "gen-templates-json", - "category": "matter", - "version": "chip-v1" - }, { "pathRelativity": "relativeToZap", "path": "../../../src/app/zap-templates/zcl/zcl.json", @@ -31,6 +24,13 @@ "category": "matter", "version": 1, "description": "Matter SDK ZCL data" + }, + { + "pathRelativity": "relativeToZap", + "path": "../../../src/app/zap-templates/app-templates.json", + "type": "gen-templates-json", + "category": "matter", + "version": "chip-v1" } ], "endpointTypes": [ @@ -104,7 +104,7 @@ "singleton": 0, "bounded": 0, "defaultValue": null, - "reportable": 0, + "reportable": 1, "minInterval": 0, "maxInterval": 65534, "reportableChange": 0 @@ -120,7 +120,7 @@ "singleton": 0, "bounded": 0, "defaultValue": null, - "reportable": 0, + "reportable": 1, "minInterval": 0, "maxInterval": 65534, "reportableChange": 0 @@ -136,7 +136,7 @@ "singleton": 0, "bounded": 0, "defaultValue": null, - "reportable": 0, + "reportable": 1, "minInterval": 0, "maxInterval": 65534, "reportableChange": 0 @@ -151,7 +151,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -167,7 +167,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -183,7 +183,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -199,7 +199,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -258,7 +258,7 @@ "singleton": 0, "bounded": 0, "defaultValue": null, - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -274,7 +274,7 @@ "singleton": 0, "bounded": 0, "defaultValue": null, - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -337,7 +337,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -353,7 +353,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -369,7 +369,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -460,7 +460,7 @@ "singleton": 1, "bounded": 0, "defaultValue": null, - "reportable": 0, + "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -476,7 +476,7 @@ "singleton": 1, "bounded": 0, "defaultValue": null, - "reportable": 0, + "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -492,7 +492,7 @@ "singleton": 1, "bounded": 0, "defaultValue": null, - "reportable": 0, + "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -508,7 +508,7 @@ "singleton": 1, "bounded": 0, "defaultValue": null, - "reportable": 0, + "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -524,7 +524,7 @@ "singleton": 1, "bounded": 0, "defaultValue": null, - "reportable": 0, + "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -540,7 +540,7 @@ "singleton": 1, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -556,7 +556,7 @@ "singleton": 1, "bounded": 0, "defaultValue": null, - "reportable": 0, + "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -572,7 +572,7 @@ "singleton": 1, "bounded": 0, "defaultValue": null, - "reportable": 0, + "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -588,7 +588,7 @@ "singleton": 1, "bounded": 0, "defaultValue": null, - "reportable": 0, + "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -604,7 +604,7 @@ "singleton": 1, "bounded": 0, "defaultValue": null, - "reportable": 0, + "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -620,7 +620,7 @@ "singleton": 1, "bounded": 0, "defaultValue": null, - "reportable": 0, + "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -795,7 +795,7 @@ "storageOption": "External", "singleton": 1, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -811,7 +811,7 @@ "storageOption": "External", "singleton": 1, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -827,7 +827,7 @@ "storageOption": "External", "singleton": 1, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -843,7 +843,7 @@ "storageOption": "External", "singleton": 1, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -1082,7 +1082,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -1098,7 +1098,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -1114,7 +1114,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -1130,7 +1130,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -1212,7 +1212,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "en-US", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -1228,7 +1228,7 @@ "singleton": 0, "bounded": 0, "defaultValue": null, - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -1243,7 +1243,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -1259,7 +1259,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -1275,7 +1275,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -1291,7 +1291,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -1350,7 +1350,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "0", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -1569,7 +1569,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -1585,7 +1585,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -1601,7 +1601,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -1617,7 +1617,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -1877,7 +1877,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -1893,7 +1893,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -1909,7 +1909,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -1925,7 +1925,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -2042,7 +2042,7 @@ "singleton": 0, "bounded": 0, "defaultValue": null, - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -2153,7 +2153,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -2169,7 +2169,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -2185,7 +2185,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -2201,7 +2201,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -2342,7 +2342,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -2358,7 +2358,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -2374,7 +2374,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -2390,7 +2390,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -2642,7 +2642,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -2658,7 +2658,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -2674,7 +2674,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -2690,7 +2690,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -2862,7 +2862,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -2878,7 +2878,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -2894,7 +2894,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -2910,7 +2910,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/placeholder/linux/apps/app1/config.zap b/examples/placeholder/linux/apps/app1/config.zap index c6bf896bc9e398..d7cad4f031e5c3 100644 --- a/examples/placeholder/linux/apps/app1/config.zap +++ b/examples/placeholder/linux/apps/app1/config.zap @@ -7941,7 +7941,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "bitmap8", + "type": "OccupancyBitmap", "included": 1, "storageOption": "External", "singleton": 0, @@ -8053,7 +8053,7 @@ "code": 9, "mfgCode": null, "side": "server", - "type": "bitmap8", + "type": "HVACSystemTypeBitmap", "included": 1, "storageOption": "External", "singleton": 0, @@ -8085,7 +8085,7 @@ "code": 17, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -8101,7 +8101,7 @@ "code": 18, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -8117,7 +8117,7 @@ "code": 19, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "External", "singleton": 0, @@ -8133,7 +8133,7 @@ "code": 20, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "External", "singleton": 0, @@ -8149,7 +8149,7 @@ "code": 21, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -8165,7 +8165,7 @@ "code": 22, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -8181,7 +8181,7 @@ "code": 23, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -8197,7 +8197,7 @@ "code": 24, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -14093,7 +14093,7 @@ "code": 5, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "DriftCompensationEnum", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -14141,7 +14141,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "ColorModeEnum", "included": 1, "storageOption": "RAM", "singleton": 1, @@ -14157,7 +14157,7 @@ "code": 15, "mfgCode": null, "side": "server", - "type": "bitmap8", + "type": "OptionsBitmap", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -14669,7 +14669,7 @@ "code": 16385, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "EnhancedColorModeEnum", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -14765,7 +14765,7 @@ "code": 16394, "mfgCode": null, "side": "server", - "type": "bitmap16", + "type": "ColorCapabilitiesBitmap", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -15081,10 +15081,10 @@ "side": "server", "type": "bitmap32", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/placeholder/linux/apps/app2/config.zap b/examples/placeholder/linux/apps/app2/config.zap index 22e1cb640b777e..45b74c1f84c9bf 100644 --- a/examples/placeholder/linux/apps/app2/config.zap +++ b/examples/placeholder/linux/apps/app2/config.zap @@ -8015,7 +8015,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "bitmap8", + "type": "OccupancyBitmap", "included": 1, "storageOption": "External", "singleton": 0, @@ -8127,7 +8127,7 @@ "code": 9, "mfgCode": null, "side": "server", - "type": "bitmap8", + "type": "HVACSystemTypeBitmap", "included": 1, "storageOption": "External", "singleton": 0, @@ -8159,7 +8159,7 @@ "code": 17, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -8175,7 +8175,7 @@ "code": 18, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -8191,7 +8191,7 @@ "code": 19, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "External", "singleton": 0, @@ -8207,7 +8207,7 @@ "code": 20, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "External", "singleton": 0, @@ -8223,7 +8223,7 @@ "code": 21, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -8239,7 +8239,7 @@ "code": 22, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -8255,7 +8255,7 @@ "code": 23, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -8271,7 +8271,7 @@ "code": 24, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -13853,7 +13853,7 @@ "code": 5, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "DriftCompensationEnum", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -13901,7 +13901,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "ColorModeEnum", "included": 1, "storageOption": "RAM", "singleton": 1, @@ -13917,7 +13917,7 @@ "code": 15, "mfgCode": null, "side": "server", - "type": "bitmap8", + "type": "OptionsBitmap", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -14429,7 +14429,7 @@ "code": 16385, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "EnhancedColorModeEnum", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -14525,7 +14525,7 @@ "code": 16394, "mfgCode": null, "side": "server", - "type": "bitmap16", + "type": "ColorCapabilitiesBitmap", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -14841,10 +14841,10 @@ "side": "server", "type": "bitmap32", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/pump-app/pump-common/pump-app.zap b/examples/pump-app/pump-common/pump-app.zap index 17e0732704d2af..0d3235ce637719 100644 --- a/examples/pump-app/pump-common/pump-app.zap +++ b/examples/pump-app/pump-common/pump-app.zap @@ -4626,10 +4626,10 @@ "side": "client", "type": "bitmap32", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/pump-app/silabs/data_model/pump-thread-app.zap b/examples/pump-app/silabs/data_model/pump-thread-app.zap index d977c40da06770..b58b4f50c804f5 100644 --- a/examples/pump-app/silabs/data_model/pump-thread-app.zap +++ b/examples/pump-app/silabs/data_model/pump-thread-app.zap @@ -4626,10 +4626,10 @@ "side": "client", "type": "bitmap32", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/pump-app/silabs/data_model/pump-wifi-app.zap b/examples/pump-app/silabs/data_model/pump-wifi-app.zap index d977c40da06770..b58b4f50c804f5 100644 --- a/examples/pump-app/silabs/data_model/pump-wifi-app.zap +++ b/examples/pump-app/silabs/data_model/pump-wifi-app.zap @@ -4626,10 +4626,10 @@ "side": "client", "type": "bitmap32", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/thermostat/nxp/zap/thermostat_matter_thread.zap b/examples/thermostat/nxp/zap/thermostat_matter_thread.zap index 8824bce22564b9..0ed071f900d8b4 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_thread.zap +++ b/examples/thermostat/nxp/zap/thermostat_matter_thread.zap @@ -5151,7 +5151,7 @@ "code": 9, "mfgCode": null, "side": "server", - "type": "bitmap8", + "type": "HVACSystemTypeBitmap", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5167,7 +5167,7 @@ "code": 17, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "NVM", "singleton": 0, @@ -5183,7 +5183,7 @@ "code": 18, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "NVM", "singleton": 0, @@ -5199,7 +5199,7 @@ "code": 21, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5215,7 +5215,7 @@ "code": 22, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5231,7 +5231,7 @@ "code": 23, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5247,7 +5247,7 @@ "code": 24, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, diff --git a/examples/thermostat/nxp/zap/thermostat_matter_wifi.zap b/examples/thermostat/nxp/zap/thermostat_matter_wifi.zap index fbb71356ddaf07..000bc243947016 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_wifi.zap +++ b/examples/thermostat/nxp/zap/thermostat_matter_wifi.zap @@ -4245,7 +4245,7 @@ "code": 9, "mfgCode": null, "side": "server", - "type": "bitmap8", + "type": "HVACSystemTypeBitmap", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4261,7 +4261,7 @@ "code": 17, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "NVM", "singleton": 0, @@ -4277,7 +4277,7 @@ "code": 18, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "NVM", "singleton": 0, @@ -4293,7 +4293,7 @@ "code": 21, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4309,7 +4309,7 @@ "code": 22, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4325,7 +4325,7 @@ "code": 23, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4341,7 +4341,7 @@ "code": 24, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, diff --git a/examples/thermostat/qpg/zap/thermostaticRadiatorValve.zap b/examples/thermostat/qpg/zap/thermostaticRadiatorValve.zap index c30867b7da3149..6077dfb9d0f599 100644 --- a/examples/thermostat/qpg/zap/thermostaticRadiatorValve.zap +++ b/examples/thermostat/qpg/zap/thermostaticRadiatorValve.zap @@ -4098,7 +4098,7 @@ "code": 17, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "NVM", "singleton": 0, @@ -4114,7 +4114,7 @@ "code": 18, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "NVM", "singleton": 0, @@ -4130,7 +4130,7 @@ "code": 21, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4146,7 +4146,7 @@ "code": 22, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4162,7 +4162,7 @@ "code": 23, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4178,7 +4178,7 @@ "code": 24, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, diff --git a/examples/thread-br-app/thread-br-common/thread-br-app.zap b/examples/thread-br-app/thread-br-common/thread-br-app.zap index e8c999068390e6..cad9d37b2d6286 100644 --- a/examples/thread-br-app/thread-br-common/thread-br-app.zap +++ b/examples/thread-br-app/thread-br-common/thread-br-app.zap @@ -2913,7 +2913,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap b/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap index 4f234c23f8eadb..a8cb35694cf8f7 100644 --- a/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap +++ b/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap @@ -17,13 +17,6 @@ } ], "package": [ - { - "pathRelativity": "relativeToZap", - "path": "../../../src/app/zap-templates/app-templates.json", - "type": "gen-templates-json", - "category": "matter", - "version": "chip-v1" - }, { "pathRelativity": "relativeToZap", "path": "../../../src/app/zap-templates/zcl/zcl.json", @@ -31,6 +24,13 @@ "category": "matter", "version": 1, "description": "Matter SDK ZCL data" + }, + { + "pathRelativity": "relativeToZap", + "path": "../../../src/app/zap-templates/app-templates.json", + "type": "gen-templates-json", + "category": "matter", + "version": "chip-v1" } ], "endpointTypes": [ diff --git a/examples/virtual-device-app/virtual-device-common/virtual-device-app.zap b/examples/virtual-device-app/virtual-device-common/virtual-device-app.zap index 5fdeb3f38b60a8..16a11f8316f4e7 100644 --- a/examples/virtual-device-app/virtual-device-common/virtual-device-app.zap +++ b/examples/virtual-device-app/virtual-device-common/virtual-device-app.zap @@ -6416,7 +6416,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "ColorModeEnum", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -6432,7 +6432,7 @@ "code": 15, "mfgCode": null, "side": "server", - "type": "bitmap8", + "type": "OptionsBitmap", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -6464,7 +6464,7 @@ "code": 16385, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "EnhancedColorModeEnum", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -6480,7 +6480,7 @@ "code": 16394, "mfgCode": null, "side": "server", - "type": "bitmap16", + "type": "ColorCapabilitiesBitmap", "included": 1, "storageOption": "RAM", "singleton": 0, diff --git a/examples/window-app/common/window-app.zap b/examples/window-app/common/window-app.zap index ae2f7195f18070..7610434e4517e6 100644 --- a/examples/window-app/common/window-app.zap +++ b/examples/window-app/common/window-app.zap @@ -17,13 +17,6 @@ } ], "package": [ - { - "pathRelativity": "relativeToZap", - "path": "../../../src/app/zap-templates/app-templates.json", - "type": "gen-templates-json", - "category": "matter", - "version": "chip-v1" - }, { "pathRelativity": "relativeToZap", "path": "../../../src/app/zap-templates/zcl/zcl.json", @@ -31,6 +24,13 @@ "category": "matter", "version": 1, "description": "Matter SDK ZCL data" + }, + { + "pathRelativity": "relativeToZap", + "path": "../../../src/app/zap-templates/app-templates.json", + "type": "gen-templates-json", + "category": "matter", + "version": "chip-v1" } ], "endpointTypes": [ diff --git a/scripts/tools/zap/tests/inputs/all-clusters-app.zap b/scripts/tools/zap/tests/inputs/all-clusters-app.zap index ccc41909f62992..763b4f66c42140 100644 --- a/scripts/tools/zap/tests/inputs/all-clusters-app.zap +++ b/scripts/tools/zap/tests/inputs/all-clusters-app.zap @@ -17018,7 +17018,7 @@ "code": 5, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "DriftCompensationEnum", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17066,7 +17066,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "ColorModeEnum", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17082,7 +17082,7 @@ "code": 15, "mfgCode": null, "side": "server", - "type": "bitmap8", + "type": "OptionsBitmap", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17594,7 +17594,7 @@ "code": 16385, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "EnhancedColorModeEnum", "included": 1, "storageOption": "NVM", "singleton": 0, @@ -17690,7 +17690,7 @@ "code": 16394, "mfgCode": null, "side": "server", - "type": "bitmap16", + "type": "ColorCapabilitiesBitmap", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -18707,10 +18707,10 @@ "side": "server", "type": "bitmap32", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -24720,10 +24720,10 @@ "side": "server", "type": "bitmap32", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/scripts/tools/zap/tests/inputs/lighting-app.zap b/scripts/tools/zap/tests/inputs/lighting-app.zap index 9935fea81069d3..b0bb70a68fbe5d 100644 --- a/scripts/tools/zap/tests/inputs/lighting-app.zap +++ b/scripts/tools/zap/tests/inputs/lighting-app.zap @@ -5552,7 +5552,7 @@ "code": 8, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "ColorModeEnum", "included": 1, "storageOption": "NVM", "singleton": 0, @@ -5568,7 +5568,7 @@ "code": 15, "mfgCode": null, "side": "server", - "type": "bitmap8", + "type": "OptionsBitmap", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5616,7 +5616,7 @@ "code": 16385, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "EnhancedColorModeEnum", "included": 1, "storageOption": "NVM", "singleton": 0, @@ -5712,7 +5712,7 @@ "code": 16394, "mfgCode": null, "side": "server", - "type": "bitmap16", + "type": "ColorCapabilitiesBitmap", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5884,10 +5884,10 @@ "side": "server", "type": "bitmap32", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index c82cc3da84f30c..0c4c6a7a1a842e 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -3226,7 +3226,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -3239,10 +3239,10 @@ "side": "client", "type": "int16u", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -3491,7 +3491,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4910,10 +4910,10 @@ "side": "client", "type": "bitmap32", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4944,6 +4944,7 @@ "define": "THREAD_NETWORK_DIRECTORY_CLUSTER", "side": "client", "enabled": 1, + "apiMaturity": "provisional", "commands": [ { "name": "AddNetwork", @@ -5994,4 +5995,4 @@ "parentEndpointIdentifier": null } ] -} +} \ No newline at end of file diff --git a/src/darwin/Framework/CHIP/MTRDevice.mm b/src/darwin/Framework/CHIP/MTRDevice.mm index 134042f974dd54..44aac3b2ac56e0 100644 --- a/src/darwin/Framework/CHIP/MTRDevice.mm +++ b/src/darwin/Framework/CHIP/MTRDevice.mm @@ -111,33 +111,6 @@ - (void)_deviceInternalStateChanged:(MTRDevice *)device; #pragma mark - MTRDevice -typedef NS_ENUM(NSUInteger, MTRDeviceExpectedValueFieldIndex) { - MTRDeviceExpectedValueFieldExpirationTimeIndex = 0, - MTRDeviceExpectedValueFieldValueIndex = 1, - MTRDeviceExpectedValueFieldIDIndex = 2 -}; - -typedef NS_ENUM(NSUInteger, MTRDeviceReadRequestFieldIndex) { - MTRDeviceReadRequestFieldPathIndex = 0, - MTRDeviceReadRequestFieldParamsIndex = 1 -}; - -typedef NS_ENUM(NSUInteger, MTRDeviceWriteRequestFieldIndex) { - MTRDeviceWriteRequestFieldPathIndex = 0, - MTRDeviceWriteRequestFieldValueIndex = 1, - MTRDeviceWriteRequestFieldTimeoutIndex = 2, - MTRDeviceWriteRequestFieldExpectedValueIDIndex = 3, -}; - -typedef NS_ENUM(NSUInteger, MTRDeviceWorkItemBatchingID) { - MTRDeviceWorkItemBatchingReadID = 1, - MTRDeviceWorkItemBatchingWriteID = 2, -}; - -typedef NS_ENUM(NSUInteger, MTRDeviceWorkItemDuplicateTypeID) { - MTRDeviceWorkItemDuplicateReadTypeID = 1, -}; - @implementation MTRDeviceClusterData { NSMutableDictionary * _attributes; } @@ -238,20 +211,6 @@ - (BOOL)isEqual:(id)object @end -// Minimal time to wait since our last resubscribe failure before we will allow -// a read attempt to prod our subscription. -// -// TODO: Figure out a better value for this, but for now don't allow this to -// happen more often than once every 10 minutes. -#define MTRDEVICE_MIN_RESUBSCRIBE_DUE_TO_READ_INTERVAL_SECONDS (10 * 60) - -// Weight of new data in determining subscription latencies. To avoid random -// outliers causing too much noise in the value, treat an existing value (if -// any) as having 2/3 weight and the new value as having 1/3 weight. These -// weights are subject to change, if it's determined that different ones give -// better behavior. -#define MTRDEVICE_SUBSCRIPTION_LATENCY_NEW_VALUE_WEIGHT (1.0 / 3.0) - @interface MTRDevice () // protects against concurrent time updates by guarding timeUpdateScheduled flag which manages time updates scheduling, // and protects device calls to setUTCTime and setDSTOffset. This can't just be replaced with "lock", because the time @@ -267,21 +226,6 @@ @interface MTRDevice () @property (nonatomic) MTRInternalDeviceState internalDeviceState; -#define MTRDEVICE_SUBSCRIPTION_ATTEMPT_MIN_WAIT_SECONDS (1) -#define MTRDEVICE_SUBSCRIPTION_ATTEMPT_MAX_WAIT_SECONDS (3600) -@property (nonatomic) uint32_t lastSubscriptionAttemptWait; - -// Expected value cache is attributePath => NSArray of [NSDate of expiration time, NSDictionary of value, expected value ID] -// - See MTRDeviceExpectedValueFieldIndex for the definitions of indices into this array. -// See MTRDeviceResponseHandler definition for value dictionary details. -@property (nonatomic) NSMutableDictionary * expectedValueCache; - -// This is a monotonically increasing value used when adding entries to expectedValueCache -// Currently used/updated only in _getAttributesToReportWithNewExpectedValues:expirationTime:expectedValueID: -@property (nonatomic) uint64_t expectedValueNextID; - -@property (nonatomic) BOOL expirationCheckScheduled; - @property (nonatomic) BOOL timeUpdateScheduled; @property (nonatomic) NSMutableDictionary * temporaryMetaDataCache; @@ -379,7 +323,6 @@ - (instancetype)initWithNodeID:(NSNumber *)nodeID controller:(MTRDeviceControlle _deviceController = controller; _queue = dispatch_queue_create("org.csa-iot.matter.framework.device.workqueue", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - _expectedValueCache = [NSMutableDictionary dictionary]; _asyncWorkQueue = [[MTRAsyncWorkQueue alloc] initWithContext:self]; _state = MTRDeviceStateUnknown; _internalDeviceState = MTRInternalDeviceStateUnsubscribed; @@ -1145,77 +1088,6 @@ - (void)setStorageBehaviorConfiguration:(MTRDeviceStorageBehaviorConfiguration * [self _resetStorageBehaviorState]; } -- (BOOL)_interestedPaths:(NSArray * _Nullable)interestedPaths includesAttributePath:(MTRAttributePath *)attributePath -{ - for (id interestedPath in interestedPaths) { - if ([interestedPath isKindOfClass:[NSNumber class]]) { - NSNumber * interestedEndpointIDNumber = interestedPath; - if ([interestedEndpointIDNumber isEqualToNumber:attributePath.endpoint]) { - return YES; - } - } else if ([interestedPath isKindOfClass:[MTRClusterPath class]]) { - MTRClusterPath * interestedClusterPath = interestedPath; - if ([interestedClusterPath.cluster isEqualToNumber:attributePath.cluster]) { - return YES; - } - } else if ([interestedPath isKindOfClass:[MTRAttributePath class]]) { - MTRAttributePath * interestedAttributePath = interestedPath; - if (([interestedAttributePath.cluster isEqualToNumber:attributePath.cluster]) && ([interestedAttributePath.attribute isEqualToNumber:attributePath.attribute])) { - return YES; - } - } - } - - return NO; -} - -// Returns filtered set of attributes using an interestedPaths array. -// Returns nil if no attribute report has a path that matches the paths in the interestedPaths array. -- (NSArray *> *)_filteredAttributes:(NSArray *> *)attributes forInterestedPaths:(NSArray * _Nullable)interestedPaths -{ - if (!interestedPaths) { - return attributes; - } - - if (!interestedPaths.count) { - return nil; - } - - NSMutableArray * filteredAttributes = nil; - for (NSDictionary * responseValue in attributes) { - MTRAttributePath * attributePath = responseValue[MTRAttributePathKey]; - if ([self _interestedPaths:interestedPaths includesAttributePath:attributePath]) { - if (!filteredAttributes) { - filteredAttributes = [NSMutableArray array]; - } - [filteredAttributes addObject:responseValue]; - } - } - - if (filteredAttributes.count && (filteredAttributes.count != attributes.count)) { - MTR_LOG("%@ filtered attribute report %lu => %lu", self, static_cast(attributes.count), static_cast(filteredAttributes.count)); - } - - return filteredAttributes; -} - -// assume lock is held -- (void)_reportAttributes:(NSArray *> *)attributes -{ - os_unfair_lock_assert_owner(&self->_lock); - if (attributes.count) { - [self _iterateDelegatesWithBlock:^(MTRDeviceDelegateInfo * delegateInfo) { - // _iterateDelegatesWithBlock calls this with an autorelease pool, and so temporary filtered attributes reports don't bloat memory - NSArray *> * filteredAttributes = [self _filteredAttributes:attributes forInterestedPaths:delegateInfo.interestedPathsForAttributes]; - if (filteredAttributes.count) { - [delegateInfo callDelegateWithBlock:^(id delegate) { - [delegate device:self receivedAttributeReport:filteredAttributes]; - }]; - } - }]; - } -} - #ifdef DEBUG - (void)unitTestInjectEventReport:(NSArray *> *)eventReport { @@ -1228,60 +1100,6 @@ - (void)unitTestInjectAttributeReport:(NSArray *> * } #endif -- (BOOL)_interestedPaths:(NSArray * _Nullable)interestedPaths includesEventPath:(MTREventPath *)eventPath -{ - for (id interestedPath in interestedPaths) { - if ([interestedPath isKindOfClass:[NSNumber class]]) { - NSNumber * interestedEndpointIDNumber = interestedPath; - if ([interestedEndpointIDNumber isEqualToNumber:eventPath.endpoint]) { - return YES; - } - } else if ([interestedPath isKindOfClass:[MTRClusterPath class]]) { - MTRClusterPath * interestedClusterPath = interestedPath; - if ([interestedClusterPath.cluster isEqualToNumber:eventPath.cluster]) { - return YES; - } - } else if ([interestedPath isKindOfClass:[MTREventPath class]]) { - MTREventPath * interestedEventPath = interestedPath; - if (([interestedEventPath.cluster isEqualToNumber:eventPath.cluster]) && ([interestedEventPath.event isEqualToNumber:eventPath.event])) { - return YES; - } - } - } - - return NO; -} - -// Returns filtered set of events using an interestedPaths array. -// Returns nil if no event report has a path that matches the paths in the interestedPaths array. -- (NSArray *> *)_filteredEvents:(NSArray *> *)events forInterestedPaths:(NSArray * _Nullable)interestedPaths -{ - if (!interestedPaths) { - return events; - } - - if (!interestedPaths.count) { - return nil; - } - - NSMutableArray * filteredEvents = nil; - for (NSDictionary * responseValue in events) { - MTREventPath * eventPath = responseValue[MTREventPathKey]; - if ([self _interestedPaths:interestedPaths includesEventPath:eventPath]) { - if (!filteredEvents) { - filteredEvents = [NSMutableArray array]; - } - [filteredEvents addObject:responseValue]; - } - } - - if (filteredEvents.count && (filteredEvents.count != events.count)) { - MTR_LOG("%@ filtered event report %lu => %lu", self, static_cast(events.count), static_cast(filteredEvents.count)); - } - - return filteredEvents; -} - #ifdef DEBUG - (void)unitTestClearClusterData { @@ -1517,90 +1335,12 @@ - (void)_invokeCommandWithEndpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue completion:(MTRDeviceResponseHandler)completion { - if (!expectedValueInterval || ([expectedValueInterval compare:@(0)] == NSOrderedAscending)) { - expectedValues = nil; - } else { - expectedValueInterval = MTRClampedNumber(expectedValueInterval, @(1), @(UINT32_MAX)); - } - - serverSideProcessingTimeout = [serverSideProcessingTimeout copy]; - timeout = [timeout copy]; - - if (timeout == nil && MTRCommandNeedsTimedInvoke(clusterID, commandID)) { - timeout = @(MTR_DEFAULT_TIMED_INTERACTION_TIMEOUT_MS); - } - - NSDate * cutoffTime; - if (timeout) { - cutoffTime = [NSDate dateWithTimeIntervalSinceNow:(timeout.doubleValue / 1000)]; - } - - uint64_t expectedValueID = 0; - NSMutableArray * attributePaths = nil; - if (expectedValues) { - [self setExpectedValues:expectedValues expectedValueInterval:expectedValueInterval expectedValueID:&expectedValueID]; - attributePaths = [NSMutableArray array]; - for (NSDictionary * expectedValue in expectedValues) { - [attributePaths addObject:expectedValue[MTRAttributePathKey]]; - } - } - MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.queue]; - uint64_t workItemID = workItem.uniqueID; // capture only the ID, not the work item - // The command operation will install a duplicate check handler, to return NO for "isDuplicate". Since a command operation may - // change values, only read requests after this should be considered for duplicate requests. - [workItem setDuplicateTypeID:MTRDeviceWorkItemDuplicateReadTypeID handler:^(id opaqueItemData, BOOL * isDuplicate, BOOL * stop) { - *isDuplicate = NO; - *stop = YES; - }]; - [workItem setReadyHandler:^(MTRDevice * self, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { - auto workDone = ^(NSArray *> * _Nullable values, NSError * _Nullable error) { - dispatch_async(queue, ^{ - completion(values, error); - }); - if (error && expectedValues) { - [self removeExpectedValuesForAttributePaths:attributePaths expectedValueID:expectedValueID]; - } - workCompletion(MTRAsyncWorkComplete); - }; - - NSNumber * timedInvokeTimeout = nil; - if (timeout) { - auto * now = [NSDate now]; - if ([now compare:cutoffTime] == NSOrderedDescending) { - // Our timed invoke timeout has expired already. Command - // was queued for too long. Do not send it out. - workDone(nil, [MTRError errorForIMStatusCode:Status::Timeout]); - return; - } - - // Recompute the actual timeout left, accounting for time spent - // in our queuing and retries. - timedInvokeTimeout = @([cutoffTime timeIntervalSinceDate:now] * 1000); - } - MTRBaseDevice * baseDevice = [self newBaseDevice]; - [baseDevice - _invokeCommandWithEndpointID:endpointID - clusterID:clusterID - commandID:commandID - commandFields:commandFields - timedInvokeTimeout:timedInvokeTimeout - serverSideProcessingTimeout:serverSideProcessingTimeout - queue:self.queue - completion:^(NSArray *> * _Nullable values, NSError * _Nullable error) { - // Log the data at the INFO level (not usually persisted permanently), - // but make sure we log the work completion at the DEFAULT level. - MTR_LOG("Invoke work item [%llu] received command response: %@ error: %@", workItemID, values, error); - // TODO: This 5-retry cap is very arbitrary. - // TODO: Should there be some sort of backoff here? - if (error != nil && error.domain == MTRInteractionErrorDomain && error.code == MTRInteractionErrorCodeBusy && retryCount < 5) { - workCompletion(MTRAsyncWorkNeedsRetry); - return; - } - - workDone(values, error); - }]; - }]; - [_asyncWorkQueue enqueueWorkItem:workItem descriptionWithFormat:@"invoke %@ 0x%llx 0x%llx", endpointID, clusterID.unsignedLongLongValue, commandID.unsignedLongLongValue]; +#define MTRDeviceErrorStr "MTRDevice _invokeCommandWithEndpointID: must be handled by subclasses" + MTR_LOG_ERROR(MTRDeviceErrorStr); +#ifdef DEBUG + NSAssert(NO, @MTRDeviceErrorStr); +#endif // DEBUG +#undef MTRDeviceErrorStr } - (void)_invokeKnownCommandWithEndpointID:(NSNumber *)endpointID @@ -1692,93 +1432,6 @@ - (void)downloadLogOfType:(MTRDiagnosticLogType)type #pragma mark - Cache management -// assume lock is held -- (void)_checkExpiredExpectedValues -{ - os_unfair_lock_assert_owner(&self->_lock); - - // find expired attributes, and calculate next timer fire date - NSDate * now = [NSDate date]; - NSDate * nextExpirationDate = nil; - // Set of NSArray with 2 elements [path, value] - this is used in this method only - NSMutableSet * attributeInfoToRemove = [NSMutableSet set]; - for (MTRAttributePath * attributePath in _expectedValueCache) { - NSArray * expectedValue = _expectedValueCache[attributePath]; - NSDate * attributeExpirationDate = expectedValue[MTRDeviceExpectedValueFieldExpirationTimeIndex]; - if (expectedValue) { - if ([now compare:attributeExpirationDate] == NSOrderedDescending) { - // expired - save [path, values] pair to attributeToRemove - [attributeInfoToRemove addObject:@[ attributePath, expectedValue[MTRDeviceExpectedValueFieldValueIndex] ]]; - } else { - // get the next expiration date - if (!nextExpirationDate || [nextExpirationDate compare:attributeExpirationDate] == NSOrderedDescending) { - nextExpirationDate = attributeExpirationDate; - } - } - } - } - - // remove from expected value cache and report attributes as needed - NSMutableArray * attributesToReport = [NSMutableArray array]; - NSMutableArray * attributePathsToReport = [NSMutableArray array]; - for (NSArray * attributeInfo in attributeInfoToRemove) { - // compare with known value and mark for report if different - MTRAttributePath * attributePath = attributeInfo[0]; - NSDictionary * attributeDataValue = attributeInfo[1]; - NSDictionary * cachedAttributeDataValue = [self _cachedAttributeValueForPath:attributePath]; - if (cachedAttributeDataValue - && ![self _attributeDataValue:attributeDataValue isEqualToDataValue:cachedAttributeDataValue]) { - [attributesToReport addObject:@{ MTRAttributePathKey : attributePath, MTRDataKey : cachedAttributeDataValue, MTRPreviousDataKey : attributeDataValue }]; - [attributePathsToReport addObject:attributePath]; - } - - _expectedValueCache[attributePath] = nil; - } - - // log attribute paths - MTR_LOG("%@ report from expired expected values %@", self, attributePathsToReport); - [self _reportAttributes:attributesToReport]; - -// Have a reasonable minimum wait time for expiration timers -#define MTR_DEVICE_EXPIRATION_CHECK_TIMER_MINIMUM_WAIT_TIME (0.1) - - if (nextExpirationDate && _expectedValueCache.count && !self.expirationCheckScheduled) { - NSTimeInterval waitTime = [nextExpirationDate timeIntervalSinceDate:now]; - if (waitTime < MTR_DEVICE_EXPIRATION_CHECK_TIMER_MINIMUM_WAIT_TIME) { - waitTime = MTR_DEVICE_EXPIRATION_CHECK_TIMER_MINIMUM_WAIT_TIME; - } - mtr_weakify(self); - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t) (waitTime * NSEC_PER_SEC)), self.queue, ^{ - mtr_strongify(self); - [self _performScheduledExpirationCheck]; - }); - } -} - -- (void)_performScheduledExpirationCheck -{ - std::lock_guard lock(_lock); - - self.expirationCheckScheduled = NO; - [self _checkExpiredExpectedValues]; -} - -- (BOOL)_attributeDataValue:(NSDictionary *)one isEqualToDataValue:(NSDictionary *)theOther -{ - // Sanity check for nil cases - if (!one && !theOther) { - MTR_LOG_ERROR("%@ attribute data-value comparison does not expect comparing two nil dictionaries", self); - return YES; - } - if (!one || !theOther) { - // Comparing against nil is expected, and should return NO quietly - return NO; - } - - // Attribute data-value dictionaries are equal if type and value are equal, and specifically, this should return true if values are both nil - return [one[MTRTypeKey] isEqual:theOther[MTRTypeKey]] && ((one[MTRValueKey] == theOther[MTRValueKey]) || [one[MTRValueKey] isEqual:theOther[MTRValueKey]]); -} - // Utility to return data value dictionary without data version - (NSDictionary *)_dataValueWithoutDataVersion:(NSDictionary *)attributeValue { @@ -1887,169 +1540,6 @@ - (BOOL)deviceCachePrimed return _deviceCachePrimed; } -// If value is non-nil, associate with expectedValueID -// If value is nil, remove only if expectedValueID matches -// previousValue is an out parameter -- (void)_setExpectedValue:(NSDictionary *)expectedAttributeValue - attributePath:(MTRAttributePath *)attributePath - expirationTime:(NSDate *)expirationTime - shouldReportValue:(BOOL *)shouldReportValue - attributeValueToReport:(NSDictionary **)attributeValueToReport - expectedValueID:(uint64_t)expectedValueID - previousValue:(NSDictionary **)previousValue -{ - os_unfair_lock_assert_owner(&self->_lock); - - *shouldReportValue = NO; - - NSArray * previousExpectedValue = _expectedValueCache[attributePath]; - if (previousExpectedValue) { - if (expectedAttributeValue - && ![self _attributeDataValue:expectedAttributeValue - isEqualToDataValue:previousExpectedValue[MTRDeviceExpectedValueFieldValueIndex]]) { - // Case where new expected value overrides previous expected value - report new expected value - *shouldReportValue = YES; - *attributeValueToReport = expectedAttributeValue; - *previousValue = previousExpectedValue[MTRDeviceExpectedValueFieldValueIndex]; - } else if (!expectedAttributeValue) { - // Remove previous expected value only if it's from the same setExpectedValues operation - NSNumber * previousExpectedValueID = previousExpectedValue[MTRDeviceExpectedValueFieldIDIndex]; - if (previousExpectedValueID.unsignedLongLongValue == expectedValueID) { - MTRDeviceDataValueDictionary cachedValue = [self _cachedAttributeValueForPath:attributePath]; - if (![self _attributeDataValue:previousExpectedValue[MTRDeviceExpectedValueFieldValueIndex] - isEqualToDataValue:cachedValue]) { - // Case of removing expected value that is different than read cache - report read cache value - *shouldReportValue = YES; - *attributeValueToReport = cachedValue; - *previousValue = previousExpectedValue[MTRDeviceExpectedValueFieldValueIndex]; - _expectedValueCache[attributePath] = nil; - } - } - } - } else { - MTRDeviceDataValueDictionary cachedValue = [self _cachedAttributeValueForPath:attributePath]; - if (expectedAttributeValue - && ![self _attributeDataValue:expectedAttributeValue isEqualToDataValue:cachedValue]) { - // Case where new expected value is different than read cache - report new expected value - *shouldReportValue = YES; - *attributeValueToReport = expectedAttributeValue; - *previousValue = cachedValue; - } else { - *previousValue = nil; - } - - // No need to report if new and previous expected value are both nil - } - - if (expectedAttributeValue) { - _expectedValueCache[attributePath] = @[ expirationTime, expectedAttributeValue, @(expectedValueID) ]; - } -} - -// assume lock is held -- (NSArray *)_getAttributesToReportWithNewExpectedValues:(NSArray *> *)expectedAttributeValues - expirationTime:(NSDate *)expirationTime - expectedValueID:(uint64_t *)expectedValueID -{ - os_unfair_lock_assert_owner(&self->_lock); - uint64_t expectedValueIDToReturn = _expectedValueNextID++; - - NSMutableArray * attributesToReport = [NSMutableArray array]; - NSMutableArray * attributePathsToReport = [NSMutableArray array]; - for (NSDictionary * attributeResponseValue in expectedAttributeValues) { - MTRAttributePath * attributePath = attributeResponseValue[MTRAttributePathKey]; - NSDictionary * attributeDataValue = attributeResponseValue[MTRDataKey]; - - BOOL shouldReportValue = NO; - NSDictionary * attributeValueToReport; - NSDictionary * previousValue; - [self _setExpectedValue:attributeDataValue - attributePath:attributePath - expirationTime:expirationTime - shouldReportValue:&shouldReportValue - attributeValueToReport:&attributeValueToReport - expectedValueID:expectedValueIDToReturn - previousValue:&previousValue]; - - if (shouldReportValue) { - if (previousValue) { - [attributesToReport addObject:@{ MTRAttributePathKey : attributePath, MTRDataKey : attributeValueToReport, MTRPreviousDataKey : previousValue }]; - } else { - [attributesToReport addObject:@{ MTRAttributePathKey : attributePath, MTRDataKey : attributeValueToReport }]; - } - [attributePathsToReport addObject:attributePath]; - } - } - if (expectedValueID) { - *expectedValueID = expectedValueIDToReturn; - } - - MTR_LOG("%@ report from new expected values %@", self, attributePathsToReport); - - return attributesToReport; -} - -// expectedValueID is an out-argument that returns an identifier to be used when removing expected values -- (void)setExpectedValues:(NSArray *> *)values - expectedValueInterval:(NSNumber *)expectedValueInterval - expectedValueID:(uint64_t *)expectedValueID -{ - // since NSTimeInterval is in seconds, convert ms into seconds in double - NSDate * expirationTime = [NSDate dateWithTimeIntervalSinceNow:expectedValueInterval.doubleValue / 1000]; - - MTR_LOG( - "%@ Setting expected values %@ with expiration time %f seconds from now", self, values, [expirationTime timeIntervalSinceNow]); - - std::lock_guard lock(_lock); - - // _getAttributesToReportWithNewExpectedValues will log attribute paths reported - NSArray * attributesToReport = [self _getAttributesToReportWithNewExpectedValues:values - expirationTime:expirationTime - expectedValueID:expectedValueID]; - [self _reportAttributes:attributesToReport]; - - [self _checkExpiredExpectedValues]; -} - -- (void)removeExpectedValuesForAttributePaths:(NSArray *)attributePaths - expectedValueID:(uint64_t)expectedValueID -{ - std::lock_guard lock(_lock); - - for (MTRAttributePath * attributePath in attributePaths) { - [self _removeExpectedValueForAttributePath:attributePath expectedValueID:expectedValueID]; - } -} - -- (void)_removeExpectedValueForAttributePath:(MTRAttributePath *)attributePath expectedValueID:(uint64_t)expectedValueID -{ - os_unfair_lock_assert_owner(&self->_lock); - - BOOL shouldReportValue; - NSDictionary * attributeValueToReport; - NSDictionary * previousValue; - [self _setExpectedValue:nil - attributePath:attributePath - expirationTime:nil - shouldReportValue:&shouldReportValue - attributeValueToReport:&attributeValueToReport - expectedValueID:expectedValueID - previousValue:&previousValue]; - - MTR_LOG("%@ remove expected value for path %@ should report %@", self, attributePath, shouldReportValue ? @"YES" : @"NO"); - - if (shouldReportValue) { - NSMutableDictionary * attribute = [NSMutableDictionary dictionaryWithObject:attributePath forKey:MTRAttributePathKey]; - if (attributeValueToReport) { - attribute[MTRDataKey] = attributeValueToReport; - } - if (previousValue) { - attribute[MTRPreviousDataKey] = previousValue; - } - [self _reportAttributes:@[ attribute ]]; - } -} - - (MTRBaseDevice *)newBaseDevice { return [MTRBaseDevice deviceWithNodeID:self.nodeID controller:self.deviceController]; diff --git a/src/platform/Zephyr/wifi/WiFiManager.cpp b/src/platform/Zephyr/wifi/WiFiManager.cpp index 11187a7cef1655..01d0d937b19b3a 100644 --- a/src/platform/Zephyr/wifi/WiFiManager.cpp +++ b/src/platform/Zephyr/wifi/WiFiManager.cpp @@ -347,7 +347,8 @@ void WiFiManager::ScanResultHandler(Platform::UniquePtr data) Instance().mWiFiParams.mParams.security = scanResult->security <= WIFI_SECURITY_TYPE_MAX ? scanResult->security : WIFI_SECURITY_TYPE_PSK; Instance().mWiFiParams.mParams.psk_length = static_cast(Instance().mWantedNetwork.passLen); - Instance().mWiFiParams.mParams.mfp = (scanResult->mfp == WIFI_MFP_REQUIRED) ? WIFI_MFP_REQUIRED : WIFI_MFP_OPTIONAL; + Instance().mWiFiParams.mParams.mfp = scanResult->mfp; + Instance().mWiFiParams.mParams.band = scanResult->band; // If the security is none, WiFi driver expects the psk to be nullptr if (Instance().mWiFiParams.mParams.security == WIFI_SECURITY_TYPE_NONE) diff --git a/src/platform/silabs/CHIPDevicePlatformConfig.h b/src/platform/silabs/CHIPDevicePlatformConfig.h index 091940bff31291..010d72ebb887eb 100644 --- a/src/platform/silabs/CHIPDevicePlatformConfig.h +++ b/src/platform/silabs/CHIPDevicePlatformConfig.h @@ -130,7 +130,11 @@ // ========== Platform-specific Configuration Overrides ========= #ifndef CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE +#if SLI_SI91X_MCU_INTERFACE +#define CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE (7 * 1024) +#else #define CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE (6 * 1024) +#endif #endif // CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE #ifndef CHIP_DEVICE_CONFIG_THREAD_TASK_STACK_SIZE diff --git a/src/python_testing/TC_ACL_2_11.py b/src/python_testing/TC_ACL_2_11.py new file mode 100644 index 00000000000000..a979b1ca3f5b1a --- /dev/null +++ b/src/python_testing/TC_ACL_2_11.py @@ -0,0 +1,172 @@ +# +# Copyright (c) 2024 Project CHIP Authors +# All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# See https://github.com/project-chip/connectedhomeip/blob/master/docs/testing/python.md#defining-the-ci-test-arguments +# for details about the block below. +# +# === BEGIN CI TEST ARGUMENTS === +# test-runner-runs: run1 +# test-runner-run/run1/app: ${NETWORK_MANAGEMENT_APP} +# test-runner-run/run1/factoryreset: True +# test-runner-run/run1/quiet: True +# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json --commissioning-arl-entries "[{\"endpoint\": 1,\"cluster\": 1105,\"restrictions\": [{\"type\": 0,\"id\": 0}]}]" --arl-entries "[{\"endpoint\": 1,\"cluster\": 1105,\"restrictions\": [{\"type\": 0,\"id\": 0}]}]" +# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# === END CI TEST ARGUMENTS === + +import logging +import queue + +import chip.clusters as Clusters +from chip.clusters.Attribute import EventReadResult, SubscriptionTransaction +from chip.clusters.ClusterObjects import ALL_ACCEPTED_COMMANDS, ALL_ATTRIBUTES, ALL_CLUSTERS, ClusterEvent +from chip.clusters.Objects import AccessControl +from chip.interaction_model import Status +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from mobly import asserts + + +class EventChangeCallback: + def __init__(self, expected_event: ClusterEvent, output: queue.Queue): + self._output = output + self._expected_cluster_id = expected_event.cluster_id + self._expected_event_id = expected_event.event_id + + def __call__(self, res: EventReadResult, transaction: SubscriptionTransaction): + if res.Status == Status.Success and res.Header.ClusterId == self._expected_cluster_id and res.Header.EventId == self._expected_event_id: + logging.info( + f'Got subscription report for event {self._expected_event_id} on cluster {self._expected_cluster_id}: {res.Data}') + self._output.put(res) + + +def WaitForEventReport(q: queue.Queue, expected_event: ClusterEvent): + try: + res = q.get(block=True, timeout=10) + except queue.Empty: + asserts.fail("Failed to receive a report for the event {}".format(expected_event)) + + asserts.assert_equal(res.Header.ClusterId, expected_event.cluster_id, "Expected cluster ID not found in event report") + asserts.assert_equal(res.Header.EventId, expected_event.event_id, "Expected event ID not found in event report") + + +class TC_ACL_2_11(MatterBaseTest): + + def desc_TC_ACL_2_11(self) -> str: + return "[TC-ACL-2.11] Verification of Managed Device feature" + + def steps_TC_ACL_2_11(self) -> list[TestStep]: + steps = [ + TestStep(1, "Commissioning, already done"), + TestStep(2, "TH1 reads DUT Endpoint 0 AccessControl cluster CommissioningARL attribute"), + TestStep(3, "TH1 reads DUT Endpoint 0 AccessControl cluster ARL attribute"), + TestStep(4, "For each entry in ARL, iterate over each restriction and attempt access the restriction's ID on the Endpoint and Cluster in the ARL entry.", + "If the restriction is Type AttributeAccessForbidden, read the restriction's attribute ID and verify the response is UNSUPPORTED_ACCESS." + "If the restriction is Type AttributeWriteForbidden, write restriction's the attribute ID and verify the response is UNSUPPORTED_ACCESS." + "If the restriction is Type CommandForbidden, invoke the restriction's command ID and verify the response is UNSUPPORTED_ACCESS."), + TestStep(5, "TH1 sends DUT Endpoint 0 AccessControl cluster command ReviewFabricRestrictions"), + TestStep(6, "Wait for up to 1 hour. Follow instructions provided by device maker to remove all access restrictions", + "AccessRestrictionReviewUpdate event is received"), + TestStep(7, "TH1 reads DUT Endpoint 0 AccessControl cluster ARL attribute", "ARL is empty") + ] + return steps + + @async_test_body + async def test_TC_ACL_2_11(self): + self.step(1) + self.step(2) + await self.read_single_attribute_check_success( + endpoint=0, + cluster=Clusters.AccessControl, + attribute=Clusters.AccessControl.Attributes.CommissioningARL + ) + self.step(3) + arl = await self.read_single_attribute_check_success( + endpoint=0, + cluster=Clusters.AccessControl, + attribute=Clusters.AccessControl.Attributes.Arl + ) + self.step(4) + + care_struct = None + + for arl_entry in arl: + E1 = arl_entry.endpoint + C1 = arl_entry.cluster + R1 = arl_entry.restrictions + + care_struct = Clusters.AccessControl.Structs.AccessRestrictionEntryStruct(E1, C1, R1) + + cluster = ALL_CLUSTERS[C1] + + for restriction in R1: + restriction_type = restriction.type + ID1 = restriction.id + + attribute = ALL_ATTRIBUTES[C1][ID1] + command = ALL_ACCEPTED_COMMANDS[C1][ID1] + + if restriction_type == AccessControl.Enums.AccessRestrictionTypeEnum.kAttributeAccessForbidden: + await self.read_single_attribute_expect_error(cluster=cluster, attribute=attribute, error=Status.UnsupportedAccess, endpoint=E1) + elif restriction_type == AccessControl.Enums.AccessRestrictionTypeEnum.kAttributeWriteForbidden: + status = await self.write_single_attribute(attribute_value=attribute, endpoint_id=E1) + asserts.assert_equal(status, Status.UnsupportedAccess, + f"Failed to verify UNSUPPORTED_ACCESS when writing to Attribute {ID1} Cluster {C1} Endpoint {E1}") + elif restriction_type == AccessControl.Enums.AccessRestrictionTypeEnum.kCommandForbidden: + result = await self.send_single_cmd(cmd=command, endpoint=E1) + asserts.assert_equal(result.status, Status.UnsupportedAccess, + f"Failed to verify UNSUPPORTED_ACCESS when sending command {ID1} to Cluster {C1} Endpoint {E1}") + + # Belongs to step 6, but needs to be subscribed before executing step 5: begin + arru_queue = queue.Queue() + arru_cb = EventChangeCallback(Clusters.AccessControl.Events.FabricRestrictionReviewUpdate, arru_queue) + + urgent = 1 + subscription_arru = await self.default_controller.ReadEvent(nodeid=self.dut_node_id, events=[(0, Clusters.AccessControl.Events.FabricRestrictionReviewUpdate, urgent)], reportInterval=(1, 5), keepSubscriptions=True, autoResubscribe=False) + subscription_arru.SetEventUpdateCallback(callback=arru_cb) + # end + + # Belongs to step 7, but needs to be subscribed before executing step 5: begin + arec_queue = queue.Queue() + arec_cb = EventChangeCallback(Clusters.AccessControl.Events.AccessRestrictionEntryChanged, arec_queue) + + urgent = 1 + subscription_arec = await self.default_controller.ReadEvent(nodeid=self.dut_node_id, events=[(0, Clusters.AccessControl.Events.AccessRestrictionEntryChanged, urgent)], reportInterval=(1, 5), keepSubscriptions=True, autoResubscribe=False) + subscription_arec.SetEventUpdateCallback(callback=arec_cb) + # end + + self.step(5) + response = await self.send_single_cmd(cmd=Clusters.AccessControl.Commands.ReviewFabricRestrictions([care_struct]), endpoint=0) + asserts.assert_true(isinstance(response, Clusters.AccessControl.Commands.ReviewFabricRestrictionsResponse), + "Result is not of type ReviewFabricRestrictionsResponse") + + self.step(6) + logging.info("Please follow instructions provided by the product maker to remove all ARL entries") + WaitForEventReport(arru_queue, Clusters.AccessControl.Events.FabricRestrictionReviewUpdate) + + self.step(7) + cluster = Clusters.AccessControl + attribute = Clusters.AccessControl.Attributes.Arl + arl = await self.read_single_attribute_check_success( + node_id=self.dut_node_id, + endpoint=0, + cluster=cluster, + attribute=attribute + ) + asserts.assert_equal(arl, [], "Unexpected Arl; Not empty") + + +if __name__ == "__main__": + default_matter_test_main() diff --git a/src/python_testing/TC_BRBINFO_4_1.py b/src/python_testing/TC_BRBINFO_4_1.py index 5e1474adc35038..595d87912ad012 100644 --- a/src/python_testing/TC_BRBINFO_4_1.py +++ b/src/python_testing/TC_BRBINFO_4_1.py @@ -129,14 +129,16 @@ async def setup_class(self): asserts.fail('This test requires a TH_ICD_SERVER app. Specify app path with --string-arg th_icd_server_app_path:') self.kvs = f'kvs_{str(uuid.uuid4())}' - self.port = 5543 discriminator = 3850 passcode = 20202021 - app_args = f'--secured-device-port {self.port} --discriminator {discriminator} --passcode {passcode} --KVS {self.kvs} ' - cmd = f'{app} {app_args}' + cmd = [app] + cmd.extend(['--secured-device-port', str(5543)]) + cmd.extend(['--discriminator', str(discriminator)]) + cmd.extend(['--passcode', str(passcode)]) + cmd.extend(['--KVS', self.kvs]) logging.info("Starting ICD Server App") - self.app_process = subprocess.Popen(cmd, bufsize=0, shell=True) + self.app_process = subprocess.Popen(cmd) logging.info("ICD started") time.sleep(3) diff --git a/src/python_testing/TC_CCTRL_2_3.py b/src/python_testing/TC_CCTRL_2_3.py new file mode 100644 index 00000000000000..c733235f635ff8 --- /dev/null +++ b/src/python_testing/TC_CCTRL_2_3.py @@ -0,0 +1,176 @@ +# +# Copyright (c) 2024 Project CHIP Authors +# All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# See https://github.com/project-chip/connectedhomeip/blob/master/docs/testing/python.md#defining-the-ci-test-arguments +# for details about the block below. +# +# TODO: Skip CI for now, we don't have any way to run this. Needs setup. See test_TC_CCTRL.py + +# This test requires a TH_SERVER application. Please specify with --string-arg th_server_app_path: + +import logging +import os +import random +import signal +import subprocess +import time +import uuid + +import chip.clusters as Clusters +from chip import ChipDeviceCtrl +from chip.interaction_model import InteractionModelError, Status +from matter_testing_support import (MatterBaseTest, TestStep, async_test_body, default_matter_test_main, has_cluster, + per_endpoint_test) +from mobly import asserts + + +class TC_CCTRL_2_3(MatterBaseTest): + + @async_test_body + async def setup_class(self): + super().setup_class() + self.app_process = None + app = self.user_params.get("th_server_app_path", None) + if not app: + asserts.fail('This test requires a TH_SERVER app. Specify app path with --string-arg th_server_app_path:') + + self.kvs = f'kvs_{str(uuid.uuid4())}' + self.port = 5543 + discriminator = random.randint(0, 4095) + passcode = 20202021 + app_args = f'--secured-device-port {self.port} --discriminator {discriminator} --passcode {passcode} --KVS {self.kvs}' + cmd = f'{app} {app_args}' + # TODO: Determine if we want these logs cooked or pushed to somewhere else + logging.info("Starting TH_SERVER") + self.app_process = subprocess.Popen(cmd, bufsize=0, shell=True) + logging.info("TH_SERVER started") + time.sleep(3) + + logging.info("Commissioning from separate fabric") + + # Create a second controller on a new fabric to communicate to the server + new_certificate_authority = self.certificate_authority_manager.NewCertificateAuthority() + new_fabric_admin = new_certificate_authority.NewFabricAdmin(vendorId=0xFFF1, fabricId=2) + paa_path = str(self.matter_test_config.paa_trust_store_path) + self.TH_server_controller = new_fabric_admin.NewController(nodeId=112233, paaTrustStorePath=paa_path) + self.server_nodeid = 1111 + await self.TH_server_controller.CommissionOnNetwork(nodeId=self.server_nodeid, setupPinCode=passcode, filterType=ChipDeviceCtrl.DiscoveryFilterType.LONG_DISCRIMINATOR, filter=discriminator) + logging.info("Commissioning TH_SERVER complete") + + def teardown_class(self): + # In case the th_server_app_path does not exist, then we failed the test + # and there is nothing to remove + if self.app_process is not None: + logging.warning("Stopping app with SIGTERM") + self.app_process.send_signal(signal.SIGTERM.value) + self.app_process.wait() + + if os.path.exists(self.kvs): + os.remove(self.kvs) + + super().teardown_class() + + def steps_TC_CCTRL_2_3(self) -> list[TestStep]: + steps = [TestStep(1, "Get number of fabrics from TH_SERVER", is_commissioning=True), + TestStep(2, "Reading Attribute VendorId from TH_SERVER"), + TestStep(3, "Reading Attribute ProductId from TH_SERVER"), + TestStep(4, "Send RequestCommissioningApproval command to DUT with CASE session with correct VendorId and ProductId"), + TestStep(5, "(Manual Step) Approve Commissioning Approval Request on DUT using method indicated by the manufacturer"), + TestStep(6, "Reading Event CommissioningRequestResult from DUT, confirm one new event"), + TestStep(7, "Send another RequestCommissioningApproval command to DUT with CASE session with same RequestId as the previous one"), + TestStep(8, "Send CommissionNode command to DUT with CASE session, with valid parameters"), + TestStep(9, "Send another CommissionNode command to DUT with CASE session, with with same RequestId as the previous one"), + TestStep(10, "Send OpenCommissioningWindow command on Administrator Commissioning Cluster sent to TH_SERVER"), + TestStep(11, "Wait for DUT to successfully commission TH_SERVER, 30 seconds"), + TestStep(12, "Get number of fabrics from TH_SERVER, verify DUT successfully commissioned TH_SERVER")] + + return steps + + @per_endpoint_test(has_cluster(Clusters.CommissionerControl)) + async def test_TC_CCTRL_2_3(self): + self.is_ci = self.check_pics('PICS_SDK_CI_ONLY') + + self.step(1) + th_server_fabrics = await self.read_single_attribute_check_success(cluster=Clusters.OperationalCredentials, attribute=Clusters.OperationalCredentials.Attributes.Fabrics, dev_ctrl=self.TH_server_controller, node_id=self.server_nodeid, endpoint=0, fabric_filtered=False) + + self.step(2) + th_server_vid = await self.read_single_attribute_check_success(cluster=Clusters.BasicInformation, attribute=Clusters.BasicInformation.Attributes.VendorID, dev_ctrl=self.TH_server_controller, node_id=self.server_nodeid, endpoint=0) + + self.step(3) + th_server_pid = await self.read_single_attribute_check_success(cluster=Clusters.BasicInformation, attribute=Clusters.BasicInformation.Attributes.ProductID, dev_ctrl=self.TH_server_controller, node_id=self.server_nodeid, endpoint=0) + + self.step(4) + good_request_id = 0x1234567812345678 + cmd = Clusters.CommissionerControl.Commands.RequestCommissioningApproval( + requestId=good_request_id, vendorId=th_server_vid, productId=th_server_pid, label="Test Ecosystem") + await self.send_single_cmd(cmd=cmd) + + self.step(5) + if not self.is_ci: + self.wait_for_user_input("Approve Commissioning approval request using manufacturer specified mechanism") + + self.step(6) + event_path = [(self.matter_test_config.endpoint, Clusters.CommissionerControl.Events.CommissioningRequestResult, 1)] + events = await self.default_controller.ReadEvent(nodeid=self.dut_node_id, events=event_path) + asserts.assert_equal(len(events), 1, "Unexpected event list len") + asserts.assert_equal(events[0].Data.statusCode, 0, "Unexpected status code") + asserts.assert_equal(events[0].Data.clientNodeId, + self.matter_test_config.controller_node_id, "Unexpected client node id") + asserts.assert_equal(events[0].Data.requestId, good_request_id, "Unexpected request ID") + + self.step(7) + cmd = Clusters.CommissionerControl.Commands.RequestCommissioningApproval( + requestId=good_request_id, vendorId=th_server_vid, productId=th_server_pid) + try: + await self.send_single_cmd(cmd=cmd) + asserts.fail("Unexpected success on CommissionNode") + except InteractionModelError as e: + asserts.assert_equal(e.status, Status.Failure, "Incorrect error returned") + + self.step(8) + cmd = Clusters.CommissionerControl.Commands.CommissionNode(requestId=good_request_id, responseTimeoutSeconds=30) + resp = await self.send_single_cmd(cmd) + asserts.assert_equal(type(resp), Clusters.CommissionerControl.Commands.ReverseOpenCommissioningWindow, + "Incorrect response type") + + self.step(9) + cmd = Clusters.CommissionerControl.Commands.CommissionNode(requestId=good_request_id, responseTimeoutSeconds=30) + try: + await self.send_single_cmd(cmd=cmd) + asserts.fail("Unexpected success on CommissionNode") + except InteractionModelError as e: + asserts.assert_equal(e.status, Status.Failure, "Incorrect error returned") + + self.step(10) + # min commissioning timeout is 3*60 seconds, so use that even though the command said 30. + cmd = Clusters.AdministratorCommissioning.Commands.OpenCommissioningWindow(commissioningTimeout=3*60, + PAKEPasscodeVerifier=resp.PAKEPasscodeVerifier, + discriminator=resp.discriminator, + iterations=resp.iterations, salt=resp.salt) + await self.send_single_cmd(cmd, dev_ctrl=self.TH_server_controller, node_id=self.server_nodeid, endpoint=0, timedRequestTimeoutMs=5000) + + self.step(11) + time.sleep(30) + + self.step(12) + th_server_fabrics_new = await self.read_single_attribute_check_success(cluster=Clusters.OperationalCredentials, attribute=Clusters.OperationalCredentials.Attributes.Fabrics, dev_ctrl=self.TH_server_controller, node_id=self.server_nodeid, endpoint=0, fabric_filtered=False) + asserts.assert_equal(len(th_server_fabrics) + 1, len(th_server_fabrics_new), + "Unexpected number of fabrics on TH_SERVER") + + +if __name__ == "__main__": + default_matter_test_main() diff --git a/src/python_testing/TC_DEM_2_1.py b/src/python_testing/TC_DEM_2_1.py new file mode 100644 index 00000000000000..cbbf7e3783edeb --- /dev/null +++ b/src/python_testing/TC_DEM_2_1.py @@ -0,0 +1,190 @@ +# +# Copyright (c) 2024 Project CHIP Authors +# All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# pylint: disable=invalid-name + +# See https://github.com/project-chip/connectedhomeip/blob/master/docs/testing/python.md#defining-the-ci-test-arguments +# for details about the block below. +# +# === BEGIN CI TEST ARGUMENTS === +# test-runner-runs: run1 +# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_APP} +# test-runner-run/run1/factoryreset: True +# test-runner-run/run1/quiet: True +# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json --enable-key 000102030405060708090a0b0c0d0e0f --featureSet 0x7e +# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# === END CI TEST ARGUMENTS === + +"""Define Matter test case TC_DEM_2_1.""" + + +import logging + +import chip.clusters as Clusters +from chip.clusters.Types import NullValue +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from mobly import asserts +from TC_DEMTestBase import DEMTestBase + +logger = logging.getLogger(__name__) + + +class TC_DEM_2_1(MatterBaseTest, DEMTestBase): + """Implementation of test case TC_DEM_2_1.""" + + def desc_TC_DEM_2_1(self) -> str: + """Return a description of this test.""" + return "4.1.2. [TC-DEM-2.1] Attributes with DUT as Server" + + def pics_TC_DEM_2_1(self): + """Return the PICS definitions associated with this test.""" + pics = [ + "DEM.S", + ] + return pics + + def steps_TC_DEM_2_1(self) -> list[TestStep]: + """Execute the test steps.""" + steps = [ + TestStep("1", "Commissioning, already done", + is_commissioning=True), + TestStep("2", "TH reads from the DUT FeatureMap attribute.", + "Store the value as FeatureMap."), + TestStep("3", "TH reads from the DUT ESAType attribute.", + "Verify that the DUT response contains an a ESATypeEnum (enum8) value to match the DUT type."), + TestStep("4", "TH reads from the DUT the ESACanGenerate attribute.", + "Verify that the DUT response contains a boolean value to match the DUT capability."), + TestStep("5", "TH reads from the DUT ESAState attribute.", + "Verify that the DUT response contains an a ESAStateEnum (enum8) value to match the DUT state (Online or Offline)."), + TestStep("6", "TH reads from the DUT the AbsMinPower attribute.", + "Verify that the DUT response contains a power-mW value to match the DUT capability, and is negative if and only if the ESACanGenerate read in step 4 is TRUE."), + TestStep("7", "TH reads from the DUT the AbsMaxPower attribute.", + "Verify that the DUT response contains a power-mW value to match the DUT capability, and greater than or equal to the AbsMinPower read in step 6."), + TestStep("8", "TH reads from the DUT the PowerAdjustmentCapability attribute.", + "Verify that the DUT response contains either a null value or a PowerAdjustCapabilityStruct value which contains a list of PowerAdjustStruct values and a valid Cause PowerAdjustReasonEnum (enum8) value."), + TestStep("9", "If PFR or SFR feature is supported on the cluster, TH reads from the DUT the Forecast attribute.", + "Verify that the DUT response contains either a null value or a valid ForecastStruct value."), + TestStep("10", "If PA, STA, PAU, FA or CON feature is supported on the cluster, TH reads from the DUT the OptOutState attribute.", + "Verify that the DUT response contains an OptOutStateEnum (enum8) value."), + ] + + return steps + + @async_test_body + async def test_TC_DEM_2_1(self): + # pylint: disable=too-many-locals, too-many-statements + """Run the test steps.""" + + # Allow some user input steps to be skipped if running under CI + self.is_ci = self.check_pics("PICS_SDK_CI_ONLY") + + self.step("1") + # Commission DUT - already done + + # Get the feature map for later + self.step("2") + feature_map = await self.read_dem_attribute_expect_success(attribute="FeatureMap") + logger.info(f"FeatureMap: {feature_map}") + + self.step("3") + esa_type = await self.read_dem_attribute_expect_success(attribute="ESAType") + asserts.assert_is_instance(esa_type, Clusters.DeviceEnergyManagement.Enums.ESATypeEnum, "Invalid type for ESAType") + + if not self.is_ci: + user_response = self.wait_for_user_input(prompt_msg=f"Detected ESAType is {esa_type.name}:{esa_type} - is this correct? Enter 'y' or 'n'", + prompt_msg_placeholder="y", + default_value="y") + asserts.assert_equal(user_response.lower(), "y") + + self.step("4") + esa_can_generate = await self.read_dem_attribute_expect_success(attribute="ESACanGenerate") + asserts.assert_is_instance(esa_can_generate, bool) + + if not self.is_ci: + user_response = self.wait_for_user_input(prompt_msg=f"Detected ESACanGenerate is: {esa_can_generate} - is this correct? Enter 'y' or 'n'", + prompt_msg_placeholder="y", + default_value="y") + asserts.assert_equal(user_response.lower(), "y") + + self.step("5") + esa_state = await self.read_dem_attribute_expect_success(attribute="ESAState") + logger.info(f"ESAState is {esa_state}") + asserts.assert_is_instance(esa_state, Clusters.DeviceEnergyManagement.Enums.ESAStateEnum) + + self.step("6") + abs_min_power = await self.read_dem_attribute_expect_success(attribute="AbsMinPower") + asserts.assert_is_instance(abs_min_power, int) + + if not self.is_ci: + user_response = self.wait_for_user_input(prompt_msg=f"AbsMinPower is {abs_min_power/1000000.0} W - is this correct? Enter 'y' or 'n'", + prompt_msg_placeholder="y", + default_value="y") + asserts.assert_equal(user_response.lower(), "y") + + if not esa_can_generate: + # ESA's that can't generate must have positive values + asserts.assert_greater_equal(abs_min_power, 0) + + self.step("7") + abs_max_power = await self.read_dem_attribute_expect_success(attribute="AbsMaxPower") + asserts.assert_is_instance(abs_max_power, int) + asserts.assert_greater_equal(abs_max_power, abs_min_power) + + if not self.is_ci: + user_response = self.wait_for_user_input(prompt_msg=f"AbsMaxPower is {abs_max_power/1000000.0} W - is this correct? Enter 'y' or 'n'", + prompt_msg_placeholder="y", + default_value="y") + asserts.assert_equal(user_response.lower(), "y") + + self.step("8") + if Clusters.DeviceEnergyManagement.Bitmaps.Feature.kPowerAdjustment & feature_map: + power_adjustment_capability = await self.read_dem_attribute_expect_success(attribute="PowerAdjustmentCapability") + logger.info(f"PowerAdjustmentCapability is {power_adjustment_capability}") + + if power_adjustment_capability is not NullValue: + asserts.assert_is_instance(power_adjustment_capability, + Clusters.DeviceEnergyManagement.Structs.PowerAdjustCapabilityStruct) + + power_adjustment_list = power_adjustment_capability.powerAdjustCapability + if power_adjustment_list is not NullValue: + asserts.assert_is_instance(power_adjustment_list, list) + for entry in power_adjustment_list: + asserts.assert_is_instance(entry, Clusters.DeviceEnergyManagement.Structs.PowerAdjustStruct) + + power_adjustment_cause = power_adjustment_capability.cause + asserts.assert_is_instance(power_adjustment_cause, Clusters.DeviceEnergyManagement.Enums.PowerAdjustReasonEnum) + + self.step("9") + if Clusters.DeviceEnergyManagement.Bitmaps.Feature.kPowerForecastReporting & feature_map or \ + Clusters.DeviceEnergyManagement.Bitmaps.Feature.kStateForecastReporting & feature_map: + forecast = await self.read_dem_attribute_expect_success(attribute="Forecast") + logger.info(f"Forecast is {forecast}") + + if forecast is not NullValue: + asserts.assert_is_instance(forecast, + Clusters.DeviceEnergyManagement.Structs.ForecastStruct) + + self.step("10") + if Clusters.DeviceEnergyManagement.Bitmaps.Feature.kPowerAdjustment & feature_map or \ + Clusters.DeviceEnergyManagement.Bitmaps.Feature.kStartTimeAdjustment & feature_map or \ + Clusters.DeviceEnergyManagement.Bitmaps.Feature.kPausable & feature_map or \ + Clusters.DeviceEnergyManagement.Bitmaps.Feature.kForecastAdjustment & feature_map or \ + Clusters.DeviceEnergyManagement.Bitmaps.Feature.kConstraintBasedAdjustment & feature_map: + opt_out_state = await self.read_dem_attribute_expect_success(attribute="OptOutState") + logger.info(f"OptOutState is {opt_out_state.name}:{opt_out_state}") + + +if __name__ == "__main__": + default_matter_test_main() diff --git a/src/python_testing/TC_ECOINFO_2_1.py b/src/python_testing/TC_ECOINFO_2_1.py index 8397402983d163..5b952647ab4113 100644 --- a/src/python_testing/TC_ECOINFO_2_1.py +++ b/src/python_testing/TC_ECOINFO_2_1.py @@ -115,6 +115,11 @@ async def test_TC_ECOINFO_2_1(self): self.print_step(0, "Commissioning, already done") + pause_for_pre_condition = self.user_params.get("pause_for_pre_condition", False) + if pause_for_pre_condition: + self.wait_for_user_input( + "Paused test to allow for manufacturer to satisfy precondition where one or more bridged devices of a supported type is connected to DUT") + self.step(1) endpoint_wild_card_read = await dev_ctrl.ReadAttribute(dut_node_id, [(Clusters.EcosystemInformation.Attributes.ClusterRevision)]) list_of_endpoints = list(endpoint_wild_card_read.keys()) diff --git a/src/python_testing/TC_SEAR_1_2.py b/src/python_testing/TC_SEAR_1_2.py index c21e831464557e..1c08b87cad2bf5 100644 --- a/src/python_testing/TC_SEAR_1_2.py +++ b/src/python_testing/TC_SEAR_1_2.py @@ -140,10 +140,10 @@ async def read_and_validate_current_area(self, step): endpoint=self.endpoint, attribute=Clusters.ServiceArea.Attributes.CurrentArea) logging.info(f"CurrentArea {current_area}") - asserts.assert_true((len(self.selareaid_list) == 0 and current_area is NullValue) - or - current_area in self.selareaid_list, - f"CurrentArea {current_area} is invalid. SelectedAreas is {self.selareaid_list}.") + if current_area is not NullValue: + asserts.assert_true(current_area in self.areaid_list, + f"CurrentArea {current_area} is not in SupportedAreas: {self.areaid_list}.") + # save so other methods can use this if needed self.current_area = current_area @@ -158,7 +158,8 @@ async def read_and_validate_estimated_end_time(self, step): if self.current_area is NullValue: asserts.assert_true(estimated_end_time is NullValue, "EstimatedEndTime should be null if CurrentArea is null.") - else: + + if estimated_end_time is not NullValue: # allow for some clock skew asserts.assert_true(estimated_end_time >= read_time - 3*60, f"EstimatedEndTime({estimated_end_time}) should be greater than the time when it was read({read_time})") diff --git a/src/python_testing/execute_python_tests.py b/src/python_testing/execute_python_tests.py index ad3fc83c910bf8..91db2b2614e56f 100644 --- a/src/python_testing/execute_python_tests.py +++ b/src/python_testing/execute_python_tests.py @@ -59,6 +59,7 @@ def main(search_directory, env_file): "TC_CNET_4_4.py", "TC_CCTRL_2_1.py", "TC_CCTRL_2_2.py", + "TC_CCTRL_2_3.py", "TC_DGGEN_3_2.py", "TC_EEVSE_Utils.py", "TC_ECOINFO_2_1.py",