diff --git a/.github/.wordlist.txt b/.github/.wordlist.txt index 07f3df6b7a9822..c2820eee66d529 100644 --- a/.github/.wordlist.txt +++ b/.github/.wordlist.txt @@ -17,6 +17,7 @@ ables AccessControl AccessControlEntry accessor +Accessors AccountLogin acdbc ack @@ -31,7 +32,9 @@ AddNOC AddOrUpdateThreadNetwork AddOrUpdateWiFiNetwork addr +AddResponse AddThreadNetwork +AddStatus adk AdministratorCommissioning adoc @@ -92,11 +95,13 @@ ASR AssertionError AST ASYNC +ATLs atomics att attId attr attrib +AttributeAccessInterface attributeValue attrListName attrMask @@ -156,6 +161,7 @@ blockquote bluetoothd bluez BOOL +booleans BooleanState bootable Bootloader @@ -256,6 +262,7 @@ clusterAttrs clusterId clusterList clusterListName +ClusterName ClusterObjectTests ClusterRevision ClusterTestGeneration @@ -276,6 +283,8 @@ codelabs ColorControl Comcast Commandline +CommandHandlerInterface +CommandName Commissionable CommissionableDataProvider commissionables @@ -289,6 +298,7 @@ configs configTOTAL ConfigurationManager ConfigurationManagerImpl +conformant connectedhomeip ConnectionData ConnectIP @@ -372,6 +382,7 @@ DefaultOTARequestor DefaultOTARequestorDriver DefaultOTARequestorStorage DefaultSuccess +defaultValue definedValue DehumidificationControl DelayedActionTime @@ -490,8 +501,12 @@ eg EjQ elftools elock +emberAf emberAfExternalAttributeReadCallback emberAfExternalAttributeWriteCallback +EmberAfInitializeAttributes +emberAfSetDynamicEndpoint +emsp EnableNetwork EnableWiFiNetwork endian @@ -521,6 +536,7 @@ EvalCodeWithName EvalFrameDefault EV EVB +EventLogging evk EVSE exceptfds @@ -592,8 +608,10 @@ GenericWiFiConfigurationManagerImpl GetDeviceId GetDeviceInfo GetDns +GetInDevelopmentTests GetIP getManualTests +GetSafeAttributePersistenceProvider getstarted getTests GH @@ -629,6 +647,7 @@ Gv gz gzbf HaloaceticAcidsConcentrationMeasurement +HandleCommand hardcoded hardknott hardwarever @@ -659,6 +678,7 @@ IasWd iaszone ibb ICA +ICAC ICD ICDs iCloud @@ -700,6 +720,7 @@ installDebug instantiation integrations IntelliSense +InteractionModelEngine InteractionModelVersion Interoperable introvideos @@ -709,6 +730,7 @@ IoT ipaddr iPadOS ipadr +IPK ipp iptables iputils @@ -804,6 +826,7 @@ localhost LocalizationConfiguration localstatedir LockingState +LogEvent loopback LowPower LPC @@ -832,6 +855,7 @@ matterc MatterCustomTrace matterd MatterLock +MatterReportingAttributeChangeCallback matterSdkSourceBuild matterSourceBuildAbiFilters matterUTestLib @@ -918,6 +942,7 @@ namespacing nano natively navpad +nbsp NCP ncs nding @@ -1059,12 +1084,14 @@ Pigweed PinCode pinrequest PIXIT +PIXITs pkgconfig PKI plaintext PlatformManager PlatformManagerImpl plt +PluginServerCallback png Podman PollControl @@ -1137,6 +1164,7 @@ RADVD raspberryPi RasPi rAv +RCAC RCP ReadAttribute ReadConfigValue @@ -1152,6 +1180,8 @@ recommand recommanded recurse regen +registerAttributeAccessOverride +RegisterCommandHandler RelativeHumidityMeasurement RemainAfterExit remoteDeviceId @@ -1161,6 +1191,7 @@ RendezvousParameters RendezVousTest REPL repo +repos req Requestor Requestor's @@ -1198,6 +1229,7 @@ RTOS RTT RTX runArgs +runIf RUNAS RunMain runtime @@ -1206,6 +1238,7 @@ rw RXD sandboxed saveAs +saveDataVersschemaionAs sbin scalability scalable @@ -1356,6 +1389,7 @@ TestArray TestCluster TestConstraints TestEmptyString +TestEqualities TestGenExample TestGroupDemoConfig TestMultiRead diff --git a/.github/workflows/examples-esp32.yaml b/.github/workflows/examples-esp32.yaml index 47908d654006e9..2e5432dd4ec03f 100644 --- a/.github/workflows/examples-esp32.yaml +++ b/.github/workflows/examples-esp32.yaml @@ -165,3 +165,6 @@ jobs: - name: Build example Lighting App (external platform) run: scripts/examples/esp_example.sh lighting-app sdkconfig.ext_plat.defaults + + - name: Build example Energy Management App + run: scripts/examples/esp_example.sh energy-management-app sdkconfig.defaults diff --git a/.github/workflows/examples-stm32.yaml b/.github/workflows/examples-stm32.yaml index 5541e0e64927ab..2e261c6f1c9735 100644 --- a/.github/workflows/examples-stm32.yaml +++ b/.github/workflows/examples-stm32.yaml @@ -62,7 +62,14 @@ jobs: "./scripts/build/build_examples.py \ --target stm32-STM32WB5MM-DK-light build \ " - + + - name: Gather size reports + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + stm32 STM32WB5MM-DK light \ + out/stm32-stm32wb5mm-dk-light/chip-stm32-lighting-example.elf \ + /tmp/bloat_reports/ + - name: Uploading Size Reports uses: ./.github/actions/upload-size-reports if: ${{ !env.ACT }} diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 48e0af5ffa754d..4781ff8280d868 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -114,6 +114,7 @@ jobs: src/app/zap-templates/zcl/data-model/chip/content-control-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/descriptor-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/device-energy-management-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/device-energy-management-mode-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/diagnostic-logs-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/dishwasher-alarm-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/dishwasher-mode-cluster.xml \ @@ -121,6 +122,7 @@ jobs: src/app/zap-templates/zcl/data-model/chip/microwave-oven-control-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/door-lock-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/energy-evse-mode-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/ethernet-network-diagnostics-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/fan-control-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/fault-injection-cluster.xml \ @@ -461,9 +463,11 @@ 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_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_ACE_1_4.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --int-arg PIXIT.ACE.APPENDPOINT:1 PIXIT.ACE.APPDEVTYPEID:0x0100 --string-arg PIXIT.ACE.APPCLUSTER:OnOff PIXIT.ACE.APPATTRIBUTE:OnOff --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_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_ACE_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_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 --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/TestGroupTableReports.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/TestBatchInvoke.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 --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"' @@ -481,6 +485,10 @@ jobs: scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-lit-icd-ipv6only-no-ble-no-wifi-tsan-clang-test/lit-icd-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_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_IDM_1_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_IDM_4_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_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_FAN_3_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"' 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_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_FAN_3_5.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/.restyled.yaml b/.restyled.yaml index ddea89227f3727..56ed3061e6e1fa 100644 --- a/.restyled.yaml +++ b/.restyled.yaml @@ -86,6 +86,8 @@ exclude: - "scripts/setup/pigweed.json" # TODO(#29547). This file is temporary copy from pigweed repo that has minor edits. No restyle help in diff. - "docs/ERROR_CODES.md" # generated by scripts, not easy to align tables - "docs/clusters.md" # generated by scripts, not easy to align tables + - "docs/testing/yaml_pseudocluster.md" # generated by scripts, restyler makes the tables render improperly + - "docs/testing/yaml_schema.md" # generated by scripts, restyler makes the tables render improperly changed_paths: maximum: 100000 diff --git a/.spellcheck.yml b/.spellcheck.yml index e3e470a696bbeb..c04880827addba 100644 --- a/.spellcheck.yml +++ b/.spellcheck.yml @@ -20,7 +20,7 @@ # # Actual run: # -# pyspelling pyspelling --config .spellcheck.yml +# pyspelling --config .spellcheck.yml matrix: - name: markdown @@ -65,6 +65,6 @@ matrix: # converts markdown to HTML - pyspelling.filters.markdown: sources: - - '**/*.md|!third_party/**|!examples/common/**/repo/**|!docs/ERROR_CODES.md|!docs/clusters.md' + - '**/*.md|!third_party/**|!examples/common/**/repo/**|!docs/ERROR_CODES.md|!docs/clusters.md|!docs/testing/yaml_schema.md|!docs/testing/yaml_pseudocluster.md' aspell: ignore-case: true diff --git a/build/chip/chip_test_group.gni b/build/chip/chip_test_group.gni index bc092c46ab6bcd..9e26b19235e29c 100644 --- a/build/chip/chip_test_group.gni +++ b/build/chip/chip_test_group.gni @@ -39,10 +39,14 @@ template("chip_test_group") { [ "build_monolithic_library", "deps", + "tests", ]) deps = [] - foreach(_test, invoker.deps) { + if (defined(invoker.deps)) { + deps = invoker.deps + } + foreach(_test, invoker.tests) { deps += [ get_label_info(_test, "label_no_toolchain") + ".lib" ] } @@ -53,7 +57,7 @@ template("chip_test_group") { group("${_test_group_name}") { deps = [] - data_deps = invoker.deps + data_deps = invoker.tests if (_build_monolithic_library) { deps += [ ":${_lib_target_name}" ] @@ -64,7 +68,10 @@ template("chip_test_group") { group("${_test_group_name}_run") { if (chip_link_tests) { deps = [] - foreach(_test, invoker.deps) { + if (defined(invoker.deps)) { + deps = invoker.deps + } + foreach(_test, invoker.tests) { deps += [ get_label_info(_test, "label_no_toolchain") + "_run" ] } } diff --git a/build/chip/esp32/esp32_codegen.cmake b/build/chip/esp32/esp32_codegen.cmake index 75cd1f42587469..af943e39fbff30 100644 --- a/build/chip/esp32/esp32_codegen.cmake +++ b/build/chip/esp32/esp32_codegen.cmake @@ -33,6 +33,7 @@ macro(chip_app_component_codegen IDL_NAME) OUTPUTS "app/PluginApplicationCallbacks.h" "app/callback-stub.cpp" + "app/cluster-init-callback.cpp" OUTPUT_PATH APP_GEN_DIR OUTPUT_FILES APP_GEN_FILES ) diff --git a/config/ameba/lib/pw_rpc/BUILD.gn b/config/ameba/lib/pw_rpc/BUILD.gn index 4b47ab1d61a16a..0b125c8a98aada 100644 --- a/config/ameba/lib/pw_rpc/BUILD.gn +++ b/config/ameba/lib/pw_rpc/BUILD.gn @@ -24,7 +24,6 @@ static_library("pw_rpc") { "$dir_pw_rpc:server", "$dir_pw_rpc/nanopb:echo_service", "${chip_root}/examples/platform/ameba/pw_sys_io:pw_sys_io_ameba", - "${dir_pigweed}/pw_hdlc:pw_rpc", dir_pw_assert, dir_pw_hdlc, dir_pw_log, diff --git a/config/bouffalolab/common/lib/pw_rpc/BUILD.gn b/config/bouffalolab/common/lib/pw_rpc/BUILD.gn index b1c9e1a596209e..999ffe37618ec7 100644 --- a/config/bouffalolab/common/lib/pw_rpc/BUILD.gn +++ b/config/bouffalolab/common/lib/pw_rpc/BUILD.gn @@ -36,7 +36,6 @@ static_library("pw_rpc") { "$dir_pw_rpc:server", "$dir_pw_rpc/nanopb:echo_service", "${chip_root}/examples/platform/bouffalolab/common/rpc/pw_sys_io:pw_sys_io", - "${dir_pigweed}/pw_hdlc:pw_rpc", dir_pw_assert, dir_pw_checksum, dir_pw_hdlc, diff --git a/config/efr32/lib/pw_rpc/BUILD.gn b/config/efr32/lib/pw_rpc/BUILD.gn index ed2e3a47bc1305..f858f6c1321999 100644 --- a/config/efr32/lib/pw_rpc/BUILD.gn +++ b/config/efr32/lib/pw_rpc/BUILD.gn @@ -25,7 +25,6 @@ static_library("pw_rpc") { "$dir_pw_rpc:server", "$dir_pw_rpc/nanopb:echo_service", "${chip_root}/examples/platform/silabs/pw_sys_io:pw_sys_io_silabs", - "${dir_pigweed}/pw_hdlc:pw_rpc", dir_pw_assert, dir_pw_checksum, dir_pw_hdlc, diff --git a/config/esp32/lib/pw_rpc/BUILD.gn b/config/esp32/lib/pw_rpc/BUILD.gn index 383e4b25f21d56..2ced13e5c5574d 100644 --- a/config/esp32/lib/pw_rpc/BUILD.gn +++ b/config/esp32/lib/pw_rpc/BUILD.gn @@ -24,7 +24,6 @@ static_library("pw_rpc") { "$dir_pw_rpc:server", "$dir_pw_rpc/nanopb:echo_service", "${chip_root}/examples/platform/esp32/pw_sys_io:pw_sys_io_esp32", - "${dir_pigweed}/pw_hdlc:pw_rpc", dir_pw_assert, dir_pw_hdlc, dir_pw_log, diff --git a/config/linux/lib/pw_rpc/BUILD.gn b/config/linux/lib/pw_rpc/BUILD.gn index e79af448d13e57..a01627c32541d1 100644 --- a/config/linux/lib/pw_rpc/BUILD.gn +++ b/config/linux/lib/pw_rpc/BUILD.gn @@ -22,7 +22,6 @@ static_library("pw_rpc") { public_configs = [ "${dir_pigweed}/pw_hdlc:default_config" ] deps = [ "$dir_pw_hdlc:encoder", - "$dir_pw_hdlc:pw_rpc", "$dir_pw_hdlc:rpc_channel_output", "$dir_pw_rpc/system_server:facade", "$dir_pw_stream:socket_stream", diff --git a/config/mbed/chip-gn/lib/pw_rpc/BUILD.gn b/config/mbed/chip-gn/lib/pw_rpc/BUILD.gn index f1a5e071e9c619..c84adde4fb1e46 100644 --- a/config/mbed/chip-gn/lib/pw_rpc/BUILD.gn +++ b/config/mbed/chip-gn/lib/pw_rpc/BUILD.gn @@ -30,7 +30,6 @@ static_library("pw_rpc") { deps = [ "$dir_pw_rpc:server", "${chip_root}/examples/platform/mbed/pw_sys_io:pw_sys_io_mbed", - "${dir_pigweed}/pw_hdlc:pw_rpc", dir_pw_assert, dir_pw_hdlc, dir_pw_log, diff --git a/config/nxp/README.md b/config/nxp/README.md new file mode 100644 index 00000000000000..e15ad309dc9d1a --- /dev/null +++ b/config/nxp/README.md @@ -0,0 +1,10 @@ +# NXP Zephyr build and configuration files + +This directory contains build scripts and common configuration files used by +CHIP NXP Zephyr applications. It is structured as follows: + +| File/Folder | Contents | +| ----------- | ----------------------------------------------------------------------------------------------------------------------------------- | +| chip-gn | GN project used to build selected CHIP libraries with the _nxp_zephyr_ platform integration layer | +| chip-module | CMake wrapper for the GN project defined in `chip-gn` directory, and other components that allow one to use CHIP as a Zephyr module | +| app | Common and optional Kconfig configuration files that can be used in NXP Zephyr applications | diff --git a/config/nxp/app/bootloader.conf b/config/nxp/app/bootloader.conf new file mode 100644 index 00000000000000..281e1145a89aa0 --- /dev/null +++ b/config/nxp/app/bootloader.conf @@ -0,0 +1,25 @@ +# +# Copyright (c) 2024 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. +# + +# Options to be used for MCUBOOT build are located on this file. + +# The default signature key used by MCUBOOT is located on their repository, +# change this to the appropriate one. +# NOTE: This option needs to contain a path to the same file used by +# MCUBOOT_SIGNATURE_KEY_FILE. +#CONFIG_BOOT_SIGNATURE_KEY_FILE="root-rsa-2048.pem" + +CONFIG_BOOT_MAX_IMG_SECTORS=2048 diff --git a/config/nxp/app/enable-gnu-std.cmake b/config/nxp/app/enable-gnu-std.cmake new file mode 100644 index 00000000000000..a5a5c6c6aca10f --- /dev/null +++ b/config/nxp/app/enable-gnu-std.cmake @@ -0,0 +1,22 @@ +# +# Copyright (c) 2024 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. +# + +add_library(gnu17 INTERFACE) +target_compile_options(gnu17 + INTERFACE + $<$:-std=gnu++17> + -D_SYS__PTHREADTYPES_H_) +target_link_libraries(app PRIVATE gnu17) diff --git a/config/nxp/app/pre-zephyr.cmake b/config/nxp/app/pre-zephyr.cmake new file mode 100644 index 00000000000000..9dd1b2ae32c5bf --- /dev/null +++ b/config/nxp/app/pre-zephyr.cmake @@ -0,0 +1,21 @@ +# +# Copyright (c) 2024 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. +# + +# Automatically find overlays defined at platform level +# Those are usually used to change FLASH and RAM layouts +if (EXISTS ${CHIP_ROOT}/src/platform/nxp/zephyr/boards/${BOARD}/${BOARD}.overlay) + list(APPEND EXTRA_DTC_OVERLAY_FILE ${CHIP_ROOT}/src/platform/nxp/zephyr/boards/${BOARD}/${BOARD}.overlay) +endif() diff --git a/config/nxp/chip-gn/.gn b/config/nxp/chip-gn/.gn new file mode 100644 index 00000000000000..0cc783dee91703 --- /dev/null +++ b/config/nxp/chip-gn/.gn @@ -0,0 +1,29 @@ +# Copyright (c) 2024 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. + +import("//build_overrides/build.gni") +import("//build_overrides/chip.gni") + +# The location of the build configuration file. +buildconfig = "${build_root}/config/BUILDCONFIG.gn" + +# CHIP uses angle bracket includes. +check_system_includes = true + +default_args = { + target_cpu = "arm" + target_os = "zephyr" + + import("${chip_root}/config/nxp/chip-gn/args.gni") +} diff --git a/config/nxp/chip-gn/BUILD.gn b/config/nxp/chip-gn/BUILD.gn new file mode 100644 index 00000000000000..1fc09ec27d611a --- /dev/null +++ b/config/nxp/chip-gn/BUILD.gn @@ -0,0 +1,40 @@ +# Copyright (c) 2024 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. + +import("//build_overrides/build.gni") +import("//build_overrides/chip.gni") + +import("${chip_root}/build/chip/tests.gni") + +assert(current_os == "zephyr") + +declare_args() { + chip_build_example_providers = false +} + +group("nxp_zephyr") { + deps = [ "${chip_root}/src/lib" ] + + if (chip_build_tests) { + deps += [ "${chip_root}/src:tests" ] + } + + if (chip_build_example_providers) { + deps += [ "${chip_root}/examples/providers:device_info_provider" ] + } +} + +group("default") { + deps = [ ":nxp_zephyr" ] +} diff --git a/config/nxp/chip-gn/args.gni b/config/nxp/chip-gn/args.gni new file mode 100644 index 00000000000000..702e9537b4b74d --- /dev/null +++ b/config/nxp/chip-gn/args.gni @@ -0,0 +1,32 @@ +# Copyright (c) 2024 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. + +import("//build_overrides/chip.gni") + +import("${chip_root}/src/crypto/crypto.gni") + +chip_device_platform = "nxp_zephyr" + +chip_build_tests = false + +chip_project_config_include = "" +chip_system_project_config_include = "" +chip_ble_project_config_include = "" + +chip_crypto = "mbedtls" +chip_external_mbedtls = true + +custom_toolchain = "${chip_root}/config/nxp/chip-gn/toolchain:zephyr" + +pw_build_PIP_CONSTRAINTS = [ "${chip_root}/scripts/setup/constraints.txt" ] diff --git a/config/nxp/chip-gn/toolchain/BUILD.gn b/config/nxp/chip-gn/toolchain/BUILD.gn new file mode 100644 index 00000000000000..0bee7f170cbd89 --- /dev/null +++ b/config/nxp/chip-gn/toolchain/BUILD.gn @@ -0,0 +1,34 @@ +# Copyright (c) 2024 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. + +import("//build_overrides/build.gni") + +import("${build_root}/toolchain/arm_gcc/arm_toolchain.gni") + +declare_args() { + zephyr_ar = "" + zephyr_cc = "" + zephyr_cxx = "" +} + +gcc_toolchain("zephyr") { + ar = zephyr_ar + cc = zephyr_cc + cxx = zephyr_cxx + + toolchain_args = { + current_os = "zephyr" + is_clang = false + } +} diff --git a/config/nxp/chip-module/CMakeLists.txt b/config/nxp/chip-module/CMakeLists.txt new file mode 100644 index 00000000000000..0e35f27a44d153 --- /dev/null +++ b/config/nxp/chip-module/CMakeLists.txt @@ -0,0 +1,270 @@ +# +# Copyright (c) 2024 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. +# + +# +# @file +# CMake sub-project defining 'chip' target which represents CHIP library +# and other optional libraries like unit tests, built with 'nxp_zephyr' +# platform. +# Since CHIP doesn't provide native CMake support, ExternalProject +# module is used to build the required artifacts with GN meta-build +# system. It is assumed that find_package(Zephyr) has been called before +# including this file. +# + +if (CONFIG_CHIP) + +include(ExternalProject) +include(../../zephyr/ota-image.cmake) +include(../../zephyr/zephyr-util.cmake) +include(generate_factory_data.cmake) + +# ============================================================================== +# Prepare CHIP configuration based on the project Kconfig configuration +# ============================================================================== + +# Set paths + +if (NOT CHIP_ROOT) + get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../.. REALPATH) +endif() +get_filename_component(GN_ROOT_TARGET ${CHIP_ROOT}/config/nxp/chip-gn REALPATH) +get_filename_component(COMMON_CMAKE_SOURCE_DIR ${CHIP_ROOT}/config/common/cmake REALPATH) + +# Get common Cmake sources + +include(${COMMON_CMAKE_SOURCE_DIR}/chip_gn_args.cmake) +include(${COMMON_CMAKE_SOURCE_DIR}/chip_gn.cmake) + +# Prepare compiler flags +if (CHIP_CFLAGS) + matter_add_flags("${CHIP_CFLAGS}") +endif() + +matter_add_cxxflags(-D_POSIX_C_SOURCE=200809) + +if (CONFIG_ARM) + matter_add_cflags(--specs=nosys.specs) +endif() + +if(CONFIG_MBEDTLS) + zephyr_include_directories($) + zephyr_compile_definitions($) +endif() + +zephyr_include_directories(${CHIP_ROOT}/src/platform/nxp/zephyr) + +zephyr_get_compile_flags(ZEPHYR_CFLAGS_C C) +matter_add_cflags("${ZEPHYR_CFLAGS_C}") +zephyr_get_compile_flags(ZEPHYR_CFLAGS_CC CXX) +matter_add_cxxflags("${ZEPHYR_CFLAGS_CC}") +zephyr_get_gnu_cpp_standard(ZEPHYR_GNU_CPP_STD) +matter_add_cxxflags(${ZEPHYR_GNU_CPP_STD}) + +# Set up custom OpenThread configuration + +if (CONFIG_CHIP_OPENTHREAD_CONFIG) + get_filename_component(CHIP_OPENTHREAD_CONFIG + ${CONFIG_CHIP_OPENTHREAD_CONFIG} + REALPATH + BASE_DIR ${CMAKE_SOURCE_DIR} + ) + zephyr_set_openthread_config(${CHIP_OPENTHREAD_CONFIG}) +endif() + +# Set up Zephyr symbol level + +if (NOT CONFIG_CHIP_DEBUG_SYMBOLS) + set_compiler_property(PROPERTY debug -g0) +endif() + +# Determine if ccache should be used + +get_property(CHIP_COMPILER_LAUNCHER GLOBAL PROPERTY RULE_LAUNCH_COMPILE) + +# ============================================================================== +# Generate configuration for CHIP GN build system +# ============================================================================== + +matter_common_gn_args( + DEBUG CONFIG_DEBUG + LIB_SHELL CONFIG_CHIP_LIB_SHELL + LIB_TESTS CONFIG_CHIP_BUILD_TESTS + PROJECT_CONFIG ${CONFIG_CHIP_PROJECT_CONFIG} + DEVICE_INFO_EXAMPLE_PROVIDER CONFIG_CHIP_EXAMPLE_DEVICE_INFO_PROVIDER +) +matter_add_gn_arg_string("zephyr_ar" ${CMAKE_AR}) +matter_add_gn_arg_string("zephyr_cc" ${CMAKE_C_COMPILER}) +matter_add_gn_arg_string("zephyr_cxx" ${CMAKE_CXX_COMPILER}) +matter_add_gn_arg_bool ("chip_logging" CONFIG_LOG) +matter_add_gn_arg_bool ("chip_enable_openthread" CONFIG_NET_L2_OPENTHREAD) +matter_add_gn_arg_bool ("chip_openthread_ftd" CONFIG_OPENTHREAD_FTD) +matter_add_gn_arg_bool ("chip_config_network_layer_ble" CONFIG_BT) +matter_add_gn_arg_bool ("chip_inet_config_enable_ipv4" CONFIG_CHIP_IPV4) +matter_add_gn_arg_bool ("chip_persist_subscriptions" CONFIG_CHIP_PERSISTENT_SUBSCRIPTIONS) +matter_add_gn_arg_bool ("chip_monolithic_tests" CONFIG_CHIP_BUILD_TESTS) +matter_add_gn_arg_bool ("chip_inet_config_enable_tcp_endpoint" CONFIG_CHIP_BUILD_TESTS) +matter_add_gn_arg_bool ("chip_error_logging" CONFIG_MATTER_LOG_LEVEL GREATER_EQUAL 1) +matter_add_gn_arg_bool ("chip_progress_logging" CONFIG_MATTER_LOG_LEVEL GREATER_EQUAL 3) +matter_add_gn_arg_bool ("chip_detail_logging" CONFIG_MATTER_LOG_LEVEL GREATER_EQUAL 4) +matter_add_gn_arg_bool ("chip_automation_logging" FALSE) +matter_add_gn_arg_bool ("chip_malloc_sys_heap" CONFIG_CHIP_MALLOC_SYS_HEAP) +matter_add_gn_arg_bool ("chip_enable_wifi" CONFIG_CHIP_WIFI) +matter_add_gn_arg_bool ("chip_system_config_provide_statistics" CONFIG_CHIP_STATISTICS) +matter_add_gn_arg_bool ("chip_enable_icd_server" CONFIG_CHIP_ENABLE_ICD_SUPPORT) +matter_add_gn_arg_bool ("enable_eventlist_attribute" TRUE) +matter_add_gn_arg_bool ("chip_enable_ota_requestor" CONFIG_CHIP_OTA_REQUESTOR) + +if(CONFIG_DEBUG) + matter_add_gn_arg_bool("optimize_debug" true) + matter_add_gn_arg_string("optimize_debug_level" "0") + matter_add_gn_arg_string("symbol_level" "2") +endif() + +if (CONFIG_CHIP_FACTORY_DATA) + matter_add_gn_arg_bool("chip_use_transitional_commissionable_data_provider" FALSE) + matter_add_gn_arg_bool("chip_enable_factory_data" TRUE) +elseif (CONFIG_CHIP_FACTORY_DATA_CUSTOM_BACKEND) + matter_add_gn_arg_bool("chip_use_transitional_commissionable_data_provider" FALSE) +endif() + +if (CONFIG_CHIP_ROTATING_DEVICE_ID) + matter_add_gn_arg_bool("chip_enable_rotating_device_id" TRUE) + matter_add_gn_arg_bool("chip_enable_additional_data_advertising" TRUE) +endif() + +if (CONFIG_NET_L2_OPENTHREAD) + matter_add_gn_arg_string("chip_mdns" "platform") +elseif(CONFIG_WIFI_NXP) + matter_add_gn_arg_string("chip_mdns" "minimal") +else() + matter_add_gn_arg_string("chip_mdns" "none") +endif() + +if (CONFIG_CHIP_CRYPTO_PSA) + matter_add_gn_arg_string("chip_crypto" "psa") +endif() + +# if (BOARD STREQUAL "native_posix") +# matter_add_gn_arg_string("target_cpu" "x86") +# elseif (BOARD STREQUAL "native_posix_64") +# matter_add_gn_arg_string("target_cpu" "x64") +# endif() + +if (NOT CONFIG_CHIP_DEBUG_SYMBOLS) + matter_add_gn_arg_string("symbol_level" "0") +endif() + +# if (CHIP_COMPILER_LAUNCHER) +# matter_add_gn_arg_string("pw_command_launcher" ${CHIP_COMPILER_LAUNCHER}) +# endif() + +# if (CONFIG_CHIP_PW_RPC) +# set(PIGWEED_DIR "//third_party/pigweed/repo") +# matter_add_gn_arg_string("pw_assert_BACKEND" ${PIGWEED_DIR}/pw_assert_log:check_backend) +# matter_add_gn_arg_string("pw_log_BACKEND" ${PIGWEED_DIR}/pw_log_basic) +# matter_add_gn_arg("pw_build_LINK_DEPS" [\"${PIGWEED_DIR}/pw_assert:impl\",\ \"${PIGWEED_DIR}/pw_log:impl\"]) +# endif() + +matter_generate_args_tmp_file() + +# ============================================================================== +# Build chip library +# ============================================================================== + +matter_build(chip + LIB_SHELL ${CONFIG_CHIP_LIB_SHELL} + LIB_TESTS ${CONFIG_CHIP_BUILD_TESTS} + DEVICE_INFO_EXAMPLE_PROVIDER ${CONFIG_CHIP_EXAMPLE_DEVICE_INFO_PROVIDER} + GN_DEPENDENCIES kernel +) + +set_property(GLOBAL APPEND PROPERTY ZEPHYR_INTERFACE_LIBS chip) +# Enable visibility of POSIX.1-2008 functions, such as strnlen +target_compile_definitions(chip INTERFACE _POSIX_C_SOURCE=200809) +# Make sure that kernel symbols that are only referenced by the Matter libraries are resolved. +target_link_libraries(chip INTERFACE $) + +if (CONFIG_CHIP_MALLOC_SYS_HEAP_OVERRIDE) + target_link_options(chip INTERFACE + -Wl,--wrap=malloc + -Wl,--wrap=calloc + -Wl,--wrap=realloc + -Wl,--wrap=free + -Wl,--wrap=_malloc_r + -Wl,--wrap=_calloc_r + -Wl,--wrap=_realloc_r + -Wl,--wrap=_free_r + ) +endif() + +# ============================================================================== +# Define 'chip-ota-image' target for building CHIP OTA image +# ============================================================================== +if(EXISTS "${CHIP_ROOT}/src/platform/nxp/zephyr/boards/${BOARD}/${BOARD}.overlay") + set(DTC_BOARD_OVERLAY "${CHIP_ROOT}/src/platform/nxp/zephyr/boards/${BOARD}/${BOARD}.overlay") +else() + set(DTC_BOARD_OVERLAY "") + message(STATUS "No board overlay found") +endif() + +if (CONFIG_CHIP_OTA_REQUESTOR) + if(CONFIG_MCUBOOT_SIGNATURE_KEY_FILE STREQUAL "") + set(ZEPHYR_OUTPUT_NAME "zephyr") + else() + set(ZEPHYR_OUTPUT_NAME "zephyr.signed") + endif() + + set(GLOBAL_BOOTLOADER_CONF_OVERLAY_FILE "${CHIP_ROOT}/config/nxp/app/bootloader.conf") + + add_custom_target(build_mcuboot ALL + COMMAND + west build -b ${BOARD} -d build_mcuboot ${ZEPHYR_BASE}/../bootloader/mcuboot/boot/zephyr + -- -DOVERLAY_CONFIG=${GLOBAL_BOOTLOADER_CONF_OVERLAY_FILE} -DEXTRA_DTC_OVERLAY_FILE=${DTC_BOARD_OVERLAY} + COMMAND + cp ${PROJECT_BINARY_DIR}/../modules/connectedhomeip/build_mcuboot/zephyr/zephyr.bin ${PROJECT_BINARY_DIR}/zephyr.mcuboot.bin + ) + + set(BLOCK_SIZE "1024") + dt_nodelabel(dts_partition_path NODELABEL "boot_partition") + dt_reg_size(mcuboot_size PATH ${dts_partition_path}) + math(EXPR boot_blocks "${mcuboot_size} / ${BLOCK_SIZE}" OUTPUT_FORMAT DECIMAL) + + add_custom_target(merge_mcuboot ALL + COMMAND + dd if=${PROJECT_BINARY_DIR}/zephyr.mcuboot.bin of=${PROJECT_BINARY_DIR}/zephyr_full.bin + COMMAND + dd if=${PROJECT_BINARY_DIR}/${ZEPHYR_OUTPUT_NAME}.bin of=${PROJECT_BINARY_DIR}/zephyr_full.bin bs=${BLOCK_SIZE} seek=${boot_blocks} + ) + add_dependencies(merge_mcuboot ${ZEPHYR_FINAL_EXECUTABLE}) + + if (CONFIG_CHIP_OTA_IMAGE_BUILD) + chip_ota_image(chip-ota-image + INPUT_FILES ${PROJECT_BINARY_DIR}/${ZEPHYR_OUTPUT_NAME}.bin + OUTPUT_FILE ${PROJECT_BINARY_DIR}/${CONFIG_CHIP_OTA_IMAGE_FILE_NAME} + ) + endif() +endif() + +# ============================================================================== +# Define 'factory_data' target for generating a factory data partition +# ============================================================================== + +if (CONFIG_CHIP_FACTORY_DATA_BUILD) + nxp_generate_factory_data() +endif() + +endif() # CONFIG_CHIP diff --git a/config/nxp/chip-module/Kconfig b/config/nxp/chip-module/Kconfig new file mode 100644 index 00000000000000..88918a67450ad3 --- /dev/null +++ b/config/nxp/chip-module/Kconfig @@ -0,0 +1,258 @@ +# +# Copyright (c) 2024 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. +# + +rsource "../../zephyr/Kconfig" + +if CHIP + +config CHIP_NXP_PLATFORM + bool + default y + help + States that the configuration uses Matter NXP platform, + what can be used to conditionally deviate from Zephyr generic configuration + for NXP platform related purposes. + +# See config/zephyr/Kconfig for full definition +config CHIP_DEVICE_VENDOR_NAME + default "NXP Semiconductors" + +config CHIP_APP_LOG_LEVEL + int "Logging level in application" + default LOG_DEFAULT_LEVEL + depends on LOG + help + Sets the logging level in the Matter application. Use this configuration + option only within the application. To set the logging level for the + Matter stack, use the MATTER_LOG_LEVEL configuration option. + +config CHIP_EXAMPLE_DEVICE_INFO_PROVIDER + bool "Include default device information provider build" + default y + +config CHIP_DEBUG_SYMBOLS + bool "Generate debug symbols" + default y + help + Enables building the application with debug symbols. + +config CHIP_MALLOC_SYS_HEAP + default y if !ARCH_POSIX + +config CHIP_FACTORY_DATA + bool "Factory data provider" + help + Enables the default NXP factory data provider implementation that + supports reading the factory data encoded in the KLV format from the + flash memory partition. This option requires a fixed partition named + "factory_partition" declared on the device tree. Factory data partition + can be generated during build process, see CHIP_FACTORY_DATA_BUILD Kconfig. + +config CHIP_FACTORY_DATA_CUSTOM_BACKEND + bool "Custom factory data provider" + depends on !CHIP_FACTORY_DATA + help + Enables user's custom factory data provider implementation. This option + cannot be used with the CHIP_FACTORY_DATA, which enables the default NXP + factory data provider implementation. + +config CHIP_FACTORY_DATA_BUILD + bool "Generate factory data contents" + default n + imply CHIP_FACTORY_DATA + help + Enables generation of the factory data contents during the building. This + option requires a fixed partition named "factory_partition" declared on the + device tree. + +config CHIP_FACTORY_DATA_VERSION + int + default 1 + help + Provides the version of the generated factory data parameter set. This is + a hidden configuration option that the user cannot change. You can use + this value in the factory data provider implementation to verify that the + factory data saved in the flash memory has the expected version. + +config CHIP_FACTORY_DATA_ROTATING_DEVICE_UID_MAX_LEN + int "Maximum length of rotating device ID unique ID in bytes" + default 16 + depends on CHIP_FACTORY_DATA + help + Maximum acceptable length of rotating device ID unique ID in bytes. + +if CHIP_FACTORY_DATA + +config CHIP_ENCRYPTED_FACTORY_DATA_AES128_KEY + string "AES128 key used to encrypt factory data." + default "2B7E151628AED2A6ABF7158809CF4F3C" + help + AES128 key used to encrypt factory data. + +config CHIP_ENCRYPTED_FACTORY_DATA + bool "Encrypt factory data with AES128 ECB." + default y + help + If enabled, the factory data partition will be encrypted with AES128 ECB. + +config CHIP_DEVICE_PRODUCT_URL + string "Product URL" + help + Provides the URL to the product page. The URL is exposed as an attribute + of the Basic Information cluster. + +config CHIP_DEVICE_PRODUCT_LABEL + string "Product label" + help + Provides the product label. The label is exposed as an attribute + of the Basic Information cluster. + +config CHIP_DEVICE_PART_NUMBER + string "Part number" + help + Provides the part number. The part number is exposed as an attribute + of the Basic Information cluster. + +endif + +if CHIP_FACTORY_DATA_BUILD + +# Factory data definitions +config CHIP_FACTORY_DATA_GENERATE_ONBOARDING_CODES + bool "Generate onboarding codes during the generation of a factory data set" + help + Enables generation of onboarding codes (manual pairing code and QR code) + during the generation of a factory data set. You can provide the + onboarding codes a Matter controller to commission a device to a Matter + network. + +# Select source of the certificates +choice CHIP_FACTORY_DATA_CERT_SOURCE + prompt "Attestation certificate file source" + default CHIP_FACTORY_DATA_USE_DEFAULT_CERTS + + config CHIP_FACTORY_DATA_USE_DEFAULT_CERTS + bool "Use pre-generated development certificates" + help + Uses pre-generated certificate files from the + credentials/development/attestation/ directory that match the + configured Product ID. This can be used for development purpose. + + config CHIP_FACTORY_DATA_CERT_SOURCE_GENERATED + bool "Auto-generate certificates" + help + Generates new certificates instead of using pre-generated ones. The + certificates are generated on every build. + + config CHIP_FACTORY_DATA_CERT_SOURCE_USER + bool "Use user-provided certificate files" + help + Uses user-provided certificate files. The user needs to specify the + absolute paths to all necessary files. + +endchoice + +if CHIP_FACTORY_DATA_CERT_SOURCE_USER + +config CHIP_FACTORY_DATA_USER_CERTS_CD_CERT + string "Path to the CD certificate (DER format)" + help + Provides the absolute path to the CD certificate file in the DER format. + +config CHIP_FACTORY_DATA_USER_CERTS_DAC_CERT + string "Path to the DAC certificate (DER format)" + help + Provides the absolute path to the DAC certificate file in the DER format. + +config CHIP_FACTORY_DATA_USER_CERTS_DAC_KEY + string "Path to the DAC private key (DER format)" + help + Provides the absolute path to the DAC keypair file in the DER format. Both + public and private keys must be present (the private key will be extracted + automatically). + +config CHIP_FACTORY_DATA_USER_CERTS_PAI_CERT + string "Path to the PAI certificate (DER format)" + help + Provides the absolute path to the PAI certificate in the DER format. +endif + +# Configs for SPAKE2+ generation +config CHIP_FACTORY_DATA_GENERATE_SPAKE2_VERIFIER + bool "Generate SPAKE2+ verifier" + help + Enables the generation of the SPAKE2+ verifier for the configured SPAKE2+ + passcode, iteration count and salt. + +config CHIP_DEVICE_GENERATE_ROTATING_DEVICE_UID + bool "Generate Rotating device ID unique ID" + default y + help + Enables the generation of a random Rotating device ID unique ID. + +endif #CHIP_FACTORY_DATA_BUILD + +# See config/zephyr/Kconfig for full definition +config CHIP_FACTORY_RESET_ERASE_NVS + bool + default y if CHIP_FACTORY_DATA || CHIP_FACTORY_DATA_CUSTOM_BACKEND + +endif + +config CHIP_LOG_SIZE_OPTIMIZATION + bool "Disable some detailed logs to decrease flash usage" + help + Disables some log levels for specific Matter log modules that provide + information that is too detailed to be used in most cases. You can find + full configuration enabled by this option in the + platform/nxp/CHIPPlatformConfig.h file. + +config CHIP_IPV4 + bool "IPv4 support for Matter" + default n + depends on NET_IPV4 + help + If disabled, it allows to build NXP SDK application + with IPv4 support independently of the Matter stack still + running over IPv6. + +config CHIP_OTA_REQUESTOR + bool + select BOOTLOADER_MCUBOOT + +config BOOTLOADER_MCUBOOT + bool + select IMG_MANAGER + select STREAM_FLASH + select STREAM_FLASH_ERASE + +config CHIP_OTA_REQUESTOR_BUFFER_SIZE + int "OTA Requestor image buffer size" + default 256 + depends on CHIP_OTA_REQUESTOR + help + Configures the size of the buffer used by OTA Requestor when downloading + and writing a new firmware image to flash. + +config CHIP_OTA_REQUESTOR_REBOOT_ON_APPLY + bool "Auto-reboot when firmware update is applied" + default y + depends on CHIP_OTA_REQUESTOR + imply REBOOT + help + Reboots the device automatically after downloading a new firmware update + to swap the old and the new firmware images. The reboot happens only when + a user consents to apply the firmware update. diff --git a/config/nxp/chip-module/Kconfig.defaults b/config/nxp/chip-module/Kconfig.defaults new file mode 100644 index 00000000000000..56c82e3752900c --- /dev/null +++ b/config/nxp/chip-module/Kconfig.defaults @@ -0,0 +1,381 @@ +# +# Copyright (c) 2024 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. +# + +# The purpose of this file is to define new default values of settings used when building Matter samples. +# This file only changes defaults and thus all symbols here must be promptless +# and safeguarded so that they only are applied when building Matter. + +if CHIP + +config CHIP_OPERATIONAL_TIME_SAVE_INTERVAL + default 1 + +if CHIP_FACTORY_DATA + +config CHIP_DEVICE_VENDOR_ID + default 4151 # 0x1037 + +config CHIP_DEVICE_MANUFACTURING_DATE + default "2023-01-01" + +config CHIP_DEVICE_PRODUCT_ID + default 41510 if SOC_SERIES_RW6XX + +endif # CHIP_FACTORY_DATA + +config LOG + default y + +if LOG + +choice LOG_MODE + default LOG_MODE_MINIMAL +endchoice + +choice MATTER_LOG_LEVEL_CHOICE + default MATTER_LOG_LEVEL_DBG +endchoice + +config CHIP_APP_LOG_LEVEL + default 4 # debug + +config LOG_DEFAULT_LEVEL + default 1 # error + +config CHIP_LOG_SIZE_OPTIMIZATION + default y + +endif + +config PRINTK_SYNC + default y + +config ASSERT + default y + +config ASSERT_NO_COND_INFO + default y + +config ASSERT_NO_MSG_INFO + default y + +config HW_STACK_PROTECTION + default y + +config FPU + default y + +config SHELL + default y + +config PTHREAD_IPC + bool + default n + +config POSIX_MAX_FDS + int + default 16 + +# Application stack size +config MAIN_STACK_SIZE + default 8192 + +config INIT_STACKS + default y + +config NET_MGMT_EVENT_STACK_SIZE + default 2048 + +config NET_IPV6_MLD + default y + +config NET_IF_MCAST_IPV6_ADDR_COUNT + default 14 + +config NET_TC_TX_COUNT + default 1 + +config NET_TC_RX_COUNT + default 1 + +config NET_TC_THREAD_PRIO_CUSTOM + default y + +choice NET_TC_THREAD_TYPE + default NET_TC_THREAD_PREEMPTIVE +endchoice + +config NET_TCP_WORK_QUEUE_THREAD_PRIO + default -16 + +config NET_TC_TX_THREAD_BASE_PRIO + default 3 + +config NET_TC_RX_THREAD_BASE_PRIO + default 3 + +# Network buffers +config NET_PKT_RX_COUNT + default 16 + +config NET_PKT_TX_COUNT + default 16 + +config NET_BUF_RX_COUNT + default 60 + +config NET_BUF_TX_COUNT + default 80 + +config NET_BUF_DATA_SIZE + default 1700 + +# Bluetooth Low Energy configs + +config BT + default y + +config BT_PERIPHERAL + default y + +config BT_CENTRAL + default n + +config BT_PERIPHERAL_PREF_MIN_INT + default 36 + +config BT_PERIPHERAL_PREF_MAX_INT + default 36 + +# Increase BT timeout to 5 s to improve connection reliability and avoid fast drop outs. +config BT_PERIPHERAL_PREF_TIMEOUT + default 500 + +config BT_GAP_AUTO_UPDATE_CONN_PARAMS + default y + +# Decrease connection parameters update time, as some Matter controllers request +# enabling IP networking faster than BT connection parameters are updated, what may result +# in commissioning instabilities. +config BT_CONN_PARAM_UPDATE_TIMEOUT + default 1000 + +config BT_GATT_DYNAMIC_DB + default y + +config BT_DEVICE_NAME_DYNAMIC + default y + +config BT_DEVICE_NAME_MAX + default 15 + +config BT_MAX_CONN + default 1 + +config BT_L2CAP_TX_MTU + default 247 + +config BT_BUF_ACL_RX_SIZE + default 251 + +config BT_BUF_ACL_TX_SIZE + default 251 + +config BT_RX_STACK_SIZE + default 2048 if NO_OPTIMIZATIONS && DEBUG + default 1536 + +config BT_DEVICE_NAME_GATT_WRITABLE + bool + default n + +config HCI_NXP_ENABLE_AUTO_SLEEP + default n + +config CHIP_OTA_REQUESTOR + default n + +# Enable extended discovery +config CHIP_EXTENDED_DISCOVERY + default y + +config NVS_LOOKUP_CACHE + default y + +config NVS_LOOKUP_CACHE_SIZE + default 512 + +if CHIP_WIFI + +choice SCHED_ALGORITHM + default SCHED_MULTIQ +endchoice + +choice LIBC_IMPLEMENTATION + default NEWLIB_LIBC +endchoice + +choice WPA_SUPP_LOG_LEVEL_CHOICE + default WPA_SUPP_LOG_LEVEL_ERR +endchoice + +config WPA_SUPP_THREAD_STACK_SIZE + default 6144 + +config SYSTEM_WORKQUEUE_STACK_SIZE + default 2048 + +# align these numbers to match the OpenThread config +config NET_IF_UNICAST_IPV6_ADDR_COUNT + default 6 + +config NET_IF_MCAST_IPV6_ADDR_COUNT + default 8 + +config NET_SOCKETS_POLL_MAX + default 4 + +# options managed by IP4/IP6 simultaneous support +# aligned here to match OpenThread config +config NET_MAX_ROUTERS + default 1 + +config NET_MAX_CONN + default 4 + +config SHELL_STACK_SIZE + default 2616 + +config HEAP_MEM_POOL_SIZE + default 65536 + +config CHIP_MALLOC_SYS_HEAP_SIZE + default 28672 # 28 kB + +endif + +# Configure MBEDTLS lib +config MBEDTLS + default y + +config MBEDTLS_CFG_FILE + default "config-tls-generic.h" + +config MBEDTLS_USER_CONFIG_ENABLE + default y + +config MBEDTLS_USER_CONFIG_FILE + default "nxp-zephyr-mbedtls-config.h" + +config MBEDTLS_ENTROPY_ENABLED + default y + +config MBEDTLS_ZEPHYR_ENTROPY + default y + +config MBEDTLS_ENABLE_HEAP + default y + +config MBEDTLS_HEAP_SIZE + default 15360 + +config MBEDTLS_CIPHER_AES_ENABLED + default y + +config MBEDTLS_CIPHER_CCM_ENABLED + default y + +config MBEDTLS_CTR_DRBG_ENABLED + default y + +config MBEDTLS_CIPHER_MODE_CBC_ENABLED + default y + +config MBEDTLS_ECP_C + default y + +config MBEDTLS_ECP_DP_SECP256R1_ENABLED + default y + +if CHIP_CRYPTO_PSA + +config MBEDTLS_PSA_CRYPTO_C + default y + +config WPA_SUPP_CRYPTO_MBEDTLS_PSA + default y if WPA_SUPP_CRYPTO + +endif + +config MCUX_ELS_PKC + default y if SOC_SERIES_RW6XX + +if MCUX_ELS_PKC + +config KSDK_MBEDTLS + default n + +config MCUX_PSA_CRYPTO_DRIVER_ELS_PKC + default y if MBEDTLS_PSA_CRYPTO_C + +config ENTROPY_GENERATOR + default y + +endif # MCUX_ELS_PKC + + +if SHELL + +config KERNEL_SHELL + default y + +config DEVICE_SHELL + default y + +config REBOOT + default y + +# Disable not used shell modules +config SHELL_WILDCARD + default n + +config SHELL_VT100_COLORS + default n + +config SHELL_STATS + default n + +config SENSOR_SHELL + default n + +config DATE_SHELL + default n + +config DEVMEM_SHELL + default n + +config MCUBOOT_SHELL + default n + +config FLASH_SHELL + default n + +endif # SHELL + +endif + +config NXP_FW_LOADER_MONOLITHIC + default y if NXP_FW_LOADER diff --git a/config/nxp/chip-module/Kconfig.features b/config/nxp/chip-module/Kconfig.features new file mode 100644 index 00000000000000..d8d194ccef2b41 --- /dev/null +++ b/config/nxp/chip-module/Kconfig.features @@ -0,0 +1,74 @@ +# +# Copyright (c) 2024 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. +# + +# The purpose of this file is to define Kconfig options enabling specific features. +# Feature options will define defaults for settings that are related to the specific feature. + +if CHIP + +config CHIP_WIFI + bool "Enable NXP Wi-Fi support" + default y + select WIFI + select WIFI_NXP + select WPA_SUPP + select WPA_SUPP_AP + select WPA_SUPP_WPS + select WPA_SUPP_WPA3 + select WPA_SUPP_CRYPTO_ENTERPRISE + imply MBEDTLS_ENTROPY_C + imply NET_STATISTICS + imply NET_PKT_TXTIME + imply NET_PKT_TIMESTAMP + imply NET_IPV6_ND # enable Neighbor Discovery to handle Router Advertisements + imply NET_IPV6_NBR_CACHE + imply NET_STATISTICS_IPV6 + imply NET_STATISTICS_USER_API + +config CHIP_WIFI_CONNECTION_RECOVERY_MINIMUM_INTERVAL + int "Define the minimum connection recovery time interval in milliseconds" + depends on CHIP_WIFI + default 500 + help + Specifies the minimum connection recovery interval (in milliseconds). + +config CHIP_WIFI_CONNECTION_RECOVERY_MAXIMUM_INTERVAL + int "Define the maximum connection recovery time interval in milliseconds" + depends on CHIP_WIFI + default 3600000 # 1 hour + help + Specifies the maximum connection recovery interval (in milliseconds). + +config CHIP_WIFI_CONNECTION_RECOVERY_MAX_RETRIES_NUMBER + int "Define the maximum amount of connection recovery occurrences" + depends on CHIP_WIFI + default 0 + help + Specifies the maximum number of connection recovery attempts. + If set to 0, no limitation is applied and attempts + to recover the connection are performed indefinitely. + +config CHIP_WIFI_CONNECTION_RECOVERY_JITTER + int "Define the connection recovery jitter in milliseconds" + depends on CHIP_WIFI + default 2000 + help + Specifies the maximum connection recovery jitter interval (in milliseconds). + Once the wait time reaches the current maximum value (defined by CHIP_WIFI_CONNECTION_RECOVERY_MAXIMUM_INTERVAL), + a random jitter interval is added to it to avoid periodicity. The random jitter is selected + within range [-JITTER; +JITTER]. + +endif # CHIP diff --git a/config/nxp/chip-module/generate_factory_data.cmake b/config/nxp/chip-module/generate_factory_data.cmake new file mode 100644 index 00000000000000..ea1e35a797ab78 --- /dev/null +++ b/config/nxp/chip-module/generate_factory_data.cmake @@ -0,0 +1,229 @@ +# +# Copyright (c) 2024 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. +# + +# Generate certificates based on factory data given via Kconfigs. +# +# This function creates a list of arguments for external script and then run it to generate certificates. +# +# During generation process a some file will be created in zephyr's build directory: +# - Chip-PAI-NXP---Cert.der +# - Chip-PAI-NXP---Key.der +# - Chip-DAC-NXP---Cert.der +# - Chip-DAC-NXP---Key.der +# +# [Args]: +# script_path - a path to script that generates the certificates. +# output_path - a path to output directory, where generated certificates will be stored. +function(nxp_generate_certs script_path output_path) + if(NOT EXISTS ${CHIP_ROOT}/out/chip-cert) + message(FATAL_ERROR "Couldn't find chip-cert in ${CHIP_ROOT}/out folder. + Run following command from ${CHIP_ROOT} to build it: + gn gen out + ninja -C out chip-cert") + endif() + + # generate all script arguments + set(script_args) + string(APPEND script_args "--gen_cd\n") + string(APPEND script_args "--cd_type \"1\"\n") + string(APPEND script_args "--chip_cert_path ${CHIP_ROOT}/out/chip-cert\n") + string(APPEND script_args "--vendor_id ${CONFIG_CHIP_DEVICE_VENDOR_ID}\n") + string(APPEND script_args "--product_id ${CONFIG_CHIP_DEVICE_PRODUCT_ID}\n") + string(APPEND script_args "--vendor_name \"${CONFIG_CHIP_DEVICE_VENDOR_NAME}\"\n") + string(APPEND script_args "--product_name \"${CONFIG_CHIP_DEVICE_PRODUCT_NAME}\"\n") + string(APPEND script_args "--device_type \"${CONFIG_CHIP_DEVICE_TYPE}\"\n") + string(APPEND script_args "--output \"${output_path}\"\n") + + # convert decimal VID to its hexadecimal representation to find out certification files in repository + math(EXPR LOCAL_VID "${CONFIG_CHIP_DEVICE_VENDOR_ID}" OUTPUT_FORMAT HEXADECIMAL) + string(SUBSTRING ${LOCAL_VID} 2 -1 raw_vid) + string(TOUPPER ${raw_vid} raw_vid_upper) + + # convert decimal PID to its hexadecimal representation to find out certification files in repository + math(EXPR LOCAL_PID "${CONFIG_CHIP_DEVICE_PRODUCT_ID}" OUTPUT_FORMAT HEXADECIMAL) + string(SUBSTRING ${LOCAL_PID} 2 -1 raw_pid) + string(TOUPPER ${raw_pid} raw_pid_upper) + + # execute the script which can generate the certificates + separate_arguments(separated_script_args NATIVE_COMMAND ${script_args}) + add_custom_command( + OUTPUT + ${output_path}/Chip-PAI-NXP-${raw_vid_upper}-${raw_pid_upper}-Cert.pem + ${output_path}/Chip-PAI-NXP-${raw_vid_upper}-${raw_pid_upper}-Key.pem + ${output_path}/Chip-DAC-NXP-${raw_vid_upper}-${raw_pid_upper}-Cert.pem + ${output_path}/Chip-DAC-NXP-${raw_vid_upper}-${raw_pid_upper}-Key.pem + ${output_path}/Chip-PAI-NXP-${raw_vid_upper}-${raw_pid_upper}-Cert.der + ${output_path}/Chip-PAI-NXP-${raw_vid_upper}-${raw_pid_upper}-Key.der + ${output_path}/Chip-DAC-NXP-${raw_vid_upper}-${raw_pid_upper}-Cert.der + ${output_path}/Chip-DAC-NXP-${raw_vid_upper}-${raw_pid_upper}-Key.der + DEPENDS ${script_path} + COMMAND ${Python3_EXECUTABLE} ${script_path} ${separated_script_args} + COMMENT "Generating new certificates..." + ) + add_custom_target(chip-certificates ALL + DEPENDS + ${output_path}/Chip-PAI-NXP-${raw_vid_upper}-${raw_pid_upper}-Cert.pem + ${output_path}/Chip-PAI-NXP-${raw_vid_upper}-${raw_pid_upper}-Key.pem + ${output_path}/Chip-DAC-NXP-${raw_vid_upper}-${raw_pid_upper}-Cert.pem + ${output_path}/Chip-DAC-NXP-${raw_vid_upper}-${raw_pid_upper}-Key.pem + ${output_path}/Chip-PAI-NXP-${raw_vid_upper}-${raw_pid_upper}-Cert.der + ${output_path}/Chip-PAI-NXP-${raw_vid_upper}-${raw_pid_upper}-Key.der + ${output_path}/Chip-DAC-NXP-${raw_vid_upper}-${raw_pid_upper}-Cert.der + ${output_path}/Chip-DAC-NXP-${raw_vid_upper}-${raw_pid_upper}-Key.der + ) +endfunction() + +# Create a .bin file with factory data in KLV format. +# +# This function creates a .bin file from given Kconfig. +# +# During generation process, following files will be created in zephyr's build directory: +# - .bin a binary file containing all raw factory data in KLV format. +# +# [Args]: +# script_path - a path to script that makes a factory data .bin file from given arguments. +# output_path - a path to output directory, where created bin file will be stored. +function(nxp_generate_factory_data_bin script_path output_path) + if(NOT EXISTS ${CHIP_ROOT}/out/spake2p) + message(FATAL_ERROR "Couldn't find spake2p in ${CHIP_ROOT}/out folder. + Run following command from ${CHIP_ROOT} to build it: + gn gen out + ninja -C out spake2p") + endif() + + # convert decimal VID to its hexadecimal representation to find out certification files in repository + math(EXPR LOCAL_VID "${CONFIG_CHIP_DEVICE_VENDOR_ID}" OUTPUT_FORMAT HEXADECIMAL) + string(SUBSTRING ${LOCAL_VID} 2 -1 raw_vid) + string(TOUPPER ${raw_vid} raw_vid_upper) + + # convert decimal PID to its hexadecimal representation to find out certification files in repository + math(EXPR LOCAL_PID "${CONFIG_CHIP_DEVICE_PRODUCT_ID}" OUTPUT_FORMAT HEXADECIMAL) + string(SUBSTRING ${LOCAL_PID} 2 -1 raw_pid) + string(TOUPPER ${raw_pid} raw_pid_upper) + + # generate all script arguments + set(script_args) + string(APPEND script_args "--it \"${CONFIG_CHIP_DEVICE_SPAKE2_IT}\"\n") + string(APPEND script_args "--salt \"${CONFIG_CHIP_DEVICE_SPAKE2_SALT}\"\n") + string(APPEND script_args "--discriminator ${CONFIG_CHIP_DEVICE_DISCRIMINATOR}\n") + string(APPEND script_args "--passcode ${CONFIG_CHIP_DEVICE_SPAKE2_PASSCODE}\n") + string(APPEND script_args "--vid ${CONFIG_CHIP_DEVICE_VENDOR_ID}\n") + string(APPEND script_args "--pid ${CONFIG_CHIP_DEVICE_PRODUCT_ID}\n") + string(APPEND script_args "--vendor_name \"${CONFIG_CHIP_DEVICE_VENDOR_NAME}\"\n") + string(APPEND script_args "--product_name \"${CONFIG_CHIP_DEVICE_PRODUCT_NAME}\"\n") + string(APPEND script_args "--hw_version ${CONFIG_CHIP_DEVICE_HARDWARE_VERSION}\n") + string(APPEND script_args "--hw_version_str \"${CONFIG_CHIP_DEVICE_HARDWARE_VERSION_STRING}\"\n") + string(APPEND script_args "--spake2p_path \"${CHIP_ROOT}/out/spake2p\"\n") + string(APPEND script_args "--serial_num \"${CONFIG_CHIP_DEVICE_SERIAL_NUMBER}\"\n") + string(APPEND script_args "--date \"${CONFIG_CHIP_DEVICE_MANUFACTURING_DATE}\"\n") + string(APPEND script_args "--unique_id \"${CONFIG_CHIP_DEVICE_ROTATING_DEVICE_UID}\"\n") + string(APPEND script_args "--product_finish ${CONFIG_CHIP_DEVICE_PRODUCT_FINISH}\n") + string(APPEND script_args "--product_url ${CONFIG_CHIP_DEVICE_PRODUCT_URL}\n") + string(APPEND script_args "--product_label ${CONFIG_CHIP_DEVICE_PRODUCT_LABEL}\n") + string(APPEND script_args "--part_number ${CONFIG_CHIP_DEVICE_PART_NUMBER}\n") + string(APPEND script_args "--out \"${output_path}/factory_data.bin\"\n") + + # for development purpose user can use default certs instead of generating or providing them + if(CONFIG_CHIP_FACTORY_DATA_USE_DEFAULT_CERTS) + # all certs are located in ${CHIP_ROOT}/credentials/development/attestation + # it can be used during development without need to generate new certifications + set(cd_cert ${CHIP_ROOT}/credentials/development/cd-certs/Chip-Test-CD-Cert.der) + set(dac_cert ${CHIP_ROOT}/credentials/development/attestation/Matter-Development-DAC-${raw_vid_upper}-${raw_pid_upper}-Cert.der) + set(dac_key ${CHIP_ROOT}/credentials/development/attestation/Matter-Development-DAC-${raw_vid_upper}-${raw_pid_upper}-Key.der) + set(pai_cert ${CHIP_ROOT}/credentials/development/attestation/Matter-Development-PAI-${raw_vid_upper}-noPID-Cert.der) + elseif(CONFIG_CHIP_FACTORY_DATA_CERT_SOURCE_USER) + set(cd_cert ${CONFIG_CHIP_FACTORY_DATA_USER_CERTS_CD_CERT}) + set(dac_cert ${CONFIG_CHIP_FACTORY_DATA_USER_CERTS_DAC_CERT}) + set(dac_key ${CONFIG_CHIP_FACTORY_DATA_USER_CERTS_DAC_KEY}) + set(pai_cert ${CONFIG_CHIP_FACTORY_DATA_USER_CERTS_PAI_CERT}) + elseif(CONFIG_CHIP_FACTORY_DATA_CERT_SOURCE_GENERATED) + set(cd_cert ${output_path}/Chip-Test-CD-${raw_vid_upper}-${raw_pid_upper}.der) + set(dac_cert ${output_path}/Chip-DAC-NXP-${raw_vid_upper}-${raw_pid_upper}-Cert.der) + set(dac_key ${output_path}/Chip-DAC-NXP-${raw_vid_upper}-${raw_pid_upper}-Key.der) + set(pai_cert ${output_path}/Chip-PAI-NXP-${raw_vid_upper}-${raw_pid_upper}-Cert.der) + else() + message(FATAL_ERROR "Either CONFIG_CHIP_FACTORY_DATA_USE_DEFAULT_CERTS or CONFIG_CHIP_FACTORY_DATA_CERT_SOURCE_USER + or CONFIG_CHIP_FACTORY_DATA_CERT_SOURCE_GENERATED must be defined. + See ${CHIP_ROOT}/config/nxp/chip-module/Kconfig for details.") + endif() + + string(APPEND script_args "--cert_declaration \"${cd_cert}\"\n") + string(APPEND script_args "--dac_cert \"${dac_cert}\"\n") + string(APPEND script_args "--dac_key \"${dac_key}\"\n") + string(APPEND script_args "--pai_cert \"${pai_cert}\"\n") + + # check if spake2 verifier should be generated using script + if(NOT CONFIG_CHIP_FACTORY_DATA_GENERATE_SPAKE2_VERIFIER) + # Spake2 verifier should be provided using Kconfig + string(APPEND script_args "--spake2p_verifier \"${CONFIG_CHIP_DEVICE_SPAKE2_TEST_VERIFIER}\"\n") + endif() + + if(CONFIG_CHIP_ENCRYPTED_FACTORY_DATA) + if(NOT CONFIG_CHIP_ENCRYPTED_FACTORY_DATA_AES128_KEY) + message(FATAL_ERROR "CONFIG_CHIP_ENCRYPTED_FACTORY_DATA_AES128_KEY is required when using CONFIG_CHIP_ENCRYPTED_FACTORY_DATA !") + endif() + + string(APPEND script_args "--aes128_key \"${CONFIG_CHIP_ENCRYPTED_FACTORY_DATA_AES128_KEY}\"\n") + endif() + + if(CONFIG_CHIP_DEVICE_PRODUCT_COLOR) + string(APPEND script_args "--product_primary_color ${CONFIG_CHIP_DEVICE_PRODUCT_COLOR}\n") + endif() + + # execute the script which can generate the factory_data.bin file + separate_arguments(separated_script_args NATIVE_COMMAND ${script_args}) + add_custom_command( + OUTPUT ${output_path}/factory_data.bin + DEPENDS ${script_path} + COMMAND ${Python3_EXECUTABLE} ${script_path} ${separated_script_args} + COMMENT "Generating new Factory Data..." + ) + add_custom_target(factory_data ALL + DEPENDS ${output_path}/factory_data.bin + ) + + if(CONFIG_CHIP_FACTORY_DATA_CERT_SOURCE_GENERATED) + # Make sure certificates are generated before trying to generate factory data + add_dependencies(factory_data chip-certificates) + endif() +endfunction() + +# Generate factory data partition using given args +# +# During generation process a some file will be created in zephyr's build directory: +# - factory_data.bin: a raw binary file containing the factory data partition +# - CD, PAI, DEC certificates if CONFIG_CHIP_FACTORY_DATA_CERT_SOURCE_GENERATED is set +# +function(nxp_generate_factory_data) + find_package(Python REQUIRED) + + # CHIP_ROOT must be provided as a reference set all localization of scripts + if(NOT CHIP_ROOT) + message(FATAL_ERROR "CHIP_ROOT variable is not set, please add it to CMakeLists.txt file") + endif() + + # Localize all scripts needed to generate factory data partition + set(GENERATE_CERTS_SCRIPT_PATH ${CHIP_ROOT}/scripts/tools/nxp/generate_certs.py) + set(GENERATE_FDATA_SCRIPT_PATH ${CHIP_ROOT}/scripts/tools/nxp/factory_data_generator/generate.py) + set(OUTPUT_FILE_PATH ${APPLICATION_BINARY_DIR}/zephyr) + + if(CONFIG_CHIP_FACTORY_DATA_CERT_SOURCE_GENERATED) + # Generate certificates + nxp_generate_certs(${GENERATE_CERTS_SCRIPT_PATH} ${OUTPUT_FILE_PATH}) + endif() + + nxp_generate_factory_data_bin(${GENERATE_FDATA_SCRIPT_PATH} ${OUTPUT_FILE_PATH}) +endfunction() diff --git a/config/nxp/chip-module/zephyr/module.yml b/config/nxp/chip-module/zephyr/module.yml new file mode 100644 index 00000000000000..870b1a37e35231 --- /dev/null +++ b/config/nxp/chip-module/zephyr/module.yml @@ -0,0 +1,22 @@ +# +# Copyright (c) 2024 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +name: connectedhomeip +build: + cmake: . + kconfig: Kconfig + depends: + - openthread diff --git a/config/qpg/lib/pw_rpc/BUILD.gn b/config/qpg/lib/pw_rpc/BUILD.gn index bd633d591b3577..99c64201f5df19 100644 --- a/config/qpg/lib/pw_rpc/BUILD.gn +++ b/config/qpg/lib/pw_rpc/BUILD.gn @@ -36,7 +36,6 @@ static_library("pw_rpc") { "$dir_pw_rpc:server", "$dir_pw_rpc/nanopb:echo_service", "${chip_root}/examples/platform/qpg/pw_sys_io:pw_sys_io_qpg", - "${dir_pigweed}/pw_hdlc:pw_rpc", dir_pw_assert, dir_pw_checksum, dir_pw_hdlc, diff --git a/config/zephyr/Kconfig b/config/zephyr/Kconfig index bd4b52ecb7a193..8df6c418aa42e3 100644 --- a/config/zephyr/Kconfig +++ b/config/zephyr/Kconfig @@ -17,12 +17,12 @@ menuconfig CHIP bool "Matter protocol stack" default n - select CPLUSPLUS - imply LIB_CPLUSPLUS + select CPP + imply REQUIRES_FULL_LIBCPP imply REQUIRES_FULL_LIBC imply NEWLIB_LIBC_NANO imply CBPRINTF_LIBC_SUBSTS - imply POSIX_API if !ARCH_POSIX && !CHIP_NRF_PLATFORM + imply POSIX_API if !ARCH_POSIX && !CHIP_NRF_PLATFORM && !CHIP_NXP_PLATFORM imply EVENTFD if !ARCH_POSIX imply REBOOT imply ENTROPY_GENERATOR @@ -30,7 +30,7 @@ menuconfig CHIP imply NET_IPV6 imply NET_CONFIG_NEED_IPV6 imply NET_SOCKETS - imply NET_SOCKETS_POSIX_NAMES if !ARCH_POSIX && CHIP_NRF_PLATFORM + imply NET_SOCKETS_POSIX_NAMES if !ARCH_POSIX && (CHIP_NRF_PLATFORM || CHIP_NXP_PLATFORM) imply NETWORKING imply HWINFO imply FLASH diff --git a/data_model/clusters/BooleanStateConfiguration.xml b/data_model/clusters/BooleanStateConfiguration.xml index 0b60a3e6b9f557..160cb7fadb7a93 100644 --- a/data_model/clusters/BooleanStateConfiguration.xml +++ b/data_model/clusters/BooleanStateConfiguration.xml @@ -68,7 +68,12 @@ Davis, CA 95616, USA - + + + + + + @@ -130,13 +135,7 @@ Davis, CA 95616, USA - - - - - - - + diff --git a/data_model/clusters/ConcentrationMeasurement.xml b/data_model/clusters/ConcentrationMeasurement.xml index 7351a0951e003f..c5e2971406f676 100644 --- a/data_model/clusters/ConcentrationMeasurement.xml +++ b/data_model/clusters/ConcentrationMeasurement.xml @@ -1,59 +1,59 @@ - @@ -62,6 +62,7 @@ Davis, CA 95616, USA + @@ -260,4 +261,4 @@ Davis, CA 95616, USA - \ No newline at end of file + diff --git a/data_model/clusters/ContentAppObserver.xml b/data_model/clusters/ContentAppObserver.xml index 4d292cc3e6b2d7..b426daa5ec3379 100644 --- a/data_model/clusters/ContentAppObserver.xml +++ b/data_model/clusters/ContentAppObserver.xml @@ -76,9 +76,11 @@ Davis, CA 95616, USA + + @@ -89,9 +91,11 @@ Davis, CA 95616, USA + + diff --git a/data_model/clusters/DeviceEnergyManagement.xml b/data_model/clusters/DeviceEnergyManagement.xml index fe2358e36854cb..6d6477cc72fb7c 100644 --- a/data_model/clusters/DeviceEnergyManagement.xml +++ b/data_model/clusters/DeviceEnergyManagement.xml @@ -55,41 +55,88 @@ Connectivity Standards Alliance 508 Second Street, Suite 206 Davis, CA 95616, USA --> - + + - + + adjustment (within the limits offered by the ESA)."> + future power consumption vs time."> - + + + + + + + + + + + + future state vs time."> - + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + @@ -103,6 +150,9 @@ Davis, CA 95616, USA + + + @@ -128,15 +178,12 @@ Davis, CA 95616, USA - - - - + - + @@ -189,6 +236,31 @@ Davis, CA 95616, USA + + + + + + + + + + + + + + + + + + + + + + + + + @@ -261,13 +333,13 @@ Davis, CA 95616, USA - + - + @@ -280,6 +352,10 @@ Davis, CA 95616, USA + + + + @@ -339,15 +415,21 @@ Davis, CA 95616, USA - + + + - + + + - + + + @@ -429,6 +511,109 @@ Davis, CA 95616, USA + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -453,15 +638,18 @@ Davis, CA 95616, USA - - - + + + - - - + + + + + + \ No newline at end of file diff --git a/data_model/clusters/EnergyEVSE.xml b/data_model/clusters/EnergyEVSE.xml index 52cf89fecee8a7..c788edc054ede0 100644 --- a/data_model/clusters/EnergyEVSE.xml +++ b/data_model/clusters/EnergyEVSE.xml @@ -60,7 +60,7 @@ Davis, CA 95616, USA - + @@ -79,6 +79,8 @@ Davis, CA 95616, USA + + @@ -212,6 +214,17 @@ Davis, CA 95616, USA + + + + + + + + + + + @@ -220,7 +233,12 @@ Davis, CA 95616, USA - + + + + + + @@ -293,20 +311,6 @@ Davis, CA 95616, USA - - - - - - - - - - - - - - @@ -398,14 +402,10 @@ Davis, CA 95616, USA - + + - - - - - - + @@ -451,14 +451,10 @@ Davis, CA 95616, USA - + + - - - - - - + @@ -466,10 +462,6 @@ Davis, CA 95616, USA - - - - diff --git a/data_model/clusters/FanControl.xml b/data_model/clusters/FanControl.xml index e3ac9f85cc4c16..acf1d59e54d91e 100644 --- a/data_model/clusters/FanControl.xml +++ b/data_model/clusters/FanControl.xml @@ -59,12 +59,12 @@ Davis, CA 95616, USA - + - + @@ -79,7 +79,7 @@ Davis, CA 95616, USA - + diff --git a/data_model/clusters/ICDManagement.xml b/data_model/clusters/ICDManagement.xml index efd974dece9fe4..f138e7037687b6 100644 --- a/data_model/clusters/ICDManagement.xml +++ b/data_model/clusters/ICDManagement.xml @@ -1,59 +1,59 @@ - @@ -69,6 +69,14 @@ Davis, CA 95616, USA + + + + + + + + @@ -83,14 +91,6 @@ Davis, CA 95616, USA - - - - - - - - @@ -133,13 +133,6 @@ Davis, CA 95616, USA - - - - - - - @@ -210,4 +203,4 @@ Davis, CA 95616, USA - + \ No newline at end of file diff --git a/data_model/clusters/MediaPlayback.xml b/data_model/clusters/MediaPlayback.xml index b01562cadf055a..f2cdf5c4a7c851 100644 --- a/data_model/clusters/MediaPlayback.xml +++ b/data_model/clusters/MediaPlayback.xml @@ -203,22 +203,12 @@ Davis, CA 95616, USA - - - - - - - - - - diff --git a/data_model/clusters/MicrowaveOvenControl.xml b/data_model/clusters/MicrowaveOvenControl.xml index dd60600c792beb..c95d713714854f 100644 --- a/data_model/clusters/MicrowaveOvenControl.xml +++ b/data_model/clusters/MicrowaveOvenControl.xml @@ -61,12 +61,17 @@ Davis, CA 95616, USA - + - + + + + + + @@ -90,26 +95,26 @@ Davis, CA 95616, USA - - - - + + + + - - - - + + + + - - - - + + + + @@ -137,7 +142,7 @@ Davis, CA 95616, USA - + diff --git a/data_model/clusters/ModeBase.xml b/data_model/clusters/ModeBase.xml index 179a6ade6ab7fc..1e6a81807e29a2 100644 --- a/data_model/clusters/ModeBase.xml +++ b/data_model/clusters/ModeBase.xml @@ -63,12 +63,6 @@ Require at least one standard mode tag. Define reserved ranges for base/derived - - - - - - @@ -104,12 +98,6 @@ Require at least one standard mode tag. Define reserved ranges for base/derived - - - - - - @@ -139,12 +127,6 @@ Require at least one standard mode tag. Define reserved ranges for base/derived - - - - - - diff --git a/data_model/clusters/Mode_DeviceEnergyManagement.xml b/data_model/clusters/Mode_DeviceEnergyManagement.xml new file mode 100644 index 00000000000000..dc28204cecb511 --- /dev/null +++ b/data_model/clusters/Mode_DeviceEnergyManagement.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/clusters/Mode_EVSE.xml b/data_model/clusters/Mode_EVSE.xml index d52139252d014d..2a600e3e381325 100644 --- a/data_model/clusters/Mode_EVSE.xml +++ b/data_model/clusters/Mode_EVSE.xml @@ -55,9 +55,9 @@ Connectivity Standards Alliance 508 Second Street, Suite 206 Davis, CA 95616, USA --> - + - + \ No newline at end of file diff --git a/data_model/clusters/Mode_RVCClean.xml b/data_model/clusters/Mode_RVCClean.xml index b82c26501f1196..64118517a03c1b 100644 --- a/data_model/clusters/Mode_RVCClean.xml +++ b/data_model/clusters/Mode_RVCClean.xml @@ -58,9 +58,23 @@ Davis, CA 95616, USA - + + + + + + + + + + + + + + + diff --git a/data_model/clusters/Mode_RVCRun.xml b/data_model/clusters/Mode_RVCRun.xml index 7ea4183603482c..8f49741f7cfeb8 100644 --- a/data_model/clusters/Mode_RVCRun.xml +++ b/data_model/clusters/Mode_RVCRun.xml @@ -58,9 +58,23 @@ Davis, CA 95616, USA - + + + + + + + + + + + + + + + diff --git a/data_model/clusters/Mode_WaterHeater.xml b/data_model/clusters/Mode_WaterHeater.xml index 535eb4d22dd7c7..69fba08b940293 100644 --- a/data_model/clusters/Mode_WaterHeater.xml +++ b/data_model/clusters/Mode_WaterHeater.xml @@ -55,7 +55,7 @@ Connectivity Standards Alliance 508 Second Street, Suite 206 Davis, CA 95616, USA --> - + diff --git a/data_model/clusters/NetworkIdentityManagement.xml b/data_model/clusters/NetworkIdentityManagement.xml index e43eeaa615ba9a..08bee6af5871ff 100644 --- a/data_model/clusters/NetworkIdentityManagement.xml +++ b/data_model/clusters/NetworkIdentityManagement.xml @@ -120,7 +120,7 @@ Davis, CA 95616, USA - + @@ -131,7 +131,7 @@ Davis, CA 95616, USA - + @@ -142,7 +142,7 @@ Davis, CA 95616, USA - + diff --git a/data_model/clusters/OperationalState.xml b/data_model/clusters/OperationalState.xml index 97fae41a3aa2ad..dcb5753b2c1998 100644 --- a/data_model/clusters/OperationalState.xml +++ b/data_model/clusters/OperationalState.xml @@ -58,7 +58,7 @@ Davis, CA 95616, USA - + diff --git a/data_model/clusters/OperationalState_RVC.xml b/data_model/clusters/OperationalState_RVC.xml index 24166eb9fcd8dd..bc4e5505e45d6d 100644 --- a/data_model/clusters/OperationalState_RVC.xml +++ b/data_model/clusters/OperationalState_RVC.xml @@ -58,9 +58,32 @@ Davis, CA 95616, USA - + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data_model/clusters/ResourceMonitoring.xml b/data_model/clusters/ResourceMonitoring.xml index 8ac1186f7b3a99..9772efbd429982 100644 --- a/data_model/clusters/ResourceMonitoring.xml +++ b/data_model/clusters/ResourceMonitoring.xml @@ -1,65 +1,66 @@ - + @@ -170,4 +171,4 @@ Davis, CA 95616, USA - \ No newline at end of file + diff --git a/data_model/clusters/Scenes.xml b/data_model/clusters/Scenes.xml index daa9e5da564a41..2168c164a02460 100644 --- a/data_model/clusters/Scenes.xml +++ b/data_model/clusters/Scenes.xml @@ -55,28 +55,15 @@ Connectivity Standards Alliance 508 Second Street, Suite 206 Davis, CA 95616, USA --> - + - - - - - + - - - - - - - - - @@ -84,20 +71,10 @@ Davis, CA 95616, USA - - - - - - - - - - - + @@ -150,6 +127,7 @@ Davis, CA 95616, USA + @@ -157,26 +135,24 @@ Davis, CA 95616, USA - + + - - - - - + + @@ -188,87 +164,45 @@ Davis, CA 95616, USA - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - - - + - + - - - + - + + - + - + @@ -292,16 +226,18 @@ Davis, CA 95616, USA + - + + @@ -316,9 +252,10 @@ Davis, CA 95616, USA + - - + + @@ -328,13 +265,14 @@ Davis, CA 95616, USA - + + @@ -349,10 +287,11 @@ Davis, CA 95616, USA + - + @@ -370,13 +309,14 @@ Davis, CA 95616, USA - + + @@ -391,25 +331,27 @@ Davis, CA 95616, USA + - + + - + - + - + @@ -433,66 +375,8 @@ Davis, CA 95616, USA - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -501,17 +385,17 @@ Davis, CA 95616, USA - + - + - + @@ -525,7 +409,8 @@ Davis, CA 95616, USA + - + \ No newline at end of file diff --git a/data_model/clusters/Thermostat.xml b/data_model/clusters/Thermostat.xml index 8a09ea37e8948c..b7e811bb8738ae 100644 --- a/data_model/clusters/Thermostat.xml +++ b/data_model/clusters/Thermostat.xml @@ -85,21 +85,21 @@ Davis, CA 95616, USA - + - - + - + + - + - + @@ -225,6 +225,26 @@ Davis, CA 95616, USA + + + + + + + + + + + + + + + + + + + + @@ -295,6 +315,21 @@ Davis, CA 95616, USA + + + + + + + + + + + + + + + @@ -416,26 +451,6 @@ Davis, CA 95616, USA - - - - - - - - - - - - - - - - - - - - @@ -452,10 +467,12 @@ Davis, CA 95616, USA + + @@ -640,10 +657,12 @@ Davis, CA 95616, USA - + + + - + @@ -820,7 +839,7 @@ Davis, CA 95616, USA - + @@ -833,6 +852,22 @@ Davis, CA 95616, USA + + + + + + + + + + + + + + + + @@ -842,7 +877,7 @@ Davis, CA 95616, USA - + @@ -899,7 +934,7 @@ Davis, CA 95616, USA - + @@ -907,7 +942,9 @@ Davis, CA 95616, USA - + + + \ No newline at end of file diff --git a/data_model/clusters/ValveConfigurationControl.xml b/data_model/clusters/ValveConfigurationControl.xml index 2d1554df10df59..32620ad9cce97d 100644 --- a/data_model/clusters/ValveConfigurationControl.xml +++ b/data_model/clusters/ValveConfigurationControl.xml @@ -161,6 +161,14 @@ Davis, CA 95616, USA + + + + + + + + diff --git a/data_model/clusters/WaterContentMeasurement.xml b/data_model/clusters/WaterContentMeasurement.xml index 15b613015444cb..bca3f6de8e4101 100644 --- a/data_model/clusters/WaterContentMeasurement.xml +++ b/data_model/clusters/WaterContentMeasurement.xml @@ -1,4 +1,4 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file +--> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data_model/device_types/BaseDeviceType.xml b/data_model/device_types/BaseDeviceType.xml index 22cec956aa6061..a92816ac49d6e1 100644 --- a/data_model/device_types/BaseDeviceType.xml +++ b/data_model/device_types/BaseDeviceType.xml @@ -62,4 +62,23 @@ Davis, CA 95616, USA + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data_model/device_types/ColorDimmerSwitch.xml b/data_model/device_types/ColorDimmerSwitch.xml index 4de98619c1f9fb..0adcfcedcdc92a 100644 --- a/data_model/device_types/ColorDimmerSwitch.xml +++ b/data_model/device_types/ColorDimmerSwitch.xml @@ -1,59 +1,59 @@ - @@ -73,20 +73,17 @@ Davis, CA 95616, USA - - - - - - + + + - + \ No newline at end of file diff --git a/data_model/device_types/ColorTemperatureLight.xml b/data_model/device_types/ColorTemperatureLight.xml index 2e6db00535d3e3..210ce03b2da41c 100644 --- a/data_model/device_types/ColorTemperatureLight.xml +++ b/data_model/device_types/ColorTemperatureLight.xml @@ -1,59 +1,59 @@ - @@ -76,32 +76,6 @@ Davis, CA 95616, USA - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -132,6 +106,14 @@ Davis, CA 95616, USA + + + + + + + + @@ -155,4 +137,4 @@ Davis, CA 95616, USA - + \ No newline at end of file diff --git a/data_model/device_types/ContactSensor.xml b/data_model/device_types/ContactSensor.xml index e8a7c3f343a9f4..6fa5620a77bebb 100644 --- a/data_model/device_types/ContactSensor.xml +++ b/data_model/device_types/ContactSensor.xml @@ -55,9 +55,10 @@ Connectivity Standards Alliance 508 Second Street, Suite 206 Davis, CA 95616, USA --> - + + @@ -68,5 +69,8 @@ Davis, CA 95616, USA + + + \ No newline at end of file diff --git a/data_model/device_types/ControlBridge.xml b/data_model/device_types/ControlBridge.xml index 6c73377045b533..f97439b77f8c3b 100644 --- a/data_model/device_types/ControlBridge.xml +++ b/data_model/device_types/ControlBridge.xml @@ -1,59 +1,59 @@ - @@ -74,18 +74,15 @@ required."/> - - - - - - + + + @@ -96,4 +93,4 @@ required."/> - + \ No newline at end of file diff --git a/data_model/device_types/CookSurface.xml b/data_model/device_types/CookSurface.xml index 34f5556234a6e5..a9548d3ac6e3dd 100644 --- a/data_model/device_types/CookSurface.xml +++ b/data_model/device_types/CookSurface.xml @@ -63,10 +63,10 @@ Davis, CA 95616, USA - + - + \ No newline at end of file diff --git a/data_model/device_types/Cooktop.xml b/data_model/device_types/Cooktop.xml index ea94653008d25a..233c72ed37590a 100644 --- a/data_model/device_types/Cooktop.xml +++ b/data_model/device_types/Cooktop.xml @@ -71,6 +71,9 @@ Davis, CA 95616, USA + + + diff --git a/data_model/device_types/DimmableLight.xml b/data_model/device_types/DimmableLight.xml index 777cf64847884b..ce5dce7c8bf192 100644 --- a/data_model/device_types/DimmableLight.xml +++ b/data_model/device_types/DimmableLight.xml @@ -1,59 +1,59 @@ - @@ -76,32 +76,6 @@ Davis, CA 95616, USA - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -113,10 +87,10 @@ Davis, CA 95616, USA - + - + @@ -132,6 +106,14 @@ Davis, CA 95616, USA + + + + + + + + @@ -142,4 +124,4 @@ Davis, CA 95616, USA - + \ No newline at end of file diff --git a/data_model/device_types/DimmablePlug-InUnit.xml b/data_model/device_types/DimmablePlug-InUnit.xml index 9a304fe9d18460..0756ed62baf9c0 100644 --- a/data_model/device_types/DimmablePlug-InUnit.xml +++ b/data_model/device_types/DimmablePlug-InUnit.xml @@ -1,59 +1,59 @@ - @@ -76,32 +76,6 @@ Davis, CA 95616, USA - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -132,6 +106,14 @@ Davis, CA 95616, USA + + + + + + + + @@ -142,4 +124,4 @@ Davis, CA 95616, USA - + \ No newline at end of file diff --git a/data_model/device_types/DimmerSwitch.xml b/data_model/device_types/DimmerSwitch.xml index 9922d6fb96dbcf..8be246f3a16056 100644 --- a/data_model/device_types/DimmerSwitch.xml +++ b/data_model/device_types/DimmerSwitch.xml @@ -1,59 +1,59 @@ - @@ -73,17 +73,14 @@ Davis, CA 95616, USA - - - - - - + + + - + \ No newline at end of file diff --git a/data_model/device_types/DoorLock.xml b/data_model/device_types/DoorLock.xml index c5eaf911f8f537..b7a0beaa3946e6 100644 --- a/data_model/device_types/DoorLock.xml +++ b/data_model/device_types/DoorLock.xml @@ -1,59 +1,59 @@ - @@ -68,17 +68,7 @@ Davis, CA 95616, USA - - - - - - - - - - - + @@ -95,6 +85,9 @@ Davis, CA 95616, USA + + + @@ -187,4 +180,4 @@ Davis, CA 95616, USA - + \ No newline at end of file diff --git a/data_model/device_types/DoorLockController.xml b/data_model/device_types/DoorLockController.xml index 6e515bc206e04a..a41cdad0e1bf5a 100644 --- a/data_model/device_types/DoorLockController.xml +++ b/data_model/device_types/DoorLockController.xml @@ -1,59 +1,59 @@ - @@ -74,17 +74,7 @@ Davis, CA 95616, USA - - - - - - - - - - - + @@ -92,8 +82,11 @@ Davis, CA 95616, USA + + + - + \ No newline at end of file diff --git a/data_model/device_types/EVSE.xml b/data_model/device_types/EVSE.xml index b5e57c83aa3ac1..42636733090c9c 100644 --- a/data_model/device_types/EVSE.xml +++ b/data_model/device_types/EVSE.xml @@ -55,16 +55,13 @@ Connectivity Standards Alliance + 508 Second Street, Suite 206 + Davis, CA 95616, USA --> - + - - - @@ -99,6 +96,9 @@ Davis, CA 95616, USA + + + diff --git a/data_model/device_types/ExtendedColorLight.xml b/data_model/device_types/ExtendedColorLight.xml index 839a9c1db7a75b..a0337009f660eb 100644 --- a/data_model/device_types/ExtendedColorLight.xml +++ b/data_model/device_types/ExtendedColorLight.xml @@ -1,59 +1,59 @@ - @@ -76,32 +76,6 @@ Davis, CA 95616, USA - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -132,6 +106,14 @@ Davis, CA 95616, USA + + + + + + + + @@ -167,4 +149,4 @@ Davis, CA 95616, USA - + \ No newline at end of file diff --git a/data_model/device_types/ExtractorHood.xml b/data_model/device_types/ExtractorHood.xml index 9f86280510fedc..6606b377f47a39 100644 --- a/data_model/device_types/ExtractorHood.xml +++ b/data_model/device_types/ExtractorHood.xml @@ -80,7 +80,7 @@ Davis, CA 95616, USA - + diff --git a/data_model/device_types/HeatingCoolingUnit.xml b/data_model/device_types/HeatingCoolingUnit.xml index 3bcf0b8e2db0d1..39fbb766111b31 100644 --- a/data_model/device_types/HeatingCoolingUnit.xml +++ b/data_model/device_types/HeatingCoolingUnit.xml @@ -1,59 +1,59 @@ - @@ -70,18 +70,15 @@ Davis, CA 95616, USA - - - - - - + + + @@ -92,4 +89,4 @@ Davis, CA 95616, USA - + \ No newline at end of file diff --git a/data_model/device_types/MicrowaveOven.xml b/data_model/device_types/MicrowaveOven.xml index 933e1f896da484..3ae1fd8d5bf22d 100644 --- a/data_model/device_types/MicrowaveOven.xml +++ b/data_model/device_types/MicrowaveOven.xml @@ -85,7 +85,7 @@ Davis, CA 95616, USA - + diff --git a/data_model/device_types/NetworkInfraIntro-CommonRequirements.xml b/data_model/device_types/NetworkInfraIntro-CommonRequirements.xml new file mode 100644 index 00000000000000..454dc857f0b8db --- /dev/null +++ b/data_model/device_types/NetworkInfraIntro-CommonRequirements.xml @@ -0,0 +1,58 @@ + + + \ No newline at end of file diff --git a/data_model/device_types/NetworkInfraIntro-Introduction.xml b/data_model/device_types/NetworkInfraIntro-Introduction.xml new file mode 100644 index 00000000000000..e5bc56b1f095ac --- /dev/null +++ b/data_model/device_types/NetworkInfraIntro-Introduction.xml @@ -0,0 +1,58 @@ + + + \ No newline at end of file diff --git a/data_model/device_types/OccupancySensor.xml b/data_model/device_types/OccupancySensor.xml index bef470cc1c9ec6..1ac4e0ab937830 100644 --- a/data_model/device_types/OccupancySensor.xml +++ b/data_model/device_types/OccupancySensor.xml @@ -55,12 +55,13 @@ Connectivity Standards Alliance 508 Second Street, Suite 206 Davis, CA 95616, USA --> - + + @@ -68,10 +69,8 @@ Davis, CA 95616, USA - - - - + + diff --git a/data_model/device_types/OnOffLight.xml b/data_model/device_types/OnOffLight.xml index 6b12217ff10d6f..ea520612b9dc42 100644 --- a/data_model/device_types/OnOffLight.xml +++ b/data_model/device_types/OnOffLight.xml @@ -1,59 +1,59 @@ - @@ -76,32 +76,6 @@ Davis, CA 95616, USA - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -132,6 +106,14 @@ Davis, CA 95616, USA + + + + + + + + @@ -142,4 +124,4 @@ Davis, CA 95616, USA - + \ No newline at end of file diff --git a/data_model/device_types/OnOffLightSwitch.xml b/data_model/device_types/OnOffLightSwitch.xml index df64178ade52ad..eb2c3ff938060a 100644 --- a/data_model/device_types/OnOffLightSwitch.xml +++ b/data_model/device_types/OnOffLightSwitch.xml @@ -1,59 +1,59 @@ - @@ -73,14 +73,11 @@ Davis, CA 95616, USA - - - - - - + + + - + \ No newline at end of file diff --git a/data_model/device_types/OnOffPlug-inUnit.xml b/data_model/device_types/OnOffPlug-inUnit.xml index 83f1c9d0ec15ec..d63e3b22e81aae 100644 --- a/data_model/device_types/OnOffPlug-inUnit.xml +++ b/data_model/device_types/OnOffPlug-inUnit.xml @@ -1,59 +1,59 @@ - @@ -76,32 +76,6 @@ Davis, CA 95616, USA - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -132,6 +106,14 @@ Davis, CA 95616, USA + + + + + + + + @@ -142,4 +124,4 @@ Davis, CA 95616, USA - + \ No newline at end of file diff --git a/data_model/device_types/OnOffSensor.xml b/data_model/device_types/OnOffSensor.xml index d28f76f6130964..904b5f6da74c7c 100644 --- a/data_model/device_types/OnOffSensor.xml +++ b/data_model/device_types/OnOffSensor.xml @@ -1,59 +1,59 @@ - @@ -74,20 +74,17 @@ required."/> - - - - - - + + + - + \ No newline at end of file diff --git a/data_model/device_types/Pump.xml b/data_model/device_types/Pump.xml index 298bb43cbb02c6..4662ce0945b06d 100644 --- a/data_model/device_types/Pump.xml +++ b/data_model/device_types/Pump.xml @@ -1,59 +1,59 @@ - @@ -70,18 +70,15 @@ Davis, CA 95616, USA - - - - - - + + + @@ -107,4 +104,4 @@ Davis, CA 95616, USA - + \ No newline at end of file diff --git a/data_model/device_types/PumpController.xml b/data_model/device_types/PumpController.xml index 223915f4525b40..274eefb764de41 100644 --- a/data_model/device_types/PumpController.xml +++ b/data_model/device_types/PumpController.xml @@ -1,59 +1,59 @@ - @@ -72,12 +72,6 @@ Davis, CA 95616, USA - - - - - - @@ -87,6 +81,9 @@ Davis, CA 95616, USA + + + @@ -100,4 +97,4 @@ Davis, CA 95616, USA - + \ No newline at end of file diff --git a/data_model/device_types/RoboticVacuumCleaner.xml b/data_model/device_types/RoboticVacuumCleaner.xml index 4e02b17d772606..2657a560109829 100644 --- a/data_model/device_types/RoboticVacuumCleaner.xml +++ b/data_model/device_types/RoboticVacuumCleaner.xml @@ -58,7 +58,7 @@ Davis, CA 95616, USA - + @@ -68,40 +68,12 @@ Davis, CA 95616, USA - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/data_model/device_types/RoomAirConditioner.xml b/data_model/device_types/RoomAirConditioner.xml index 8e6a833406637c..888ec8a448a501 100644 --- a/data_model/device_types/RoomAirConditioner.xml +++ b/data_model/device_types/RoomAirConditioner.xml @@ -1,59 +1,59 @@ - @@ -68,12 +68,6 @@ Davis, CA 95616, USA - - - - - - @@ -82,6 +76,9 @@ Davis, CA 95616, USA + + + @@ -95,4 +92,4 @@ Davis, CA 95616, USA - + \ No newline at end of file diff --git a/data_model/device_types/RootNodeDeviceType.xml b/data_model/device_types/RootNodeDeviceType.xml index e1a9276a97fbd8..1696791ab8a2b3 100644 --- a/data_model/device_types/RootNodeDeviceType.xml +++ b/data_model/device_types/RootNodeDeviceType.xml @@ -137,13 +137,6 @@ Davis, CA 95616, USA - - - - - - - diff --git a/data_model/device_types/Thermostat.xml b/data_model/device_types/Thermostat.xml index dac8172278b4ad..8676fe965ef280 100644 --- a/data_model/device_types/Thermostat.xml +++ b/data_model/device_types/Thermostat.xml @@ -1,59 +1,59 @@ - @@ -72,12 +72,6 @@ Davis, CA 95616, USA - - - - - - @@ -100,40 +94,14 @@ Davis, CA 95616, USA + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -154,4 +122,4 @@ Davis, CA 95616, USA - + \ No newline at end of file diff --git a/data_model/device_types/WaterHeater.xml b/data_model/device_types/WaterHeater.xml index 2f2f7fae235e1b..7b06da2add9de3 100644 --- a/data_model/device_types/WaterHeater.xml +++ b/data_model/device_types/WaterHeater.xml @@ -55,16 +55,13 @@ Connectivity Standards Alliance + 508 Second Street, Suite 206 + Davis, CA 95616, USA --> - + - - - @@ -82,6 +79,9 @@ Davis, CA 95616, USA + + + diff --git a/data_model/device_types/WaterValve.xml b/data_model/device_types/WaterValve.xml index 59a065243923f2..5c65f4565f6746 100644 --- a/data_model/device_types/WaterValve.xml +++ b/data_model/device_types/WaterValve.xml @@ -68,5 +68,11 @@ Davis, CA 95616, USA + + + + + + \ No newline at end of file diff --git a/data_model/device_types/WindowCovering.xml b/data_model/device_types/WindowCovering.xml index 1f9e4a3a8ec319..1a56bbd753f63a 100644 --- a/data_model/device_types/WindowCovering.xml +++ b/data_model/device_types/WindowCovering.xml @@ -1,59 +1,59 @@ - @@ -77,7 +77,6 @@ Davis, CA 95616, USA - @@ -121,4 +120,4 @@ Davis, CA 95616, USA - + \ No newline at end of file diff --git a/data_model/device_types/WindowCoveringController.xml b/data_model/device_types/WindowCoveringController.xml index 8e31eed548e90e..5bae9d81103247 100644 --- a/data_model/device_types/WindowCoveringController.xml +++ b/data_model/device_types/WindowCoveringController.xml @@ -1,59 +1,59 @@ - @@ -80,7 +80,6 @@ Davis, CA 95616, USA - @@ -98,4 +97,4 @@ Davis, CA 95616, USA - + \ No newline at end of file diff --git a/data_model/spec_sha b/data_model/spec_sha index 6ef2b40b40b6be..9c275037d5b895 100644 --- a/data_model/spec_sha +++ b/data_model/spec_sha @@ -1 +1 @@ -1736656c4cb1b4f752dcd5b4c8b924b142ff29d4 +7e16e82e5264105bdc61d6bc8fe18095959b8292 diff --git a/docs/ERROR_CODES.md b/docs/ERROR_CODES.md index 35dcd05d5bff07..8cd4a4c80940e3 100644 --- a/docs/ERROR_CODES.md +++ b/docs/ERROR_CODES.md @@ -44,6 +44,7 @@ This file was **AUTOMATICALLY** generated by | 26 | 0x1A | `CHIP_ERROR_DUPLICATE_KEY_ID` | | 27 | 0x1B | `CHIP_ERROR_WRONG_KEY_TYPE` | | 28 | 0x1C | `CHIP_ERROR_UNINITIALIZED` | +| 29 | 0x1D | `CHIP_ERROR_INVALID_IPK` | | 30 | 0x1E | `CHIP_ERROR_INVALID_STRING_LENGTH` | | 31 | 0x1F | `CHIP_ERROR_INVALID_LIST_LENGTH` | | 33 | 0x21 | `CHIP_ERROR_END_OF_TLV` | diff --git a/docs/cluster_and_device_type_dev/cluster_and_device_type_dev.md b/docs/cluster_and_device_type_dev/cluster_and_device_type_dev.md new file mode 100644 index 00000000000000..9e34e961ae6d87 --- /dev/null +++ b/docs/cluster_and_device_type_dev/cluster_and_device_type_dev.md @@ -0,0 +1,251 @@ +# New Clusters & Device Types + +The goal of new cluster and device type development is to + +1. write the cluster implementations +2. write the code and supporting material that will allow zap to generate the + appropriate ember layers +3. write the unit tests, test plans and automation scripts that prove the code + correctness and allow these new features to be certified + +Unit tests, test plans and certification tests are covered in the testing +section. This document will concentrate on implementing clusters and device +types in the SDK. + +- Cluster Definition + - XML + - Describes the structures, enums, attributes, commands, events etc. + - Direct translation of the spec into code + - src/app/zap-templates/zcl/data-model/chip/ +- Cluster Implementation + + - Client side - codegen, you write the glue + - Server side - cpp implementation through Ember and / or + AttributeAccessInterface & CommandHandlerInterface + - src/app/clusters/ + - build file: src/app/chip_data_model.gni + - build file uses data from the codegen to auto-populate the cluster + list. + - Follow examples in there to get your code building into the image + when selected in zap + +- Device Type Definitions + - XML defines conformance + - src/app/zap-templates/zcl/data-model/chip/matter-devices.xml + +The following wiki page has a detailed description of how and where to add +cluster and device type definitions so they are picked up properly by ZAP/ember +and the SDK. + +[https://groups.csa-iot.org/wg/matter-tsg/wiki/howto-add-a-new-device-type](https://groups.csa-iot.org/wg/matter-tsg/wiki/howto-add-a-new-device-type) + +Note that the output should also be verified against the spec using the +[.matter parser tools](https://project-chip.github.io/connectedhomeip-doc/guides/matter_idl_tooling.html). + +## ZAP, Ember and Overrides + +- Goal: get zap to understand the new cluster so it can be used on devices + (XML and glue) + +![](../getting_started/img/zap_compiler.png) + +### Cluster definitions and ZAP + +Please see [ZAP](../getting_started/zap.md) for an introduction to ZAP. + +After implementing the changes outlined in the wiki article, your cluster and +device type should show up in zap. you can check this by running zaptool with +any zap file. + +./scripts/tools/zap/run_zaptool.sh + +To ensure the cluster and device type are correctly implemented for ZAP, open +the endpoint configuration and ensure the device type appears in the device type +list. + +![](../getting_started/img/zap3.png) + +Next, check your cluster. The "domain" parameter in the XML controls which group +the cluster is in. It should have all the expected attributes, commands and +events. + +![](../getting_started/img/zap4.png) + +Last, ensure that your attributes have the storage option set appropriately. + +![](../getting_started/img/zap5.png) + +### Cluster implementation - Ember and overrides + +- Ember: layer used to setup/access the endpoints / attributes / commands etc. + on the device + + - The build generates the Ember function signatures and defaults + - The Cluster server code implements callbacks for initialization, + commands, attribute access and event generation + - Interaction Model layer will call ember functions when it receives + incoming interactions for your cluster + +- Overrides + - Ember layer is _generated_ at compile time whereas overrides are + _installed_ at run time + - Overrides are called before the ember layer for attribute access or + command handling + - AttributeAccessInterface & CommandHandlerInterface + - Allow significantly more control, but are more complex + - **UNIT TESTABLE** + - Both allow fall through to the ember layer (if setup in zap) + +#### Cluster Server Initialization + +The following diagram shows the flow of messages coming into the Matter core and +ending in the cluster initialization code. + +![](img/cluster_initialization.png) + +EmberAfInitializeAttributes - ember attribute storage - for all attributes +marked as “RAM” in the zap, sets defaults in the storage +MatterPluginServerCallback - .h is a generated file, .cpp impl is done +in the server cluster code. Use this to setup the cluster and do attribute +overrides registerAttributeAccessOverride - use this if you want to handle +attribute reads and writes externally + +Blue sections can be overridden. + +#### Cluster Server Attributes + +**Two mechanisms** + +- Ember layer +- Override + +**ZAP files and implementation** + +- For attributes marked as **“RAM”** storage in the zap file + - Storage allocated automatically, Ember handles read/write + - Generated “Get” and “Set” functions for each attribute in Accessors.h + (generated file) + - You _CAN_ register an override on the cluster. If you don’t try to + encode the attribute in the override, it will fall through to the + storage. + - If you _DO_ always encode the attribute in the access override + function, you’re wasting space. +- For attributes marked as **“External”** storage in the zap file + - NO storage is allocated, no fall through to ember storage + - NEED to register an access override for these to work + +##### Cluster Server Attributes via Override (read) + +![](img/cluster_attribute_read.png) + +[AttributeAccessInterface::Read()](https://github.com/project-chip/connectedhomeip/blob/master/src/app/AttributeAccessInterface.h#L424) + +``` +CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, + AttributeValueEncoder & aEncoder) +{ + // Parse aPath to determine the requested attribute + switch (aPath.mAttributeId) + { + case SomeAttribute::Id: + // Just encode the value + aEncoder.Encode(mSomeValue); + break; + } + // Beware of lists - the need to use EncodeList to have + // chunking handled properly + return CHIP_NO_ERROR; +``` + +#### Cluster Server Attributes via override (write) + +Write are handled using the same path as read, but land in the “Write” function +of the AttributeAccessInterface. + +[AttributeAccessInterface::Write()](https://github.com/project-chip/connectedhomeip/blob/master/src/app/AttributeAccessInterface.h#444) + +The attribute handler is responsible for constraint checking and Attribute +persistence + +##### Attribute Persistence + +- When using AttributeAccessInterface, you need to manage any Attributes that + require Persistence. +- This can be done by using GetSafeAttributePersistenceProvider() +- This provides a useful API for Reading & Writing values of any type to the + default Persistence Store + - [src/app/SafeAttributePersistenceProvider.h](https://github.com/project-chip/connectedhomeip/blob/master/src/app/SafeAttributePersistenceProvider.h) + +#### Ember layer read / write + +In the ember layer functions, the ember layer handles the encode and decode. +This can work for simple attributes, but is can be challenging for complex +attribute interactions. The ember layer is also VERY difficult to unit test. + +The ember layer provides callbacks for attribute changes so you can handle them + +``` +void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & attributePath, + uint8_t type, uint16_t size, uint8_t * value) + +``` + +Take care when using this that the callbacks are implemented in a way that can +be used across examples + +#### Cluster Server Commands + +- As with Attributes, there is an ember layer option, and an override option +- **Override** + - Registered at runtime + - InteractionModelEngine::RegisterCommandHandler + - Implement CommandHandlerInterface +- **Ember** + - static + - emberAfCallback + +![](img/cluster_commands.png) + +##### Command Handler Code + +- CommandHandlerInterface + - Can use HandleCommand function for convenience (sets handled) + - If not, need to set whether the command was handled + - if no, falls through to ember by default + - If entirely handled by this interface, add to + src/app/common/templates/config-data.yaml to disable ember +- Ember interface + - Return true if the command was handled, false to have an invalid command + response returned +- For both + - Need to handle the return to the caller using either AddResponse or + AddStatus in the command handler + - Need to handle constraints checking and return the appropriate status or + response per the spec + +The +[config-data.yaml](https://github.com/project-chip/connectedhomeip/blob/master/src/app/common/templates/config-data.yaml) +file is used to turn off ember command callback generation for clusters with +pure CommandHandlerInterface implementations. + +#### Events and Attribute Subscriptions + +- **Attribute** change reporting + - If you go through the ember storage layer (generated Get/Set functions + on the attribute), this is handled for you + - If you are using an AttributeAccessInterface, you need to tell the + reporting engine that the attribute has changed + - **MatterReportingAttributeChangeCallback** +- **Events** + - No direct ember support + - Call LogEvent function in EventLogging.h + +#### A note on Dynamic Endpoints + +- Dynamic endpoint registration + - ZAP configs are static at compile time + - Can also use dynamic endpoint registration at runtime + - common for bridges + - **emberAfSetDynamicEndpoint** + - If you have your own storage for attributes etc, need to account for + dynamic endpoints as well as static diff --git a/docs/cluster_and_device_type_dev/img/cluster_attribute_read.png b/docs/cluster_and_device_type_dev/img/cluster_attribute_read.png new file mode 100644 index 00000000000000..5f073aca8067a6 Binary files /dev/null and b/docs/cluster_and_device_type_dev/img/cluster_attribute_read.png differ diff --git a/docs/cluster_and_device_type_dev/img/cluster_commands.png b/docs/cluster_and_device_type_dev/img/cluster_commands.png new file mode 100644 index 00000000000000..959774e071b717 Binary files /dev/null and b/docs/cluster_and_device_type_dev/img/cluster_commands.png differ diff --git a/docs/cluster_and_device_type_dev/img/cluster_initialization.png b/docs/cluster_and_device_type_dev/img/cluster_initialization.png new file mode 100644 index 00000000000000..9cf980e3f727fb Binary files /dev/null and b/docs/cluster_and_device_type_dev/img/cluster_initialization.png differ diff --git a/docs/cluster_and_device_type_dev/index.md b/docs/cluster_and_device_type_dev/index.md new file mode 100644 index 00000000000000..6d5cf71edfef1c --- /dev/null +++ b/docs/cluster_and_device_type_dev/index.md @@ -0,0 +1,15 @@ +# Cluster and Device Type development + +The following docs present a guide on how to develop new clusters and device +types in the SDK. + +```{toctree} +:glob: +:maxdepth: 1 +:hidden: + +* + +``` + +- [Cluster and device type development](./cluster_and_device_type_dev.md) diff --git a/docs/clusters.md b/docs/clusters.md index 70f657fd8779ad..510dce18b0d3e6 100644 --- a/docs/clusters.md +++ b/docs/clusters.md @@ -82,6 +82,8 @@ Generally regenerate using one of: | 152 | 0x98 | DeviceEnergyManagement | | 153 | 0x99 | EnergyEvse | | 155 | 0x9B | EnergyPreference | +| 157 | 0x9D | EnergyEvseMode | +| 159 | 0x9F | DeviceEnergyManagementMode | | 257 | 0x101 | DoorLock | | 258 | 0x102 | WindowCovering | | 259 | 0x103 | BarrierControl | diff --git a/docs/getting_started/SDKBasics.md b/docs/getting_started/SDKBasics.md new file mode 100644 index 00000000000000..fee03ae7cd484d --- /dev/null +++ b/docs/getting_started/SDKBasics.md @@ -0,0 +1,99 @@ +# SDK Basics + +## Getting Started + +- SDK Location: + [https://github\.com/project\-chip/connectedhomeip](https://github.com/project-chip/connectedhomeip)\_ +- email _[help@csa\-iot\.org](mailto:help@csa-iot.org)_ to get access to the + other repos and to be added to project\-chip org + +## Basic SDK Architecture + +![](img/SDK_layers.png) + +### Platform Layer + +Platform layer implements the connection to the network stack and the base OS. +Messages flow off the wire into the platform layer, where they are routed into +the platform API for processing by the Matter stack. + +### Platform API + +The platform API defines a common layer to interact with the core. + +### Core + +Core encompasses a huge part of the spec, including all of the the underlying +communication protocols. The goal of the core code is to deliver valid messages +to the ember layer indicating the cluster request and associated endpoint +information. + +### Ember + +The ember layer is a generated layer that implements the composition of ONE +SPECIFIC device. It looks at each message and determines if the device has +implemented the selected attribute or command on the cluster on the selected +endpoint, and then blocks or routes accordingly, based on the implementation and +the access control. + +Valid requests are forwarded on to the cluster implementations to handle and +invalid requests get sent back with an error. Ember layer is the piece that +makes your device your device. Most are generated statically using zap. + +### Cluster implementations + +The cluster implementations are the logic that back the cluster. The cluster +implementation code receives messages from the ember layer to request data model +operations on the cluster (reads / writes / command invokes). They are also +responsible for event generation and attribute change reporting. Simple cluster +logic can be written in the ember callback functions, but more complex cluster +logic is handled in the run-time installed interface layers. + +## SDK Organization (some key bits) + +- docs + - [docs/guides/BUILDING\.md](https://github.com/project-chip/connectedhomeip/blob/master/docs/guides/BUILDING.md) - + follow this first + - [docs/guides/chip_tool_guide.md](https://github.com/project-chip/connectedhomeip/blob/master/docs/guides/chip_tool_guide.md) +- examples + - [examples/chip-tool](https://github.com/project-chip/connectedhomeip/blob/master/examples/chip-tool) - + main controller example + - [examples/all-clusters-app](https://github.com/project-chip/connectedhomeip/blob/master/examples/all-cluster-app) - + QA app + - [examples/\](https://github.com/project-chip/connectedhomeip/blob/master/examples) - + Specific Device examples +- scripts + - [bootstrap.sh](https://github.com/project-chip/connectedhomeip/blob/master/scripts/bootstrap.sh) + & + [activate.sh](https://github.com/project-chip/connectedhomeip/blob/master/scripts/activate.sh) - + environment setup + - [build/build_examples.py](https://github.com/project-chip/connectedhomeip/blob/master/scripts/build/build_examples.py) - + build example code + - [tools/zap/run_zaptool.sh](https://github.com/project-chip/connectedhomeip/blob/master/scripts/tools/zap/run_zaptool.sh) - + start zap tool + - [tools/zap_regen_all.py](https://github.com/project-chip/connectedhomeip/blob/master/scripts/tools/zap_regen_all.py) - + .zap -> .matter +- src + - [controller](https://github.com/project-chip/connectedhomeip/blob/master/src/controller/) - + client side code including python implementation + - [app](https://github.com/project-chip/connectedhomeip/blob/master/src/app) - + base server side code + - [app/clusters](https://github.com/project-chip/connectedhomeip/blob/master/src/app/clusters) - + cluster implementations (.cpp) + - [app/zap-templates/zcl/data-model/chip/](https://github.com/project-chip/connectedhomeip/blob/master/src/app/zap-templates/zcl/data-model/chip/) - + cluster definitions (.xml) + - [app/tests/suites/certification](https://github.com/project-chip/connectedhomeip/blob/master/src/app/tests/suites/certification) - + yaml cert test automation scripts + - [lib/support/](https://github.com/project-chip/connectedhomeip/blob/master/src/lib/support/) - + Embedded versions of common utilities + - [platform](https://github.com/project-chip/connectedhomeip/blob/master/src/platform) - + platform delegate APIs / implementations + - [include/platform](https://github.com/project-chip/connectedhomeip/blob/master/src/include/platform) - + platform delegate APIs / implementations + - [python_testing](https://github.com/project-chip/connectedhomeip/blob/master/src/python_testing) - + python cert test automation scripts +- zzz_generated/app-common/app-common/zap-generated/\* + - all the generated cluster logic / namespaces +- data_model + - These files are generated and are used to check conformance against the + spec. They should not be manually changed. diff --git a/docs/getting_started/discovery_from_a_host_computer.md b/docs/getting_started/discovery_from_a_host_computer.md new file mode 100644 index 00000000000000..5b02524460ff80 --- /dev/null +++ b/docs/getting_started/discovery_from_a_host_computer.md @@ -0,0 +1,14 @@ +# Device discovery from a Host computer (mDNS Scanning) + +Device discovery for commissioning over the operational network happens over +DNS-SD. DNS-SD is handled over mDNS on WiFi and using an SRP server on a boarder +router for thread. On a computer, you can use the built-in mDNS applications to +discover devices for the purposes of testing. Avahi is the standard mDNS program +for linux, dns-sd is used on macs. + +- Scanning for commissionable devices + - avahi-browse -d local \_matterc.\_udp --resolve + - dns-sd -B \_matterc.\_udp +- Scanning for commissioned devices + - avahi-browse -d local \_matter.\_tcp --resolve + - dns-sd -B \_matter.\_tcp diff --git a/docs/getting_started/img/SDK_layers.png b/docs/getting_started/img/SDK_layers.png new file mode 100644 index 00000000000000..84ecda72153507 Binary files /dev/null and b/docs/getting_started/img/SDK_layers.png differ diff --git a/docs/getting_started/img/ci_raw_logs.png b/docs/getting_started/img/ci_raw_logs.png new file mode 100644 index 00000000000000..84465ab7d19592 Binary files /dev/null and b/docs/getting_started/img/ci_raw_logs.png differ diff --git a/docs/getting_started/img/zap1.png b/docs/getting_started/img/zap1.png new file mode 100644 index 00000000000000..4356cda98e85e5 Binary files /dev/null and b/docs/getting_started/img/zap1.png differ diff --git a/docs/getting_started/img/zap2.png b/docs/getting_started/img/zap2.png new file mode 100644 index 00000000000000..cd73e0417c25ad Binary files /dev/null and b/docs/getting_started/img/zap2.png differ diff --git a/docs/getting_started/img/zap3.png b/docs/getting_started/img/zap3.png new file mode 100644 index 00000000000000..018778c7dceeb4 Binary files /dev/null and b/docs/getting_started/img/zap3.png differ diff --git a/docs/getting_started/img/zap4.png b/docs/getting_started/img/zap4.png new file mode 100644 index 00000000000000..92ab5cce5186b4 Binary files /dev/null and b/docs/getting_started/img/zap4.png differ diff --git a/docs/getting_started/img/zap5.png b/docs/getting_started/img/zap5.png new file mode 100644 index 00000000000000..5ca6908144704b Binary files /dev/null and b/docs/getting_started/img/zap5.png differ diff --git a/docs/getting_started/img/zap6.png b/docs/getting_started/img/zap6.png new file mode 100644 index 00000000000000..0901e225fbff46 Binary files /dev/null and b/docs/getting_started/img/zap6.png differ diff --git a/docs/getting_started/img/zap_compiler.png b/docs/getting_started/img/zap_compiler.png new file mode 100644 index 00000000000000..68c1e09395a069 Binary files /dev/null and b/docs/getting_started/img/zap_compiler.png differ diff --git a/docs/getting_started/index.md b/docs/getting_started/index.md new file mode 100644 index 00000000000000..b961701cc98bc8 --- /dev/null +++ b/docs/getting_started/index.md @@ -0,0 +1,16 @@ +# Getting Started + +The following docs are a brief introduction to SDK development. + +```{toctree} +:glob: +:maxdepth: 1 +:hidden: + +* + +``` + +- [SDK Basics](./SDKBasics.md) +- [ZAP](./zap.md) +- [Discover from a host computer](./discovery_from_a_host_computer.md) diff --git a/docs/getting_started/zap.md b/docs/getting_started/zap.md new file mode 100644 index 00000000000000..0177aa8ba4f3a7 --- /dev/null +++ b/docs/getting_started/zap.md @@ -0,0 +1,92 @@ +# ZAP + +The ZAP tool is a GUI tool that is used to generate a .zap file that describes +the endpoint composition of a device. This includes the endpoints on the device, +the clusters and device types on each endpoint, as well as the cluster features, +attributes, commands and events. The .zap file is used by the ZAP compiler along +with the cluster definitions files to generate an ember layer. This happens +automatically as part of the build process, and the ember layer is compiled into +the firmware. + +.matter files are a human-readable version of the .zap that can be used for +review + +![](img/zap_compiler.png) + +## A quick tour + +Run ./scripts/tools/zap/run_zaptool.sh \ to open a file in zap. +Select the Matter format. + +The left hand side shows the endpoint configuration. + +![](img/zap1.png) + +Select the edit button (pencil) on an endpoint to edit it. + +![](img/zap2.png) + +This will open a dialog where you can edit the device types and revisions of +your endpoint. Do not edit the profile ID or network. The profile ID identifies +the zap endpoint as being a matter endpoint, network is a property that only +applies to zigbee products. + +![](img/zap3.png) + +To edit the clusters on an endpoint, select the endpoint. To enable a cluster on +an endpoint, set the "enable" drop down to "server" and click the gear to edit +the cluster + +![](img/zap4.png) + +### Cluster setup + +#### Attributes + +The zap file will list all the available attributes in the cluster. The column +settings are as follows: + +- Enabled - turn this on to enable the attribute on the device. +- Attribute ID - Attribute ID of the attribute from the spec +- Attribute - Attribute name from the spec +- Required - This is set to yes if the attribute is mandatory. Note that some + attributes become mandatory when features or other attributes are enabled. + This will NOT be reflected in the UI. It is up to the device manufacture to + ensure the device is conformant with the specification. Conformance can be + checked using the conformance checker test + [TC_DeviceConformance.py](https://github.com/project-chip/connectedhomeip/blob/master/src/python_testing/TC_DeviceConformance.py) + +- Client/Server - For Matter, all attributes will be server +- Mfg code - applies only to manufacturer specific attributes +- Storage option - determines whether ember allocates storage for the + attribute. The correct value for this field is determined by the cluster + implementation. Clusters that use the ember layer directly will be RAM, + clusters that use the override layer and implement their own storage are + external. Files in the Matter SDK will set these values as appropriate based + on the the cluster implementations and as described in the Matter zap config + document. It is best to leave these values as-is unless you have a specific + reason to override them. + +[//]: + # + "NOTE: Insert a link to the override specification documentation once that is up" + +- Type - type from the spec +- Default - this is different than the "default" set in the spec, and + represents the desired starting value for an attribute IF it is implemented + in the ember layer (RAM storage) + +![](img/zap5.png) + +#### Attribute Reporting + +This does not apply to Matter and is unused. + +#### Commands + +Check off the commands you wish to support. Response commands are required if +the corresponding Request command is supported. ![](img/zap6.png) + +#### Events + +This does not apply to Matter and is unused. diff --git a/docs/guides/esp32/setup_idf_chip.md b/docs/guides/esp32/setup_idf_chip.md index 900bfc170b5dea..5a6728c44d8417 100644 --- a/docs/guides/esp32/setup_idf_chip.md +++ b/docs/guides/esp32/setup_idf_chip.md @@ -13,25 +13,25 @@ step. ### Install Prerequisites -- [Linux](https://docs.espressif.com/projects/esp-idf/en/v5.1/esp32/get-started/linux-macos-setup.html#for-linux-users) -- [macOS](https://docs.espressif.com/projects/esp-idf/en/v5.1/esp32/get-started/linux-macos-setup.html#for-macos-users) +- [Linux](https://docs.espressif.com/projects/esp-idf/en/v5.1.2/esp32/get-started/linux-macos-setup.html#for-linux-users) +- [macOS](https://docs.espressif.com/projects/esp-idf/en/v5.1.2/esp32/get-started/linux-macos-setup.html#for-macos-users) -### Get IDF v5.1.1 +### Get IDF v5.1.2 -- Clone ESP-IDF [v5.1.1 - release](https://github.com/espressif/esp-idf/releases/tag/v5.1.1 +- Clone ESP-IDF [v5.1.2 + release](https://github.com/espressif/esp-idf/releases/tag/v5.1.2 ``` - git clone -b v5.1.1 --recursive --depth 1 --shallow-submodule https://github.com/espressif/esp-idf.git + git clone -b v5.1.2 --recursive --depth 1 --shallow-submodule https://github.com/espressif/esp-idf.git cd esp-idf ./install.sh ``` -- To update an existing esp-idf toolchain to v5.1.1: +- To update an existing esp-idf toolchain to v5.1.2: ``` cd path/to/esp-idf - git fetch --depth 1 origin v5.1.1 + git fetch --depth 1 origin v5.1.2 git reset --hard FETCH_HEAD git submodule update --depth 1 --recursive --init diff --git a/docs/guides/nxp_zephyr_ota_software_update.md b/docs/guides/nxp_zephyr_ota_software_update.md new file mode 100644 index 00000000000000..430e0bfd81e694 --- /dev/null +++ b/docs/guides/nxp_zephyr_ota_software_update.md @@ -0,0 +1,205 @@ +# Matter Over-The-Air Software Update with NXP using Zephyr example applications + +## Overview + +The OTA Requestor feature enables the device to be informed of, download and +apply a software update from an OTA Provider. + +This section explains how to perform an OTA Software Update with NXP platform +using NXP/Zephyr SDK. Throughout this guide, the all-clusters application is +used as an example. + +In general, the Over-The-Air Software Update process consists of the following +steps : + +- The OTA Requestor queries an update image from the OTA Provider which + responds according to its availability. +- The update image is received in blocks and stored in the external flash of + the device. +- Once the update image is fully downloaded, the bootloader is notified and + the device resets applying the update in test-mode. +- If the test is successful, the update is applied permanently. Otherwise, the + bootloader reverts back to the primary application, preventing any + downgrade. + +### Flash Memory Layout + +The Flash is divided into different regions as follow : + +- Bootloader : MCUBoot resides at the base of the flash. +- Primary application partition : The example application which would be run + by the bootloader (active application). +- Secondary application partition : Update image received with the OTA + (candidate application). + +The size reserved for each partition can be found in +`src/platform/nxp/zephyr/boards/board.overlay`. + +Notes : + +- When applicable, BLE/15.4/Wi-Fi firmware are embedded in the application + binary, ensuring compatibility between the application and the controllers. +- The sizes of the primary and secondary applications are provided as an + example. The size can be changed by overriding the partitions located at + `board.overlay`.(example: + `src/platform/nxp/zephyr/boards/rd_rw612_bga.overlay`) + +### MCUBoot Bootloader + +Current OTA solution is using MCUBoot Bootloader. MCUBoot is an open-source +secure bootloader used to apply the self-upgrade. For more details, please refer +to the +[MCUBoot documentation](https://github.com/mcu-tools/mcuboot/blob/main/docs/design.md). + +In our use case, the bootloader runs the application residing in the primary +partition. In order to run the OTA update image, the bootloader will swap the +content of the primary and the secondary partitions. This type of upgrade is +called swap-move and is the default upgrade configured by MCUBoot. + +## OTA Software Update process + +### Generating and flashing application image + +The all cluster app is able to demonstrate the usage of OTA. To have this OTA +support, prj_ota.conf configurations needs to be used. This can be done by +adding `-DEXTRA_CONF_FILE=prj_ota.conf` to the west build command. + +Current OTA implementation automates the following procedures: + +- Generation of MCUBOOT image (File generated: + `modules/connectedhomeip/build_mcuboot/zephyr/zephyr.bin`)\* +- Generation of Matter application image (File generated: + `zephyr/zephyr.bin`)\* +- Signature of the application image (File generated: + `zephyr/zephyr.signed.bin`)\* +- Generation of a single binary merging the signed application with the + MCUBoot Image (File generated: `zephyr/zephyr_full.bin`)\* + +> **Note**: \*All paths are relative to the output folder. + +The final binary to be used is `zephyr_full.bin`. + +The application image have the following format : + +- Header : contains general information about the image (version, size, + magic...) +- Code of the application : generated binary +- Trailer : contains metadata needed by the bootloader such as the image + signature, the upgrade type, the swap status... + +In the all-cluster-app example, the image is signed with the default private key +provided by MCUBoot(`/zephyrproject/bootloader/mcuboot/root-rsa-2048.pem`). +MCUBoot is built with its corresponding public key which would be used to verify +the integrity of the image. It is possible to generate a new pair of keys using +the following commands. This procedure should be done prior to building the +mcuboot application. + +- To generate the private key : + +``` +user@ubuntu: python3 imgtool.py keygen -k priv_key.pem -t rsa-2048 +``` + +- To extract the public key : + +``` +user@ubuntu: python3 imgtool.py getpub -k priv_key.pem +``` + +To use a different key than the default one, `CONFIG_BOOT_SIGNATURE_KEY_FILE` +and `CONFIG_MCUBOOT_SIGNATURE_KEY_FILE` needs to point to that same key. + +- `CONFIG_BOOT_SIGNATURE_KEY_FILE`: This is used for the MCUboot bootloader + image. The path to the key can be either absolute or relative. Relative + paths starts from the MCUBoot repository root. This option can be changed + in: `config/nxp/app/bootloader.conf` + +- `CONFIG_BOOT_SIGNATURE_KEY_FILE`: This is used for the application to be + loaded by the bootloader. The path can be either absolute or relative. + Relative paths starts from the west workspace location. This option can be + changed in the application .conf files. + +Refer to those two files for more information: + +- [MCUBoot Config used for the MCUBoot Image](https://github.com/zephyrproject-rtos/mcuboot/blob/main/boot/zephyr/Kconfig) +- [MCUBoot Config used for the application](https://github.com/zephyrproject-rtos/zephyr/blob/main/modules/Kconfig.mcuboot) + +JLink can be used to flash the mixed binary at the base address 0x8000000, using +the command : + +``` +J-Link > loadbin zephyr_full.bin 0x8000000 +``` + +The bootloader should then be able to jump directly to the start of the +application and run it. + +### Generating the OTA Update Image + +The same procedure can be followed from the +[Generating and flashing application image](#generating-and-flashing-application-image) +sub-section, replacing `CONFIG_CHIP_DEVICE_SOFTWARE_VERSION` with a number +greater than the initial one used on the active application (Candidate +application version number should be greater than the one used on the active +application). By default the value is set to 0, try resetting this option to 1 +to generate the OTA update Image. You can do this by adding +`-DCONFIG_CHIP_DEVICE_SOFTWARE_VERSION=1` to the west build command. + +The current implementation automates the following procedures: + +- Generation of the Image to be used for update (File generated: + `zephyr/zephyr.bin`)\* +- Signature of the Image (File generated: `zephyr/zephyr.signed.bin`)\* +- Conversion of the signed Image into the OTA format (.ota file) (File + generated: `zephyr/matter.ota`)\* + +> **Note**: \*All paths are relative to the output folder. + +The generated OTA file `matter.ota` can be used to perform the OTA Software +Update. The instructions below describes the procedure step-by-step. + +### Performing the OTA Software Update + +Setup example : + +- [Chip-tool](../../examples/chip-tool/README.md) application running on the + RPi. +- OTA Provider application built on the same RPi (as explained below). +- Board programmed with the example application (with the instructions above). + +Before starting the OTA process, the Linux OTA Provider application can be built +on the RPi (if not already present in the pre-installed apps) : + +``` +user@ubuntu:~/connectedhomeip$ : ./scripts/examples/gn_build_example.sh examples/ota-provider-app/linux out/ota-provider-app chip_config_network_layer_ble=false + +user@ubuntu:~/connectedhomeip$ : rm -rf /tmp/chip_* +user@ubuntu:~/connectedhomeip$ : ./out/ota-provider-app/chip-ota-provider-app -f matter.ota +``` + +The OTA Provider should first be provisioned with chip-tool by assigning it the +node id 1, and then granted the ACL entries : + +``` +user@ubuntu:~/connectedhomeip$ : ./out/chip-tool-app/chip-tool pairing onnetwork 1 20202021 +user@ubuntu:~/connectedhomeip$ : ./out/chip-tool-app/chip-tool accesscontrol write acl '[{"fabricIndex": 1, "privilege": 5, "authMode": 2, "subjects": [112233], "targets": null}, {"fabricIndex": 1, "privilege": 3, "authMode": 2, "subjects": null, "targets": null}]' 1 0 +``` + +The second step is to provision the device with the node id 2 using ble-wifi or +ble-thread commissioning. For example : + +``` +user@ubuntu:~/connectedhomeip$ : ./out/chip-tool-app/chip-tool pairing ble-wifi 2 WIFI_SSID WIFI_PASSWORD 20202021 3840 +``` + +Once commissioned, the OTA process can be initiated with the +"announce-ota-provider" command using chip-tool (the given numbers refer +respectively to [ProviderNodeId][vendorid] [AnnouncementReason][endpoint] +[node-id][endpoint-id]) : + +``` +user@ubuntu:~/connectedhomeip$ : ./out/chip-tool-app/chip-tool otasoftwareupdaterequestor announce-otaprovider 1 0 0 0 2 0 +``` + +When the full update image is downloaded and stored, the bootloader will be +notified and the device will reboot with the update image. diff --git a/docs/index.md b/docs/index.md index f6575ed88a5d7c..8447850784787f 100644 --- a/docs/index.md +++ b/docs/index.md @@ -11,9 +11,12 @@ VSCODE_DEVELOPMENT api/index ci-cd/index discussion/index +getting_started/index +cluster_and_device_type_dev/index guides/index style/index examples/index +testing/index tools/index BUG_REPORT code_generation diff --git a/docs/testing/ci_testing.md b/docs/testing/ci_testing.md new file mode 100644 index 00000000000000..7f974bb6f03604 --- /dev/null +++ b/docs/testing/ci_testing.md @@ -0,0 +1,6 @@ +# CI testing + +This file is a placeholder for information on how to run tests in the CI. + +NOTE: discuss in particular triggers direct to the device, test event triggers +and the CI pics. diff --git a/docs/testing/index.md b/docs/testing/index.md new file mode 100644 index 00000000000000..0b9bbf4c494a38 --- /dev/null +++ b/docs/testing/index.md @@ -0,0 +1,31 @@ +# Testing Guides + +The following guide provide an introduction to the testing mechanisms available +in the SDK. + +```{toctree} +:glob: +:maxdepth: 1 +:hidden: + +* +``` + +## Unit testing + +- [Unit tests](./unit_testing.md) + +## Integration and Certification tests + +- [Integration and Certification tests](./integration_tests.md) +- [YAML](./yaml.md) +- [Python testing framework](./python.md) +- [Enabling tests in the CI](./ci_testing.md) + +## PICS and PIXIT + +- [PICS and PIXIT](./pics_and_pixit.md) + +## Testing in the CI + +- [CI testing](./ci_testing.md) diff --git a/docs/testing/integration_tests.md b/docs/testing/integration_tests.md new file mode 100644 index 00000000000000..46a20ebb8ac090 --- /dev/null +++ b/docs/testing/integration_tests.md @@ -0,0 +1,46 @@ +# Integration and Certification Tests + +Integration tests use a server and a controller or controllers to test the +behavior of a device. Certification tests are all integration tests. For +certified products, the device under test (DUT) is tested against one of the SDK +controller implementations (either chip-tool or the python-based controller, +depending on the test type). For software component certification, the software +component is tested against a sample device built from the SDK. + +Certification tests require an accompanying certification test plan in order to +be used in the certification testing process. More information about test plans +can be found in the +[test plans repository](https://github.com/CHIP-Specifications/chip-test-plans/tree/master/docs). +Integration testing can also be used outside of the certification testing +program to test device behavior in the SDK. Certification tests are all run in +the [CI](./ci_testing). + +There are two main integration test types: + +- [YAML](./yaml.md) +- [Python framework](./python.md) + +YAML is a human-readable serialization language that uses structured tags to +define test steps. Tests are defined in YAML, and parsed and run through a +runner that is backed by the chip-tool controller. + +The Python framework tests are written in python and use the +[Mobly](https://github.com/google/mobly) test framework to execute tests. + +## Which test framework to use + +Both types of tests can be run through the Test Harness for certification +testing, locally for the purposes of development and in the CI for the SDK. The +appropriate test framework to use is whatever lets you automate your tests in a +way that is understandable, readable, and has the features you need + +- YAML + - pros: more readable, simpler to write, easy for ATLs to parse and + understand + - cons: conditionals are harder (not all supported), no branch control, + schema not well documented +- python + - pros: full programming language, full control API with support for core + (certs, commissioning, etc), less plumbing if you need to add features, + can use python libraries + - cons: more complex, can be harder to read diff --git a/docs/testing/pics_and_pixit.md b/docs/testing/pics_and_pixit.md new file mode 100644 index 00000000000000..ee8901c66fecab --- /dev/null +++ b/docs/testing/pics_and_pixit.md @@ -0,0 +1,10 @@ +# PICS and PIXITs + +Placeholder file for PICS and PIXIT info + +- PICS formats - XML vs. test harness +- PICS in CI +- PICS tool and how we practically use it in Matter +- PICS checker test +- PIXITs in tests and how to set them +- Why you should avoid using both of these things. diff --git a/docs/testing/python.md b/docs/testing/python.md new file mode 100644 index 00000000000000..3af81e2394fe85 --- /dev/null +++ b/docs/testing/python.md @@ -0,0 +1,6 @@ +# Python framework tests + +This file is a placeholder for python framework test information. + +NOTE: be sure to include information about how you need to commission with the +python controller, not chip-tool and how to do that in the scripts diff --git a/docs/testing/unit_testing.md b/docs/testing/unit_testing.md new file mode 100644 index 00000000000000..e62940f15a9c7c --- /dev/null +++ b/docs/testing/unit_testing.md @@ -0,0 +1,3 @@ +# Unit testing + +This doc is a placeholder for an guide around unit tests. diff --git a/docs/testing/yaml.md b/docs/testing/yaml.md new file mode 100644 index 00000000000000..2099d623c1b3db --- /dev/null +++ b/docs/testing/yaml.md @@ -0,0 +1,362 @@ +# YAML tests + +YAML is a structured, human-readable data-serialization language. Much like json +or proto, YAML refers to the structure and parser, and the schema used for any +particular application is defined by the application. + +In Matter, we use YAML for describing tests and test steps. A YAML parser and +runner is then used to translate the YAML instructions into actions used to +interact with the device under test (DUT). + +The main runner we use for testing in Matter parses the YAML instructions into +chip-tool commands. + +The schema description for the Matter test YAML is available here: +[YAML Schema](./yaml_schema.md) + +## Writing YAML tests + +Most YAML tests are written for certification. These follow a standard format +that is used to display the test easily in the test harness. + +### Placeholder for anatomy of a yaml test - need diagram + +### Placeholder for anatomy of a test step - need diagram + +### Common actions + +#### Sending a cluster command + +The following shows a test step sending a simple command with no arguments. + +``` + - label: "This label gets printed" + cluster: "On/Off" + command: "On" +``` + +- label - label to print before performing the test step +- cluster - name of the cluster to send the command to +- command - name of the command to send + +This send the On command to the On/Off cluster on the DUT. For most tests, the +nodeID of the DUT and endpoint for the cluster are defined in the top-level +config section of the file and applied to every test step. However, these can +also be overwritten in the individual test steps. + +The following shows how to send a command with arguments: + +``` + - label: "This label gets printed before the test step" + command: "MoveToColor" + arguments: + values: + - name: "ColorX" + value: 32768 + - name: "ColorY" + value: 19660 + - name: "TransitionTime" + value: 0 + - name: "OptionsMask" + value: 0 + - name: "OptionsOverride" + value: 0 +``` + +- label - label to print before performing the test step +- command - name of the command to send +- argument - this is a list parameter that takes either a "value" or "values" + tag. Commands with arguments all use structured fields, which require the + "values" tag with a list. Each of the fields is represented by a "name" and + "value" pair + +In this command, the cluster: tag is elided. The cluster for the entire test can +be set in the config section at the top of the test. This can be overwritten for +individual test steps (as above). + +#### Reading and writing attributes + +Reading and writing attributes is represented in the Matter test YAML schemas as +a special command that requires an additional "attribute" tag. + +The following YAML would appear as a test step, and shows how to read an +attribute. + +``` +- label: "TH reads the ClusterRevision from DUT" + command: "readAttribute" + attribute: "ClusterRevision" +``` + +The following YAML would appear as a test step and shows how to write an +attribute. Commands to write attributes always require an argument: tag. + +``` +- label: "Write example attribute" + command: "writeAttribute" + attribute: "ExampleAttribute" + arguments: + value: 1 +``` + +#### Parsing Responses + +After sending a command or read or write attribute request, you may want to +verify the response. This is done using the "response" tag with various +sub-tags. + +The following shows a simple response parsing with two (somewhat redundant) +checks. + +``` +- label: "TH reads the ClusterRevision from DUT" + command: "readAttribute" + attribute: "ClusterRevision" + response: + value: 1 + constraints: + minValue: 1 +``` + +The following tags can be used to parse the response + +| Example | Description | +| :---------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------- | +| response:
 value: [1, 2, 3, 4] | must match exactly. Variables and saveAs values allowed | +| response:
 values:
  - name: response_field
     value: 1 | Must match exactly
