diff --git a/.github/workflows/darwin.yaml b/.github/workflows/darwin.yaml index c30cc044f35b33..1eddaec04a8667 100644 --- a/.github/workflows/darwin.yaml +++ b/.github/workflows/darwin.yaml @@ -95,15 +95,9 @@ jobs: - name: Build example OTA Provider run: | scripts/examples/gn_build_example.sh examples/ota-provider-app/linux out/debug chip_config_network_layer_ble=false - - name: Build OTA image files with software version number 5 and 10 - run: | - scripts/examples/gn_build_example.sh examples/ota-requestor-app/linux out/debug chip_config_network_layer_ble=false non_spec_compliant_ota_action_delay_floor=0 chip_device_config_device_software_version=5 chip_device_config_device_software_version_string='"5.0"' - cp out/debug/chip-ota-requestor-app /tmp/ota-raw-image-v5 - scripts/examples/gn_build_example.sh examples/ota-requestor-app/linux out/debug chip_config_network_layer_ble=false non_spec_compliant_ota_action_delay_floor=0 chip_device_config_device_software_version=10 chip_device_config_device_software_version_string='"10.0"' - cp out/debug/chip-ota-requestor-app /tmp/ota-raw-image-v10 - name: Build example OTA Requestor run: | - scripts/examples/gn_build_example.sh examples/ota-requestor-app/linux out/debug chip_config_network_layer_ble=false non_spec_compliant_ota_action_delay_floor=0 + scripts/examples/gn_build_example.sh examples/ota-requestor-app/linux out/debug/ota-requestor-app chip_config_network_layer_ble=false non_spec_compliant_ota_action_delay_floor=0 - name: Delete Defaults run: defaults delete com.apple.dt.xctest.tool continue-on-error: true @@ -116,13 +110,6 @@ jobs: mkdir -p /tmp/darwin/framework-tests ../../../out/debug/chip-all-clusters-app --interface-id -1 > >(tee /tmp/darwin/framework-tests/all-cluster-app.log) 2> >(tee /tmp/darwin/framework-tests/all-cluster-app-err.log >&2) & ../../../out/debug/chip-all-clusters-app --interface-id -1 --dac_provider ../../../credentials/development/commissioner_dut/struct_cd_origin_pid_vid_correct/test_case_vector.json --product-id 32768 --discriminator 3839 --secured-device-port 5539 --KVS /tmp/chip-all-clusters-app-kvs2 > >(tee /tmp/darwin/framework-tests/all-cluster-app-origin-vid.log) 2> >(tee /tmp/darwin/framework-tests/all-cluster-app-origin-vid-err.log >&2) & - # Make sure each ota-requestor is using a different port, discriminator, and KVS from - # all-clusters-app and from other requestors. - # - # And a different port from the test harness too; the test harness uses port 5541. - ../../../out/debug/chip-ota-requestor-app --interface-id -1 --secured-device-port 5542 --discriminator 1111 --KVS /tmp/chip-ota-requestor-kvs1 --otaDownloadPath /tmp/chip-ota-requestor-downloaded-image1 --autoApplyImage > >(tee /tmp/darwin/framework-tests/ota-requestor-app-1.log) 2> >(tee /tmp/darwin/framework-tests/ota-requestor-app-err-1.log >&2) & - ../../../out/debug/chip-ota-requestor-app --interface-id -1 --secured-device-port 5543 --discriminator 1112 --KVS /tmp/chip-ota-requestor-kvs2 --otaDownloadPath /tmp/chip-ota-requestor-downloaded-image2 --autoApplyImage > >(tee /tmp/darwin/framework-tests/ota-requestor-app-2.log) 2> >(tee /tmp/darwin/framework-tests/ota-requestor-app-err-2.log >&2) & - ../../../out/debug/chip-ota-requestor-app --interface-id -1 --secured-device-port 5544 --discriminator 1113 --KVS /tmp/chip-ota-requestor-kvs3 --otaDownloadPath /tmp/chip-ota-requestor-downloaded-image3 --autoApplyImage > >(tee /tmp/darwin/framework-tests/ota-requestor-app-3.log) 2> >(tee /tmp/darwin/framework-tests/ota-requestor-app-err-3.log >&2) & # Disable BLE because the app does not have the permission to use # it and that may crash the CI. # diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index ea421b96afccc3..2571c6410d4432 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -418,8 +418,20 @@ jobs: scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_ACE_1_3.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_CGEN_2_4.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_DA_1_2.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' + scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --script "src/python_testing/TC_TIMESYNC_2_1.py" --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' + scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --script "src/python_testing/TC_TIMESYNC_2_2.py" --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' + scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --script "src/python_testing/TC_TIMESYNC_2_4.py" --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' + scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --script "src/python_testing/TC_TIMESYNC_2_5.py" --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' + scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --script "src/python_testing/TC_TIMESYNC_2_6.py" --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' + scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --script "src/python_testing/TC_TIMESYNC_2_7.py" --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' + scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --script "src/python_testing/TC_TIMESYNC_2_8.py" --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' + scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --script "src/python_testing/TC_TIMESYNC_2_9.py" --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' + scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --script "src/python_testing/TC_TIMESYNC_2_10.py" --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' + scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --script "src/python_testing/TC_TIMESYNC_2_11.py" --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' + scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --script "src/python_testing/TC_TIMESYNC_2_12.py" --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' + scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --script "src/python_testing/TC_TIMESYNC_2_13.py" --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' + scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --script "src/python_testing/TC_TIMESYNC_3_1.py" --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_ICDM_2_1.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' - scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_TIMESYNC_3_1.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_DA_1_5.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_IDM_1_2.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_FAN_3_3.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' diff --git a/examples/all-clusters-app/asr/include/CHIPProjectConfig.h b/examples/all-clusters-app/asr/include/CHIPProjectConfig.h index 6a81ee6517aedb..dba0febabcd20d 100755 --- a/examples/all-clusters-app/asr/include/CHIPProjectConfig.h +++ b/examples/all-clusters-app/asr/include/CHIPProjectConfig.h @@ -43,7 +43,6 @@ // including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS. // #define CHIP_CONFIG_SECURITY_TEST_MODE 0 -#define CHIP_CONFIG_REQUIRE_AUTH 1 /** * CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION diff --git a/examples/all-clusters-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h b/examples/all-clusters-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h index b4f9ba2b737c86..97357823332342 100644 --- a/examples/all-clusters-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h +++ b/examples/all-clusters-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h @@ -36,9 +36,6 @@ #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 -// Use a default pairing code if one hasn't been provisioned in flash. -#define CHIP_DEVICE_CONFIG_USE_TEST_PAIRING_CODE "CHIPUS" - /** * CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER * diff --git a/examples/all-clusters-app/cc13x4_26x4/main/include/CHIPProjectConfig.h b/examples/all-clusters-app/cc13x4_26x4/main/include/CHIPProjectConfig.h index 939f01d93b8e6c..f42469c54a5880 100644 --- a/examples/all-clusters-app/cc13x4_26x4/main/include/CHIPProjectConfig.h +++ b/examples/all-clusters-app/cc13x4_26x4/main/include/CHIPProjectConfig.h @@ -36,9 +36,6 @@ #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 -// Use a default pairing code if one hasn't been provisioned in flash. -#define CHIP_DEVICE_CONFIG_USE_TEST_PAIRING_CODE "CHIPUS" - /** * CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER * diff --git a/examples/all-clusters-app/nxp/mw320/include/CHIPProjectConfig.h b/examples/all-clusters-app/nxp/mw320/include/CHIPProjectConfig.h index bce9f09d3cbee2..5e4a6b1e4f5419 100644 --- a/examples/all-clusters-app/nxp/mw320/include/CHIPProjectConfig.h +++ b/examples/all-clusters-app/nxp/mw320/include/CHIPProjectConfig.h @@ -31,7 +31,6 @@ // Security and Authentication enabled for release build. #define CHIP_CONFIG_SECURITY_TEST_MODE 0 -#define CHIP_CONFIG_REQUIRE_AUTH 1 #else // development build @@ -41,20 +40,6 @@ // WARNING: These options make it possible to circumvent basic CHIP security functionality, // including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS. #define CHIP_CONFIG_SECURITY_TEST_MODE 0 -#define CHIP_CONFIG_REQUIRE_AUTH 1 - -/** - * CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY - * - * Enables the use of a hard-coded default CHIP device id and credentials if no device id - * is found in CHIP NV storage. - * - * This option is for testing only and should be disabled in production releases. - */ -#define CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY 34 - -// Use a default pairing code if one hasn't been provisioned in flash. -#define CHIP_DEVICE_CONFIG_USE_TEST_PAIRING_CODE "CHIPUS" /** * CHIP_DEVICE_CONFIG_USE_TEST_SERIAL_NUMBER diff --git a/examples/all-clusters-minimal-app/asr/include/CHIPProjectConfig.h b/examples/all-clusters-minimal-app/asr/include/CHIPProjectConfig.h index 6a81ee6517aedb..dba0febabcd20d 100755 --- a/examples/all-clusters-minimal-app/asr/include/CHIPProjectConfig.h +++ b/examples/all-clusters-minimal-app/asr/include/CHIPProjectConfig.h @@ -43,7 +43,6 @@ // including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS. // #define CHIP_CONFIG_SECURITY_TEST_MODE 0 -#define CHIP_CONFIG_REQUIRE_AUTH 1 /** * CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION diff --git a/examples/bridge-app/asr/include/CHIPProjectConfig.h b/examples/bridge-app/asr/include/CHIPProjectConfig.h index 6b159a670b5ed7..4520ec75b28c33 100755 --- a/examples/bridge-app/asr/include/CHIPProjectConfig.h +++ b/examples/bridge-app/asr/include/CHIPProjectConfig.h @@ -27,16 +27,6 @@ #pragma once -/** - * CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY - * - * Enables the use of a hard-coded default Chip device id and credentials if no device id - * is found in Chip NV storage. - * - * This option is for testing only and should be disabled in production releases. - */ -#define CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY 34 - // Use a default pairing code if one hasn't been provisioned in flash. #ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 diff --git a/examples/chip-tool/include/CHIPProjectAppConfig.h b/examples/chip-tool/include/CHIPProjectAppConfig.h index bc8ee25a03645e..eef6466aa1a510 100644 --- a/examples/chip-tool/include/CHIPProjectAppConfig.h +++ b/examples/chip-tool/include/CHIPProjectAppConfig.h @@ -56,8 +56,6 @@ #define CHIP_CONFIG_DATA_MANAGEMENT_CLIENT_EXPERIMENTAL 1 -#define CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY 1 - #define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY 1 // Enable some test-only interaction model APIs. diff --git a/examples/contact-sensor-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h b/examples/contact-sensor-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h index 03e638f54cbf13..7d435215252b0e 100644 --- a/examples/contact-sensor-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h +++ b/examples/contact-sensor-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h @@ -97,9 +97,6 @@ #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 -// Use a default pairing code if one hasn't been provisioned in flash. -#define CHIP_DEVICE_CONFIG_USE_TEST_PAIRING_CODE "CHIPUS" - /** * CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER * diff --git a/examples/dishwasher-app/asr/include/CHIPProjectConfig.h b/examples/dishwasher-app/asr/include/CHIPProjectConfig.h index 38ba84fe10f85a..9a69f8227a7187 100755 --- a/examples/dishwasher-app/asr/include/CHIPProjectConfig.h +++ b/examples/dishwasher-app/asr/include/CHIPProjectConfig.h @@ -27,16 +27,6 @@ #pragma once -/** - * CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY - * - * Enables the use of a hard-coded default Chip device id and credentials if no device id - * is found in Chip NV storage. - * - * This option is for testing only and should be disabled in production releases. - */ -#define CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY 34 - // Use a default pairing code if one hasn't been provisioned in flash. #ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 diff --git a/examples/java-matter-controller/include/CHIPProjectAppConfig.h b/examples/java-matter-controller/include/CHIPProjectAppConfig.h index dd3a009f81d785..5805016d714427 100644 --- a/examples/java-matter-controller/include/CHIPProjectAppConfig.h +++ b/examples/java-matter-controller/include/CHIPProjectAppConfig.h @@ -53,8 +53,6 @@ #define CHIP_CONFIG_DATA_MANAGEMENT_CLIENT_EXPERIMENTAL 1 -#define CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY 1 - #define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY 1 // Enable some test-only interaction model APIs. diff --git a/examples/light-switch-app/genio/include/CHIPProjectConfig.h b/examples/light-switch-app/genio/include/CHIPProjectConfig.h index c314ebba41e617..fec05c1ed66a48 100644 --- a/examples/light-switch-app/genio/include/CHIPProjectConfig.h +++ b/examples/light-switch-app/genio/include/CHIPProjectConfig.h @@ -44,7 +44,6 @@ // including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS. // #define CHIP_CONFIG_SECURITY_TEST_MODE 0 -#define CHIP_CONFIG_REQUIRE_AUTH 1 /** * CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID diff --git a/examples/light-switch-app/infineon/cyw30739/include/CHIPProjectConfig.h b/examples/light-switch-app/infineon/cyw30739/include/CHIPProjectConfig.h index 522e40755f8bca..82ea3f0e71d7a4 100644 --- a/examples/light-switch-app/infineon/cyw30739/include/CHIPProjectConfig.h +++ b/examples/light-switch-app/infineon/cyw30739/include/CHIPProjectConfig.h @@ -58,8 +58,6 @@ #define CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER "TEST_SN" // -------------------- Test Configuration -------------------- -#define CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY 1 - #define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 // ------------------------- Debug use ------------------------- diff --git a/examples/lighting-app/asr/include/CHIPProjectConfig.h b/examples/lighting-app/asr/include/CHIPProjectConfig.h index 4ff8cbed869e34..458aeb605534e9 100755 --- a/examples/lighting-app/asr/include/CHIPProjectConfig.h +++ b/examples/lighting-app/asr/include/CHIPProjectConfig.h @@ -28,16 +28,6 @@ #pragma once -/** - * CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY - * - * Enables the use of a hard-coded default Chip device id and credentials if no device id - * is found in Chip NV storage. - * - * This option is for testing only and should be disabled in production releases. - */ -#define CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY 34 - // Use a default pairing code if one hasn't been provisioned in flash. #ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 diff --git a/examples/lighting-app/bouffalolab/bl602/CHIPProjectConfig.h b/examples/lighting-app/bouffalolab/bl602/CHIPProjectConfig.h index 24dd8a2c395383..d265e16693b9b2 100644 --- a/examples/lighting-app/bouffalolab/bl602/CHIPProjectConfig.h +++ b/examples/lighting-app/bouffalolab/bl602/CHIPProjectConfig.h @@ -27,16 +27,6 @@ #pragma once -/** - * CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY - * - * Enables the use of a hard-coded default Chip device id and credentials if no device id - * is found in Chip NV storage. - * - * This option is for testing only and should be disabled in production releases. - */ -#define CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY 34 - // Use a default pairing code if one hasn't been provisioned in flash. #ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 diff --git a/examples/lighting-app/bouffalolab/bl702/CHIPProjectConfig.h b/examples/lighting-app/bouffalolab/bl702/CHIPProjectConfig.h index 19ff4f3eaf13f4..137b0aff6e8ee8 100644 --- a/examples/lighting-app/bouffalolab/bl702/CHIPProjectConfig.h +++ b/examples/lighting-app/bouffalolab/bl702/CHIPProjectConfig.h @@ -27,16 +27,6 @@ #pragma once -/** - * CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY - * - * Enables the use of a hard-coded default Chip device id and credentials if no device id - * is found in Chip NV storage. - * - * This option is for testing only and should be disabled in production releases. - */ -#define CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY 34 - // Use a default pairing code if one hasn't been provisioned in flash. #ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 @@ -53,7 +43,6 @@ // including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS. // #define CHIP_CONFIG_SECURITY_TEST_MODE 0 -#define CHIP_CONFIG_REQUIRE_AUTH 1 /** * CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID diff --git a/examples/lighting-app/bouffalolab/bl702l/CHIPProjectConfig.h b/examples/lighting-app/bouffalolab/bl702l/CHIPProjectConfig.h index 19ff4f3eaf13f4..137b0aff6e8ee8 100644 --- a/examples/lighting-app/bouffalolab/bl702l/CHIPProjectConfig.h +++ b/examples/lighting-app/bouffalolab/bl702l/CHIPProjectConfig.h @@ -27,16 +27,6 @@ #pragma once -/** - * CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY - * - * Enables the use of a hard-coded default Chip device id and credentials if no device id - * is found in Chip NV storage. - * - * This option is for testing only and should be disabled in production releases. - */ -#define CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY 34 - // Use a default pairing code if one hasn't been provisioned in flash. #ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 @@ -53,7 +43,6 @@ // including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS. // #define CHIP_CONFIG_SECURITY_TEST_MODE 0 -#define CHIP_CONFIG_REQUIRE_AUTH 1 /** * CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID diff --git a/examples/lighting-app/cc13x2x7_26x2x7/include/CHIPProjectConfig.h b/examples/lighting-app/cc13x2x7_26x2x7/include/CHIPProjectConfig.h index 0f5090d7d9f320..88e08c63321770 100644 --- a/examples/lighting-app/cc13x2x7_26x2x7/include/CHIPProjectConfig.h +++ b/examples/lighting-app/cc13x2x7_26x2x7/include/CHIPProjectConfig.h @@ -36,9 +36,6 @@ #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 -// Use a default pairing code if one hasn't been provisioned in flash. -#define CHIP_DEVICE_CONFIG_USE_TEST_PAIRING_CODE "CHIPUS" - /** * CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER * diff --git a/examples/lighting-app/cc13x4_26x4/include/CHIPProjectConfig.h b/examples/lighting-app/cc13x4_26x4/include/CHIPProjectConfig.h index 0f5090d7d9f320..88e08c63321770 100644 --- a/examples/lighting-app/cc13x4_26x4/include/CHIPProjectConfig.h +++ b/examples/lighting-app/cc13x4_26x4/include/CHIPProjectConfig.h @@ -36,9 +36,6 @@ #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 -// Use a default pairing code if one hasn't been provisioned in flash. -#define CHIP_DEVICE_CONFIG_USE_TEST_PAIRING_CODE "CHIPUS" - /** * CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER * diff --git a/examples/lighting-app/genio/include/CHIPProjectConfig.h b/examples/lighting-app/genio/include/CHIPProjectConfig.h index dbdd8fcdbe350d..00e00a63256185 100644 --- a/examples/lighting-app/genio/include/CHIPProjectConfig.h +++ b/examples/lighting-app/genio/include/CHIPProjectConfig.h @@ -44,7 +44,6 @@ // including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS. // #define CHIP_CONFIG_SECURITY_TEST_MODE 0 -#define CHIP_CONFIG_REQUIRE_AUTH 1 /** * CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID diff --git a/examples/lighting-app/infineon/cyw30739/include/CHIPProjectConfig.h b/examples/lighting-app/infineon/cyw30739/include/CHIPProjectConfig.h index 233ffd19da1e59..26d7e65bcca57e 100644 --- a/examples/lighting-app/infineon/cyw30739/include/CHIPProjectConfig.h +++ b/examples/lighting-app/infineon/cyw30739/include/CHIPProjectConfig.h @@ -58,6 +58,4 @@ #define CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER "TEST_SN" // -------------------- Test Configuration -------------------- -#define CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY 1 - #define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 diff --git a/examples/lighting-app/infineon/psoc6/include/CHIPProjectConfig.h b/examples/lighting-app/infineon/psoc6/include/CHIPProjectConfig.h index fe4ba5c8fe87e4..ab00f26adecb76 100644 --- a/examples/lighting-app/infineon/psoc6/include/CHIPProjectConfig.h +++ b/examples/lighting-app/infineon/psoc6/include/CHIPProjectConfig.h @@ -28,16 +28,6 @@ #pragma once -/** - * CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY - * - * Enables the use of a hard-coded default Chip device id and credentials if no device id - * is found in Chip NV storage. - * - * This option is for testing only and should be disabled in production releases. - */ -#define CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY 34 - // Use a default pairing code if one hasn't been provisioned in flash. #ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 diff --git a/examples/lighting-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h b/examples/lighting-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h index f56764b2cb731b..63abce6c8c0682 100644 --- a/examples/lighting-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h +++ b/examples/lighting-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h @@ -111,9 +111,6 @@ #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 -// Use a default pairing code if one hasn't been provisioned in flash. -#define CHIP_DEVICE_CONFIG_USE_TEST_PAIRING_CODE "CHIPUS" - /** * CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER * diff --git a/examples/lock-app/asr/include/CHIPProjectConfig.h b/examples/lock-app/asr/include/CHIPProjectConfig.h index fbaf9ea3c7c9be..866db6b5836475 100755 --- a/examples/lock-app/asr/include/CHIPProjectConfig.h +++ b/examples/lock-app/asr/include/CHIPProjectConfig.h @@ -28,16 +28,6 @@ #pragma once -/** - * CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY - * - * Enables the use of a hard-coded default Chip device id and credentials if no device id - * is found in Chip NV storage. - * - * This option is for testing only and should be disabled in production releases. - */ -#define CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY 34 - // Use a default pairing code if one hasn't been provisioned in flash. #ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 diff --git a/examples/lock-app/cc13x2x7_26x2x7/include/CHIPProjectConfig.h b/examples/lock-app/cc13x2x7_26x2x7/include/CHIPProjectConfig.h index a808f37a72d7b5..6e6a2562178da4 100644 --- a/examples/lock-app/cc13x2x7_26x2x7/include/CHIPProjectConfig.h +++ b/examples/lock-app/cc13x2x7_26x2x7/include/CHIPProjectConfig.h @@ -36,9 +36,6 @@ #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 -// Use a default pairing code if one hasn't been provisioned in flash. -#define CHIP_DEVICE_CONFIG_USE_TEST_PAIRING_CODE "CHIPUS" - /** * CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER * diff --git a/examples/lock-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h b/examples/lock-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h index 5e4fd0215c517a..424e38a29f7766 100644 --- a/examples/lock-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h +++ b/examples/lock-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h @@ -36,9 +36,6 @@ #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 -// Use a default pairing code if one hasn't been provisioned in flash. -#define CHIP_DEVICE_CONFIG_USE_TEST_PAIRING_CODE "CHIPUS" - /** * CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER * diff --git a/examples/lock-app/cc13x4_26x4/include/CHIPProjectConfig.h b/examples/lock-app/cc13x4_26x4/include/CHIPProjectConfig.h index a808f37a72d7b5..6e6a2562178da4 100644 --- a/examples/lock-app/cc13x4_26x4/include/CHIPProjectConfig.h +++ b/examples/lock-app/cc13x4_26x4/include/CHIPProjectConfig.h @@ -36,9 +36,6 @@ #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 -// Use a default pairing code if one hasn't been provisioned in flash. -#define CHIP_DEVICE_CONFIG_USE_TEST_PAIRING_CODE "CHIPUS" - /** * CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER * diff --git a/examples/lock-app/cc32xx/main/include/CHIPProjectConfig.h b/examples/lock-app/cc32xx/main/include/CHIPProjectConfig.h index 4268330033b485..a7d35339632e4f 100644 --- a/examples/lock-app/cc32xx/main/include/CHIPProjectConfig.h +++ b/examples/lock-app/cc32xx/main/include/CHIPProjectConfig.h @@ -32,7 +32,6 @@ // Security and Authentication enabled for release build. #define CHIP_CONFIG_SECURITY_TEST_MODE 0 -#define CHIP_CONFIG_REQUIRE_AUTH 1 #else // development build @@ -42,25 +41,11 @@ // WARNING: These options make it possible to circumvent basic CHIP security functionality, // including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS. #define CHIP_CONFIG_SECURITY_TEST_MODE 0 -#define CHIP_CONFIG_REQUIRE_AUTH 0 - -/** - * CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY - * - * Enables the use of a hard-coded default CHIP device id and credentials if no device id - * is found in CHIP NV storage. - * - * This option is for testing only and should be disabled in production releases. - */ -#define CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY 34 // Use a default pairing code if one hasn't been provisioned in flash. #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 -// Use a default pairing code if one hasn't been provisioned in flash. -#define CHIP_DEVICE_CONFIG_USE_TEST_PAIRING_CODE "CHIPUS" - /** * CHIP_DEVICE_CONFIG_USE_TEST_SERIAL_NUMBER * diff --git a/examples/lock-app/genio/include/CHIPProjectConfig.h b/examples/lock-app/genio/include/CHIPProjectConfig.h index 65333f8b2b82d7..d0066caae603d1 100644 --- a/examples/lock-app/genio/include/CHIPProjectConfig.h +++ b/examples/lock-app/genio/include/CHIPProjectConfig.h @@ -44,7 +44,6 @@ // including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS. // #define CHIP_CONFIG_SECURITY_TEST_MODE 0 -#define CHIP_CONFIG_REQUIRE_AUTH 1 /** * CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID diff --git a/examples/lock-app/infineon/cyw30739/include/CHIPProjectConfig.h b/examples/lock-app/infineon/cyw30739/include/CHIPProjectConfig.h index 40eedf4771147d..ffe889f725d909 100644 --- a/examples/lock-app/infineon/cyw30739/include/CHIPProjectConfig.h +++ b/examples/lock-app/infineon/cyw30739/include/CHIPProjectConfig.h @@ -58,6 +58,4 @@ #define CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER "TEST_SN" // -------------------- Test Configuration -------------------- -#define CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY 1 - #define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 diff --git a/examples/lock-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h b/examples/lock-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h index 0e087ffa3f3a1b..046b005f78da73 100644 --- a/examples/lock-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h +++ b/examples/lock-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h @@ -97,9 +97,6 @@ #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 -// Use a default pairing code if one hasn't been provisioned in flash. -#define CHIP_DEVICE_CONFIG_USE_TEST_PAIRING_CODE "CHIPUS" - /** * CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER * diff --git a/examples/lock-app/silabs/include/CHIPProjectConfig.h b/examples/lock-app/silabs/include/CHIPProjectConfig.h index 1cfb6e7b0ac82c..87d7485558c659 100644 --- a/examples/lock-app/silabs/include/CHIPProjectConfig.h +++ b/examples/lock-app/silabs/include/CHIPProjectConfig.h @@ -44,7 +44,6 @@ // including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS. // #define CHIP_CONFIG_SECURITY_TEST_MODE 0 -#define CHIP_CONFIG_REQUIRE_AUTH 1 /** * CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID diff --git a/examples/ota-requestor-app/asr/include/CHIPProjectConfig.h b/examples/ota-requestor-app/asr/include/CHIPProjectConfig.h index 9f21f281471076..7ee063f0924661 100755 --- a/examples/ota-requestor-app/asr/include/CHIPProjectConfig.h +++ b/examples/ota-requestor-app/asr/include/CHIPProjectConfig.h @@ -28,16 +28,6 @@ #pragma once -/** - * CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY - * - * Enables the use of a hard-coded default Chip device id and credentials if no device id - * is found in Chip NV storage. - * - * This option is for testing only and should be disabled in production releases. - */ -#define CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY 34 - // Use a default pairing code if one hasn't been provisioned in flash. #ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 diff --git a/examples/ota-requestor-app/genio/include/CHIPProjectConfig.h b/examples/ota-requestor-app/genio/include/CHIPProjectConfig.h index 79395c5bb88a32..28ec12d1e86248 100644 --- a/examples/ota-requestor-app/genio/include/CHIPProjectConfig.h +++ b/examples/ota-requestor-app/genio/include/CHIPProjectConfig.h @@ -44,7 +44,6 @@ // including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS. // #define CHIP_CONFIG_SECURITY_TEST_MODE 0 -#define CHIP_CONFIG_REQUIRE_AUTH 1 /** * CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID diff --git a/examples/ota-requestor-app/infineon/cyw30739/include/CHIPProjectConfig.h b/examples/ota-requestor-app/infineon/cyw30739/include/CHIPProjectConfig.h index f3f4c57bc244a3..82a889907606bd 100644 --- a/examples/ota-requestor-app/infineon/cyw30739/include/CHIPProjectConfig.h +++ b/examples/ota-requestor-app/infineon/cyw30739/include/CHIPProjectConfig.h @@ -58,6 +58,4 @@ #define CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER "TEST_SN" // -------------------- Test Configuration -------------------- -#define CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY 1 - #define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 diff --git a/examples/persistent-storage/cc13x2x7_26x2x7/include/CHIPProjectConfig.h b/examples/persistent-storage/cc13x2x7_26x2x7/include/CHIPProjectConfig.h index 2a15a30a7f4c02..2bcf489732b312 100644 --- a/examples/persistent-storage/cc13x2x7_26x2x7/include/CHIPProjectConfig.h +++ b/examples/persistent-storage/cc13x2x7_26x2x7/include/CHIPProjectConfig.h @@ -46,9 +46,6 @@ #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 -// Use a default pairing code if one hasn't been provisioned in flash. -#define CHIP_DEVICE_CONFIG_USE_TEST_PAIRING_CODE "CHIPUS" - /** * CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER * diff --git a/examples/persistent-storage/infineon/psoc6/include/CHIPProjectConfig.h b/examples/persistent-storage/infineon/psoc6/include/CHIPProjectConfig.h index 900b0d10ef8ca6..83435a2c574e34 100644 --- a/examples/persistent-storage/infineon/psoc6/include/CHIPProjectConfig.h +++ b/examples/persistent-storage/infineon/psoc6/include/CHIPProjectConfig.h @@ -28,16 +28,6 @@ #pragma once -/** - * CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY - * - * Enables the use of a hard-coded default Chip device id and credentials if no device id - * is found in Chip NV storage. - * - * This option is for testing only and should be disabled in production releases. - */ -#define CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY 34 - // Use a default pairing code if one hasn't been provisioned in flash. #ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 diff --git a/examples/platform/silabs/SilabsDeviceAttestationCreds.cpp b/examples/platform/silabs/SilabsDeviceAttestationCreds.cpp index 53590ff2b7672d..dac4081ff35e12 100644 --- a/examples/platform/silabs/SilabsDeviceAttestationCreds.cpp +++ b/examples/platform/silabs/SilabsDeviceAttestationCreds.cpp @@ -100,6 +100,9 @@ class DeviceAttestationCredsSilabs : public DeviceAttestationCredentialsProvider if (SilabsConfig::ConfigValueExists(SilabsConfig::kConfigKey_Creds_KeyId)) { // Provisioned DAC key +#ifdef SIWX_917 + return CHIP_ERROR_NOT_IMPLEMENTED; +#else uint32_t key_id = SILABS_CREDENTIALS_DAC_KEY_ID; uint8_t signature[64] = { 0 }; size_t signature_size = sizeof(signature); @@ -114,6 +117,7 @@ class DeviceAttestationCredsSilabs : public DeviceAttestationCredentialsProvider VerifyOrReturnError(!err, CHIP_ERROR_INTERNAL); return CopySpanToMutableSpan(ByteSpan(signature, signature_size), out_span); +#endif } else { diff --git a/examples/pump-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h b/examples/pump-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h index f99523c278db0c..e10a37616e6360 100644 --- a/examples/pump-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h +++ b/examples/pump-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h @@ -39,9 +39,6 @@ #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 -// Use a default pairing code if one hasn't been provisioned in flash. -#define CHIP_DEVICE_CONFIG_USE_TEST_PAIRING_CODE "CHIPUS" - /** * CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION * diff --git a/examples/pump-app/cc13x4_26x4/main/include/CHIPProjectConfig.h b/examples/pump-app/cc13x4_26x4/main/include/CHIPProjectConfig.h index 49a0e036a33181..44fb94d6161543 100644 --- a/examples/pump-app/cc13x4_26x4/main/include/CHIPProjectConfig.h +++ b/examples/pump-app/cc13x4_26x4/main/include/CHIPProjectConfig.h @@ -39,9 +39,6 @@ #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 -// Use a default pairing code if one hasn't been provisioned in flash. -#define CHIP_DEVICE_CONFIG_USE_TEST_PAIRING_CODE "CHIPUS" - /** * CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION * diff --git a/examples/pump-controller-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h b/examples/pump-controller-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h index 97dac7bf1fe313..e8329c75ae9e29 100644 --- a/examples/pump-controller-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h +++ b/examples/pump-controller-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h @@ -39,9 +39,6 @@ #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 -// Use a default pairing code if one hasn't been provisioned in flash. -#define CHIP_DEVICE_CONFIG_USE_TEST_PAIRING_CODE "CHIPUS" - /** * CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION * diff --git a/examples/pump-controller-app/cc13x4_26x4/main/include/CHIPProjectConfig.h b/examples/pump-controller-app/cc13x4_26x4/main/include/CHIPProjectConfig.h index 2b2c3370763af8..cbf68cae5508d3 100644 --- a/examples/pump-controller-app/cc13x4_26x4/main/include/CHIPProjectConfig.h +++ b/examples/pump-controller-app/cc13x4_26x4/main/include/CHIPProjectConfig.h @@ -39,9 +39,6 @@ #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 -// Use a default pairing code if one hasn't been provisioned in flash. -#define CHIP_DEVICE_CONFIG_USE_TEST_PAIRING_CODE "CHIPUS" - /** * CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION * diff --git a/examples/shell/cc13x2x7_26x2x7/include/CHIPProjectConfig.h b/examples/shell/cc13x2x7_26x2x7/include/CHIPProjectConfig.h index 1e8f718031e90f..0464c9d043027e 100644 --- a/examples/shell/cc13x2x7_26x2x7/include/CHIPProjectConfig.h +++ b/examples/shell/cc13x2x7_26x2x7/include/CHIPProjectConfig.h @@ -30,9 +30,6 @@ #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 -// Use a default pairing code if one hasn't been provisioned in flash. -#define CHIP_DEVICE_CONFIG_USE_TEST_PAIRING_CODE "CHIPUS" - /** * CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER * diff --git a/examples/shell/cc13x4_26x4/include/CHIPProjectConfig.h b/examples/shell/cc13x4_26x4/include/CHIPProjectConfig.h index bec2bc08625272..d362c297d07f14 100644 --- a/examples/shell/cc13x4_26x4/include/CHIPProjectConfig.h +++ b/examples/shell/cc13x4_26x4/include/CHIPProjectConfig.h @@ -30,9 +30,6 @@ #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 -// Use a default pairing code if one hasn't been provisioned in flash. -#define CHIP_DEVICE_CONFIG_USE_TEST_PAIRING_CODE "CHIPUS" - /** * CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER * diff --git a/examples/shell/genio/include/CHIPProjectConfig.h b/examples/shell/genio/include/CHIPProjectConfig.h index 013d86f0b00708..30b02be9b67d81 100644 --- a/examples/shell/genio/include/CHIPProjectConfig.h +++ b/examples/shell/genio/include/CHIPProjectConfig.h @@ -41,7 +41,6 @@ // including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS. // #define CHIP_CONFIG_SECURITY_TEST_MODE 0 -#define CHIP_CONFIG_REQUIRE_AUTH 1 /** * CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID diff --git a/examples/shell/nxp/k32w/k32w0/include/CHIPProjectConfig.h b/examples/shell/nxp/k32w/k32w0/include/CHIPProjectConfig.h index bcb7d017560dc2..f7ef2f6c352cce 100644 --- a/examples/shell/nxp/k32w/k32w0/include/CHIPProjectConfig.h +++ b/examples/shell/nxp/k32w/k32w0/include/CHIPProjectConfig.h @@ -38,9 +38,6 @@ #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 -// Use a default pairing code if one hasn't been provisioned in flash. -#define CHIP_DEVICE_CONFIG_USE_TEST_PAIRING_CODE "CHIPUS" - /** * CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER * diff --git a/examples/temperature-measurement-app/asr/include/CHIPProjectConfig.h b/examples/temperature-measurement-app/asr/include/CHIPProjectConfig.h index 00af1a3364eb3e..fbb3fbe96eca91 100755 --- a/examples/temperature-measurement-app/asr/include/CHIPProjectConfig.h +++ b/examples/temperature-measurement-app/asr/include/CHIPProjectConfig.h @@ -28,16 +28,6 @@ #pragma once -/** - * CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY - * - * Enables the use of a hard-coded default Chip device id and credentials if no device id - * is found in Chip NV storage. - * - * This option is for testing only and should be disabled in production releases. - */ -#define CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY 37 - // Use a default pairing code if one hasn't been provisioned in flash. #ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 diff --git a/examples/thermostat/asr/include/CHIPProjectConfig.h b/examples/thermostat/asr/include/CHIPProjectConfig.h index 00af1a3364eb3e..fbb3fbe96eca91 100755 --- a/examples/thermostat/asr/include/CHIPProjectConfig.h +++ b/examples/thermostat/asr/include/CHIPProjectConfig.h @@ -28,16 +28,6 @@ #pragma once -/** - * CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY - * - * Enables the use of a hard-coded default Chip device id and credentials if no device id - * is found in Chip NV storage. - * - * This option is for testing only and should be disabled in production releases. - */ -#define CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY 37 - // Use a default pairing code if one hasn't been provisioned in flash. #ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 diff --git a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/MainActivity.java b/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/MainActivity.java index 864f993544c760..de1b547f929dd5 100644 --- a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/MainActivity.java +++ b/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/MainActivity.java @@ -8,9 +8,9 @@ import com.chip.casting.AppParameters; import com.chip.casting.DiscoveredNodeData; import com.chip.casting.TvCastingApp; -import com.chip.casting.util.DACProviderStub; import com.chip.casting.util.GlobalCastingConstants; import com.chip.casting.util.PreferencesConfigurationManager; +import com.matter.casting.InitializationExample; import java.util.Random; public class MainActivity extends AppCompatActivity @@ -27,7 +27,10 @@ protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); - boolean ret = initJni(); + boolean ret = + GlobalCastingConstants.ChipCastingSimplified + ? InitializationExample.initAndStart(this.getApplicationContext()).hasNoError() + : initJni(); if (!ret) { Log.e(TAG, "Failed to initialize Matter TV casting library"); return; @@ -78,7 +81,7 @@ public void handleDisconnect() { private boolean initJni() { tvCastingApp = TvCastingApp.getInstance(); - tvCastingApp.setDACProvider(new DACProviderStub()); + tvCastingApp.setDACProvider(new com.chip.casting.util.DACProviderStub()); AppParameters appParameters = new AppParameters(); appParameters.setConfigurationManager( diff --git a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/util/GlobalCastingConstants.java b/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/util/GlobalCastingConstants.java index 4bd6d25a08364c..d063cc7e6f78c5 100644 --- a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/util/GlobalCastingConstants.java +++ b/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/util/GlobalCastingConstants.java @@ -5,4 +5,6 @@ public class GlobalCastingConstants { public static final int CommissioningWindowDurationSecs = 3 * 60; public static final int SetupPasscode = 20202021; public static final int Discriminator = 0xF00; + public static final boolean ChipCastingSimplified = + false; // set this flag to true to demo simplified casting APIs } diff --git a/examples/tv-casting-app/android/App/app/src/main/java/com/matter/casting/DACProviderStub.java b/examples/tv-casting-app/android/App/app/src/main/java/com/matter/casting/DACProviderStub.java new file mode 100644 index 00000000000000..37bc17dd59ca6f --- /dev/null +++ b/examples/tv-casting-app/android/App/app/src/main/java/com/matter/casting/DACProviderStub.java @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2023 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. + */ +package com.matter.casting; + +import android.util.Base64; +import com.matter.casting.support.DACProvider; +import java.math.BigInteger; +import java.security.AlgorithmParameters; +import java.security.KeyFactory; +import java.security.PrivateKey; +import java.security.Signature; +import java.security.spec.ECGenParameterSpec; +import java.security.spec.ECParameterSpec; +import java.security.spec.ECPrivateKeySpec; + +public class DACProviderStub implements DACProvider { + + private String kDevelopmentDAC_Cert_FFF1_8001 = + "MIIB5zCCAY6gAwIBAgIIac3xDenlTtEwCgYIKoZIzj0EAwIwPTElMCMGA1UEAwwcTWF0dGVyIERldiBQQUkgMHhGRkYxIG5vIFBJRDEUMBIGCisGAQQBgqJ8AgEMBEZGRjEwIBcNMjIwMjA1MDAwMDAwWhgPOTk5OTEyMzEyMzU5NTlaMFMxJTAjBgNVBAMMHE1hdHRlciBEZXYgREFDIDB4RkZGMS8weDgwMDExFDASBgorBgEEAYKifAIBDARGRkYxMRQwEgYKKwYBBAGConwCAgwEODAwMTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABEY6xpNCkQoOVYj8b/Vrtj5i7M7LFI99TrA+5VJgFBV2fRalxmP3k+SRIyYLgpenzX58/HsxaznZjpDSk3dzjoKjYDBeMAwGA1UdEwEB/wQCMAAwDgYDVR0PAQH/BAQDAgeAMB0GA1UdDgQWBBSI3eezADgpMs/3NMBGJIEPRBaKbzAfBgNVHSMEGDAWgBRjVA5H9kscONE4hKRi0WwZXY/7PDAKBggqhkjOPQQDAgNHADBEAiABJ6J7S0RhDuL83E0reIVWNmC8D3bxchntagjfsrPBzQIga1ngr0Xz6yqFuRnTVzFSjGAoxBUjlUXhCOTlTnCXE1M="; + + private String kDevelopmentDAC_PrivateKey_FFF1_8001 = + "qrYAroroqrfXNifCF7fCBHCcppRq9fL3UwgzpStE+/8="; + + private String kDevelopmentDAC_PublicKey_FFF1_8001 = + "BEY6xpNCkQoOVYj8b/Vrtj5i7M7LFI99TrA+5VJgFBV2fRalxmP3k+SRIyYLgpenzX58/HsxaznZjpDSk3dzjoI="; + + private String KPAI_FFF1_8000_Cert_Array = + "MIIByzCCAXGgAwIBAgIIVq2CIq2UW2QwCgYIKoZIzj0EAwIwMDEYMBYGA1UEAwwPTWF0dGVyIFRlc3QgUEFBMRQwEgYKKwYBBAGConwCAQwERkZGMTAgFw0yMjAyMDUwMDAwMDBaGA85OTk5MTIzMTIzNTk1OVowPTElMCMGA1UEAwwcTWF0dGVyIERldiBQQUkgMHhGRkYxIG5vIFBJRDEUMBIGCisGAQQBgqJ8AgEMBEZGRjEwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAARBmpMVwhc+DIyHbQPM/JRIUmR/f+xeUIL0BZko7KiUxZQVEwmsYx5MsDOSr2hLC6+35ls7gWLC9Sv5MbjneqqCo2YwZDASBgNVHRMBAf8ECDAGAQH/AgEAMA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUY1QOR/ZLHDjROISkYtFsGV2P+zwwHwYDVR0jBBgwFoAUav0idx9RH+y/FkGXZxDc3DGhcX4wCgYIKoZIzj0EAwIDSAAwRQIhALLvJ/Sa6bUPuR7qyUxNC9u415KcbLiPrOUpNo0SBUwMAiBlXckrhr2QmIKmxiF3uCXX0F7b58Ivn+pxIg5+pwP4kQ=="; + + /** + * format_version = 1 vendor_id = 0xFFF1 product_id_array = [ 0x8000,0x8001...0x8063] + * device_type_id = 0x1234 certificate_id = "ZIG20141ZB330001-24" security_level = 0 + * security_information = 0 version_number = 0x2694 certification_type = 0 dac_origin_vendor_id is + * not present dac_origin_product_id is not present + */ + private String kCertificationDeclaration = + "MIICGQYJKoZIhvcNAQcCoIICCjCCAgYCAQMxDTALBglghkgBZQMEAgEwggFxBgkqhkiG9w0BBwGgggFiBIIBXhUkAAElAfH/NgIFAIAFAYAFAoAFA4AFBIAFBYAFBoAFB4AFCIAFCYAFCoAFC4AFDIAFDYAFDoAFD4AFEIAFEYAFEoAFE4AFFIAFFYAFFoAFF4AFGIAFGYAFGoAFG4AFHIAFHYAFHoAFH4AFIIAFIYAFIoAFI4AFJIAFJYAFJoAFJ4AFKIAFKYAFKoAFK4AFLIAFLYAFLoAFL4AFMIAFMYAFMoAFM4AFNIAFNYAFNoAFN4AFOIAFOYAFOoAFO4AFPIAFPYAFPoAFP4AFQIAFQYAFQoAFQ4AFRIAFRYAFRoAFR4AFSIAFSYAFSoAFS4AFTIAFTYAFToAFT4AFUIAFUYAFUoAFU4AFVIAFVYAFVoAFV4AFWIAFWYAFWoAFW4AFXIAFXYAFXoAFX4AFYIAFYYAFYoAFY4AYJAMWLAQTWklHMjAxNDJaQjMzMDAwMy0yNCQFACQGACUHlCYkCAAYMX0wewIBA4AUYvqCM1ms+qmWPhz6FArd9QTzcWAwCwYJYIZIAWUDBAIBMAoGCCqGSM49BAMCBEcwRQIgJOXR9Hp9ew0gaibvaZt8l1e3LUaQid4xkuZ4x0Xn9gwCIQD4qi+nEfy3m5fjl87aZnuuRk4r0//fw8zteqjKX0wafA=="; + + @Override + public byte[] GetCertificationDeclaration() { + return Base64.decode(kCertificationDeclaration, Base64.DEFAULT); + } + + @Override + public byte[] GetFirmwareInformation() { + return new byte[0]; + } + + @Override + public byte[] GetDeviceAttestationCert() { + return Base64.decode(kDevelopmentDAC_Cert_FFF1_8001, Base64.DEFAULT); + } + + @Override + public byte[] GetProductAttestationIntermediateCert() { + return Base64.decode(KPAI_FFF1_8000_Cert_Array, Base64.DEFAULT); + } + + @Override + public byte[] SignWithDeviceAttestationKey(byte[] message) { + + try { + byte[] privateKeyBytes = Base64.decode(kDevelopmentDAC_PrivateKey_FFF1_8001, Base64.DEFAULT); + + AlgorithmParameters algorithmParameters = AlgorithmParameters.getInstance("EC"); + algorithmParameters.init(new ECGenParameterSpec("secp256r1")); + ECParameterSpec parameterSpec = algorithmParameters.getParameterSpec(ECParameterSpec.class); + ECPrivateKeySpec ecPrivateKeySpec = + new ECPrivateKeySpec(new BigInteger(1, privateKeyBytes), parameterSpec); + + KeyFactory keyFactory = KeyFactory.getInstance("EC"); + PrivateKey privateKey = keyFactory.generatePrivate(ecPrivateKeySpec); + + Signature signature = Signature.getInstance("SHA256withECDSA"); + signature.initSign(privateKey); + + signature.update(message); + + return signature.sign(); + + } catch (Exception e) { + return null; + } + } +} diff --git a/examples/tv-casting-app/android/App/app/src/main/java/com/matter/casting/InitializationExample.java b/examples/tv-casting-app/android/App/app/src/main/java/com/matter/casting/InitializationExample.java new file mode 100644 index 00000000000000..0d2135e1a7bc66 --- /dev/null +++ b/examples/tv-casting-app/android/App/app/src/main/java/com/matter/casting/InitializationExample.java @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2023 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. + */ +package com.matter.casting; + +import android.content.Context; +import android.util.Log; +import chip.platform.ConfigurationManager; +import com.chip.casting.util.PreferencesConfigurationManager; +import com.matter.casting.core.CastingApp; +import com.matter.casting.support.AppParameters; +import com.matter.casting.support.CommissionableData; +import com.matter.casting.support.DACProvider; +import com.matter.casting.support.DataProvider; +import com.matter.casting.support.MatterError; + +public class InitializationExample { + private static final String TAG = InitializationExample.class.getSimpleName(); + + /** + * DataProvider implementation for the Unique ID that is used by the SDK to generate the Rotating + * Device ID + */ + private static final DataProvider rotatingDeviceIdUniqueIdProvider = + new DataProvider() { + private static final String ROTATING_DEVICE_ID_UNIQUE_ID = + "EXAMPLE_ID"; // dummy value for demonstration only + + @Override + public byte[] get() { + return ROTATING_DEVICE_ID_UNIQUE_ID.getBytes(); + } + }; + + /** + * DataProvider implementation for the Commissioning Data used by the SDK when the CastingApp goes + * through commissioning + */ + private static final DataProvider commissionableDataProvider = + new DataProvider() { + @Override + public CommissionableData get() { + // dummy values for demonstration only + return new CommissionableData(20202021, 3874); + } + }; + + /** + * DACProvider implementation for the Device Attestation Credentials required at the time of + * commissioning + * + *

