diff --git a/.github/.wordlist.txt b/.github/.wordlist.txt index ac58409264db79..9fb6b695c40dfb 100644 --- a/.github/.wordlist.txt +++ b/.github/.wordlist.txt @@ -4,11 +4,6 @@ aarch abcdef abfb ABI -AES -DMM -ECDH -ECDSA -SHA ABIs ables accessor @@ -31,6 +26,7 @@ AdvRouterAddr AdvSendAdvert AE aef +AES algs alloc ameba @@ -277,6 +273,7 @@ DevKitC DevKitM df dfu +dhclient DHCP DHCPC DHCPv @@ -285,6 +282,7 @@ dialout diffstat diffsyms dimmable +dirname dirs disambiguated discoverable @@ -296,6 +294,7 @@ DK DL DM DMG +DMM DNS Dnsmasq dnsmasqd @@ -318,6 +317,8 @@ eabi EB ECC ECD +ECDH +ECDSA EchoMessage EchoRequests EchoResponse @@ -497,15 +498,15 @@ IPv ISCAN itemName iterable +JDK jinja jlink -jre -JDK JLink JLinkExe JLinkRTTClient JN jpg +jre js json JTAG @@ -683,11 +684,11 @@ Onboarding onboardingcodes oneshot onnetwork -openjdk OnOff OnOffClusterTest OnPlatformEvent OO +openjdk OpenOCD OpenSSL OpenThread @@ -707,9 +708,9 @@ OTAImageProcessorDriver OTAProviderIpAddress OTAProviderNodeId OTAProviderSerialPort +OTARequesterImpl OTARequestor OTARequestorDriver -OTARequesterImpl OTARequestorSerialPort OTBR otcli @@ -852,8 +853,8 @@ ScriptBinding SDC SDHC SDK -sdkconfig SDK's +sdkconfig SDKs SDKTARGETSYSROOT sdl @@ -872,6 +873,7 @@ SetRequestorInstance SetUpPINCode SetupQRCode sexualized +SHA shubhamdp SIGINT SiLabs @@ -912,6 +914,7 @@ subcommand subcommands subdirectories subdirectory +subfolder submodule submodules subprocess @@ -999,7 +1002,6 @@ unblur UNBLUR uncommissioned unfocus -userguide Unicast UniFlash unpair @@ -1011,6 +1013,7 @@ URI usbmodem USBtoUART uscif +userguide USERINTERFACE UserLabel usermod diff --git a/.github/workflows/examples-ameba.yaml b/.github/workflows/examples-ameba.yaml index 326b399ed38001..5c36324109bd32 100644 --- a/.github/workflows/examples-ameba.yaml +++ b/.github/workflows/examples-ameba.yaml @@ -28,7 +28,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-ameba:0.5.28 + image: connectedhomeip/chip-build-ameba:0.5.33 options: --user root steps: diff --git a/.github/workflows/examples-efr32.yaml b/.github/workflows/examples-efr32.yaml index cd24c6092d0fde..ccdee07ab280b5 100644 --- a/.github/workflows/examples-efr32.yaml +++ b/.github/workflows/examples-efr32.yaml @@ -45,6 +45,7 @@ jobs: submodules: true - name: Set up environment for size reports + if: ${{ !env.ACT }} env: GH_CONTEXT: ${{ toJson(github) }} run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}" diff --git a/.github/workflows/examples-esp32.yaml b/.github/workflows/examples-esp32.yaml index fe59c53d8016c8..33fb80929f5ff0 100644 --- a/.github/workflows/examples-esp32.yaml +++ b/.github/workflows/examples-esp32.yaml @@ -46,6 +46,7 @@ jobs: submodules: true - name: Set up environment for size reports + if: ${{ !env.ACT }} env: GH_CONTEXT: ${{ toJson(github) }} run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}" diff --git a/.github/workflows/examples-infineon.yaml b/.github/workflows/examples-infineon.yaml index 3c709c3354aa0b..7b92a324f0503d 100644 --- a/.github/workflows/examples-infineon.yaml +++ b/.github/workflows/examples-infineon.yaml @@ -41,6 +41,7 @@ jobs: submodules: true - name: Set up environment for size reports + if: ${{ !env.ACT }} env: GH_CONTEXT: ${{ toJson(github) }} run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}" @@ -88,3 +89,4 @@ jobs: path: | out/infineon-p6-lock/p6-default-lock-app-sizes.json out/infineon-p6-all-clusters/p6-default-all-clusters-app-sizes.json + out/infineon-p6-light/p6-default-light-app-sizes.json diff --git a/.github/workflows/examples-k32w.yaml b/.github/workflows/examples-k32w.yaml index 22676e6b0708e8..8fc2a81215111f 100644 --- a/.github/workflows/examples-k32w.yaml +++ b/.github/workflows/examples-k32w.yaml @@ -44,6 +44,7 @@ jobs: submodules: true - name: Set up environment for size reports + if: ${{ !env.ACT }} env: GH_CONTEXT: ${{ toJson(github) }} run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}" diff --git a/.github/workflows/examples-linux-standalone.yaml b/.github/workflows/examples-linux-standalone.yaml index f6593e5d7a5886..e8977cad8382eb 100644 --- a/.github/workflows/examples-linux-standalone.yaml +++ b/.github/workflows/examples-linux-standalone.yaml @@ -45,6 +45,7 @@ jobs: submodules: true - name: Set up environment for size reports + if: ${{ !env.ACT }} env: GH_CONTEXT: ${{ toJson(github) }} run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}" diff --git a/.github/workflows/examples-mbed.yaml b/.github/workflows/examples-mbed.yaml index ed5932aad9f5c0..03dba88839f9d3 100644 --- a/.github/workflows/examples-mbed.yaml +++ b/.github/workflows/examples-mbed.yaml @@ -48,6 +48,7 @@ jobs: submodules: true - name: Set up environment for size reports + if: ${{ !env.ACT }} env: GH_CONTEXT: ${{ toJson(github) }} run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}" diff --git a/.github/workflows/examples-nrfconnect.yaml b/.github/workflows/examples-nrfconnect.yaml index 63bd1c210c6238..66eefbdc4c1ef4 100644 --- a/.github/workflows/examples-nrfconnect.yaml +++ b/.github/workflows/examples-nrfconnect.yaml @@ -45,6 +45,7 @@ jobs: submodules: true - name: Set up environment for size reports + if: ${{ !env.ACT }} env: GH_CONTEXT: ${{ toJson(github) }} run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}" @@ -148,6 +149,14 @@ jobs: run: | scripts/run_in_build_env.sh "scripts/tests/nrfconnect_native_posix_tests.sh native_posix_64" + - name: Uploading Failed Test Logs + uses: actions/upload-artifact@v2 + if: ${{ failure() }} && ${{ !env.ACT }} + with: + name: test-log + path: | + src/test_driver/nrfconnect/build/Testing/Temporary/LastTest.log + - name: Uploading Size Reports uses: actions/upload-artifact@v2 if: ${{ !env.ACT }} diff --git a/.github/workflows/examples-qpg.yaml b/.github/workflows/examples-qpg.yaml index 486f774c7c79d0..724511050e74a1 100644 --- a/.github/workflows/examples-qpg.yaml +++ b/.github/workflows/examples-qpg.yaml @@ -44,6 +44,7 @@ jobs: submodules: true - name: Set up environment for size reports + if: ${{ !env.ACT }} env: GH_CONTEXT: ${{ toJson(github) }} run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}" diff --git a/.github/workflows/examples-telink.yaml b/.github/workflows/examples-telink.yaml index b24da206d6848d..6a372930a42146 100644 --- a/.github/workflows/examples-telink.yaml +++ b/.github/workflows/examples-telink.yaml @@ -43,6 +43,7 @@ jobs: submodules: true - name: Set up environment for size reports + if: ${{ !env.ACT }} env: GH_CONTEXT: ${{ toJson(github) }} run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}" diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index e0ba2a9a6aebb1..3e392c1ae9bdc6 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -30,11 +30,11 @@ jobs: strategy: matrix: - type: [tsan] - eventloop: [eventloop_same, eventloop_separate] + build_variant: [no-ble-tsan] + chip_tool: ["", -same-event-loop] env: - USE_SEPARATE_EVENTLOOP: ${{ matrix.eventloop == 'eventloop_separate' }} - USE_TSAN: ${{ matrix.type == 'tsan' }} + BUILD_VARIANT: ${{matrix.build_variant}} + CHIP_TOOL_VARIANT: ${{matrix.chip_tool}} if: github.actor != 'restyled-io[bot]' runs-on: ubuntu-latest @@ -66,33 +66,27 @@ jobs: path: | .environment/gn_out/.ninja_log .environment/pigweed-venv/*.log - - name: Build all clusters app - timeout-minutes: 5 + - name: Build Apps + timeout-minutes: 20 run: | - scripts/examples/gn_build_example.sh examples/all-clusters-app/linux out/debug/standalone/ chip_config_network_layer_ble=false is_tsan=${USE_TSAN} - - name: Build TV app - timeout-minutes: 5 - run: | - scripts/examples/gn_build_example.sh examples/tv-app/linux out/debug/standalone/ chip_config_network_layer_ble=false is_tsan=${USE_TSAN} - - name: Build chip-tool - timeout-minutes: 5 - run: | - scripts/examples/gn_build_example.sh examples/chip-tool out/debug/standalone/ is_tsan=${USE_TSAN} config_use_separate_eventloop=${USE_SEPARATE_EVENTLOOP} - - name: Copy objdir - run: | - # The idea is to not upload our objdir unless builds have - # actually succeeded, because that just wastes space. - rsync -a out/debug/standalone/ objdir-clone || true + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target linux-x64-chip-tool-${BUILD_VARIANT}${CHIP_TOOL_VARIANT} \ + --target linux-x64-all-clusters-${BUILD_VARIANT} \ + --target linux-x64-tv-app-${BUILD_VARIANT} \ + build \ + --copy-artifacts-to objdir-clone \ + " - name: Run Tests timeout-minutes: 30 run: | ./scripts/run_in_build_env.sh \ "./scripts/tests/run_test_suite.py \ - --chip-tool ./out/debug/standalone/chip-tool \ + --chip-tool ./out/linux-x64-chip-tool-${BUILD_VARIANT}${CHIP_TOOL_VARIANT}/chip-tool \ run \ - --iterations 2 \ - --all-clusters-app ./out/debug/standalone/chip-all-clusters-app \ - --tv-app ./out/debug/standalone/chip-tv-app \ + --iterations 1 \ + --all-clusters-app ./out/linux-x64-all-clusters-${BUILD_VARIANT}/chip-all-clusters-app \ + --tv-app ./out/linux-x64-tv-app-${BUILD_VARIANT}/chip-tv-app \ " - name: Uploading core files uses: actions/upload-artifact@v2 @@ -116,13 +110,11 @@ jobs: strategy: matrix: - type: [tsan, asan] - eventloop: [eventloop_same, eventloop_separate] + build_variant: [no-ble-tsan, no-ble-asan] + chip_tool: ["", -same-event-loop] env: - USE_SEPARATE_EVENTLOOP: ${{ matrix.eventloop == 'eventloop_separate' }} - USE_TSAN: ${{ matrix.type == 'tsan' }} - - USE_ASAN: ${{ matrix.type == 'asan' }} + BUILD_VARIANT: ${{matrix.build_variant}} + CHIP_TOOL_VARIANT: ${{matrix.chip_tool}} if: github.actor != 'restyled-io[bot]' runs-on: macos-latest @@ -159,30 +151,26 @@ jobs: path: | .environment/gn_out/.ninja_log .environment/pigweed-venv/*.log - - name: Run Build Test Server - timeout-minutes: 10 - run: | - scripts/examples/gn_build_example.sh examples/all-clusters-app/linux out/debug/standalone/ chip_config_network_layer_ble=false is_tsan=${USE_TSAN} is_asan=${USE_ASAN} - - name: Build chip-tool - timeout-minutes: 10 + - name: Build Apps + timeout-minutes: 20 run: | - scripts/examples/gn_build_example.sh examples/chip-tool out/debug/standalone/ is_tsan=${USE_TSAN} is_asan=${USE_ASAN} config_use_separate_eventloop=${USE_SEPARATE_EVENTLOOP} - - name: Copy objdir - run: | - # The idea is to not upload our objdir unless builds have - # actually succeeded, because that just wastes space. - rsync -a out/debug/standalone/ objdir-clone || true + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target darwin-x64-chip-tool-${BUILD_VARIANT}${CHIP_TOOL_VARIANT} \ + --target darwin-x64-all-clusters-${BUILD_VARIANT} \ + build \ + --copy-artifacts-to objdir-clone \ + " - name: Run Tests timeout-minutes: 45 run: | ./scripts/run_in_build_env.sh \ "./scripts/tests/run_test_suite.py \ - --chip-tool ./out/debug/standalone/chip-tool \ - --target-skip-glob 'TV_*' \ + --chip-tool ./out/darwin-x64-chip-tool-${BUILD_VARIANT}${CHIP_TOOL_VARIANT}/chip-tool \ + --target-skip-glob 'TV*' \ run \ - --iterations 2 \ - --all-clusters-app ./out/debug/standalone/chip-all-clusters-app \ - --tv-app ./out/debug/standalone/chip-tv-app \ + --iterations 1 \ + --all-clusters-app ./out/darwin-x64-all-clusters-${BUILD_VARIANT}/chip-all-clusters-app \ " - name: Uploading core files uses: actions/upload-artifact@v2 diff --git a/config/esp32/components/chip/Kconfig b/config/esp32/components/chip/Kconfig index 3ab41d517b8a50..3e59822a63553b 100644 --- a/config/esp32/components/chip/Kconfig +++ b/config/esp32/components/chip/Kconfig @@ -67,17 +67,6 @@ menu "CHIP Core" message handlers with the CHIP message layer to direct incoming messages to their code. - config RMP_TIMER_DEFAULT_PERIOD_SHIFT - int "Default WRMP Timer Tick Interval Shift (ms)" - range 0 16 - default 6 - help - The default interval shift, in milliseconds (e.g. 6 bits shift - = 64ms), at which items in the WRMP pending message list are - processed for the purpose of retransmission or timeout. - - This value can be overridden by the application at runtime. - config ENABLE_PW_RPC bool "Enable Pigweed RPC library" default n diff --git a/config/mbed/CMakeLists.txt b/config/mbed/CMakeLists.txt index b6bf30cfe9453b..b3e362e6ece434 100644 --- a/config/mbed/CMakeLists.txt +++ b/config/mbed/CMakeLists.txt @@ -371,6 +371,7 @@ target_include_directories(${APP_TARGET} PRIVATE ${PIGWEED_ROOT}/pw_log_basic/public_overrides ${PIGWEED_ROOT}/pw_span/public_overrides ${PIGWEED_ROOT}/pw_span/public + ${PIGWEED_ROOT}/pw_sync/public ${PIGWEED_ROOT}/pw_polyfill/public ${PIGWEED_ROOT}/pw_polyfill/standard_library_public ${PIGWEED_ROOT}/pw_polyfill/public_overrides diff --git a/config/python/CHIPProjectConfig.h b/config/python/CHIPProjectConfig.h index bdb2b613f7ceb7..7282f35db3a033 100644 --- a/config/python/CHIPProjectConfig.h +++ b/config/python/CHIPProjectConfig.h @@ -25,8 +25,6 @@ #define CHIP_CONFIG_ENABLE_EPHEMERAL_UDP_PORT 1 -#define CHIP_CONFIG_EVENT_LOGGING_UTC_TIMESTAMPS 1 - #define CHIP_CONFIG_EVENT_LOGGING_NUM_EXTERNAL_CALLBACKS 2 #define CHIP_CONFIG_EVENT_LOGGING_EXTERNAL_EVENT_SUPPORT 1 diff --git a/config/standalone/CHIPProjectConfig.h b/config/standalone/CHIPProjectConfig.h index 5cb03319c166ae..90873026e001ce 100644 --- a/config/standalone/CHIPProjectConfig.h +++ b/config/standalone/CHIPProjectConfig.h @@ -26,8 +26,6 @@ #define CHIP_CONFIG_ENABLE_EPHEMERAL_UDP_PORT 1 -#define CHIP_CONFIG_EVENT_LOGGING_UTC_TIMESTAMPS 1 - #define CHIP_CONFIG_EVENT_LOGGING_NUM_EXTERNAL_CALLBACKS 2 #define CHIP_CONFIG_EVENT_LOGGING_EXTERNAL_EVENT_SUPPORT 1 @@ -71,8 +69,8 @@ #define CHIP_CONFIG_DATA_MANAGEMENT_CLIENT_EXPERIMENTAL 1 -#ifndef DYNAMIC_ENDPOINT_COUNT -#define DYNAMIC_ENDPOINT_COUNT 4 +#ifndef CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT +#define CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT 4 #endif #define CONFIG_IM_BUILD_FOR_UNIT_TEST 1 diff --git a/docs/guides/nrfconnect_android_commissioning.md b/docs/guides/nrfconnect_android_commissioning.md index 787ba5957a72ab..b6260873b968d7 100644 --- a/docs/guides/nrfconnect_android_commissioning.md +++ b/docs/guides/nrfconnect_android_commissioning.md @@ -1,6 +1,6 @@ # Commissioning nRF Connect Accessory using Android CHIPTool -You can use [CHIPTool](android_chiptool_building.md) for Android smartphones to +You can use [CHIPTool](android_building.md) for Android smartphones to commission a Nordic Semiconductor device running an nRF Connect platform example onto a Matter-enabled Thread network. @@ -104,7 +104,7 @@ learn how to build and program the example onto an nRF52840 DK. ## Building and installing Android CHIPTool To build the CHIPTool application for your smartphone, read the -[Building Android CHIPTool](android_chiptool_building.md) guide. +[Building Android](android_building.md) guide. After building, install the application by completing the following steps: diff --git a/docs/guides/simulated_device_linux.md b/docs/guides/simulated_device_linux.md new file mode 100644 index 00000000000000..5bbd5f2b6452cf --- /dev/null +++ b/docs/guides/simulated_device_linux.md @@ -0,0 +1,144 @@ +# Simulated Device How-To (Linux) + +This document contains instructions on how to build, run, and interact with a +simulated device. All virtual accessories live in +[examples/placeholder/linux/apps](../../examples/placeholder/linux/apps). + +Each accessory needs to be hosted into a subfolder. It will be the name of the +application. For example `app1` will create a binary named `chip-app1`. + +If some parameters need to be overridden, a `CHIPProjectConfig.h` file can be +placed under an ‘include’ folder into the app folder. For example +`examples/placeholder/linux/apps/app1/include/CHIPProjectConfig.h` + +In order to generate specific tests for a given accessory, a +[examples/placeholder/linux/apps/app1/tests.js](../../examples/placeholder/linux/apps/app1/tests.js) +file can be added into the application directory. The tests listed there are the +one that will be executed once the application has been commissioned. + +Simulated Device: simulation of an application in which tests can be added. It +is defined by a ZAP config file and tests can be added with a +[YAML file](../../src/app/tests/suites/certification/Test_TC_DM_1_3_Simulated.yaml). + +### Prerequisite + +- [Building Prerequisites](./BUILDING.md#prerequisites) +- [Prepare For Building](./BUILDING.md#prepare-for-building) + +## Generating and building the default Simulated App with Script + +In order to utilize the app against a commissioner or controller, the app will +need to be specifically built. + +1. To generate the ZAP files, and build the `chip-app1` binary completing the + following steps: + + ``` + ./scripts/examples/gn_build_test_example.sh app1 + ``` + +## Build the App only + +In order to utilize the app against a commissioner or controller, the app will +need to be specifically built. + +1. To only build the `chip-app1` binary completing the following steps: + + ``` + source scripts/activate.sh + CHIP_ROOT="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" + GN_ARGS="chip_tests_zap_config=\"app1\"" + GN_ARGS+="chip_project_config_include_dirs=[\"$CHIP_ROOT/examples/placeholder/linux/apps/app1/include\", \"$CHIP_ROOT/config/standalone\"]" + GN_ARGS+="chip_config_network_layer_ble=false" + + gn gen --check --fail-on-unused-args --root=examples/placeholder/linux out/simulated --args="$GN_ARGS" + + ninja -C out/simulated + ``` + +## Running the app + +Now that the building is completed there is a `chip-app1` binary created. This +binary can be executed on a linux os. + +1. To generate the ZAP files, and build the `chip-app1` binary completing the + following steps: + + ``` + ./out/simulated/chip-app1 + ``` + +## Running the app with test parameter + +Now that the building is completed there is a `chip-app1` binary created. This +binary can be executed on a linux os with test commands. + +1. To generate the ZAP files, and build the `chip-app1` binary completing the + following steps: + + ``` + ./out/simulated/chip-app1 --command [TEST NAME] + ``` + +## Interacting with the simulated app + +Now that the building the app and starting it is complete, you will be able to +interact with it using chip-tool + +1. Follow the instruction to build chip-tool in the + [chip-tool readme](../../examples/chip-tool). + +2. Run this command to initiate the pairing. + ``` + ./out/debug/standalone/chip-tool pairing ethernet 0x654321 20202021 3842 [IP ADDRESS of App] 5542 + ``` +3. Run this command to complete the commissioning. + ``` + ./out/debug/standalone/chip-tool generalcommissioning commissioning-complete 0x654321 0 + ``` +4. Most tests will start at this point and now an send cluster commands with + chip-tool as follow. + + ``` + ./out/debug/standalone/chip-tool onoff on 0x654321 1 + ./out/debug/standalone/chip-tool onoff read on-off 0x654321 1 + ./out/debug/standalone/chip-tool onoff write on-time 1 0x654321 1 + ``` + + See [chip-tool readme](../../examples/chip-tool) for additional commands. + +## Adding simulated Tests via YAML + +In order to validate commissioner/controller behavior, tests need to be added to +the simulated device test framework. To achieve this, YAML files are created and +new code is generated. + +1. YAML test file are located in + [YAML folder](../../src/app/tests/suites/certification/) +2. Test names must follow a strict format dues to CI of test recognition. The + format is as follows: + - Test_TC\_[`CATEGORY ABBREVIATION`]\_[`SECTION NUMBER`]\_[`SUBSECTION + NUMBER`]\_Simulated.yaml + - `IMPORTANT`: The test name must end in Simulated with the + capital. +3. Available properties can be found in + [YAML Test Name](../../src/app/tests/suites/README.md) +4. An Additional property is as follows: + + | Name | Description | + | ---- | --------------------------------------------------------------------------- | + | wait | The command that is expected to be received on the app from the controller. | + +5. [Test_TC_DM_1_3_Simulated](../../src/app/tests/suites/certification/Test_TC_DM_1_3_Simulated.yaml) + is an example of a written test that runs on the simulated device. +6. Next, it will need to be added to + [examples/placeholder/linux/apps/app1/tests.js](../../examples/placeholder/linux/apps/app1/tests.js). + in the following array + ```javascript + const tests = ["Test_TC_DM_1_3_Simulated"]; + ``` +7. Then, the code will be generated using ZAP. Follow + [Gen Script](#generating-and-building-the-default-simulated-app-with-script) + to do so. +8. When submitting code for review, create 2 commits. One for YAML changes and + second for generated code. 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 c982a6f1f92318..65df1f07560b01 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 @@ -1532,6 +1532,36 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "RegulatoryConfig", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LocationCapability", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "FeatureMap", "code": 65532, @@ -3061,6 +3091,21 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x000F", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -4008,7 +4053,7 @@ "outgoing": 1 }, { - "name": "SetPin", + "name": "SetPINCode", "code": 5, "mfgCode": null, "source": "client", @@ -4016,7 +4061,7 @@ "outgoing": 1 }, { - "name": "GetPin", + "name": "GetPINCode", "code": 6, "mfgCode": null, "source": "client", @@ -4024,7 +4069,7 @@ "outgoing": 1 }, { - "name": "ClearPin", + "name": "ClearPINCode", "code": 7, "mfgCode": null, "source": "client", @@ -4032,7 +4077,7 @@ "outgoing": 1 }, { - "name": "ClearAllPins", + "name": "ClearAllPINCodes", "code": 8, "mfgCode": null, "source": "client", @@ -4040,7 +4085,7 @@ "outgoing": 1 }, { - "name": "SetWeekdaySchedule", + "name": "SetWeekDaySchedule", "code": 11, "mfgCode": null, "source": "client", @@ -4048,7 +4093,7 @@ "outgoing": 1 }, { - "name": "GetWeekdaySchedule", + "name": "GetWeekDaySchedule", "code": 12, "mfgCode": null, "source": "client", @@ -4056,7 +4101,7 @@ "outgoing": 1 }, { - "name": "ClearWeekdaySchedule", + "name": "ClearWeekDaySchedule", "code": 13, "mfgCode": null, "source": "client", @@ -4064,7 +4109,7 @@ "outgoing": 1 }, { - "name": "SetYeardaySchedule", + "name": "SetYearDaySchedule", "code": 14, "mfgCode": null, "source": "client", @@ -4072,7 +4117,7 @@ "outgoing": 1 }, { - "name": "GetYeardaySchedule", + "name": "GetYearDaySchedule", "code": 15, "mfgCode": null, "source": "client", @@ -4080,7 +4125,7 @@ "outgoing": 1 }, { - "name": "ClearYeardaySchedule", + "name": "ClearYearDaySchedule", "code": 16, "mfgCode": null, "source": "client", @@ -4128,7 +4173,7 @@ "outgoing": 1 }, { - "name": "SetRfid", + "name": "SetRFIDCode", "code": 22, "mfgCode": null, "source": "client", @@ -4136,7 +4181,7 @@ "outgoing": 1 }, { - "name": "GetRfid", + "name": "GetRFIDCode", "code": 23, "mfgCode": null, "source": "client", @@ -4144,7 +4189,7 @@ "outgoing": 1 }, { - "name": "ClearRfid", + "name": "ClearRFIDCode", "code": 24, "mfgCode": null, "source": "client", @@ -4152,7 +4197,7 @@ "outgoing": 1 }, { - "name": "ClearAllRfids", + "name": "ClearAllRFIDCodes", "code": 25, "mfgCode": null, "source": "client", @@ -4185,27 +4230,10 @@ "define": "DOOR_LOCK_CLUSTER", "side": "server", "enabled": 0, - "commands": [ - { - "name": "LockDoorResponse", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "UnlockDoorResponse", - "code": 1, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - } - ], + "commands": [], "attributes": [ { - "name": "lock state", + "name": "LockState", "code": 0, "mfgCode": null, "side": "server", @@ -4220,7 +4248,7 @@ "reportableChange": 0 }, { - "name": "lock type", + "name": "LockType", "code": 1, "mfgCode": null, "side": "server", @@ -4235,7 +4263,7 @@ "reportableChange": 0 }, { - "name": "actuator enabled", + "name": "ActuatorEnabled", "code": 2, "mfgCode": null, "side": "server", @@ -4250,7 +4278,7 @@ "reportableChange": 0 }, { - "name": "door state", + "name": "DoorState", "code": 3, "mfgCode": null, "side": "server", @@ -4265,7 +4293,7 @@ "reportableChange": 0 }, { - "name": "enable logging", + "name": "EnableLogging", "code": 32, "mfgCode": null, "side": "server", @@ -4280,7 +4308,7 @@ "reportableChange": 0 }, { - "name": "language", + "name": "Language", "code": 33, "mfgCode": null, "side": "server", @@ -4295,7 +4323,7 @@ "reportableChange": 0 }, { - "name": "led settings", + "name": "LEDSettings", "code": 34, "mfgCode": null, "side": "server", @@ -4310,7 +4338,7 @@ "reportableChange": 0 }, { - "name": "auto relock time", + "name": "AutoRelockTime", "code": 35, "mfgCode": null, "side": "server", @@ -4325,7 +4353,7 @@ "reportableChange": 0 }, { - "name": "sound volume", + "name": "SoundVolume", "code": 36, "mfgCode": null, "side": "server", @@ -4340,7 +4368,7 @@ "reportableChange": 0 }, { - "name": "operating mode", + "name": "OperatingMode", "code": 37, "mfgCode": null, "side": "server", @@ -4355,7 +4383,7 @@ "reportableChange": 0 }, { - "name": "default configuration register", + "name": "DefaultConfigurationRegister", "code": 39, "mfgCode": null, "side": "server", @@ -4370,7 +4398,7 @@ "reportableChange": 0 }, { - "name": "enable local programming", + "name": "EnableLocalProgramming", "code": 40, "mfgCode": null, "side": "server", @@ -4385,7 +4413,7 @@ "reportableChange": 0 }, { - "name": "enable one touch locking", + "name": "EnableOneTouchLocking", "code": 41, "mfgCode": null, "side": "server", @@ -4400,7 +4428,7 @@ "reportableChange": 0 }, { - "name": "enable inside status led", + "name": "EnableInsideStatusLED", "code": 42, "mfgCode": null, "side": "server", @@ -4415,7 +4443,7 @@ "reportableChange": 0 }, { - "name": "enable privacy mode button", + "name": "EnablePrivacyModeButton", "code": 43, "mfgCode": null, "side": "server", @@ -4430,7 +4458,7 @@ "reportableChange": 0 }, { - "name": "wrong code entry limit", + "name": "WrongCodeEntryLimit", "code": 48, "mfgCode": null, "side": "server", @@ -4445,7 +4473,7 @@ "reportableChange": 0 }, { - "name": "user code temporary disable time", + "name": "UserCodeTemporaryDisableTime", "code": 49, "mfgCode": null, "side": "server", @@ -4460,7 +4488,7 @@ "reportableChange": 0 }, { - "name": "send pin over the air", + "name": "SendPINOverTheAir", "code": 50, "mfgCode": null, "side": "server", @@ -4475,7 +4503,7 @@ "reportableChange": 0 }, { - "name": "require pin for rf operation", + "name": "RequirePINforRemoteOperation", "code": 51, "mfgCode": null, "side": "server", @@ -4490,22 +4518,7 @@ "reportableChange": 0 }, { - "name": "zigbee security level", - "code": 52, - "mfgCode": null, - "side": "server", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "alarm mask", + "name": "AlarmMask", "code": 64, "mfgCode": null, "side": "server", @@ -4520,7 +4533,7 @@ "reportableChange": 0 }, { - "name": "keypad operation event mask", + "name": "KeypadOperationEventMask", "code": 65, "mfgCode": null, "side": "server", @@ -4535,7 +4548,7 @@ "reportableChange": 0 }, { - "name": "RF operation event mask", + "name": "RemoteOperationEventMask", "code": 66, "mfgCode": null, "side": "server", @@ -4550,7 +4563,7 @@ "reportableChange": 0 }, { - "name": "manual operation event mask", + "name": "ManualOperationEventMask", "code": 67, "mfgCode": null, "side": "server", @@ -4565,7 +4578,7 @@ "reportableChange": 0 }, { - "name": "rfid operation event mask", + "name": "RFIDOperationEventMask", "code": 68, "mfgCode": null, "side": "server", @@ -4580,7 +4593,7 @@ "reportableChange": 0 }, { - "name": "keypad programming event mask", + "name": "KeypadProgrammingEventMask", "code": 69, "mfgCode": null, "side": "server", @@ -4595,7 +4608,7 @@ "reportableChange": 0 }, { - "name": "rf programming event mask", + "name": "RemoteProgrammingEventMask", "code": 70, "mfgCode": null, "side": "server", @@ -4610,7 +4623,7 @@ "reportableChange": 0 }, { - "name": "rfid programming event mask", + "name": "RFIDProgrammingEventMask", "code": 71, "mfgCode": null, "side": "server", @@ -9811,7 +9824,7 @@ "outgoing": 1 }, { - "name": "SetPin", + "name": "SetPINCode", "code": 5, "mfgCode": null, "source": "client", @@ -9819,7 +9832,7 @@ "outgoing": 1 }, { - "name": "GetPin", + "name": "GetPINCode", "code": 6, "mfgCode": null, "source": "client", @@ -9827,7 +9840,7 @@ "outgoing": 1 }, { - "name": "ClearPin", + "name": "ClearPINCode", "code": 7, "mfgCode": null, "source": "client", @@ -9835,7 +9848,7 @@ "outgoing": 1 }, { - "name": "ClearAllPins", + "name": "ClearAllPINCodes", "code": 8, "mfgCode": null, "source": "client", @@ -9843,7 +9856,7 @@ "outgoing": 1 }, { - "name": "SetWeekdaySchedule", + "name": "SetWeekDaySchedule", "code": 11, "mfgCode": null, "source": "client", @@ -9851,7 +9864,7 @@ "outgoing": 1 }, { - "name": "GetWeekdaySchedule", + "name": "GetWeekDaySchedule", "code": 12, "mfgCode": null, "source": "client", @@ -9859,7 +9872,7 @@ "outgoing": 1 }, { - "name": "ClearWeekdaySchedule", + "name": "ClearWeekDaySchedule", "code": 13, "mfgCode": null, "source": "client", @@ -9867,7 +9880,7 @@ "outgoing": 1 }, { - "name": "SetYeardaySchedule", + "name": "SetYearDaySchedule", "code": 14, "mfgCode": null, "source": "client", @@ -9875,7 +9888,7 @@ "outgoing": 1 }, { - "name": "GetYeardaySchedule", + "name": "GetYearDaySchedule", "code": 15, "mfgCode": null, "source": "client", @@ -9883,7 +9896,7 @@ "outgoing": 1 }, { - "name": "ClearYeardaySchedule", + "name": "ClearYearDaySchedule", "code": 16, "mfgCode": null, "source": "client", @@ -9931,7 +9944,7 @@ "outgoing": 1 }, { - "name": "SetRfid", + "name": "SetRFIDCode", "code": 22, "mfgCode": null, "source": "client", @@ -9939,7 +9952,7 @@ "outgoing": 1 }, { - "name": "GetRfid", + "name": "GetRFIDCode", "code": 23, "mfgCode": null, "source": "client", @@ -9947,7 +9960,7 @@ "outgoing": 1 }, { - "name": "ClearRfid", + "name": "ClearRFIDCode", "code": 24, "mfgCode": null, "source": "client", @@ -9955,7 +9968,7 @@ "outgoing": 1 }, { - "name": "ClearAllRfids", + "name": "ClearAllRFIDCodes", "code": 25, "mfgCode": null, "source": "client", @@ -9990,25 +10003,41 @@ "enabled": 1, "commands": [ { - "name": "LockDoorResponse", - "code": 0, + "name": "GetLogRecordResponse", + "code": 4, "mfgCode": null, "source": "server", - "incoming": 1, + "incoming": 0, "outgoing": 1 }, { - "name": "UnlockDoorResponse", - "code": 1, + "name": "GetPINCodeResponse", + "code": 6, "mfgCode": null, "source": "server", - "incoming": 1, + "incoming": 0, + "outgoing": 1 + }, + { + "name": "GetWeekDayScheduleResponse", + "code": 12, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "GetYearDayScheduleResponse", + "code": 15, + "mfgCode": null, + "source": "server", + "incoming": 0, "outgoing": 1 } ], "attributes": [ { - "name": "lock state", + "name": "LockState", "code": 0, "mfgCode": null, "side": "server", @@ -10023,7 +10052,7 @@ "reportableChange": 0 }, { - "name": "lock type", + "name": "LockType", "code": 1, "mfgCode": null, "side": "server", @@ -10038,7 +10067,7 @@ "reportableChange": 0 }, { - "name": "actuator enabled", + "name": "ActuatorEnabled", "code": 2, "mfgCode": null, "side": "server", @@ -10053,7 +10082,7 @@ "reportableChange": 0 }, { - "name": "door state", + "name": "DoorState", "code": 3, "mfgCode": null, "side": "server", @@ -10068,7 +10097,22 @@ "reportableChange": 0 }, { - "name": "enable logging", + "name": "NumberOfLogRecordsSupported", + "code": 16, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EnableLogging", "code": 32, "mfgCode": null, "side": "server", @@ -10083,7 +10127,7 @@ "reportableChange": 0 }, { - "name": "language", + "name": "Language", "code": 33, "mfgCode": null, "side": "server", @@ -10098,7 +10142,7 @@ "reportableChange": 0 }, { - "name": "led settings", + "name": "LEDSettings", "code": 34, "mfgCode": null, "side": "server", @@ -10113,11 +10157,11 @@ "reportableChange": 0 }, { - "name": "auto relock time", + "name": "AutoRelockTime", "code": 35, "mfgCode": null, "side": "server", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -10128,7 +10172,7 @@ "reportableChange": 0 }, { - "name": "sound volume", + "name": "SoundVolume", "code": 36, "mfgCode": null, "side": "server", @@ -10143,11 +10187,11 @@ "reportableChange": 0 }, { - "name": "operating mode", + "name": "OperatingMode", "code": 37, "mfgCode": null, "side": "server", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -10158,7 +10202,22 @@ "reportableChange": 0 }, { - "name": "default configuration register", + "name": "SupportedOperatingModes", + "code": 38, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFFF6", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "DefaultConfigurationRegister", "code": 39, "mfgCode": null, "side": "server", @@ -10173,7 +10232,7 @@ "reportableChange": 0 }, { - "name": "enable local programming", + "name": "EnableLocalProgramming", "code": 40, "mfgCode": null, "side": "server", @@ -10188,7 +10247,7 @@ "reportableChange": 0 }, { - "name": "enable one touch locking", + "name": "EnableOneTouchLocking", "code": 41, "mfgCode": null, "side": "server", @@ -10203,7 +10262,7 @@ "reportableChange": 0 }, { - "name": "enable inside status led", + "name": "EnableInsideStatusLED", "code": 42, "mfgCode": null, "side": "server", @@ -10218,7 +10277,7 @@ "reportableChange": 0 }, { - "name": "enable privacy mode button", + "name": "EnablePrivacyModeButton", "code": 43, "mfgCode": null, "side": "server", @@ -10233,7 +10292,7 @@ "reportableChange": 0 }, { - "name": "wrong code entry limit", + "name": "WrongCodeEntryLimit", "code": 48, "mfgCode": null, "side": "server", @@ -10248,7 +10307,7 @@ "reportableChange": 0 }, { - "name": "user code temporary disable time", + "name": "UserCodeTemporaryDisableTime", "code": 49, "mfgCode": null, "side": "server", @@ -10263,7 +10322,7 @@ "reportableChange": 0 }, { - "name": "send pin over the air", + "name": "SendPINOverTheAir", "code": 50, "mfgCode": null, "side": "server", @@ -10278,7 +10337,7 @@ "reportableChange": 0 }, { - "name": "require pin for rf operation", + "name": "RequirePINforRemoteOperation", "code": 51, "mfgCode": null, "side": "server", @@ -10293,22 +10352,7 @@ "reportableChange": 0 }, { - "name": "zigbee security level", - "code": 52, - "mfgCode": null, - "side": "server", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "alarm mask", + "name": "AlarmMask", "code": 64, "mfgCode": null, "side": "server", @@ -10323,7 +10367,7 @@ "reportableChange": 0 }, { - "name": "keypad operation event mask", + "name": "KeypadOperationEventMask", "code": 65, "mfgCode": null, "side": "server", @@ -10338,7 +10382,7 @@ "reportableChange": 0 }, { - "name": "RF operation event mask", + "name": "RemoteOperationEventMask", "code": 66, "mfgCode": null, "side": "server", @@ -10353,7 +10397,7 @@ "reportableChange": 0 }, { - "name": "manual operation event mask", + "name": "ManualOperationEventMask", "code": 67, "mfgCode": null, "side": "server", @@ -10368,7 +10412,7 @@ "reportableChange": 0 }, { - "name": "rfid operation event mask", + "name": "RFIDOperationEventMask", "code": 68, "mfgCode": null, "side": "server", @@ -10383,7 +10427,7 @@ "reportableChange": 0 }, { - "name": "keypad programming event mask", + "name": "KeypadProgrammingEventMask", "code": 69, "mfgCode": null, "side": "server", @@ -10398,7 +10442,7 @@ "reportableChange": 0 }, { - "name": "rf programming event mask", + "name": "RemoteProgrammingEventMask", "code": 70, "mfgCode": null, "side": "server", @@ -10413,7 +10457,7 @@ "reportableChange": 0 }, { - "name": "rfid programming event mask", + "name": "RFIDProgrammingEventMask", "code": 71, "mfgCode": null, "side": "server", @@ -15319,6 +15363,22 @@ "source": "client", "incoming": 1, "outgoing": 0 + }, + { + "name": "TimedInvokeRequest", + "code": 18, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "TestSimpleOptionalArgumentRequest", + "code": 19, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 } ], "attributes": [ @@ -15503,8 +15563,8 @@ "reportableChange": 0 }, { - "name": "int32u", - "code": 8, + "name": "int24u", + "code": 7, "mfgCode": null, "side": "server", "included": 1, @@ -15513,13 +15573,13 @@ "bounded": 0, "defaultValue": "0", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { - "name": "int64u", - "code": 12, + "name": "int32u", + "code": 8, "mfgCode": null, "side": "server", "included": 1, @@ -15533,8 +15593,8 @@ "reportableChange": 0 }, { - "name": "int8s", - "code": 13, + "name": "int40u", + "code": 9, "mfgCode": null, "side": "server", "included": 1, @@ -15543,13 +15603,13 @@ "bounded": 0, "defaultValue": "0", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { - "name": "int16s", - "code": 14, + "name": "int48u", + "code": 10, "mfgCode": null, "side": "server", "included": 1, @@ -15558,13 +15618,13 @@ "bounded": 0, "defaultValue": "0", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { - "name": "int32s", - "code": 16, + "name": "int56u", + "code": 11, "mfgCode": null, "side": "server", "included": 1, @@ -15573,13 +15633,13 @@ "bounded": 0, "defaultValue": "0", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { - "name": "int64s", - "code": 20, + "name": "int64u", + "code": 12, "mfgCode": null, "side": "server", "included": 1, @@ -15593,8 +15653,8 @@ "reportableChange": 0 }, { - "name": "enum8", - "code": 21, + "name": "int8s", + "code": 13, "mfgCode": null, "side": "server", "included": 1, @@ -15608,8 +15668,8 @@ "reportableChange": 0 }, { - "name": "enum16", - "code": 22, + "name": "int16s", + "code": 14, "mfgCode": null, "side": "server", "included": 1, @@ -15623,113 +15683,263 @@ "reportableChange": 0 }, { - "name": "octet_string", - "code": 25, + "name": "int24s", + "code": 15, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { - "name": "list_int8u", - "code": 26, + "name": "int32s", + "code": 16, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0", "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "list_octet_string", - "code": 27, + "name": "int40s", + "code": 17, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { - "name": "list_struct_octet_string", - "code": 28, + "name": "int48s", + "code": 18, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { - "name": "long_octet_string", - "code": 29, + "name": "int56s", + "code": 19, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0", "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { - "name": "char_string", - "code": 30, + "name": "int64s", + "code": 20, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0", "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "long_char_string", - "code": 31, + "name": "enum8", + "code": 21, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0", "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "epoch_us", - "code": 32, + "name": "enum16", + "code": 22, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "float_single", + "code": 23, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "float_double", + "code": 24, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "octet_string", + "code": 25, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "list_int8u", + "code": 26, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "list_octet_string", + "code": 27, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "list_struct_octet_string", + "code": 28, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "long_octet_string", + "code": 29, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "char_string", + "code": 30, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "long_char_string", + "code": 31, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "epoch_us", + "code": 32, "mfgCode": null, "side": "server", "included": 1, @@ -15787,6 +15997,111 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "enum_attr", + "code": 36, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "struct", + "code": 37, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "range_restricted_int8u", + "code": 38, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "70", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "range_restricted_int8s", + "code": 39, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "range_restricted_int16u", + "code": 40, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "200", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "range_restricted_int16s", + "code": 41, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "timed_write_boolean", + "code": 48, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "unsupported", "code": 255, @@ -15907,6 +16222,21 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "nullable_int24u", + "code": 32775, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "nullable_int32u", "code": 32776, @@ -15922,6 +16252,51 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "nullable_int40u", + "code": 32777, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "nullable_int48u", + "code": 32778, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "nullable_int56u", + "code": 32779, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "nullable_int64u", "code": 32780, @@ -15967,6 +16342,21 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "nullable_int24s", + "code": 32783, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "nullable_int32s", "code": 32784, @@ -15982,6 +16372,51 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "nullable_int40s", + "code": 32785, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "nullable_int48s", + "code": 32786, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "nullable_int56s", + "code": 32787, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "nullable_int64s", "code": 32788, @@ -16027,6 +16462,36 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "nullable_float_single", + "code": 32791, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "nullable_float_double", + "code": 32792, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "nullable_octet_string", "code": 32793, @@ -16057,6 +16522,96 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "nullable_enum_attr", + "code": 32804, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "nullable_struct", + "code": 32805, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "nullable_range_restricted_int8u", + "code": 32806, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "70", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "nullable_range_restricted_int8s", + "code": 32807, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "nullable_range_restricted_int16u", + "code": 32808, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "200", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "nullable_range_restricted_int16s", + "code": 32809, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -17619,7 +18174,7 @@ "outgoing": 1 }, { - "name": "SetPin", + "name": "SetPINCode", "code": 5, "mfgCode": null, "source": "client", @@ -17627,7 +18182,7 @@ "outgoing": 1 }, { - "name": "GetPin", + "name": "GetPINCode", "code": 6, "mfgCode": null, "source": "client", @@ -17635,7 +18190,7 @@ "outgoing": 1 }, { - "name": "ClearPin", + "name": "ClearPINCode", "code": 7, "mfgCode": null, "source": "client", @@ -17643,7 +18198,7 @@ "outgoing": 1 }, { - "name": "ClearAllPins", + "name": "ClearAllPINCodes", "code": 8, "mfgCode": null, "source": "client", @@ -17651,7 +18206,7 @@ "outgoing": 1 }, { - "name": "SetWeekdaySchedule", + "name": "SetWeekDaySchedule", "code": 11, "mfgCode": null, "source": "client", @@ -17659,7 +18214,7 @@ "outgoing": 1 }, { - "name": "GetWeekdaySchedule", + "name": "GetWeekDaySchedule", "code": 12, "mfgCode": null, "source": "client", @@ -17667,7 +18222,7 @@ "outgoing": 1 }, { - "name": "ClearWeekdaySchedule", + "name": "ClearWeekDaySchedule", "code": 13, "mfgCode": null, "source": "client", @@ -17675,7 +18230,7 @@ "outgoing": 1 }, { - "name": "SetYeardaySchedule", + "name": "SetYearDaySchedule", "code": 14, "mfgCode": null, "source": "client", @@ -17683,7 +18238,7 @@ "outgoing": 1 }, { - "name": "GetYeardaySchedule", + "name": "GetYearDaySchedule", "code": 15, "mfgCode": null, "source": "client", @@ -17691,7 +18246,7 @@ "outgoing": 1 }, { - "name": "ClearYeardaySchedule", + "name": "ClearYearDaySchedule", "code": 16, "mfgCode": null, "source": "client", @@ -17739,7 +18294,7 @@ "outgoing": 1 }, { - "name": "SetRfid", + "name": "SetRFIDCode", "code": 22, "mfgCode": null, "source": "client", @@ -17747,7 +18302,7 @@ "outgoing": 1 }, { - "name": "GetRfid", + "name": "GetRFIDCode", "code": 23, "mfgCode": null, "source": "client", @@ -17755,7 +18310,7 @@ "outgoing": 1 }, { - "name": "ClearRfid", + "name": "ClearRFIDCode", "code": 24, "mfgCode": null, "source": "client", @@ -17763,7 +18318,7 @@ "outgoing": 1 }, { - "name": "ClearAllRfids", + "name": "ClearAllRFIDCodes", "code": 25, "mfgCode": null, "source": "client", @@ -17796,27 +18351,10 @@ "define": "DOOR_LOCK_CLUSTER", "side": "server", "enabled": 0, - "commands": [ - { - "name": "LockDoorResponse", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "UnlockDoorResponse", - "code": 1, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - } - ], + "commands": [], "attributes": [ { - "name": "lock state", + "name": "LockState", "code": 0, "mfgCode": null, "side": "server", @@ -17831,7 +18369,7 @@ "reportableChange": 0 }, { - "name": "lock type", + "name": "LockType", "code": 1, "mfgCode": null, "side": "server", @@ -17846,7 +18384,7 @@ "reportableChange": 0 }, { - "name": "actuator enabled", + "name": "ActuatorEnabled", "code": 2, "mfgCode": null, "side": "server", @@ -17861,7 +18399,7 @@ "reportableChange": 0 }, { - "name": "door state", + "name": "DoorState", "code": 3, "mfgCode": null, "side": "server", @@ -17876,7 +18414,7 @@ "reportableChange": 0 }, { - "name": "enable logging", + "name": "EnableLogging", "code": 32, "mfgCode": null, "side": "server", @@ -17891,7 +18429,7 @@ "reportableChange": 0 }, { - "name": "language", + "name": "Language", "code": 33, "mfgCode": null, "side": "server", @@ -17906,7 +18444,7 @@ "reportableChange": 0 }, { - "name": "led settings", + "name": "LEDSettings", "code": 34, "mfgCode": null, "side": "server", @@ -17921,7 +18459,7 @@ "reportableChange": 0 }, { - "name": "auto relock time", + "name": "AutoRelockTime", "code": 35, "mfgCode": null, "side": "server", @@ -17936,7 +18474,7 @@ "reportableChange": 0 }, { - "name": "sound volume", + "name": "SoundVolume", "code": 36, "mfgCode": null, "side": "server", @@ -17951,7 +18489,7 @@ "reportableChange": 0 }, { - "name": "operating mode", + "name": "OperatingMode", "code": 37, "mfgCode": null, "side": "server", @@ -17966,7 +18504,7 @@ "reportableChange": 0 }, { - "name": "default configuration register", + "name": "DefaultConfigurationRegister", "code": 39, "mfgCode": null, "side": "server", @@ -17981,7 +18519,7 @@ "reportableChange": 0 }, { - "name": "enable local programming", + "name": "EnableLocalProgramming", "code": 40, "mfgCode": null, "side": "server", @@ -17996,7 +18534,7 @@ "reportableChange": 0 }, { - "name": "enable one touch locking", + "name": "EnableOneTouchLocking", "code": 41, "mfgCode": null, "side": "server", @@ -18011,7 +18549,7 @@ "reportableChange": 0 }, { - "name": "enable inside status led", + "name": "EnableInsideStatusLED", "code": 42, "mfgCode": null, "side": "server", @@ -18026,7 +18564,7 @@ "reportableChange": 0 }, { - "name": "enable privacy mode button", + "name": "EnablePrivacyModeButton", "code": 43, "mfgCode": null, "side": "server", @@ -18041,7 +18579,7 @@ "reportableChange": 0 }, { - "name": "wrong code entry limit", + "name": "WrongCodeEntryLimit", "code": 48, "mfgCode": null, "side": "server", @@ -18056,7 +18594,7 @@ "reportableChange": 0 }, { - "name": "user code temporary disable time", + "name": "UserCodeTemporaryDisableTime", "code": 49, "mfgCode": null, "side": "server", @@ -18071,7 +18609,7 @@ "reportableChange": 0 }, { - "name": "send pin over the air", + "name": "SendPINOverTheAir", "code": 50, "mfgCode": null, "side": "server", @@ -18086,7 +18624,7 @@ "reportableChange": 0 }, { - "name": "require pin for rf operation", + "name": "RequirePINforRemoteOperation", "code": 51, "mfgCode": null, "side": "server", @@ -18101,22 +18639,7 @@ "reportableChange": 0 }, { - "name": "zigbee security level", - "code": 52, - "mfgCode": null, - "side": "server", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "alarm mask", + "name": "AlarmMask", "code": 64, "mfgCode": null, "side": "server", @@ -18131,7 +18654,7 @@ "reportableChange": 0 }, { - "name": "keypad operation event mask", + "name": "KeypadOperationEventMask", "code": 65, "mfgCode": null, "side": "server", @@ -18146,7 +18669,7 @@ "reportableChange": 0 }, { - "name": "RF operation event mask", + "name": "RemoteOperationEventMask", "code": 66, "mfgCode": null, "side": "server", @@ -18161,7 +18684,7 @@ "reportableChange": 0 }, { - "name": "manual operation event mask", + "name": "ManualOperationEventMask", "code": 67, "mfgCode": null, "side": "server", @@ -18176,7 +18699,7 @@ "reportableChange": 0 }, { - "name": "rfid operation event mask", + "name": "RFIDOperationEventMask", "code": 68, "mfgCode": null, "side": "server", @@ -18191,7 +18714,7 @@ "reportableChange": 0 }, { - "name": "keypad programming event mask", + "name": "KeypadProgrammingEventMask", "code": 69, "mfgCode": null, "side": "server", @@ -18206,7 +18729,7 @@ "reportableChange": 0 }, { - "name": "rf programming event mask", + "name": "RemoteProgrammingEventMask", "code": 70, "mfgCode": null, "side": "server", @@ -18221,7 +18744,7 @@ "reportableChange": 0 }, { - "name": "rfid programming event mask", + "name": "RFIDProgrammingEventMask", "code": 71, "mfgCode": null, "side": "server", diff --git a/examples/all-clusters-app/ameba/chip_main.cmake b/examples/all-clusters-app/ameba/chip_main.cmake index 6b0541edb6b76b..bdf74e801590ce 100755 --- a/examples/all-clusters-app/ameba/chip_main.cmake +++ b/examples/all-clusters-app/ameba/chip_main.cmake @@ -23,6 +23,7 @@ list( ${chip_dir}/src/app/EventManagement.cpp ${chip_dir}/src/app/ReadClient.cpp ${chip_dir}/src/app/ReadHandler.cpp + ${chip_dir}/src/app/TimedHandler.cpp ${chip_dir}/src/app/WriteClient.cpp ${chip_dir}/src/app/WriteHandler.cpp ${chip_dir}/src/app/util/CHIPDeviceCallbacksMgr.cpp diff --git a/examples/all-clusters-app/p6/include/CHIPProjectConfig.h b/examples/all-clusters-app/p6/include/CHIPProjectConfig.h index 94c068c5d18f44..7a6ada1013b678 100644 --- a/examples/all-clusters-app/p6/include/CHIPProjectConfig.h +++ b/examples/all-clusters-app/p6/include/CHIPProjectConfig.h @@ -90,13 +90,6 @@ */ #define CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER "TEST_SN" -/** - * CHIP_CONFIG_EVENT_LOGGING_UTC_TIMESTAMPS - * - * Enable recording UTC timestamps. - */ -#define CHIP_CONFIG_EVENT_LOGGING_UTC_TIMESTAMPS 1 - /** * CHIP_DEVICE_CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE * diff --git a/examples/bridge-app/bridge-common/bridge-app.zap b/examples/bridge-app/bridge-common/bridge-app.zap index 6df6cdad810c09..525f68c7bc1d31 100644 --- a/examples/bridge-app/bridge-common/bridge-app.zap +++ b/examples/bridge-app/bridge-common/bridge-app.zap @@ -505,6 +505,36 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "RegulatoryConfig", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LocationCapability", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "FeatureMap", "code": 65532, @@ -2015,6 +2045,21 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "15", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, diff --git a/examples/bridge-app/bridge-common/include/CHIPProjectAppConfig.h b/examples/bridge-app/bridge-common/include/CHIPProjectAppConfig.h new file mode 100644 index 00000000000000..036cbda81ad736 --- /dev/null +++ b/examples/bridge-app/bridge-common/include/CHIPProjectAppConfig.h @@ -0,0 +1,34 @@ +/* + * + * Copyright (c) 2020 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. + */ + +/** + * @file + * Example project configuration file for CHIP. + * + * This is a place to put application or project-specific overrides + * to the default configuration values for general CHIP features. + * + */ + +#pragma once + +// overrides CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT in CHIPProjectConfig +#define CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT 16 + +// include the CHIPProjectConfig from config/standalone +#include diff --git a/examples/bridge-app/esp32/CMakeLists.txt b/examples/bridge-app/esp32/CMakeLists.txt index 0a0bc8b1131b65..dd174e3e7ec1c8 100644 --- a/examples/bridge-app/esp32/CMakeLists.txt +++ b/examples/bridge-app/esp32/CMakeLists.txt @@ -23,9 +23,9 @@ set(EXTRA_COMPONENT_DIRS "${CMAKE_CURRENT_LIST_DIR}/../../common/QRCode" ) +# TODO: add CHIPProjectAppConfig.h to esp32 project(chip-bridge-app) -idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++14;-Os;-DLWIP_IPV6_SCOPES=0;-DCHIP_HAVE_CONFIG_H;-DDYNAMIC_ENDPOINT_COUNT=16" APPEND) +idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++14;-Os;-DLWIP_IPV6_SCOPES=0;-DCHIP_HAVE_CONFIG_H;-DCHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT=16" APPEND) idf_build_set_property(C_COMPILE_OPTIONS "-Os;-DLWIP_IPV6_SCOPES=0" APPEND) flashing_script() - diff --git a/examples/bridge-app/esp32/main/main.cpp b/examples/bridge-app/esp32/main/main.cpp index cf5b5fe88ba5f8..411ff15c5bec8d 100644 --- a/examples/bridge-app/esp32/main/main.cpp +++ b/examples/bridge-app/esp32/main/main.cpp @@ -50,7 +50,7 @@ static const int kFixedLabelAttributeArraySize = 254; static EndpointId gCurrentEndpointId; static EndpointId gFirstDynamicEndpointId; -static Device * gDevices[DYNAMIC_ENDPOINT_COUNT]; // number of dynamic endpoints count +static Device * gDevices[CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT]; // number of dynamic endpoints count // 4 Bridged devices static Device gLight1("Light 1", "Office"); @@ -116,7 +116,7 @@ DECLARE_DYNAMIC_ENDPOINT(bridgedLightEndpoint, bridgedLightClusters); CHIP_ERROR AddDeviceEndpoint(Device * dev, EmberAfEndpointType * ep, uint16_t deviceType) { uint8_t index = 0; - while (index < DYNAMIC_ENDPOINT_COUNT) + while (index < CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT) { if (NULL == gDevices[index]) { @@ -144,7 +144,7 @@ CHIP_ERROR AddDeviceEndpoint(Device * dev, EmberAfEndpointType * ep, uint16_t de CHIP_ERROR RemoveDeviceEndpoint(Device * dev) { - for (uint8_t index = 0; index < DYNAMIC_ENDPOINT_COUNT; index++) + for (uint8_t index = 0; index < CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT; index++) { if (gDevices[index] == dev) { @@ -264,7 +264,7 @@ EmberAfStatus emberAfExternalAttributeReadCallback(EndpointId endpoint, ClusterI { uint16_t endpointIndex = emberAfGetDynamicIndexFromEndpoint(endpoint); - if ((endpointIndex < DYNAMIC_ENDPOINT_COUNT) && (gDevices[endpointIndex] != NULL)) + if ((endpointIndex < CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT) && (gDevices[endpointIndex] != NULL)) { Device * dev = gDevices[endpointIndex]; @@ -291,7 +291,7 @@ EmberAfStatus emberAfExternalAttributeWriteCallback(EndpointId endpoint, Cluster { uint16_t endpointIndex = emberAfGetDynamicIndexFromEndpoint(endpoint); - if (endpointIndex < DYNAMIC_ENDPOINT_COUNT) + if (endpointIndex < CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT) { Device * dev = gDevices[endpointIndex]; diff --git a/examples/bridge-app/linux/BUILD.gn b/examples/bridge-app/linux/BUILD.gn index 572142d2357782..0f27218e003c55 100644 --- a/examples/bridge-app/linux/BUILD.gn +++ b/examples/bridge-app/linux/BUILD.gn @@ -20,6 +20,7 @@ assert(chip_build_tools) executable("chip-bridge-app") { sources = [ + "${chip_root}/examples/tv-app/tv-common/include/CHIPProjectAppConfig.h", "Device.cpp", "Options.cpp", "include/Device.h", @@ -33,9 +34,6 @@ executable("chip-bridge-app") { cflags = [ "-Wconversion" ] - # TODO: the definition of DYNAMIC_ENDPOINT_COUNT needs find a common home! - cflags += [ "-DDYNAMIC_ENDPOINT_COUNT=16" ] - include_dirs = [ "include" ] output_dir = root_out_dir diff --git a/examples/bridge-app/linux/args.gni b/examples/bridge-app/linux/args.gni index a6463ca2c05fae..7039d20e181994 100644 --- a/examples/bridge-app/linux/args.gni +++ b/examples/bridge-app/linux/args.gni @@ -15,3 +15,11 @@ import("//build_overrides/chip.gni") import("${chip_root}/config/standalone/args.gni") + +chip_device_project_config_include = "" +chip_project_config_include = "" +chip_system_project_config_include = "" + +chip_project_config_include_dirs = + [ "${chip_root}/examples/bridge-app/bridge-common/include" ] +chip_project_config_include_dirs += [ "${chip_root}/config/standalone" ] diff --git a/examples/bridge-app/linux/main.cpp b/examples/bridge-app/linux/main.cpp index 16b2a54da783d7..3d7deecc5649d1 100644 --- a/examples/bridge-app/linux/main.cpp +++ b/examples/bridge-app/linux/main.cpp @@ -59,7 +59,7 @@ static const int kFixedLabelElementsOctetStringSize = 16; static EndpointId gCurrentEndpointId; static EndpointId gFirstDynamicEndpointId; -static Device * gDevices[DYNAMIC_ENDPOINT_COUNT]; +static Device * gDevices[CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT]; // ENDPOINT DEFINITIONS: // ================================================================================= @@ -184,7 +184,7 @@ DECLARE_DYNAMIC_ENDPOINT(bridgedSwitchEndpoint, bridgedSwitchClusters); int AddDeviceEndpoint(Device * dev, EmberAfEndpointType * ep, uint16_t deviceType) { uint8_t index = 0; - while (index < DYNAMIC_ENDPOINT_COUNT) + while (index < CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT) { if (NULL == gDevices[index]) { @@ -219,7 +219,7 @@ int AddDeviceEndpoint(Device * dev, EmberAfEndpointType * ep, uint16_t deviceTyp int RemoveDeviceEndpoint(Device * dev) { uint8_t index = 0; - while (index < DYNAMIC_ENDPOINT_COUNT) + while (index < CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT) { if (gDevices[index] == dev) { @@ -460,7 +460,7 @@ EmberAfStatus emberAfExternalAttributeReadCallback(EndpointId endpoint, ClusterI EmberAfStatus ret = EMBER_ZCL_STATUS_FAILURE; - if ((endpointIndex < DYNAMIC_ENDPOINT_COUNT) && (gDevices[endpointIndex] != NULL)) + if ((endpointIndex < CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT) && (gDevices[endpointIndex] != NULL)) { Device * dev = gDevices[endpointIndex]; @@ -496,7 +496,7 @@ EmberAfStatus emberAfExternalAttributeWriteCallback(EndpointId endpoint, Cluster // ChipLogProgress(DeviceLayer, "emberAfExternalAttributeWriteCallback: ep=%d", endpoint); - if (endpointIndex < DYNAMIC_ENDPOINT_COUNT) + if (endpointIndex < CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT) { Device * dev = gDevices[endpointIndex]; diff --git a/examples/chip-tool/commands/clusters/ModelCommand.h b/examples/chip-tool/commands/clusters/ModelCommand.h index 5e6a44eee20c9f..b03361433e0996 100644 --- a/examples/chip-tool/commands/clusters/ModelCommand.h +++ b/examples/chip-tool/commands/clusters/ModelCommand.h @@ -37,6 +37,7 @@ class ModelCommand : public CHIPCommand { AddArgument("node-id", 0, UINT64_MAX, &mNodeId); AddArgument("endpoint-id", CHIP_ZCL_ENDPOINT_MIN, CHIP_ZCL_ENDPOINT_MAX, &mEndPointId); + AddArgument("timedInteractionTimeoutMs", 0, UINT16_MAX, &mTimedInteractionTimeoutMs); } /////////// CHIPCommand Interface ///////// @@ -45,6 +46,9 @@ class ModelCommand : public CHIPCommand virtual CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endPointId) = 0; +protected: + chip::Optional mTimedInteractionTimeoutMs; + private: chip::NodeId mNodeId; uint8_t mEndPointId; diff --git a/examples/chip-tool/commands/common/CHIPCommand.cpp b/examples/chip-tool/commands/common/CHIPCommand.cpp index f45a88bcaec6a8..b8568da129a48e 100644 --- a/examples/chip-tool/commands/common/CHIPCommand.cpp +++ b/examples/chip-tool/commands/common/CHIPCommand.cpp @@ -29,13 +29,9 @@ using DeviceControllerFactory = chip::Controller::DeviceControllerFactory; -constexpr const char kCommissionerAlpha[] = "alpha"; -constexpr const char kCommissionerBeta[] = "beta"; -constexpr const char kCommissionerGamma[] = "gamma"; - -constexpr chip::FabricId kCommissionerAlphaFabricId = 1; -constexpr chip::FabricId kCommissionerBetaFabricId = 2; -constexpr chip::FabricId kCommissionerGammaFabricId = 3; +constexpr chip::FabricId kIdentityAlphaFabricId = 1; +constexpr chip::FabricId kIdentityBetaFabricId = 2; +constexpr chip::FabricId kIdentityGammaFabricId = 3; CHIP_ERROR CHIPCommand::Run() { @@ -52,7 +48,7 @@ CHIP_ERROR CHIPCommand::Run() factoryInitParams.listenPort = static_cast(mDefaultStorage.GetListenPort() + CurrentCommissionerIndex()); ReturnLogErrorOnFailure(DeviceControllerFactory::GetInstance().Init(factoryInitParams)); - ReturnLogErrorOnFailure(InitializeCommissioner(CurrentCommissionerName(), CurrentCommissionerIndex())); + ReturnLogErrorOnFailure(InitializeCommissioner(GetIdentity(), CurrentCommissionerIndex())); chip::DeviceLayer::PlatformMgr().ScheduleWork(RunQueuedCommand, reinterpret_cast(this)); ReturnLogErrorOnFailure(StartWaiting(GetWaitDuration())); @@ -64,18 +60,31 @@ CHIP_ERROR CHIPCommand::Run() // since the CHIP thread and event queue have been stopped, preventing any thread // races. // - ReturnLogErrorOnFailure(ShutdownCommissioner(CurrentCommissionerName())); + ReturnLogErrorOnFailure(ShutdownCommissioner(GetIdentity())); return CHIP_NO_ERROR; } -std::string CHIPCommand::CurrentCommissionerName() +void CHIPCommand::SetIdentity(const char * identity) +{ + std::string name = std::string(identity); + if (name.compare(kIdentityAlpha) != 0 && name.compare(kIdentityBeta) != 0 && name.compare(kIdentityGamma) != 0) + { + ChipLogError(chipTool, "Unknown commissioner name: %s. Supported names are [%s, %s, %s]", name.c_str(), kIdentityAlpha, + kIdentityBeta, kIdentityGamma); + chipDie(); + } + + mCommissionerName.SetValue(const_cast(identity)); +} + +std::string CHIPCommand::GetIdentity() { - std::string name = mCommissionerName.HasValue() ? mCommissionerName.Value() : kCommissionerAlpha; - if (name.compare(kCommissionerAlpha) != 0 && name.compare(kCommissionerBeta) != 0 && name.compare(kCommissionerGamma) != 0) + std::string name = mCommissionerName.HasValue() ? mCommissionerName.Value() : kIdentityAlpha; + if (name.compare(kIdentityAlpha) != 0 && name.compare(kIdentityBeta) != 0 && name.compare(kIdentityGamma) != 0) { - ChipLogError(chipTool, "Unknown commissioner name: %s. Supported names are [%s, %s, %s]", name.c_str(), kCommissionerAlpha, - kCommissionerBeta, kCommissionerGamma); + ChipLogError(chipTool, "Unknown commissioner name: %s. Supported names are [%s, %s, %s]", name.c_str(), kIdentityAlpha, + kIdentityBeta, kIdentityGamma); chipDie(); } @@ -86,28 +95,28 @@ uint16_t CHIPCommand::CurrentCommissionerIndex() { uint16_t index = 0; - std::string name = CurrentCommissionerName(); - if (name.compare(kCommissionerAlpha) == 0) + std::string name = GetIdentity(); + if (name.compare(kIdentityAlpha) == 0) { - index = kCommissionerAlphaFabricId; + index = kIdentityAlphaFabricId; } - else if (name.compare(kCommissionerBeta) == 0) + else if (name.compare(kIdentityBeta) == 0) { - index = kCommissionerBetaFabricId; + index = kIdentityBetaFabricId; } - else if (name.compare(kCommissionerGamma) == 0) + else if (name.compare(kIdentityGamma) == 0) { - index = kCommissionerGammaFabricId; + index = kIdentityGammaFabricId; } VerifyOrDieWithMsg(index != 0, chipTool, "Unknown commissioner name: %s. Supported names are [%s, %s, %s]", name.c_str(), - kCommissionerAlpha, kCommissionerBeta, kCommissionerGamma); + kIdentityAlpha, kIdentityBeta, kIdentityGamma); return index; } chip::Controller::DeviceCommissioner & CHIPCommand::CurrentCommissioner() { - auto item = mCommissioners.find(CurrentCommissionerName()); + auto item = mCommissioners.find(GetIdentity()); return *item->second.get(); } diff --git a/examples/chip-tool/commands/common/CHIPCommand.h b/examples/chip-tool/commands/common/CHIPCommand.h index c28bf9b7e5e261..f1aeadbbffea81 100644 --- a/examples/chip-tool/commands/common/CHIPCommand.h +++ b/examples/chip-tool/commands/common/CHIPCommand.h @@ -27,6 +27,10 @@ class PersistentStorage; +constexpr const char kIdentityAlpha[] = "alpha"; +constexpr const char kIdentityBeta[] = "beta"; +constexpr const char kIdentityGamma[] = "gamma"; + class CHIPCommand : public Command { public: @@ -69,6 +73,9 @@ class CHIPCommand : public Command chip::SimpleFabricStorage mFabricStorage; chip::Controller::ExampleOperationalCredentialsIssuer mOpCredsIssuer; + std::string GetIdentity(); + void SetIdentity(const char * name); + // This method returns the commissioner instance to be used for running the command. // The default commissioner instance name is "alpha", but it can be overriden by passing // --identity "instance name" when running a command. @@ -77,7 +84,6 @@ class CHIPCommand : public Command private: CHIP_ERROR InitializeCommissioner(std::string key, chip::FabricId fabricId); CHIP_ERROR ShutdownCommissioner(std::string key); - std::string CurrentCommissionerName(); uint16_t CurrentCommissionerIndex(); std::map> mCommissioners; chip::Optional mCommissionerName; diff --git a/examples/chip-tool/commands/common/Command.cpp b/examples/chip-tool/commands/common/Command.cpp index 6969e3962c33a9..00658fc9cf9168 100644 --- a/examples/chip-tool/commands/common/Command.cpp +++ b/examples/chip-tool/commands/common/Command.cpp @@ -357,6 +357,28 @@ bool Command::InitArgument(size_t argIndex, char * argValue) break; } + case ArgumentType::Float: { + if (arg.optional) + arg.value = &(static_cast *>(arg.value))->Emplace(); + float * value = static_cast(arg.value); + std::stringstream ss; + ss << argValue; + ss >> *value; + isValidArgument = (!ss.fail() && ss.eof()); + break; + } + + case ArgumentType::Double: { + if (arg.optional) + arg.value = &(static_cast *>(arg.value))->Emplace(); + double * value = static_cast(arg.value); + std::stringstream ss; + ss << argValue; + ss >> *value; + isValidArgument = (!ss.fail() && ss.eof()); + break; + } + case ArgumentType::Address: { if (arg.optional) arg.value = &(reinterpret_cast *>(arg.value))->Emplace(); @@ -429,6 +451,30 @@ size_t Command::AddArgument(const char * name, AddressWithInterface * out, bool return AddArgumentToList(std::move(arg)); } +size_t Command::AddArgument(const char * name, float min, float max, float * out, bool optional) +{ + Argument arg; + arg.type = ArgumentType::Float; + arg.name = name; + arg.value = reinterpret_cast(out); + arg.optional = optional; + // Ignore min/max for now; they're always +-Infinity anyway. + + return AddArgumentToList(std::move(arg)); +} + +size_t Command::AddArgument(const char * name, double min, double max, double * out, bool optional) +{ + Argument arg; + arg.type = ArgumentType::Double; + arg.name = name; + arg.value = reinterpret_cast(out); + arg.optional = optional; + // Ignore min/max for now; they're always +-Infinity anyway. + + return AddArgumentToList(std::move(arg)); +} + size_t Command::AddArgument(const char * name, int64_t min, uint64_t max, void * out, ArgumentType type, bool optional) { Argument arg; diff --git a/examples/chip-tool/commands/common/Command.h b/examples/chip-tool/commands/common/Command.h index 1857db7f737f45..806e205936b22f 100644 --- a/examples/chip-tool/commands/common/Command.h +++ b/examples/chip-tool/commands/common/Command.h @@ -62,6 +62,8 @@ enum ArgumentType Number_int16, Number_int32, Number_int64, + Float, + Double, Boolean, String, CharString, @@ -152,6 +154,9 @@ class Command return AddArgument(name, min, max, reinterpret_cast(out), Number_uint64, optional); } + size_t AddArgument(const char * name, float min, float max, float * out, bool optional = false); + size_t AddArgument(const char * name, double min, double max, double * out, bool optional = false); + template ::value>> size_t AddArgument(const char * name, int64_t min, uint64_t max, T * out, bool optional = false) { diff --git a/examples/chip-tool/commands/common/CommandInvoker.h b/examples/chip-tool/commands/common/CommandInvoker.h index 30613dfc54710f..6583cc9124280e 100644 --- a/examples/chip-tool/commands/common/CommandInvoker.h +++ b/examples/chip-tool/commands/common/CommandInvoker.h @@ -23,6 +23,7 @@ #include #include #include +#include namespace chip { namespace Controller { @@ -84,18 +85,52 @@ class CommandInvoker final : public ResponseReceiver(aContext, aOnSuccess, aOnError); } - CHIP_ERROR InvokeCommand(DeviceProxy * aDevice, EndpointId aEndpoint, const RequestType & aRequestData) + CHIP_ERROR InvokeCommand(DeviceProxy * aDevice, EndpointId aEndpoint, const RequestType & aRequestData, + const Optional & aTimedInvokeTimeoutMs) { - app::CommandPathParams commandPath = { aEndpoint, 0, RequestType::GetClusterId(), RequestType::GetCommandId(), + app::CommandPathParams commandPath = { aEndpoint, 0 /* groupId */, RequestType::GetClusterId(), RequestType::GetCommandId(), (app::CommandPathFlags::kEndpointIdValid) }; - auto commandSender = Platform::MakeUnique(this, aDevice->GetExchangeManager()); + auto commandSender = + Platform::MakeUnique(this, aDevice->GetExchangeManager(), aTimedInvokeTimeoutMs.HasValue()); VerifyOrReturnError(commandSender != nullptr, CHIP_ERROR_NO_MEMORY); - ReturnErrorOnFailure(commandSender->AddRequestData(commandPath, aRequestData)); + ReturnErrorOnFailure(commandSender->AddRequestDataNoTimedCheck(commandPath, aRequestData, aTimedInvokeTimeoutMs)); ReturnErrorOnFailure(commandSender->SendCommandRequest(aDevice->GetSecureSession().Value())); commandSender.release(); return CHIP_NO_ERROR; } + + CHIP_ERROR InvokeGroupCommand(DeviceProxy * aDevice, GroupId groupId, const RequestType & aRequestData) + { + app::CommandPathParams commandPath = { 0 /* endpoint */, groupId, RequestType::GetClusterId(), RequestType::GetCommandId(), + (app::CommandPathFlags::kGroupIdValid) }; + + auto commandSender = Platform::MakeUnique(this, aDevice->GetExchangeManager()); + VerifyOrReturnError(commandSender != nullptr, CHIP_ERROR_NO_MEMORY); + + ReturnErrorOnFailure(commandSender->AddRequestData(commandPath, aRequestData)); + + if (aDevice->GetSecureSession().HasValue()) + { + SessionHandle session = aDevice->GetSecureSession().Value(); + session.SetGroupId(groupId); + + if (!session.IsGroupSession()) + { + return CHIP_ERROR_INCORRECT_STATE; + } + + ReturnErrorOnFailure(commandSender->SendCommandRequest(session)); + } + else + { + // something fishy is going on + return CHIP_ERROR_INCORRECT_STATE; + } + + commandSender.release(); + return CHIP_NO_ERROR; + } }; template @@ -150,14 +185,47 @@ inline void ResponseReceiver::OnResponse(app::Co } // namespace detail template +CHIP_ERROR InvokeCommand(DeviceProxy * aDevice, void * aContext, + typename detail::CommandInvoker::SuccessCallback aSuccessCallback, + typename detail::CommandInvoker::FailureCallback aFailureCallback, EndpointId aEndpoint, + const RequestType & aRequestData, const Optional & aTimedInvokeTimeoutMs) +{ + auto invoker = detail::CommandInvoker::Alloc(aContext, aSuccessCallback, aFailureCallback); + VerifyOrReturnError(invoker != nullptr, CHIP_ERROR_NO_MEMORY); + ReturnErrorOnFailure(invoker->InvokeCommand(aDevice, aEndpoint, aRequestData, aTimedInvokeTimeoutMs)); + invoker.release(); + return CHIP_NO_ERROR; +} + +template +CHIP_ERROR InvokeCommand(DeviceProxy * aDevice, void * aContext, + typename detail::CommandInvoker::SuccessCallback aSuccessCallback, + typename detail::CommandInvoker::FailureCallback aFailureCallback, EndpointId aEndpoint, + const RequestType & aRequestData, uint16_t aTimedInvokeTimeoutMs) +{ + return InvokeCommand(aDevice, aContext, aSuccessCallback, aFailureCallback, aEndpoint, aRequestData, + MakeOptional(aTimedInvokeTimeoutMs)); +} + +template = 0> CHIP_ERROR InvokeCommand(DeviceProxy * aDevice, void * aContext, typename detail::CommandInvoker::SuccessCallback aSuccessCallback, typename detail::CommandInvoker::FailureCallback aFailureCallback, EndpointId aEndpoint, const RequestType & aRequestData) +{ + return InvokeCommand(aDevice, aContext, aSuccessCallback, aFailureCallback, aEndpoint, aRequestData, NullOptional); +} + +// Group commands can't do timed invoke in a meaningful way. +template = 0> +CHIP_ERROR InvokeGroupCommand(DeviceProxy * aDevice, void * aContext, + typename detail::CommandInvoker::SuccessCallback aSuccessCallback, + typename detail::CommandInvoker::FailureCallback aFailureCallback, GroupId groupId, + const RequestType & aRequestData) { auto invoker = detail::CommandInvoker::Alloc(aContext, aSuccessCallback, aFailureCallback); VerifyOrReturnError(invoker != nullptr, CHIP_ERROR_NO_MEMORY); - ReturnErrorOnFailure(invoker->InvokeCommand(aDevice, aEndpoint, aRequestData)); + ReturnErrorOnFailure(invoker->InvokeGroupCommand(aDevice, groupId, aRequestData)); invoker.release(); return CHIP_NO_ERROR; } diff --git a/examples/chip-tool/commands/discover/Commands.h b/examples/chip-tool/commands/discover/Commands.h index c68ae26615b4ee..cbcdf2e27bd938 100644 --- a/examples/chip-tool/commands/discover/Commands.h +++ b/examples/chip-tool/commands/discover/Commands.h @@ -55,12 +55,12 @@ class Resolve : public DiscoverCommand, public chip::Dnssd::ResolverDelegate auto retryInterval = nodeData.GetMrpRetryIntervalIdle(); if (retryInterval.HasValue()) - ChipLogProgress(chipTool, " MRP retry interval (idle): %" PRIu32 "ms", retryInterval.Value()); + ChipLogProgress(chipTool, " MRP retry interval (idle): %" PRIu32 "ms", retryInterval.Value().count()); retryInterval = nodeData.GetMrpRetryIntervalActive(); if (retryInterval.HasValue()) - ChipLogProgress(chipTool, " MRP retry interval (active): %" PRIu32 "ms", retryInterval.Value()); + ChipLogProgress(chipTool, " MRP retry interval (active): %" PRIu32 "ms", retryInterval.Value().count()); ChipLogProgress(chipTool, " Supports TCP: %s", nodeData.mSupportsTcp ? "yes" : "no"); SetCommandExitStatus(CHIP_NO_ERROR); diff --git a/examples/chip-tool/commands/discover/DiscoverCommissionablesCommand.cpp b/examples/chip-tool/commands/discover/DiscoverCommissionablesCommand.cpp index 88f41cc2b8125f..fd116833696027 100644 --- a/examples/chip-tool/commands/discover/DiscoverCommissionablesCommand.cpp +++ b/examples/chip-tool/commands/discover/DiscoverCommissionablesCommand.cpp @@ -30,27 +30,5 @@ CHIP_ERROR DiscoverCommissionablesCommand::RunCommand() void DiscoverCommissionablesCommand::OnDiscoveredDevice(const chip::Dnssd::DiscoveredNodeData & nodeData) { - char rotatingId[chip::Dnssd::kMaxRotatingIdLen * 2 + 1] = ""; - Encoding::BytesToUppercaseHexString(nodeData.rotatingId, nodeData.rotatingIdLen, rotatingId, sizeof(rotatingId)); - - ChipLogProgress(Discovery, "Discovered Node: "); - ChipLogProgress(Discovery, "\tInstance name:\t\t%s", nodeData.instanceName); - ChipLogProgress(Discovery, "\tHost name:\t\t%s", nodeData.hostName); - ChipLogProgress(Discovery, "\tPort:\t\t\t%u", nodeData.port); - ChipLogProgress(Discovery, "\tLong discriminator:\t%u", nodeData.longDiscriminator); - ChipLogProgress(Discovery, "\tVendor ID:\t\t%u", nodeData.vendorId); - ChipLogProgress(Discovery, "\tProduct ID:\t\t%u", nodeData.productId); - ChipLogProgress(Discovery, "\tCommissioning Mode:\t%u", nodeData.commissioningMode); - ChipLogProgress(Discovery, "\tDevice Type:\t\t%u", nodeData.deviceType); - ChipLogProgress(Discovery, "\tDevice Name:\t\t%s", nodeData.deviceName); - ChipLogProgress(Discovery, "\tRotating Id:\t\t%s", rotatingId); - ChipLogProgress(Discovery, "\tPairing Instruction:\t%s", nodeData.pairingInstruction); - ChipLogProgress(Discovery, "\tPairing Hint:\t\t%u", nodeData.pairingHint); - for (int i = 0; i < nodeData.numIPs; i++) - { - char buf[chip::Inet::IPAddress::kMaxStringLength]; - nodeData.ipAddress[i].ToString(buf); - - ChipLogProgress(Discovery, "\tAddress %d:\t\t%s", i, buf); - } + nodeData.LogDetail(); } diff --git a/examples/chip-tool/commands/pairing/OpenCommissioningWindowCommand.cpp b/examples/chip-tool/commands/pairing/OpenCommissioningWindowCommand.cpp index 8c8576d9e30311..030a5858067bd9 100644 --- a/examples/chip-tool/commands/pairing/OpenCommissioningWindowCommand.cpp +++ b/examples/chip-tool/commands/pairing/OpenCommissioningWindowCommand.cpp @@ -53,5 +53,6 @@ void OpenCommissioningWindowCommand::OnOpenCommissioningWindowResponse(void * co CHIP_ERROR OpenCommissioningWindowCommand::OpenCommissioningWindow() { return CurrentCommissioner().OpenCommissioningWindowWithCallback( - mNodeId, mTimeout, mIteration, mDiscriminator, mCommissioningWindowOption, &mOnOpenCommissioningWindowCallback); + mNodeId, mTimeout, mIteration, mDiscriminator, mCommissioningWindowOption, &mOnOpenCommissioningWindowCallback, + /* readVIDPIDAttributes */ true); } diff --git a/examples/chip-tool/commands/tests/TestCommand.cpp b/examples/chip-tool/commands/tests/TestCommand.cpp index be7dc5d6d312ad..4e9f01af3cdf5c 100644 --- a/examples/chip-tool/commands/tests/TestCommand.cpp +++ b/examples/chip-tool/commands/tests/TestCommand.cpp @@ -19,6 +19,18 @@ #include "TestCommand.h" CHIP_ERROR TestCommand::RunCommand() +{ + if (mPICSFilePath.HasValue()) + { + PICS.SetValue(PICSBooleanReader::Read(mPICSFilePath.Value())); + } + + NextTest(); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR TestCommand::WaitForCommissionee() { return CurrentCommissioner().GetConnectedDevice(mNodeId, &mOnDeviceConnectedCallback, &mOnDeviceConnectionFailureCallback); } @@ -28,12 +40,8 @@ void TestCommand::OnDeviceConnectedFn(void * context, chip::OperationalDevicePro ChipLogProgress(chipTool, " **** Test Setup: Device Connected\n"); auto * command = static_cast(context); VerifyOrReturn(command != nullptr, ChipLogError(chipTool, "Device connected, but cannot run the test, as the context is null")); - command->mDevice = device; + command->mDevices[command->GetIdentity()] = device; - if (command->mPICSFilePath.HasValue()) - { - command->PICS.SetValue(PICSBooleanReader::Read(command->mPICSFilePath.Value())); - } command->NextTest(); } @@ -60,7 +68,14 @@ CHIP_ERROR TestCommand::Wait(chip::System::Clock::Timeout duration) CHIP_ERROR TestCommand::Log(const char * message) { ChipLogDetail(chipTool, "%s", message); - WaitForMs(0); + ReturnErrorOnFailure(ContinueOnChipMainThread()); + return CHIP_NO_ERROR; +} + +CHIP_ERROR TestCommand::UserPrompt(const char * message) +{ + ChipLogDetail(chipTool, "USER_PROMPT: %s", message); + ReturnErrorOnFailure(ContinueOnChipMainThread()); return CHIP_NO_ERROR; } @@ -175,7 +190,7 @@ bool TestCommand::ShouldSkip(const char * expression) if (shouldSkip) { ChipLogProgress(chipTool, " **** Skipping: %s == false\n", expression); - WaitForMs(0); + ContinueOnChipMainThread(); } return shouldSkip; } diff --git a/examples/chip-tool/commands/tests/TestCommand.h b/examples/chip-tool/commands/tests/TestCommand.h index 80f1ce9297c107..c314699e0e7a59 100644 --- a/examples/chip-tool/commands/tests/TestCommand.h +++ b/examples/chip-tool/commands/tests/TestCommand.h @@ -59,16 +59,18 @@ class TestCommand : public CHIPCommand CHIP_ERROR WaitForMs(uint16_t ms) { return Wait(chip::System::Clock::Milliseconds32(ms)); } CHIP_ERROR WaitForCommissionee(); CHIP_ERROR Log(const char * message); - CHIP_ERROR Prompt(const char * message); + CHIP_ERROR UserPrompt(const char * message); protected: - ChipDevice * mDevice; + std::map mDevices; chip::NodeId mNodeId; static void OnDeviceConnectedFn(void * context, chip::OperationalDeviceProxy * device); static void OnDeviceConnectionFailureFn(void * context, NodeId deviceId, CHIP_ERROR error); static void OnWaitForMsFn(chip::System::Layer * systemLayer, void * context); + CHIP_ERROR ContinueOnChipMainThread() { return WaitForMs(0); }; + void Exit(std::string message); void ThrowFailureResponse(); void ThrowSuccessResponse(); diff --git a/examples/chip-tool/include/CHIPProjectAppConfig.h b/examples/chip-tool/include/CHIPProjectAppConfig.h index 0d5aee9f4135cf..81010d4cacffad 100644 --- a/examples/chip-tool/include/CHIPProjectAppConfig.h +++ b/examples/chip-tool/include/CHIPProjectAppConfig.h @@ -25,8 +25,6 @@ #define CHIP_CONFIG_ENABLE_EPHEMERAL_UDP_PORT 1 -#define CHIP_CONFIG_EVENT_LOGGING_UTC_TIMESTAMPS 1 - #define CHIP_CONFIG_EVENT_LOGGING_NUM_EXTERNAL_CALLBACKS 2 #define CHIP_CONFIG_EVENT_LOGGING_EXTERNAL_EVENT_SUPPORT 1 @@ -72,4 +70,7 @@ #define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY 1 +// Enable some test-only interaction model APIs. +#define CONFIG_IM_BUILD_FOR_UNIT_TEST 1 + #endif /* CHIPPROJECTCONFIG_H */ diff --git a/examples/chip-tool/templates/commands.zapt b/examples/chip-tool/templates/commands.zapt index 7eed05a3f98edd..70c2a81b73eab6 100644 --- a/examples/chip-tool/templates/commands.zapt +++ b/examples/chip-tool/templates/commands.zapt @@ -309,6 +309,32 @@ static void OnInt64sAttributeResponse(void * context, int64_t value) command->SetCommandExitStatus(CHIP_NO_ERROR); } +static void OnFloatAttributeReport(void * context, float value) +{ + ChipLogProgress(chipTool, "Float attribute Response: %f", value); +} + +static void OnFloatAttributeResponse(void * context, float value) +{ + OnFloatAttributeReport(context, value); + + ModelCommand * command = static_cast(context); + command->SetCommandExitStatus(CHIP_NO_ERROR); +} + +static void OnDoubleAttributeReport(void * context, double value) +{ + ChipLogProgress(chipTool, "Double attribute Response: %f", value); +} + +static void OnDoubleAttributeResponse(void * context, double value) +{ + OnDoubleAttributeReport(context, value); + + ModelCommand * command = static_cast(context); + command->SetCommandExitStatus(CHIP_NO_ERROR); +} + static void OnOctetStringAttributeReport(void * context, const chip::ByteSpan value) { char buffer[CHIP_CONFIG_LOG_MESSAGE_MAX_SIZE]; @@ -419,7 +445,7 @@ public: {{/if}} {{/chip_cluster_command_non_expanded_arguments}} - return chip::Controller::InvokeCommand(device, this, {{#if hasSpecificResponse}}On{{asUpperCamelCase parent.name}}{{asUpperCamelCase response.name}}Success{{else}}OnDefaultSuccess{{/if}}, OnDefaultFailure, endpointId, mRequest); + return chip::Controller::InvokeCommand(device, this, {{#if hasSpecificResponse}}On{{asUpperCamelCase parent.name}}{{asUpperCamelCase response.name}}Success{{else}}OnDefaultSuccess{{/if}}, OnDefaultFailure, endpointId, mRequest, mTimedInteractionTimeoutMs); } private: @@ -429,6 +455,8 @@ private: {{/chip_cluster_commands}} {{#chip_server_cluster_attributes}} +{{! TODO: Various types (floats, structs) not supported here. }} +{{#unless (isStrEqual chipCallback.name "Unsupported")}} /* * Attribute {{asUpperCamelCase name}} */ @@ -475,7 +503,11 @@ public: Write{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}(): ModelCommand("write") { AddArgument("attr-name", "{{asDelimitedCommand (asUpperCamelCase name)}}"); - {{#if (isString type)}} + {{#if isArray}} + // {{label}} Array parsing is not supported yet + {{else if isStruct}} + // {{label}} Struct parsing is not supported yet + {{else if (isString type)}} AddArgument("attr-value", &mValue); {{else}} AddArgument("attr-value", {{asTypeMinValue type}}, {{asTypeMaxValue type}}, &mValue); @@ -558,6 +590,7 @@ private: {{/unless}} {{/if}} +{{/unless}} {{/chip_server_cluster_attributes}} {{/chip_client_clusters}} @@ -574,6 +607,8 @@ void registerCluster{{asUpperCamelCase name}}(Commands & commands) make_unique<{{asUpperCamelCase clusterName}}{{asUpperCamelCase name}}>(), // {{/chip_cluster_commands}} {{#chip_server_cluster_attributes}} + {{! TODO: Various types (floats, structs) not supported here. }} + {{#unless (isStrEqual chipCallback.name "Unsupported")}} make_unique(), // {{#if isWritableAttribute}} {{! No list support for writing yet. Need to figure out how to @@ -587,6 +622,7 @@ void registerCluster{{asUpperCamelCase name}}(Commands & commands) make_unique(), // {{/unless}} {{/if}} + {{/unless}} {{/chip_server_cluster_attributes}} }; diff --git a/examples/chip-tool/templates/helper.js b/examples/chip-tool/templates/helper.js index 7810306e7f80a6..dc95273dc2a06e 100644 --- a/examples/chip-tool/templates/helper.js +++ b/examples/chip-tool/templates/helper.js @@ -48,6 +48,9 @@ function asTypeMinValue(type) case 'uint32_t': case 'uint64_t': return '0'; + case 'float': + case 'double': + return `-std::numeric_limits<${basicType}>::infinity()`; default: error = 'asTypeMinValue: Unhandled underlying type ' + zclType + ' for original type ' + type; throw error; @@ -82,6 +85,9 @@ function asTypeMaxValue(type) case 'uint32_t': case 'uint64_t': return 'UINT' + parseInt(basicType.slice(4)) + '_MAX'; + case 'float': + case 'double': + return `std::numeric_limits<${basicType}>::infinity()`; default: return 'err'; error = 'asTypeMaxValue: Unhandled underlying type ' + zclType + ' for original type ' + type; diff --git a/examples/chip-tool/templates/partials/test_cluster.zapt b/examples/chip-tool/templates/partials/test_cluster.zapt index 713cc0effd4442..984a57f680bb74 100644 --- a/examples/chip-tool/templates/partials/test_cluster.zapt +++ b/examples/chip-tool/templates/partials/test_cluster.zapt @@ -149,6 +149,7 @@ class {{filename}}: public TestCommand {{#if (isTestOnlyCluster cluster)}} CHIP_ERROR {{>testCommand}}() { + SetIdentity(kIdentity{{asUpperCamelCase identity}}); return {{command}}({{#chip_tests_item_parameters}}{{#not_first}}, {{/not_first}}{{#if (isString type)}}"{{/if}}{{definedValue}}{{#if (isString type)}}"{{/if}}{{/chip_tests_item_parameters}}); } {{else if isWait}} @@ -171,6 +172,7 @@ class {{filename}}: public TestCommand {{#*inline "successArguments"}}{{#chip_tests_item_response_parameters}}{{#not_first}}, {{/not_first}}{{zapTypeToDecodableClusterObjectType type ns=parent.cluster isArgument=true}} {{asLowerCamelCase name}}{{/chip_tests_item_response_parameters}}{{/inline}} {{#*inline "doneArguments"}}{{/inline}} + {{#*inline "device"}}mDevices[kIdentity{{asUpperCamelCase identity}}]{{/inline}} CHIP_ERROR {{>testCommand}}() { {{#if isGroupCommand}} @@ -194,14 +196,31 @@ class {{filename}}: public TestCommand (static_cast<{{filename}} *>(context))->OnFailureResponse_{{index}}(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevice, this, success, failure, endpoint, request)); + ReturnErrorOnFailure(chip::Controller::{{#if isGroupCommand}}InvokeGroupCommand{{else}}InvokeCommand{{/if}}({{>device}}, this, success, failure, + {{#if isGroupCommand}}groupId{{else}}endpoint{{/if}}, + request + {{#if timedInteractionTimeoutMs}} + , {{timedInteractionTimeoutMs}} + {{else if commandObject.mustUseTimedInvoke}} + , chip::NullOptional + {{/if}} + )); + {{#if busyWaitMs}} + { + using namespace chip::System::Clock::Literals; + // Busy-wait for {{busyWaitMs}} milliseconds. + auto & clock = chip::System::SystemClock(); + auto start = clock.GetMonotonicTimestamp(); + while (clock.GetMonotonicTimestamp() - start < {{busyWaitMs}}_ms); + } + {{/if}} {{#unless async}}return CHIP_NO_ERROR;{{/unless}} {{else}} chip::Controller::{{asUpperCamelCase cluster}}ClusterTest cluster; {{#if isGroupCommand}} - cluster.AssociateWithGroup(mDevice, groupId); + cluster.AssociateWithGroup({{>device}}, groupId); {{else}} - cluster.Associate(mDevice, endpoint); + cluster.Associate({{>device}}, endpoint); {{/if}} {{#chip_tests_item_parameters}} diff --git a/examples/chip-tool/templates/reporting-commands.zapt b/examples/chip-tool/templates/reporting-commands.zapt index 2995440e76ac34..6ba2e8e29b1c53 100644 --- a/examples/chip-tool/templates/reporting-commands.zapt +++ b/examples/chip-tool/templates/reporting-commands.zapt @@ -20,8 +20,10 @@ public: {{#chip_server_cluster_attributes}} {{#if isReportableAttribute}} {{#unless isList}} +{{#unless (isStrEqual chipCallback.name "Unsupported")}} delete onReport{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}Callback; {{/unless}} +{{/unless}} {{/if}} {{/chip_server_cluster_attributes}} {{/chip_client_clusters}} @@ -34,8 +36,10 @@ public: {{#chip_server_cluster_attributes}} {{#if isReportableAttribute}} {{#unless isList}} +{{#unless (isStrEqual chipCallback.name "Unsupported")}} callbacksMgr.AddReportCallback(remoteId, endpointId, {{asHex parent.code 4}}, {{asHex code 4}}, onReport{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}Callback->Cancel(), BasicAttributeFilter<{{chipCallback.name}}AttributeCallback>); {{/unless}} +{{/unless}} {{/if}} {{/chip_server_cluster_attributes}} {{/chip_client_clusters}} @@ -81,8 +85,10 @@ private: {{#chip_server_cluster_attributes}} {{#if isReportableAttribute}} {{#unless isList}} +{{#unless (isStrEqual chipCallback.name "Unsupported")}} chip::Callback::Callback<{{chipCallback.name}}AttributeCallback> * onReport{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}Callback = new chip::Callback::Callback<{{chipCallback.name}}AttributeCallback>(On{{chipCallback.name}}AttributeResponse, this); {{/unless}} +{{/unless}} {{/if}} {{/chip_server_cluster_attributes}} {{/chip_client_clusters}} diff --git a/examples/chip-tool/templates/tests-commands.zapt b/examples/chip-tool/templates/tests-commands.zapt index 65750d9d19314e..27e6ac1ea84b28 100644 --- a/examples/chip-tool/templates/tests-commands.zapt +++ b/examples/chip-tool/templates/tests-commands.zapt @@ -4,6 +4,10 @@ #include #include +#include +#include + +#include // For INFINITY class TestList : public Command { diff --git a/examples/common/pigweed/mbed/Rpc.cpp b/examples/common/pigweed/mbed/Rpc.cpp index 4f9ccde46beecc..e16c3afc816673 100644 --- a/examples/common/pigweed/mbed/Rpc.cpp +++ b/examples/common/pigweed/mbed/Rpc.cpp @@ -58,7 +58,7 @@ namespace rpc { class MbedButton final : public Button { public: - pw::Status Event(ServerContext &, const chip_rpc_ButtonEvent & request, pw_protobuf_Empty & response) + pw::Status Event(const chip_rpc_ButtonEvent & request, pw_protobuf_Empty & response) { GetAppTask().ButtonEventHandler(request.idx, request.pushed); return pw::OkStatus(); diff --git a/examples/common/pigweed/rpc_console/py/BUILD.gn b/examples/common/pigweed/rpc_console/py/BUILD.gn index a9fa6b5797b58e..a7d8ec88ca63c5 100644 --- a/examples/common/pigweed/rpc_console/py/BUILD.gn +++ b/examples/common/pigweed/rpc_console/py/BUILD.gn @@ -15,8 +15,8 @@ import("//build_overrides/chip.gni") import("//build_overrides/pigweed.gni") -import("$dir_pw_build/mirror_tree.gni") import("$dir_pw_build/python.gni") +import("$dir_pw_build/python_dist.gni") import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni") pw_python_package("chip_rpc") { @@ -46,8 +46,7 @@ pw_python_package("chip_rpc") { ] } -pw_mirror_tree("chip_rpc_wheel") { - path_data_keys = [ "pw_python_package_wheels" ] - deps = [ ":chip_rpc.wheel" ] +pw_python_wheels("chip_rpc_wheel") { + packages = [ ":chip_rpc" ] directory = "$root_out_dir/chip_rpc_console_wheels" } diff --git a/examples/common/pigweed/rpc_services/Attributes.h b/examples/common/pigweed/rpc_services/Attributes.h index 6b48fb96f6c62a..93b26f809dd543 100644 --- a/examples/common/pigweed/rpc_services/Attributes.h +++ b/examples/common/pigweed/rpc_services/Attributes.h @@ -32,7 +32,7 @@ namespace rpc { class Attributes : public generated::Attributes { public: - ::pw::Status Write(ServerContext &, const chip_rpc_AttributeWrite & request, pw_protobuf_Empty & response) + ::pw::Status Write(const chip_rpc_AttributeWrite & request, pw_protobuf_Empty & response) { const void * data; switch (request.data.which_data) @@ -70,7 +70,7 @@ class Attributes : public generated::Attributes return pw::OkStatus(); } - ::pw::Status Read(ServerContext &, const chip_rpc_AttributeMetadata & request, chip_rpc_AttributeData & response) + ::pw::Status Read(const chip_rpc_AttributeMetadata & request, chip_rpc_AttributeData & response) { void * data; size_t size = 0; diff --git a/examples/common/pigweed/rpc_services/Button.h b/examples/common/pigweed/rpc_services/Button.h index 87531e2035cb73..924783a5d6f86c 100644 --- a/examples/common/pigweed/rpc_services/Button.h +++ b/examples/common/pigweed/rpc_services/Button.h @@ -28,7 +28,7 @@ class Button : public generated::Button