Use for commands that return command responses with named fields | +| response:
  error: CONSTRAINT_ERROR | expect an error back (omit for success)
Variables and saveAs values will not work. | +| response:
 constraints: | more complex checks - see [Schema](./yaml_schema.md) for a complete description | + +#### Lists and structs + +Lists and structs can be represented as follows: + +Lists: `[1,2,3,4,5]` + +structs: `{field1:value, field2:value}` + +lists of structs: + +``` +[ + +{field1:value, field2:value, optionalfield:value}, + +{field1:value, field2:value}, + +] +``` + +Note that structs are different than command and command response fields, which +are represented using name:, value: tags. + +#### Pseudo clusters + +Tests often require functionality that is not strictly cluster-based. Some of +this functionality is supported in YAML using pseudo-clusters. These clusters +accept command: tags like the DUT clusters to control the pseudo-cluster +functionality. + +Some of the more common functionality is shown below: + +Establishing a connection to the DUT. This is the first step in nearly every +test. + +``` + - label: "Establish a connection to the DUT" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId +``` + +Wait for a user action: + +``` + - label: "Do a simple user prompt message. Expect 'y' to pass." + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" +``` + +Wait for a time: + +``` + - label: "Wait for 5S" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 5000 +``` + +A full description of the available pseudo-clusters and their commands is +available at [Pseudo-cluster description](./yaml_pseudocluster.md). + +#### Config variables and saveAs: + +Certain tags can use variables that are either declared in the config: section +or saved from other steps. Variables that are declared in the config can be +overwritten on the command line when running locally or through the config file +in the test harness. + +To declare config variables in the config section, use a label with the desired +name, then provide the type and defaultValue tags as sub-tags. + +``` +config: + nodeId: 0x12344321 + cluster: "Unit Testing" + endpoint: 1 + myArg1: + type: int8u + defaultValue: 5 +``` + +Variables can also be saved from responses: + +``` + - label: "Send Test Add Arguments Command" + command: "TestAddArguments" + arguments: + values: + - name: "arg1" + value: 3 + - name: "arg2" + value: 17 + response: + values: + - name: "returnValue" + saveAs: TestAddArgumentDefaultValue + value: 20 +``` + +Variables can then be used in later steps: + +``` + - label: "Send Test Add Arguments Command" + command: "TestAddArguments" + arguments: + values: + - name: "arg1" + value: 3 + - name: "arg2" + value: 17 + response: + values: + - name: "returnValue" + value: TestAddArgumentDefaultValue +``` + +Tags where variables can be used are noted in the +[schema description](./yaml_schema.md). + +Config variables can be used to implement PIXIT values in tests. + +#### Gating tests and steps: PICS, TestEqualities and runIf + +The PICS tag can be used to unconditionally gate a test step on the PICS value +in the file. + +The PICS tag can handle standard boolean operations on pics (!, ||, &&, ()). + +A PICS tag at the top level of the file can be used to gate the entire test in +the test harness. Note that full-test gating is not currently implemented in the +local runner or in the CI. + +Some test steps need to be gated on values from earlier in the test. In these +cases, PICS cannot be used. Instead, the runIf: tag can be used. This tag +requires a boolean value. To convert values to booleans, the TestEqualities +function can be use. See +[TestEqualities](https://github.com/project-chip/connectedhomeip/blob/master/src/app/tests/suites/TestEqualities.yaml) +for an example of how to use this pseudo-cluster. + +## Running YAML tests + +YAML scripts are parsed and run using a python-based runner program that parses +the file, then translates the tags into chip-tool commands, and sends those +commands over a socket to chip-tool (running in interactive mode). + +### Running locally + +#### Commissioning the DUT + +All YAML tests assume that the DUT has previously been commissioned before +running. DUTs should be commissioned using chip-tool. Use the same KVS file when +running the test. + +#### Running the tests + +There are several options for running tests locally. Because the YAML runner +uses python, it is necessary to compile and install the chip python package +before using any YAML runner script. + +``` +./scripts/build_python.sh -i py +source py/bin/activate +``` + +Compile chip-tool: + +``` +./scripts/build/build_examples.py --target linux-x64-chip-tool build + +``` + +NOTE: use the target appropriate to your system + +[chiptool.py](https://github.com/project-chip/connectedhomeip/blob/master/scripts/tests/yaml/chiptool.py) +can be used to run tests against a commissioned DUT (commissioned by chip-tool). +This will start an interactive instance of chip-tool automatically. + +``` +./scripts/tests/yaml/chiptool.py tests Test_TC_OO_2_1 --server_path ./out/linux-x64-chip-tool/chip-tool + +``` + +NOTE: substitute the appropriate test name and chip-tool path as appropriate. + +A list of available tests can be generated using: + +``` +./scripts/tests/yaml/chiptool.py list +``` + +Config variables can be passed to chiptool.py after the script by separating +with -- + +``` +./scripts/tests/yaml/chiptool.py tests Test_TC_OO_2_1 --server_path ./out/linux-x64-chip-tool/chip-tool -- nodeId 0x12344321 + +``` + +#### Factory resetting the DUT + +On the host machine, you can simulate a factory reset by deleting the KVS file. +If you did not specify a location for the KVS file when starting the +application, the KVS file will be in /tmp as chip_kvs + +### Running in the CI + +- YAML tests added to the certification directory get run automatically + - src/app/tests/suites/certification/ + - PICS file: src/app/tests/suites/certification/ci-pics-values +- If you DON’T want to run a test in the CI + - (ex under development), add it to \_GetInDevelopmentTests in + `scripts/tests/chiptest/__init__.py` + +Please see [CI testing](./ci_testing.md) for more information about how to set +up examples apps, PICS and PIXIT values for use in the CI. + +### Running in the TH + +TODO: Do we have a permanent link to the most up to date TH documentation? If +so, add here. diff --git a/docs/testing/yaml_pseudocluster.md b/docs/testing/yaml_pseudocluster.md new file mode 100644 index 00000000000000..49946187aa39b9 --- /dev/null +++ b/docs/testing/yaml_pseudocluster.md @@ -0,0 +1,74 @@ + + +# YAML Pseudo-clusters + + + +CommissionerCommands +|command|args|arg type| arg optional| +|:---|:---|:---|:---| +|PairWithCode|nodeId