Using the DACProviderStub which provides dummy values for demonstration only + */ + private static final DACProvider dacProvider = new DACProviderStub(); + + /** + * @param applicationContext Given android.content.Context, initialize and start the CastingApp + */ + public static MatterError initAndStart(Context applicationContext) { + // Create an AppParameters object to pass in global casting parameters to the SDK + final AppParameters appParameters = + new AppParameters( + applicationContext, + new DataProvider() { + @Override + public ConfigurationManager get() { + return new PreferencesConfigurationManager( + applicationContext, "chip.platform.ConfigurationManager"); + } + }, + rotatingDeviceIdUniqueIdProvider, + commissionableDataProvider, + dacProvider); + + // Initialize the SDK using the appParameters and check if it returns successfully + MatterError err = CastingApp.getInstance().initialize(appParameters); + if (err.hasError()) { + Log.e(TAG, "Failed to initialize Matter CastingApp"); + return err; + } + + err = CastingApp.getInstance().start(); + if (err.hasError()) { + Log.e(TAG, "Failed to start Matter CastingApp"); + return err; + } + return err; + } +} diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/core/CastingApp.java b/examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/core/CastingApp.java new file mode 100644 index 00000000000000..0823920503d9db --- /dev/null +++ b/examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/core/CastingApp.java @@ -0,0 +1,163 @@ +/* + * Copyright (c) 2023 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. + */ + +package com.matter.casting.core; + +import android.content.Context; +import android.util.Log; +import chip.appserver.ChipAppServer; +import chip.platform.AndroidBleManager; +import chip.platform.AndroidChipPlatform; +import chip.platform.ChipMdnsCallbackImpl; +import chip.platform.DiagnosticDataProviderImpl; +import chip.platform.NsdManagerServiceBrowser; +import chip.platform.NsdManagerServiceResolver; +import chip.platform.PreferencesKeyValueStoreManager; +import com.matter.casting.support.AppParameters; +import com.matter.casting.support.CommissionableData; +import com.matter.casting.support.MatterError; + +/** + * CastingApp represents an app that can cast content to a Casting Player. This class is a + * singleton. + */ +public final class CastingApp { + private static final String TAG = CastingApp.class.getSimpleName(); + + private static CastingApp sInstance; + + private CastingAppState mState = CastingAppState.UNINITIALIZED; + private AppParameters appParameters; + private NsdManagerServiceResolver.NsdManagerResolverAvailState nsdManagerResolverAvailState; + private ChipAppServer chipAppServer; + + private CastingApp() {} + + public static CastingApp getInstance() { + if (sInstance == null) { + sInstance = new CastingApp(); + } + return sInstance; + } + + /** + * Initializes the CastingApp with appParameters + * + * @param appParameters + */ + public MatterError initialize(AppParameters appParameters) { + Log.i(TAG, "CastingApp.initialize called"); + if (mState != CastingAppState.UNINITIALIZED) { + return MatterError.CHIP_ERROR_INCORRECT_STATE; + } + + this.appParameters = appParameters; + this.nsdManagerResolverAvailState = + new NsdManagerServiceResolver.NsdManagerResolverAvailState(); + + Context applicationContext = appParameters.getApplicationContext(); + AndroidChipPlatform chipPlatform = + new AndroidChipPlatform( + new AndroidBleManager(), + new PreferencesKeyValueStoreManager(appParameters.getApplicationContext()), + appParameters.getConfigurationManagerProvider().get(), + new NsdManagerServiceResolver(applicationContext, nsdManagerResolverAvailState), + new NsdManagerServiceBrowser(applicationContext), + new ChipMdnsCallbackImpl(), + new DiagnosticDataProviderImpl(applicationContext)); + + CommissionableData commissionableData = appParameters.getCommissionableDataProvider().get(); + boolean updated = + chipPlatform.updateCommissionableDataProviderData( + commissionableData.getSpake2pVerifierBase64(), + commissionableData.getSpake2pSaltBase64(), + commissionableData.getSpake2pIterationCount(), + commissionableData.getSetupPasscode(), + commissionableData.getDiscriminator()); + if (!updated) { + Log.e( + TAG, "CastingApp.initApp failed to updateCommissionableDataProviderData on chipPlatform"); + return MatterError.CHIP_ERROR_INVALID_ARGUMENT; + } + + MatterError err = finishInitialization(appParameters); + + if (err.hasNoError()) { + chipAppServer = new ChipAppServer(); // get a reference to the Matter server now + mState = CastingAppState.NOT_RUNNING; // initialization done, set state to NOT_RUNNING + } + return err; + } + + /** + * Starts the Matter server that the CastingApp runs on and registers all the necessary delegates + */ + public MatterError start() { + Log.i(TAG, "CastingApp.start called"); + if (mState != CastingAppState.NOT_RUNNING) { + return MatterError.CHIP_ERROR_INCORRECT_STATE; + } + + boolean serverStarted = chipAppServer.startApp(); + if (!serverStarted) { + Log.e(TAG, "CastingApp.start failed to start Matter server"); + return MatterError.CHIP_ERROR_INCORRECT_STATE; + } + + MatterError err = finishStartup(); + if (err.hasNoError()) { + mState = CastingAppState.RUNNING; // CastingApp started successfully, set state to RUNNING + } + return err; + } + + /** + * Stops the Matter server that the CastingApp runs on + * + * @return + */ + public MatterError stop() { + Log.i(TAG, "CastingApp.stop called"); + if (mState != CastingAppState.RUNNING) { + return MatterError.CHIP_ERROR_INCORRECT_STATE; + } + + boolean serverStopped = chipAppServer.stopApp(); + if (!serverStopped) { + Log.e(TAG, "CastingApp.stop failed to stop Matter server"); + return MatterError.CHIP_ERROR_INCORRECT_STATE; + } + mState = + CastingAppState.NOT_RUNNING; // CastingApp stopped successfully, set state to NOT_RUNNING + + return MatterError.NO_ERROR; + } + + /** + * Sets DeviceAttestationCrdentials provider and RotatingDeviceIdUniqueId + * + * @param appParameters + */ + private native MatterError finishInitialization(AppParameters appParameters); + + /** Performs post Matter server startup registrations */ + private native MatterError finishStartup(); + + static { + System.loadLibrary("TvCastingApp"); + } +} diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/core/CastingAppState.java b/examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/core/CastingAppState.java new file mode 100644 index 00000000000000..89ddef7aa0dbf6 --- /dev/null +++ b/examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/core/CastingAppState.java @@ -0,0 +1,8 @@ +package com.matter.casting.core; + +/** Represents the state of the CastingApp */ +enum CastingAppState { + UNINITIALIZED, // Before Initialize() success + NOT_RUNNING, // After Initialize() success before Start()ing, OR After stop() success + RUNNING, // After Start() success +} diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/support/AppParameters.java b/examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/support/AppParameters.java new file mode 100644 index 00000000000000..0734271ca89b88 --- /dev/null +++ b/examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/support/AppParameters.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2023 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. + */ + +package com.matter.casting.support; + +import android.content.Context; +import androidx.annotation.NonNull; +import chip.platform.ConfigurationManager; + +public class AppParameters { + @NonNull private final Context applicationContext; + + @NonNull private final DataProvider configurationManagerProvider; + + @NonNull private final DataProvider rotatingDeviceIdUniqueIdProvider; + + @NonNull private final DataProvider commissionableDataProvider; + + @NonNull private final DACProvider dacProvider; + + /** + * @param applicationContext the Android app's android.content.Context + * @param configurationManagerProvider Implementation of chip.platform.ConfigurationManager + * @param rotatingDeviceIdUniqueIdProvider Provides values of the uniqueID used to generate the + * RotatingDeviceId of the CastingApp + * @param commissionableDataProvider Provides CommissionableData (such as setupPasscode, + * discriminator, etc) used to get the CastingApp commissioned + * @param dacProvider Provides DeviceAttestationCredentials of the CastingApp during commissioning + */ + public AppParameters( + @NonNull Context applicationContext, + @NonNull DataProvider configurationManagerProvider, + @NonNull DataProvider rotatingDeviceIdUniqueIdProvider, + @NonNull DataProvider commissionableDataProvider, + @NonNull DACProvider dacProvider) { + this.applicationContext = applicationContext; + this.configurationManagerProvider = configurationManagerProvider; + this.rotatingDeviceIdUniqueIdProvider = rotatingDeviceIdUniqueIdProvider; + this.commissionableDataProvider = commissionableDataProvider; + this.dacProvider = dacProvider; + } + + @NonNull + public Context getApplicationContext() { + return applicationContext; + } + + @NonNull + public DataProvider getConfigurationManagerProvider() { + return configurationManagerProvider; + } + + @NonNull + public DataProvider getRotatingDeviceIdUniqueIdProvider() { + return rotatingDeviceIdUniqueIdProvider; + } + + @NonNull + public DataProvider getCommissionableDataProvider() { + return commissionableDataProvider; + } + + @NonNull + public DACProvider getDacProvider() { + return dacProvider; + } +} diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/support/CommissionableData.java b/examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/support/CommissionableData.java new file mode 100644 index 00000000000000..b436c98c533786 --- /dev/null +++ b/examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/support/CommissionableData.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 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. + */ + +package com.matter.casting.support; + +import androidx.annotation.Nullable; + +public class CommissionableData { + private long setupPasscode; + + private int discriminator; + + @Nullable private String spake2pVerifierBase64; + + @Nullable private String spake2pSaltBase64; + + private int spake2pIterationCount; + + public CommissionableData(long setupPasscode, int discriminator) { + this.setupPasscode = setupPasscode; + this.discriminator = discriminator; + } + + public long getSetupPasscode() { + return setupPasscode; + } + + public int getDiscriminator() { + return discriminator; + } + + @Nullable + public String getSpake2pVerifierBase64() { + return spake2pVerifierBase64; + } + + public void setSpake2pVerifierBase64(@Nullable String spake2pVerifierBase64) { + this.spake2pVerifierBase64 = spake2pVerifierBase64; + } + + @Nullable + public String getSpake2pSaltBase64() { + return spake2pSaltBase64; + } + + public void setSpake2pSaltBase64(@Nullable String spake2pSaltBase64) { + this.spake2pSaltBase64 = spake2pSaltBase64; + } + + public int getSpake2pIterationCount() { + return spake2pIterationCount; + } + + public void setSpake2pIterationCount(int spake2pIterationCount) { + this.spake2pIterationCount = spake2pIterationCount; + } +} diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/support/DACProvider.java b/examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/support/DACProvider.java new file mode 100644 index 00000000000000..3fdca947e3b035 --- /dev/null +++ b/examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/support/DACProvider.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2023 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. + * + */ +package com.matter.casting.support; + +public interface DACProvider { + byte[] GetCertificationDeclaration(); + + byte[] GetFirmwareInformation(); + + byte[] GetDeviceAttestationCert(); + + byte[] GetProductAttestationIntermediateCert(); + + /** + * Sign a mesage with the device attestation key. + * + *

The signature should be a SHA256withECDSA Signature that's returned in the ECDSA X9.62 Asn1 + * format. This is the default behavior when using java.security.Signature with an EC P-256 curve. + * + * @param message The message to sign + * @return The signature in ECDSA X9.62 Asn1 format. + */ + byte[] SignWithDeviceAttestationKey(byte[] message); +} diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/support/DataProvider.java b/examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/support/DataProvider.java new file mode 100644 index 00000000000000..eb701413bcd477 --- /dev/null +++ b/examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/support/DataProvider.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2023 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. + */ + +package com.matter.casting.support; + +import android.util.Log; + +public abstract class DataProvider { + private static final String TAG = DataProvider.class.getSimpleName(); + + protected T _get() { + T val = null; + try { + val = get(); + } catch (Throwable t) { + Log.e(TAG, "DataProvider::Caught an unhandled Throwable from the client: " + t); + } + return val; + } + + public abstract T get(); +} diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/support/MatterError.java b/examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/support/MatterError.java new file mode 100644 index 00000000000000..c570cf60e7f70c --- /dev/null +++ b/examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/support/MatterError.java @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 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. + */ + +package com.matter.casting.support; + +import java.util.Objects; + +public class MatterError { + private long errorCode; + private String errorMessage; + + public static final MatterError NO_ERROR = new MatterError(0, null); + + public static final MatterError CHIP_ERROR_INVALID_ARGUMENT = + new MatterError(0x2f, "CHIP_ERROR_INVALID_ARGUMENT"); + + public static final MatterError CHIP_ERROR_INCORRECT_STATE = + new MatterError(0x03, "CHIP_ERROR_INCORRECT_STATE"); + + public MatterError(long errorCode, String errorMessage) { + this.errorCode = errorCode; + this.errorMessage = errorMessage; + } + + public boolean hasError() { + return !this.equals(NO_ERROR); + } + + public boolean hasNoError() { + return this.equals(NO_ERROR); + } + + public long getErrorCode() { + return errorCode; + } + + public String getErrorMessage() { + return errorMessage; + } + + @Override + public String toString() { + return "MatterError{" + + (hasNoError() + ? "No error" + : "errorCode=" + errorCode + ", errorMessage='" + errorMessage + '\'') + + '}'; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + MatterError matterError = (MatterError) o; + return errorCode == matterError.getErrorCode(); + } + + @Override + public int hashCode() { + return Objects.hash(errorCode); + } +} diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/CastingApp-JNI.cpp b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/CastingApp-JNI.cpp new file mode 100644 index 00000000000000..984287af8c30fd --- /dev/null +++ b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/CastingApp-JNI.cpp @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2023 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. + * + */ + +#include "CastingApp-JNI.h" + +#include "../JNIDACProvider.h" +#include "../support/ErrorConverter-JNI.h" +#include "../support/RotatingDeviceIdUniqueIdProvider-JNI.h" +#include "core/CastingApp.h" // from tv-casting-common + +#include +#include +#include +#include +#include + +using namespace chip; + +#define JNI_METHOD(RETURN, METHOD_NAME) extern "C" JNIEXPORT RETURN JNICALL Java_com_matter_casting_core_CastingApp_##METHOD_NAME + +namespace matter { +namespace casting { +namespace core { + +CastingAppJNI CastingAppJNI::sInstance; + +jobject extractJAppParameter(jobject jAppParameters, const char * methodName, const char * methodSig); + +JNI_METHOD(jobject, finishInitialization)(JNIEnv *, jobject, jobject jAppParameters) +{ + chip::DeviceLayer::StackLock lock; + ChipLogProgress(AppServer, "JNI_METHOD CastingAppJNI.finishInitialization called"); + VerifyOrReturnValue(jAppParameters != nullptr, support::createJMatterError(CHIP_ERROR_INVALID_ARGUMENT)); + CHIP_ERROR err = CHIP_NO_ERROR; + + jobject jUniqueIdProvider = + extractJAppParameter(jAppParameters, "getRotatingDeviceIdUniqueIdProvider", "()Lcom/matter/casting/support/DataProvider;"); + VerifyOrReturnValue(jUniqueIdProvider != nullptr, support::createJMatterError(CHIP_ERROR_INCORRECT_STATE)); + support::RotatingDeviceIdUniqueIdProviderJNI * uniqueIdProvider = new support::RotatingDeviceIdUniqueIdProviderJNI(); + err = uniqueIdProvider->Initialize(jUniqueIdProvider); + VerifyOrReturnValue(err == CHIP_NO_ERROR, support::createJMatterError(CHIP_ERROR_INVALID_ARGUMENT)); + + // set the RotatingDeviceIdUniqueId +#if CHIP_ENABLE_ROTATING_DEVICE_ID + chip::MutableByteSpan * uniqueId = uniqueIdProvider->Get(); + if (uniqueId != nullptr) + { + chip::DeviceLayer::ConfigurationMgr().SetRotatingDeviceIdUniqueId(*uniqueId); + } +#endif // CHIP_ENABLE_ROTATING_DEVICE_ID + + // get the DACProvider + jobject jDACProvider = extractJAppParameter(jAppParameters, "getDacProvider", "()Lcom/matter/casting/support/DACProvider;"); + VerifyOrReturnValue(jDACProvider != nullptr, support::createJMatterError(CHIP_ERROR_INCORRECT_STATE)); + + // set the DACProvider + JNIDACProvider * dacProvider = new JNIDACProvider(jDACProvider); + chip::Credentials::SetDeviceAttestationCredentialsProvider(dacProvider); + + return support::createJMatterError(CHIP_NO_ERROR); +} + +JNI_METHOD(jobject, finishStartup)(JNIEnv *, jobject) +{ + chip::DeviceLayer::StackLock lock; + ChipLogProgress(AppServer, "JNI_METHOD CastingAppJNI.finishStartup called"); + auto & server = chip::Server::GetInstance(); + + // TODO: Set AppDelegate + // &server.GetCommissioningWindowManager().SetAppDelegate(??); + + // Initialize binding handlers + chip::BindingManager::GetInstance().Init( + { &server.GetFabricTable(), server.GetCASESessionManager(), &server.GetPersistentStorage() }); + + // TODO: Set FabricDelegate + // chip::Server::GetInstance().GetFabricTable().AddFabricDelegate(&mPersistenceManager); + + // TODO: Add DeviceEvent Handler + // ReturnErrorOnFailure(DeviceLayer::PlatformMgrImpl().AddEventHandler(DeviceEventCallback, 0)); + + return support::createJMatterError(CHIP_NO_ERROR); +} + +jobject extractJAppParameter(jobject jAppParameters, const char * methodName, const char * methodSig) +{ + ChipLogProgress(AppServer, "JNI_METHOD extractJAppParameter called"); + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + + jclass jAppParametersClass; + CHIP_ERROR err = + chip::JniReferences::GetInstance().GetClassRef(env, "com/matter/casting/support/AppParameters", jAppParametersClass); + VerifyOrReturnValue(err == CHIP_NO_ERROR, nullptr); + + // get the RotatingDeviceIdUniqueIdProvider + jmethodID getMethod = env->GetMethodID(jAppParametersClass, methodName, methodSig); + if (env->ExceptionCheck()) + { + env->ExceptionDescribe(); + env->ExceptionClear(); + return nullptr; + } + + jobject jParameter = (jobject) env->CallObjectMethod(jAppParameters, getMethod); + if (env->ExceptionCheck()) + { + env->ExceptionDescribe(); + env->ExceptionClear(); + return nullptr; + } + + return jParameter; +} + +}; // namespace core +}; // namespace casting +}; // namespace matter diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/CastingApp-JNI.h b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/CastingApp-JNI.h new file mode 100644 index 00000000000000..668ab78fdcfccd --- /dev/null +++ b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/CastingApp-JNI.h @@ -0,0 +1,41 @@ +/* + * + * Copyright (c) 2023 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. + */ + +#pragma once + +#include + +namespace matter { +namespace casting { +namespace core { + +class CastingAppJNI +{ +public: +private: + friend CastingAppJNI & CastingAppJNIMgr(); + static CastingAppJNI sInstance; +}; + +inline class CastingAppJNI & CastingAppJNIMgr() +{ + return CastingAppJNI::sInstance; +} +}; // namespace core +}; // namespace casting +}; // namespace matter diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/support/ErrorConverter-JNI.cpp b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/support/ErrorConverter-JNI.cpp new file mode 100644 index 00000000000000..171a44dc793f9f --- /dev/null +++ b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/support/ErrorConverter-JNI.cpp @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2023 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. + * + */ + +#include "ErrorConverter-JNI.h" +#include + +namespace matter { +namespace casting { +namespace support { + +using namespace chip; + +jobject createJMatterError(CHIP_ERROR inErr) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jclass jMatterErrorClass; + CHIP_ERROR err = + chip::JniReferences::GetInstance().GetClassRef(env, "com/matter/casting/support/MatterError", jMatterErrorClass); + VerifyOrReturnValue(err == CHIP_NO_ERROR, nullptr); + + jmethodID jMatterErrorConstructor = env->GetMethodID(jMatterErrorClass, "", "(JLjava/lang/String;)V"); + + return env->NewObject(jMatterErrorClass, jMatterErrorConstructor, err.AsInteger(), nullptr); +} + +}; // namespace support +}; // namespace casting +}; // namespace matter diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/support/ErrorConverter-JNI.h b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/support/ErrorConverter-JNI.h new file mode 100644 index 00000000000000..e11523397db4f3 --- /dev/null +++ b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/support/ErrorConverter-JNI.h @@ -0,0 +1,31 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#include + +#include + +namespace matter { +namespace casting { +namespace support { + +jobject createJMatterError(CHIP_ERROR inErr); + +}; // namespace support +}; // namespace casting +}; // namespace matter diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/support/RotatingDeviceIdUniqueIdProvider-JNI.cpp b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/support/RotatingDeviceIdUniqueIdProvider-JNI.cpp new file mode 100644 index 00000000000000..e010b56da36b28 --- /dev/null +++ b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/support/RotatingDeviceIdUniqueIdProvider-JNI.cpp @@ -0,0 +1,94 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "RotatingDeviceIdUniqueIdProvider-JNI.h" +#include "lib/support/logging/CHIPLogging.h" +#include +#include +#include +#include +#include +#include + +using namespace chip; + +namespace matter { +namespace casting { +namespace support { + +CHIP_ERROR RotatingDeviceIdUniqueIdProviderJNI::Initialize(jobject provider) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + VerifyOrReturnValue(env != nullptr, CHIP_ERROR_INCORRECT_STATE, + ChipLogError(AppServer, "Failed to GetEnvForCurrentThread for RotatingDeviceIdUniqueIdProviderJNI")); + + mJNIProviderObject = env->NewGlobalRef(provider); + VerifyOrReturnValue(mJNIProviderObject != nullptr, CHIP_ERROR_INCORRECT_STATE, + ChipLogError(AppServer, "Failed to NewGlobalRef JNIProvider")); + + jclass JNIProviderClass = env->GetObjectClass(provider); + VerifyOrReturnValue(JNIProviderClass != nullptr, CHIP_ERROR_INCORRECT_STATE, + ChipLogError(AppServer, "Failed to get JNIProvider Java class")); + + mGetMethod = env->GetMethodID(JNIProviderClass, "_get", "()Ljava/lang/Object;"); + if (mGetMethod == nullptr) + { + ChipLogError(AppServer, "Failed to access JNIProvider '_get' method"); + env->ExceptionClear(); + } + return CHIP_NO_ERROR; +} + +CHIP_ERROR RotatingDeviceIdUniqueIdProviderJNI::GetJavaByteByMethod(jmethodID method, MutableByteSpan & out_buffer) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + VerifyOrReturnLogError(mJNIProviderObject != nullptr, CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnLogError(method != nullptr, CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnLogError(env != nullptr, CHIP_JNI_ERROR_NO_ENV); + + jbyteArray outArray = (jbyteArray) env->CallObjectMethod(mJNIProviderObject, method); + if (env->ExceptionCheck()) + { + ChipLogError(AppServer, "Java exception in get Method"); + env->ExceptionDescribe(); + env->ExceptionClear(); + return CHIP_ERROR_INCORRECT_STATE; + } + + if (outArray == nullptr || env->GetArrayLength(outArray) <= 0) + { + out_buffer.reduce_size(0); + return CHIP_NO_ERROR; + } + + JniByteArray JniOutArray(env, outArray); + return CopySpanToMutableSpan(JniOutArray.byteSpan(), out_buffer); +} + +MutableByteSpan * RotatingDeviceIdUniqueIdProviderJNI::Get() +{ + ChipLogProgress(AppServer, "RotatingDeviceIdUniqueIdProviderJNI.Get() called"); + mRotatingDeviceIdUniqueIdSpan = MutableByteSpan(mRotatingDeviceIdUniqueId); + CHIP_ERROR err = GetJavaByteByMethod(mGetMethod, mRotatingDeviceIdUniqueIdSpan); + VerifyOrReturnValue(err != CHIP_NO_ERROR, nullptr, + ChipLogError(AppServer, "Error calling GetJavaByteByMethod %" CHIP_ERROR_FORMAT, err.Format())); + return &mRotatingDeviceIdUniqueIdSpan; +} + +}; // namespace support +}; // namespace casting +}; // namespace matter diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/support/RotatingDeviceIdUniqueIdProvider-JNI.h b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/support/RotatingDeviceIdUniqueIdProvider-JNI.h new file mode 100644 index 00000000000000..fdec7744684834 --- /dev/null +++ b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/support/RotatingDeviceIdUniqueIdProvider-JNI.h @@ -0,0 +1,44 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#include "core/Types.h" + +#include + +namespace matter { +namespace casting { +namespace support { + +class RotatingDeviceIdUniqueIdProviderJNI : public MutableByteSpanDataProvider +{ +public: + CHIP_ERROR Initialize(jobject provider); + chip::MutableByteSpan * Get() override; + +private: + CHIP_ERROR GetJavaByteByMethod(jmethodID method, chip::MutableByteSpan & out_buffer); + jobject mJNIProviderObject = nullptr; + jmethodID mGetMethod = nullptr; + + chip::MutableByteSpan mRotatingDeviceIdUniqueIdSpan; + uint8_t mRotatingDeviceIdUniqueId[chip::DeviceLayer::ConfigurationManager::kRotatingDeviceIDUniqueIDLength]; +}; + +}; // namespace support +}; // namespace casting +}; // namespace matter diff --git a/examples/tv-casting-app/android/BUILD.gn b/examples/tv-casting-app/android/BUILD.gn index d072dd4c088e95..ae349bce337efe 100644 --- a/examples/tv-casting-app/android/BUILD.gn +++ b/examples/tv-casting-app/android/BUILD.gn @@ -34,6 +34,16 @@ shared_library("jni") { "App/app/src/main/jni/cpp/TvCastingApp-JNI.cpp", ] + # add simplified casting API files here + sources += [ + "App/app/src/main/jni/cpp/core/CastingApp-JNI.cpp", + "App/app/src/main/jni/cpp/core/CastingApp-JNI.h", + "App/app/src/main/jni/cpp/support/ErrorConverter-JNI.cpp", + "App/app/src/main/jni/cpp/support/ErrorConverter-JNI.h", + "App/app/src/main/jni/cpp/support/RotatingDeviceIdUniqueIdProvider-JNI.cpp", + "App/app/src/main/jni/cpp/support/RotatingDeviceIdUniqueIdProvider-JNI.h", + ] + deps = [ "${chip_root}/examples/tv-casting-app/tv-casting-common", "${chip_root}/src/app/server/java:jni", @@ -83,6 +93,17 @@ android_library("java") { "App/app/src/main/jni/com/chip/casting/VideoPlayer.java", ] + # add simplified casting API files here + sources += [ + "App/app/src/main/jni/com/matter/casting/core/CastingApp.java", + "App/app/src/main/jni/com/matter/casting/core/CastingAppState.java", + "App/app/src/main/jni/com/matter/casting/support/AppParameters.java", + "App/app/src/main/jni/com/matter/casting/support/CommissionableData.java", + "App/app/src/main/jni/com/matter/casting/support/DACProvider.java", + "App/app/src/main/jni/com/matter/casting/support/DataProvider.java", + "App/app/src/main/jni/com/matter/casting/support/MatterError.java", + ] + javac_flags = [ "-Xlint:deprecation" ] # TODO: add classpath support (we likely need to add something like diff --git a/examples/tv-casting-app/tv-casting-common/core/CastingApp.cpp b/examples/tv-casting-app/tv-casting-common/core/CastingApp.cpp index cc21c29c9b5f30..3dd42d91d293bb 100644 --- a/examples/tv-casting-app/tv-casting-common/core/CastingApp.cpp +++ b/examples/tv-casting-app/tv-casting-common/core/CastingApp.cpp @@ -118,7 +118,7 @@ CHIP_ERROR CastingApp::Stop() // Shutdown the Matter server chip::Server::GetInstance().Shutdown(); - mState = NOT_RUNNING; // CastingApp started successfully, set state to RUNNING + mState = NOT_RUNNING; // CastingApp stopped successfully, set state to NOT_RUNNING return CHIP_ERROR_NOT_IMPLEMENTED; } diff --git a/examples/tv-casting-app/tv-casting-common/core/CastingApp.h b/examples/tv-casting-app/tv-casting-common/core/CastingApp.h index 1f122e1153c3ab..eed69e728d4358 100644 --- a/examples/tv-casting-app/tv-casting-common/core/CastingApp.h +++ b/examples/tv-casting-app/tv-casting-common/core/CastingApp.h @@ -53,20 +53,13 @@ class CastingApp CHIP_ERROR Initialize(const matter::casting::support::AppParameters & appParameters); /** - * @brief Starts the Matter server that the CastingApp runs on and calls PostStartRegistrations() to finish starting up the + * @brief Starts the Matter server that the CastingApp runs on and registers all the necessary delegates * CastingApp. * * @return CHIP_ERROR - CHIP_NO_ERROR if Matter server started successfully, specific error code otherwise. */ CHIP_ERROR Start(); - /** - * @brief Perform post Matter server startup registrations - * - * @return CHIP_ERROR - CHIP_NO_ERROR if all registrations succeeded, specific error code otherwise - */ - CHIP_ERROR PostStartRegistrations(); - /** * @brief Stops the Matter server that the CastingApp runs on * @@ -81,6 +74,13 @@ class CastingApp CastingApp(CastingApp & other) = delete; void operator=(const CastingApp &) = delete; + /** + * @brief Perform post Matter server startup registrations + * + * @return CHIP_ERROR - CHIP_NO_ERROR if all registrations succeeded, specific error code otherwise + */ + CHIP_ERROR PostStartRegistrations(); + const matter::casting::support::AppParameters * mAppParameters; CastingAppState mState = UNINITIALIZED; diff --git a/examples/tv-casting-app/tv-casting-common/core/Types.h b/examples/tv-casting-app/tv-casting-common/core/Types.h index a5dce75d60d181..691fc3d2b36944 100644 --- a/examples/tv-casting-app/tv-casting-common/core/Types.h +++ b/examples/tv-casting-app/tv-casting-common/core/Types.h @@ -37,11 +37,11 @@ using Strong = std::shared_ptr; } // namespace memory -namespace app { +namespace core { class CastingApp; -}; +}; // namespace core namespace support { diff --git a/scripts/tools/zap/tests/inputs/all-clusters-app.zap b/scripts/tools/zap/tests/inputs/all-clusters-app.zap index 65fb24bd06b7c9..e88f5012b4af64 100644 --- a/scripts/tools/zap/tests/inputs/all-clusters-app.zap +++ b/scripts/tools/zap/tests/inputs/all-clusters-app.zap @@ -4209,16 +4209,6 @@ "define": "GENERAL_DIAGNOSTICS_CLUSTER", "side": "server", "enabled": 1, - "commands": [ - { - "name": "TestEventTrigger", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - } - ], "attributes": [ { "name": "NetworkInterfaces", @@ -27329,4 +27319,4 @@ } ], "log": [] -} \ No newline at end of file +} diff --git a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h index 4b23f95540d8d6..f8834f17d60bc0 100644 --- a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h +++ b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h @@ -1666,32 +1666,31 @@ /* Endpoint: 0, Cluster: General Diagnostics (server) */\ /* AcceptedCommandList (index=40) */ \ 0x00000000 /* TestEventTrigger */, \ - 0x00000000 /* TestEventTrigger */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 0, Cluster: Software Diagnostics (server) */\ - /* AcceptedCommandList (index=43) */ \ + /* AcceptedCommandList (index=42) */ \ 0x00000000 /* ResetWatermarks */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */\ - /* AcceptedCommandList (index=45) */ \ + /* AcceptedCommandList (index=44) */ \ 0x00000000 /* ResetCounts */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */\ - /* AcceptedCommandList (index=47) */ \ + /* AcceptedCommandList (index=46) */ \ 0x00000000 /* ResetCounts */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */\ - /* AcceptedCommandList (index=49) */ \ + /* AcceptedCommandList (index=48) */ \ 0x00000000 /* ResetCounts */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 0, Cluster: Administrator Commissioning (server) */\ - /* AcceptedCommandList (index=51) */ \ + /* AcceptedCommandList (index=50) */ \ 0x00000000 /* OpenCommissioningWindow */, \ 0x00000001 /* OpenBasicCommissioningWindow */, \ 0x00000002 /* RevokeCommissioning */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 0, Cluster: Operational Credentials (server) */\ - /* AcceptedCommandList (index=55) */ \ + /* AcceptedCommandList (index=54) */ \ 0x00000000 /* AttestationRequest */, \ 0x00000002 /* CertificateChainRequest */, \ 0x00000004 /* CSRRequest */, \ @@ -1701,35 +1700,35 @@ 0x0000000A /* RemoveFabric */, \ 0x0000000B /* AddTrustedRootCertificate */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=64)*/ \ + /* GeneratedCommandList (index=63)*/ \ 0x00000001 /* AttestationResponse */, \ 0x00000003 /* CertificateChainResponse */, \ 0x00000005 /* CSRResponse */, \ 0x00000008 /* NOCResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 0, Cluster: Group Key Management (server) */\ - /* AcceptedCommandList (index=69) */ \ + /* AcceptedCommandList (index=68) */ \ 0x00000000 /* KeySetWrite */, \ 0x00000001 /* KeySetRead */, \ 0x00000003 /* KeySetRemove */, \ 0x00000004 /* KeySetReadAllIndices */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=74)*/ \ + /* GeneratedCommandList (index=73)*/ \ 0x00000002 /* KeySetReadResponse */, \ 0x00000005 /* KeySetReadAllIndicesResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 0, Cluster: Fault Injection (server) */\ - /* AcceptedCommandList (index=77) */ \ + /* AcceptedCommandList (index=76) */ \ 0x00000000 /* FailAtFault */, \ 0x00000001 /* FailRandomlyAtFault */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Identify (server) */\ - /* AcceptedCommandList (index=80) */ \ + /* AcceptedCommandList (index=79) */ \ 0x00000000 /* Identify */, \ 0x00000040 /* TriggerEffect */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Groups (server) */\ - /* AcceptedCommandList (index=83) */ \ + /* AcceptedCommandList (index=82) */ \ 0x00000000 /* AddGroup */, \ 0x00000001 /* ViewGroup */, \ 0x00000002 /* GetGroupMembership */, \ @@ -1737,14 +1736,14 @@ 0x00000004 /* RemoveAllGroups */, \ 0x00000005 /* AddGroupIfIdentifying */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=90)*/ \ + /* GeneratedCommandList (index=89)*/ \ 0x00000000 /* AddGroupResponse */, \ 0x00000001 /* ViewGroupResponse */, \ 0x00000002 /* GetGroupMembershipResponse */, \ 0x00000003 /* RemoveGroupResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Scenes (server) */\ - /* AcceptedCommandList (index=95) */ \ + /* AcceptedCommandList (index=94) */ \ 0x00000000 /* AddScene */, \ 0x00000001 /* ViewScene */, \ 0x00000002 /* RemoveScene */, \ @@ -1753,7 +1752,7 @@ 0x00000005 /* RecallScene */, \ 0x00000006 /* GetSceneMembership */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=103)*/ \ + /* GeneratedCommandList (index=102)*/ \ 0x00000000 /* AddSceneResponse */, \ 0x00000001 /* ViewSceneResponse */, \ 0x00000002 /* RemoveSceneResponse */, \ @@ -1762,7 +1761,7 @@ 0x00000006 /* GetSceneMembershipResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: On/Off (server) */\ - /* AcceptedCommandList (index=110) */ \ + /* AcceptedCommandList (index=109) */ \ 0x00000000 /* Off */, \ 0x00000001 /* On */, \ 0x00000002 /* Toggle */, \ @@ -1771,7 +1770,7 @@ 0x00000042 /* OnWithTimedOff */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Level Control (server) */\ - /* AcceptedCommandList (index=117) */ \ + /* AcceptedCommandList (index=116) */ \ 0x00000000 /* MoveToLevel */, \ 0x00000001 /* Move */, \ 0x00000002 /* Step */, \ @@ -1782,11 +1781,11 @@ 0x00000007 /* StopWithOnOff */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Mode Select (server) */\ - /* AcceptedCommandList (index=126) */ \ + /* AcceptedCommandList (index=125) */ \ 0x00000000 /* ChangeToMode */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Door Lock (server) */\ - /* AcceptedCommandList (index=128) */ \ + /* AcceptedCommandList (index=127) */ \ 0x00000000 /* LockDoor */, \ 0x00000001 /* UnlockDoor */, \ 0x00000003 /* UnlockWithTimeout */, \ @@ -1802,7 +1801,7 @@ 0x00000024 /* GetCredentialStatus */, \ 0x00000026 /* ClearCredential */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=143)*/ \ + /* GeneratedCommandList (index=142)*/ \ 0x0000000C /* GetWeekDayScheduleResponse */, \ 0x0000000F /* GetYearDayScheduleResponse */, \ 0x0000001C /* GetUserResponse */, \ @@ -1810,7 +1809,7 @@ 0x00000025 /* GetCredentialStatusResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Window Covering (server) */\ - /* AcceptedCommandList (index=149) */ \ + /* AcceptedCommandList (index=148) */ \ 0x00000000 /* UpOrOpen */, \ 0x00000001 /* DownOrClose */, \ 0x00000002 /* StopMotion */, \ @@ -1820,16 +1819,16 @@ 0x00000008 /* GoToTiltPercentage */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Barrier Control (server) */\ - /* AcceptedCommandList (index=157) */ \ + /* AcceptedCommandList (index=156) */ \ 0x00000000 /* BarrierControlGoToPercent */, \ 0x00000001 /* BarrierControlStop */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Thermostat (server) */\ - /* AcceptedCommandList (index=160) */ \ + /* AcceptedCommandList (index=159) */ \ 0x00000000 /* SetpointRaiseLower */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Color Control (server) */\ - /* AcceptedCommandList (index=162) */ \ + /* AcceptedCommandList (index=161) */ \ 0x00000000 /* MoveToHue */, \ 0x00000001 /* MoveHue */, \ 0x00000002 /* StepHue */, \ @@ -1851,32 +1850,32 @@ 0x0000004C /* StepColorTemperature */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Target Navigator (server) */\ - /* AcceptedCommandList (index=182) */ \ + /* AcceptedCommandList (index=181) */ \ 0x00000000 /* NavigateTarget */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=184)*/ \ + /* GeneratedCommandList (index=183)*/ \ 0x00000001 /* NavigateTargetResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Media Input (server) */\ - /* AcceptedCommandList (index=186) */ \ + /* AcceptedCommandList (index=185) */ \ 0x00000000 /* SelectInput */, \ 0x00000001 /* ShowInputStatus */, \ 0x00000002 /* HideInputStatus */, \ 0x00000003 /* RenameInput */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Low Power (server) */\ - /* AcceptedCommandList (index=191) */ \ + /* AcceptedCommandList (index=190) */ \ 0x00000000 /* Sleep */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Keypad Input (server) */\ - /* AcceptedCommandList (index=193) */ \ + /* AcceptedCommandList (index=192) */ \ 0x00000000 /* SendKey */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=195)*/ \ + /* GeneratedCommandList (index=194)*/ \ 0x00000001 /* SendKeyResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Unit Testing (server) */\ - /* AcceptedCommandList (index=197) */ \ + /* AcceptedCommandList (index=196) */ \ 0x00000000 /* Test */, \ 0x00000001 /* TestNotHandled */, \ 0x00000002 /* TestSpecific */, \ @@ -1896,7 +1895,7 @@ 0x00000014 /* TestEmitTestEventRequest */, \ 0x00000015 /* TestEmitTestFabricScopedEventRequest */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=216)*/ \ + /* GeneratedCommandList (index=215)*/ \ 0x00000000 /* TestSpecificResponse */, \ 0x00000001 /* TestAddArgumentsResponse */, \ 0x00000004 /* TestListInt8UReverseResponse */, \ @@ -1908,12 +1907,12 @@ 0x0000000B /* TestEmitTestFabricScopedEventResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 2, Cluster: Identify (server) */\ - /* AcceptedCommandList (index=226) */ \ + /* AcceptedCommandList (index=225) */ \ 0x00000000 /* Identify */, \ 0x00000040 /* TriggerEffect */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 2, Cluster: Groups (server) */\ - /* AcceptedCommandList (index=229) */ \ + /* AcceptedCommandList (index=228) */ \ 0x00000000 /* AddGroup */, \ 0x00000001 /* ViewGroup */, \ 0x00000002 /* GetGroupMembership */, \ @@ -1921,14 +1920,14 @@ 0x00000004 /* RemoveAllGroups */, \ 0x00000005 /* AddGroupIfIdentifying */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=236)*/ \ + /* GeneratedCommandList (index=235)*/ \ 0x00000000 /* AddGroupResponse */, \ 0x00000001 /* ViewGroupResponse */, \ 0x00000002 /* GetGroupMembershipResponse */, \ 0x00000003 /* RemoveGroupResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 2, Cluster: Scenes (server) */\ - /* AcceptedCommandList (index=241) */ \ + /* AcceptedCommandList (index=240) */ \ 0x00000000 /* AddScene */, \ 0x00000001 /* ViewScene */, \ 0x00000002 /* RemoveScene */, \ @@ -1937,7 +1936,7 @@ 0x00000005 /* RecallScene */, \ 0x00000006 /* GetSceneMembership */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=249)*/ \ + /* GeneratedCommandList (index=248)*/ \ 0x00000000 /* AddSceneResponse */, \ 0x00000001 /* ViewSceneResponse */, \ 0x00000002 /* RemoveSceneResponse */, \ @@ -1946,7 +1945,7 @@ 0x00000006 /* GetSceneMembershipResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 2, Cluster: On/Off (server) */\ - /* AcceptedCommandList (index=256) */ \ + /* AcceptedCommandList (index=255) */ \ 0x00000000 /* Off */, \ 0x00000001 /* On */, \ 0x00000002 /* Toggle */, \ @@ -1955,7 +1954,7 @@ 0x00000042 /* OnWithTimedOff */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 65534, Cluster: Network Commissioning (server) */\ - /* AcceptedCommandList (index=263) */ \ + /* AcceptedCommandList (index=262) */ \ 0x00000000 /* ScanNetworks */, \ 0x00000002 /* AddOrUpdateWiFiNetwork */, \ 0x00000003 /* AddOrUpdateThreadNetwork */, \ @@ -1963,7 +1962,7 @@ 0x00000006 /* ConnectNetwork */, \ 0x00000008 /* ReorderNetwork */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=270)*/ \ + /* GeneratedCommandList (index=269)*/ \ 0x00000001 /* ScanNetworksResponse */, \ 0x00000005 /* NetworkConfigResponse */, \ 0x00000007 /* ConnectNetworkResponse */, \ @@ -2192,7 +2191,7 @@ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 43 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 42 ), \ .generatedCommandList = nullptr, \ .eventList = ZAP_GENERATED_EVENTS_INDEX( 12 ), \ .eventCount = 1, \ @@ -2205,7 +2204,7 @@ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 45 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 44 ), \ .generatedCommandList = nullptr, \ .eventList = nullptr, \ .eventCount = 0, \ @@ -2218,7 +2217,7 @@ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 47 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 46 ), \ .generatedCommandList = nullptr, \ .eventList = ZAP_GENERATED_EVENTS_INDEX( 13 ), \ .eventCount = 3, \ @@ -2231,7 +2230,7 @@ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 49 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 48 ), \ .generatedCommandList = nullptr, \ .eventList = nullptr, \ .eventCount = 0, \ @@ -2244,7 +2243,7 @@ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 51 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 50 ), \ .generatedCommandList = nullptr, \ .eventList = nullptr, \ .eventCount = 0, \ @@ -2257,8 +2256,8 @@ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 55 ), \ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 64 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 54 ), \ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 63 ), \ .eventList = nullptr, \ .eventCount = 0, \ },\ @@ -2270,8 +2269,8 @@ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 69 ), \ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 74 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 68 ), \ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 73 ), \ .eventList = nullptr, \ .eventCount = 0, \ },\ @@ -2322,7 +2321,7 @@ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 77 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 76 ), \ .generatedCommandList = nullptr, \ .eventList = nullptr, \ .eventCount = 0, \ @@ -2335,7 +2334,7 @@ .clusterSize = 9, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ .functions = chipFuncArrayIdentifyServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 80 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 79 ), \ .generatedCommandList = nullptr, \ .eventList = nullptr, \ .eventCount = 0, \ @@ -2348,8 +2347,8 @@ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayGroupsServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 83 ), \ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 90 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 82 ), \ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 89 ), \ .eventList = nullptr, \ .eventCount = 0, \ },\ @@ -2361,8 +2360,8 @@ .clusterSize = 13, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 95 ), \ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 103 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 94 ), \ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 102 ), \ .eventList = nullptr, \ .eventCount = 0, \ },\ @@ -2374,7 +2373,7 @@ .clusterSize = 13, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(SHUTDOWN_FUNCTION), \ .functions = chipFuncArrayOnOffServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 110 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 109 ), \ .generatedCommandList = nullptr, \ .eventList = nullptr, \ .eventCount = 0, \ @@ -2400,7 +2399,7 @@ .clusterSize = 27, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(SHUTDOWN_FUNCTION), \ .functions = chipFuncArrayLevelControlServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 117 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 116 ), \ .generatedCommandList = nullptr, \ .eventList = nullptr, \ .eventCount = 0, \ @@ -2530,7 +2529,7 @@ .clusterSize = 77, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ .functions = chipFuncArrayModeSelectServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 126 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 125 ), \ .generatedCommandList = nullptr, \ .eventList = nullptr, \ .eventCount = 0, \ @@ -2543,8 +2542,8 @@ .clusterSize = 55, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION) | ZAP_CLUSTER_MASK(SHUTDOWN_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ .functions = chipFuncArrayDoorLockServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 128 ), \ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 143 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 127 ), \ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 142 ), \ .eventList = ZAP_GENERATED_EVENTS_INDEX( 17 ), \ .eventCount = 4, \ },\ @@ -2556,7 +2555,7 @@ .clusterSize = 43, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ .functions = chipFuncArrayWindowCoveringServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 149 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 148 ), \ .generatedCommandList = nullptr, \ .eventList = nullptr, \ .eventCount = 0, \ @@ -2569,7 +2568,7 @@ .clusterSize = 11, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(SHUTDOWN_FUNCTION), \ .functions = chipFuncArrayBarrierControlServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 157 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 156 ), \ .generatedCommandList = nullptr, \ .eventList = nullptr, \ .eventCount = 0, \ @@ -2595,7 +2594,7 @@ .clusterSize = 31, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ .functions = chipFuncArrayThermostatServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 160 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 159 ), \ .generatedCommandList = nullptr, \ .eventList = nullptr, \ .eventCount = 0, \ @@ -2634,7 +2633,7 @@ .clusterSize = 345, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(SHUTDOWN_FUNCTION), \ .functions = chipFuncArrayColorControlServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 162 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 161 ), \ .generatedCommandList = nullptr, \ .eventList = nullptr, \ .eventCount = 0, \ @@ -2751,8 +2750,8 @@ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 182 ), \ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 184 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 181 ), \ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 183 ), \ .eventList = nullptr, \ .eventCount = 0, \ },\ @@ -2777,7 +2776,7 @@ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 186 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 185 ), \ .generatedCommandList = nullptr, \ .eventList = nullptr, \ .eventCount = 0, \ @@ -2790,7 +2789,7 @@ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 191 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 190 ), \ .generatedCommandList = nullptr, \ .eventList = nullptr, \ .eventCount = 0, \ @@ -2803,8 +2802,8 @@ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 193 ), \ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 195 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 192 ), \ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 194 ), \ .eventList = nullptr, \ .eventCount = 0, \ },\ @@ -2894,8 +2893,8 @@ .clusterSize = 2289, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 197 ), \ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 216 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 196 ), \ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 215 ), \ .eventList = ZAP_GENERATED_EVENTS_INDEX( 21 ), \ .eventCount = 2, \ },\ @@ -2907,7 +2906,7 @@ .clusterSize = 9, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ .functions = chipFuncArrayIdentifyServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 226 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 225 ), \ .generatedCommandList = nullptr, \ .eventList = nullptr, \ .eventCount = 0, \ @@ -2920,8 +2919,8 @@ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayGroupsServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 229 ), \ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 236 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 228 ), \ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 235 ), \ .eventList = nullptr, \ .eventCount = 0, \ },\ @@ -2933,8 +2932,8 @@ .clusterSize = 13, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 241 ), \ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 249 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 240 ), \ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 248 ), \ .eventList = nullptr, \ .eventCount = 0, \ },\ @@ -2946,7 +2945,7 @@ .clusterSize = 13, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(SHUTDOWN_FUNCTION), \ .functions = chipFuncArrayOnOffServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 256 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 255 ), \ .generatedCommandList = nullptr, \ .eventList = nullptr, \ .eventCount = 0, \ @@ -3011,8 +3010,8 @@ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 263 ), \ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 270 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 262 ), \ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 269 ), \ .eventList = nullptr, \ .eventCount = 0, \ },\ diff --git a/src/app/clusters/time-synchronization-server/time-synchronization-server.cpp b/src/app/clusters/time-synchronization-server/time-synchronization-server.cpp index b34c0f157c905c..c7c79f3d1fc499 100644 --- a/src/app/clusters/time-synchronization-server/time-synchronization-server.cpp +++ b/src/app/clusters/time-synchronization-server/time-synchronization-server.cpp @@ -807,7 +807,8 @@ CHIP_ERROR TimeSynchronizationServer::GetLocalTime(EndpointId ep, DataModel::Nul { return CHIP_ERROR_INVALID_TIME; } - VerifyOrReturnError(TimeState::kInvalid != UpdateDSTOffsetState(), CHIP_ERROR_INVALID_TIME); + TimeState newState = UpdateDSTOffsetState(); + VerifyOrReturnError(TimeState::kInvalid != newState, CHIP_ERROR_INVALID_TIME); ReturnErrorOnFailure(System::SystemClock().GetClock_RealTime(utcTime)); VerifyOrReturnError(UnixEpochToChipEpochMicro(utcTime.count(), chipEpochTime), CHIP_ERROR_INVALID_TIME); if (TimeState::kChanged == UpdateTimeZoneState()) @@ -829,6 +830,10 @@ CHIP_ERROR TimeSynchronizationServer::GetLocalTime(EndpointId ep, DataModel::Nul uint64_t localTimeSec = static_cast(static_cast(chipEpochTime) + timeZoneOffset + dstOffset); localTime.SetNonNull((localTimeSec * chip::kMicrosecondsPerSecond) + usRemainder); + if (newState == TimeState::kChanged) + { + emitDSTStatusEvent(0, dstOffset != 0); + } return CHIP_NO_ERROR; } @@ -910,8 +915,12 @@ TimeState TimeSynchronizationServer::UpdateDSTOffsetState() VerifyOrReturnValue(ClearDSTOffset() == CHIP_NO_ERROR, TimeState::kInvalid); return TimeState::kInvalid; } + int32_t previousOffset = dstList[activeDstIndex].offset; dstList[activeDstIndex].offset = 0; // not using dst and last DST item in the list is not active yet - return TimeState::kStopped; + // TODO: This enum mixes state and transitions in a way that's very confusing. This should return either an active, an + // inactive or an invalid and the caller should make the judgement about whether that has changed OR this function should + // just return a bool indicating whether a change happened + return previousOffset == 0 ? TimeState::kStopped : TimeState::kChanged; } if (activeDstIndex > 0) { diff --git a/src/controller/java/AndroidDeviceControllerWrapper.cpp b/src/controller/java/AndroidDeviceControllerWrapper.cpp index 2b8c699f96bdb1..f81d8c1c0efdb8 100644 --- a/src/controller/java/AndroidDeviceControllerWrapper.cpp +++ b/src/controller/java/AndroidDeviceControllerWrapper.cpp @@ -535,11 +535,13 @@ void AndroidDeviceControllerWrapper::OnCommissioningComplete(NodeId deviceId, CH { env->ReleaseStringUTFChars(ssidStr, ssid); env->DeleteGlobalRef(ssidStr); + ssidStr = nullptr; } if (passwordStr != nullptr) { env->ReleaseStringUTFChars(passwordStr, password); env->DeleteGlobalRef(passwordStr); + passwordStr = nullptr; } if (operationalDatasetBytes != nullptr) { diff --git a/src/darwin/Framework/CHIP/MTROTAProviderDelegateBridge.mm b/src/darwin/Framework/CHIP/MTROTAProviderDelegateBridge.mm index d64522f4ceded7..4ebef0535253ee 100644 --- a/src/darwin/Framework/CHIP/MTROTAProviderDelegateBridge.mm +++ b/src/darwin/Framework/CHIP/MTROTAProviderDelegateBridge.mm @@ -108,7 +108,6 @@ CHIP_ERROR Shutdown() mExchangeMgr = nullptr; mSystemLayer = nullptr; - mDelegateNotificationQueue = nil; return CHIP_NO_ERROR; } diff --git a/src/darwin/Framework/CHIPTests/MTRCommissionableBrowserTests.m b/src/darwin/Framework/CHIPTests/MTRCommissionableBrowserTests.m index c984ac670a8500..8c9eb603d08518 100644 --- a/src/darwin/Framework/CHIPTests/MTRCommissionableBrowserTests.m +++ b/src/darwin/Framework/CHIPTests/MTRCommissionableBrowserTests.m @@ -27,13 +27,10 @@ static const uint16_t kTestVendorId = 0xFFF1u; static const uint16_t kTestProductId1 = 0x8000u; static const uint16_t kTestProductId2 = 0x8001u; -static const uint16_t kTestDiscriminator1 = 1111u; -static const uint16_t kTestDiscriminator2 = 1112u; -static const uint16_t kTestDiscriminator3 = 1113u; -static const uint16_t kTestDiscriminator4 = 3840u; -static const uint16_t kTestDiscriminator5 = 3839u; +static const uint16_t kTestDiscriminator1 = 3840u; +static const uint16_t kTestDiscriminator2 = 3839u; static const uint16_t kDiscoverDeviceTimeoutInSeconds = 10; -static const uint16_t kExpectedDiscoveredDevicesCount = 5; +static const uint16_t kExpectedDiscoveredDevicesCount = 2; // Singleton controller we use. static MTRDeviceController * sController = nil; @@ -77,9 +74,7 @@ - (void)controller:(MTRDeviceController *)controller didFindCommissionableDevice XCTAssertEqual(instanceName.length, 16); // The instance name is random, so just ensure the len is right. XCTAssertEqualObjects(vendorId, @(kTestVendorId)); XCTAssertTrue([productId isEqual:@(kTestProductId1)] || [productId isEqual:@(kTestProductId2)]); - XCTAssertTrue([discriminator isEqual:@(kTestDiscriminator1)] || [discriminator isEqual:@(kTestDiscriminator2)] || - [discriminator isEqual:@(kTestDiscriminator3)] || [discriminator isEqual:@(kTestDiscriminator4)] || - [discriminator isEqual:@(kTestDiscriminator5)]); + XCTAssertTrue([discriminator isEqual:@(kTestDiscriminator1)] || [discriminator isEqual:@(kTestDiscriminator2)]); XCTAssertEqual(commissioningMode, YES); NSLog(@"Found Device (%@) with discriminator: %@ (vendor: %@, product: %@)", instanceName, discriminator, vendorId, productId); diff --git a/src/darwin/Framework/CHIPTests/MTROTAProviderTests.m b/src/darwin/Framework/CHIPTests/MTROTAProviderTests.m index 472bd22d9919c7..c464e325ca436d 100644 --- a/src/darwin/Framework/CHIPTests/MTROTAProviderTests.m +++ b/src/darwin/Framework/CHIPTests/MTROTAProviderTests.m @@ -46,32 +46,22 @@ static const uint16_t kTimeoutWithUpdateInSeconds = 60; static const uint64_t kDeviceId1 = 0x12341234; static const uint64_t kDeviceId2 = 0x12341235; +#ifdef ENABLE_REAL_OTA_UPDATE_TESTS static const uint64_t kDeviceId3 = 0x12341236; +#endif // ENABLE_REAL_OTA_UPDATE_TESTS // NOTE: These onboarding payloads are for the chip-ota-requestor-app, not chip-all-clusters-app static NSString * kOnboardingPayload1 = @"MT:-24J0SO527K10648G00"; // Discriminator: 1111 static NSString * kOnboardingPayload2 = @"MT:-24J0AFN00L10648G00"; // Discriminator: 1112 +#ifdef ENABLE_REAL_OTA_UPDATE_TESTS static NSString * kOnboardingPayload3 = @"MT:-24J0IRV01L10648G00"; // Discriminator: 1113 +#endif // ENABLE_REAL_OTA_UPDATE_TESTS static const uint16_t kLocalPort = 5541; static const uint16_t kTestVendorId = 0xFFF1u; static const uint16_t kOTAProviderEndpointId = 0; -static MTRDevice * sConnectedDevice1; -static MTRDevice * sConnectedDevice2; -static MTRDevice * sConnectedDevice3; - -// Singleton controller we use. static MTRDeviceController * sController = nil; -// Keys we can use to restart the controller. -static MTRTestKeys * sTestKeys = nil; - -static NSString * kOtaDownloadedFilePath1 = @"/tmp/chip-ota-requestor-downloaded-image1"; - -static NSString * kOtaDownloadedFilePath2 = @"/tmp/chip-ota-requestor-downloaded-image2"; - -static NSString * kOtaDownloadedFilePath3 = @"/tmp/chip-ota-requestor-downloaded-image3"; - static NSNumber * kUpdatedSoftwareVersion_5 = @5; static NSString * kUpdatedSoftwareVersionString_5 = @"5.0"; @@ -80,6 +70,111 @@ static NSString * kUpdatedSoftwareVersionString_10 = @"10.0"; +// kOtaRequestorBasePort gets the discriminator added to it to figure out the +// port the ota-requestor app should be using. This ensures that apps with +// distinct discriminators use distinct ports. +static const uint16_t kOtaRequestorBasePort = 5542 - 1111; + +@class MTROTARequestorAppRunner; + +@interface MTROTAProviderTests : XCTestCase +#if ENABLE_OTA_TESTS +- (NSTask *)createTaskForPath:(NSString *)path; +- (NSString *)createImageFromRawImage:(NSString *)rawImage withVersion:(NSNumber *)version; +- (MTRDevice *)commissionDeviceWithPayload:(NSString *)payloadString nodeID:(NSNumber *)nodeID; +- (void)registerRunningRequestor:(MTROTARequestorAppRunner *)requestor; +#endif // ENABLE_OTA_TESTS +@end + +#if ENABLE_OTA_TESTS +static unsigned sAppRunnerIndex = 1; + +@interface MTROTARequestorAppRunner : NSObject +@property (nonatomic, copy) NSString * downloadFilePath; + +- (instancetype)initWithPayload:(NSString *)payload testcase:(MTROTAProviderTests *)testcase; +- (MTRDevice *)commissionWithNodeID:(NSNumber *)nodeID; +@end + +@implementation MTROTARequestorAppRunner { + unsigned _uniqueIndex; + NSTask * _appTask; + MTROTAProviderTests * _testcase; + NSString * _payload; + MTRDevice * commissionedDevice; +} + +- (MTRDevice *)commissionWithNodeID:(NSNumber *)nodeID +{ + return [_testcase commissionDeviceWithPayload:_payload nodeID:nodeID]; +} + +- (instancetype)initWithPayload:(NSString *)payload testcase:(MTROTAProviderTests *)testcase +{ + if (!(self = [super init])) { + return nil; + } + + _uniqueIndex = sAppRunnerIndex++; + _testcase = testcase; + _payload = payload; + _downloadFilePath = [NSString stringWithFormat:@"/tmp/chip-ota-requestor-downloaded-image%u", _uniqueIndex]; + + NSError * error; + __auto_type * parsedPayload = [MTRSetupPayload setupPayloadWithOnboardingPayload:payload error:&error]; + XCTAssertNotNil(parsedPayload); + XCTAssertNil(error); + + XCTAssertFalse(parsedPayload.hasShortDiscriminator); + + __auto_type * discriminator = parsedPayload.discriminator; + + _appTask = [testcase createTaskForPath:@"out/debug/ota-requestor-app/chip-ota-requestor-app"]; + + __auto_type * arguments = @[ + @"--interface-id", + @"-1", + @"--secured-device-port", + [NSString stringWithFormat:@"%u", kOtaRequestorBasePort + discriminator.unsignedShortValue], + @"--discriminator", + [NSString stringWithFormat:@"%u", discriminator.unsignedShortValue], + @"--KVS", + [NSString stringWithFormat:@"/tmp/chip-ota-requestor-kvs%u", _uniqueIndex], + @"--otaDownloadPath", + _downloadFilePath, + @"--autoApplyImage", + ]; + + [_appTask setArguments:arguments]; + + NSString * outFile = [NSString stringWithFormat:@"/tmp/darwin/framework-tests/ota-requestor-app-%u.log", _uniqueIndex]; + NSString * errorFile = [NSString stringWithFormat:@"/tmp/darwin/framework-tests/ota-requestor-app-err-%u.log", _uniqueIndex]; + + // Make sure the files exist. + [[NSFileManager defaultManager] createFileAtPath:outFile contents:nil attributes:nil]; + [[NSFileManager defaultManager] createFileAtPath:errorFile contents:nil attributes:nil]; + + _appTask.standardOutput = [NSFileHandle fileHandleForWritingAtPath:outFile]; + _appTask.standardError = [NSFileHandle fileHandleForWritingAtPath:errorFile]; + + [_appTask launchAndReturnError:&error]; + XCTAssertNil(error); + + NSLog(@"Started requestor with arguments %@ stdout=%@ and stderr=%@", arguments, outFile, errorFile); + + [_testcase registerRunningRequestor:self]; + + return self; +} + +- (void)terminate +{ + [_appTask terminate]; +} + +@end +#endif // ENABLE_OTA_TESTS + @interface MTROTAProviderTestControllerDelegate : NSObject @property (nonatomic, readonly) XCTestExpectation * expectation; @property (nonatomic, readonly) NSNumber * commissioneeNodeID; @@ -352,7 +447,7 @@ - (instancetype)initWithRawImagePath:(NSString *)rawImagePath softwareVersion:(NSNumber *)softwareVersion softwareVersionString:(NSString *)softwareVersionString applyUpdateAction:(MTROTASoftwareUpdateProviderOTAApplyUpdateAction)applyUpdateAction - testcase:(XCTestCase *)testcase + testcase:(MTROTAProviderTests *)testcase { if (!(self = [super init])) { return nil; @@ -365,28 +460,7 @@ - (instancetype)initWithRawImagePath:(NSString *)rawImagePath _applyUpdateRequestExpectation = [testcase expectationWithDescription:@"handleApplyUpdateRequestForNodeID called"]; _notifyUpdateAppliedExpectation = [testcase expectationWithDescription:@"handleNotifyUpdateAppliedForNodeID called"]; - NSString * imagePath = [rawImagePath stringByReplacingOccurrencesOfString:@"raw-image" withString:@"image"]; - - // Find the right absolute path to our ota_image_tool.py script. PWD should - // point to our src/darwin/Framework, while the script is in - // src/app/ota_image_tool.py. - NSString * pwd = [[NSProcessInfo processInfo] environment][@"PWD"]; - NSString * imageToolPath = [NSString - pathWithComponents:@[ [pwd substringToIndex:(pwd.length - @"darwin/Framework".length)], @"app", @"ota_image_tool.py" ]]; - -#if ENABLE_OTA_TESTS - NSTask * task = [[NSTask alloc] init]; - [task setLaunchPath:imageToolPath]; - [task setArguments:@[ - @"create", @"-v", @"0xFFF1", @"-p", @"0x8001", @"-vn", [softwareVersion stringValue], @"-vs", softwareVersionString, @"-da", - @"sha256", rawImagePath, imagePath - ]]; - NSError * launchError = nil; - [task launchAndReturnError:&launchError]; - XCTAssertNil(launchError); - [task waitUntilExit]; - XCTAssertEqual([task terminationStatus], 0); -#endif + NSString * imagePath = [testcase createImageFromRawImage:rawImagePath withVersion:softwareVersion]; NSData * updateToken = [sOTAProviderDelegate generateUpdateToken]; @@ -501,13 +575,15 @@ - (instancetype)initWithRawImagePath:(NSString *)rawImagePath } @end -@interface MTROTAProviderTests : XCTestCase -@end - static BOOL sStackInitRan = NO; static BOOL sNeedsStackShutdown = YES; -@implementation MTROTAProviderTests +@implementation MTROTAProviderTests { + NSMutableSet * _commissionedNodeIDs; + NSMutableSet * _runningRequestors; +} + +#if ENABLE_OTA_TESTS + (void)tearDown { @@ -531,16 +607,51 @@ - (void)setUp [self initStack]; } + _commissionedNodeIDs = [[NSMutableSet alloc] init]; + _runningRequestors = [[NSMutableSet alloc] init]; + XCTAssertNil(sOTAProviderDelegate.queryImageHandler); XCTAssertNil(sOTAProviderDelegate.applyUpdateRequestHandler); XCTAssertNil(sOTAProviderDelegate.notifyUpdateAppliedHandler); XCTAssertNil(sOTAProviderDelegate.transferBeginHandler); XCTAssertNil(sOTAProviderDelegate.blockQueryHandler); XCTAssertNil(sOTAProviderDelegate.transferEndHandler); + + // Start a new controller for each test, with a new fabric. Otherwise + // reusing the same node id for our commissionee devices will cause us to + // try to reuse sessions in ways that fail. + __auto_type * testKeys = [[MTRTestKeys alloc] init]; + XCTAssertNotNil(testKeys); + + __auto_type * params = [[MTRDeviceControllerStartupParams alloc] initWithIPK:testKeys.ipk fabricID:@(1) nocSigner:testKeys]; + params.vendorID = @(kTestVendorId); + + MTRDeviceController * controller = [[MTRDeviceControllerFactory sharedInstance] createControllerOnNewFabric:params error:nil]; + XCTAssertNotNil(controller); + XCTAssertTrue([controller isRunning]); + + sController = controller; } - (void)tearDown { + for (NSNumber * nodeID in _commissionedNodeIDs) { + __auto_type * device = [MTRBaseDevice deviceWithNodeID:nodeID controller:sController]; + ResetCommissionee(device, dispatch_get_main_queue(), self, kTimeoutInSeconds); + } + + for (MTROTARequestorAppRunner * runner in _runningRequestors) { + [runner terminate]; + } + // Break cycle. + _runningRequestors = nil; + + if (sController != nil) { + [sController shutdown]; + XCTAssertFalse([sController isRunning]); + sController = nil; + } + // Per-test teardown, runs after each test. [super tearDown]; @@ -573,9 +684,16 @@ - (MTRDevice *)commissionDeviceWithPayload:(NSString *)payloadString nodeID:(NSN [self waitForExpectations:@[ expectation ] timeout:kPairingTimeoutInSeconds]; + [_commissionedNodeIDs addObject:nodeID]; + return [MTRDevice deviceWithNodeID:nodeID controller:sController]; } +- (void)registerRunningRequestor:(MTROTARequestorAppRunner *)requestor +{ + [_runningRequestors addObject:requestor]; +} + - (void)initStack { sStackInitRan = YES; @@ -593,41 +711,103 @@ - (void)initStack BOOL ok = [factory startControllerFactory:factoryParams error:nil]; XCTAssertTrue(ok); +} - __auto_type * testKeys = [[MTRTestKeys alloc] init]; - XCTAssertNotNil(testKeys); ++ (void)shutdownStack +{ + sNeedsStackShutdown = NO; - sTestKeys = testKeys; + [[MTRDeviceControllerFactory sharedInstance] stopControllerFactory]; +} - // Needs to match what startControllerOnExistingFabric calls elsewhere in - // this file do. - __auto_type * params = [[MTRDeviceControllerStartupParams alloc] initWithIPK:testKeys.ipk fabricID:@(1) nocSigner:testKeys]; - params.vendorID = @(kTestVendorId); +/** + * Given a path relative to the Matter root, create an absolute path to the file. + */ +- (NSString *)absolutePathFor:(NSString *)matterRootRelativePath +{ + // Find the right absolute path to our file. PWD should + // point to our src/darwin/Framework. + NSString * pwd = [[NSProcessInfo processInfo] environment][@"PWD"]; + NSMutableArray * pathComponents = [[NSMutableArray alloc] init]; + [pathComponents addObject:[pwd substringToIndex:(pwd.length - @"src/darwin/Framework".length)]]; + [pathComponents addObjectsFromArray:[matterRootRelativePath pathComponents]]; + return [NSString pathWithComponents:pathComponents]; +} - MTRDeviceController * controller = [factory createControllerOnNewFabric:params error:nil]; - XCTAssertNotNil(controller); +/** + * Create a task given a path relative to the Matter root. + */ +- (NSTask *)createTaskForPath:(NSString *)path +{ + NSTask * task = [[NSTask alloc] init]; + [task setLaunchPath:[self absolutePathFor:path]]; + return task; +} - sController = controller; +/** + * Runs a task to completion and makes sure it succeeds. + */ +- (void)runTask:(NSTask *)task +{ + NSError * launchError; + [task launchAndReturnError:&launchError]; + XCTAssertNil(launchError); - sConnectedDevice1 = [self commissionDeviceWithPayload:kOnboardingPayload1 nodeID:@(kDeviceId1)]; - sConnectedDevice2 = [self commissionDeviceWithPayload:kOnboardingPayload2 nodeID:@(kDeviceId2)]; - sConnectedDevice3 = [self commissionDeviceWithPayload:kOnboardingPayload3 nodeID:@(kDeviceId3)]; + [task waitUntilExit]; + XCTAssertEqual([task terminationStatus], 0); } -+ (void)shutdownStack +/** + * Returns path to the raw image. + */ +- (NSString *)createRawImageWithVersion:(NSNumber *)version { - sNeedsStackShutdown = NO; + NSTask * buildTask = [self createTaskForPath:@"scripts/examples/gn_build_example.sh"]; + NSString * objdir = + [self absolutePathFor:[NSString stringWithFormat:@"out/debug/ota-requestor-app-v%u", version.unsignedIntValue]]; + [buildTask setArguments:@[ + [self absolutePathFor:@"examples/ota-requestor-app/linux"], + objdir, + @"chip_config_network_layer_ble=false", + @"non_spec_compliant_ota_action_delay_floor=0", + [NSString stringWithFormat:@"chip_device_config_device_software_version=%u", version.unsignedIntValue], + [NSString stringWithFormat:@"chip_device_config_device_software_version_string=\"%u.0\"", version.unsignedIntValue], + ]]; - MTRDeviceController * controller = sController; - XCTAssertNotNil(controller); + [self runTask:buildTask]; - [controller shutdown]; - XCTAssertFalse([controller isRunning]); + NSString * sourcePath = [NSString pathWithComponents:@[ objdir, @"chip-ota-requestor-app" ]]; + NSString * destPath = [NSString stringWithFormat:@"/tmp/ota-raw-image-v%u", version.unsignedIntValue]; - [[MTRDeviceControllerFactory sharedInstance] stopControllerFactory]; + // We don't care about error on remove; the file might not be there. But if + // it _is_ there, we have to remove, or the copy will fail. + [[NSFileManager defaultManager] removeItemAtPath:destPath error:nil]; + + NSError * copyError; + BOOL ok = [[NSFileManager defaultManager] copyItemAtPath:sourcePath toPath:destPath error:©Error]; + XCTAssertNil(copyError); + XCTAssertTrue(ok); + + return destPath; } -#if ENABLE_OTA_TESTS +/** + * Returns path to the created image. + */ +- (NSString *)createImageFromRawImage:(NSString *)rawImage withVersion:(NSNumber *)version +{ + NSString * image = [rawImage stringByReplacingOccurrencesOfString:@"raw-image" withString:@"image"]; + + NSTask * task = [self createTaskForPath:@"src/app/ota_image_tool.py"]; + [task setArguments:@[ + @"create", @"-v", @"0xFFF1", @"-p", @"0x8001", @"-vn", version.stringValue, @"-vs", + [NSString stringWithFormat:@"%.1f", version.floatValue], @"-da", @"sha256", rawImage, image + ]]; + + [self runTask:task]; + + return image; +} - (void)test000_SetUp { @@ -665,7 +845,8 @@ - (void)test001_ReceiveQueryImageRequest_RespondUpdateNotAvailable { // Test that if we advertise ourselves as a provider we end up getting a // QueryImage callbacks that we can respond to. - __auto_type * device = sConnectedDevice1; + __auto_type * runner = [[MTROTARequestorAppRunner alloc] initWithPayload:kOnboardingPayload1 testcase:self]; + __auto_type * device = [runner commissionWithNodeID:@(kDeviceId1)]; XCTestExpectation * queryExpectation = [self expectationWithDescription:@"handleQueryImageForNodeID called"]; sOTAProviderDelegate.queryImageHandler = ^(NSNumber * nodeID, MTRDeviceController * controller, @@ -689,7 +870,8 @@ - (void)test002_ReceiveTwoQueryImageRequests_RespondExplicitBusy // Test that if we advertise ourselves as a provider and respond BUSY to // QueryImage callback, then we get a second QueryImage callback later on // that we can then respond to however we wish. - __auto_type * device = sConnectedDevice1; + __auto_type * runner = [[MTROTARequestorAppRunner alloc] initWithPayload:kOnboardingPayload1 testcase:self]; + __auto_type * device = [runner commissionWithNodeID:@(kDeviceId1)]; XCTestExpectation * queryExpectation1 = [self expectationWithDescription:@"handleQueryImageForNodeID called first time"]; XCTestExpectation * queryExpectation2 = [self expectationWithDescription:@"handleQueryImageForNodeID called second time"]; @@ -734,8 +916,11 @@ - (void)test003_ReceiveQueryImageRequestWhileHandlingBDX_RespondImplicitBusy // in the middle of doing BDX with device1, this actually responds with Busy. // 5) Error out of the device1 transfer. // 6) Wait for device2 to query us again. - __auto_type * device1 = sConnectedDevice1; - __auto_type * device2 = sConnectedDevice2; + __auto_type * runner1 = [[MTROTARequestorAppRunner alloc] initWithPayload:kOnboardingPayload1 testcase:self]; + __auto_type * device1 = [runner1 commissionWithNodeID:@(kDeviceId1)]; + + __auto_type * runner2 = [[MTROTARequestorAppRunner alloc] initWithPayload:kOnboardingPayload2 testcase:self]; + __auto_type * device2 = [runner2 commissionWithNodeID:@(kDeviceId2)]; __block XCTestExpectation * announceResponseExpectation2; XCTestExpectation * queryExpectation1 = [self expectationWithDescription:@"handleQueryImageForNodeID called first time"]; @@ -823,7 +1008,8 @@ - (void)test004_DoBDXTransferDenyUpdateRequest // 5) Send the data as the BDX transfer proceeds. // 6) When device invokes ApplyUpdateRequest, respond with Discontinue so // that the update does not actually proceed. - __auto_type * device = sConnectedDevice1; + __auto_type * runner = [[MTROTARequestorAppRunner alloc] initWithPayload:kOnboardingPayload1 testcase:self]; + __auto_type * device = [runner commissionWithNodeID:@(kDeviceId1)]; // First, create an image. Make it at least 4096 bytes long, so we get // multiple BDX blocks going. @@ -840,7 +1026,7 @@ - (void)test004_DoBDXTransferDenyUpdateRequest __auto_type * checker = [[MTROTAProviderTransferChecker alloc] initWithRawImagePath:rawImagePath - otaImageDownloadFilePath:kOtaDownloadedFilePath1 + otaImageDownloadFilePath:runner.downloadFilePath nodeID:@(kDeviceId1) softwareVersion:kUpdatedSoftwareVersion_5 softwareVersionString:kUpdatedSoftwareVersionString_5 @@ -888,17 +1074,17 @@ - (void)test005_DoBDXTransferAllowUpdateRequest // 7) When device invokes ApplyUpdateRequest, respond with Proceed so that the update proceeds // 8) Wait for the app to restart and wait for the NotifyUpdateApplied message to confirm the app has updated to the new version - // This test expects a pre-generated raw image at otaRawImagePath. - NSString * otaRawImagePath = @"/tmp/ota-raw-image-v5"; + NSString * otaRawImagePath = [self createRawImageWithVersion:kUpdatedSoftwareVersion_5]; // Check whether the ota raw image exists at otaRawImagePath XCTAssertTrue([[NSFileManager defaultManager] fileExistsAtPath:otaRawImagePath]); - __auto_type * device = sConnectedDevice1; + __auto_type * runner = [[MTROTARequestorAppRunner alloc] initWithPayload:kOnboardingPayload1 testcase:self]; + __auto_type * device = [runner commissionWithNodeID:@(kDeviceId1)]; __auto_type * checker = [[MTROTAProviderTransferChecker alloc] initWithRawImagePath:otaRawImagePath - otaImageDownloadFilePath:kOtaDownloadedFilePath1 + otaImageDownloadFilePath:runner.downloadFilePath nodeID:@(kDeviceId1) softwareVersion:kUpdatedSoftwareVersion_5 softwareVersionString:kUpdatedSoftwareVersionString_5 @@ -928,10 +1114,6 @@ - (void)test005_DoBDXTransferAllowUpdateRequest - (void)test006_DoBDXTransferWithTwoOTARequesters { - // Note: This test has a dependency on test005_DoBDXTransferAllowUpdateRequest since we update device1 to version - // number 5 in the above test. We reuse device1 for this test and we need to use an OTA image with a higher version number (10) - // for device1 to update itself again. We need to fix this when we want to run tests out of order. - // In this test, we test BDX transfers between one provider and two OTA requestors device1 and device2. // // 1) We announce ourselves to device1 first. @@ -946,9 +1128,8 @@ - (void)test006_DoBDXTransferWithTwoOTARequesters // 10) At this point, we set the apply update handlers for device2. // 11) Device2 applies the update and reboots with its new image. - // This test expects a pre-generated raw image at otaRawImagePath1 for device1 and at otaRawImagePath2 for device2. - NSString * otaRawImagePath1 = @"/tmp/ota-raw-image-v10"; - NSString * otaRawImagePath2 = @"/tmp/ota-raw-image-v5"; + NSString * otaRawImagePath1 = [self createRawImageWithVersion:kUpdatedSoftwareVersion_10]; + NSString * otaRawImagePath2 = [self createRawImageWithVersion:kUpdatedSoftwareVersion_5]; // Check whether the ota raw image exists at otaRawImagePath1 and otaRawImagePath2 XCTAssertTrue([[NSFileManager defaultManager] fileExistsAtPath:otaRawImagePath1]); @@ -985,40 +1166,8 @@ - (void)test006_DoBDXTransferWithTwoOTARequesters __block XCTestExpectation * announceResponseExpectation2; - NSString * imagePath1 = [otaRawImagePath1 stringByReplacingOccurrencesOfString:@"raw-image" withString:@"image"]; - - NSString * imagePath2 = [otaRawImagePath2 stringByReplacingOccurrencesOfString:@"raw-image" withString:@"image"]; - - // Find the right absolute path to our ota_image_tool.py script. PWD should - // point to our src/darwin/Framework, while the script is in - // src/app/ota_image_tool.py. - NSString * pwd = [[NSProcessInfo processInfo] environment][@"PWD"]; - NSString * imageToolPath = [NSString - pathWithComponents:@[ [pwd substringToIndex:(pwd.length - @"darwin/Framework".length)], @"app", @"ota_image_tool.py" ]]; - - NSTask * task1 = [[NSTask alloc] init]; - [task1 setLaunchPath:imageToolPath]; - [task1 setArguments:@[ - @"create", @"-v", @"0xFFF1", @"-p", @"0x8001", @"-vn", [kUpdatedSoftwareVersion_10 stringValue], @"-vs", - kUpdatedSoftwareVersionString_10, @"-da", @"sha256", otaRawImagePath1, imagePath1 - ]]; - NSError * launchError = nil; - [task1 launchAndReturnError:&launchError]; - XCTAssertNil(launchError); - [task1 waitUntilExit]; - XCTAssertEqual([task1 terminationStatus], 0); - - NSTask * task2 = [[NSTask alloc] init]; - [task2 setLaunchPath:imageToolPath]; - [task2 setArguments:@[ - @"create", @"-v", @"0xFFF1", @"-p", @"0x8001", @"-vn", [kUpdatedSoftwareVersion_5 stringValue], @"-vs", - kUpdatedSoftwareVersionString_5, @"-da", @"sha256", otaRawImagePath2, imagePath2 - ]]; - launchError = nil; - [task2 launchAndReturnError:&launchError]; - XCTAssertNil(launchError); - [task2 waitUntilExit]; - XCTAssertEqual([task2 terminationStatus], 0); + NSString * imagePath1 = [self createImageFromRawImage:otaRawImagePath1 withVersion:kUpdatedSoftwareVersion_10]; + NSString * imagePath2 = [self createImageFromRawImage:otaRawImagePath2 withVersion:kUpdatedSoftwareVersion_5]; NSData * updateToken1 = [sOTAProviderDelegate generateUpdateToken]; NSData * updateToken2 = [sOTAProviderDelegate generateUpdateToken]; @@ -1027,8 +1176,12 @@ - (void)test006_DoBDXTransferWithTwoOTARequesters __block uint64_t imageSize; __block uint32_t lastBlockIndex = UINT32_MAX; const uint16_t busyDelay = 30; // 30 second - __auto_type * device1 = sConnectedDevice1; - __auto_type * device2 = sConnectedDevice2; + + __auto_type * runner1 = [[MTROTARequestorAppRunner alloc] initWithPayload:kOnboardingPayload1 testcase:self]; + __auto_type * device1 = [runner1 commissionWithNodeID:@(kDeviceId1)]; + + __auto_type * runner2 = [[MTROTARequestorAppRunner alloc] initWithPayload:kOnboardingPayload2 testcase:self]; + __auto_type * device2 = [runner2 commissionWithNodeID:@(kDeviceId2)]; // This to keep track of whether queryImageHandler for device 2 was called or not. The first time it's called we will // fulfill queryExpectation2 and proceed with BDX for device 1. @@ -1238,7 +1391,7 @@ - (void)test006_DoBDXTransferWithTwoOTARequesters // Device1 is updated to version 10 and device2 to version 5. NSNumber * kSoftwareVersion = (isDeviceID1) ? kUpdatedSoftwareVersion_10 : kUpdatedSoftwareVersion_5; NSString * otaImageFilePath = (isDeviceID1) ? otaRawImagePath1 : otaRawImagePath2; - NSString * otaDownloadedFilePath = (isDeviceID1) ? kOtaDownloadedFilePath1 : kOtaDownloadedFilePath2; + NSString * otaDownloadedFilePath = (isDeviceID1) ? runner1.downloadFilePath : runner2.downloadFilePath; XCTAssertEqual(controller, sController); XCTAssertEqualObjects(params.updateToken, updateToken); @@ -1343,19 +1496,19 @@ - (void)test007_DoBDXTransferIncrementalOtaUpdate // 4) Device3 completes the BDX transfer // 5) Device3 applies the update and reboots with the new image with version number 10 - // This test expects a pre-generated raw image at otaRawImagePath1 and a raw image at otaRawImagePath2 - NSString * otaRawImagePath1 = @"/tmp/ota-raw-image-v5"; - NSString * otaRawImagePath2 = @"/tmp/ota-raw-image-v10"; + NSString * otaRawImagePath1 = [self createRawImageWithVersion:kUpdatedSoftwareVersion_5]; + NSString * otaRawImagePath2 = [self createRawImageWithVersion:kUpdatedSoftwareVersion_10]; // Check whether the ota raw image exists at otaRawImagePath1 and otaRawImagePath2 XCTAssertTrue([[NSFileManager defaultManager] fileExistsAtPath:otaRawImagePath1]); XCTAssertTrue([[NSFileManager defaultManager] fileExistsAtPath:otaRawImagePath2]); - __auto_type * device = sConnectedDevice3; + __auto_type * runner = [[MTROTARequestorAppRunner alloc] initWithPayload:kOnboardingPayload3 testcase:self]; + __auto_type * device = [runner commissionWithNodeID:@(kDeviceId3)]; __auto_type * checker = [[MTROTAProviderTransferChecker alloc] initWithRawImagePath:otaRawImagePath1 - otaImageDownloadFilePath:kOtaDownloadedFilePath3 + otaImageDownloadFilePath:runner.downloadFilePath nodeID:@(kDeviceId3) softwareVersion:kUpdatedSoftwareVersion_5 softwareVersionString:kUpdatedSoftwareVersionString_5 @@ -1386,7 +1539,7 @@ - (void)test007_DoBDXTransferIncrementalOtaUpdate __auto_type * checker1 = [[MTROTAProviderTransferChecker alloc] initWithRawImagePath:otaRawImagePath2 - otaImageDownloadFilePath:kOtaDownloadedFilePath3 + otaImageDownloadFilePath:runner.downloadFilePath nodeID:@(kDeviceId3) softwareVersion:kUpdatedSoftwareVersion_10 softwareVersionString:kUpdatedSoftwareVersionString_10 @@ -1417,18 +1570,9 @@ - (void)test007_DoBDXTransferIncrementalOtaUpdate - (void)test999_TearDown { - __auto_type * device = [MTRBaseDevice deviceWithNodeID:@(kDeviceId1) controller:sController]; - ResetCommissionee(device, dispatch_get_main_queue(), self, kTimeoutInSeconds); - - device = [MTRBaseDevice deviceWithNodeID:@(kDeviceId2) controller:sController]; - ResetCommissionee(device, dispatch_get_main_queue(), self, kTimeoutInSeconds); - - device = [MTRBaseDevice deviceWithNodeID:@(kDeviceId3) controller:sController]; - ResetCommissionee(device, dispatch_get_main_queue(), self, kTimeoutInSeconds); - [[self class] shutdownStack]; } -#endif +#endif // ENABLE_OTA_TESTS @end diff --git a/src/lib/format/protocol_decoder.cpp b/src/lib/format/protocol_decoder.cpp index 5f787a9982b286..0d495791702387 100644 --- a/src/lib/format/protocol_decoder.cpp +++ b/src/lib/format/protocol_decoder.cpp @@ -182,6 +182,8 @@ void PrettyPrintCurrentValue(const TLVReader & reader, chip::StringBuilderBase & out.AddFormat(" | 0x%08" PRIX64, value); } } + + out.AddMarkerIfOverflow(); } } // namespace diff --git a/src/lib/format/tests/TestDecoding.cpp b/src/lib/format/tests/TestDecoding.cpp index 9ad6f97b6849d5..0a848e5de8f835 100644 --- a/src/lib/format/tests/TestDecoding.cpp +++ b/src/lib/format/tests/TestDecoding.cpp @@ -157,13 +157,13 @@ void TestFullDataDecoding(nlTestSuite * inSuite, void * inContext) TestSampleData(inSuite, params, secure_channel_pase_pake1, // clang-format off "pase_pake1\n" - " pA: hex:0422ABC7A84352850456BD4A510905FE6BB782A0863A9382550E1228020801B22EEC4102C60F80082842B9739705FCD37F134651442A41E3723DFFE0278\n" + " pA: hex:0422ABC7A84352850456BD4A510905FE6BB782A0863A9382550E1228020801B22EEC4102C60F80082842B9739705FCD37F134651442A41E3723DFFE0...\n" // clang-format on ); TestSampleData(inSuite, params, secure_channel_pase_pake2, // clang-format off "pase_pake2\n" - " pB: hex:04B6A44A3347C6B77900A3674CA19F40F25F056F8CB344EC1B4FA7888B9E6B570B7010431C5D0BE4021FE74A96C40721765FDA6802BE8DFDF5624332275\n" + " pB: hex:04B6A44A3347C6B77900A3674CA19F40F25F056F8CB344EC1B4FA7888B9E6B570B7010431C5D0BE4021FE74A96C40721765FDA6802BE8DFDF5624332...\n" " cB: hex:40E7452275E38AEBAF0E0F6FAB33A1B0CB5AEB5E824230DD40D0071DC7E55C87\n" // clang-format on ); diff --git a/src/messaging/ExchangeContext.cpp b/src/messaging/ExchangeContext.cpp index cac98cd95017f0..bb8fe2d993da32 100644 --- a/src/messaging/ExchangeContext.cpp +++ b/src/messaging/ExchangeContext.cpp @@ -156,7 +156,7 @@ CHIP_ERROR ExchangeContext::SendMessage(Protocols::Id protocolId, uint8_t msgTyp bool reliableTransmissionRequested = GetSessionHandle()->RequireMRP() && !sendFlags.Has(SendMessageFlags::kNoAutoRequestAck) && !IsGroupExchangeContext(); - bool startedResponseTimer = false; + bool currentMessageExpectResponse = false; // If a response message is expected... if (sendFlags.Has(SendMessageFlags::kExpectResponse) && !IsGroupExchangeContext()) { @@ -178,7 +178,7 @@ CHIP_ERROR ExchangeContext::SendMessage(Protocols::Id protocolId, uint8_t msgTyp SetResponseExpected(false); return err; } - startedResponseTimer = true; + currentMessageExpectResponse = true; } } @@ -222,9 +222,9 @@ CHIP_ERROR ExchangeContext::SendMessage(Protocols::Id protocolId, uint8_t msgTyp #endif if (err != CHIP_NO_ERROR) { - // We should only cancel the response timer if the ExchangeContext fails to send the message that starts the response - // timer. - if (startedResponseTimer) + // We should only cancel the response timer if the ExchangeContext fails to send the message that expects a + // response. + if (currentMessageExpectResponse) { CancelResponseTimer(); SetResponseExpected(false); @@ -243,7 +243,7 @@ CHIP_ERROR ExchangeContext::SendMessage(Protocols::Id protocolId, uint8_t msgTyp #if CONFIG_DEVICE_LAYER && CHIP_CONFIG_ENABLE_ICD_SERVER DeviceLayer::ChipDeviceEvent event; event.Type = DeviceLayer::DeviceEventType::kChipMsgSentEvent; - event.MessageSent.ExpectResponse = IsResponseExpected(); + event.MessageSent.ExpectResponse = currentMessageExpectResponse; CHIP_ERROR status = DeviceLayer::PlatformMgr().PostEvent(&event); if (status != CHIP_NO_ERROR) { diff --git a/src/python_testing/TC_TIMESYNC_2_11.py b/src/python_testing/TC_TIMESYNC_2_11.py index 5d9258044df9d6..3e0a4e070c1ca2 100644 --- a/src/python_testing/TC_TIMESYNC_2_11.py +++ b/src/python_testing/TC_TIMESYNC_2_11.py @@ -108,14 +108,17 @@ async def test_TC_TIMESYNC_2_11(self): self.print_step(8, "TH waits for DSTStatus event until th_utc + 5s") self.wait_for_dst_status(th_utc, 5, True) - self.print_step(9, "TH waits until th_utc + 15s") - time.sleep(get_wait_seconds_from_set_time(th_utc, 15)) + self.print_step(9, "If dst_list_size > 1, TH waits until th_utc + 15s") + if dst_list_size > 1: + time.sleep(get_wait_seconds_from_set_time(th_utc, 15)) - self.print_step(10, "TH reads LocalTime") - await self.read_single_attribute_check_success(cluster=Clusters.TimeSynchronization, attribute=Clusters.TimeSynchronization.Attributes.LocalTime) + self.print_step(10, "If dst_list_size > 1, TH reads LocalTime") + if dst_list_size > 1: + await self.read_single_attribute_check_success(cluster=Clusters.TimeSynchronization, attribute=Clusters.TimeSynchronization.Attributes.LocalTime) - self.print_step(11, "TH waits for DSTStatus event until th_utc + 20s") - self.wait_for_dst_status(th_utc, 20, False) + self.print_step(11, "If dst_list_size > 1, TH waits for DSTStatus event until th_utc + 20s") + if dst_list_size > 1: + self.wait_for_dst_status(th_utc, 20, False) self.print_step(12, "If dst_list_size > 1, TH waits until th_utc + 30s") if dst_list_size > 1: @@ -129,24 +132,12 @@ async def test_TC_TIMESYNC_2_11(self): if dst_list_size > 1: self.wait_for_dst_status(th_utc, 35, True) - self.print_step(15, "If dst_list_size > 1, TH waits until th_utc + 45s") - if dst_list_size > 1: - time.sleep(get_wait_seconds_from_set_time(th_utc, 45)) - - self.print_step(16, "If dst_list_size > 1, TH reads the LocalTime") - if dst_list_size > 1: - await self.read_single_attribute_check_success(cluster=Clusters.TimeSynchronization, attribute=Clusters.TimeSynchronization.Attributes.LocalTime) - - self.print_step(17, "If dst_list_size > 1, TH waits for a DSTStatus event until th_utc + 50s") - if dst_list_size > 1: - self.wait_for_dst_status(th_utc, 50, False) - - self.print_step(18, "Set time zone back to 0") + self.print_step(15, "Set time zone back to 0") tz = [tz_struct(offset=0, validAt=0)] ret = await self.send_set_time_zone_cmd(tz) asserts.assert_true(ret.DSTOffsetRequired, "DSTOffsetRequired not set to true") - self.print_step(19, "Set DST back to 0") + self.print_step(16, "Set DST back to 0") dst = [dst_struct(offset=0, validStarting=0, validUntil=NullValue)] await self.send_set_dst_cmd(dst) diff --git a/src/tracing/json/json_tracing.cpp b/src/tracing/json/json_tracing.cpp index 8dd45887cf9f37..9750378df29ea7 100644 --- a/src/tracing/json/json_tracing.cpp +++ b/src/tracing/json/json_tracing.cpp @@ -19,6 +19,7 @@ #include #include +#include #include #include #include @@ -54,7 +55,7 @@ using chip::StringBuilder; using namespace chip::Decoders; -using PayloadDecoderType = chip::Decoders::PayloadDecoder<64, 256>; +using PayloadDecoderType = chip::Decoders::PayloadDecoder<64, 2048>; /// Figures out a unique name within a json object. /// @@ -226,15 +227,16 @@ void DecodePayloadData(::Json::Value & value, chip::ByteSpan payload, Protocols: #if MATTER_LOG_JSON_DECODE_FULL - PayloadDecoderType decoder(PayloadDecoderInitParams() - .SetProtocolDecodeTree(chip::TLVMeta::protocols_meta) - .SetClusterDecodeTree(chip::TLVMeta::clusters_meta) - .SetProtocol(protocolId) - .SetMessageType(messageType)); + // As PayloadDecoder is quite large (large strings buffers), we place it in heap + auto decoder = chip::Platform::MakeUnique(PayloadDecoderInitParams() + .SetProtocolDecodeTree(chip::TLVMeta::protocols_meta) + .SetClusterDecodeTree(chip::TLVMeta::clusters_meta) + .SetProtocol(protocolId) + .SetMessageType(messageType)); - decoder.StartDecoding(payload); + decoder->StartDecoding(payload); - value["decoded"] = GetPayload(decoder); + value["decoded"] = GetPayload(*decoder); #endif // MATTER_LOG_JSON_DECODE_FULL } diff --git a/third_party/asr/asr582x/asr_sdk b/third_party/asr/asr582x/asr_sdk index 13700ce098dbcd..3134c59ed1d7cd 160000 --- a/third_party/asr/asr582x/asr_sdk +++ b/third_party/asr/asr582x/asr_sdk @@ -1 +1 @@ -Subproject commit 13700ce098dbcdf5a71791ded1d85cd30901569b +Subproject commit 3134c59ed1d7cd7221d730300fd9dee39c820a35 diff --git a/third_party/asr/asr595x/asr_sdk b/third_party/asr/asr595x/asr_sdk index b8b19e39d218b1..e1a75ae0769681 160000 --- a/third_party/asr/asr595x/asr_sdk +++ b/third_party/asr/asr595x/asr_sdk @@ -1 +1 @@ -Subproject commit b8b19e39d218b13f1656d262e9b5cd94b0991410 +Subproject commit e1a75ae076968166684f68de9b38d3a1fd3122b9 diff --git a/third_party/silabs/SiWx917_sdk.gni b/third_party/silabs/SiWx917_sdk.gni index b138ef10c57537..d2e8fd731dbe65 100644 --- a/third_party/silabs/SiWx917_sdk.gni +++ b/third_party/silabs/SiWx917_sdk.gni @@ -44,6 +44,7 @@ template("siwx917_sdk") { # Treat these includes as system includes, so warnings in them are not fatal. _include_dirs = [ + "${chip_root}", "${chip_root}/examples/platform/silabs/SiWx917/SiWx917", "${sdk_support_root}/matter/si91x/siwx917/BRD4325x/support/hal", "${efr32_sdk_root}/platform/emdrv/nvm3/inc",