From 5b3828f1b78f1a9ef9b5b3b15193ead902c26cec Mon Sep 17 00:00:00 2001 From: achaulk-goog <107196446+achaulk-goog@users.noreply.github.com> Date: Mon, 8 Apr 2024 14:22:27 -0400 Subject: [PATCH 01/11] Update IsIPv6ULA (#32879) Per spec https://datatracker.ietf.org/doc/html/rfc4193#section-3.1 fc/7 prefixes are local addresses, fe/8 uses a specific method and address format, but fc/8 is still a unique local address block, just with an undefined format --- src/inet/IPAddress.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/inet/IPAddress.cpp b/src/inet/IPAddress.cpp index c6059fb1f56bdb..a5b191d20e4804 100644 --- a/src/inet/IPAddress.cpp +++ b/src/inet/IPAddress.cpp @@ -319,7 +319,7 @@ bool IPAddress::IsIPv6GlobalUnicast() const // Is address an IPv6 Unique Local Address? bool IPAddress::IsIPv6ULA() const { - return (ntohl(Addr[0]) & 0xFF000000U) == 0xFD000000U; + return (ntohl(Addr[0]) & 0xFE000000U) == 0xFC000000U; } // Is address an IPv6 Link-local Address? From 297bea34a9d0b99dbe8172023d7bb704b34372ea Mon Sep 17 00:00:00 2001 From: Alex Tsitsiura Date: Mon, 8 Apr 2024 22:41:41 +0300 Subject: [PATCH 02/11] [Telink] Update Docker image (Zephyr update) (#32896) --- integrations/docker/images/base/chip-build/version | 2 +- integrations/docker/images/stage-2/chip-build-telink/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/integrations/docker/images/base/chip-build/version b/integrations/docker/images/base/chip-build/version index 3cdc06375c2eb2..20e7ff0d5a702b 100644 --- a/integrations/docker/images/base/chip-build/version +++ b/integrations/docker/images/base/chip-build/version @@ -1 +1 @@ -46 : [ESP32] Updated the QEMU Dockerfile. +47 : [Telink] Update Docker image (Zephyr update) diff --git a/integrations/docker/images/stage-2/chip-build-telink/Dockerfile b/integrations/docker/images/stage-2/chip-build-telink/Dockerfile index 9bddf431fb5a3d..46a1409fb6176d 100644 --- a/integrations/docker/images/stage-2/chip-build-telink/Dockerfile +++ b/integrations/docker/images/stage-2/chip-build-telink/Dockerfile @@ -12,7 +12,7 @@ RUN set -x \ && : # last line # Setup Zephyr -ARG ZEPHYR_REVISION=65dc1812431bf946dfc110682298acf83d63e27a +ARG ZEPHYR_REVISION=047fe473eb7e407d9905c7f1f24533e12f534280 WORKDIR /opt/telink/zephyrproject RUN set -x \ && python3 -m pip install -U --no-cache-dir west \ From f29ccbec98ea3c648c8dfd6f2a04f736972dec06 Mon Sep 17 00:00:00 2001 From: Sharad Binjola <31142146+sharadb-amazon@users.noreply.github.com> Date: Mon, 8 Apr 2024 13:39:38 -0700 Subject: [PATCH 03/11] tv-casting-app fixes: saving prevValue before callback (#32843) --- examples/tv-casting-app/APIs.md | 14 +++++------ examples/tv-casting-app/linux/main.cpp | 1 + examples/tv-casting-app/linux/simple-app.cpp | 1 + .../tv-casting-common/core/Attribute.h | 23 +++++++++++-------- .../include/CHIPProjectAppConfig.h | 7 ++++++ 5 files changed, 30 insertions(+), 16 deletions(-) diff --git a/examples/tv-casting-app/APIs.md b/examples/tv-casting-app/APIs.md index 5d80fca16fb0bb..12f5fdf30ebc1b 100644 --- a/examples/tv-casting-app/APIs.md +++ b/examples/tv-casting-app/APIs.md @@ -158,9 +158,9 @@ client's lifecycle: the Matter specification's "Onboarding Payload" section for more details on commissioning data. - On Linux, define a function `InitCommissionableDataProvider` to initialize - initialize a `LinuxCommissionableDataProvider` that can provide the required - values to the `CastingApp`. + On Linux, define a function `InitCommissionableDataProvider` to initialize a + `LinuxCommissionableDataProvider` that can provide the required values to + the `CastingApp`. ```c CHIP_ERROR InitCommissionableDataProvider(LinuxCommissionableDataProvider & provider, LinuxDeviceOptions & options) { @@ -917,14 +917,14 @@ On iOS refer to the following platform specific files: 1. For a list of clusters, commands and attributes supported by the Matter TV Casting library: - [/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCClusterObjects.h](/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCClusterObjects.h) + [darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCClusterObjects.h](darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCClusterObjects.h) 2. For the IDs and request / response types to use with the commands: - [/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandObjects.h](/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandObjects.h) + [darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandObjects.h](darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandObjects.h) and - [/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandPayloads.h](/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandPayloads.h) + [darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandPayloads.h](darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandPayloads.h) 3. For attribute [read operations](#read-operations) and [subscriptions](#subscriptions): - [/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCAttributeObjects.h](/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCAttributeObjects.h) + [darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCAttributeObjects.h](darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCAttributeObjects.h) ### Issuing Commands diff --git a/examples/tv-casting-app/linux/main.cpp b/examples/tv-casting-app/linux/main.cpp index 45c53c842568f8..0dde8a2f0d03eb 100644 --- a/examples/tv-casting-app/linux/main.cpp +++ b/examples/tv-casting-app/linux/main.cpp @@ -106,6 +106,7 @@ CHIP_ERROR ProcessClusterCommand(int argc, char ** argv) int main(int argc, char * argv[]) { + ChipLogProgress(AppServer, "chip_casting_simplified = 0"); // this file is built/run only if chip_casting_simplified = 0 VerifyOrDie(CHIP_NO_ERROR == chip::Platform::MemoryInit()); VerifyOrDie(CHIP_NO_ERROR == chip::DeviceLayer::PlatformMgr().InitChipStack()); diff --git a/examples/tv-casting-app/linux/simple-app.cpp b/examples/tv-casting-app/linux/simple-app.cpp index 26d35b443c0e67..01e33469e9b73f 100644 --- a/examples/tv-casting-app/linux/simple-app.cpp +++ b/examples/tv-casting-app/linux/simple-app.cpp @@ -130,6 +130,7 @@ class CommonCaseDeviceServerInitParamsProvider : public ServerInitParamsProvider int main(int argc, char * argv[]) { + ChipLogProgress(AppServer, "chip_casting_simplified = 1"); // this file is built/run only if chip_casting_simplified = 1 // Create AppParameters that need to be passed to CastingApp.Initialize() AppParameters appParameters; RotatingDeviceIdUniqueIdProvider rotatingDeviceIdUniqueIdProvider; diff --git a/examples/tv-casting-app/tv-casting-common/core/Attribute.h b/examples/tv-casting-app/tv-casting-common/core/Attribute.h index 958c7ab24bce9b..6e717d33e2d2d0 100644 --- a/examples/tv-casting-app/tv-casting-common/core/Attribute.h +++ b/examples/tv-casting-app/tv-casting-common/core/Attribute.h @@ -97,16 +97,19 @@ class Attribute static_cast *>(__context); ChipLogProgress(AppServer, "::Read() success"); Attribute * __attr = static_cast *>(__attributeContext->mAttribute); - __attr->value = response; if (__attr->hasValue) { - __attributeContext->mSuccessCb(__attributeContext->mClientContext, - chip::MakeOptional(__attr->value), response); + typename TypeInfo::DecodableType prevValue = __attr->value; + __attr->value = response; + __attributeContext->mSuccessCb(__attributeContext->mClientContext, chip::MakeOptional(prevValue), + __attr->value); } else { __attr->hasValue = true; - __attributeContext->mSuccessCb(__attributeContext->mClientContext, chip::NullOptional, response); + __attr->value = response; + __attributeContext->mSuccessCb(__attributeContext->mClientContext, chip::NullOptional, + __attr->value); } delete __attributeContext; }, @@ -269,17 +272,19 @@ class Attribute static_cast *>(__context); ChipLogProgress(AppServer, "::Subscribe() success"); Attribute * __attr = static_cast *>(__attributeContext->mAttribute); - __attr->value = response; - // TODO: Save old value and then overwrite if (__attr->hasValue) { - __attributeContext->mSuccessCb(__attributeContext->mClientContext, - chip::MakeOptional(__attr->value), response); + typename TypeInfo::DecodableType prevValue = __attr->value; + __attr->value = response; + __attributeContext->mSuccessCb(__attributeContext->mClientContext, chip::MakeOptional(prevValue), + __attr->value); } else { __attr->hasValue = true; - __attributeContext->mSuccessCb(__attributeContext->mClientContext, chip::NullOptional, response); + __attr->value = response; + __attributeContext->mSuccessCb(__attributeContext->mClientContext, chip::NullOptional, + __attr->value); } delete __attributeContext; }, diff --git a/examples/tv-casting-app/tv-casting-common/include/CHIPProjectAppConfig.h b/examples/tv-casting-app/tv-casting-common/include/CHIPProjectAppConfig.h index 6a9549e4d1fd9d..74926b00489703 100644 --- a/examples/tv-casting-app/tv-casting-common/include/CHIPProjectAppConfig.h +++ b/examples/tv-casting-app/tv-casting-common/include/CHIPProjectAppConfig.h @@ -58,6 +58,13 @@ #define CHIP_CONFIG_EXAMPLE_ACCESS_CONTROL_MAX_SUBJECTS_PER_ENTRY 20 #define CHIP_CONFIG_EXAMPLE_ACCESS_CONTROL_MAX_ENTRIES_PER_FABRIC 20 +/** + * For casting, we need to allow for more binding table entries because the Casting App can connect to many Matter Casting Players, + * each with many Content Apps. Each Casting Player will set 1 binding per endpoint on it. A Casting Player will have 1 endpoint for + * every Matter Content App installed on it + 1 endpoint representing the Casting Player + 1 endpoint representing a speaker. + */ +#define MATTER_BINDING_TABLE_SIZE 64 + // Enable some test-only interaction model APIs. #define CONFIG_BUILD_FOR_HOST_UNIT_TEST 1 From 1a907b374ba62736f980524fda43dbfc3a2cd3a1 Mon Sep 17 00:00:00 2001 From: Karsten Sperling <113487422+ksperling-apple@users.noreply.github.com> Date: Wed, 10 Apr 2024 00:48:14 +1200 Subject: [PATCH 04/11] Avoid zombie DeviceControllerSystemState (#32903) Make sure a dead system state can't be revived by raising the retain count above 0 again. Also ensure the retain count is read and updated in a single atomic operation. Return a bool from Release so the caller can know if the release resulted in state shutdown, and add an IsShutdown method. --- .../CHIPDeviceControllerFactory.cpp | 4 ++-- src/controller/CHIPDeviceControllerFactory.h | 4 +++- .../CHIPDeviceControllerSystemState.h | 21 +++++++++++-------- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/controller/CHIPDeviceControllerFactory.cpp b/src/controller/CHIPDeviceControllerFactory.cpp index 84a00d4243acee..e4e419978d8a2d 100644 --- a/src/controller/CHIPDeviceControllerFactory.cpp +++ b/src/controller/CHIPDeviceControllerFactory.cpp @@ -392,9 +392,9 @@ void DeviceControllerFactory::RetainSystemState() (void) mSystemState->Retain(); } -void DeviceControllerFactory::ReleaseSystemState() +bool DeviceControllerFactory::ReleaseSystemState() { - mSystemState->Release(); + return mSystemState->Release(); } DeviceControllerFactory::~DeviceControllerFactory() diff --git a/src/controller/CHIPDeviceControllerFactory.h b/src/controller/CHIPDeviceControllerFactory.h index 260273180d0ee7..19b19e54eab414 100644 --- a/src/controller/CHIPDeviceControllerFactory.h +++ b/src/controller/CHIPDeviceControllerFactory.h @@ -205,7 +205,9 @@ class DeviceControllerFactory // // This should only be invoked if a matching call to RetainSystemState() was called prior. // - void ReleaseSystemState(); + // Returns true if stack was shut down in response to this call, or false otherwise. + // + bool ReleaseSystemState(); // // Retrieve a read-only pointer to the system state object that contains pointers to key stack diff --git a/src/controller/CHIPDeviceControllerSystemState.h b/src/controller/CHIPDeviceControllerSystemState.h index bc89d6c1d21ec2..707f1befacec94 100644 --- a/src/controller/CHIPDeviceControllerSystemState.h +++ b/src/controller/CHIPDeviceControllerSystemState.h @@ -167,8 +167,9 @@ class DeviceControllerSystemState // should be called to release the reference once it is no longer needed. DeviceControllerSystemState * Retain() { - VerifyOrDie(mRefCount < std::numeric_limits::max()); - ++mRefCount; + auto count = mRefCount++; + VerifyOrDie(count < std::numeric_limits::max()); // overflow + VerifyOrDie(!IsShutdown()); // avoid zombie return this; }; @@ -178,14 +179,15 @@ class DeviceControllerSystemState // // NB: The system state is owned by the factory; Relase() will not free it // but will free its members (Shutdown()). - void Release() + // + // Returns true if the system state was shut down in response to this call. + bool Release() { - VerifyOrDie(mRefCount > 0); - - if (--mRefCount == 0) - { - Shutdown(); - } + auto count = mRefCount--; + VerifyOrDie(count > 0); // underflow + VerifyOrReturnValue(count == 1, false); + Shutdown(); + return true; }; bool IsInitialized() { @@ -195,6 +197,7 @@ class DeviceControllerSystemState mGroupDataProvider != nullptr && mReportScheduler != nullptr && mTimerDelegate != nullptr && mSessionKeystore != nullptr && mSessionResumptionStorage != nullptr && mBDXTransferServer != nullptr; }; + bool IsShutdown() { return mHaveShutDown; } System::Layer * SystemLayer() const { return mSystemLayer; }; Inet::EndPointManager * TCPEndPointManager() const { return mTCPEndPointManager; }; From 45a9a6682b73054b2b7590d976a9d5d88cfea52c Mon Sep 17 00:00:00 2001 From: Terence Hampson Date: Tue, 9 Apr 2024 09:32:31 -0400 Subject: [PATCH 05/11] CIPD gen script is callable regard where activate is called from (#32822) --- scripts/setup/bootstrap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/setup/bootstrap.sh b/scripts/setup/bootstrap.sh index 0a2a898eaf02c5..ce6b12f1df330d 100644 --- a/scripts/setup/bootstrap.sh +++ b/scripts/setup/bootstrap.sh @@ -113,7 +113,7 @@ _bootstrap_or_activate() { local _PIGWEED_CIPD_JSON="$_CHIP_ROOT/third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/cipd_setup/pigweed.json" mkdir -p "$_PW_ACTUAL_ENVIRONMENT_ROOT" local _GENERATED_PIGWEED_CIPD_JSON="$_PW_ACTUAL_ENVIRONMENT_ROOT/pigweed.json" - scripts/setup/gen_pigweed_cipd_json.py -i $_PIGWEED_CIPD_JSON -o $_GENERATED_PIGWEED_CIPD_JSON + $_CHIP_ROOT/scripts/setup/gen_pigweed_cipd_json.py -i $_PIGWEED_CIPD_JSON -o $_GENERATED_PIGWEED_CIPD_JSON if test -n "$GITHUB_ACTION"; then tee <"${_PW_ACTUAL_ENVIRONMENT_ROOT}/pip.conf" From eb2650a1c391c87a74430128ec588d4ed18999a1 Mon Sep 17 00:00:00 2001 From: Vatsal Ghelani <152916324+vatsalghelani-csa@users.noreply.github.com> Date: Tue, 9 Apr 2024 10:55:15 -0400 Subject: [PATCH 06/11] Issue/30754 dependabot ci runs for both push and pull (#32834) * Update examples-tizen.yaml - use on: push: branches: - 'master' to fulfill * Update cirque.yaml * Update examples-linux-standalone.yaml * Update examples-qpg.yaml * Update zap_templates.yaml * Update examples-linux-imx.yaml * Update examples-ameba.yaml * Update chef.yaml * Update darwin.yaml * Update gradle-wrapper-validation.yml * Update spell.yml * Update examples-efr32.yaml * Update examples-asr.yaml * Update examples-esp32.yaml * Update examples-stm32.yaml * Update tests.yaml * Update examples-mw320.yaml * Update examples-nrfconnect.yaml * Update chef.yaml * Update cirque.yaml * Update examples-ameba.yaml * Update examples-asr.yaml * Update examples-efr32.yaml * Update examples-esp32.yaml * Update examples-linux-imx.yaml * Update examples-linux-standalone.yaml * Update examples-mw320.yaml * Update examples-nrfconnect.yaml * Update examples-qpg.yaml * Update examples-stm32.yaml * Update examples-tizen.yaml * Update gradle-wrapper-validation.yml * Update spell.yml * Update tests.yaml * Update zap_templates.yaml * Update gradle-wrapper-validation.yml * Update darwin.yaml * Update examples-asr.yaml * Update examples-asr.yaml --------- Co-authored-by: Kai Liao <140431279+kliao-csa@users.noreply.github.com> --- .github/workflows/chef.yaml | 2 ++ .github/workflows/cirque.yaml | 2 ++ .github/workflows/darwin.yaml | 2 ++ .github/workflows/examples-ameba.yaml | 2 ++ .github/workflows/examples-asr.yaml | 4 +++- .github/workflows/examples-efr32.yaml | 2 ++ .github/workflows/examples-esp32.yaml | 2 ++ .github/workflows/examples-linux-imx.yaml | 2 ++ .github/workflows/examples-linux-standalone.yaml | 2 ++ .github/workflows/examples-mw320.yaml | 2 ++ .github/workflows/examples-nrfconnect.yaml | 2 ++ .github/workflows/examples-qpg.yaml | 4 +++- .github/workflows/examples-stm32.yaml | 2 ++ .github/workflows/examples-tizen.yaml | 2 ++ .github/workflows/gradle-wrapper-validation.yml | 6 +++++- .github/workflows/spell.yml | 2 ++ .github/workflows/tests.yaml | 2 ++ .github/workflows/zap_templates.yaml | 2 ++ 18 files changed, 41 insertions(+), 3 deletions(-) diff --git a/.github/workflows/chef.yaml b/.github/workflows/chef.yaml index 862ada5236f96f..b2119552c7924a 100644 --- a/.github/workflows/chef.yaml +++ b/.github/workflows/chef.yaml @@ -16,6 +16,8 @@ name: Build Chef CI examples on all platforms on: push: + branches-ignore: + - 'dependabot/**' pull_request: merge_group: diff --git a/.github/workflows/cirque.yaml b/.github/workflows/cirque.yaml index a82750e546278d..4da74b74bcae18 100644 --- a/.github/workflows/cirque.yaml +++ b/.github/workflows/cirque.yaml @@ -16,6 +16,8 @@ name: Cirque on: push: + branches-ignore: + - 'dependabot/**' pull_request: merge_group: workflow_dispatch: diff --git a/.github/workflows/darwin.yaml b/.github/workflows/darwin.yaml index af8740f74eddb7..e857515b11f952 100644 --- a/.github/workflows/darwin.yaml +++ b/.github/workflows/darwin.yaml @@ -16,6 +16,8 @@ name: Darwin on: push: + branches-ignore: + - 'dependabot/**' pull_request: merge_group: workflow_dispatch: diff --git a/.github/workflows/examples-ameba.yaml b/.github/workflows/examples-ameba.yaml index 16cfb4c17e0419..0beab0cc0aa8a3 100644 --- a/.github/workflows/examples-ameba.yaml +++ b/.github/workflows/examples-ameba.yaml @@ -16,6 +16,8 @@ name: Build example - Ameba on: push: + branches-ignore: + - 'dependabot/**' pull_request: merge_group: diff --git a/.github/workflows/examples-asr.yaml b/.github/workflows/examples-asr.yaml index 6e9d4a8b13527b..6708f2221ea2d4 100644 --- a/.github/workflows/examples-asr.yaml +++ b/.github/workflows/examples-asr.yaml @@ -16,6 +16,8 @@ name: Build example - ASR on: push: + branches-ignore: + - 'dependabot/**' pull_request: merge_group: @@ -60,4 +62,4 @@ jobs: --target asr-asr582x-dishwasher \ --target asr-asr582x-refrigerator \ build \ - " \ No newline at end of file + " diff --git a/.github/workflows/examples-efr32.yaml b/.github/workflows/examples-efr32.yaml index 0ec8a540c2311f..8586542fc6242d 100644 --- a/.github/workflows/examples-efr32.yaml +++ b/.github/workflows/examples-efr32.yaml @@ -16,6 +16,8 @@ name: Build example - EFR32 on: push: + branches-ignore: + - 'dependabot/**' pull_request: merge_group: diff --git a/.github/workflows/examples-esp32.yaml b/.github/workflows/examples-esp32.yaml index 09eca99abad026..33637e81068194 100644 --- a/.github/workflows/examples-esp32.yaml +++ b/.github/workflows/examples-esp32.yaml @@ -16,6 +16,8 @@ name: Build example - ESP32 on: push: + branches-ignore: + - 'dependabot/**' pull_request: merge_group: diff --git a/.github/workflows/examples-linux-imx.yaml b/.github/workflows/examples-linux-imx.yaml index 27a997db1bf5cf..772765e1e110f7 100644 --- a/.github/workflows/examples-linux-imx.yaml +++ b/.github/workflows/examples-linux-imx.yaml @@ -16,6 +16,8 @@ name: Build example - i.MX Linux on: push: + branches-ignore: + - 'dependabot/**' pull_request: merge_group: diff --git a/.github/workflows/examples-linux-standalone.yaml b/.github/workflows/examples-linux-standalone.yaml index ffec5dad8cb1a9..832afae53b3851 100644 --- a/.github/workflows/examples-linux-standalone.yaml +++ b/.github/workflows/examples-linux-standalone.yaml @@ -16,6 +16,8 @@ name: Build example - Linux Standalone on: push: + branches-ignore: + - 'dependabot/**' pull_request: merge_group: diff --git a/.github/workflows/examples-mw320.yaml b/.github/workflows/examples-mw320.yaml index 1f2940af4c576f..7513c8fb477c09 100644 --- a/.github/workflows/examples-mw320.yaml +++ b/.github/workflows/examples-mw320.yaml @@ -16,6 +16,8 @@ name: Build example - MW320 on: push: + branches-ignore: + - 'dependabot/**' pull_request: merge_group: diff --git a/.github/workflows/examples-nrfconnect.yaml b/.github/workflows/examples-nrfconnect.yaml index d305ebf05e4717..d8a5f15fb0e4b4 100644 --- a/.github/workflows/examples-nrfconnect.yaml +++ b/.github/workflows/examples-nrfconnect.yaml @@ -16,6 +16,8 @@ name: Build example - nRF Connect SDK on: push: + branches-ignore: + - 'dependabot/**' pull_request: merge_group: diff --git a/.github/workflows/examples-qpg.yaml b/.github/workflows/examples-qpg.yaml index b67ef067ed1caf..8e7b28727c5591 100644 --- a/.github/workflows/examples-qpg.yaml +++ b/.github/workflows/examples-qpg.yaml @@ -16,6 +16,8 @@ name: Build example - QPG on: push: + branches-ignore: + - 'dependabot/**' pull_request: merge_group: @@ -86,4 +88,4 @@ jobs: uses: ./.github/actions/upload-size-reports if: ${{ !env.ACT }} with: - platform-name: QPG \ No newline at end of file + platform-name: QPG diff --git a/.github/workflows/examples-stm32.yaml b/.github/workflows/examples-stm32.yaml index 57d0c3115ca01b..c1af5e399cddec 100644 --- a/.github/workflows/examples-stm32.yaml +++ b/.github/workflows/examples-stm32.yaml @@ -16,6 +16,8 @@ name: Build example - stm32 on: push: + branches-ignore: + - 'dependabot/**' pull_request: merge_group: diff --git a/.github/workflows/examples-tizen.yaml b/.github/workflows/examples-tizen.yaml index f89c2d259490cc..b3d584de22f45f 100644 --- a/.github/workflows/examples-tizen.yaml +++ b/.github/workflows/examples-tizen.yaml @@ -16,6 +16,8 @@ name: Build example - Tizen on: push: + branches-ignore: + - 'dependabot/**' pull_request: merge_group: diff --git a/.github/workflows/gradle-wrapper-validation.yml b/.github/workflows/gradle-wrapper-validation.yml index 97617480d8f292..ab3f49942329ce 100644 --- a/.github/workflows/gradle-wrapper-validation.yml +++ b/.github/workflows/gradle-wrapper-validation.yml @@ -1,5 +1,9 @@ name: "Validate Gradle Wrapper" -on: [push, pull_request] +on: + push: + branches-ignore: + - 'dependabot/**' + pull_request: jobs: validation: diff --git a/.github/workflows/spell.yml b/.github/workflows/spell.yml index 84877bf6f8c8bb..f37a0e28711c6f 100644 --- a/.github/workflows/spell.yml +++ b/.github/workflows/spell.yml @@ -16,6 +16,8 @@ name: Run misspell on: push: + branches-ignore: + - 'dependabot/**' paths: - "**.md" - ".github/.wordlist.txt" diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 68f978f1ab9fbf..73158ccb0557fd 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -16,6 +16,8 @@ name: Tests on: push: + branches-ignore: + - 'dependabot/**' pull_request: merge_group: workflow_dispatch: diff --git a/.github/workflows/zap_templates.yaml b/.github/workflows/zap_templates.yaml index ea8c72ae349ba7..07c5f64afe591a 100644 --- a/.github/workflows/zap_templates.yaml +++ b/.github/workflows/zap_templates.yaml @@ -16,6 +16,8 @@ name: ZAP on: push: + branches-ignore: + - 'dependabot/**' pull_request: merge_group: From d96944524e85c03cc10c2ef37bc4209f3cd1e978 Mon Sep 17 00:00:00 2001 From: Kai Liao <140431279+kliao-csa@users.noreply.github.com> Date: Tue, 9 Apr 2024 07:56:10 -0700 Subject: [PATCH 07/11] 30754 cicd dependabot ci runs for both push and pull effectively double the processing (#32833) * Update examples-infineon.yaml * Update examples-telink.yaml * Update examples-openiotsdk.yaml * Update examples-mbed.yaml * Update java-tests.yaml * Update minimal-build.yaml * Update examples-cc13x2x7_26x2x7.yaml * Update full-android.yaml * Update unit_integration_test.yaml * Update qemu.yaml * Update examples-cc32xx.yaml * Update examples-bouffalolab.yaml * Update lint.yml * Update examples-linux-arm.yaml * Update build.yaml * Update examples-mbed.yaml * Update java-tests.yaml * Update examples-infineon.yaml * Update examples-telink.yaml * Update examples-openiotsdk.yaml * Update minimal-build.yaml * Update examples-cc13x2x7_26x2x7.yaml * Update full-android.yaml * Update unit_integration_test.yaml * Update qemu.yaml * Update examples-cc32xx.yaml * Update examples-bouffalolab.yaml * Update build.yaml * Update examples-linux-arm.yaml * Update lint.yml * Update lint.yml * Update examples-cc13x2x7_26x2x7.yaml Entire yaml seems to be deleted so I'm removing changes to the file --- .github/workflows/build.yaml | 2 ++ .github/workflows/examples-bouffalolab.yaml | 2 ++ .github/workflows/examples-cc32xx.yaml | 2 ++ .github/workflows/examples-infineon.yaml | 4 +++- .github/workflows/examples-linux-arm.yaml | 2 ++ .github/workflows/examples-mbed.yaml | 2 ++ .github/workflows/examples-openiotsdk.yaml | 2 ++ .github/workflows/examples-telink.yaml | 2 ++ .github/workflows/full-android.yaml | 2 ++ .github/workflows/java-tests.yaml | 2 ++ .github/workflows/lint.yml | 3 +++ .github/workflows/minimal-build.yaml | 2 ++ .github/workflows/qemu.yaml | 2 ++ .github/workflows/unit_integration_test.yaml | 2 ++ 14 files changed, 30 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f6abbd7315128d..3ba46848909d8d 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -16,6 +16,8 @@ name: Builds on: push: + branches-ignore: + - 'dependabot/**' pull_request: merge_group: workflow_dispatch: diff --git a/.github/workflows/examples-bouffalolab.yaml b/.github/workflows/examples-bouffalolab.yaml index ce38acdc0d5165..2cba36cc443b6e 100644 --- a/.github/workflows/examples-bouffalolab.yaml +++ b/.github/workflows/examples-bouffalolab.yaml @@ -16,6 +16,8 @@ name: Build example - BouffaloLab on: push: + branches-ignore: + - 'dependabot/**' pull_request: merge_group: workflow_dispatch: diff --git a/.github/workflows/examples-cc32xx.yaml b/.github/workflows/examples-cc32xx.yaml index a56e5cff8d70c4..4e11072e711e03 100644 --- a/.github/workflows/examples-cc32xx.yaml +++ b/.github/workflows/examples-cc32xx.yaml @@ -16,6 +16,8 @@ name: Build example - TI CC32XX on: push: + branches-ignore: + - 'dependabot/**' pull_request: merge_group: diff --git a/.github/workflows/examples-infineon.yaml b/.github/workflows/examples-infineon.yaml index 9aba6a2ec6e1fc..240db045f051e4 100644 --- a/.github/workflows/examples-infineon.yaml +++ b/.github/workflows/examples-infineon.yaml @@ -16,6 +16,8 @@ name: Build example - Infineon on: push: + branches-ignore: + - 'dependabot/**' pull_request: merge_group: workflow_dispatch: @@ -144,4 +146,4 @@ jobs: uses: ./.github/actions/upload-size-reports if: ${{ !env.ACT }} with: - platform-name: Infineon \ No newline at end of file + platform-name: Infineon diff --git a/.github/workflows/examples-linux-arm.yaml b/.github/workflows/examples-linux-arm.yaml index 6dc80615c426ac..8ca577410ac37d 100644 --- a/.github/workflows/examples-linux-arm.yaml +++ b/.github/workflows/examples-linux-arm.yaml @@ -16,6 +16,8 @@ name: Build example - Linux ARM on: push: + branches-ignore: + - 'dependabot/**' pull_request: merge_group: diff --git a/.github/workflows/examples-mbed.yaml b/.github/workflows/examples-mbed.yaml index 3744047406009a..2da09b78003fa0 100644 --- a/.github/workflows/examples-mbed.yaml +++ b/.github/workflows/examples-mbed.yaml @@ -16,6 +16,8 @@ name: Build example - Mbed OS on: push: + branches-ignore: + - 'dependabot/**' pull_request: merge_group: workflow_dispatch: diff --git a/.github/workflows/examples-openiotsdk.yaml b/.github/workflows/examples-openiotsdk.yaml index fead4424f712a1..e61e06761a1a16 100644 --- a/.github/workflows/examples-openiotsdk.yaml +++ b/.github/workflows/examples-openiotsdk.yaml @@ -16,6 +16,8 @@ name: Build example - Open IoT SDK on: push: + branches-ignore: + - 'dependabot/**' pull_request: merge_group: workflow_dispatch: diff --git a/.github/workflows/examples-telink.yaml b/.github/workflows/examples-telink.yaml index a21d4970730703..563a450aa6ed1a 100644 --- a/.github/workflows/examples-telink.yaml +++ b/.github/workflows/examples-telink.yaml @@ -16,6 +16,8 @@ name: Build example - Telink on: push: + branches-ignore: + - 'dependabot/**' pull_request: merge_group: diff --git a/.github/workflows/full-android.yaml b/.github/workflows/full-android.yaml index 48f0af185c268e..4c54b4be121491 100644 --- a/.github/workflows/full-android.yaml +++ b/.github/workflows/full-android.yaml @@ -16,6 +16,8 @@ name: Full builds - Android on: push: + branches-ignore: + - 'dependabot/**' workflow_dispatch: concurrency: diff --git a/.github/workflows/java-tests.yaml b/.github/workflows/java-tests.yaml index b609ad79fc9d56..ce3ceb0e292721 100644 --- a/.github/workflows/java-tests.yaml +++ b/.github/workflows/java-tests.yaml @@ -16,6 +16,8 @@ name: Java Tests on: push: + branches-ignore: + - 'dependabot/**' pull_request: merge_group: workflow_dispatch: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 1968718809124a..89f25b2c163142 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -13,8 +13,11 @@ # limitations under the License. name: Lint Code Base + on: push: + branches-ignore: + - 'dependabot/**' pull_request: merge_group: workflow_dispatch: diff --git a/.github/workflows/minimal-build.yaml b/.github/workflows/minimal-build.yaml index 3320dab5a0b59c..e6514bb72f7cc0 100644 --- a/.github/workflows/minimal-build.yaml +++ b/.github/workflows/minimal-build.yaml @@ -16,6 +16,8 @@ name: Minimal Build (Linux / configure) on: push: + branches-ignore: + - 'dependabot/**' pull_request: merge_group: diff --git a/.github/workflows/qemu.yaml b/.github/workflows/qemu.yaml index 9b6c85592d8755..ba52f767485371 100644 --- a/.github/workflows/qemu.yaml +++ b/.github/workflows/qemu.yaml @@ -16,6 +16,8 @@ name: QEMU on: push: + branches-ignore: + - 'dependabot/**' pull_request: merge_group: diff --git a/.github/workflows/unit_integration_test.yaml b/.github/workflows/unit_integration_test.yaml index 480e9ec74362be..d2e2af12adea65 100644 --- a/.github/workflows/unit_integration_test.yaml +++ b/.github/workflows/unit_integration_test.yaml @@ -16,6 +16,8 @@ name: Unit / Integration Tests on: push: + branches-ignore: + - 'dependabot/**' pull_request: merge_group: From 46b33ad085c53a22950d66fb14da2d4b9c503879 Mon Sep 17 00:00:00 2001 From: chrisdecenzo <61757564+chrisdecenzo@users.noreply.github.com> Date: Tue, 9 Apr 2024 08:27:01 -0700 Subject: [PATCH 08/11] Temp fix for #32875 (network commissioning cluster check for SSID on Thread feature) (#32884) * Temp fix for 32875 * Clarify comments --- .../network-commissioning.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/app/clusters/network-commissioning/network-commissioning.cpp b/src/app/clusters/network-commissioning/network-commissioning.cpp index 8212ea9f8008dc..3ad47b6cee7540 100644 --- a/src/app/clusters/network-commissioning/network-commissioning.cpp +++ b/src/app/clusters/network-commissioning/network-commissioning.cpp @@ -491,12 +491,17 @@ void Instance::HandleScanNetworks(HandlerContext & ctx, const Commands::ScanNetw } else if (mFeatureFlags.Has(Feature::kThreadNetworkInterface)) { + // NOTE: the following lines were commented out due to issue #32875. In short, a popular + // commissioner is passing a null SSID argument and this logic breaks interoperability as a result. + // The spec has some inconsistency on this which also needs to be fixed. The commissioner maker is + // fixing its code and will return to un-comment this code, with that work tracked by Issue #32887. + // // SSID present on Thread violates the `[WI]` conformance. - if (req.ssid.HasValue()) - { - ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Protocols::InteractionModel::Status::InvalidCommand); - return; - } + // if (req.ssid.HasValue()) + // { + // ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Protocols::InteractionModel::Status::InvalidCommand); + // return; + // } mCurrentOperationBreadcrumb = req.breadcrumb; mAsyncCommandHandle = CommandHandler::Handle(&ctx.mCommandHandler); From ff6c19b0edd2d3de6d46ff88a1d16d0b7ee7627c Mon Sep 17 00:00:00 2001 From: Jakub Latusek Date: Tue, 9 Apr 2024 17:35:00 +0200 Subject: [PATCH 09/11] Replace enum to enum class (#32909) --- .../Linux/ConnectivityManagerImpl.cpp | 36 +++++++++---------- src/platform/Linux/ConnectivityManagerImpl.h | 24 ++++++------- .../Linux/bluez/ChipDeviceScanner.cpp | 14 ++++---- src/platform/Linux/bluez/ChipDeviceScanner.h | 12 +++---- 4 files changed, 43 insertions(+), 43 deletions(-) diff --git a/src/platform/Linux/ConnectivityManagerImpl.cpp b/src/platform/Linux/ConnectivityManagerImpl.cpp index 2a57a99d507976..7e7d2a1786b29e 100644 --- a/src/platform/Linux/ConnectivityManagerImpl.cpp +++ b/src/platform/Linux/ConnectivityManagerImpl.cpp @@ -209,7 +209,7 @@ bool ConnectivityManagerImpl::_IsWiFiStationConnected() std::lock_guard lock(mWpaSupplicantMutex); - if (mWpaSupplicant.state != GDBusWpaSupplicant::WPA_INTERFACE_CONNECTED) + if (mWpaSupplicant.state != GDBusWpaSupplicant::WpaState::INTERFACE_CONNECTED) { ChipLogProgress(DeviceLayer, "wpa_supplicant: _IsWiFiStationConnected: interface not connected"); return false; @@ -238,7 +238,7 @@ bool ConnectivityManagerImpl::_IsWiFiStationProvisioned() std::lock_guard lock(mWpaSupplicantMutex); - if (mWpaSupplicant.state != GDBusWpaSupplicant::WPA_INTERFACE_CONNECTED) + if (mWpaSupplicant.state != GDBusWpaSupplicant::WpaState::INTERFACE_CONNECTED) { ChipLogProgress(DeviceLayer, "wpa_supplicant: _IsWiFiStationProvisioned: interface not connected"); return false; @@ -257,7 +257,7 @@ void ConnectivityManagerImpl::_ClearWiFiStationProvision() { std::lock_guard lock(mWpaSupplicantMutex); - if (mWpaSupplicant.state != GDBusWpaSupplicant::WPA_INTERFACE_CONNECTED) + if (mWpaSupplicant.state != GDBusWpaSupplicant::WpaState::INTERFACE_CONNECTED) { ChipLogProgress(DeviceLayer, "wpa_supplicant: _ClearWiFiStationProvision: interface not connected"); return; @@ -280,8 +280,8 @@ bool ConnectivityManagerImpl::_CanStartWiFiScan() { std::lock_guard lock(mWpaSupplicantMutex); - bool ret = mWpaSupplicant.state == GDBusWpaSupplicant::WPA_INTERFACE_CONNECTED && - mWpaSupplicant.scanState == GDBusWpaSupplicant::WIFI_SCANNING_IDLE; + bool ret = mWpaSupplicant.state == GDBusWpaSupplicant::WpaState::INTERFACE_CONNECTED && + mWpaSupplicant.scanState == GDBusWpaSupplicant::WpaScanningState::IDLE; return ret; } @@ -507,7 +507,7 @@ void ConnectivityManagerImpl::_OnWpaInterfaceProxyReady(GObject * sourceObject, if (iface != nullptr && err == nullptr) { mWpaSupplicant.iface = iface; - mWpaSupplicant.state = GDBusWpaSupplicant::WPA_INTERFACE_CONNECTED; + mWpaSupplicant.state = GDBusWpaSupplicant::WpaState::INTERFACE_CONNECTED; ChipLogProgress(DeviceLayer, "wpa_supplicant: connected to wpa_supplicant interface proxy"); g_signal_connect( @@ -527,7 +527,7 @@ void ConnectivityManagerImpl::_OnWpaInterfaceProxyReady(GObject * sourceObject, ChipLogProgress(DeviceLayer, "wpa_supplicant: failed to create wpa_supplicant interface proxy %s: %s", mWpaSupplicant.interfacePath, err ? err->message : "unknown error"); - mWpaSupplicant.state = GDBusWpaSupplicant::WPA_NOT_CONNECTED; + mWpaSupplicant.state = GDBusWpaSupplicant::WpaState::NOT_CONNECTED; } // We need to stop auto scan or it will block our network scan. @@ -584,7 +584,7 @@ void ConnectivityManagerImpl::_OnWpaInterfaceReady(GObject * sourceObject, GAsyn &err.GetReceiver()); if (result) { - mWpaSupplicant.state = GDBusWpaSupplicant::WPA_GOT_INTERFACE_PATH; + mWpaSupplicant.state = GDBusWpaSupplicant::WpaState::GOT_INTERFACE_PATH; ChipLogProgress(DeviceLayer, "wpa_supplicant: WiFi interface: %s", mWpaSupplicant.interfacePath); wpa_fi_w1_wpa_supplicant1_interface_proxy_new_for_bus( @@ -623,7 +623,7 @@ void ConnectivityManagerImpl::_OnWpaInterfaceReady(GObject * sourceObject, GAsyn if (result) { - mWpaSupplicant.state = GDBusWpaSupplicant::WPA_GOT_INTERFACE_PATH; + mWpaSupplicant.state = GDBusWpaSupplicant::WpaState::GOT_INTERFACE_PATH; ChipLogProgress(DeviceLayer, "wpa_supplicant: WiFi interface: %s", mWpaSupplicant.interfacePath); Platform::CopyString(sWiFiIfName, CHIP_DEVICE_CONFIG_WIFI_STATION_IF_NAME); @@ -649,7 +649,7 @@ void ConnectivityManagerImpl::_OnWpaInterfaceReady(GObject * sourceObject, GAsyn ChipLogProgress(DeviceLayer, "wpa_supplicant: failed to create interface %s: %s", CHIP_DEVICE_CONFIG_WIFI_STATION_IF_NAME, error ? error->message : "unknown error"); - mWpaSupplicant.state = GDBusWpaSupplicant::WPA_NO_INTERFACE_PATH; + mWpaSupplicant.state = GDBusWpaSupplicant::WpaState::NO_INTERFACE_PATH; if (mWpaSupplicant.interfacePath) { @@ -676,7 +676,7 @@ void ConnectivityManagerImpl::_OnWpaInterfaceAdded(WpaFiW1Wpa_supplicant1 * prox mWpaSupplicant.interfacePath = const_cast(path); if (mWpaSupplicant.interfacePath) { - mWpaSupplicant.state = GDBusWpaSupplicant::WPA_GOT_INTERFACE_PATH; + mWpaSupplicant.state = GDBusWpaSupplicant::WpaState::GOT_INTERFACE_PATH; ChipLogProgress(DeviceLayer, "wpa_supplicant: WiFi interface added: %s", mWpaSupplicant.interfacePath); wpa_fi_w1_wpa_supplicant1_interface_proxy_new_for_bus( @@ -710,7 +710,7 @@ void ConnectivityManagerImpl::_OnWpaInterfaceRemoved(WpaFiW1Wpa_supplicant1 * pr { ChipLogProgress(DeviceLayer, "wpa_supplicant: WiFi interface removed: %s", StringOrNullMarker(path)); - mWpaSupplicant.state = GDBusWpaSupplicant::WPA_NO_INTERFACE_PATH; + mWpaSupplicant.state = GDBusWpaSupplicant::WpaState::NO_INTERFACE_PATH; if (mWpaSupplicant.interfacePath) { @@ -730,7 +730,7 @@ void ConnectivityManagerImpl::_OnWpaInterfaceRemoved(WpaFiW1Wpa_supplicant1 * pr mWpaSupplicant.bss = nullptr; } - mWpaSupplicant.scanState = GDBusWpaSupplicant::WIFI_SCANNING_IDLE; + mWpaSupplicant.scanState = GDBusWpaSupplicant::WpaScanningState::IDLE; } } @@ -747,7 +747,7 @@ void ConnectivityManagerImpl::_OnWpaProxyReady(GObject * sourceObject, GAsyncRes mWpaSupplicant.proxy = wpa_fi_w1_wpa_supplicant1_proxy_new_for_bus_finish(res, &err.GetReceiver()); if (mWpaSupplicant.proxy != nullptr && err.get() == nullptr) { - mWpaSupplicant.state = GDBusWpaSupplicant::WPA_CONNECTED; + mWpaSupplicant.state = GDBusWpaSupplicant::WpaState::CONNECTED; ChipLogProgress(DeviceLayer, "wpa_supplicant: connected to wpa_supplicant proxy"); g_signal_connect( @@ -773,7 +773,7 @@ void ConnectivityManagerImpl::_OnWpaProxyReady(GObject * sourceObject, GAsyncRes { ChipLogProgress(DeviceLayer, "wpa_supplicant: failed to create wpa_supplicant proxy %s", err ? err->message : "unknown error"); - mWpaSupplicant.state = GDBusWpaSupplicant::WPA_NOT_CONNECTED; + mWpaSupplicant.state = GDBusWpaSupplicant::WpaState::NOT_CONNECTED; } } @@ -793,7 +793,7 @@ bool ConnectivityManagerImpl::IsWiFiManagementStarted() { std::lock_guard lock(mWpaSupplicantMutex); - bool ret = mWpaSupplicant.state == GDBusWpaSupplicant::WPA_INTERFACE_CONNECTED; + bool ret = mWpaSupplicant.state == GDBusWpaSupplicant::WpaState::INTERFACE_CONNECTED; return ret; } @@ -1322,7 +1322,7 @@ CHIP_ERROR ConnectivityManagerImpl::CommitConfig() std::lock_guard lock(mWpaSupplicantMutex); - if (mWpaSupplicant.state != GDBusWpaSupplicant::WPA_INTERFACE_CONNECTED) + if (mWpaSupplicant.state != GDBusWpaSupplicant::WpaState::INTERFACE_CONNECTED) { ChipLogError(DeviceLayer, "wpa_supplicant: CommitConfig: interface proxy not connected"); return CHIP_ERROR_INCORRECT_STATE; @@ -1391,7 +1391,7 @@ CHIP_ERROR ConnectivityManagerImpl::GetWiFiSecurityType(SecurityTypeEnum & secur std::lock_guard lock(mWpaSupplicantMutex); - if (mWpaSupplicant.state != GDBusWpaSupplicant::WPA_INTERFACE_CONNECTED) + if (mWpaSupplicant.state != GDBusWpaSupplicant::WpaState::INTERFACE_CONNECTED) { ChipLogError(DeviceLayer, "wpa_supplicant: GetWiFiSecurityType: interface proxy not connected"); return CHIP_ERROR_INCORRECT_STATE; diff --git a/src/platform/Linux/ConnectivityManagerImpl.h b/src/platform/Linux/ConnectivityManagerImpl.h index 26d6172ad438eb..ee5978faf6ff70 100644 --- a/src/platform/Linux/ConnectivityManagerImpl.h +++ b/src/platform/Linux/ConnectivityManagerImpl.h @@ -66,25 +66,25 @@ namespace DeviceLayer { #if CHIP_DEVICE_CONFIG_ENABLE_WPA struct GDBusWpaSupplicant { - enum WpaState + enum class WpaState { INIT, - WPA_CONNECTING, - WPA_CONNECTED, - WPA_NOT_CONNECTED, - WPA_NO_INTERFACE_PATH, - WPA_GOT_INTERFACE_PATH, - WPA_INTERFACE_CONNECTED, + CONNECTING, + CONNECTED, + NOT_CONNECTED, + NO_INTERFACE_PATH, + GOT_INTERFACE_PATH, + INTERFACE_CONNECTED, }; - enum WpaScanning + enum class WpaScanningState { - WIFI_SCANNING_IDLE, - WIFI_SCANNING, + IDLE, + SCANNING, }; - WpaState state = INIT; - WpaScanning scanState = WIFI_SCANNING_IDLE; + WpaState state = WpaState::INIT; + WpaScanningState scanState = WpaScanningState::IDLE; WpaFiW1Wpa_supplicant1 * proxy = nullptr; WpaFiW1Wpa_supplicant1Interface * iface = nullptr; WpaFiW1Wpa_supplicant1BSS * bss = nullptr; diff --git a/src/platform/Linux/bluez/ChipDeviceScanner.cpp b/src/platform/Linux/bluez/ChipDeviceScanner.cpp index 2842da85256dad..28a9baa358b33f 100644 --- a/src/platform/Linux/bluez/ChipDeviceScanner.cpp +++ b/src/platform/Linux/bluez/ChipDeviceScanner.cpp @@ -65,14 +65,14 @@ CHIP_ERROR ChipDeviceScanner::Init(BluezAdapter1 * adapter, ChipDeviceScannerDel mAdapter.reset(reinterpret_cast(g_object_ref(adapter))); mDelegate = delegate; - mScannerState = ChipDeviceScannerState::SCANNER_INITIALIZED; + mScannerState = ChipDeviceScannerState::INITIALIZED; return CHIP_NO_ERROR; } void ChipDeviceScanner::Shutdown() { - VerifyOrReturn(mScannerState != ChipDeviceScannerState::SCANNER_UNINITIALIZED); + VerifyOrReturn(mScannerState != ChipDeviceScannerState::UNINITIALIZED); StopScan(); @@ -86,13 +86,13 @@ void ChipDeviceScanner::Shutdown() }, this); - mScannerState = ChipDeviceScannerState::SCANNER_UNINITIALIZED; + mScannerState = ChipDeviceScannerState::UNINITIALIZED; } CHIP_ERROR ChipDeviceScanner::StartScan() { assertChipStackLockedByCurrentThread(); - VerifyOrReturnError(mScannerState != ChipDeviceScannerState::SCANNER_SCANNING, CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(mScannerState != ChipDeviceScannerState::SCANNING, CHIP_ERROR_INCORRECT_STATE); mCancellable.reset(g_cancellable_new()); CHIP_ERROR err = PlatformMgrImpl().GLibMatterContextInvokeSync( @@ -104,7 +104,7 @@ CHIP_ERROR ChipDeviceScanner::StartScan() return err; } - mScannerState = ChipDeviceScannerState::SCANNER_SCANNING; + mScannerState = ChipDeviceScannerState::SCANNING; ChipLogDetail(Ble, "ChipDeviceScanner has started scanning!"); return CHIP_NO_ERROR; @@ -113,7 +113,7 @@ CHIP_ERROR ChipDeviceScanner::StartScan() CHIP_ERROR ChipDeviceScanner::StopScan() { assertChipStackLockedByCurrentThread(); - VerifyOrReturnError(mScannerState == ChipDeviceScannerState::SCANNER_SCANNING, CHIP_NO_ERROR); + VerifyOrReturnError(mScannerState == ChipDeviceScannerState::SCANNING, CHIP_NO_ERROR); CHIP_ERROR err = PlatformMgrImpl().GLibMatterContextInvokeSync( +[](ChipDeviceScanner * self) { return self->StopScanImpl(); }, this); @@ -124,7 +124,7 @@ CHIP_ERROR ChipDeviceScanner::StopScan() } // Stop scanning and return to initialization state - mScannerState = ChipDeviceScannerState::SCANNER_INITIALIZED; + mScannerState = ChipDeviceScannerState::INITIALIZED; ChipLogDetail(Ble, "ChipDeviceScanner has stopped scanning!"); diff --git a/src/platform/Linux/bluez/ChipDeviceScanner.h b/src/platform/Linux/bluez/ChipDeviceScanner.h index d3730527589bfc..ead9467fdc29ef 100644 --- a/src/platform/Linux/bluez/ChipDeviceScanner.h +++ b/src/platform/Linux/bluez/ChipDeviceScanner.h @@ -79,7 +79,7 @@ class ChipDeviceScanner : public BluezObjectManagerAdapterNotificationsDelegate CHIP_ERROR StopScan(); /// Check if the scanner is active - bool IsScanning() const { return mScannerState == ChipDeviceScannerState::SCANNER_SCANNING; } + bool IsScanning() const { return mScannerState == ChipDeviceScannerState::SCANNING; } /// Members that implement virtual methods on BluezObjectManagerAdapterNotificationsDelegate void OnDeviceAdded(BluezDevice1 & device) override; @@ -87,11 +87,11 @@ class ChipDeviceScanner : public BluezObjectManagerAdapterNotificationsDelegate void OnDeviceRemoved(BluezDevice1 & device) override {} private: - enum ChipDeviceScannerState + enum class ChipDeviceScannerState { - SCANNER_UNINITIALIZED, - SCANNER_INITIALIZED, - SCANNER_SCANNING + UNINITIALIZED, + INITIALIZED, + SCANNING }; CHIP_ERROR StartScanImpl(); @@ -108,7 +108,7 @@ class ChipDeviceScanner : public BluezObjectManagerAdapterNotificationsDelegate GAutoPtr mAdapter; ChipDeviceScannerDelegate * mDelegate = nullptr; - ChipDeviceScannerState mScannerState = ChipDeviceScannerState::SCANNER_UNINITIALIZED; + ChipDeviceScannerState mScannerState = ChipDeviceScannerState::UNINITIALIZED; GAutoPtr mCancellable; }; From fffec4ceea26c7c196616b5d3423cbd8ea273a47 Mon Sep 17 00:00:00 2001 From: Arkadiusz Bokowy Date: Tue, 9 Apr 2024 18:11:53 +0200 Subject: [PATCH 10/11] Remove CHIPoBLE testing dead code (#32910) * Remove CHIPoBLE testing dead code * Remove legacy TX queue locking functions * Do not turn off clang-format * Fix spelling typos --- src/ble/BLEEndPoint.cpp | 124 +++++------------------------- src/ble/BLEEndPoint.h | 34 -------- src/ble/BUILD.gn | 5 +- src/ble/BleConfig.h | 14 +--- src/ble/BleLayer.cpp | 8 -- src/ble/BleLayer.h | 15 +--- src/ble/BtpEngine.cpp | 44 +---------- src/ble/BtpEngine.h | 42 +--------- src/ble/tests/TestBleErrorStr.cpp | 5 +- 9 files changed, 31 insertions(+), 260 deletions(-) diff --git a/src/ble/BLEEndPoint.cpp b/src/ble/BLEEndPoint.cpp index 5f60c009753cbe..840a668be0a62a 100644 --- a/src/ble/BLEEndPoint.cpp +++ b/src/ble/BLEEndPoint.cpp @@ -41,17 +41,12 @@ #include #include #include -#if CHIP_ENABLE_CHIPOBLE_TEST -#include "BtpEngineTest.h" -#endif - -// clang-format off // Define below to enable extremely verbose, BLE end point-specific debug logging. #undef CHIP_BLE_END_POINT_DEBUG_LOGGING_ENABLED #ifdef CHIP_BLE_END_POINT_DEBUG_LOGGING_ENABLED -#define ChipLogDebugBleEndPoint(MOD, MSG, ...) ChipLogDetail(MOD, MSG, ## __VA_ARGS__) +#define ChipLogDebugBleEndPoint(MOD, MSG, ...) ChipLogDetail(MOD, MSG, ##__VA_ARGS__) #else #define ChipLogDebugBleEndPoint(MOD, MSG, ...) #endif @@ -64,7 +59,7 @@ * packet to re-open its window instead of waiting for the send-ack timer to expire. * */ -#define BLE_CONFIG_IMMEDIATE_ACK_WINDOW_THRESHOLD 1 +#define BLE_CONFIG_IMMEDIATE_ACK_WINDOW_THRESHOLD 1 /** * @def BLE_UNSUBSCRIBE_TIMEOUT_MS @@ -74,14 +69,18 @@ * before it automatically releases its BLE connection and frees itself. The default value of 5 seconds is arbitrary. * */ -#define BLE_UNSUBSCRIBE_TIMEOUT_MS 5000 // 5 seconds - -#define BTP_ACK_SEND_TIMEOUT_MS 2500 // 2.5 seconds +#define BLE_UNSUBSCRIBE_TIMEOUT_MS 5000 -#define BTP_WINDOW_NO_ACK_SEND_THRESHOLD 1 // Data fragments may only be sent without piggybacked - // acks if receiver's window size is above this threshold. +#define BTP_ACK_SEND_TIMEOUT_MS 2500 -// clang-format on +/** + * @def BTP_WINDOW_NO_ACK_SEND_THRESHOLD + * + * @brief + * Data fragments may only be sent without piggybacked acks if receiver's window size is above this threshold. + * + */ +#define BTP_WINDOW_NO_ACK_SEND_THRESHOLD 1 namespace chip { namespace Ble { @@ -204,18 +203,13 @@ void BLEEndPoint::HandleSubscribeReceived() VerifyOrExit(!mSendQueue.IsNull(), err = CHIP_ERROR_INCORRECT_STATE); // Send BTP capabilities response to peripheral via GATT indication. -#if CHIP_ENABLE_CHIPOBLE_TEST - VerifyOrExit(mBtpEngine.PopPacketTag(mSendQueue) == kType_Data, err = BLE_ERROR_INVALID_BTP_HEADER_FLAGS); -#endif // Add reference to message fragment for duration of platform's GATT indication attempt. CHIP retains partial // ownership of message fragment's packet buffer, since this is the same buffer as that of the whole message, just // with a fragmenter-modified payload offset and data length. if (!SendIndication(mSendQueue.Retain())) { // Ensure transmit queue is empty and set to NULL. - QueueTxLock(); mSendQueue = nullptr; - QueueTxUnlock(); ChipLogError(Ble, "cap resp ind failed"); err = BLE_ERROR_GATT_INDICATE_FAILED; @@ -289,9 +283,6 @@ void BLEEndPoint::Abort() OnConnectComplete = nullptr; OnConnectionClosed = nullptr; OnMessageReceived = nullptr; -#if CHIP_ENABLE_CHIPOBLE_TEST - OnCommandReceived = NULL; -#endif DoClose(kBleCloseFlag_SuppressCallback | kBleCloseFlag_AbortTransmission, CHIP_NO_ERROR); } @@ -302,9 +293,6 @@ void BLEEndPoint::Close() OnConnectComplete = nullptr; OnConnectionClosed = nullptr; OnMessageReceived = nullptr; -#if CHIP_ENABLE_CHIPOBLE_TEST - OnCommandReceived = NULL; -#endif DoClose(kBleCloseFlag_SuppressCallback, CHIP_NO_ERROR); } @@ -364,9 +352,7 @@ void BLEEndPoint::FinalizeClose(uint8_t oldState, uint8_t flags, CHIP_ERROR err) mState = kState_Closed; // Ensure transmit queue is empty and set to NULL. - QueueTxLock(); mSendQueue = nullptr; - QueueTxUnlock(); // Fire application's close callback if we haven't already, and it's not suppressed. if (oldState != kState_Closing && (flags & kBleCloseFlag_SuppressCallback) == 0) @@ -486,11 +472,6 @@ void BLEEndPoint::Free() StopAckReceivedTimer(); StopSendAckTimer(); StopUnsubscribeTimer(); -#if CHIP_ENABLE_CHIPOBLE_TEST - mBtpEngineTest.StopTestTimer(); - // Clear callback - OnCommandReceived = NULL; -#endif // Clear callbacks. OnConnectComplete = nullptr; @@ -524,7 +505,7 @@ CHIP_ERROR BLEEndPoint::Init(BleLayer * bleLayer, BLE_CONNECTION_OBJECT connObj, VerifyOrReturnError((role == kBleRole_Central || role == kBleRole_Peripheral), CHIP_ERROR_INVALID_ARGUMENT); // If end point plays peripheral role, expect ack for indication sent as last step of BTP handshake. - // If central, periperal's handshake indication 'ack's write sent by central to kick off the BTP handshake. + // If central, peripheral's handshake indication 'ack's write sent by central to kick off the BTP handshake. bool expectInitialAck = (role == kBleRole_Peripheral); CHIP_ERROR err = mBtpEngine.Init(this, expectInitialAck); @@ -534,21 +515,6 @@ CHIP_ERROR BLEEndPoint::Init(BleLayer * bleLayer, BLE_CONNECTION_OBJECT connObj, return err; } -#if CHIP_ENABLE_CHIPOBLE_TEST - err = static_cast(mTxQueueMutex.Init(mTxQueueMutex)); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Ble, "%s: Mutex init failed", __FUNCTION__); - return err; - } - err = mBtpEngineTest.Init(this); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Ble, "BTP test init failed"); - return err; - } -#endif - mBle = bleLayer; mRefCount = 1; @@ -630,13 +596,6 @@ CHIP_ERROR BLEEndPoint::SendCharacteristic(PacketBufferHandle && buf) */ void BLEEndPoint::QueueTx(PacketBufferHandle && data, PacketType_t type) { -#if CHIP_ENABLE_CHIPOBLE_TEST - ChipLogDebugBleEndPoint(Ble, "%s: data->%p, type %d, len %d", __FUNCTION__, data, type, data->DataLength()); - mBtpEngine.PushPacketTag(data, type); -#endif - - QueueTxLock(); - if (mSendQueue.IsNull()) { mSendQueue = std::move(data); @@ -647,8 +606,6 @@ void BLEEndPoint::QueueTx(PacketBufferHandle && data, PacketType_t type) mSendQueue->AddToEnd(std::move(data)); ChipLogDebugBleEndPoint(Ble, "%s: Append data to mSendQueue %p, type %d", __FUNCTION__, mSendQueue->Start(), type); } - - QueueTxUnlock(); } CHIP_ERROR BLEEndPoint::Send(PacketBufferHandle && data) @@ -714,26 +671,7 @@ bool BLEEndPoint::PrepareNextFragment(PacketBufferHandle && data, bool & sentAck CHIP_ERROR BLEEndPoint::SendNextMessage() { // Get the first queued packet to send - QueueTxLock(); -#if CHIP_ENABLE_CHIPOBLE_TEST - // Return if tx queue is empty - // Note: PopHead() does not check an empty queue - if (mSendQueue.IsNull()) - { - QueueTxUnlock(); - return CHIP_NO_ERROR; - } -#endif - PacketBufferHandle data = mSendQueue.PopHead(); - QueueTxUnlock(); - -#if CHIP_ENABLE_CHIPOBLE_TEST - // Get and consume the packet tag in message buffer - PacketType_t type = mBtpEngine.PopPacketTag(data); - mBtpEngine.SetTxPacketType(type); - mBtpEngineTest.DoTxTiming(data, BTP_TX_START); -#endif // Hand whole message payload to the fragmenter. bool sentAck; @@ -799,9 +737,7 @@ CHIP_ERROR BLEEndPoint::HandleHandshakeConfirmationReceived() uint8_t closeFlags = kBleCloseFlag_AbortTransmission; // Free capabilities request/response payload. - QueueTxLock(); mSendQueue.FreeHead(); - QueueTxUnlock(); if (mRole == kBleRole_Central) { @@ -831,7 +767,7 @@ CHIP_ERROR BLEEndPoint::HandleHandshakeConfirmationReceived() } else { - // Drive sending in case application callend Send() after we sent the handshake indication, but + // Drive sending in case application called Send() after we sent the handshake indication, but // before the GATT confirmation for this indication was received. err = DriveSending(); SuccessOrExit(err); @@ -1020,9 +956,6 @@ CHIP_ERROR BLEEndPoint::DriveSending() // Clear fragmenter's pointer to sent message buffer and reset its Tx state. // Buffer will be freed at scope exit. PacketBufferHandle sentBuf = mBtpEngine.TakeTxPacket(); -#if CHIP_ENABLE_CHIPOBLE_TEST - mBtpEngineTest.DoTxTiming(sentBuf, BTP_TX_DONE); -#endif // CHIP_ENABLE_CHIPOBLE_TEST if (!mSendQueue.IsNull()) { @@ -1201,13 +1134,6 @@ CHIP_ERROR BLEEndPoint::Receive(PacketBufferHandle && data) uint8_t closeFlags = kBleCloseFlag_AbortTransmission; bool didReceiveAck = false; -#if CHIP_ENABLE_CHIPOBLE_TEST - if (mBtpEngine.IsCommandPacket(data)) - { - ChipLogDebugBleEndPoint(Ble, "%s: Received Control frame: Flags %x", __FUNCTION__, *(data->Start())); - } - else -#endif { // This is a special handling on the first CHIPoBLE data packet, the CapabilitiesRequest. // Suppress error logging if peer's send overlaps with our unsubscribe on final close. if (IsUnsubscribePending()) @@ -1283,7 +1209,7 @@ CHIP_ERROR BLEEndPoint::Receive(PacketBufferHandle && data) { ChipLogDebugBleEndPoint(Ble, "got btp ack = %u", receivedAck); - // If ack was rx'd for neweset unacked sent fragment, stop ack received timer. + // If ack was rx'd for newest unacked sent fragment, stop ack received timer. if (!mBtpEngine.ExpectingAck()) { ChipLogDebugBleEndPoint(Ble, "got ack for last outstanding fragment"); @@ -1359,24 +1285,12 @@ CHIP_ERROR BLEEndPoint::Receive(PacketBufferHandle && data) ChipLogDebugBleEndPoint(Ble, "reassembled whole msg, len = %d", full_packet->DataLength()); -#if CHIP_ENABLE_CHIPOBLE_TEST - // If we have a control message received callback, and end point is not closing... - if (mBtpEngine.RxPacketType() == kType_Control && OnCommandReceived && mState != kState_Closing) + // If we have a message received callback, and end point is not closing... + if (mBleTransport != nullptr && mState != kState_Closing) { - ChipLogDebugBleEndPoint(Ble, "%s: calling OnCommandReceived, seq# %u, len = %u, type %u", __FUNCTION__, receivedAck, - full_packet->DataLength(), mBtpEngine.RxPacketType()); - // Pass received control message up the stack. - mBtpEngine.SetRxPacketSeq(receivedAck); - OnCommandReceived(this, std::move(full_packet)); + // Pass received message up the stack. + mBleTransport->OnEndPointMessageReceived(this, std::move(full_packet)); } - else -#endif - // If we have a message received callback, and end point is not closing... - if (mBleTransport != nullptr && mState != kState_Closing) - { - // Pass received message up the stack. - mBleTransport->OnEndPointMessageReceived(this, std::move(full_packet)); - } } exit: diff --git a/src/ble/BLEEndPoint.h b/src/ble/BLEEndPoint.h index dba18fc5b43511..1bce51e1671419 100644 --- a/src/ble/BLEEndPoint.h +++ b/src/ble/BLEEndPoint.h @@ -32,11 +32,6 @@ #include #include -#if CHIP_ENABLE_CHIPOBLE_TEST -#include -#include -#endif - namespace chip { namespace Ble { @@ -53,17 +48,11 @@ class BleLayer; class BleEndPointPool; // BLEEndPoint holds a pointer to BleLayerDelegate for messages, while BleLayerDelegate functions also accepts BLEEndPoint. class BleLayerDelegate; -#if CHIP_ENABLE_CHIPOBLE_TEST -class BtpEngineTest; -#endif class DLL_EXPORT BLEEndPoint { friend class BleLayer; friend class BleEndPointPool; -#if CHIP_ENABLE_CHIPOBLE_TEST - friend class BtpEngineTest; -#endif public: typedef uint64_t AlignT; @@ -90,15 +79,6 @@ class DLL_EXPORT BLEEndPoint typedef void (*OnConnectionClosedFunct)(BLEEndPoint * endPoint, CHIP_ERROR err); OnConnectionClosedFunct OnConnectionClosed; -#if CHIP_ENABLE_CHIPOBLE_TEST - typedef void (*OnCommandReceivedFunct)(BLEEndPoint * endPoint, PacketBufferHandle && msg); - OnCommandReceivedFunct OnCommandReceived; - inline void SetOnCommandReceivedCB(OnCommandReceivedFunct cb) { OnCommandReceived = cb; }; - BtpEngineTest mBtpEngineTest; - inline void SetTxWindowSize(uint8_t size) { mRemoteReceiveWindowSize = size; }; - inline void SetRxWindowSize(uint8_t size) { mReceiveWindowMaxSize = size; }; -#endif - // Public functions: CHIP_ERROR Send(PacketBufferHandle && data); CHIP_ERROR Receive(PacketBufferHandle && data); @@ -137,9 +117,6 @@ class DLL_EXPORT BLEEndPoint kAckReceivedTimerRunning = 0x04, // Ack received timer running due to unacked sent fragment. kSendAckTimerRunning = 0x08, // Send ack timer running; indicates pending ack to send. kUnsubscribeTimerRunning = 0x10, // Unsubscribe completion timer running. -#if CHIP_ENABLE_CHIPOBLE_TEST - kUnderTestTimerRunnung = 0x80 // running throughput Tx test -#endif }; // BLE connection to which an end point is uniquely bound. Type BLE_CONNECTION_OBJECT is defined by the platform or @@ -164,9 +141,6 @@ class DLL_EXPORT BLEEndPoint SequenceNumber_t mLocalReceiveWindowSize; SequenceNumber_t mRemoteReceiveWindowSize; SequenceNumber_t mReceiveWindowMaxSize; -#if CHIP_ENABLE_CHIPOBLE_TEST - chip::System::Mutex mTxQueueMutex; // For MT-safe Tx queuing -#endif // Private functions: BLEEndPoint() = delete; @@ -228,14 +202,6 @@ class DLL_EXPORT BLEEndPoint void Free(); void FreeBtpEngine(); - // Mutex lock on Tx queue. Used only in BtpEngine test build for now. -#if CHIP_ENABLE_CHIPOBLE_TEST - inline void QueueTxLock() { mTxQueueMutex.Lock(); } - inline void QueueTxUnlock() { mTxQueueMutex.Unlock(); } -#else - inline void QueueTxLock() {} - inline void QueueTxUnlock() {} -#endif void QueueTx(PacketBufferHandle && data, PacketType_t type); }; diff --git a/src/ble/BUILD.gn b/src/ble/BUILD.gn index bfdc3db2548044..508d420f665107 100644 --- a/src/ble/BUILD.gn +++ b/src/ble/BUILD.gn @@ -29,10 +29,7 @@ buildconfig_header("ble_buildconfig") { header = "BleBuildConfig.h" header_dir = "ble" - defines = [ - "CONFIG_NETWORK_LAYER_BLE=${chip_config_network_layer_ble}", - "CHIP_ENABLE_CHIPOBLE_TEST=false", - ] + defines = [ "CONFIG_NETWORK_LAYER_BLE=${chip_config_network_layer_ble}" ] if (chip_ble_project_config_include != "") { defines += diff --git a/src/ble/BleConfig.h b/src/ble/BleConfig.h index 91005a20882fc1..c6d7877081f340 100644 --- a/src/ble/BleConfig.h +++ b/src/ble/BleConfig.h @@ -65,9 +65,6 @@ #include BLE_PLATFORM_CONFIG_INCLUDE #endif -// clang-format off - - /** * @def BLE_LAYER_NUM_BLE_ENDPOINTS * @@ -102,7 +99,7 @@ * */ #ifndef BLE_CONNECTION_OBJECT -#define BLE_CONNECTION_OBJECT void* +#define BLE_CONNECTION_OBJECT void * #endif // BLE_CONNECTION_OBJECT /** @@ -129,7 +126,7 @@ * */ #ifndef BLE_READ_REQUEST_CONTEXT -#define BLE_READ_REQUEST_CONTEXT void* +#define BLE_READ_REQUEST_CONTEXT void * #endif // BLE_READ_REQUEST_CONTEXT /** @@ -197,7 +194,6 @@ #define BLE_CONFIG_ERROR(e) (BLE_CONFIG_ERROR_MIN + (e)) #endif // BLE_CONFIG_ERROR - /** * @def BTP_CONN_RSP_TIMEOUT_MS * @@ -206,7 +202,7 @@ * request to wait for connection establishment. */ #ifndef BTP_CONN_RSP_TIMEOUT_MS -#define BTP_CONN_RSP_TIMEOUT_MS 15000 // 15 seconds +#define BTP_CONN_RSP_TIMEOUT_MS 15000 #endif // BTP_CONN_RSP_TIMEOUT_MS /** @@ -217,9 +213,7 @@ * an acknowledgement. When the ack is not received within this period the BTP session is closed. */ #ifndef BTP_ACK_TIMEOUT_MS -#define BTP_ACK_TIMEOUT_MS 15000 // 15 seconds +#define BTP_ACK_TIMEOUT_MS 15000 #endif // BTP_ACK_TIMEOUT_MS -// clang-format on - #include diff --git a/src/ble/BleLayer.cpp b/src/ble/BleLayer.cpp index eae49a0bfa8dd1..0472d70ac28d2c 100644 --- a/src/ble/BleLayer.cpp +++ b/src/ble/BleLayer.cpp @@ -287,10 +287,6 @@ CHIP_ERROR BleLayer::Init(BlePlatformDelegate * platformDelegate, BleConnectionD mState = kState_Initialized; -#if CHIP_ENABLE_CHIPOBLE_TEST - mTestBleEndPoint = NULL; -#endif - return CHIP_NO_ERROR; } @@ -444,10 +440,6 @@ CHIP_ERROR BleLayer::NewBleEndPoint(BLEEndPoint ** retEndPoint, BLE_CONNECTION_O (*retEndPoint)->Init(this, connObj, role, autoClose); (*retEndPoint)->mBleTransport = mBleTransport; -#if CHIP_ENABLE_CHIPOBLE_TEST - mTestBleEndPoint = *retEndPoint; -#endif - return CHIP_NO_ERROR; } diff --git a/src/ble/BleLayer.h b/src/ble/BleLayer.h index af2267b770fcf8..a1c4d191672617 100644 --- a/src/ble/BleLayer.h +++ b/src/ble/BleLayer.h @@ -22,7 +22,7 @@ * platform's Bluetooth Low Energy (BLE) implementation and the CHIP * stack. * - * The BleLayer obect accepts BLE data and control input from the + * The BleLayer object accepts BLE data and control input from the * application via a functional interface. It performs the fragmentation * and reassembly required to transmit CHIP message via a BLE GATT * characteristic interface, and drives incoming messages up the CHIP @@ -197,7 +197,7 @@ class BleTransportCapabilitiesResponseMessage * and hand the platform-specific BLE_CONNECTION_OBJECT that this receipt * generates to BleLayer via the corresponding platform interface function. * This causes BleLayer to wrap the BLE_CONNECTION_OBJECT in a BLEEndPoint, - * and notify chipMessageLayer that a new BLE conneciotn has been received. + * and notify chipMessageLayer that a new BLE connection has been received. * The message layer then wraps the new BLEEndPoint object in a * chipConnection, and hands this object to the application via the message * layer's OnConnectionReceived callback. @@ -214,9 +214,6 @@ class BleTransportCapabilitiesResponseMessage class DLL_EXPORT BleLayer { friend class BLEEndPoint; -#if CHIP_ENABLE_CHIPOBLE_TEST - friend class BtpEngineTest; -#endif public: // Public data members: @@ -271,7 +268,7 @@ class DLL_EXPORT BleLayer * characteristics CHIP cares about. * Platform must call this function when a GATT subscription has been established to any CHIP service - * charateristic. + * characteristic. * * If this function returns true, CHIP has accepted the BLE connection and wrapped it * in a chipConnection object. If CHIP accepts a BLE connection, the platform MUST @@ -283,7 +280,7 @@ class DLL_EXPORT BleLayer bool HandleSubscribeComplete(BLE_CONNECTION_OBJECT connObj, const ChipBleUUID * svcId, const ChipBleUUID * charId); /**< Platform must call this function when a GATT unsubscribe is requested on any CHIP - * service charateristic, that is, when an existing GATT subscription on a CHIP service + * service characteristic, that is, when an existing GATT subscription on a CHIP service * characteristic is canceled. */ bool HandleUnsubscribeReceived(BLE_CONNECTION_OBJECT connObj, const ChipBleUUID * svcId, const ChipBleUUID * charId); @@ -319,10 +316,6 @@ class DLL_EXPORT BleLayer * err = BLE_ERROR_APP_CLOSED_CONNECTION to prevent the leak of this chipConnection and its end point object. */ void HandleConnectionError(BLE_CONNECTION_OBJECT connObj, CHIP_ERROR err); -#if CHIP_ENABLE_CHIPOBLE_TEST - BLEEndPoint * mTestBleEndPoint; -#endif - private: // Private data members: diff --git a/src/ble/BtpEngine.cpp b/src/ble/BtpEngine.cpp index 3183c6db79aed1..cb3ac8ee092e2a 100644 --- a/src/ble/BtpEngine.cpp +++ b/src/ble/BtpEngine.cpp @@ -30,9 +30,6 @@ #if CONFIG_NETWORK_LAYER_BLE #include -#if CHIP_ENABLE_CHIPOBLE_TEST -#include -#endif #include #include @@ -93,10 +90,6 @@ CHIP_ERROR BtpEngine::Init(void * an_app_state, bool expect_first_ack) mTxPacketCount = 0; mTxNewestUnackedSeqNum = 0; mTxOldestUnackedSeqNum = 0; -#if CHIP_ENABLE_CHIPOBLE_TEST - mTxPacketType = kType_Data; // Default BtpEngine Data packet - mRxPacketType = kType_Data; // Default BtpEngine Data packet -#endif if (expect_first_ack) { @@ -144,25 +137,6 @@ SequenceNumber_t BtpEngine::GetAndRecordRxAckSeqNum() return ret; } -#if CHIP_ENABLE_CHIPOBLE_TEST -bool BtpEngine::IsCommandPacket(const PacketBufferHandle & p) -{ - if (p.IsNull()) - { - return false; - } - - BitFlags rx_flags; - Encoding::LittleEndian::Reader reader(data->Start(), data->DataLength()); - CHIP_ERROR err = reader.Read8(rx_flags.RawStorage()).StatusCode(); - if (err != CHIP_NO_ERROR) - { - return false; - } - return rx_flags.Has(HeaderFlags::kCommandMessage); -} -#endif // CHIP_ENABLE_CHIPOBLE_TEST - bool BtpEngine::HasUnackedData() const { return (mRxOldestUnackedSeqNum != mRxNextSeqNum); @@ -271,12 +245,6 @@ CHIP_ERROR BtpEngine::HandleCharacteristicReceived(System::PacketBufferHandle && // Get header flags, always in first byte. err = reader.Read8(rx_flags.RawStorage()).StatusCode(); SuccessOrExit(err); -#if CHIP_ENABLE_CHIPOBLE_TEST - if (rx_flags.Has(HeaderFlags::kCommandMessage)) - SetRxPacketType(kType_Control); - else - SetRxPacketType(kType_Data); -#endif didReceiveAck = rx_flags.Has(HeaderFlags::kFragmentAck); @@ -307,7 +275,7 @@ CHIP_ERROR BtpEngine::HandleCharacteristicReceived(System::PacketBufferHandle && } // Truncate the incoming fragment length by the mRxFragmentSize as the negotiated - // mRxFragnentSize may be smaller than the characteristic size. Make sure + // mRxFragmentSize may be smaller than the characteristic size. Make sure // we're not truncating to a data length smaller than what we have already consumed. VerifyOrExit(reader.OctetsRead() <= mRxFragmentSize, err = BLE_ERROR_REASSEMBLER_INCORRECT_STATE); data->SetDataLength(chip::min(data->DataLength(), mRxFragmentSize)); @@ -483,11 +451,6 @@ bool BtpEngine::HandleCharacteristicSend(System::PacketBufferHandle data, bool s uint8_t cursor = 1; // first position past header flags byte BitFlags headerFlags(HeaderFlags::kStartMessage); -#if CHIP_ENABLE_CHIPOBLE_TEST - if (TxPacketType() == kType_Control) - headerFlags.Set(HeaderFlags::kCommandMessage); -#endif - if (send_ack) { headerFlags.Set(HeaderFlags::kFragmentAck); @@ -536,11 +499,6 @@ bool BtpEngine::HandleCharacteristicSend(System::PacketBufferHandle data, bool s BitFlags headerFlags(HeaderFlags::kContinueMessage); -#if CHIP_ENABLE_CHIPOBLE_TEST - if (TxPacketType() == kType_Control) - headerFlags.Set(HeaderFlags::kCommandMessage); -#endif - if (send_ack) { headerFlags.Set(HeaderFlags::kFragmentAck); diff --git a/src/ble/BtpEngine.h b/src/ble/BtpEngine.h index 2055c2a9c1cfbb..0e1ed33789f513 100644 --- a/src/ble/BtpEngine.h +++ b/src/ble/BtpEngine.h @@ -39,7 +39,7 @@ namespace chip { namespace Ble { -inline constexpr size_t kTransferProtocolHeaderFlagsSize = 1; // Size in bytes of enocded BTP fragment header flag bits +inline constexpr size_t kTransferProtocolHeaderFlagsSize = 1; // Size in bytes of encoded BTP fragment header flag bits inline constexpr size_t kTransferProtocolSequenceNumSize = 1; // Size in bytes of encoded BTP sequence number inline constexpr size_t kTransferProtocolAckSize = 1; // Size in bytes of encoded BTP fragment acknowledgement number inline constexpr size_t kTransferProtocolMsgLenSize = 2; // Size in byte of encoded BTP total fragmented message length @@ -56,10 +56,6 @@ using ::chip::System::PacketBufferHandle; typedef uint8_t SequenceNumber_t; // If type changed from uint8_t, adjust assumptions in BtpEngine::IsValidAck and // BLEEndPoint::AdjustReceiveWindow. -#if CHIP_ENABLE_CHIPOBLE_TEST -class BLEEndPoint; -#endif - // Public data members: typedef enum { @@ -69,10 +65,6 @@ typedef enum class BtpEngine { -#if CHIP_ENABLE_CHIPOBLE_TEST - friend class BLEEndPoint; -#endif - public: // Public data members: typedef enum @@ -90,9 +82,6 @@ class BtpEngine kContinueMessage = 0x02, kEndMessage = 0x04, kFragmentAck = 0x08, -#if CHIP_ENABLE_CHIPOBLE_TEST - kCommandMessage = 0x10, -#endif }; static const uint16_t sDefaultFragmentSize; @@ -117,29 +106,6 @@ class BtpEngine inline State_t RxState() { return mRxState; } inline State_t TxState() { return mTxState; } -#if CHIP_ENABLE_CHIPOBLE_TEST - inline PacketType_t SetTxPacketType(PacketType_t type) { return (mTxPacketType = type); } - inline PacketType_t SetRxPacketType(PacketType_t type) { return (mRxPacketType = type); } - inline PacketType_t TxPacketType() { return mTxPacketType; } - inline PacketType_t RxPacketType() { return mRxPacketType; } - inline SequenceNumber_t SetTxPacketSeq(SequenceNumber_t seq) { return (mTxPacketSeq = seq); } - inline SequenceNumber_t SetRxPacketSeq(SequenceNumber_t seq) { return (mRxPacketSeq = seq); } - inline SequenceNumber_t TxPacketSeq() { return mTxPacketSeq; } - inline SequenceNumber_t RxPacketSeq() { return mRxPacketSeq; } - static bool IsCommandPacket(const PacketBufferHandle & p); - inline void PushPacketTag(const PacketBufferHandle & p, PacketType_t type) - { - p->SetStart(p->Start() - sizeof(type)); - memcpy(p->Start(), &type, sizeof(type)); - } - inline PacketType_t PopPacketTag(const PacketBufferHandle & p) - { - PacketType_t type; - memcpy(&type, p->Start(), sizeof(type)); - p->SetStart(p->Start() + sizeof(type)); - return type; - } -#endif // CHIP_ENABLE_CHIPOBLE_TEST bool HasUnackedData() const; @@ -160,12 +126,6 @@ class BtpEngine private: // Private data members: -#if CHIP_ENABLE_CHIPOBLE_TEST - PacketType_t mTxPacketType; - PacketType_t mRxPacketType; - SequenceNumber_t mTxPacketSeq; - SequenceNumber_t mRxPacketSeq; -#endif State_t mRxState; uint16_t mRxLength; void * mAppState; diff --git a/src/ble/tests/TestBleErrorStr.cpp b/src/ble/tests/TestBleErrorStr.cpp index 34123c17803c58..1dcb30e6e9878d 100644 --- a/src/ble/tests/TestBleErrorStr.cpp +++ b/src/ble/tests/TestBleErrorStr.cpp @@ -37,9 +37,7 @@ using namespace chip; // Test input data. -// clang-format off -static const CHIP_ERROR kTestElements[] = -{ +static const CHIP_ERROR kTestElements[] = { BLE_ERROR_ADAPTER_UNAVAILABLE, BLE_ERROR_NO_CONNECTION_RECEIVED_CALLBACK, BLE_ERROR_CENTRAL_UNSUBSCRIBED, @@ -66,7 +64,6 @@ static const CHIP_ERROR kTestElements[] = BLE_ERROR_INVALID_BTP_SEQUENCE_NUMBER, BLE_ERROR_REASSEMBLER_INCORRECT_STATE, }; -// clang-format on TEST(TestBleErrorStr, CheckBleErrorStr) { From bc9fc76a1f8e95c54730f6233617db28a4842c01 Mon Sep 17 00:00:00 2001 From: Jaehoon-You <55170115+Jaehoon-You@users.noreply.github.com> Date: Wed, 10 Apr 2024 01:12:08 +0900 Subject: [PATCH 11/11] virtual-device-app: Enable WindowCovering cluster (#32906) Signed-off-by: Jaehoon You Signed-off-by: Charles Kim --- .../virtual-device-app.matter | 192 +++++++ .../virtual-device-app.zap | 516 ++++++++++++++++++ 2 files changed, 708 insertions(+) diff --git a/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter b/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter index a190ff6d15e4ab..12ca71b573185f 100644 --- a/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter +++ b/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter @@ -2688,6 +2688,159 @@ cluster DoorLock = 257 { timed command access(invoke: administer) ClearAliroReaderConfig(): DefaultSuccess = 41; } +/** Provides an interface for controlling and adjusting automatic window coverings. */ +cluster WindowCovering = 258 { + revision 5; + + enum EndProductType : enum8 { + kRollerShade = 0; + kRomanShade = 1; + kBalloonShade = 2; + kWovenWood = 3; + kPleatedShade = 4; + kCellularShade = 5; + kLayeredShade = 6; + kLayeredShade2D = 7; + kSheerShade = 8; + kTiltOnlyInteriorBlind = 9; + kInteriorBlind = 10; + kVerticalBlindStripCurtain = 11; + kInteriorVenetianBlind = 12; + kExteriorVenetianBlind = 13; + kLateralLeftCurtain = 14; + kLateralRightCurtain = 15; + kCentralCurtain = 16; + kRollerShutter = 17; + kExteriorVerticalScreen = 18; + kAwningTerracePatio = 19; + kAwningVerticalScreen = 20; + kTiltOnlyPergola = 21; + kSwingingShutter = 22; + kSlidingShutter = 23; + kUnknown = 255; + } + + enum Type : enum8 { + kRollerShade = 0; + kRollerShade2Motor = 1; + kRollerShadeExterior = 2; + kRollerShadeExterior2Motor = 3; + kDrapery = 4; + kAwning = 5; + kShutter = 6; + kTiltBlindTiltOnly = 7; + kTiltBlindLiftAndTilt = 8; + kProjectorScreen = 9; + kUnknown = 255; + } + + bitmap ConfigStatus : bitmap8 { + kOperational = 0x1; + kOnlineReserved = 0x2; + kLiftMovementReversed = 0x4; + kLiftPositionAware = 0x8; + kTiltPositionAware = 0x10; + kLiftEncoderControlled = 0x20; + kTiltEncoderControlled = 0x40; + } + + bitmap Feature : bitmap32 { + kLift = 0x1; + kTilt = 0x2; + kPositionAwareLift = 0x4; + kAbsolutePosition = 0x8; + kPositionAwareTilt = 0x10; + } + + bitmap Mode : bitmap8 { + kMotorDirectionReversed = 0x1; + kCalibrationMode = 0x2; + kMaintenanceMode = 0x4; + kLedFeedback = 0x8; + } + + bitmap OperationalStatus : bitmap8 { + kGlobal = 0x3; + kLift = 0xC; + kTilt = 0x30; + } + + bitmap SafetyStatus : bitmap16 { + kRemoteLockout = 0x1; + kTamperDetection = 0x2; + kFailedCommunication = 0x4; + kPositionFailure = 0x8; + kThermalProtection = 0x10; + kObstacleDetected = 0x20; + kPower = 0x40; + kStopInput = 0x80; + kMotorJammed = 0x100; + kHardwareFailure = 0x200; + kManualOperation = 0x400; + kProtection = 0x800; + } + + readonly attribute Type type = 0; + readonly attribute optional int16u physicalClosedLimitLift = 1; + readonly attribute optional int16u physicalClosedLimitTilt = 2; + readonly attribute optional nullable int16u currentPositionLift = 3; + readonly attribute optional nullable int16u currentPositionTilt = 4; + readonly attribute optional int16u numberOfActuationsLift = 5; + readonly attribute optional int16u numberOfActuationsTilt = 6; + readonly attribute ConfigStatus configStatus = 7; + readonly attribute optional nullable percent currentPositionLiftPercentage = 8; + readonly attribute optional nullable percent currentPositionTiltPercentage = 9; + readonly attribute OperationalStatus operationalStatus = 10; + readonly attribute optional nullable percent100ths targetPositionLiftPercent100ths = 11; + readonly attribute optional nullable percent100ths targetPositionTiltPercent100ths = 12; + readonly attribute EndProductType endProductType = 13; + readonly attribute optional nullable percent100ths currentPositionLiftPercent100ths = 14; + readonly attribute optional nullable percent100ths currentPositionTiltPercent100ths = 15; + readonly attribute optional int16u installedOpenLimitLift = 16; + readonly attribute optional int16u installedClosedLimitLift = 17; + readonly attribute optional int16u installedOpenLimitTilt = 18; + readonly attribute optional int16u installedClosedLimitTilt = 19; + attribute access(write: manage) Mode mode = 23; + readonly attribute optional SafetyStatus safetyStatus = 26; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct GoToLiftValueRequest { + int16u liftValue = 0; + } + + request struct GoToLiftPercentageRequest { + percent100ths liftPercent100thsValue = 0; + } + + request struct GoToTiltValueRequest { + int16u tiltValue = 0; + } + + request struct GoToTiltPercentageRequest { + percent100ths tiltPercent100thsValue = 0; + } + + /** Moves window covering to InstalledOpenLimitLift and InstalledOpenLimitTilt */ + command UpOrOpen(): DefaultSuccess = 0; + /** Moves window covering to InstalledClosedLimitLift and InstalledCloseLimitTilt */ + command DownOrClose(): DefaultSuccess = 1; + /** Stop any adjusting of window covering */ + command StopMotion(): DefaultSuccess = 2; + /** Go to lift value specified */ + command GoToLiftValue(GoToLiftValueRequest): DefaultSuccess = 4; + /** Go to lift percentage specified */ + command GoToLiftPercentage(GoToLiftPercentageRequest): DefaultSuccess = 5; + /** Go to tilt value specified */ + command GoToTiltValue(GoToTiltValueRequest): DefaultSuccess = 7; + /** Go to tilt percentage specified */ + command GoToTiltPercentage(GoToTiltPercentageRequest): DefaultSuccess = 8; +} + /** Attributes and commands for controlling the color properties of a color-capable light. */ cluster ColorControl = 768 { revision 6; @@ -3505,6 +3658,45 @@ endpoint 1 { handle command ClearCredential; } + server cluster WindowCovering { + ram attribute type default = 0x00; + ram attribute physicalClosedLimitLift default = 0x0000; + ram attribute physicalClosedLimitTilt default = 0x0000; + ram attribute currentPositionLift; + ram attribute currentPositionTilt; + ram attribute numberOfActuationsLift default = 0x0000; + ram attribute numberOfActuationsTilt default = 0x0000; + ram attribute configStatus default = 0x03; + ram attribute currentPositionLiftPercentage; + ram attribute currentPositionTiltPercentage; + ram attribute operationalStatus default = 0x00; + ram attribute targetPositionLiftPercent100ths; + ram attribute targetPositionTiltPercent100ths; + ram attribute endProductType default = 0x00; + ram attribute currentPositionLiftPercent100ths; + ram attribute currentPositionTiltPercent100ths; + ram attribute installedOpenLimitLift default = 0x0000; + ram attribute installedClosedLimitLift default = 0xFFFF; + ram attribute installedOpenLimitTilt default = 0x0000; + ram attribute installedClosedLimitTilt default = 0xFFFF; + ram attribute mode default = 0x00; + ram attribute safetyStatus default = 0x0000; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 5; + + handle command UpOrOpen; + handle command DownOrClose; + handle command StopMotion; + handle command GoToLiftValue; + handle command GoToLiftPercentage; + handle command GoToTiltValue; + handle command GoToTiltPercentage; + } + server cluster ColorControl { ram attribute currentHue default = 0x00; ram attribute currentSaturation default = 0x00; diff --git a/examples/virtual-device-app/virtual-device-common/virtual-device-app.zap b/examples/virtual-device-app/virtual-device-common/virtual-device-app.zap index 144c21afd7d90b..af20ff3733f846 100644 --- a/examples/virtual-device-app/virtual-device-common/virtual-device-app.zap +++ b/examples/virtual-device-app/virtual-device-common/virtual-device-app.zap @@ -5748,6 +5748,522 @@ } ] }, + { + "name": "Window Covering", + "code": 258, + "mfgCode": null, + "define": "WINDOW_COVERING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "UpOrOpen", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "DownOrClose", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "StopMotion", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "GoToLiftValue", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "GoToLiftPercentage", + "code": 5, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "GoToTiltValue", + "code": 7, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "GoToTiltPercentage", + "code": 8, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "Type", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "Type", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PhysicalClosedLimitLift", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PhysicalClosedLimitTilt", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentPositionLift", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentPositionTilt", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NumberOfActuationsLift", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NumberOfActuationsTilt", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ConfigStatus", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "ConfigStatus", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x03", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentPositionLiftPercentage", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "percent", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentPositionTiltPercentage", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "percent", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OperationalStatus", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "OperationalStatus", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TargetPositionLiftPercent100ths", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "percent100ths", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TargetPositionTiltPercent100ths", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "percent100ths", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EndProductType", + "code": 13, + "mfgCode": null, + "side": "server", + "type": "EndProductType", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentPositionLiftPercent100ths", + "code": 14, + "mfgCode": null, + "side": "server", + "type": "percent100ths", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentPositionTiltPercent100ths", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "percent100ths", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "InstalledOpenLimitLift", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "InstalledClosedLimitLift", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFFFF", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "InstalledOpenLimitTilt", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "InstalledClosedLimitTilt", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFFFF", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Mode", + "code": 23, + "mfgCode": null, + "side": "server", + "type": "Mode", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SafetyStatus", + "code": 26, + "mfgCode": null, + "side": "server", + "type": "SafetyStatus", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, { "name": "Color Control", "code": 768,