payload
discoverOnce|node_id
char_string
boolean|false
false
true| +|Unpair|nodeId|node_id|false| +|GetCommissionerNodeId|||| +|GetCommissionerNodeIdResponse|nodeId|node_id|false| +|GetCommissionerRootCertificate|||| +|GetCommissionerRootCertificateResponse|RCAC|OCTET_STRING|false| +|IssueNocChain|Elements
nodeId|octet_string
node_id|false
false| +|IssueNocChainResponse|NOC
ICAC
RCAC
IPK|octet_string
octet_string
octet_string
octet_string|false
false
false
false| + + +DelayCommands +|command|args|arg type| arg optional| +|:---|:---|:---|:---| +|WaitForCommissioning|||| +|WaitForCommissionee|nodeId
expireExistingSession|node_id
bool|false
true| +|WaitForMs|ms|int16u|false| +|WaitForMessage|registerKey
message|char_string
char_string|false
false| + + +DiscoveryCommands +|command|args|arg type| arg optional| +|:---|:---|:---|:---| +|FindCommissionable|||| +|FindCommissionableByShortDiscriminator|value|int16u|false| +|FindCommissionableByLongDiscriminator|value|int16u|false| +|FindCommissionableByCommissioningMode|||| +|FindCommissionableByVendorId|value|vendor_id|false| +|FindCommissionableByDeviceType|value|devtype_id|false| +|FindCommissioner|||| +|FindCommissionerByVendorId|value|vendor_id|false| +|FindCommissionerByDeviceType|value|devtype_id|false| +|FindResponse|hostName
instanceName
longDiscriminator
shortDiscriminator
vendorId
productId
commissioningMode
deviceType
deviceName
rotatingId
rotatingIdLen
pairingHint
pairingInstruction
supportsTcp
numIPs
port
mrpRetryIntervalIdle
mrpRetryIntervalActive
mrpRetryActiveThreshold
isICDOperatingAsLIT|char_string
char_string
int16u
int16u
vendor_id
int16u
int8u
devtype_id
char_string
octet_string
int64u
int16u
char_string
boolean
int8u
int16u
int32u
int32u
int16u
boolean|false
false
false
false
false
false
false
false
false
false
false
false
false
false
false
false
true
true
true
true| + + +EqualityCommands +|command|args|arg type| arg optional| +|:---|:---|:---|:---| +|BooleanEquals|Value1
Value2|boolean
boolean|false
false| +|SignedNumberEquals|Value1
Value2|int64s
int64s|false
false| +|UnsignedNumberEquals|Value1
Value2|int64u
int64u|false
false| +|EqualityResponse|Equals|bool|false| + + +LogCommands +|command|args|arg type| arg optional| +|:---|:---|:---|:---| +|Log|message|char_string|false| +|UserPrompt|message
expectedValue|char_string
char_string|false
true| + + +SystemCommands +|command|args|arg type| arg optional| +|:---|:---|:---|:---| +|Start|registerKey
discriminator
port
minCommissioningTimeout
kvs
filepath
otaDownloadPath
endUserSupportLogPath
networkDiagnosticsLogPath
crashLogPath|char_string
int16u
int16u
int16u
char_string
char_string
char_string
char_string
char_string
char_string|true
true
true
true
true
true
true
true
true
true| +|Stop|registerKey|char_string|true| +|Reboot|registerKey|char_string|true| +|FactoryReset|registerKey|char_string|true| +|CreateOtaImage|otaImageFilePath
rawImageFilePath
rawImageContent|char_string
char_string
char_string|false
false
false| +|CompareFiles|file1
file2|char_string
char_string|false
false| +|CreateFile|filePath
fileContent|char_string
char_string|false
false| +|DeleteFile|filePath|char_string|false| diff --git a/docs/testing/yaml_schema.md b/docs/testing/yaml_schema.md new file mode 100644 index 00000000000000..8a4846bde5e4f1 --- /dev/null +++ b/docs/testing/yaml_schema.md @@ -0,0 +1,75 @@ + + +# YAML Schema + +YAML schema +|key | type| supports variables +|:---|:---|:---| +|name |str|| +|PICS |str,list|| +|config | | | +|  nodeId |int|| +|  cluster |str|| +|  endpoint |int|| +|  _variableName_ | | | +|    type |type|| +|    defaultValue |Any|| +|tests | | | +|  label |str|| +|  identity |str|| +|  nodeId |int|Y| +|  runIf |str|| +|  groupId |int|Y| +|  endpoint |int|Y| +|  cluster |str|| +|  attribute |str|| +|  command |str|| +|  event |str|| +|  eventNumber |int|Y| +|  disabled |bool|| +|  fabricFiltered |bool|| +|  verification |str|| +|  PICS |str|| +|  arguments | | | +|    values | | | +|      value |NoneType,bool,int,float,dict,list|Y| +|      name |str|| +|    value |NoneType,bool,int,float,dict,list|Y| +|  response | |Y | +|    value |NoneType,bool,int,float,dict,list|Y| +|    name |str|| +|    error |str|| +|    clusterError |int|| +|    constraints | | | +|      hasValue |bool|| +|      type |str|| +|      minLength |int|| +|      maxLength |int|| +|      isHexString |bool|| +|      startsWith |str|| +|      endsWith |str|| +|      isUpperCase |bool|| +|      isLowerCase |bool|| +|      minValue |int,float|Y| +|      maxValue |int,float|Y| +|      contains |list|| +|      excludes |list|| +|      hasMasksSet |list|| +|      hasMasksClear |list|| +|      notValue |NoneType,bool,int,float,list,dict|Y| +|      anyOf |list|| +|    saveAs |str|| +|    saveDataVersschemaionAs |str|| +|  saveResponseAs |str|| +|  minInterval |int|| +|  maxInterval |int|| +|  keepSubscriptions |bool|| +|  timeout |int|| +|  timedInteractionTimeoutMs |int|| +|  dataVersion |list,int|Y| +|  busyWaitMs |int|| +|  wait |str|| diff --git a/examples/air-purifier-app/air-purifier-common/air-purifier-app.zap b/examples/air-purifier-app/air-purifier-common/air-purifier-app.zap index 987813f08a1cee..9e6fd096b39361 100644 --- a/examples/air-purifier-app/air-purifier-common/air-purifier-app.zap +++ b/examples/air-purifier-app/air-purifier-common/air-purifier-app.zap @@ -7583,6 +7583,5 @@ "endpointId": 4, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.zap b/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.zap index 383705d04183cf..52d2ddfccc18f1 100644 --- a/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.zap +++ b/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.zap @@ -6063,6 +6063,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index ad7cb56245f2bd..91d26e041ad7a0 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -2592,6 +2592,72 @@ cluster BooleanState = 69 { readonly attribute int16u clusterRevision = 65533; } +/** This cluster supports remotely monitoring and, where supported, changing the operational state of an Oven. */ +provisional cluster OvenCavityOperationalState = 72 { + revision 1; + + enum ErrorStateEnum : enum8 { + kNoError = 0; + kUnableToStartOrResume = 1; + kUnableToCompleteOperation = 2; + kCommandInvalidInState = 3; + } + + enum OperationalStateEnum : enum8 { + kStopped = 0; + kRunning = 1; + kPaused = 2; + kError = 3; + } + + struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; + } + + struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; + } + + critical event OperationalError = 0 { + ErrorStateStruct errorState = 0; + } + + info event OperationCompletion = 1 { + enum8 completionErrorCode = 0; + optional nullable elapsed_s totalOperationalTime = 1; + optional nullable elapsed_s pausedTime = 2; + } + + readonly attribute nullable char_string phaseList[] = 0; + readonly attribute nullable int8u currentPhase = 1; + readonly attribute optional nullable elapsed_s countdownTime = 2; + readonly attribute OperationalStateStruct operationalStateList[] = 3; + readonly attribute OperationalStateEnum operationalState = 4; + readonly attribute ErrorStateStruct operationalError = 5; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + response struct OperationalCommandResponse = 4 { + ErrorStateStruct commandResponseState = 0; + } + + /** Upon receipt, the device SHALL pause its operation if it is possible based on the current function of the server. */ + command Pause(): OperationalCommandResponse = 0; + /** Upon receipt, the device SHALL stop its operation if it is at a position where it is safe to do so and/or permitted. */ + command Stop(): OperationalCommandResponse = 1; + /** Upon receipt, the device SHALL start its operation if it is safe to do so and the device is in an operational state from which it can be started. */ + command Start(): OperationalCommandResponse = 2; + /** Upon receipt, the device SHALL resume its operation from the point it was at when it received the Pause command, or from the point when it was paused by means outside of this cluster (for example by manual button press). */ + command Resume(): OperationalCommandResponse = 3; +} + /** Attributes and commands for selecting a mode from a list of supported options. */ provisional cluster OvenMode = 73 { revision 1; @@ -2990,20 +3056,20 @@ cluster TemperatureControl = 86 { cluster RefrigeratorAlarm = 87 { revision 1; // NOTE: Default/not specifically set - bitmap AlarmMap : bitmap32 { + bitmap AlarmBitmap : bitmap32 { kDoorOpen = 0x1; } info event Notify = 0 { - AlarmMap active = 0; - AlarmMap inactive = 1; - AlarmMap state = 2; - AlarmMap mask = 3; + AlarmBitmap active = 0; + AlarmBitmap inactive = 1; + AlarmBitmap state = 2; + AlarmBitmap mask = 3; } - readonly attribute AlarmMap mask = 0; - readonly attribute AlarmMap state = 2; - readonly attribute AlarmMap supported = 3; + readonly attribute AlarmBitmap mask = 0; + readonly attribute AlarmBitmap state = 2; + readonly attribute AlarmBitmap supported = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -3208,7 +3274,7 @@ cluster SmokeCoAlarm = 92 { cluster DishwasherAlarm = 93 { revision 1; // NOTE: Default/not specifically set - bitmap AlarmMap : bitmap32 { + bitmap AlarmBitmap : bitmap32 { kInflowError = 0x1; kDrainError = 0x2; kDoorError = 0x4; @@ -3222,16 +3288,16 @@ cluster DishwasherAlarm = 93 { } info event Notify = 0 { - AlarmMap active = 0; - AlarmMap inactive = 1; - AlarmMap state = 2; - AlarmMap mask = 3; + AlarmBitmap active = 0; + AlarmBitmap inactive = 1; + AlarmBitmap state = 2; + AlarmBitmap mask = 3; } - readonly attribute AlarmMap mask = 0; - readonly attribute optional AlarmMap latch = 1; - readonly attribute AlarmMap state = 2; - readonly attribute AlarmMap supported = 3; + readonly attribute AlarmBitmap mask = 0; + readonly attribute optional AlarmBitmap latch = 1; + readonly attribute AlarmBitmap state = 2; + readonly attribute AlarmBitmap supported = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -3240,11 +3306,11 @@ cluster DishwasherAlarm = 93 { readonly attribute int16u clusterRevision = 65533; request struct ResetRequest { - AlarmMap alarms = 0; + AlarmBitmap alarms = 0; } request struct ModifyEnabledAlarmsRequest { - AlarmMap mask = 0; + AlarmBitmap mask = 0; } /** Reset alarm */ @@ -3420,11 +3486,13 @@ cluster RvcOperationalState = 97 { command Start(): OperationalCommandResponse = 2; /** Upon receipt, the device SHALL resume its operation from the point it was at when it received the Pause command, or from the point when it was paused by means outside of this cluster (for example by manual button press). */ command Resume(): OperationalCommandResponse = 3; + /** On receipt of this command, the device SHALL start seeking the charging dock, if possible in the current state of the device. */ + command GoHome(): OperationalCommandResponse = 128; } /** Attributes and commands for scene configuration and manipulation. */ provisional cluster ScenesManagement = 98 { - revision 5; + revision 1; bitmap CopyModeBitmap : bitmap8 { kCopyAllScenes = 0x1; @@ -3432,13 +3500,6 @@ provisional cluster ScenesManagement = 98 { bitmap Feature : bitmap32 { kSceneNames = 0x1; - kExplicit = 0x2; - kTableSize = 0x4; - kFabricScenes = 0x8; - } - - bitmap NameSupportBitmap : bitmap8 { - kSceneNames = 0x80; } struct AttributeValuePair { @@ -3460,14 +3521,9 @@ provisional cluster ScenesManagement = 98 { fabric_idx fabricIndex = 254; } - readonly attribute optional int8u sceneCount = 0; - readonly attribute optional int8u currentScene = 1; - readonly attribute optional group_id currentGroup = 2; - readonly attribute optional boolean sceneValid = 3; - readonly attribute NameSupportBitmap nameSupport = 4; - readonly attribute optional nullable node_id lastConfiguredBy = 5; - readonly attribute int16u sceneTableSize = 6; - readonly attribute SceneInfoStruct fabricSceneInfo[] = 7; + readonly attribute optional nullable node_id lastConfiguredBy = 0; + readonly attribute int16u sceneTableSize = 1; + readonly attribute SceneInfoStruct fabricSceneInfo[] = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -3478,7 +3534,7 @@ provisional cluster ScenesManagement = 98 { request struct AddSceneRequest { group_id groupID = 0; int8u sceneID = 1; - int16u transitionTime = 2; + int32u transitionTime = 2; char_string sceneName = 3; ExtensionFieldSet extensionFieldSets[] = 4; } @@ -3498,7 +3554,7 @@ provisional cluster ScenesManagement = 98 { status status = 0; group_id groupID = 1; int8u sceneID = 2; - optional int16u transitionTime = 3; + optional int32u transitionTime = 3; optional char_string sceneName = 4; optional ExtensionFieldSet extensionFieldSets[] = 5; } @@ -3537,7 +3593,7 @@ provisional cluster ScenesManagement = 98 { request struct RecallSceneRequest { group_id groupID = 0; int8u sceneID = 1; - optional nullable int16u transitionTime = 2; + optional nullable int32u transitionTime = 2; } request struct GetSceneMembershipRequest { @@ -3551,34 +3607,6 @@ provisional cluster ScenesManagement = 98 { optional int8u sceneList[] = 3; } - request struct EnhancedAddSceneRequest { - group_id groupID = 0; - int8u sceneID = 1; - int16u transitionTime = 2; - char_string sceneName = 3; - ExtensionFieldSet extensionFieldSets[] = 4; - } - - response struct EnhancedAddSceneResponse = 64 { - status status = 0; - group_id groupID = 1; - int8u sceneID = 2; - } - - request struct EnhancedViewSceneRequest { - group_id groupID = 0; - int8u sceneID = 1; - } - - response struct EnhancedViewSceneResponse = 65 { - status status = 0; - group_id groupID = 1; - int8u sceneID = 2; - optional int16u transitionTime = 3; - optional char_string sceneName = 4; - optional ExtensionFieldSet extensionFieldSets[] = 5; - } - request struct CopySceneRequest { CopyModeBitmap mode = 0; group_id groupIdentifierFrom = 1; @@ -3587,7 +3615,7 @@ provisional cluster ScenesManagement = 98 { int8u sceneIdentifierTo = 4; } - response struct CopySceneResponse = 66 { + response struct CopySceneResponse = 64 { status status = 0; group_id groupIdentifierFrom = 1; int8u sceneIdentifierFrom = 2; @@ -3607,12 +3635,8 @@ provisional cluster ScenesManagement = 98 { fabric command RecallScene(RecallSceneRequest): DefaultSuccess = 5; /** Get an unused scene identifier when no commissioning tool is in the network, or for a commissioning tool to get the used scene identifiers within a certain group */ fabric command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; - /** Allows a scene to be added using a finer scene transition time than the AddScene command. */ - fabric command EnhancedAddScene(EnhancedAddSceneRequest): EnhancedAddSceneResponse = 64; - /** Allows a scene to be retrieved using a finer scene transition time than the ViewScene command */ - fabric command EnhancedViewScene(EnhancedViewSceneRequest): EnhancedViewSceneResponse = 65; /** Allows a client to efficiently copy scenes from one group/scene identifier pair to another group/scene identifier pair. */ - fabric command CopyScene(CopySceneRequest): CopySceneResponse = 66; + fabric command CopyScene(CopySceneRequest): CopySceneResponse = 64; } /** Attributes and commands for monitoring HEPA filters in a device */ @@ -3922,13 +3946,19 @@ provisional cluster ElectricalEnergyMeasurement = 145 { /** This cluster allows a client to manage the power draw of a device. An example of such a client could be an Energy Management System (EMS) which controls an Energy Smart Appliance (ESA). */ provisional cluster DeviceEnergyManagement = 152 { - revision 2; + revision 3; + + enum AdjustmentCauseEnum : enum8 { + kLocalOptimization = 0; + kGridOptimization = 1; + } enum CauseEnum : enum8 { kNormalCompletion = 0; kOffline = 1; kFault = 2; kUserOptOut = 3; + kCancelled = 4; } enum CostTypeEnum : enum8 { @@ -3942,9 +3972,8 @@ provisional cluster DeviceEnergyManagement = 152 { kOffline = 0; kOnline = 1; kFault = 2; - kUserOptOut = 3; - kPowerAdjustActive = 4; - kPaused = 5; + kPowerAdjustActive = 3; + kPaused = 4; } enum ESATypeEnum : enum8 { @@ -3965,11 +3994,27 @@ provisional cluster DeviceEnergyManagement = 152 { kOther = 255; } + enum ForecastUpdateReasonEnum : enum8 { + kInternalOptimization = 0; + kLocalOptimization = 1; + kGridOptimization = 2; + } + + enum OptOutStateEnum : enum8 { + kNoOptOut = 0; + kLocalOptOut = 1; + kGridOptOut = 2; + kOptOut = 3; + } + bitmap Feature : bitmap32 { kPowerAdjustment = 0x1; kPowerForecastReporting = 0x2; kStateForecastReporting = 0x4; - kForecastAdjustment = 0x8; + kStartTimeAdjustment = 0x8; + kPausable = 0x10; + kForecastAdjustment = 0x20; + kConstraintBasedAdjustment = 0x40; } struct CostStruct { @@ -3985,9 +4030,9 @@ provisional cluster DeviceEnergyManagement = 152 { elapsed_s defaultDuration = 2; elapsed_s elapsedSlotTime = 3; elapsed_s remainingSlotTime = 4; - boolean slotIsPauseable = 5; - elapsed_s minPauseDuration = 6; - elapsed_s maxPauseDuration = 7; + optional boolean slotIsPauseable = 5; + optional elapsed_s minPauseDuration = 6; + optional elapsed_s maxPauseDuration = 7; optional int16u manufacturerESAState = 8; optional power_mw nominalPower = 9; optional power_mw minPower = 10; @@ -4009,6 +4054,7 @@ provisional cluster DeviceEnergyManagement = 152 { optional epoch_s latestEndTime = 5; boolean isPauseable = 6; SlotStruct slots[] = 7; + ForecastUpdateReasonEnum forecastUpdateReason = 8; } struct ConstraintsStruct { @@ -4045,6 +4091,7 @@ provisional cluster DeviceEnergyManagement = 152 { } info event Resumed = 3 { + CauseEnum cause = 0; } readonly attribute ESATypeEnum ESAType = 0; @@ -4054,6 +4101,7 @@ provisional cluster DeviceEnergyManagement = 152 { readonly attribute power_mw absMaxPower = 4; readonly attribute optional nullable PowerAdjustStruct powerAdjustmentCapability[] = 5; readonly attribute optional nullable ForecastStruct forecast = 6; + readonly attribute optional OptOutStateEnum optOutState = 7; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -4064,23 +4112,28 @@ provisional cluster DeviceEnergyManagement = 152 { request struct PowerAdjustRequestRequest { power_mw power = 0; elapsed_s duration = 1; + AdjustmentCauseEnum cause = 2; } request struct StartTimeAdjustRequestRequest { epoch_s requestedStartTime = 0; + AdjustmentCauseEnum cause = 1; } request struct PauseRequestRequest { elapsed_s duration = 0; + AdjustmentCauseEnum cause = 1; } request struct ModifyForecastRequestRequest { int32u forecastId = 0; SlotAdjustmentStruct slotAdjustments[] = 1; + AdjustmentCauseEnum cause = 2; } request struct RequestConstraintBasedForecastRequest { ConstraintsStruct constraints[] = 0; + AdjustmentCauseEnum cause = 1; } /** Allows a client to request an adjustment in the power consumption of an ESA for a specified duration. */ @@ -4097,6 +4150,8 @@ provisional cluster DeviceEnergyManagement = 152 { command ModifyForecastRequest(ModifyForecastRequestRequest): DefaultSuccess = 5; /** Allows a client to ask the ESA to recompute its Forecast based on power and time constraints. */ command RequestConstraintBasedForecast(RequestConstraintBasedForecastRequest): DefaultSuccess = 6; + /** Allows a client to request cancellation of a previous adjustment request in a StartTimeAdjustRequest, ModifyForecastRequest or RequestConstraintBasedForecast command */ + command CancelRequest(): DefaultSuccess = 7; } /** Electric Vehicle Supply Equipment (EVSE) is equipment used to charge an Electric Vehicle (EV) or Plug-In Hybrid Electric Vehicle. This cluster provides an interface to the functionality of Electric Vehicle Supply Equipment (EVSE) management. */ @@ -4171,6 +4226,11 @@ provisional cluster EnergyEvse = 153 { optional energy_mwh addedEnergy = 2; } + struct ChargingTargetScheduleStruct { + TargetDayOfWeekBitmap dayOfWeekForSequence = 0; + ChargingTargetStruct chargingTargets[] = 1; + } + info event EVConnected = 0 { int32u sessionID = 0; } @@ -4218,8 +4278,6 @@ provisional cluster EnergyEvse = 153 { readonly attribute optional amperage_ma maximumDischargeCurrent = 8; attribute access(write: manage) optional amperage_ma userMaximumChargeCurrent = 9; attribute access(write: manage) optional elapsed_s randomizationDelayWindow = 10; - readonly attribute optional int8u numberOfWeeklyTargets = 33; - readonly attribute optional int8u numberOfDailyTargets = 34; readonly attribute optional nullable epoch_s nextChargeStartTime = 35; readonly attribute optional nullable epoch_s nextChargeTargetTime = 36; readonly attribute optional nullable energy_mwh nextChargeRequiredEnergy = 37; @@ -4240,8 +4298,7 @@ provisional cluster EnergyEvse = 153 { readonly attribute int16u clusterRevision = 65533; response struct GetTargetsResponse = 0 { - TargetDayOfWeekBitmap dayOfWeekforSequence = 0; - ChargingTargetStruct chargingTargets[] = 1; + ChargingTargetScheduleStruct chargingTargetSchedules[] = 0; } request struct EnableChargingRequest { @@ -4256,12 +4313,7 @@ provisional cluster EnergyEvse = 153 { } request struct SetTargetsRequest { - TargetDayOfWeekBitmap dayOfWeekforSequence = 0; - ChargingTargetStruct chargingTargets[] = 1; - } - - request struct GetTargetsRequest { - TargetDayOfWeekBitmap daysToReturn = 0; + ChargingTargetScheduleStruct chargingTargetSchedules[] = 0; } /** Allows a client to disable the EVSE from charging and discharging. */ @@ -4275,11 +4327,112 @@ provisional cluster EnergyEvse = 153 { /** Allows a client to set the user specified charging targets. */ timed command SetTargets(SetTargetsRequest): DefaultSuccess = 5; /** Allows a client to retrieve the user specified charging targets. */ - timed command GetTargets(GetTargetsRequest): GetTargetsResponse = 6; + timed command GetTargets(): GetTargetsResponse = 6; /** Allows a client to clear all stored charging targets. */ timed command ClearTargets(): DefaultSuccess = 7; } +/** Attributes and commands for selecting a mode from a list of supported options. */ +provisional cluster EnergyEvseMode = 157 { + revision 1; + + enum ModeTag : enum16 { + kManual = 16384; + kTimeOfUse = 16385; + kSolarCharging = 16386; + } + + bitmap Feature : bitmap32 { + kOnOff = 0x1; + } + + struct ModeTagStruct { + optional vendor_id mfgCode = 0; + enum16 value = 1; + } + + struct ModeOptionStruct { + char_string<64> label = 0; + int8u mode = 1; + ModeTagStruct modeTags[] = 2; + } + + readonly attribute ModeOptionStruct supportedModes[] = 0; + readonly attribute int8u currentMode = 1; + attribute optional nullable int8u startUpMode = 2; + attribute optional nullable int8u onMode = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ChangeToModeRequest { + int8u newMode = 0; + } + + response struct ChangeToModeResponse = 1 { + enum8 status = 0; + optional char_string<64> statusText = 1; + } + + /** This command is used to change device modes. + On receipt of this command the device SHALL respond with a ChangeToModeResponse command. */ + command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0; +} + +/** Attributes and commands for selecting a mode from a list of supported options. */ +provisional cluster DeviceEnergyManagementMode = 159 { + revision 1; + + enum ModeTag : enum16 { + kNoOptimization = 16384; + kDeviceOptimization = 16385; + kLocalOptimization = 16386; + kGridOptimization = 16387; + } + + bitmap Feature : bitmap32 { + kOnOff = 0x1; + } + + struct ModeTagStruct { + optional vendor_id mfgCode = 0; + enum16 value = 1; + } + + struct ModeOptionStruct { + char_string<64> label = 0; + int8u mode = 1; + ModeTagStruct modeTags[] = 2; + } + + readonly attribute ModeOptionStruct supportedModes[] = 0; + readonly attribute int8u currentMode = 1; + attribute optional nullable int8u startUpMode = 2; + attribute optional nullable int8u onMode = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ChangeToModeRequest { + int8u newMode = 0; + } + + response struct ChangeToModeResponse = 1 { + enum8 status = 0; + optional char_string<64> statusText = 1; + } + + /** This command is used to change device modes. + On receipt of this command the device SHALL respond with a ChangeToModeResponse command. */ + command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0; +} + /** Provides an interface for controlling and adjusting automatic window coverings. */ cluster WindowCovering = 258 { revision 5; @@ -6463,6 +6616,10 @@ internal cluster UnitTesting = 4294048773 { fabric_idx fabricIndex = 254; } + info event TestDifferentVendorMeiEvent = 4294050030 { + int8u arg1 = 1; + } + attribute boolean boolean = 0; attribute Bitmap8MaskMap bitmap8 = 1; attribute Bitmap16MaskMap bitmap16 = 2; @@ -6545,6 +6702,7 @@ internal cluster UnitTesting = 4294048773 { attribute nullable int16u nullableRangeRestrictedInt16u = 16424; attribute nullable int16s nullableRangeRestrictedInt16s = 16425; attribute optional int8u writeOnlyInt8u = 16426; + attribute int8u meiInt8u = 4294070017; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -6740,7 +6898,17 @@ internal cluster UnitTesting = 4294048773 { int8u fillCharacter = 2; } - /** Simple command without any parameters and without a specific response */ + request struct TestDifferentVendorMeiRequestRequest { + int8u arg1 = 0; + } + + response struct TestDifferentVendorMeiResponse = 4294049979 { + int8u arg1 = 0; + int64u eventNumber = 1; + } + + /** Simple command without any parameters and without a specific response. + To aid in unit testing, this command will re-initialize attribute storage to defaults. */ command Test(): DefaultSuccess = 0; /** Simple command without any parameters and without a specific response not handled by the server */ command TestNotHandled(): DefaultSuccess = 1; @@ -6809,6 +6977,8 @@ internal cluster UnitTesting = 4294048773 { command TestBatchHelperRequest(TestBatchHelperRequestRequest): TestBatchHelperResponse = 22; /** Second command that responds after sleepBeforeResponseTimeMs with an octet_string the size requested with fillCharacter. */ command TestSecondBatchHelperRequest(TestSecondBatchHelperRequestRequest): TestBatchHelperResponse = 23; + /** Command having a different MEI vendor ID than the cluster. Also emits TestDifferentVendorMeiEvent. */ + command TestDifferentVendorMeiRequest(TestDifferentVendorMeiRequestRequest): TestDifferentVendorMeiResponse = 4294049962; } /** The Fault Injection Cluster provide a means for a test harness to configure faults(for example triggering a fault in the system). */ @@ -7074,10 +7244,15 @@ endpoint 0 { } server cluster DiagnosticLogs { + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; ram attribute featureMap default = 0; ram attribute clusterRevision default = 1; handle command RetrieveLogsRequest; + handle command RetrieveLogsResponse; } server cluster GeneralDiagnostics { @@ -7530,6 +7705,20 @@ endpoint 1 { ram attribute clusterRevision default = 1; } + server cluster OvenCavityOperationalState { + callback attribute phaseList; + callback attribute currentPhase; + callback attribute operationalStateList; + callback attribute operationalState; + callback attribute operationalError; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + server cluster OvenMode { callback attribute supportedModes; ram attribute currentMode; @@ -7539,6 +7728,9 @@ endpoint 1 { callback attribute attributeList; ram attribute featureMap default = 0; ram attribute clusterRevision default = 1; + + handle command ChangeToMode; + handle command ChangeToModeResponse; } server cluster LaundryDryerControls { @@ -7786,10 +7978,10 @@ endpoint 1 { handle command Pause; handle command Resume; handle command OperationalCommandResponse; + handle command GoHome; } server cluster ScenesManagement { - ram attribute nameSupport default = 0x80; ram attribute lastConfiguredBy; ram attribute sceneTableSize default = 16; callback attribute fabricSceneInfo; @@ -7797,8 +7989,8 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 15; - ram attribute clusterRevision default = 5; + ram attribute featureMap default = 1; + ram attribute clusterRevision default = 1; handle command AddScene; handle command AddSceneResponse; @@ -7813,10 +8005,6 @@ endpoint 1 { handle command RecallScene; handle command GetSceneMembership; handle command GetSceneMembershipResponse; - handle command EnhancedAddScene; - handle command EnhancedAddSceneResponse; - handle command EnhancedViewScene; - handle command EnhancedViewSceneResponse; handle command CopyScene; handle command CopySceneResponse; } @@ -7928,12 +8116,13 @@ endpoint 1 { callback attribute absMaxPower; callback attribute powerAdjustmentCapability; callback attribute forecast; + callback attribute optOutState; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; callback attribute featureMap; - ram attribute clusterRevision default = 2; + ram attribute clusterRevision default = 3; handle command PowerAdjustRequest; handle command CancelPowerAdjustRequest; @@ -7942,9 +8131,16 @@ endpoint 1 { handle command ResumeRequest; handle command ModifyForecastRequest; handle command RequestConstraintBasedForecast; + handle command CancelRequest; } server cluster EnergyEvse { + emits event EVConnected; + emits event EVNotDetected; + emits event EnergyTransferStarted; + emits event EnergyTransferStopped; + emits event Fault; + emits event RFID; callback attribute state; callback attribute supplyState; callback attribute faultState; @@ -7956,8 +8152,6 @@ endpoint 1 { callback attribute maximumDischargeCurrent; callback attribute userMaximumChargeCurrent; callback attribute randomizationDelayWindow; - callback attribute numberOfWeeklyTargets default = 0; - callback attribute numberOfDailyTargets default = 1; callback attribute nextChargeStartTime; callback attribute nextChargeTargetTime; callback attribute nextChargeRequiredEnergy; @@ -7987,6 +8181,34 @@ endpoint 1 { handle command ClearTargets; } + server cluster EnergyEvseMode { + callback attribute supportedModes; + callback attribute currentMode; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap; + ram attribute clusterRevision default = 1; + + handle command ChangeToMode; + handle command ChangeToModeResponse; + } + + server cluster DeviceEnergyManagementMode { + callback attribute supportedModes; + callback attribute currentMode; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap; + ram attribute clusterRevision default = 1; + + handle command ChangeToMode; + handle command ChangeToModeResponse; + } + server cluster WindowCovering { ram attribute type default = 0x08; ram attribute physicalClosedLimitLift default = 0xFFFF; @@ -8101,13 +8323,6 @@ endpoint 1 { ram attribute clusterRevision default = 6; handle command SetpointRaiseLower; - handle command SetActiveScheduleRequest; - handle command SetActivePresetRequest; - handle command StartPresetsSchedulesEditRequest; - handle command CancelPresetsSchedulesEditRequest; - handle command CommitPresetsSchedulesRequest; - handle command CancelSetActivePresetRequest; - handle command SetTemperatureSetpointHoldPolicy; } server cluster FanControl { @@ -8511,6 +8726,7 @@ endpoint 1 { server cluster UnitTesting { emits event TestEvent; emits event TestFabricScopedEvent; + emits event TestDifferentVendorMeiEvent; ram attribute boolean default = false; ram attribute bitmap8 default = 0; ram attribute bitmap16 default = 0; @@ -8594,6 +8810,7 @@ endpoint 1 { callback attribute writeOnlyInt8u default = 0; ram attribute featureMap default = 0; ram attribute clusterRevision default = 1; + ram attribute meiInt8u default = 0; handle command Test; handle command TestSpecificResponse; @@ -8623,6 +8840,8 @@ endpoint 1 { handle command TestEmitTestFabricScopedEventRequest; handle command TestBatchHelperRequest; handle command TestSecondBatchHelperRequest; + handle command TestDifferentVendorMeiRequest; + handle command TestDifferentVendorMeiResponse; } } endpoint 2 { @@ -8717,7 +8936,6 @@ endpoint 2 { } server cluster ScenesManagement { - ram attribute nameSupport default = 0x80; ram attribute lastConfiguredBy; ram attribute sceneTableSize default = 16; callback attribute fabricSceneInfo; @@ -8725,8 +8943,8 @@ endpoint 2 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 15; - ram attribute clusterRevision default = 5; + ram attribute featureMap default = 1; + ram attribute clusterRevision default = 1; handle command AddScene; handle command AddSceneResponse; @@ -8741,10 +8959,6 @@ endpoint 2 { handle command RecallScene; handle command GetSceneMembership; handle command GetSceneMembershipResponse; - handle command EnhancedAddScene; - handle command EnhancedAddSceneResponse; - handle command EnhancedViewScene; - handle command EnhancedViewSceneResponse; handle command CopyScene; handle command CopySceneResponse; } diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index 9013ea3140e6db..12de6efc7065fe 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -2572,7 +2572,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -2723,9 +2723,81 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "RetrieveLogsResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "FeatureMap", "code": 65532, @@ -6624,41 +6696,9 @@ "isIncoming": 0, "isEnabled": 1 }, - { - "name": "EnhancedAddScene", - "code": 64, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "EnhancedAddSceneResponse", - "code": 64, - "mfgCode": null, - "source": "server", - "isIncoming": 0, - "isEnabled": 1 - }, - { - "name": "EnhancedViewScene", - "code": 65, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "EnhancedViewSceneResponse", - "code": 65, - "mfgCode": null, - "source": "server", - "isIncoming": 0, - "isEnabled": 1 - }, { "name": "CopyScene", - "code": 66, + "code": 64, "mfgCode": null, "source": "client", "isIncoming": 1, @@ -6666,7 +6706,7 @@ }, { "name": "CopySceneResponse", - "code": 66, + "code": 64, "mfgCode": null, "source": "server", "isIncoming": 0, @@ -6674,25 +6714,9 @@ } ], "attributes": [ - { - "name": "NameSupport", - "code": 4, - "mfgCode": null, - "side": "server", - "type": "NameSupportBitmap", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x80", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, { "name": "LastConfiguredBy", - "code": 5, + "code": 0, "mfgCode": null, "side": "server", "type": "node_id", @@ -6708,7 +6732,7 @@ }, { "name": "SceneTableSize", - "code": 6, + "code": 1, "mfgCode": null, "side": "server", "type": "int16u", @@ -6724,7 +6748,7 @@ }, { "name": "FabricSceneInfo", - "code": 7, + "code": 2, "mfgCode": null, "side": "server", "type": "array", @@ -6812,7 +6836,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "15", + "defaultValue": "1", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -6828,7 +6852,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "5", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -8457,16 +8481,16 @@ ] }, { - "name": "Oven Mode", - "code": 73, + "name": "Oven Cavity Operational State", + "code": 72, "mfgCode": null, - "define": "OVEN_MODE_CLUSTER", + "define": "OPERATIONAL_STATE_OVEN_CLUSTER", "side": "server", "enabled": 1, "apiMaturity": "provisional", "attributes": [ { - "name": "SupportedModes", + "name": "PhaseList", "code": 0, "mfgCode": null, "side": "server", @@ -8482,16 +8506,64 @@ "reportableChange": 0 }, { - "name": "CurrentMode", + "name": "CurrentPhase", "code": 1, "mfgCode": null, "side": "server", "type": "int8u", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OperationalStateList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OperationalState", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "OperationalStateEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OperationalError", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "ErrorStateStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -8596,15 +8668,34 @@ ] }, { - "name": "Laundry Dryer Controls", - "code": 74, + "name": "Oven Mode", + "code": 73, "mfgCode": null, - "define": "LAUNDRY_DRYER_CONTROLS_CLUSTER", + "define": "OVEN_MODE_CLUSTER", "side": "server", "enabled": 1, + "apiMaturity": "provisional", + "commands": [ + { + "name": "ChangeToMode", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ChangeToModeResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], "attributes": [ { - "name": "SupportedDrynessLevels", + "name": "SupportedModes", "code": 0, "mfgCode": null, "side": "server", @@ -8620,11 +8711,11 @@ "reportableChange": 0 }, { - "name": "SelectedDrynessLevel", + "name": "CurrentMode", "code": 1, "mfgCode": null, "side": "server", - "type": "DrynessLevelEnum", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -8734,58 +8825,48 @@ ] }, { - "name": "Mode Select", - "code": 80, + "name": "Laundry Dryer Controls", + "code": 74, "mfgCode": null, - "define": "MODE_SELECT_CLUSTER", + "define": "LAUNDRY_DRYER_CONTROLS_CLUSTER", "side": "server", "enabled": 1, - "commands": [ - { - "name": "ChangeToMode", - "code": 0, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - } - ], "attributes": [ { - "name": "Description", + "name": "SupportedDrynessLevels", "code": 0, "mfgCode": null, "side": "server", - "type": "char_string", + "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "Coffee", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "StandardNamespace", + "name": "SelectedDrynessLevel", "code": 1, "mfgCode": null, "side": "server", - "type": "enum16", + "type": "DrynessLevelEnum", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": "", "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "SupportedModes", - "code": 2, + "name": "GeneratedCommandList", + "code": 65528, "mfgCode": null, "side": "server", "type": "array", @@ -8800,8 +8881,156 @@ "reportableChange": 0 }, { - "name": "CurrentMode", - "code": 3, + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Mode Select", + "code": 80, + "mfgCode": null, + "define": "MODE_SELECT_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ChangeToMode", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "Description", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "Coffee", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "StandardNamespace", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "enum16", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportedModes", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentMode", + "code": 3, "mfgCode": null, "side": "server", "type": "int8u", @@ -9916,7 +10145,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "AlarmMap", + "type": "AlarmBitmap", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -9932,7 +10161,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "AlarmMap", + "type": "AlarmBitmap", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -9948,7 +10177,7 @@ "code": 3, "mfgCode": null, "side": "server", - "type": "AlarmMap", + "type": "AlarmBitmap", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -10698,7 +10927,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "AlarmMap", + "type": "AlarmBitmap", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -10714,7 +10943,7 @@ "code": 1, "mfgCode": null, "side": "server", - "type": "AlarmMap", + "type": "AlarmBitmap", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -10730,7 +10959,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "AlarmMap", + "type": "AlarmBitmap", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -10746,7 +10975,7 @@ "code": 3, "mfgCode": null, "side": "server", - "type": "AlarmMap", + "type": "AlarmBitmap", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11262,6 +11491,14 @@ "source": "server", "isIncoming": 0, "isEnabled": 1 + }, + { + "name": "GoHome", + "code": 128, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 } ], "attributes": [ @@ -11888,7 +12125,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -12704,6 +12941,14 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "CancelRequest", + "code": 7, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 } ], "attributes": [ @@ -12717,7 +12962,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -12733,7 +12978,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -12749,7 +12994,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -12765,7 +13010,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -12781,7 +13026,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -12819,6 +13064,22 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "OptOutState", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "OptOutStateEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "GeneratedCommandList", "code": 65528, @@ -12861,7 +13122,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -12893,7 +13154,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -12909,7 +13170,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "3", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -13032,7 +13293,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -13048,7 +13309,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -13064,7 +13325,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -13080,7 +13341,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -13096,7 +13357,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -13112,7 +13373,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -13128,7 +13389,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "6000", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -13144,7 +13405,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -13160,7 +13421,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -13176,7 +13437,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -13192,82 +13453,379 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "600", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "NumberOfWeeklyTargets", - "code": 33, + "name": "NextChargeStartTime", + "code": 35, "mfgCode": null, "side": "server", - "type": "int8u", + "type": "epoch_s", "included": 1, "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "NumberOfDailyTargets", - "code": 34, + "name": "NextChargeTargetTime", + "code": 36, "mfgCode": null, "side": "server", - "type": "int8u", + "type": "epoch_s", "included": 1, "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "NextChargeStartTime", - "code": 35, + "name": "NextChargeRequiredEnergy", + "code": 37, "mfgCode": null, "side": "server", - "type": "epoch_s", + "type": "energy_mwh", "included": 1, "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "NextChargeTargetTime", - "code": 36, + "name": "NextChargeTargetSoC", + "code": 38, "mfgCode": null, "side": "server", - "type": "epoch_s", + "type": "percent", "included": 1, "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "NextChargeRequiredEnergy", - "code": 37, + "name": "ApproximateEVEfficiency", + "code": 39, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "StateOfCharge", + "code": 48, + "mfgCode": null, + "side": "server", + "type": "percent", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BatteryCapacity", + "code": 49, + "mfgCode": null, + "side": "server", + "type": "energy_mwh", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "VehicleID", + "code": 50, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SessionID", + "code": 64, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SessionDuration", + "code": 65, + "mfgCode": null, + "side": "server", + "type": "elapsed_s", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SessionEnergyCharged", + "code": 66, + "mfgCode": null, + "side": "server", + "type": "energy_mwh", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SessionEnergyDischarged", + "code": 67, + "mfgCode": null, + "side": "server", + "type": "energy_mwh", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "EVConnected", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "EVNotDetected", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "EnergyTransferStarted", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "EnergyTransferStopped", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "Fault", + "code": 4, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "RFID", + "code": 5, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Energy EVSE Mode", + "code": 157, + "mfgCode": null, + "define": "ENERGY_EVSE_MODE_CLUSTER", + "side": "server", + "enabled": 1, + "apiMaturity": "provisional", + "commands": [ + { + "name": "ChangeToMode", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ChangeToModeResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "SupportedModes", + "code": 0, "mfgCode": null, "side": "server", - "type": "energy_mwh", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -13279,11 +13837,11 @@ "reportableChange": 0 }, { - "name": "NextChargeTargetSoC", - "code": 38, + "name": "CurrentMode", + "code": 1, "mfgCode": null, "side": "server", - "type": "percent", + "type": "int8u", "included": 1, "storageOption": "External", "singleton": 0, @@ -13295,27 +13853,27 @@ "reportableChange": 0 }, { - "name": "ApproximateEVEfficiency", - "code": 39, + "name": "GeneratedCommandList", + "code": 65528, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0xFFFF", + "defaultValue": "", "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "StateOfCharge", - "code": 48, + "name": "AcceptedCommandList", + "code": 65529, "mfgCode": null, "side": "server", - "type": "percent", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -13327,11 +13885,11 @@ "reportableChange": 0 }, { - "name": "BatteryCapacity", - "code": 49, + "name": "EventList", + "code": 65530, "mfgCode": null, "side": "server", - "type": "energy_mwh", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -13343,11 +13901,11 @@ "reportableChange": 0 }, { - "name": "VehicleID", - "code": 50, + "name": "AttributeList", + "code": 65531, "mfgCode": null, "side": "server", - "type": "char_string", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -13359,43 +13917,72 @@ "reportableChange": 0 }, { - "name": "SessionID", - "code": 64, + "name": "FeatureMap", + "code": 65532, "mfgCode": null, "side": "server", - "type": "int32u", + "type": "bitmap32", "included": 1, "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "SessionDuration", - "code": 65, + "name": "ClusterRevision", + "code": 65533, "mfgCode": null, "side": "server", - "type": "elapsed_s", + "type": "int16u", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "1", "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 + } + ] + }, + { + "name": "Device Energy Management Mode", + "code": 159, + "mfgCode": null, + "define": "DEVICE_ENERGY_MANAGEMENT_MODE_CLUSTER", + "side": "server", + "enabled": 1, + "apiMaturity": "provisional", + "commands": [ + { + "name": "ChangeToMode", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 }, { - "name": "SessionEnergyCharged", - "code": 66, + "name": "ChangeToModeResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "SupportedModes", + "code": 0, "mfgCode": null, "side": "server", - "type": "energy_mwh", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -13407,11 +13994,11 @@ "reportableChange": 0 }, { - "name": "SessionEnergyDischarged", - "code": 67, + "name": "CurrentMode", + "code": 1, "mfgCode": null, "side": "server", - "type": "energy_mwh", + "type": "int8u", "included": 1, "storageOption": "External", "singleton": 0, @@ -13432,7 +14019,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -13448,7 +14035,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -13464,7 +14051,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -13480,7 +14067,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -13512,7 +14099,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "1", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -14570,78 +15157,6 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 - }, - { - "name": "GetRelayStatusLogResponse", - "code": 1, - "mfgCode": null, - "source": "server", - "isIncoming": 0, - "isEnabled": 0 - }, - { - "name": "GetRelayStatusLog", - "code": 4, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 0 - }, - { - "name": "SetActiveScheduleRequest", - "code": 5, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 0 - }, - { - "name": "SetActivePresetRequest", - "code": 6, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 0 - }, - { - "name": "StartPresetsSchedulesEditRequest", - "code": 7, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 0 - }, - { - "name": "CancelPresetsSchedulesEditRequest", - "code": 8, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 0 - }, - { - "name": "CommitPresetsSchedulesRequest", - "code": 9, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 0 - }, - { - "name": "CancelSetActivePresetRequest", - "code": 10, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 0 - }, - { - "name": "SetTemperatureSetpointHoldPolicy", - "code": 11, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 0 } ], "attributes": [ @@ -14879,7 +15394,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -14895,7 +15410,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -14991,7 +15506,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -15007,7 +15522,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -15071,7 +15586,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -20694,6 +21209,22 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TestDifferentVendorMeiRequest", + "code": 4294049962, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TestDifferentVendorMeiResponse", + "code": 4294049979, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -21993,6 +22524,22 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "MeiInt8u", + "code": 4294070017, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, { "name": "FeatureMap", "code": 65532, @@ -22040,6 +22587,13 @@ "mfgCode": null, "side": "server", "included": 1 + }, + { + "name": "TestDifferentVendorMeiEvent", + "code": 4294050030, + "mfgCode": null, + "side": "server", + "included": 1 } ] } @@ -22553,41 +23107,9 @@ "isIncoming": 0, "isEnabled": 1 }, - { - "name": "EnhancedAddScene", - "code": 64, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "EnhancedAddSceneResponse", - "code": 64, - "mfgCode": null, - "source": "server", - "isIncoming": 0, - "isEnabled": 1 - }, - { - "name": "EnhancedViewScene", - "code": 65, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "EnhancedViewSceneResponse", - "code": 65, - "mfgCode": null, - "source": "server", - "isIncoming": 0, - "isEnabled": 1 - }, { "name": "CopyScene", - "code": 66, + "code": 64, "mfgCode": null, "source": "client", "isIncoming": 1, @@ -22595,7 +23117,7 @@ }, { "name": "CopySceneResponse", - "code": 66, + "code": 64, "mfgCode": null, "source": "server", "isIncoming": 0, @@ -22603,25 +23125,9 @@ } ], "attributes": [ - { - "name": "NameSupport", - "code": 4, - "mfgCode": null, - "side": "server", - "type": "NameSupportBitmap", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x80", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, { "name": "LastConfiguredBy", - "code": 5, + "code": 0, "mfgCode": null, "side": "server", "type": "node_id", @@ -22637,7 +23143,7 @@ }, { "name": "SceneTableSize", - "code": 6, + "code": 1, "mfgCode": null, "side": "server", "type": "int16u", @@ -22653,7 +23159,7 @@ }, { "name": "FabricSceneInfo", - "code": 7, + "code": 2, "mfgCode": null, "side": "server", "type": "array", @@ -22741,7 +23247,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "15", + "defaultValue": "1", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -22757,7 +23263,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "5", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -24034,6 +24540,5 @@ "endpointId": 65534, "networkId": 0 } - ], - "log": [] -} \ No newline at end of file + ] +} diff --git a/examples/all-clusters-app/all-clusters-common/include/operational-state-delegate-impl.h b/examples/all-clusters-app/all-clusters-common/include/operational-state-delegate-impl.h index c8d63c2bb6efc2..0bcb76f324a1da 100644 --- a/examples/all-clusters-app/all-clusters-common/include/operational-state-delegate-impl.h +++ b/examples/all-clusters-app/all-clusters-common/include/operational-state-delegate-impl.h @@ -111,38 +111,11 @@ class OperationalStateDelegate : public GenericOperationalStateDelegateImpl } }; -void Shutdown(); - -} // namespace OperationalState - -namespace RvcOperationalState { - -// This is an application level delegate to handle operational state commands according to the specific business logic. -class RvcOperationalStateDelegate : public OperationalState::GenericOperationalStateDelegateImpl -{ -private: - const OperationalState::GenericOperationalState rvcOpStateList[7] = { - OperationalState::GenericOperationalState(to_underlying(OperationalState::OperationalStateEnum::kStopped)), - OperationalState::GenericOperationalState(to_underlying(OperationalState::OperationalStateEnum::kRunning)), - OperationalState::GenericOperationalState(to_underlying(OperationalState::OperationalStateEnum::kPaused)), - OperationalState::GenericOperationalState(to_underlying(OperationalState::OperationalStateEnum::kError)), - OperationalState::GenericOperationalState( - to_underlying(Clusters::RvcOperationalState::OperationalStateEnum::kSeekingCharger)), - OperationalState::GenericOperationalState(to_underlying(Clusters::RvcOperationalState::OperationalStateEnum::kCharging)), - OperationalState::GenericOperationalState(to_underlying(Clusters::RvcOperationalState::OperationalStateEnum::kDocked)), - }; - -public: - RvcOperationalStateDelegate() - { - GenericOperationalStateDelegateImpl::mOperationalStateList = - Span(rvcOpStateList); - } -}; +Instance * GetOperationalStateInstance(); void Shutdown(); -} // namespace RvcOperationalState +} // namespace OperationalState } // namespace Clusters } // namespace app } // namespace chip diff --git a/examples/all-clusters-app/all-clusters-common/include/oven-operational-state-delegate.h b/examples/all-clusters-app/all-clusters-common/include/oven-operational-state-delegate.h new file mode 100644 index 00000000000000..6d7338214f77ae --- /dev/null +++ b/examples/all-clusters-app/all-clusters-common/include/oven-operational-state-delegate.h @@ -0,0 +1,118 @@ +/* + * + * 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 +#include +#include +#include + +namespace chip { +namespace app { +namespace Clusters { + +namespace OvenCavityOperationalState { + +// This is an application level delegate to handle operational state commands according to the specific business logic. +class OvenCavityOperationalStateDelegate : public OperationalState::Delegate +{ +private: + inline static const Clusters::OperationalState::GenericOperationalState mOperationalStateList[] = { + OperationalState::GenericOperationalState(to_underlying(OperationalState::OperationalStateEnum::kStopped)), + OperationalState::GenericOperationalState(to_underlying(OperationalState::OperationalStateEnum::kRunning)), + OperationalState::GenericOperationalState(to_underlying(OperationalState::OperationalStateEnum::kPaused)), + OperationalState::GenericOperationalState(to_underlying(OperationalState::OperationalStateEnum::kError)) + }; + +public: + /** + * Get the countdown time. This attribute is not supported in our example app. + * @return Null. + */ + DataModel::Nullable GetCountdownTime() override { return DataModel::NullNullable; }; + + /** + * Fills in the provided GenericOperationalState with the state at index `index` if there is one, + * or returns CHIP_ERROR_NOT_FOUND if the index is out of range for the list of states. + * Note: This is used by the SDK to populate the operational state list attribute. If the contents of this list changes, + * the device SHALL call the Instance's ReportOperationalStateListChange method to report that this attribute has changed. + * @param index The index of the state, with 0 representing the first state. + * @param operationalState The GenericOperationalState is filled. + */ + CHIP_ERROR GetOperationalStateAtIndex(size_t index, + Clusters::OperationalState::GenericOperationalState & operationalState) override; + + /** + * Fills in the provided MutableCharSpan with the phase at index `index` if there is one, + * or returns CHIP_ERROR_NOT_FOUND if the index is out of range for the list of phases. + * Note: This is used by the SDK to populate the phase list attribute. If the contents of this list changes, the + * device SHALL call the Instance's ReportPhaseListChange method to report that this attribute has changed. + * @param index The index of the phase, with 0 representing the first phase. + * @param operationalPhase The MutableCharSpan is filled. + */ + CHIP_ERROR GetOperationalPhaseAtIndex(size_t index, MutableCharSpan & operationalPhase) override; + + // command callback + /** + * Handle Command Callback in application: Pause + * @param[out] get operational error after callback. + */ + void HandlePauseStateCallback(Clusters::OperationalState::GenericOperationalError & err) override + { + // This command in not supported. + err.Set(to_underlying(ErrorStateEnum::kCommandInvalidInState)); + }; + + /** + * Handle Command Callback in application: Resume + * @param[out] get operational error after callback. + */ + void HandleResumeStateCallback(Clusters::OperationalState::GenericOperationalError & err) override + { + // This command in not supported. + err.Set(to_underlying(ErrorStateEnum::kCommandInvalidInState)); + }; + + /** + * Handle Command Callback in application: Start + * @param[out] get operational error after callback. + */ + void HandleStartStateCallback(Clusters::OperationalState::GenericOperationalError & err) override + { + // This command in not supported. + err.Set(to_underlying(ErrorStateEnum::kCommandInvalidInState)); + }; + + /** + * Handle Command Callback in application: Stop + * @param[out] get operational error after callback. + */ + void HandleStopStateCallback(Clusters::OperationalState::GenericOperationalError & err) override + { + // This command in not supported. + err.Set(to_underlying(ErrorStateEnum::kCommandInvalidInState)); + }; +}; + +void Shutdown(); + +} // namespace OvenCavityOperationalState +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/examples/all-clusters-app/all-clusters-common/include/rvc-modes.h b/examples/all-clusters-app/all-clusters-common/include/rvc-modes.h index af8313fa285385..8af4aa5f6f9155 100644 --- a/examples/all-clusters-app/all-clusters-common/include/rvc-modes.h +++ b/examples/all-clusters-app/all-clusters-common/include/rvc-modes.h @@ -41,6 +41,7 @@ class RvcRunModeDelegate : public ModeBase::Delegate using ModeTagStructType = detail::Structs::ModeTagStruct::Type; ModeTagStructType ModeTagsIdle[1] = { { .value = to_underlying(ModeTag::kIdle) } }; ModeTagStructType ModeTagsCleaning[1] = { { .value = to_underlying(ModeTag::kCleaning) } }; + ModeTagStructType ModeTagsMapping[1] = { { .value = to_underlying(ModeTag::kMapping) } }; const detail::Structs::ModeOptionStruct::Type kModeOptions[3] = { detail::Structs::ModeOptionStruct::Type{ .label = CharSpan::fromCharString("Idle"), @@ -49,10 +50,9 @@ class RvcRunModeDelegate : public ModeBase::Delegate detail::Structs::ModeOptionStruct::Type{ .label = CharSpan::fromCharString("Cleaning"), .mode = ModeCleaning, .modeTags = DataModel::List(ModeTagsCleaning) }, - detail::Structs::ModeOptionStruct::Type{ - .label = CharSpan::fromCharString("Mapping"), - .mode = ModeMapping, - .modeTags = DataModel::List(ModeTagsIdle) }, // todo set to no mode tags + detail::Structs::ModeOptionStruct::Type{ .label = CharSpan::fromCharString("Mapping"), + .mode = ModeMapping, + .modeTags = DataModel::List(ModeTagsMapping) }, }; CHIP_ERROR Init() override; diff --git a/examples/all-clusters-app/ameba/main/include/OperationalStateManager.h b/examples/all-clusters-app/all-clusters-common/include/rvc-operational-state-delegate-impl.h similarity index 64% rename from examples/all-clusters-app/ameba/main/include/OperationalStateManager.h rename to examples/all-clusters-app/all-clusters-common/include/rvc-operational-state-delegate-impl.h index 2183e92078e6c7..89a3e69c5b8bed 100644 --- a/examples/all-clusters-app/ameba/main/include/OperationalStateManager.h +++ b/examples/all-clusters-app/all-clusters-common/include/rvc-operational-state-delegate-impl.h @@ -23,20 +23,34 @@ #include #include -void getOperationalStateSet(u8 state); - namespace chip { namespace app { namespace Clusters { -namespace OperationalState { - -Instance * GetOperationalStateInstance(); +namespace RvcOperationalState { // This is an application level delegate to handle operational state commands according to the specific business logic. -class GenericOperationalStateDelegateImpl : public Delegate +class RvcOperationalStateDelegate : public Delegate { +private: + const Clusters::OperationalState::GenericOperationalState rvcOpStateList[7] = { + OperationalState::GenericOperationalState(to_underlying(OperationalState::OperationalStateEnum::kStopped)), + OperationalState::GenericOperationalState(to_underlying(OperationalState::OperationalStateEnum::kRunning)), + OperationalState::GenericOperationalState(to_underlying(OperationalState::OperationalStateEnum::kPaused)), + OperationalState::GenericOperationalState(to_underlying(OperationalState::OperationalStateEnum::kError)), + OperationalState::GenericOperationalState( + to_underlying(Clusters::RvcOperationalState::OperationalStateEnum::kSeekingCharger)), + OperationalState::GenericOperationalState(to_underlying(Clusters::RvcOperationalState::OperationalStateEnum::kCharging)), + OperationalState::GenericOperationalState(to_underlying(Clusters::RvcOperationalState::OperationalStateEnum::kDocked)), + }; + + Span mOperationalStateList = + Span(rvcOpStateList); + Span mOperationalPhaseList; + public: + RvcOperationalStateDelegate() {} + /** * Get the countdown time. This attribute is not used in this application. * @return The current countdown time. @@ -51,19 +65,15 @@ class GenericOperationalStateDelegateImpl : public Delegate * @param index The index of the state, with 0 representing the first state. * @param operationalState The GenericOperationalState is filled. */ - CHIP_ERROR GetOperationalStateAtIndex(size_t index, GenericOperationalState & operationalState) override; + CHIP_ERROR GetOperationalStateAtIndex(size_t index, OperationalState::GenericOperationalState & operationalState) override; /** - * Fills in the provided MutableCharSpan with the phase at index `index` if there is one, + * Fills in the provided GenericOperationalPhase with the phase at index `index` if there is one, * or returns CHIP_ERROR_NOT_FOUND if the index is out of range for the list of phases. - * - * If CHIP_ERROR_NOT_FOUND is returned for index 0, that indicates that the PhaseList attribute is null - * (there are no phases defined at all). - * * Note: This is used by the SDK to populate the phase list attribute. If the contents of this list changes, the * device SHALL call the Instance's ReportPhaseListChange method to report that this attribute has changed. * @param index The index of the phase, with 0 representing the first phase. - * @param operationalPhase The MutableCharSpan is filled. + * @param operationalPhase The GenericOperationalPhase is filled. */ CHIP_ERROR GetOperationalPhaseAtIndex(size_t index, MutableCharSpan & operationalPhase) override; @@ -72,82 +82,37 @@ class GenericOperationalStateDelegateImpl : public Delegate * Handle Command Callback in application: Pause * @param[out] get operational error after callback. */ - void HandlePauseStateCallback(GenericOperationalError & err) override; + void HandlePauseStateCallback(OperationalState::GenericOperationalError & err) override; /** * Handle Command Callback in application: Resume * @param[out] get operational error after callback. */ - void HandleResumeStateCallback(GenericOperationalError & err) override; + void HandleResumeStateCallback(OperationalState::GenericOperationalError & err) override; /** * Handle Command Callback in application: Start * @param[out] get operational error after callback. */ - void HandleStartStateCallback(GenericOperationalError & err) override; + void HandleStartStateCallback(OperationalState::GenericOperationalError & err) override; /** * Handle Command Callback in application: Stop * @param[out] get operational error after callback. */ - void HandleStopStateCallback(GenericOperationalError & err) override; - -protected: - Span mOperationalStateList; - Span mOperationalPhaseList; -}; - -// This is an application level delegate to handle operational state commands according to the specific business logic. -class OperationalStateDelegate : public GenericOperationalStateDelegateImpl -{ -private: - const GenericOperationalState opStateList[4] = { - GenericOperationalState(to_underlying(OperationalStateEnum::kStopped)), - GenericOperationalState(to_underlying(OperationalStateEnum::kRunning)), - GenericOperationalState(to_underlying(OperationalStateEnum::kPaused)), - GenericOperationalState(to_underlying(OperationalStateEnum::kError)), - }; + void HandleStopStateCallback(OperationalState::GenericOperationalError & err) override; -public: - OperationalStateDelegate() - { - GenericOperationalStateDelegateImpl::mOperationalStateList = Span(opStateList); - } + /** + * Handle the GoHome command. + * @param err + */ + void HandleGoHomeCommandCallback(OperationalState::GenericOperationalError & err) override; }; void Shutdown(); -} // namespace OperationalState - -namespace RvcOperationalState { - Instance * GetRvcOperationalStateInstance(); -// This is an application level delegate to handle operational state commands according to the specific business logic. -class RvcOperationalStateDelegate : public OperationalState::GenericOperationalStateDelegateImpl -{ -private: - const OperationalState::GenericOperationalState rvcOpStateList[7] = { - OperationalState::GenericOperationalState(to_underlying(OperationalState::OperationalStateEnum::kStopped)), - OperationalState::GenericOperationalState(to_underlying(OperationalState::OperationalStateEnum::kRunning)), - OperationalState::GenericOperationalState(to_underlying(OperationalState::OperationalStateEnum::kPaused)), - OperationalState::GenericOperationalState(to_underlying(OperationalState::OperationalStateEnum::kError)), - OperationalState::GenericOperationalState( - to_underlying(Clusters::RvcOperationalState::OperationalStateEnum::kSeekingCharger)), - OperationalState::GenericOperationalState(to_underlying(Clusters::RvcOperationalState::OperationalStateEnum::kCharging)), - OperationalState::GenericOperationalState(to_underlying(Clusters::RvcOperationalState::OperationalStateEnum::kDocked)), - }; - -public: - RvcOperationalStateDelegate() - { - GenericOperationalStateDelegateImpl::mOperationalStateList = - Span(rvcOpStateList); - } -}; - -void Shutdown(); - } // namespace RvcOperationalState } // namespace Clusters } // namespace app diff --git a/examples/all-clusters-app/all-clusters-common/src/air-quality-instance.cpp b/examples/all-clusters-app/all-clusters-common/src/air-quality-instance.cpp index c78f34e9a8f31f..9297cd79960b89 100644 --- a/examples/all-clusters-app/all-clusters-common/src/air-quality-instance.cpp +++ b/examples/all-clusters-app/all-clusters-common/src/air-quality-instance.cpp @@ -1,3 +1,20 @@ +/* + * + * 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 using namespace chip::app::Clusters; diff --git a/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp b/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp index 385c1cfa43c8ee..ddbfe17e639d60 100644 --- a/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp +++ b/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp @@ -50,10 +50,9 @@ void emberAfDeviceEnergyManagementClusterInitCallback(chip::EndpointId endpointI gInstance = std::make_unique( endpointId, *gDelegate, BitMask( - DeviceEnergyManagement::Feature::kPowerForecastReporting, DeviceEnergyManagement::Feature::kStateForecastReporting, - DeviceEnergyManagement::Feature::kPowerAdjustment, DeviceEnergyManagement::Feature::kForecastAdjustment), - BitMask(OptionalCommands::kSupportsModifyForecastRequest, - OptionalCommands::kSupportsRequestConstraintBasedForecast)); + DeviceEnergyManagement::Feature::kPowerAdjustment, DeviceEnergyManagement::Feature::kPowerForecastReporting, + DeviceEnergyManagement::Feature::kStateForecastReporting, DeviceEnergyManagement::Feature::kStartTimeAdjustment, + DeviceEnergyManagement::Feature::kPausable)); if (!gInstance) { diff --git a/examples/all-clusters-app/all-clusters-common/src/operational-state-delegate-impl.cpp b/examples/all-clusters-app/all-clusters-common/src/operational-state-delegate-impl.cpp index 02bcd4a775a07e..3370d75bd65f35 100644 --- a/examples/all-clusters-app/all-clusters-common/src/operational-state-delegate-impl.cpp +++ b/examples/all-clusters-app/all-clusters-common/src/operational-state-delegate-impl.cpp @@ -103,6 +103,11 @@ void GenericOperationalStateDelegateImpl::HandleStopStateCallback(GenericOperati static OperationalState::Instance * gOperationalStateInstance = nullptr; static OperationalStateDelegate * gOperationalStateDelegate = nullptr; +OperationalState::Instance * OperationalState::GetOperationalStateInstance() +{ + return gOperationalStateInstance; +} + void OperationalState::Shutdown() { if (gOperationalStateInstance != nullptr) @@ -130,36 +135,3 @@ void emberAfOperationalStateClusterInitCallback(chip::EndpointId endpointId) gOperationalStateInstance->Init(); } - -// Init RVC Operational State cluster - -static OperationalState::Instance * gRvcOperationalStateInstance = nullptr; -static RvcOperationalStateDelegate * gRvcOperationalStateDelegate = nullptr; - -void RvcOperationalState::Shutdown() -{ - if (gRvcOperationalStateInstance != nullptr) - { - delete gRvcOperationalStateInstance; - gRvcOperationalStateInstance = nullptr; - } - if (gRvcOperationalStateDelegate != nullptr) - { - delete gRvcOperationalStateDelegate; - gRvcOperationalStateDelegate = nullptr; - } -} - -void emberAfRvcOperationalStateClusterInitCallback(chip::EndpointId endpointId) -{ - VerifyOrDie(endpointId == 1); // this cluster is only enabled for endpoint 1. - VerifyOrDie(gRvcOperationalStateInstance == nullptr && gRvcOperationalStateDelegate == nullptr); - - gRvcOperationalStateDelegate = new RvcOperationalStateDelegate; - EndpointId operationalStateEndpoint = 0x01; - gRvcOperationalStateInstance = new RvcOperationalState::Instance(gRvcOperationalStateDelegate, operationalStateEndpoint); - - gRvcOperationalStateInstance->SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kStopped)); - - gRvcOperationalStateInstance->Init(); -} diff --git a/examples/all-clusters-app/all-clusters-common/src/oven-modes.cpp b/examples/all-clusters-app/all-clusters-common/src/oven-modes.cpp index 017f6b8eae2ac7..a3b8e4ac2a0761 100644 --- a/examples/all-clusters-app/all-clusters-common/src/oven-modes.cpp +++ b/examples/all-clusters-app/all-clusters-common/src/oven-modes.cpp @@ -101,7 +101,6 @@ void emberAfOvenModeClusterInitCallback(chip::EndpointId endpointId) VerifyOrDie(endpointId == 1); // this cluster is only enabled for endpoint 1. VerifyOrDie(gOvenModeDelegate == nullptr && gOvenModeInstance == nullptr); gOvenModeDelegate = new OvenMode::OvenModeDelegate; - gOvenModeInstance = - new ModeBase::Instance(gOvenModeDelegate, 0x1, OvenMode::Id, chip::to_underlying(OvenMode::Feature::kOnOff)); + gOvenModeInstance = new ModeBase::Instance(gOvenModeDelegate, 0x1, OvenMode::Id, 0x0); gOvenModeInstance->Init(); } diff --git a/examples/all-clusters-app/all-clusters-common/src/oven-operational-state-delegate.cpp b/examples/all-clusters-app/all-clusters-common/src/oven-operational-state-delegate.cpp new file mode 100644 index 00000000000000..ecae5c88006ef4 --- /dev/null +++ b/examples/all-clusters-app/all-clusters-common/src/oven-operational-state-delegate.cpp @@ -0,0 +1,73 @@ +/* + * + * 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 + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::OvenCavityOperationalState; + +static OperationalState::Instance * gOvenCavityOperationalStateInstance = nullptr; +static OvenCavityOperationalStateDelegate * gOvenCavityOperationalStateDelegate = nullptr; + +void OvenCavityOperationalState::Shutdown() +{ + if (gOvenCavityOperationalStateInstance != nullptr) + { + delete gOvenCavityOperationalStateInstance; + gOvenCavityOperationalStateInstance = nullptr; + } + if (gOvenCavityOperationalStateDelegate != nullptr) + { + delete gOvenCavityOperationalStateDelegate; + gOvenCavityOperationalStateDelegate = nullptr; + } +} + +void emberAfOvenCavityOperationalStateClusterInitCallback(chip::EndpointId endpointId) +{ + VerifyOrDie(endpointId == 1); // this cluster is only enabled for endpoint 1. + VerifyOrDie(gOvenCavityOperationalStateInstance == nullptr && gOvenCavityOperationalStateDelegate == nullptr); + + gOvenCavityOperationalStateDelegate = new OvenCavityOperationalStateDelegate; + EndpointId operationalStateEndpoint = 0x01; + gOvenCavityOperationalStateInstance = + new OvenCavityOperationalState::Instance(gOvenCavityOperationalStateDelegate, operationalStateEndpoint); + + gOvenCavityOperationalStateInstance->SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kStopped)); + + gOvenCavityOperationalStateInstance->Init(); +} + +CHIP_ERROR +OvenCavityOperationalStateDelegate::GetOperationalStateAtIndex(size_t index, + OperationalState::GenericOperationalState & operationalState) +{ + if (index >= ArraySize(mOperationalStateList)) + { + return CHIP_ERROR_NOT_FOUND; + } + operationalState = mOperationalStateList[index]; + return CHIP_NO_ERROR; +} + +CHIP_ERROR +OvenCavityOperationalStateDelegate::GetOperationalPhaseAtIndex(size_t index, MutableCharSpan & operationalPhase) +{ + return CHIP_ERROR_NOT_FOUND; +} diff --git a/examples/all-clusters-app/all-clusters-common/src/rvc-modes.cpp b/examples/all-clusters-app/all-clusters-common/src/rvc-modes.cpp index 480c8f793ceb4d..999d62ae48c263 100644 --- a/examples/all-clusters-app/all-clusters-common/src/rvc-modes.cpp +++ b/examples/all-clusters-app/all-clusters-common/src/rvc-modes.cpp @@ -43,7 +43,7 @@ void RvcRunModeDelegate::HandleChangeToMode(uint8_t NewMode, ModeBase::Commands: // Our business logic states that we can only switch into the mapping state from the idle state. if (NewMode == RvcRunMode::ModeMapping && currentMode != RvcRunMode::ModeIdle) { - response.status = to_underlying(ModeBase::StatusCode::kGenericFailure); + response.status = to_underlying(ModeBase::StatusCode::kInvalidInMode); response.statusText.SetValue(chip::CharSpan::fromCharString("Change to the mapping mode is only allowed from idle")); return; } @@ -112,8 +112,7 @@ void emberAfRvcRunModeClusterInitCallback(chip::EndpointId endpointId) VerifyOrDie(endpointId == 1); // this cluster is only enabled for endpoint 1. VerifyOrDie(gRvcRunModeDelegate == nullptr && gRvcRunModeInstance == nullptr); gRvcRunModeDelegate = new RvcRunMode::RvcRunModeDelegate; - gRvcRunModeInstance = - new ModeBase::Instance(gRvcRunModeDelegate, 0x1, RvcRunMode::Id, chip::to_underlying(RvcRunMode::Feature::kOnOff)); + gRvcRunModeInstance = new ModeBase::Instance(gRvcRunModeDelegate, 0x1, RvcRunMode::Id, 0); gRvcRunModeInstance->Init(); } @@ -130,10 +129,11 @@ void RvcCleanModeDelegate::HandleChangeToMode(uint8_t NewMode, ModeBase::Command { uint8_t rvcRunCurrentMode = gRvcRunModeInstance->GetCurrentMode(); - if (rvcRunCurrentMode == RvcRunMode::ModeCleaning) + if (rvcRunCurrentMode != RvcRunMode::ModeIdle) { - response.status = to_underlying(RvcCleanMode::StatusCode::kCleaningInProgress); - response.statusText.SetValue(chip::CharSpan::fromCharString("Cannot change the cleaning mode during a clean")); + response.status = to_underlying(ModeBase::StatusCode::kInvalidInMode); + response.statusText.SetValue( + chip::CharSpan::fromCharString("Cannot change the cleaning mode when the device is not in idle")); return; } @@ -201,7 +201,6 @@ void emberAfRvcCleanModeClusterInitCallback(chip::EndpointId endpointId) VerifyOrDie(endpointId == 1); // this cluster is only enabled for endpoint 1. VerifyOrDie(gRvcCleanModeDelegate == nullptr && gRvcCleanModeInstance == nullptr); gRvcCleanModeDelegate = new RvcCleanMode::RvcCleanModeDelegate; - gRvcCleanModeInstance = - new ModeBase::Instance(gRvcCleanModeDelegate, 0x1, RvcCleanMode::Id, chip::to_underlying(RvcCleanMode::Feature::kOnOff)); + gRvcCleanModeInstance = new ModeBase::Instance(gRvcCleanModeDelegate, 0x1, RvcCleanMode::Id, 0); gRvcCleanModeInstance->Init(); } diff --git a/examples/all-clusters-app/ameba/main/OperationalStateManager.cpp b/examples/all-clusters-app/all-clusters-common/src/rvc-operational-state-delegate-impl.cpp similarity index 53% rename from examples/all-clusters-app/ameba/main/OperationalStateManager.cpp rename to examples/all-clusters-app/all-clusters-common/src/rvc-operational-state-delegate-impl.cpp index 8dbeda60d75526..946110bb18906c 100644 --- a/examples/all-clusters-app/ameba/main/OperationalStateManager.cpp +++ b/examples/all-clusters-app/all-clusters-common/src/rvc-operational-state-delegate-impl.cpp @@ -15,15 +15,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include +#include using namespace chip; using namespace chip::app; using namespace chip::app::Clusters; -using namespace chip::app::Clusters::OperationalState; using namespace chip::app::Clusters::RvcOperationalState; -CHIP_ERROR GenericOperationalStateDelegateImpl::GetOperationalStateAtIndex(size_t index, GenericOperationalState & operationalState) +CHIP_ERROR RvcOperationalStateDelegate::GetOperationalStateAtIndex(size_t index, + OperationalState::GenericOperationalState & operationalState) { if (index >= mOperationalStateList.size()) { @@ -33,7 +33,7 @@ CHIP_ERROR GenericOperationalStateDelegateImpl::GetOperationalStateAtIndex(size_ return CHIP_NO_ERROR; } -CHIP_ERROR GenericOperationalStateDelegateImpl::GetOperationalPhaseAtIndex(size_t index, MutableCharSpan & operationalPhase) +CHIP_ERROR RvcOperationalStateDelegate::GetOperationalPhaseAtIndex(size_t index, MutableCharSpan & operationalPhase) { if (index >= mOperationalPhaseList.size()) { @@ -42,98 +42,76 @@ CHIP_ERROR GenericOperationalStateDelegateImpl::GetOperationalPhaseAtIndex(size_ return CopyCharSpanToMutableCharSpan(mOperationalPhaseList[index], operationalPhase); } -void GenericOperationalStateDelegateImpl::HandlePauseStateCallback(GenericOperationalError & err) +void RvcOperationalStateDelegate::HandlePauseStateCallback(OperationalState::GenericOperationalError & err) { + // placeholder implementation auto error = GetInstance()->SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kPaused)); if (error == CHIP_NO_ERROR) { - err.Set(to_underlying(ErrorStateEnum::kNoError)); + err.Set(to_underlying(OperationalState::ErrorStateEnum::kNoError)); } else { - err.Set(to_underlying(ErrorStateEnum::kUnableToCompleteOperation)); + err.Set(to_underlying(OperationalState::ErrorStateEnum::kUnableToCompleteOperation)); } } -void GenericOperationalStateDelegateImpl::HandleResumeStateCallback(GenericOperationalError & err) +void RvcOperationalStateDelegate::HandleResumeStateCallback(OperationalState::GenericOperationalError & err) { - auto error = GetInstance()->SetOperationalState(to_underlying(OperationalStateEnum::kRunning)); + // placeholder implementation + auto error = GetInstance()->SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kRunning)); if (error == CHIP_NO_ERROR) { - err.Set(to_underlying(ErrorStateEnum::kNoError)); + err.Set(to_underlying(OperationalState::ErrorStateEnum::kNoError)); } else { - err.Set(to_underlying(ErrorStateEnum::kUnableToCompleteOperation)); + err.Set(to_underlying(OperationalState::ErrorStateEnum::kUnableToCompleteOperation)); } } -void GenericOperationalStateDelegateImpl::HandleStartStateCallback(GenericOperationalError & err) +void RvcOperationalStateDelegate::HandleStartStateCallback(OperationalState::GenericOperationalError & err) { - auto error = GetInstance()->SetOperationalState(to_underlying(OperationalStateEnum::kRunning)); + // placeholder implementation + auto error = GetInstance()->SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kRunning)); if (error == CHIP_NO_ERROR) { - err.Set(to_underlying(ErrorStateEnum::kNoError)); + err.Set(to_underlying(OperationalState::ErrorStateEnum::kNoError)); } else { - err.Set(to_underlying(ErrorStateEnum::kUnableToCompleteOperation)); + err.Set(to_underlying(OperationalState::ErrorStateEnum::kUnableToCompleteOperation)); } } -void GenericOperationalStateDelegateImpl::HandleStopStateCallback(GenericOperationalError & err) +void RvcOperationalStateDelegate::HandleStopStateCallback(OperationalState::GenericOperationalError & err) { - auto error = GetInstance()->SetOperationalState(to_underlying(OperationalStateEnum::kStopped)); + // placeholder implementation + auto error = GetInstance()->SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kStopped)); if (error == CHIP_NO_ERROR) { - err.Set(to_underlying(ErrorStateEnum::kNoError)); + err.Set(to_underlying(OperationalState::ErrorStateEnum::kNoError)); } else { - err.Set(to_underlying(ErrorStateEnum::kUnableToCompleteOperation)); + err.Set(to_underlying(OperationalState::ErrorStateEnum::kUnableToCompleteOperation)); } } -// Init Operational State cluster - -static OperationalState::Instance * gOperationalStateInstance = nullptr; -static OperationalStateDelegate * gOperationalStateDelegate = nullptr; - -void OperationalState::Shutdown() +void RvcOperationalStateDelegate::HandleGoHomeCommandCallback(OperationalState::GenericOperationalError & err) { - if (gOperationalStateInstance != nullptr) + // placeholder implementation + auto error = GetInstance()->SetOperationalState(to_underlying(OperationalStateEnum::kSeekingCharger)); + if (error == CHIP_NO_ERROR) { - delete gOperationalStateInstance; - gOperationalStateInstance = nullptr; + err.Set(to_underlying(OperationalState::ErrorStateEnum::kNoError)); } - if (gOperationalStateDelegate != nullptr) + else { - delete gOperationalStateDelegate; - gOperationalStateDelegate = nullptr; + err.Set(to_underlying(OperationalState::ErrorStateEnum::kUnableToCompleteOperation)); } } -OperationalState::Instance * OperationalState::GetOperationalStateInstance() -{ - return gOperationalStateInstance; -} - -void emberAfOperationalStateClusterInitCallback(chip::EndpointId endpointId) -{ - VerifyOrDie(endpointId == 1); // this cluster is only enabled for endpoint 1. - VerifyOrDie(gOperationalStateInstance == nullptr && gOperationalStateDelegate == nullptr); - - gOperationalStateDelegate = new OperationalStateDelegate; - EndpointId operationalStateEndpoint = 0x01; - gOperationalStateInstance = new OperationalState::Instance(gOperationalStateDelegate, operationalStateEndpoint); - - gOperationalStateInstance->SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kStopped)); - - gOperationalStateInstance->Init(); -} - -// Init RVC Operational State cluster - static RvcOperationalState::Instance * gRvcOperationalStateInstance = nullptr; static RvcOperationalStateDelegate * gRvcOperationalStateDelegate = nullptr; diff --git a/examples/all-clusters-app/ameba/chip_main.cmake b/examples/all-clusters-app/ameba/chip_main.cmake index 66528a9941141a..6cc76ad25e7dd8 100755 --- a/examples/all-clusters-app/ameba/chip_main.cmake +++ b/examples/all-clusters-app/ameba/chip_main.cmake @@ -166,13 +166,14 @@ list( ${chip_dir}/examples/all-clusters-app/all-clusters-common/src/smco-stub.cpp ${chip_dir}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp ${chip_dir}/examples/all-clusters-app/all-clusters-common/src/static-supported-temperature-levels.cpp + ${chip_dir}/examples/all-clusters-app/all-clusters-common/src/operational-state-delegate-impl.cpp + ${chip_dir}/examples/all-clusters-app/all-clusters-common/src/rvc-operational-state-delegate-impl.cpp ${chip_dir}/examples/all-clusters-app/ameba/main/chipinterface.cpp ${chip_dir}/examples/all-clusters-app/ameba/main/BindingHandler.cpp ${chip_dir}/examples/all-clusters-app/ameba/main/DeviceCallbacks.cpp ${chip_dir}/examples/all-clusters-app/ameba/main/CHIPDeviceManager.cpp ${chip_dir}/examples/all-clusters-app/ameba/main/Globals.cpp ${chip_dir}/examples/all-clusters-app/ameba/main/LEDWidget.cpp - ${chip_dir}/examples/all-clusters-app/ameba/main/OperationalStateManager.cpp ${chip_dir}/examples/all-clusters-app/ameba/main/ManualOperationCommand.cpp ${chip_dir}/examples/all-clusters-app/ameba/main/SmokeCOAlarmManager.cpp diff --git a/examples/all-clusters-app/ameba/main/include/ManualOperationalStateCommand.h b/examples/all-clusters-app/ameba/main/include/ManualOperationalStateCommand.h index 5d4373597a2d00..fc2825576e6b72 100644 --- a/examples/all-clusters-app/ameba/main/include/ManualOperationalStateCommand.h +++ b/examples/all-clusters-app/ameba/main/include/ManualOperationalStateCommand.h @@ -18,7 +18,8 @@ #include "controller/InvokeInteraction.h" #include "controller/ReadInteraction.h" -#include +#include "operational-state-delegate-impl.h" +#include "rvc-operational-state-delegate-impl.h" #if CONFIG_ENABLE_CHIP_SHELL #include "lib/shell/Engine.h" diff --git a/examples/all-clusters-app/esp32/main/CMakeLists.txt b/examples/all-clusters-app/esp32/main/CMakeLists.txt index 623e2ded547abe..f2f432a60d615a 100644 --- a/examples/all-clusters-app/esp32/main/CMakeLists.txt +++ b/examples/all-clusters-app/esp32/main/CMakeLists.txt @@ -28,6 +28,8 @@ set(SRC_DIRS_LIST "${CMAKE_CURRENT_LIST_DIR}" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/app-common/app-common/zap-generated/attributes" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/app-common/app-common/zap-generated" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/all-clusters-app/all-clusters-common/src" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/energy-management-app/energy-management-common/src" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/ota" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/common" @@ -38,9 +40,11 @@ set(SRC_DIRS_LIST "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/util" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/reporting" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/administrator-commissioning-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/air-quality-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/test-cluster-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/boolean-state-configuration-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/descriptor" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/energy-evse-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/fault-injection-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/fan-control-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/fixed-label-server" @@ -56,6 +60,7 @@ set(SRC_DIRS_LIST "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/groups-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/color-control-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/operational-credentials-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/operational-state-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/mode-select-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/mode-base-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/low-power-server" @@ -90,9 +95,8 @@ set(SRC_DIRS_LIST "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/time-synchronization-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/valve-configuration-and-control-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/dishwasher-alarm-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/laundry-washer-controls-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/laundry-washer-controls-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/laundry-dryer-controls-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/all-clusters-app/all-clusters-common/src" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/electrical-energy-measurement-server" ) diff --git a/examples/all-clusters-app/esp32/sdkconfig.defaults.esp32c6 b/examples/all-clusters-app/esp32/sdkconfig.defaults.esp32c6 index 7ef46707ea5c95..29a525f2a75994 100644 --- a/examples/all-clusters-app/esp32/sdkconfig.defaults.esp32c6 +++ b/examples/all-clusters-app/esp32/sdkconfig.defaults.esp32c6 @@ -19,13 +19,13 @@ CONFIG_BT_ENABLED=y CONFIG_BT_NIMBLE_ENABLED=y CONFIG_BT_NIMBLE_EXT_ADV=n CONFIG_BT_NIMBLE_HCI_EVT_BUF_SIZE=70 -CONFIG_USE_BLE_ONLY_FOR_COMMISSIONING=n +CONFIG_USE_BLE_ONLY_FOR_COMMISSIONING=y # Disable OpenThread CONFIG_OPENTHREAD_ENABLED=n # Disable lwip ipv6 autoconfig -CONFIG_LWIP_IPV6_AUTOCONFIG=n +CONFIG_LWIP_IPV6_AUTOCONFIG=y # Use a custom partition table CONFIG_PARTITION_TABLE_CUSTOM=y diff --git a/examples/all-clusters-app/linux/AppOptions.cpp b/examples/all-clusters-app/linux/AppOptions.cpp index ef42660972f8d9..50be6561c6bb4a 100644 --- a/examples/all-clusters-app/linux/AppOptions.cpp +++ b/examples/all-clusters-app/linux/AppOptions.cpp @@ -27,11 +27,23 @@ using chip::ArgParser::OptionDef; using chip::ArgParser::OptionSet; using chip::ArgParser::PrintArgError; -constexpr uint16_t kOptionDacProviderFilePath = 0xFF01; -constexpr uint16_t kOptionMinCommissioningTimeout = 0xFF02; +constexpr uint16_t kOptionDacProviderFilePath = 0xFF01; +constexpr uint16_t kOptionMinCommissioningTimeout = 0xFF02; +constexpr uint16_t kOptionEndUserSupportFilePath = 0xFF03; +constexpr uint16_t kOptionNetworkDiagnosticsFilePath = 0xFF04; +constexpr uint16_t kOptionCrashFilePath = 0xFF05; static chip::Credentials::Examples::TestHarnessDACProvider mDacProvider; +static chip::Optional sEndUserSupportLogFilePath; +static chip::Optional sNetworkDiagnosticsLogFilePath; +static chip::Optional sCrashLogFilePath; + +bool AppOptions::IsEmptyString(const char * value) +{ + return (value == nullptr || strlen(value) == 0); +} + bool AppOptions::HandleOptions(const char * program, OptionSet * options, int identifier, const char * name, const char * value) { bool retval = true; @@ -45,6 +57,27 @@ bool AppOptions::HandleOptions(const char * program, OptionSet * options, int id commissionMgr.OverrideMinCommissioningTimeout(chip::System::Clock::Seconds16(static_cast(atoi(value)))); break; } + case kOptionEndUserSupportFilePath: { + if (!IsEmptyString(value)) + { + sEndUserSupportLogFilePath.SetValue(value); + } + break; + } + case kOptionNetworkDiagnosticsFilePath: { + if (!IsEmptyString(value)) + { + sNetworkDiagnosticsLogFilePath.SetValue(value); + } + break; + } + case kOptionCrashFilePath: { + if (!IsEmptyString(value)) + { + sCrashLogFilePath.SetValue(value); + } + break; + } default: PrintArgError("%s: INTERNAL ERROR: Unhandled option: %s\n", program, name); retval = false; @@ -59,6 +92,9 @@ OptionSet * AppOptions::GetOptions() static OptionDef optionsDef[] = { { "dac_provider", kArgumentRequired, kOptionDacProviderFilePath }, { "min_commissioning_timeout", kArgumentRequired, kOptionMinCommissioningTimeout }, + { "end_user_support_log", kArgumentRequired, kOptionEndUserSupportFilePath }, + { "network_diagnostics_log", kArgumentRequired, kOptionNetworkDiagnosticsFilePath }, + { "crash_log", kArgumentRequired, kOptionCrashFilePath }, {}, }; @@ -68,6 +104,12 @@ OptionSet * AppOptions::GetOptions() " A json file with data used by the example dac provider to validate device attestation procedure.\n" " --min_commissioning_timeout \n" " The minimum time in seconds during which commissioning session establishment is allowed by the Node.\n" + " --end_user_support_log \n" + " The end user support log file to be used for diagnostic logs transfer.\n" + " --network_diagnostics_log \n" + " The network diagnostics log file to be used for diagnostic logs transfer.\n" + " --crash_log \n" + " The crash log file to be used for diagnostic logs transfer.\n" }; return &options; @@ -77,3 +119,18 @@ chip::Credentials::DeviceAttestationCredentialsProvider * AppOptions::GetDACProv { return &mDacProvider; } + +chip::Optional AppOptions::GetEndUserSupportLogFilePath() +{ + return sEndUserSupportLogFilePath; +} + +chip::Optional AppOptions::GetNetworkDiagnosticsLogFilePath() +{ + return sNetworkDiagnosticsLogFilePath; +} + +chip::Optional AppOptions::GetCrashLogFilePath() +{ + return sCrashLogFilePath; +} diff --git a/examples/all-clusters-app/linux/AppOptions.h b/examples/all-clusters-app/linux/AppOptions.h index 3073c66176331f..dfdd2c0e66fe70 100644 --- a/examples/all-clusters-app/linux/AppOptions.h +++ b/examples/all-clusters-app/linux/AppOptions.h @@ -1,6 +1,6 @@ /* * - * Copyright (c) 2022 Project CHIP Authors + * Copyright (c) 2022-2023 Project CHIP Authors * All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -27,8 +27,13 @@ class AppOptions public: static chip::ArgParser::OptionSet * GetOptions(); static chip::Credentials::DeviceAttestationCredentialsProvider * GetDACProvider(); + static chip::Optional GetEndUserSupportLogFilePath(); + static chip::Optional GetNetworkDiagnosticsLogFilePath(); + static chip::Optional GetCrashLogFilePath(); private: static bool HandleOptions(const char * program, chip::ArgParser::OptionSet * options, int identifier, const char * name, const char * value); + + static bool IsEmptyString(const char * value); }; diff --git a/examples/all-clusters-app/linux/BUILD.gn b/examples/all-clusters-app/linux/BUILD.gn index 8b031d769773e4..20dd248abf2a1a 100644 --- a/examples/all-clusters-app/linux/BUILD.gn +++ b/examples/all-clusters-app/linux/BUILD.gn @@ -37,16 +37,21 @@ source_set("chip-all-clusters-common") { "${chip_root}/examples/all-clusters-app/all-clusters-common/src/microwave-oven-mode.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/operational-state-delegate-impl.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/oven-modes.cpp", + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/oven-operational-state-delegate.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/resource-monitoring-delegates.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/rvc-modes.cpp", + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/rvc-operational-state-delegate-impl.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/smco-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-temperature-levels.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/tcc-mode.cpp", + "${chip_root}/examples/all-clusters-app/linux/diagnostic-logs-provider-delegate-impl.cpp", "${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp", "${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementManager.cpp", "${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp", "${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseManager.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/src/device-energy-management-mode.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/src/energy-evse-mode.cpp", "AllClustersCommandDelegate.cpp", "AppOptions.cpp", "ValveControlDelegate.cpp", diff --git a/examples/all-clusters-app/linux/ValveControlDelegate.cpp b/examples/all-clusters-app/linux/ValveControlDelegate.cpp index 9c51aff63101f5..d0ce1b4ab3a980 100644 --- a/examples/all-clusters-app/linux/ValveControlDelegate.cpp +++ b/examples/all-clusters-app/linux/ValveControlDelegate.cpp @@ -70,7 +70,7 @@ void ValveControlDelegate::HandleRemainingDurationTick(uint32_t duration) sLastOpenDuration = duration; } -void ExtendedTimeSyncDelegate::UTCTimeChanged(uint64_t time) +void ExtendedTimeSyncDelegate::UTCTimeAvailabilityChanged(uint64_t time) { ValveConfigurationAndControl::UpdateAutoCloseTime(time); } diff --git a/examples/all-clusters-app/linux/ValveControlDelegate.h b/examples/all-clusters-app/linux/ValveControlDelegate.h index 76f0f17a8fdfd1..8781137af299f5 100644 --- a/examples/all-clusters-app/linux/ValveControlDelegate.h +++ b/examples/all-clusters-app/linux/ValveControlDelegate.h @@ -40,7 +40,7 @@ namespace TimeSynchronization { class ExtendedTimeSyncDelegate : public DefaultTimeSyncDelegate { public: - void UTCTimeChanged(uint64_t time) override; + void UTCTimeAvailabilityChanged(uint64_t time) override; }; } // namespace TimeSynchronization diff --git a/examples/all-clusters-app/linux/diagnostic-logs-provider-delegate-impl.cpp b/examples/all-clusters-app/linux/diagnostic-logs-provider-delegate-impl.cpp new file mode 100644 index 00000000000000..4dc94da1338c28 --- /dev/null +++ b/examples/all-clusters-app/linux/diagnostic-logs-provider-delegate-impl.cpp @@ -0,0 +1,177 @@ +/* + * + * 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 "include/diagnostic-logs-provider-delegate-impl.h" + +#include + +using namespace chip; +using namespace chip::app::Clusters::DiagnosticLogs; + +LogProvider LogProvider::sInstance; + +namespace { +bool IsValidIntent(IntentEnum intent) +{ + return intent != IntentEnum::kUnknownEnumValue; +} + +size_t GetFileSize(FILE * fp) +{ + VerifyOrReturnValue(nullptr != fp, 0); + + auto offset = ftell(fp); + VerifyOrReturnValue(offset != -1, 0); + + auto rv = fseek(fp, 0, SEEK_END); + VerifyOrReturnValue(rv == 0, 0); + + auto fileSize = ftell(fp); + VerifyOrReturnValue(fileSize != -1, 0); + + rv = fseek(fp, offset, SEEK_SET); + VerifyOrReturnValue(rv == 0, 0); + + return static_cast(fileSize); +} +} // namespace + +LogProvider::~LogProvider() +{ + for (auto f : mFiles) + { + auto rv = fclose(f.second); + if (rv != 0) + { + ChipLogError(NotSpecified, "Error when closing file pointer: %p (%d)", f.second, errno); + } + } + mFiles.clear(); +} + +CHIP_ERROR LogProvider::GetLogForIntent(IntentEnum intent, MutableByteSpan & outBuffer, Optional & outTimeStamp, + Optional & outTimeSinceBoot) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + LogSessionHandle sessionHandle = kInvalidLogSessionHandle; + + err = StartLogCollection(intent, sessionHandle, outTimeStamp, outTimeSinceBoot); + VerifyOrReturnError(CHIP_NO_ERROR == err, err, outBuffer.reduce_size(0)); + + bool unusedOutIsEndOfLog; + err = CollectLog(sessionHandle, outBuffer, unusedOutIsEndOfLog); + VerifyOrReturnError(CHIP_NO_ERROR == err, err, outBuffer.reduce_size(0)); + + err = EndLogCollection(sessionHandle); + VerifyOrReturnError(CHIP_NO_ERROR == err, err, outBuffer.reduce_size(0)); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR LogProvider::StartLogCollection(IntentEnum intent, LogSessionHandle & outHandle, Optional & outTimeStamp, + Optional & outTimeSinceBoot) +{ + VerifyOrReturnValue(IsValidIntent(intent), CHIP_ERROR_INVALID_ARGUMENT); + + auto filePath = GetFilePathForIntent(intent); + VerifyOrReturnValue(filePath.HasValue(), CHIP_ERROR_NOT_FOUND); + + auto fp = fopen(filePath.Value().c_str(), "rb"); + VerifyOrReturnValue(!(nullptr == fp && errno == ENOENT), CHIP_ERROR_NOT_FOUND); + VerifyOrReturnValue(nullptr != fp, CHIP_ERROR_INTERNAL); + + mLogSessionHandle++; + // If the session handle rolls over to UINT16_MAX which is invalid, reset to 0. + VerifyOrDo(mLogSessionHandle != kInvalidLogSessionHandle, mLogSessionHandle = 0); + + outHandle = mLogSessionHandle; + mFiles[mLogSessionHandle] = fp; + return CHIP_NO_ERROR; +} + +CHIP_ERROR LogProvider::EndLogCollection(LogSessionHandle sessionHandle) +{ + VerifyOrReturnValue(sessionHandle != kInvalidLogSessionHandle, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnValue(mFiles.count(sessionHandle), CHIP_ERROR_INVALID_ARGUMENT); + + auto fp = mFiles[sessionHandle]; + mFiles.erase(sessionHandle); + + auto rv = fclose(fp); + VerifyOrReturnError(rv == 0, CHIP_ERROR_POSIX(errno)); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR LogProvider::CollectLog(LogSessionHandle sessionHandle, MutableByteSpan & outBuffer, bool & outIsEndOfLog) +{ + VerifyOrReturnValue(sessionHandle != kInvalidLogSessionHandle, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnValue(mFiles.count(sessionHandle), CHIP_ERROR_INVALID_ARGUMENT); + + auto fp = mFiles[sessionHandle]; + auto fileSize = GetFileSize(fp); + auto count = std::min(fileSize, outBuffer.size()); + + VerifyOrReturnError(CanCastTo(count), CHIP_ERROR_INVALID_ARGUMENT, outBuffer.reduce_size(0)); + + auto bytesRead = fread(outBuffer.data(), 1, count, fp); + VerifyOrReturnError(CanCastTo(bytesRead), CHIP_ERROR_INTERNAL, outBuffer.reduce_size(0)); + + outBuffer.reduce_size(static_cast(bytesRead)); + outIsEndOfLog = fileSize == static_cast(ftell(fp)); + return CHIP_NO_ERROR; +} + +size_t LogProvider::GetSizeForIntent(IntentEnum intent) +{ + VerifyOrReturnValue(IsValidIntent(intent), 0); + + auto filePath = GetFilePathForIntent(intent); + VerifyOrReturnValue(filePath.HasValue(), 0); + + auto fp = fopen(filePath.Value().c_str(), "rb"); + VerifyOrReturnValue(nullptr != fp, 0); + + auto fileSize = GetFileSize(fp); + + auto rv = fclose(fp); + if (rv != 0) + { + ChipLogError(NotSpecified, "Error when closing file pointer (%d)", errno); + } + + return fileSize; +} + +Optional LogProvider::GetFilePathForIntent(IntentEnum intent) const +{ + switch (intent) + { + case IntentEnum::kEndUserSupport: + return mEndUserSupportLogFilePath; + case IntentEnum::kNetworkDiag: + return mNetworkDiagnosticsLogFilePath; + case IntentEnum::kCrashLogs: + return mCrashLogFilePath; + case IntentEnum::kUnknownEnumValue: + // It should never happen. + chipDie(); + } + + return NullOptional; +} diff --git a/examples/all-clusters-app/linux/include/CHIPProjectAppConfig.h b/examples/all-clusters-app/linux/include/CHIPProjectAppConfig.h index 7346ebd2807bfb..588d77da1ce652 100644 --- a/examples/all-clusters-app/linux/include/CHIPProjectAppConfig.h +++ b/examples/all-clusters-app/linux/include/CHIPProjectAppConfig.h @@ -42,3 +42,8 @@ // Marks that a ModeBase Derived cluster is being used. #define EMBER_AF_PLUGIN_MODE_BASE + +// Enable batching of up to 5 commands. +#define CHIP_CONFIG_MAX_PATHS_PER_INVOKE 5 + +#define CHIP_CONFIG_ENABLE_BDX_LOG_TRANSFER 1 diff --git a/examples/all-clusters-app/linux/include/diagnostic-logs-provider-delegate-impl.h b/examples/all-clusters-app/linux/include/diagnostic-logs-provider-delegate-impl.h new file mode 100644 index 00000000000000..c0e69f1c5bde0b --- /dev/null +++ b/examples/all-clusters-app/linux/include/diagnostic-logs-provider-delegate-impl.h @@ -0,0 +1,78 @@ +/* + * + * 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 + +#include +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace DiagnosticLogs { + +/** + * The LogProvider class serves as the sole instance delegate for handling diagnostic logs. + * + * It implements the DiagnosticLogsProviderDelegate interface and provides mechanisms to set file paths for different types of logs + * (end-user support, network diagnostics, and crash logs). + */ + +class LogProvider : public DiagnosticLogsProviderDelegate +{ +public: + static inline LogProvider & GetInstance() { return sInstance; } + + void SetEndUserSupportLogFilePath(Optional logFilePath) { mEndUserSupportLogFilePath = logFilePath; } + void SetNetworkDiagnosticsLogFilePath(Optional logFilePath) { mNetworkDiagnosticsLogFilePath = logFilePath; } + void SetCrashLogFilePath(Optional logFilePath) { mCrashLogFilePath = logFilePath; } + + /////////// DiagnosticLogsProviderDelegate Interface ///////// + CHIP_ERROR StartLogCollection(IntentEnum intent, LogSessionHandle & outHandle, Optional & outTimeStamp, + Optional & outTimeSinceBoot) override; + CHIP_ERROR EndLogCollection(LogSessionHandle sessionHandle) override; + CHIP_ERROR CollectLog(LogSessionHandle sessionHandle, MutableByteSpan & outBuffer, bool & outIsEndOfLog) override; + size_t GetSizeForIntent(IntentEnum intent) override; + CHIP_ERROR GetLogForIntent(IntentEnum intent, MutableByteSpan & outBuffer, Optional & outTimeStamp, + Optional & outTimeSinceBoot) override; + +private: + static LogProvider sInstance; + LogProvider() = default; + ~LogProvider(); + + LogProvider(const LogProvider &) = delete; + LogProvider & operator=(const LogProvider &) = delete; + + Optional GetFilePathForIntent(IntentEnum intent) const; + + Optional mEndUserSupportLogFilePath; + Optional mNetworkDiagnosticsLogFilePath; + Optional mCrashLogFilePath; + + std::map mFiles; + + LogSessionHandle mLogSessionHandle = kInvalidLogSessionHandle; +}; + +} // namespace DiagnosticLogs +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/examples/all-clusters-app/linux/main-common.cpp b/examples/all-clusters-app/linux/main-common.cpp index 49ee513ca33f95..1d849dc5f2751b 100644 --- a/examples/all-clusters-app/linux/main-common.cpp +++ b/examples/all-clusters-app/linux/main-common.cpp @@ -17,10 +17,14 @@ */ #include "AllClustersCommandDelegate.h" +#include "AppOptions.h" #include "ValveControlDelegate.h" #include "WindowCoveringManager.h" #include "air-quality-instance.h" +#include "device-energy-management-modes.h" #include "dishwasher-mode.h" +#include "energy-evse-modes.h" +#include "include/diagnostic-logs-provider-delegate-impl.h" #include "include/tv-callbacks.h" #include "laundry-dryer-controls-delegate-impl.h" #include "laundry-washer-controls-delegate-impl.h" @@ -28,13 +32,16 @@ #include "microwave-oven-mode.h" #include "operational-state-delegate-impl.h" #include "oven-modes.h" +#include "oven-operational-state-delegate.h" #include "resource-monitoring-delegates.h" #include "rvc-modes.h" +#include "rvc-operational-state-delegate-impl.h" #include "tcc-mode.h" #include #include #include #include +#include #include #include #include @@ -247,6 +254,10 @@ void ApplicationShutdown() Clusters::OperationalState::Shutdown(); Clusters::RvcOperationalState::Shutdown(); Clusters::OvenMode::Shutdown(); + Clusters::OvenCavityOperationalState::Shutdown(); + + Clusters::DeviceEnergyManagementMode::Shutdown(); + Clusters::EnergyEvseMode::Shutdown(); if (sChipNamedPipeCommands.Stop() != CHIP_NO_ERROR) { @@ -278,3 +289,14 @@ void emberAfWindowCoveringClusterInitCallback(chip::EndpointId endpoint) Clusters::WindowCovering::SetDefaultDelegate(endpoint, &sWindowCoveringManager); Clusters::WindowCovering::ConfigStatusUpdateFeatures(endpoint); } + +using namespace chip::app::Clusters::DiagnosticLogs; +void emberAfDiagnosticLogsClusterInitCallback(chip::EndpointId endpoint) +{ + auto & logProvider = LogProvider::GetInstance(); + logProvider.SetEndUserSupportLogFilePath(AppOptions::GetEndUserSupportLogFilePath()); + logProvider.SetNetworkDiagnosticsLogFilePath(AppOptions::GetNetworkDiagnosticsLogFilePath()); + logProvider.SetCrashLogFilePath(AppOptions::GetCrashLogFilePath()); + + DiagnosticLogsServer::Instance().SetDiagnosticLogsProviderDelegate(endpoint, &logProvider); +} diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter index dd01a2fb356f22..17689ab421469c 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter @@ -2398,7 +2398,7 @@ cluster TemperatureControl = 86 { /** Attributes and commands for scene configuration and manipulation. */ provisional cluster ScenesManagement = 98 { - revision 5; + revision 1; bitmap CopyModeBitmap : bitmap8 { kCopyAllScenes = 0x1; @@ -2406,13 +2406,6 @@ provisional cluster ScenesManagement = 98 { bitmap Feature : bitmap32 { kSceneNames = 0x1; - kExplicit = 0x2; - kTableSize = 0x4; - kFabricScenes = 0x8; - } - - bitmap NameSupportBitmap : bitmap8 { - kSceneNames = 0x80; } struct AttributeValuePair { @@ -2434,14 +2427,9 @@ provisional cluster ScenesManagement = 98 { fabric_idx fabricIndex = 254; } - readonly attribute optional int8u sceneCount = 0; - readonly attribute optional int8u currentScene = 1; - readonly attribute optional group_id currentGroup = 2; - readonly attribute optional boolean sceneValid = 3; - readonly attribute NameSupportBitmap nameSupport = 4; - readonly attribute optional nullable node_id lastConfiguredBy = 5; - readonly attribute int16u sceneTableSize = 6; - readonly attribute SceneInfoStruct fabricSceneInfo[] = 7; + readonly attribute optional nullable node_id lastConfiguredBy = 0; + readonly attribute int16u sceneTableSize = 1; + readonly attribute SceneInfoStruct fabricSceneInfo[] = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -2452,7 +2440,7 @@ provisional cluster ScenesManagement = 98 { request struct AddSceneRequest { group_id groupID = 0; int8u sceneID = 1; - int16u transitionTime = 2; + int32u transitionTime = 2; char_string sceneName = 3; ExtensionFieldSet extensionFieldSets[] = 4; } @@ -2472,7 +2460,7 @@ provisional cluster ScenesManagement = 98 { status status = 0; group_id groupID = 1; int8u sceneID = 2; - optional int16u transitionTime = 3; + optional int32u transitionTime = 3; optional char_string sceneName = 4; optional ExtensionFieldSet extensionFieldSets[] = 5; } @@ -2511,7 +2499,7 @@ provisional cluster ScenesManagement = 98 { request struct RecallSceneRequest { group_id groupID = 0; int8u sceneID = 1; - optional nullable int16u transitionTime = 2; + optional nullable int32u transitionTime = 2; } request struct GetSceneMembershipRequest { @@ -2525,34 +2513,6 @@ provisional cluster ScenesManagement = 98 { optional int8u sceneList[] = 3; } - request struct EnhancedAddSceneRequest { - group_id groupID = 0; - int8u sceneID = 1; - int16u transitionTime = 2; - char_string sceneName = 3; - ExtensionFieldSet extensionFieldSets[] = 4; - } - - response struct EnhancedAddSceneResponse = 64 { - status status = 0; - group_id groupID = 1; - int8u sceneID = 2; - } - - request struct EnhancedViewSceneRequest { - group_id groupID = 0; - int8u sceneID = 1; - } - - response struct EnhancedViewSceneResponse = 65 { - status status = 0; - group_id groupID = 1; - int8u sceneID = 2; - optional int16u transitionTime = 3; - optional char_string sceneName = 4; - optional ExtensionFieldSet extensionFieldSets[] = 5; - } - request struct CopySceneRequest { CopyModeBitmap mode = 0; group_id groupIdentifierFrom = 1; @@ -2561,7 +2521,7 @@ provisional cluster ScenesManagement = 98 { int8u sceneIdentifierTo = 4; } - response struct CopySceneResponse = 66 { + response struct CopySceneResponse = 64 { status status = 0; group_id groupIdentifierFrom = 1; int8u sceneIdentifierFrom = 2; @@ -2581,12 +2541,8 @@ provisional cluster ScenesManagement = 98 { fabric command RecallScene(RecallSceneRequest): DefaultSuccess = 5; /** Get an unused scene identifier when no commissioning tool is in the network, or for a commissioning tool to get the used scene identifiers within a certain group */ fabric command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; - /** Allows a scene to be added using a finer scene transition time than the AddScene command. */ - fabric command EnhancedAddScene(EnhancedAddSceneRequest): EnhancedAddSceneResponse = 64; - /** Allows a scene to be retrieved using a finer scene transition time than the ViewScene command */ - fabric command EnhancedViewScene(EnhancedViewSceneRequest): EnhancedViewSceneResponse = 65; /** Allows a client to efficiently copy scenes from one group/scene identifier pair to another group/scene identifier pair. */ - fabric command CopyScene(CopySceneRequest): CopySceneResponse = 66; + fabric command CopyScene(CopySceneRequest): CopySceneResponse = 64; } /** An interface to a generic way to secure a door */ @@ -5535,6 +5491,10 @@ internal cluster UnitTesting = 4294048773 { fabric_idx fabricIndex = 254; } + info event TestDifferentVendorMeiEvent = 4294050030 { + int8u arg1 = 1; + } + attribute boolean boolean = 0; attribute Bitmap8MaskMap bitmap8 = 1; attribute Bitmap16MaskMap bitmap16 = 2; @@ -5617,6 +5577,7 @@ internal cluster UnitTesting = 4294048773 { attribute nullable int16u nullableRangeRestrictedInt16u = 16424; attribute nullable int16s nullableRangeRestrictedInt16s = 16425; attribute optional int8u writeOnlyInt8u = 16426; + attribute int8u meiInt8u = 4294070017; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -5812,7 +5773,17 @@ internal cluster UnitTesting = 4294048773 { int8u fillCharacter = 2; } - /** Simple command without any parameters and without a specific response */ + request struct TestDifferentVendorMeiRequestRequest { + int8u arg1 = 0; + } + + response struct TestDifferentVendorMeiResponse = 4294049979 { + int8u arg1 = 0; + int64u eventNumber = 1; + } + + /** Simple command without any parameters and without a specific response. + To aid in unit testing, this command will re-initialize attribute storage to defaults. */ command Test(): DefaultSuccess = 0; /** Simple command without any parameters and without a specific response not handled by the server */ command TestNotHandled(): DefaultSuccess = 1; @@ -5881,6 +5852,8 @@ internal cluster UnitTesting = 4294048773 { command TestBatchHelperRequest(TestBatchHelperRequestRequest): TestBatchHelperResponse = 22; /** Second command that responds after sleepBeforeResponseTimeMs with an octet_string the size requested with fillCharacter. */ command TestSecondBatchHelperRequest(TestSecondBatchHelperRequestRequest): TestBatchHelperResponse = 23; + /** Command having a different MEI vendor ID than the cluster. Also emits TestDifferentVendorMeiEvent. */ + command TestDifferentVendorMeiRequest(TestDifferentVendorMeiRequestRequest): TestDifferentVendorMeiResponse = 4294049962; } endpoint 0 { @@ -6412,7 +6385,6 @@ endpoint 1 { } server cluster ScenesManagement { - ram attribute nameSupport default = 0x80; ram attribute lastConfiguredBy; ram attribute sceneTableSize default = 16; callback attribute fabricSceneInfo; @@ -6420,8 +6392,8 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 15; - ram attribute clusterRevision default = 5; + ram attribute featureMap default = 1; + ram attribute clusterRevision default = 1; handle command AddScene; handle command AddSceneResponse; @@ -6690,6 +6662,7 @@ endpoint 1 { server cluster UnitTesting { emits event TestEvent; emits event TestFabricScopedEvent; + emits event TestDifferentVendorMeiEvent; ram attribute boolean default = false; ram attribute bitmap8 default = 0; ram attribute bitmap16 default = 0; @@ -6770,8 +6743,10 @@ endpoint 1 { ram attribute nullableRangeRestrictedInt8s default = -20; ram attribute nullableRangeRestrictedInt16u default = 200; ram attribute nullableRangeRestrictedInt16s default = -100; + callback attribute writeOnlyInt8u default = 0; ram attribute featureMap default = 0; ram attribute clusterRevision default = 1; + ram attribute meiInt8u default = 0; handle command Test; handle command TestSpecificResponse; @@ -6799,6 +6774,10 @@ endpoint 1 { handle command TestSimpleOptionalArgumentRequest; handle command TestEmitTestEventRequest; handle command TestEmitTestFabricScopedEventRequest; + handle command TestBatchHelperRequest; + handle command TestSecondBatchHelperRequest; + handle command TestDifferentVendorMeiRequest; + handle command TestDifferentVendorMeiResponse; } } endpoint 2 { @@ -6889,15 +6868,15 @@ endpoint 2 { } server cluster ScenesManagement { - ram attribute nameSupport default = 0x80; + ram attribute lastConfiguredBy; ram attribute sceneTableSize default = 16; callback attribute fabricSceneInfo; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 15; - ram attribute clusterRevision default = 5; + ram attribute featureMap default = 1; + ram attribute clusterRevision default = 1; handle command AddScene; handle command AddSceneResponse; diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap index 5aff52c41cca6b..f81e261efc295c 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap @@ -2245,7 +2245,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4713,25 +4713,9 @@ } ], "attributes": [ - { - "name": "NameSupport", - "code": 4, - "mfgCode": null, - "side": "server", - "type": "NameSupportBitmap", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x80", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, { "name": "LastConfiguredBy", - "code": 5, + "code": 0, "mfgCode": null, "side": "server", "type": "node_id", @@ -4747,7 +4731,7 @@ }, { "name": "SceneTableSize", - "code": 6, + "code": 1, "mfgCode": null, "side": "server", "type": "int16u", @@ -4763,7 +4747,7 @@ }, { "name": "FabricSceneInfo", - "code": 7, + "code": 2, "mfgCode": null, "side": "server", "type": "array", @@ -4851,7 +4835,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "15", + "defaultValue": "1", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4867,7 +4851,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "5", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -9104,6 +9088,38 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "TestBatchHelperRequest", + "code": 22, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TestSecondBatchHelperRequest", + "code": 23, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TestDifferentVendorMeiRequest", + "code": 4294049962, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TestDifferentVendorMeiResponse", + "code": 4294049979, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -10387,6 +10403,38 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "write_only_int8u", + "code": 16426, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MeiInt8u", + "code": 4294070017, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, { "name": "FeatureMap", "code": 65532, @@ -10434,6 +10482,13 @@ "mfgCode": null, "side": "server", "included": 1 + }, + { + "name": "TestDifferentVendorMeiEvent", + "code": 4294050030, + "mfgCode": null, + "side": "server", + "included": 1 } ] } @@ -10950,24 +11005,24 @@ ], "attributes": [ { - "name": "NameSupport", - "code": 4, + "name": "LastConfiguredBy", + "code": 0, "mfgCode": null, "side": "server", - "type": "NameSupportBitmap", + "type": "node_id", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x80", + "defaultValue": "", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { "name": "SceneTableSize", - "code": 6, + "code": 1, "mfgCode": null, "side": "server", "type": "int16u", @@ -10983,7 +11038,7 @@ }, { "name": "FabricSceneInfo", - "code": 7, + "code": 2, "mfgCode": null, "side": "server", "type": "array", @@ -11071,7 +11126,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "15", + "defaultValue": "1", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -11087,7 +11142,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "5", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -12300,6 +12355,5 @@ "endpointId": 65534, "networkId": 0 } - ], - "log": [] -} \ No newline at end of file + ] +} diff --git a/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/SelectActionFragment.kt b/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/SelectActionFragment.kt index a597bd934514e7..f935ab37926927 100644 --- a/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/SelectActionFragment.kt +++ b/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/SelectActionFragment.kt @@ -172,7 +172,7 @@ class SelectActionFragment : Fragment() { /** Notifies listener of Scan QR code button click. */ private fun handleScanQrCodeClicked() { - showFragment(BarcodeFragment.newInstance(), false) + showFragment(BarcodeFragment.newInstance()) } /** Notifies listener of Light On/Off & Level Cluster button click. */ @@ -221,24 +221,24 @@ class SelectActionFragment : Fragment() { } private fun handleOTAProviderClicked() { - showFragment(OtaProviderClientFragment.newInstance(), false) + showFragment(OtaProviderClientFragment.newInstance()) } /** Notifies listener of provision-WiFi-credentials button click. */ private fun handleProvisionWiFiCredentialsClicked() { getCallback()?.SetNetworkType(ProvisionNetworkType.WIFI) - showFragment(BarcodeFragment.newInstance(), false) + showFragment(BarcodeFragment.newInstance()) } /** Notifies listener of provision-Thread-credentials button click. */ private fun handleProvisionThreadCredentialsClicked() { getCallback()?.SetNetworkType(ProvisionNetworkType.THREAD) - showFragment(BarcodeFragment.newInstance(), false) + showFragment(BarcodeFragment.newInstance()) } /** Notifies listener of provision-custom-flow button click. */ private fun handleProvisionCustomFlowClicked() { - showFragment(BarcodeFragment.newInstance(), false) + showFragment(BarcodeFragment.newInstance()) } private fun handleGroupSettingClicked() { diff --git a/examples/bridge-app/bridge-common/bridge-app.zap b/examples/bridge-app/bridge-common/bridge-app.zap index daeb971c0c9b48..0412a216ba7872 100644 --- a/examples/bridge-app/bridge-common/bridge-app.zap +++ b/examples/bridge-app/bridge-common/bridge-app.zap @@ -5753,6 +5753,5 @@ "endpointId": 2, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/bridge-app/linux/BUILD.gn b/examples/bridge-app/linux/BUILD.gn index 3912e887a846be..490c59d17ad6b1 100644 --- a/examples/bridge-app/linux/BUILD.gn +++ b/examples/bridge-app/linux/BUILD.gn @@ -44,3 +44,7 @@ executable("chip-bridge-app") { group("linux") { deps = [ ":chip-bridge-app" ] } + +group("default") { + deps = [ ":chip-bridge-app" ] +} diff --git a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.zap b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.zap index 9eae9ed03bec5c..44e06c856968f8 100644 --- a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.zap +++ b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.zap @@ -4827,6 +4827,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_airpurifier_73a6fe2651.zap b/examples/chef/devices/rootnode_airpurifier_73a6fe2651.zap index fd02955e218164..5ca6fd92d71bd1 100644 --- a/examples/chef/devices/rootnode_airpurifier_73a6fe2651.zap +++ b/examples/chef/devices/rootnode_airpurifier_73a6fe2651.zap @@ -3369,6 +3369,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.zap b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.zap index 029e03b3d6c8db..0d630cb43d894e 100644 --- a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.zap +++ b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.zap @@ -7641,7 +7641,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7721,7 +7721,7 @@ "code": 28, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "SystemModeEnum", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7876,6 +7876,5 @@ "endpointId": 5, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.zap b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.zap index 1225a520c5e2c2..ce907b4d22843f 100644 --- a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.zap +++ b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.zap @@ -5788,7 +5788,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "10", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -5804,7 +5804,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "5", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -5836,7 +5836,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "36", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -5868,7 +5868,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "20", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -5900,7 +5900,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -5916,7 +5916,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -5948,7 +5948,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -6070,6 +6070,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] -} + ] +} \ No newline at end of file diff --git a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.zap b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.zap index 9876380437e15b..272db06ab28ad4 100644 --- a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.zap +++ b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.zap @@ -3970,6 +3970,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.zap b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.zap index 863849c072ec8f..709b2d3d338aba 100644 --- a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.zap +++ b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.zap @@ -3950,6 +3950,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.zap b/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.zap index d87e6d10b111ef..c81df7d7482f9e 100644 --- a/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.zap +++ b/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.zap @@ -2908,6 +2908,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.zap b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.zap index 58b836ccf50f53..7b5a4b49f9810a 100644 --- a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.zap +++ b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.zap @@ -3132,6 +3132,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.zap b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.zap index c8330dd1701340..6ccf72e82c653b 100644 --- a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.zap +++ b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.zap @@ -3564,6 +3564,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap b/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap index b43f3c763799ff..5bc8fb68715b8c 100644 --- a/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap +++ b/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap @@ -3565,6 +3565,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.zap b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.zap index 91b44423822875..96c60ff5453cd3 100644 --- a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.zap +++ b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.zap @@ -3461,6 +3461,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.zap b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.zap index 1a8fa80a5068ab..edd39619401e94 100644 --- a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.zap +++ b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.zap @@ -4054,6 +4054,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_fan_7N2TobIlOX.zap b/examples/chef/devices/rootnode_fan_7N2TobIlOX.zap index c73eb2c7d43b2d..f3b01c60689739 100644 --- a/examples/chef/devices/rootnode_fan_7N2TobIlOX.zap +++ b/examples/chef/devices/rootnode_fan_7N2TobIlOX.zap @@ -3275,6 +3275,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.zap b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.zap index dbb444c612924f..5fe9927c1a14ea 100644 --- a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.zap +++ b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.zap @@ -3034,6 +3034,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_genericswitch_9866e35d0b.zap b/examples/chef/devices/rootnode_genericswitch_9866e35d0b.zap index d4801ef3d48ab4..d4f54512a7f13e 100644 --- a/examples/chef/devices/rootnode_genericswitch_9866e35d0b.zap +++ b/examples/chef/devices/rootnode_genericswitch_9866e35d0b.zap @@ -2438,6 +2438,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.zap b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.zap index d796e78dcc17be..139e739d9f8411 100644 --- a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.zap +++ b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.zap @@ -3639,6 +3639,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.zap b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.zap index fd1801e7f923d0..d93a61ea027e91 100644 --- a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.zap +++ b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.zap @@ -3034,6 +3034,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap index d9cd3825701630..6b3b2859bc5f03 100644 --- a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap +++ b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap @@ -3401,6 +3401,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.zap b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.zap index ffe1e4e9881e6f..c01e3ca021db05 100644 --- a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.zap +++ b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.zap @@ -3002,6 +3002,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.zap b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.zap index 01ee3e4be73b33..550bd5b467de59 100644 --- a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.zap +++ b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.zap @@ -3018,6 +3018,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.zap b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.zap index 5387f929b2e5d5..e39bd754aadf0c 100644 --- a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.zap +++ b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.zap @@ -3474,6 +3474,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_onofflight_samplemei.zap b/examples/chef/devices/rootnode_onofflight_samplemei.zap index 0bcd495ba65859..5ebbfde48fba36 100644 --- a/examples/chef/devices/rootnode_onofflight_samplemei.zap +++ b/examples/chef/devices/rootnode_onofflight_samplemei.zap @@ -3631,6 +3631,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.zap b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.zap index 330377146f46f4..4172207e164fe8 100644 --- a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.zap +++ b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.zap @@ -3194,6 +3194,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.zap b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.zap index 09eb11f7af077e..7dcde4698b9da4 100644 --- a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.zap +++ b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.zap @@ -3222,6 +3222,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.zap b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.zap index feeee30e560046..d8a968333633c6 100644 --- a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.zap +++ b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.zap @@ -3044,6 +3044,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_pump_5f904818cc.zap b/examples/chef/devices/rootnode_pump_5f904818cc.zap index 7ad53ca3281b52..b8909b097aaaa0 100644 --- a/examples/chef/devices/rootnode_pump_5f904818cc.zap +++ b/examples/chef/devices/rootnode_pump_5f904818cc.zap @@ -3577,6 +3577,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_pump_a811bb33a0.zap b/examples/chef/devices/rootnode_pump_a811bb33a0.zap index 23b03e5b5b9b45..e41fb9daa1c1aa 100644 --- a/examples/chef/devices/rootnode_pump_a811bb33a0.zap +++ b/examples/chef/devices/rootnode_pump_a811bb33a0.zap @@ -3035,6 +3035,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap index eec3ee7aa0e156..7aa39d37307947 100644 --- a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap +++ b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap @@ -3825,6 +3825,5 @@ "endpointId": 3, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter b/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter index cea46e31fad3fc..fa836fe8b0c5e2 100644 --- a/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter +++ b/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter @@ -1178,6 +1178,8 @@ cluster RvcOperationalState = 97 { command Start(): OperationalCommandResponse = 2; /** Upon receipt, the device SHALL resume its operation from the point it was at when it received the Pause command, or from the point when it was paused by means outside of this cluster (for example by manual button press). */ command Resume(): OperationalCommandResponse = 3; + /** On receipt of this command, the device SHALL start seeking the charging dock, if possible in the current state of the device. */ + command GoHome(): OperationalCommandResponse = 128; } endpoint 0 { diff --git a/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.zap b/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.zap index c186be39575abf..126e811df06356 100644 --- a/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.zap +++ b/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.zap @@ -3099,6 +3099,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.zap b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.zap index 074ad1dde59509..3c1f4e2a352817 100644 --- a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.zap +++ b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.zap @@ -2632,7 +2632,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -2648,7 +2648,7 @@ "code": 5, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -2664,7 +2664,7 @@ "code": 6, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -2744,7 +2744,7 @@ "code": 28, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "SystemModeEnum", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3180,6 +3180,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.zap b/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.zap index 3f0152a6202989..5659783ce4ece8 100644 --- a/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.zap +++ b/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.zap @@ -3117,6 +3117,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.zap b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.zap index edcfb8493a67c2..b6cd32c5f5895d 100644 --- a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.zap +++ b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.zap @@ -3206,6 +3206,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.zap b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.zap index 1a8083d15c19dd..b35d366285e564 100644 --- a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.zap +++ b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.zap @@ -3018,6 +3018,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.zap b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.zap index 29f186daa70076..1fc6cb94ba9606 100644 --- a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.zap +++ b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.zap @@ -3031,7 +3031,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3047,7 +3047,7 @@ "code": 1, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3079,7 +3079,7 @@ "code": 3, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3095,7 +3095,7 @@ "code": 4, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3111,7 +3111,7 @@ "code": 5, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3127,7 +3127,7 @@ "code": 6, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3351,7 +3351,7 @@ "code": 26, "mfgCode": null, "side": "server", - "type": "bitmap8", + "type": "RemoteSensingBitmap", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3383,7 +3383,7 @@ "code": 28, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "SystemModeEnum", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3399,7 +3399,7 @@ "code": 30, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "ThermostatRunningModeEnum", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3415,7 +3415,7 @@ "code": 32, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "StartOfWeekEnum", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3849,6 +3849,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.zap b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.zap index 3a9b598f1435ae..b91dfc2b141d36 100644 --- a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.zap +++ b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.zap @@ -3510,6 +3510,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/template.zap b/examples/chef/devices/template.zap index 7987c79179e375..6a1395f2eafb3f 100644 --- a/examples/chef/devices/template.zap +++ b/examples/chef/devices/template.zap @@ -2276,155 +2276,64 @@ ] }, { - "name": "Scenes Management", - "code": 98, + "name": "Descriptor", + "code": 29, "mfgCode": null, - "define": "SCENES_CLUSTER", + "define": "DESCRIPTOR_CLUSTER", "side": "server", "enabled": 1, - "apiMaturity": "provisional", - "commands": [ - { - "name": "AddScene", - "code": 0, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, + "attributes": [ { - "name": "AddSceneResponse", + "name": "DeviceTypeList", "code": 0, "mfgCode": null, - "source": "server", - "isIncoming": 0, - "isEnabled": 1 - }, - { - "name": "ViewScene", - "code": 1, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 }, { - "name": "ViewSceneResponse", + "name": "ServerList", "code": 1, "mfgCode": null, - "source": "server", - "isIncoming": 0, - "isEnabled": 1 - }, - { - "name": "RemoveScene", - "code": 2, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "RemoveSceneResponse", - "code": 2, - "mfgCode": null, - "source": "server", - "isIncoming": 0, - "isEnabled": 1 - }, - { - "name": "RemoveAllScenes", - "code": 3, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "RemoveAllScenesResponse", - "code": 3, - "mfgCode": null, - "source": "server", - "isIncoming": 0, - "isEnabled": 1 - }, - { - "name": "StoreScene", - "code": 4, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "StoreSceneResponse", - "code": 4, - "mfgCode": null, - "source": "server", - "isIncoming": 0, - "isEnabled": 1 - }, - { - "name": "RecallScene", - "code": 5, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "GetSceneMembership", - "code": 6, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "GetSceneMembershipResponse", - "code": 6, - "mfgCode": null, - "source": "server", - "isIncoming": 0, - "isEnabled": 1 - } - ], - "attributes": [ - { - "name": "NameSupport", - "code": 4, - "mfgCode": null, "side": "server", - "type": "NameSupportBitmap", + "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x00", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "SceneTableSize", - "code": 6, + "name": "ClientList", + "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "FabricSceneInfo", - "code": 7, + "name": "PartsList", + "code": 3, "mfgCode": null, "side": "server", "type": "array", @@ -2525,10 +2434,10 @@ "side": "server", "type": "int16u", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "5", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -2537,64 +2446,155 @@ ] }, { - "name": "Descriptor", - "code": 29, + "name": "Scenes Management", + "code": 98, "mfgCode": null, - "define": "DESCRIPTOR_CLUSTER", + "define": "SCENES_CLUSTER", "side": "server", "enabled": 1, - "attributes": [ + "apiMaturity": "provisional", + "commands": [ { - "name": "DeviceTypeList", + "name": "AddScene", "code": 0, "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 + "source": "client", + "isIncoming": 1, + "isEnabled": 1 }, { - "name": "ServerList", + "name": "AddSceneResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "ViewScene", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ViewSceneResponse", "code": 1, "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "RemoveScene", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RemoveSceneResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "RemoveAllScenes", + "code": 3, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RemoveAllScenesResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "StoreScene", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "StoreSceneResponse", + "code": 4, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "RecallScene", + "code": 5, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "GetSceneMembership", + "code": 6, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "GetSceneMembershipResponse", + "code": 6, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "LastConfiguredBy", + "code": 0, + "mfgCode": null, "side": "server", - "type": "array", + "type": "node_id", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "", "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "ClientList", - "code": 2, + "name": "SceneTableSize", + "code": 1, "mfgCode": null, "side": "server", - "type": "array", + "type": "int16u", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "", "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "PartsList", - "code": 3, + "name": "FabricSceneInfo", + "code": 2, "mfgCode": null, "side": "server", "type": "array", @@ -2682,7 +2682,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": "1", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -2695,10 +2695,10 @@ "side": "server", "type": "int16u", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "6", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -2724,6 +2724,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] -} \ No newline at end of file + ] +} diff --git a/examples/chef/linux/BUILD.gn b/examples/chef/linux/BUILD.gn index d3cf534a01ba75..fa12a79a91a09f 100644 --- a/examples/chef/linux/BUILD.gn +++ b/examples/chef/linux/BUILD.gn @@ -82,7 +82,7 @@ executable("${sample_name}") { ] deps += [ - "$dir_pw_hdlc:pw_rpc", + "$dir_pw_hdlc:default_addresses", "$dir_pw_hdlc:rpc_channel_output", "$dir_pw_log", "$dir_pw_rpc:server", diff --git a/examples/chef/nrfconnect/CMakeLists.txt b/examples/chef/nrfconnect/CMakeLists.txt index b0b69815246c10..1d9ab2fb436a62 100644 --- a/examples/chef/nrfconnect/CMakeLists.txt +++ b/examples/chef/nrfconnect/CMakeLists.txt @@ -214,7 +214,6 @@ target_link_libraries(app PRIVATE thread_service.nanopb_rpc pw_checksum pw_hdlc - pw_hdlc.pw_rpc pw_log pw_rpc.server pw_sys_io diff --git a/examples/chef/silabs/BUILD.gn b/examples/chef/silabs/BUILD.gn index cecef1c71bc050..3f74106f9f54c2 100644 --- a/examples/chef/silabs/BUILD.gn +++ b/examples/chef/silabs/BUILD.gn @@ -120,6 +120,7 @@ silabs_executable("chef_app") { ] deps += [ + "$dir_pw_hdlc:default_addresses", "$dir_pw_hdlc:rpc_channel_output", "$dir_pw_stream:sys_io_stream", "$dir_pw_trace", diff --git a/examples/chef/telink/CMakeLists.txt b/examples/chef/telink/CMakeLists.txt index 5d30d424ea3dfd..71f0c549e6ed79 100755 --- a/examples/chef/telink/CMakeLists.txt +++ b/examples/chef/telink/CMakeLists.txt @@ -231,7 +231,6 @@ target_link_libraries(app PRIVATE thread_service.nanopb_rpc pw_checksum pw_hdlc - pw_hdlc.pw_rpc pw_log pw_rpc.server pw_sys_io diff --git a/examples/chip-tool/BUILD.gn b/examples/chip-tool/BUILD.gn index 53568316114c9a..c6f5edc819ba95 100644 --- a/examples/chip-tool/BUILD.gn +++ b/examples/chip-tool/BUILD.gn @@ -55,6 +55,7 @@ static_library("chip-tool-utils") { "${chip_root}/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp", "commands/clusters/ModelCommand.cpp", "commands/clusters/ModelCommand.h", + "commands/common/BDXDiagnosticLogsServerDelegate.cpp", "commands/common/CHIPCommand.cpp", "commands/common/CHIPCommand.h", "commands/common/Command.cpp", diff --git a/examples/chip-tool/commands/clusters/ClusterCommand.h b/examples/chip-tool/commands/clusters/ClusterCommand.h index 6b68e1b04bfea0..792588a886dffb 100644 --- a/examples/chip-tool/commands/clusters/ClusterCommand.h +++ b/examples/chip-tool/commands/clusters/ClusterCommand.h @@ -55,6 +55,22 @@ class ClusterCommand : public InteractionModelCommands, public ModelCommand, pub return InteractionModelCommands::SendCommand(device, endpointId, clusterId, commandId, value); } + CHIP_ERROR SendCommand(chip::DeviceProxy * device, chip::EndpointId endpointId, chip::ClusterId clusterId, + chip::CommandId commandId, + const chip::app::Clusters::DiagnosticLogs::Commands::RetrieveLogsRequest::Type & value) + { + ReturnErrorOnFailure(InteractionModelCommands::SendCommand(device, endpointId, clusterId, commandId, value)); + + if (value.transferFileDesignator.HasValue() && + value.requestedProtocol == chip::app::Clusters::DiagnosticLogs::TransferProtocolEnum::kBdx) + { + auto sender = mCommandSender.back().get(); + auto fileDesignator = value.transferFileDesignator.Value(); + BDXDiagnosticLogsServerDelegate::GetInstance().AddFileDesignator(sender, fileDesignator); + } + return CHIP_NO_ERROR; + } + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override { return InteractionModelCommands::SendGroupCommand(groupId, fabricIndex, mClusterId, mCommandId, mPayload); @@ -120,6 +136,8 @@ class ClusterCommand : public InteractionModelCommands, public ModelCommand, pub shouldStop = mRepeatCount.Value() == 0; } + BDXDiagnosticLogsServerDelegate::GetInstance().RemoveFileDesignator(client); + if (shouldStop) { SetCommandExitStatus(mError); diff --git a/examples/chip-tool/commands/common/BDXDiagnosticLogsServerDelegate.cpp b/examples/chip-tool/commands/common/BDXDiagnosticLogsServerDelegate.cpp new file mode 100644 index 00000000000000..27260a54f57887 --- /dev/null +++ b/examples/chip-tool/commands/common/BDXDiagnosticLogsServerDelegate.cpp @@ -0,0 +1,199 @@ +/* + * 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 "BDXDiagnosticLogsServerDelegate.h" + +#include + +constexpr const char kTmpDir[] = "/tmp/"; +constexpr uint8_t kMaxFileDesignatorLen = 32; +constexpr uint16_t kMaxFilePathLen = kMaxFileDesignatorLen + sizeof(kTmpDir) + 1; + +// For testing a few file names trigger an error depending on the current 'phase'. +constexpr char kErrorOnTransferBegin[] = "Error:OnTransferBegin"; +constexpr char kErrorOnTransferData[] = "Error:OnTransferData"; +constexpr char kErrorOnTransferEnd[] = "Error:OnTransferEnd"; + +BDXDiagnosticLogsServerDelegate BDXDiagnosticLogsServerDelegate::sInstance; + +CHIP_ERROR CheckForErrorRequested(const chip::CharSpan & phaseErrorTarget, const chip::CharSpan & fileDesignator) +{ + VerifyOrReturnError(!phaseErrorTarget.data_equal(fileDesignator), CHIP_ERROR_INTERNAL); + return CHIP_NO_ERROR; +} + +CHIP_ERROR CheckFileDesignatorAllowed(const std::map & fileDesignators, + const chip::CharSpan & fileDesignator) +{ + std::string targetFileDesignator(fileDesignator.data(), fileDesignator.size()); + + for (auto it = fileDesignators.begin(); it != fileDesignators.end(); it++) + { + auto expectedFileDesignator = it->second; + if (targetFileDesignator.compare(expectedFileDesignator) == 0) + { + return CHIP_NO_ERROR; + } + } + + return CHIP_ERROR_NOT_FOUND; +} + +CHIP_ERROR GetFilePath(const chip::CharSpan & fileDesignator, chip::MutableCharSpan & outFilePath) +{ + VerifyOrReturnError(fileDesignator.size() <= kMaxFileDesignatorLen, CHIP_ERROR_INVALID_STRING_LENGTH); + // sizeof(kTmpDir) includes the trailing null. + VerifyOrReturnError(outFilePath.size() >= sizeof(kTmpDir) - 1 + fileDesignator.size(), CHIP_ERROR_INTERNAL); + + memcpy(outFilePath.data(), kTmpDir, sizeof(kTmpDir) - 1); + memcpy(outFilePath.data() + sizeof(kTmpDir) - 1, fileDesignator.data(), fileDesignator.size()); + outFilePath.reduce_size(sizeof(kTmpDir) - 1 + fileDesignator.size()); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR CheckFileExists(const char * filePath) +{ + if (access(filePath, F_OK) != 0) + { + ChipLogError(chipTool, "The file '%s' for dumping the logs does not exist.", filePath); + return CHIP_ERROR_INCORRECT_STATE; + } + + return CHIP_NO_ERROR; +} + +CHIP_ERROR CheckFileDoesNotExist(const char * filePath) +{ + if (access(filePath, F_OK) == 0) + { + ChipLogError(chipTool, "The file '%s' for dumping the logs already exists.", filePath); + return CHIP_ERROR_INCORRECT_STATE; + } + + return CHIP_NO_ERROR; +} + +void LogFileDesignator(const char * prefix, const chip::CharSpan & fileDesignator, CHIP_ERROR error = CHIP_NO_ERROR) +{ +#if CHIP_PROGRESS_LOGGING + auto size = static_cast(fileDesignator.size()); + auto data = fileDesignator.data(); + ChipLogProgress(chipTool, "%s (%u): %.*s", prefix, size, size, data); +#endif // CHIP_PROGRESS_LOGGING + + if (CHIP_NO_ERROR != error) + { + ChipLogError(chipTool, "%s: %s", prefix, ErrorStr(error)); + } +} + +CHIP_ERROR CreateFile(const char * filePath) +{ + VerifyOrReturnError(nullptr != filePath, CHIP_ERROR_INVALID_ARGUMENT); + + auto fd = fopen(filePath, "w+"); + VerifyOrReturnError(nullptr != fd, CHIP_ERROR_WRITE_FAILED); + + auto rv = fclose(fd); + VerifyOrReturnError(EOF != rv, CHIP_ERROR_INTERNAL); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR AppendToFile(const char * filePath, const chip::ByteSpan & data) +{ + VerifyOrReturnError(nullptr != filePath, CHIP_ERROR_INVALID_ARGUMENT); + + auto fd = fopen(filePath, "a"); + VerifyOrReturnError(nullptr != fd, CHIP_ERROR_WRITE_FAILED); + + fwrite(data.data(), data.size(), 1, fd); + + auto rv = fclose(fd); + VerifyOrReturnError(EOF != rv, CHIP_ERROR_INTERNAL); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR BDXDiagnosticLogsServerDelegate::OnTransferBegin(chip::bdx::BDXTransferProxy * transfer) +{ + auto fileDesignator = transfer->GetFileDesignator(); + LogFileDesignator("OnTransferBegin", fileDesignator); + + chip::CharSpan phaseErrorTarget(kErrorOnTransferBegin, sizeof(kErrorOnTransferBegin) - 1); + ReturnErrorOnFailure(CheckForErrorRequested(phaseErrorTarget, fileDesignator)); + ReturnErrorOnFailure(CheckFileDesignatorAllowed(mFileDesignators, fileDesignator)); + + char outputFilePath[kMaxFilePathLen] = { 0 }; + chip::MutableCharSpan outputFilePathSpan(outputFilePath); + ReturnErrorOnFailure(GetFilePath(fileDesignator, outputFilePathSpan)); + + // Ensure null-termination of the filename, since we will be passing it around as a char *. + VerifyOrReturnError(outputFilePathSpan.size() < ArraySize(outputFilePath), CHIP_ERROR_INTERNAL); + outputFilePath[outputFilePathSpan.size()] = '\0'; + + ReturnErrorOnFailure(CheckFileDoesNotExist(outputFilePath)); + ReturnErrorOnFailure(CreateFile(outputFilePath)); + + return transfer->Accept(); +} + +CHIP_ERROR BDXDiagnosticLogsServerDelegate::OnTransferEnd(chip::bdx::BDXTransferProxy * transfer, CHIP_ERROR error) +{ + auto fileDesignator = transfer->GetFileDesignator(); + LogFileDesignator("OnTransferEnd", fileDesignator, error); + + chip::CharSpan phaseErrorTarget(kErrorOnTransferEnd, sizeof(kErrorOnTransferEnd) - 1); + ReturnErrorOnFailure(CheckForErrorRequested(phaseErrorTarget, fileDesignator)); + + char outputFilePath[kMaxFilePathLen] = { 0 }; + chip::MutableCharSpan outputFilePathSpan(outputFilePath); + ReturnErrorOnFailure(GetFilePath(fileDesignator, outputFilePathSpan)); + ReturnErrorOnFailure(CheckFileExists(outputFilePath)); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR BDXDiagnosticLogsServerDelegate::OnTransferData(chip::bdx::BDXTransferProxy * transfer, const chip::ByteSpan & data) +{ + auto fileDesignator = transfer->GetFileDesignator(); + LogFileDesignator("OnTransferData", fileDesignator); + + chip::CharSpan phaseErrorTarget(kErrorOnTransferData, sizeof(kErrorOnTransferData) - 1); + ReturnErrorOnFailure(CheckForErrorRequested(phaseErrorTarget, fileDesignator)); + + char outputFilePath[kMaxFilePathLen] = { 0 }; + chip::MutableCharSpan outputFilePathSpan(outputFilePath); + ReturnErrorOnFailure(GetFilePath(fileDesignator, outputFilePathSpan)); + ReturnErrorOnFailure(CheckFileExists(outputFilePath)); + ReturnErrorOnFailure(AppendToFile(outputFilePath, data)); + + return transfer->Continue(); +} + +void BDXDiagnosticLogsServerDelegate::AddFileDesignator(chip::app::CommandSender * sender, const chip::CharSpan & fileDesignator) +{ + std::string entry(fileDesignator.data(), fileDesignator.size()); + mFileDesignators[sender] = entry; +} + +void BDXDiagnosticLogsServerDelegate::RemoveFileDesignator(chip::app::CommandSender * sender) +{ + mFileDesignators.erase(sender); +} diff --git a/examples/chip-tool/commands/common/BDXDiagnosticLogsServerDelegate.h b/examples/chip-tool/commands/common/BDXDiagnosticLogsServerDelegate.h new file mode 100644 index 00000000000000..5aea4b56632e79 --- /dev/null +++ b/examples/chip-tool/commands/common/BDXDiagnosticLogsServerDelegate.h @@ -0,0 +1,45 @@ +/* + * 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 +#include + +#include +#include + +class BDXDiagnosticLogsServerDelegate : public chip::bdx::BDXTransferServerDelegate +{ +public: + static BDXDiagnosticLogsServerDelegate & GetInstance() { return sInstance; } + + void AddFileDesignator(chip::app::CommandSender * sender, const chip::CharSpan & fileDesignator); + void RemoveFileDesignator(chip::app::CommandSender * sender); + + /////////// BDXTransferServerDelegate Interface ///////// + CHIP_ERROR OnTransferBegin(chip::bdx::BDXTransferProxy * transfer) override; + CHIP_ERROR OnTransferEnd(chip::bdx::BDXTransferProxy * transfer, CHIP_ERROR error) override; + CHIP_ERROR OnTransferData(chip::bdx::BDXTransferProxy * transfer, const chip::ByteSpan & data) override; + +private: + BDXDiagnosticLogsServerDelegate() = default; + + std::map mFileDesignators; + static BDXDiagnosticLogsServerDelegate sInstance; +}; diff --git a/examples/chip-tool/commands/common/CHIPCommand.cpp b/examples/chip-tool/commands/common/CHIPCommand.cpp index 45fc2105183cdc..78abff12ada208 100644 --- a/examples/chip-tool/commands/common/CHIPCommand.cpp +++ b/examples/chip-tool/commands/common/CHIPCommand.cpp @@ -139,6 +139,14 @@ CHIP_ERROR CHIPCommand::MaybeSetUpStack() factoryInitParams.listenPort = port; ReturnLogErrorOnFailure(DeviceControllerFactory::GetInstance().Init(factoryInitParams)); + auto systemState = chip::Controller::DeviceControllerFactory::GetInstance().GetSystemState(); + VerifyOrReturnError(nullptr != systemState, CHIP_ERROR_INCORRECT_STATE); + + auto server = systemState->BDXTransferServer(); + VerifyOrReturnError(nullptr != server, CHIP_ERROR_INCORRECT_STATE); + + server->SetDelegate(&BDXDiagnosticLogsServerDelegate::GetInstance()); + ReturnErrorOnFailure(GetAttestationTrustStore(mPaaTrustStorePath.ValueOr(nullptr), &sTrustStore)); ReturnLogErrorOnFailure(sCheckInDelegate.Init(&sICDClientStorage)); diff --git a/examples/chip-tool/commands/common/CHIPCommand.h b/examples/chip-tool/commands/common/CHIPCommand.h index 2caf6fe9cc94ec..55817b5213e589 100644 --- a/examples/chip-tool/commands/common/CHIPCommand.h +++ b/examples/chip-tool/commands/common/CHIPCommand.h @@ -24,6 +24,8 @@ #include "Command.h" +#include "BDXDiagnosticLogsServerDelegate.h" + #include #include #include diff --git a/examples/chip-tool/commands/interactive/InteractiveCommands.cpp b/examples/chip-tool/commands/interactive/InteractiveCommands.cpp index d0f27acad60d34..284c145cfe0569 100644 --- a/examples/chip-tool/commands/interactive/InteractiveCommands.cpp +++ b/examples/chip-tool/commands/interactive/InteractiveCommands.cpp @@ -28,6 +28,7 @@ constexpr char kInteractiveModeStopCommand[] = "quit()"; constexpr char kCategoryError[] = "Error"; constexpr char kCategoryProgress[] = "Info"; constexpr char kCategoryDetail[] = "Debug"; +constexpr char kCategoryAutomation[] = "Automation"; namespace { @@ -146,6 +147,9 @@ struct InteractiveServerResult case chip::Logging::kLogCategory_Detail: messageType = kCategoryDetail; break; + case chip::Logging::kLogCategory_Automation: + messageType = kCategoryAutomation; + return; default: // This should not happen. chipDie(); diff --git a/examples/chip-tool/templates/commands.zapt b/examples/chip-tool/templates/commands.zapt index 37aaef24cc2678..bf981ec8e9e9bf 100644 --- a/examples/chip-tool/templates/commands.zapt +++ b/examples/chip-tool/templates/commands.zapt @@ -31,7 +31,7 @@ public: { {{#zcl_command_arguments}} {{#if_chip_complex}} - AddArgument("{{asUpperCamelCase label}}", &mComplex_{{asUpperCamelCase label}}); + AddArgument("{{asUpperCamelCase label}}", &mComplex_{{asUpperCamelCase label}}{{#if isOptional}}, "", Argument::kOptional{{/if}}); {{else if (isString type)}} AddArgument("{{asUpperCamelCase label}}", &mRequest.{{asLowerCamelCase label}}); {{else}} diff --git a/examples/common/pigweed/BUILD.gn b/examples/common/pigweed/BUILD.gn index 389c3fbc242951..d190b07fd85082 100644 --- a/examples/common/pigweed/BUILD.gn +++ b/examples/common/pigweed/BUILD.gn @@ -115,7 +115,7 @@ pw_source_set("system_rpc_server") { ] public_deps = [ - "$dir_pw_hdlc:pw_rpc", + "$dir_pw_hdlc:default_addresses", "$dir_pw_hdlc:rpc_channel_output", "$dir_pw_stream:sys_io_stream", ] diff --git a/examples/common/pigweed/RpcService.cpp b/examples/common/pigweed/RpcService.cpp index e36ab54afe1eb4..74d0b891e9b00d 100644 --- a/examples/common/pigweed/RpcService.cpp +++ b/examples/common/pigweed/RpcService.cpp @@ -22,8 +22,9 @@ #include #include +#include "pw_hdlc/decoder.h" +#include "pw_hdlc/default_addresses.h" #include "pw_hdlc/rpc_channel.h" -#include "pw_hdlc/rpc_packets.h" #include "pw_log/log.h" #include "pw_rpc/channel.h" #include "pw_status/status.h" @@ -116,7 +117,25 @@ void Start(void (*RegisterServices)(pw::rpc::Server &), ::chip::rpc::Mutex * uar std::array input_buffer; Logging::Log(Logging::kLogModule_NotSpecified, Logging::kLogCategory_Detail, "Starting pw_rpc server"); - pw::hdlc::ReadAndProcessPackets(server, input_buffer); + + pw::hdlc::Decoder decoder(input_buffer); + while (true) + { + std::byte data; + if (!pw::sys_io::ReadByte(&data).ok()) + { + // TODO: should we log? + return; + } + if (auto result = decoder.Process(data); result.ok()) + { + pw::hdlc::Frame & frame = result.value(); + if (frame.address() == pw::hdlc::kDefaultRpcAddress) + { + server.ProcessPacket(frame.data()).IgnoreError(); + } + } + } } } // namespace rpc diff --git a/examples/common/pigweed/mbed/Rpc.cpp b/examples/common/pigweed/mbed/Rpc.cpp index 79940b005eba06..2695822363d4ad 100644 --- a/examples/common/pigweed/mbed/Rpc.cpp +++ b/examples/common/pigweed/mbed/Rpc.cpp @@ -22,7 +22,6 @@ #include "pigweed/RpcService.h" #include "pw_hdlc/rpc_channel.h" -#include "pw_hdlc/rpc_packets.h" #include "pw_rpc/server.h" #include "pw_stream/sys_io_stream.h" #include "pw_sys_io/sys_io.h" diff --git a/examples/common/pigweed/rpc_console/py/BUILD.gn b/examples/common/pigweed/rpc_console/py/BUILD.gn index d250129dca13c5..5c74b7b2599544 100644 --- a/examples/common/pigweed/rpc_console/py/BUILD.gn +++ b/examples/common/pigweed/rpc_console/py/BUILD.gn @@ -37,6 +37,7 @@ pw_python_package("chip_rpc") { "$dir_pw_log_tokenized/py", "$dir_pw_protobuf_compiler/py", "$dir_pw_rpc/py", + "$dir_pw_system/py", "$dir_pw_tokenizer/py", "${chip_root}/examples/common/pigweed:attributes_service.python", "${chip_root}/examples/common/pigweed:button_service.python", diff --git a/examples/common/pigweed/rpc_console/py/chip_rpc/console.py b/examples/common/pigweed/rpc_console/py/chip_rpc/console.py index 7880d579fccf52..6d2b06fd73208f 100644 --- a/examples/common/pigweed/rpc_console/py/chip_rpc/console.py +++ b/examples/common/pigweed/rpc_console/py/chip_rpc/console.py @@ -29,35 +29,20 @@ rpcs - used to invoke RPCs device - the serial device used for communication - client - the pw_rpc.Client + client - the HDLC rpc client protos - protocol buffer messages indexed by proto package An example RPC command: - rpcs.chip.rpc.DeviceCommon.GetDeviceInfo() + rpcs.chip.rpc.Device.GetDeviceInfo() + device.rpcs.chip.rpc.Device.GetDeviceInfo() """ - import argparse -import logging -import re import sys -import threading -from collections import namedtuple -from concurrent.futures import ThreadPoolExecutor -from inspect import cleandoc -from typing import Any, BinaryIO, Callable, Collection +from pathlib import Path +from typing import Any, Collection -import pw_cli.log -from chip_rpc.plugins.device_toolbar import DeviceToolbar -from chip_rpc.plugins.helper_scripts import HelperScripts -from pw_console import PwConsoleEmbed, socket_client -from pw_console.__main__ import create_temp_log_file -from pw_console.pyserial_wrapper import SerialWithLogging -from pw_hdlc.rpc import HdlcRpcClient, SelectableReader, SerialReader, default_channels -from pw_rpc import callback_client -from pw_rpc.console_tools.console import ClientInfo, flattened_rpc_completions -from pw_tokenizer import tokens -from pw_tokenizer.database import LoadTokenDatabases -from pw_tokenizer.detokenize import Detokenizer +import pw_system.console +from pw_hdlc import rpc # Protos # isort: off @@ -72,24 +57,6 @@ from thread_service import thread_service_pb2 from wifi_service import wifi_service_pb2 -_LOG = logging.getLogger(__name__) -_DEVICE_LOG = logging.getLogger('rpc_device') - -PW_RPC_MAX_PACKET_SIZE = 256 -SOCKET_SERVER = 'localhost' -SOCKET_PORT = 33000 - -PROTOS = [attributes_service_pb2, - button_service_pb2, - descriptor_service_pb2, - device_service_pb2, - echo_pb2, - lighting_service_pb2, - locking_service_pb2, - ot_cli_service_pb2, - thread_service_pb2, - wifi_service_pb2] - def _parse_args(): """Parses and returns the command line arguments.""" @@ -116,7 +83,7 @@ def _parse_args(): parser.add_argument("--token-databases", metavar='elf_or_token_database', nargs="+", - action=LoadTokenDatabases, + type=Path, help="Path to tokenizer database csv file(s).") group.add_argument('-s', '--socket-addr', @@ -126,227 +93,55 @@ def _parse_args(): return parser.parse_args() -def _start_ipython_raw_terminal() -> None: - """Starts an interactive IPython terminal with preset variables. This raw - terminal does not use HDLC and provides no RPC functionality, this is - just a serial log viewer.""" - local_variables = dict( - LOG=_DEVICE_LOG, - ) - - welcome_message = cleandoc(""" - Welcome to the CHIP Console! - - This has been started in raw serial mode, - and all RPC functionality is disabled. - - Press F1 for help. - """) - - interactive_console = PwConsoleEmbed( - global_vars=local_variables, - local_vars=None, - loggers={ - 'Device Logs': [_DEVICE_LOG], - 'Host Logs': [logging.getLogger()], - 'Serial Debug': [logging.getLogger('pw_console.serial_debug_logger')], - }, - repl_startup_message=welcome_message, - help_text=__doc__, - app_title="CHIP Console", - ) - - interactive_console.hide_windows('Host Logs') - interactive_console.hide_windows('Serial Debug') - interactive_console.hide_windows('Python Repl') - - # Setup Python logger propagation - interactive_console.setup_python_logging() - # Don't send device logs to the root logger. - _DEVICE_LOG.propagate = False - interactive_console.embed() - - -def _start_ipython_hdlc_terminal(client: HdlcRpcClient) -> None: - """Starts an interactive IPython terminal with preset variables.""" - local_variables = dict( - client=client, - channel_client=client.client.channel(1), - rpcs=client.client.channel(1).rpcs, - scripts=HelperScripts(client.client.channel(1).rpcs), - protos=client.protos.packages, - # Include the active pane logger for creating logs in the repl. - LOG=_DEVICE_LOG, - ) - - client_info = ClientInfo('channel_client', - client.client.channel(1).rpcs, client.client) - completions = flattened_rpc_completions([client_info]) - - welcome_message = cleandoc(""" - Welcome to the CHIP RPC Console! - - Press F1 for help. - Example commands: - - rpcs.chip.rpc.Device.GetDeviceInfo() - - LOG.warning('Message appears console log window.') - """) - - interactive_console = PwConsoleEmbed( - global_vars=local_variables, - local_vars=None, - loggers={ - 'Device Logs': [_DEVICE_LOG], - 'Host Logs': [logging.getLogger()], - 'Serial Debug': [logging.getLogger('pw_console.serial_debug_logger')], - }, - repl_startup_message=welcome_message, - help_text=__doc__, - app_title="CHIP Console", - ) - - interactive_console.add_sentence_completer(completions) - interactive_console.add_bottom_toolbar( - DeviceToolbar(client.client.channel(1).rpcs)) - - interactive_console.hide_windows('Host Logs') - interactive_console.hide_windows('Serial Debug') - - # Setup Python logger propagation - interactive_console.setup_python_logging() - # Don't send device logs to the root logger. - _DEVICE_LOG.propagate = False - with client: - interactive_console.embed() - - -def write_to_output(data: bytes, - unused_output: BinaryIO = sys.stdout.buffer, - detokenizer=None): - log_line = data - RegexStruct = namedtuple('RegexStruct', 'platform type regex match_num') - LEVEL_MAPPING = {"I": logging.INFO, "W": logging.WARNING, "P": logging.INFO, - "E": logging.ERROR, "F": logging.FATAL, "V": logging.DEBUG, "D": logging.DEBUG, - "": logging.INFO, "": logging.DEBUG, "": logging.ERROR, - "": logging.INFO, "": logging.WARNING, - "": logging.ERROR, "": logging.DEBUG, - "ERR": logging.ERROR, "DBG": logging.DEBUG, "INF": logging.INFO} - - ESP_CHIP_REGEX = r"(?P[IWEFV]) \((?P