From 42510baf9cf8d6a04b3f2796e020ba024e11a38c Mon Sep 17 00:00:00 2001 From: Erwin Pan Date: Mon, 27 May 2024 22:27:46 +0800 Subject: [PATCH 01/43] [Chef] Add 2 Generic Switch devices and RPC Actions for Testing (#33255) * Add RPC Event Service draft * Commit the draft to add_event in post attr change Commit the draft to add_event in post attribute change callback * Add PreAttributeChangeCallback * Support write events as string through RPC * Revert Chef stubs.cpp to not using AttributeDelegate * RPC can call delegate to SwitchManager/EventHandler * Rmove ununsed RPC command delegate * Rename RPC Event to RPC Actions * Simplify RPC code by setting transparent subscribe * Chef RPC Actions Draft done. TBD: Debug Optimize Error code Confirm timer is ms * Fix timer bug, remove unused comments * Add Latching Switch taglist to Descriptor Cluster * Cross platform built on ESP32/nRFConnect done And also enable the ApplicationInit * Update Generic Switch 1 * Add 2nd Generic Switch * Add chef/common/chef-descriptor-namespace.h * Remote printf * Remove TODO * Remove unused comments * Restyled by whitespace * Restyled by clang-format * Fix according to PR comments https://github.com/project-chip/connectedhomeip/pull/33255 * Restyled by clang-format * Fix compilation issues * Remove unused debugging codes --------- Co-authored-by: Restyled.io --- .../chef/common/chef-descriptor-namespace.h | 51 + .../chef/common/chef-rpc-actions-worker.cpp | 158 + .../chef/common/chef-rpc-actions-worker.h | 79 + .../clusters/switch/SwitchEventHandler.cpp | 82 + .../clusters/switch/SwitchEventHandler.h | 80 + .../common/clusters/switch/SwitchManager.cpp | 172 + examples/chef/common/stubs.cpp | 10 + .../rootnode_genericswitch_2dfff6e516.matter | 1498 +++++++++ .../rootnode_genericswitch_2dfff6e516.zap | 2804 +++++++++++++++++ .../rootnode_genericswitch_9866e35d0b.matter | 285 +- .../rootnode_genericswitch_9866e35d0b.zap | 345 +- examples/chef/esp32/main/CMakeLists.txt | 1 + examples/chef/esp32/main/main.cpp | 6 + examples/chef/linux/BUILD.gn | 5 + examples/chef/linux/main.cpp | 4 - examples/chef/nrfconnect/CMakeLists.txt | 2 + examples/chef/nrfconnect/main.cpp | 9 + examples/common/pigweed/BUILD.gn | 8 + .../pigweed/protos/actions_service.options | 1 + .../pigweed/protos/actions_service.proto | 30 + .../common/pigweed/rpc_console/py/BUILD.gn | 1 + .../rpc_console/py/chip_rpc/console.py | 2 + .../common/pigweed/rpc_services/Actions.h | 127 + examples/platform/esp32/Rpc.cpp | 27 + examples/platform/esp32/Rpc.h | 12 + examples/platform/linux/Rpc.cpp | 23 + examples/platform/linux/Rpc.h | 15 + examples/platform/nrfconnect/Rpc.cpp | 31 + examples/platform/nrfconnect/Rpc.h | 12 + 29 files changed, 5872 insertions(+), 8 deletions(-) create mode 100644 examples/chef/common/chef-descriptor-namespace.h create mode 100644 examples/chef/common/chef-rpc-actions-worker.cpp create mode 100644 examples/chef/common/chef-rpc-actions-worker.h create mode 100644 examples/chef/common/clusters/switch/SwitchEventHandler.cpp create mode 100644 examples/chef/common/clusters/switch/SwitchEventHandler.h create mode 100644 examples/chef/common/clusters/switch/SwitchManager.cpp create mode 100644 examples/chef/devices/rootnode_genericswitch_2dfff6e516.matter create mode 100644 examples/chef/devices/rootnode_genericswitch_2dfff6e516.zap create mode 100644 examples/common/pigweed/protos/actions_service.options create mode 100644 examples/common/pigweed/protos/actions_service.proto create mode 100644 examples/common/pigweed/rpc_services/Actions.h diff --git a/examples/chef/common/chef-descriptor-namespace.h b/examples/chef/common/chef-descriptor-namespace.h new file mode 100644 index 00000000000000..e7e8e85df5a551 --- /dev/null +++ b/examples/chef/common/chef-descriptor-namespace.h @@ -0,0 +1,51 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +// Please refer to https://github.com/CHIP-Specifications/connectedhomeip-spec/blob/master/src/namespaces +constexpr const uint8_t kNamespaceCommonLevel = 5; +// Common Number Namespace: 5, tag 0 (Low) +constexpr const uint8_t kTagCommonLow = 0; +// Common Number Namespace: 5, tag 1 (Medium) +constexpr const uint8_t kTagCommonMedium = 1; +// Common Number Namespace: 5, tag 2 (High) +constexpr const uint8_t kTagCommonHigh = 2; + +constexpr const uint8_t kNamespaceCommonNumber = 7; +// Common Number Namespace: 7, tag 0 (Zero) +constexpr const uint8_t kTagCommonZero = 0; +// Common Number Namespace: 7, tag 1 (One) +constexpr const uint8_t kTagCommonOne = 1; +// Common Number Namespace: 7, tag 2 (Two) +constexpr const uint8_t kTagCommonTwo = 2; + +constexpr const uint8_t kNamespacePosition = 8; +// Common Position Namespace: 8, tag: 0 (Left) +constexpr const uint8_t kTagPositionLeft = 0; +// Common Position Namespace: 8, tag: 1 (Right) +constexpr const uint8_t kTagPositionRight = 1; +// Common Position Namespace: 8, tag: 2 (Top) +constexpr const uint8_t kTagPositionTop = 2; +// Common Position Namespace: 8, tag: 3 (Bottom) +constexpr const uint8_t kTagPositionBottom = 3; +// Common Position Namespace: 8, tag: 4 (Middle) +constexpr const uint8_t kTagPositionMiddle = 4; +// Common Position Namespace: 8, tag: 5 (Row) +constexpr const uint8_t kTagPositionRow = 5; +// Common Position Namespace: 8, tag: 6 (Column) +constexpr const uint8_t kTagPositionColumn = 6; diff --git a/examples/chef/common/chef-rpc-actions-worker.cpp b/examples/chef/common/chef-rpc-actions-worker.cpp new file mode 100644 index 00000000000000..98bba768e7f4d8 --- /dev/null +++ b/examples/chef/common/chef-rpc-actions-worker.cpp @@ -0,0 +1,158 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "chef-rpc-actions-worker.h" +#include +#include +#include +#include +#include +#include +#include + +using chip::app::DataModel::Nullable; + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; +using namespace chip::rpc; + +static std::map gActionsDelegateMap{}; + +ActionsDelegate * RpcFindActionsDelegate(ClusterId clusterId) +{ + if (gActionsDelegateMap.find(clusterId) != gActionsDelegateMap.end()) + { + return gActionsDelegateMap[clusterId]; + } + + return nullptr; +} + +static void RpcActionsTaskCallback(System::Layer * systemLayer, void * data) +{ + ChefRpcActionsWorker * worker = (ChefRpcActionsWorker *) data; + + worker->ProcessActionQueue(); +} + +bool ChefRpcActionsCallback(EndpointId endpointId, ClusterId clusterId, uint8_t type, uint32_t delayMs, uint32_t actionId, + std::vector args) +{ + ActionTask task(endpointId, clusterId, static_cast(type), delayMs, actionId, args); + + return ChefRpcActionsWorker::Instance().EnqueueAction(task); +} + +bool ChefRpcActionsWorker::EnqueueAction(ActionTask task) +{ + bool kickTimer = false; + + if (queue.empty()) + { + kickTimer = true; // kick timer when the first task is adding to the queue + } + + queue.push(task); + + if (kickTimer) + { + (void) DeviceLayer::SystemLayer().StartTimer(System::Clock::Milliseconds32(task.delayMs), RpcActionsTaskCallback, this); + } + return true; +} + +void ChefRpcActionsWorker::ProcessActionQueue() +{ + // Dequeue the first item + ActionTask task = queue.front(); + queue.pop(); + + ActionsDelegate * delegate = RpcFindActionsDelegate(task.clusterId); + if (nullptr == delegate) + { + ChipLogError(NotSpecified, + "Cannot run action due to not finding delegate: endpointId=%d, clusterId=%04lx, attributeId=%04lx", + task.endpointId, static_cast(task.clusterId), static_cast(task.actionId)); + return; + } + + ActionType type = static_cast(task.type); + + switch (type) + { + case ActionType::WRITE_ATTRIBUTE: { + ChipLogProgress(NotSpecified, "Writing Attribute: endpointId=%d, clusterId=%04lx, attributeId=%04lx, args.size=%lu", + task.endpointId, static_cast(task.clusterId), static_cast(task.actionId), + static_cast(task.args.size())); + delegate->AttributeWriteHandler(task.endpointId, static_cast(task.actionId), task.args); + } + break; + case ActionType::RUN_COMMAND: { + ChipLogProgress(NotSpecified, "Running Command: endpointId=%d, clusterId=%04lx, commandId=%04lx, args.size=%lu", + task.endpointId, static_cast(task.clusterId), static_cast(task.actionId), + static_cast(task.args.size())); + delegate->CommandHandler(task.endpointId, static_cast(task.actionId), task.args); + } + break; + case ActionType::EMIT_EVENT: { + ChipLogProgress(NotSpecified, "Emitting Event: endpointId=%d, clusterId=%04lx, eventIdId=%04lx, args.size=%lu", + task.endpointId, static_cast(task.clusterId), static_cast(task.actionId), + static_cast(task.args.size())); + delegate->EventHandler(task.endpointId, static_cast(task.actionId), task.args); + } + break; + default: + break; + } + + if (queue.empty()) + { + // Return due to no more actions in queue + return; + } + + // Run next action + task = queue.front(); + ChipLogProgress(NotSpecified, "StartTimer: endpointId=%d, clusterId=%04lx, eventIdId=%04lx, task.delyMs=%lu", task.endpointId, + static_cast(task.clusterId), static_cast(task.actionId), + static_cast(task.delayMs)); + (void) DeviceLayer::SystemLayer().StartTimer(System::Clock::Milliseconds32(task.delayMs), RpcActionsTaskCallback, this); +} + +void ChefRpcActionsWorker::RegisterRpcActionsDelegate(ClusterId clusterId, ActionsDelegate * delegate) +{ + // Register by cluster + if (nullptr == RpcFindActionsDelegate(clusterId)) + { + gActionsDelegateMap[clusterId] = delegate; + return; + } +} + +ChefRpcActionsWorker::ChefRpcActionsWorker() +{ + chip::rpc::SubscribeActions(ChefRpcActionsCallback); +} + +static ChefRpcActionsWorker instance; + +ChefRpcActionsWorker & ChefRpcActionsWorker::Instance() +{ + return instance; +} diff --git a/examples/chef/common/chef-rpc-actions-worker.h b/examples/chef/common/chef-rpc-actions-worker.h new file mode 100644 index 00000000000000..3ca16f4c8a716e --- /dev/null +++ b/examples/chef/common/chef-rpc-actions-worker.h @@ -0,0 +1,79 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include +#include +#include + +#include "Rpc.h" + +namespace chip { +namespace app { + +class ActionsDelegate +{ +public: + ActionsDelegate(ClusterId clusterId) : mClusterId(clusterId){}; + + virtual ~ActionsDelegate() = default; + + virtual void AttributeWriteHandler(chip::EndpointId endpointId, chip::AttributeId attributeId, std::vector args) = 0; + virtual void CommandHandler(chip::EndpointId endpointId, chip::CommandId commandId, std::vector args) = 0; + virtual void EventHandler(chip::EndpointId endpointId, chip::EventId eventId, std::vector args) = 0; + +protected: + ClusterId mClusterId; +}; + +struct ActionTask +{ + chip::EndpointId endpointId; + chip::ClusterId clusterId; + chip::rpc::ActionType type; // Aligned with Storage buf + uint32_t delayMs; + uint32_t actionId; + std::vector args; + ActionTask(chip::EndpointId endpoint, chip::ClusterId cluster, chip::rpc::ActionType actionType, uint32_t delay, uint32_t id, + std::vector arg) : + endpointId(endpoint), + clusterId(cluster), type(actionType), delayMs(delay), actionId(id), args(arg){}; + ~ActionTask(){}; +}; + +class ChefRpcActionsWorker +{ +public: + static ChefRpcActionsWorker & Instance(); + + ChefRpcActionsWorker(); + + bool EnqueueAction(ActionTask task); + void ProcessActionQueue(); + void RegisterRpcActionsDelegate(ClusterId clusterId, ActionsDelegate * delegate); + +private: + std::queue queue; +}; + +} // namespace app +} // namespace chip diff --git a/examples/chef/common/clusters/switch/SwitchEventHandler.cpp b/examples/chef/common/clusters/switch/SwitchEventHandler.cpp new file mode 100644 index 00000000000000..dd32e2b907bb5a --- /dev/null +++ b/examples/chef/common/clusters/switch/SwitchEventHandler.cpp @@ -0,0 +1,82 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#ifdef MATTER_DM_PLUGIN_SWITCH_SERVER +#include +#include +#include +#include + +#include "SwitchEventHandler.h" + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::Switch; +using namespace chip::DeviceLayer; + +void SwitchEventHandler::OnSwitchLatched(EndpointId endpointId, uint8_t newPosition) +{ + ChipLogDetail(NotSpecified, "%s: endpointId=%d, newPosition=%d", __func__, endpointId, newPosition); + + Clusters::SwitchServer::Instance().OnSwitchLatch(endpointId, newPosition); +} + +void SwitchEventHandler::OnInitialPress(EndpointId endpointId, uint8_t newPosition) +{ + ChipLogDetail(NotSpecified, "%s: endpointId=%d, newPosition=%d", __func__, endpointId, newPosition); + + Clusters::SwitchServer::Instance().OnInitialPress(endpointId, newPosition); +} + +void SwitchEventHandler::OnLongPress(EndpointId endpointId, uint8_t newPosition) +{ + ChipLogDetail(NotSpecified, "%s: endpointId=%d, newPosition=%d", __func__, endpointId, newPosition); + + Clusters::SwitchServer::Instance().OnLongPress(endpointId, newPosition); +} + +void SwitchEventHandler::OnShortRelease(EndpointId endpointId, uint8_t previousPosition) +{ + ChipLogDetail(NotSpecified, "%s: endpointId=%d, previousPosition=%d", __func__, endpointId, previousPosition); + + Clusters::SwitchServer::Instance().OnShortRelease(endpointId, previousPosition); +} + +void SwitchEventHandler::OnLongRelease(EndpointId endpointId, uint8_t previousPosition) +{ + ChipLogDetail(NotSpecified, "%s: endpointId=%d, previousPosition=%d", __func__, endpointId, previousPosition); + + Clusters::SwitchServer::Instance().OnLongRelease(endpointId, previousPosition); +} + +void SwitchEventHandler::OnMultiPressOngoing(EndpointId endpointId, uint8_t newPosition, uint8_t count) +{ + ChipLogDetail(NotSpecified, "%s: endpointId=%d, newPosition=%d, count=%d", __func__, endpointId, newPosition, count); + + Clusters::SwitchServer::Instance().OnMultiPressOngoing(endpointId, newPosition, count); +} + +void SwitchEventHandler::OnMultiPressComplete(EndpointId endpointId, uint8_t previousPosition, uint8_t count) +{ + ChipLogDetail(NotSpecified, "%s: endpointId=%d, previousPosition=%d, count=%d", __func__, endpointId, previousPosition, count); + + Clusters::SwitchServer::Instance().OnMultiPressComplete(endpointId, previousPosition, count); +} +#endif // MATTER_DM_PLUGIN_SWITCH_SERVER diff --git a/examples/chef/common/clusters/switch/SwitchEventHandler.h b/examples/chef/common/clusters/switch/SwitchEventHandler.h new file mode 100644 index 00000000000000..1648e19cc829c5 --- /dev/null +++ b/examples/chef/common/clusters/switch/SwitchEventHandler.h @@ -0,0 +1,80 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include + +#include + +namespace chip { +namespace app { +namespace Clusters { + +namespace Switch { + +class SwitchEventHandler +{ +public: + SwitchEventHandler(){}; + + /** + * Should be called when the latching switch is moved to a new position. + */ + void OnSwitchLatched(EndpointId endpointId, uint8_t newPosition); + + /** + * Should be called when the momentary switch starts to be pressed. + */ + void OnInitialPress(EndpointId endpointId, uint8_t newPosition); + + /** + * Should be called when the momentary switch has been pressed for a "long" time. + */ + void OnLongPress(EndpointId endpointId, uint8_t newPosition); + + /** + * Should be called when the momentary switch has been released. + */ + void OnShortRelease(EndpointId endpointId, uint8_t previousPosition); + + /** + * Should be called when the momentary switch has been released after having been pressed for a long time. + */ + void OnLongRelease(EndpointId endpointId, uint8_t previousPosition); + + /** + * Should be called to indicate how many times the momentary switch has been pressed in a multi-press + * sequence, during that sequence. + */ + void OnMultiPressOngoing(EndpointId endpointId, uint8_t newPosition, uint8_t count); + + /** + * Should be called to indicate how many times the momentary switch has been pressed in a multi-press + * sequence, after it has been detected that the sequence has ended. + */ + void OnMultiPressComplete(EndpointId endpointId, uint8_t previousPosition, uint8_t count); + +private: +}; + +} // namespace Switch +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/examples/chef/common/clusters/switch/SwitchManager.cpp b/examples/chef/common/clusters/switch/SwitchManager.cpp new file mode 100644 index 00000000000000..45d39dd4bce1a4 --- /dev/null +++ b/examples/chef/common/clusters/switch/SwitchManager.cpp @@ -0,0 +1,172 @@ +/* + * + * Copyright (c) 2022 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. + */ + +#ifdef MATTER_DM_PLUGIN_SWITCH_SERVER +#include "SwitchEventHandler.h" +#include +#include +#include +#include +#include +#include + +#include "chef-descriptor-namespace.h" +#include "chef-rpc-actions-worker.h" + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::Switch; +using namespace chip::DeviceLayer; + +using namespace chip::rpc; +using namespace chip::app; + +class SwitchActionsDelegate : public chip::app::ActionsDelegate +{ +public: + SwitchActionsDelegate(ClusterId clusterId, SwitchEventHandler * eventHandler) : + ActionsDelegate(clusterId), mEventHandler(eventHandler){}; + ~SwitchActionsDelegate() override{}; + + void AttributeWriteHandler(chip::EndpointId endpointId, chip::AttributeId attributeId, std::vector args) override; + void CommandHandler(chip::EndpointId endpointId, chip::AttributeId attributeId, std::vector args) override{}; + void EventHandler(chip::EndpointId endpointId, chip::EventId eventId, std::vector args) override; + +private: + SwitchEventHandler * mEventHandler; +}; + +void SwitchActionsDelegate::AttributeWriteHandler(chip::EndpointId endpointId, chip::AttributeId attributeId, + std::vector args) +{ + if (args.empty()) + { + ChipLogError(NotSpecified, "Queue is empty "); + return; + } + + switch (attributeId) + { + case Switch::Attributes::NumberOfPositions::Id: { + uint8_t data = static_cast(args[0]); + app::Clusters::Switch::Attributes::NumberOfPositions::Set(endpointId, data); + } + break; + case Switch::Attributes::CurrentPosition::Id: { + uint8_t data = static_cast(args[0]); + app::Clusters::Switch::Attributes::CurrentPosition::Set(endpointId, data); + } + break; + case Switch::Attributes::MultiPressMax::Id: { + uint8_t data = static_cast(args[0]); + app::Clusters::Switch::Attributes::MultiPressMax::Set(endpointId, data); + } + break; + default: + break; + } +} + +void SwitchActionsDelegate::EventHandler(chip::EndpointId endpointId, chip::EventId eventId, std::vector args) +{ + if (args.empty()) + { + ChipLogError(NotSpecified, "Queue is empty "); + return; + } + switch (eventId) + { + case Events::SwitchLatched::Id: { + uint8_t newPosition = static_cast(args[0]); + mEventHandler->OnSwitchLatched(endpointId, newPosition); + } + break; + case Events::InitialPress::Id: { + uint8_t newPosition = static_cast(args[0]); + mEventHandler->OnInitialPress(endpointId, newPosition); + } + break; + case Events::LongPress::Id: { + uint8_t newPosition = static_cast(args[0]); + mEventHandler->OnLongPress(endpointId, newPosition); + } + break; + case Events::ShortRelease::Id: { + uint8_t previousPosition = static_cast(args[0]); + mEventHandler->OnShortRelease(endpointId, previousPosition); + } + break; + case Events::LongRelease::Id: { + uint8_t previousPosition = static_cast(args[0]); + mEventHandler->OnLongRelease(endpointId, previousPosition); + } + break; + case Events::MultiPressOngoing::Id: { + if (args.size() < 2) + { + ChipLogError(NotSpecified, "MultiPressOngoing has too few arguments"); + return; + } + uint8_t newPosition = static_cast(args[0]); + uint8_t currentNumberOfPressesCounted = static_cast(args[1]); + mEventHandler->OnMultiPressOngoing(endpointId, newPosition, currentNumberOfPressesCounted); + } + break; + case Events::MultiPressComplete::Id: { + if (args.size() < 2) + { + ChipLogError(NotSpecified, "MultiPressComplete has too few arguments"); + return; + } + uint8_t previousPosition = static_cast(args[0]); + uint8_t totalNumberOfPressesCounted = static_cast(args[1]); + mEventHandler->OnMultiPressComplete(endpointId, previousPosition, totalNumberOfPressesCounted); + } + break; + default: + break; + } +}; + +const Clusters::Descriptor::Structs::SemanticTagStruct::Type gLatchingSwitch[] = { + { .namespaceID = kNamespaceCommonLevel, + .tag = kTagCommonLow, + .label = chip::Optional>( + { chip::app::DataModel::MakeNullable(chip::CharSpan("Low", 3)) }) }, + { .namespaceID = kNamespaceCommonLevel, + .tag = kTagCommonMedium, + .label = chip::Optional>( + { chip::app::DataModel::MakeNullable(chip::CharSpan("Medium", 6)) }) }, + { .namespaceID = kNamespaceCommonLevel, + .tag = kTagCommonHigh, + .label = chip::Optional>( + { chip::app::DataModel::MakeNullable(chip::CharSpan("High", 4)) }) } +}; + +static SwitchEventHandler * gSwitchEventHandler = new SwitchEventHandler(); +static SwitchActionsDelegate * gSwitchActionsDelegate = new SwitchActionsDelegate(Clusters::Switch::Id, gSwitchEventHandler); + +void emberAfSwitchClusterInitCallback(EndpointId endpointId) +{ + ChipLogProgress(Zcl, "Chef: emberAfSwitchClusterInitCallback"); + + ChefRpcActionsWorker::Instance().RegisterRpcActionsDelegate(Clusters::Switch::Id, gSwitchActionsDelegate); + SetTagList(/* endpoint= */ 1, Span(gLatchingSwitch)); +} +#endif // MATTER_DM_PLUGIN_SWITCH_SERVER diff --git a/examples/chef/common/stubs.cpp b/examples/chef/common/stubs.cpp index 5756aaa35b7e26..437dfe9e6221be 100644 --- a/examples/chef/common/stubs.cpp +++ b/examples/chef/common/stubs.cpp @@ -236,6 +236,16 @@ void emberAfWakeOnLanClusterInitCallback(EndpointId endpoint) } #endif +void ApplicationInit() +{ + ChipLogProgress(NotSpecified, "Chef Application Init !!!") +} + +void ApplicationShutdown() +{ + ChipLogProgress(NotSpecified, "Chef Application Down !!!") +} + // No-op function, used to force linking this file, // instead of the weak functions from other files extern "C" void chef_include_stubs_impl(void) {} diff --git a/examples/chef/devices/rootnode_genericswitch_2dfff6e516.matter b/examples/chef/devices/rootnode_genericswitch_2dfff6e516.matter new file mode 100644 index 00000000000000..89319a4b61b4e2 --- /dev/null +++ b/examples/chef/devices/rootnode_genericswitch_2dfff6e516.matter @@ -0,0 +1,1498 @@ +// This IDL was generated automatically by ZAP. +// It is for view/code review purposes only. + +/** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ +cluster Identify = 3 { + revision 4; + + enum EffectIdentifierEnum : enum8 { + kBlink = 0; + kBreathe = 1; + kOkay = 2; + kChannelChange = 11; + kFinishEffect = 254; + kStopEffect = 255; + } + + enum EffectVariantEnum : enum8 { + kDefault = 0; + } + + enum IdentifyTypeEnum : enum8 { + kNone = 0; + kLightOutput = 1; + kVisibleIndicator = 2; + kAudibleBeep = 3; + kDisplay = 4; + kActuator = 5; + } + + attribute int16u identifyTime = 0; + readonly attribute IdentifyTypeEnum identifyType = 1; + 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 IdentifyRequest { + int16u identifyTime = 0; + } + + request struct TriggerEffectRequest { + EffectIdentifierEnum effectIdentifier = 0; + EffectVariantEnum effectVariant = 1; + } + + /** Command description for Identify */ + command access(invoke: manage) Identify(IdentifyRequest): DefaultSuccess = 0; + /** Command description for TriggerEffect */ + command access(invoke: manage) TriggerEffect(TriggerEffectRequest): DefaultSuccess = 64; +} + +/** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ +cluster Descriptor = 29 { + revision 2; + + bitmap Feature : bitmap32 { + kTagList = 0x1; + } + + struct DeviceTypeStruct { + devtype_id deviceType = 0; + int16u revision = 1; + } + + struct SemanticTagStruct { + nullable vendor_id mfgCode = 0; + enum8 namespaceID = 1; + enum8 tag = 2; + optional nullable char_string label = 3; + } + + readonly attribute DeviceTypeStruct deviceTypeList[] = 0; + readonly attribute cluster_id serverList[] = 1; + readonly attribute cluster_id clientList[] = 2; + readonly attribute endpoint_no partsList[] = 3; + readonly attribute optional SemanticTagStruct tagList[] = 4; + 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; +} + +/** The Access Control Cluster exposes a data model view of a + Node's Access Control List (ACL), which codifies the rules used to manage + and enforce Access Control for the Node's endpoints and their associated + cluster instances. */ +cluster AccessControl = 31 { + revision 1; // NOTE: Default/not specifically set + + enum AccessControlEntryAuthModeEnum : enum8 { + kPASE = 1; + kCASE = 2; + kGroup = 3; + } + + enum AccessControlEntryPrivilegeEnum : enum8 { + kView = 1; + kProxyView = 2; + kOperate = 3; + kManage = 4; + kAdminister = 5; + } + + enum ChangeTypeEnum : enum8 { + kChanged = 0; + kAdded = 1; + kRemoved = 2; + } + + struct AccessControlTargetStruct { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + + fabric_scoped struct AccessControlEntryStruct { + fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; + fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; + nullable fabric_sensitive int64u subjects[] = 3; + nullable fabric_sensitive AccessControlTargetStruct targets[] = 4; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct AccessControlExtensionStruct { + fabric_sensitive octet_string<128> data = 1; + fabric_idx fabricIndex = 254; + } + + fabric_sensitive info event access(read: administer) AccessControlEntryChanged = 0 { + nullable node_id adminNodeID = 1; + nullable int16u adminPasscodeID = 2; + ChangeTypeEnum changeType = 3; + nullable AccessControlEntryStruct latestValue = 4; + fabric_idx fabricIndex = 254; + } + + fabric_sensitive info event access(read: administer) AccessControlExtensionChanged = 1 { + nullable node_id adminNodeID = 1; + nullable int16u adminPasscodeID = 2; + ChangeTypeEnum changeType = 3; + nullable AccessControlExtensionStruct latestValue = 4; + fabric_idx fabricIndex = 254; + } + + attribute access(read: administer, write: administer) AccessControlEntryStruct acl[] = 0; + attribute access(read: administer, write: administer) optional AccessControlExtensionStruct extension[] = 1; + readonly attribute int16u subjectsPerAccessControlEntry = 2; + readonly attribute int16u targetsPerAccessControlEntry = 3; + readonly attribute int16u accessControlEntriesPerFabric = 4; + 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; +} + +/** This cluster provides attributes and events for determining basic information about Nodes, which supports both + Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, + which apply to the whole Node. Also allows setting user device information such as location. */ +cluster BasicInformation = 40 { + revision 3; + + enum ColorEnum : enum8 { + kBlack = 0; + kNavy = 1; + kGreen = 2; + kTeal = 3; + kMaroon = 4; + kPurple = 5; + kOlive = 6; + kGray = 7; + kBlue = 8; + kLime = 9; + kAqua = 10; + kRed = 11; + kFuchsia = 12; + kYellow = 13; + kWhite = 14; + kNickel = 15; + kChrome = 16; + kBrass = 17; + kCopper = 18; + kSilver = 19; + kGold = 20; + } + + enum ProductFinishEnum : enum8 { + kOther = 0; + kMatte = 1; + kSatin = 2; + kPolished = 3; + kRugged = 4; + kFabric = 5; + } + + struct CapabilityMinimaStruct { + int16u caseSessionsPerFabric = 0; + int16u subscriptionsPerFabric = 1; + } + + struct ProductAppearanceStruct { + ProductFinishEnum finish = 0; + nullable ColorEnum primaryColor = 1; + } + + critical event StartUp = 0 { + int32u softwareVersion = 0; + } + + critical event ShutDown = 1 { + } + + info event Leave = 2 { + fabric_idx fabricIndex = 0; + } + + info event ReachableChanged = 3 { + boolean reachableNewValue = 0; + } + + readonly attribute int16u dataModelRevision = 0; + readonly attribute char_string<32> vendorName = 1; + readonly attribute vendor_id vendorID = 2; + readonly attribute char_string<32> productName = 3; + readonly attribute int16u productID = 4; + attribute access(write: manage) char_string<32> nodeLabel = 5; + attribute access(write: administer) char_string<2> location = 6; + readonly attribute int16u hardwareVersion = 7; + readonly attribute char_string<64> hardwareVersionString = 8; + readonly attribute int32u softwareVersion = 9; + readonly attribute char_string<64> softwareVersionString = 10; + readonly attribute optional char_string<16> manufacturingDate = 11; + readonly attribute optional char_string<32> partNumber = 12; + readonly attribute optional long_char_string<256> productURL = 13; + readonly attribute optional char_string<64> productLabel = 14; + readonly attribute optional char_string<32> serialNumber = 15; + attribute access(write: manage) optional boolean localConfigDisabled = 16; + readonly attribute optional boolean reachable = 17; + readonly attribute optional char_string<32> uniqueID = 18; + readonly attribute CapabilityMinimaStruct capabilityMinima = 19; + readonly attribute optional ProductAppearanceStruct productAppearance = 20; + readonly attribute int32u specificationVersion = 21; + readonly attribute int16u maxPathsPerInvoke = 22; + 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; + + command MfgSpecificPing(): DefaultSuccess = 0; +} + +/** This cluster is used to describe the configuration and capabilities of a physical power source that provides power to the Node. */ +cluster PowerSource = 47 { + revision 1; // NOTE: Default/not specifically set + + enum BatApprovedChemistryEnum : enum16 { + kUnspecified = 0; + kAlkaline = 1; + kLithiumCarbonFluoride = 2; + kLithiumChromiumOxide = 3; + kLithiumCopperOxide = 4; + kLithiumIronDisulfide = 5; + kLithiumManganeseDioxide = 6; + kLithiumThionylChloride = 7; + kMagnesium = 8; + kMercuryOxide = 9; + kNickelOxyhydride = 10; + kSilverOxide = 11; + kZincAir = 12; + kZincCarbon = 13; + kZincChloride = 14; + kZincManganeseDioxide = 15; + kLeadAcid = 16; + kLithiumCobaltOxide = 17; + kLithiumIon = 18; + kLithiumIonPolymer = 19; + kLithiumIronPhosphate = 20; + kLithiumSulfur = 21; + kLithiumTitanate = 22; + kNickelCadmium = 23; + kNickelHydrogen = 24; + kNickelIron = 25; + kNickelMetalHydride = 26; + kNickelZinc = 27; + kSilverZinc = 28; + kSodiumIon = 29; + kSodiumSulfur = 30; + kZincBromide = 31; + kZincCerium = 32; + } + + enum BatChargeFaultEnum : enum8 { + kUnspecified = 0; + kAmbientTooHot = 1; + kAmbientTooCold = 2; + kBatteryTooHot = 3; + kBatteryTooCold = 4; + kBatteryAbsent = 5; + kBatteryOverVoltage = 6; + kBatteryUnderVoltage = 7; + kChargerOverVoltage = 8; + kChargerUnderVoltage = 9; + kSafetyTimeout = 10; + } + + enum BatChargeLevelEnum : enum8 { + kOK = 0; + kWarning = 1; + kCritical = 2; + } + + enum BatChargeStateEnum : enum8 { + kUnknown = 0; + kIsCharging = 1; + kIsAtFullCharge = 2; + kIsNotCharging = 3; + } + + enum BatCommonDesignationEnum : enum16 { + kUnspecified = 0; + kAAA = 1; + kAA = 2; + kC = 3; + kD = 4; + k4v5 = 5; + k6v0 = 6; + k9v0 = 7; + k12AA = 8; + kAAAA = 9; + kA = 10; + kB = 11; + kF = 12; + kN = 13; + kNo6 = 14; + kSubC = 15; + kA23 = 16; + kA27 = 17; + kBA5800 = 18; + kDuplex = 19; + k4SR44 = 20; + k523 = 21; + k531 = 22; + k15v0 = 23; + k22v5 = 24; + k30v0 = 25; + k45v0 = 26; + k67v5 = 27; + kJ = 28; + kCR123A = 29; + kCR2 = 30; + k2CR5 = 31; + kCRP2 = 32; + kCRV3 = 33; + kSR41 = 34; + kSR43 = 35; + kSR44 = 36; + kSR45 = 37; + kSR48 = 38; + kSR54 = 39; + kSR55 = 40; + kSR57 = 41; + kSR58 = 42; + kSR59 = 43; + kSR60 = 44; + kSR63 = 45; + kSR64 = 46; + kSR65 = 47; + kSR66 = 48; + kSR67 = 49; + kSR68 = 50; + kSR69 = 51; + kSR516 = 52; + kSR731 = 53; + kSR712 = 54; + kLR932 = 55; + kA5 = 56; + kA10 = 57; + kA13 = 58; + kA312 = 59; + kA675 = 60; + kAC41E = 61; + k10180 = 62; + k10280 = 63; + k10440 = 64; + k14250 = 65; + k14430 = 66; + k14500 = 67; + k14650 = 68; + k15270 = 69; + k16340 = 70; + kRCR123A = 71; + k17500 = 72; + k17670 = 73; + k18350 = 74; + k18500 = 75; + k18650 = 76; + k19670 = 77; + k25500 = 78; + k26650 = 79; + k32600 = 80; + } + + enum BatFaultEnum : enum8 { + kUnspecified = 0; + kOverTemp = 1; + kUnderTemp = 2; + } + + enum BatReplaceabilityEnum : enum8 { + kUnspecified = 0; + kNotReplaceable = 1; + kUserReplaceable = 2; + kFactoryReplaceable = 3; + } + + enum PowerSourceStatusEnum : enum8 { + kUnspecified = 0; + kActive = 1; + kStandby = 2; + kUnavailable = 3; + } + + enum WiredCurrentTypeEnum : enum8 { + kAC = 0; + kDC = 1; + } + + enum WiredFaultEnum : enum8 { + kUnspecified = 0; + kOverVoltage = 1; + kUnderVoltage = 2; + } + + bitmap Feature : bitmap32 { + kWired = 0x1; + kBattery = 0x2; + kRechargeable = 0x4; + kReplaceable = 0x8; + } + + struct BatChargeFaultChangeType { + BatChargeFaultEnum current[] = 0; + BatChargeFaultEnum previous[] = 1; + } + + struct BatFaultChangeType { + BatFaultEnum current[] = 0; + BatFaultEnum previous[] = 1; + } + + struct WiredFaultChangeType { + WiredFaultEnum current[] = 0; + WiredFaultEnum previous[] = 1; + } + + info event WiredFaultChange = 0 { + WiredFaultEnum current[] = 0; + WiredFaultEnum previous[] = 1; + } + + info event BatFaultChange = 1 { + BatFaultEnum current[] = 0; + BatFaultEnum previous[] = 1; + } + + info event BatChargeFaultChange = 2 { + BatChargeFaultEnum current[] = 0; + BatChargeFaultEnum previous[] = 1; + } + + readonly attribute PowerSourceStatusEnum status = 0; + readonly attribute int8u order = 1; + readonly attribute char_string<60> description = 2; + readonly attribute optional nullable int32u wiredAssessedInputVoltage = 3; + readonly attribute optional nullable int16u wiredAssessedInputFrequency = 4; + readonly attribute optional WiredCurrentTypeEnum wiredCurrentType = 5; + readonly attribute optional nullable int32u wiredAssessedCurrent = 6; + readonly attribute optional int32u wiredNominalVoltage = 7; + readonly attribute optional int32u wiredMaximumCurrent = 8; + readonly attribute optional boolean wiredPresent = 9; + readonly attribute optional WiredFaultEnum activeWiredFaults[] = 10; + readonly attribute optional nullable int32u batVoltage = 11; + readonly attribute optional nullable int8u batPercentRemaining = 12; + readonly attribute optional nullable int32u batTimeRemaining = 13; + readonly attribute optional BatChargeLevelEnum batChargeLevel = 14; + readonly attribute optional boolean batReplacementNeeded = 15; + readonly attribute optional BatReplaceabilityEnum batReplaceability = 16; + readonly attribute optional boolean batPresent = 17; + readonly attribute optional BatFaultEnum activeBatFaults[] = 18; + readonly attribute optional char_string<60> batReplacementDescription = 19; + readonly attribute optional BatCommonDesignationEnum batCommonDesignation = 20; + readonly attribute optional char_string<20> batANSIDesignation = 21; + readonly attribute optional char_string<20> batIECDesignation = 22; + readonly attribute optional BatApprovedChemistryEnum batApprovedChemistry = 23; + readonly attribute optional int32u batCapacity = 24; + readonly attribute optional int8u batQuantity = 25; + readonly attribute optional BatChargeStateEnum batChargeState = 26; + readonly attribute optional nullable int32u batTimeToFullCharge = 27; + readonly attribute optional boolean batFunctionalWhileCharging = 28; + readonly attribute optional nullable int32u batChargingCurrent = 29; + readonly attribute optional BatChargeFaultEnum activeBatChargeFaults[] = 30; + readonly attribute endpoint_no endpointList[] = 31; + 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; +} + +/** This cluster is used to manage global aspects of the Commissioning flow. */ +cluster GeneralCommissioning = 48 { + revision 1; // NOTE: Default/not specifically set + + enum CommissioningErrorEnum : enum8 { + kOK = 0; + kValueOutsideRange = 1; + kInvalidAuthentication = 2; + kNoFailSafe = 3; + kBusyWithOtherAdmin = 4; + } + + enum RegulatoryLocationTypeEnum : enum8 { + kIndoor = 0; + kOutdoor = 1; + kIndoorOutdoor = 2; + } + + struct BasicCommissioningInfo { + int16u failSafeExpiryLengthSeconds = 0; + int16u maxCumulativeFailsafeSeconds = 1; + } + + attribute access(write: administer) int64u breadcrumb = 0; + readonly attribute BasicCommissioningInfo basicCommissioningInfo = 1; + readonly attribute RegulatoryLocationTypeEnum regulatoryConfig = 2; + readonly attribute RegulatoryLocationTypeEnum locationCapability = 3; + readonly attribute boolean supportsConcurrentConnection = 4; + 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 ArmFailSafeRequest { + int16u expiryLengthSeconds = 0; + int64u breadcrumb = 1; + } + + response struct ArmFailSafeResponse = 1 { + CommissioningErrorEnum errorCode = 0; + char_string<128> debugText = 1; + } + + request struct SetRegulatoryConfigRequest { + RegulatoryLocationTypeEnum newRegulatoryConfig = 0; + char_string<2> countryCode = 1; + int64u breadcrumb = 2; + } + + response struct SetRegulatoryConfigResponse = 3 { + CommissioningErrorEnum errorCode = 0; + char_string debugText = 1; + } + + response struct CommissioningCompleteResponse = 5 { + CommissioningErrorEnum errorCode = 0; + char_string debugText = 1; + } + + /** Arm the persistent fail-safe timer with an expiry time of now + ExpiryLengthSeconds using device clock */ + command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; + /** Set the regulatory configuration to be used during commissioning */ + command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; + /** Signals the Server that the Client has successfully completed all steps of Commissioning/Recofiguration needed during fail-safe period. */ + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; +} + +/** Functionality to configure, enable, disable network credentials and access on a Matter device. */ +cluster NetworkCommissioning = 49 { + revision 1; // NOTE: Default/not specifically set + + enum NetworkCommissioningStatusEnum : enum8 { + kSuccess = 0; + kOutOfRange = 1; + kBoundsExceeded = 2; + kNetworkIDNotFound = 3; + kDuplicateNetworkID = 4; + kNetworkNotFound = 5; + kRegulatoryError = 6; + kAuthFailure = 7; + kUnsupportedSecurity = 8; + kOtherConnectionFailure = 9; + kIPV6Failed = 10; + kIPBindFailed = 11; + kUnknownError = 12; + } + + enum WiFiBandEnum : enum8 { + k2G4 = 0; + k3G65 = 1; + k5G = 2; + k6G = 3; + k60G = 4; + k1G = 5; + } + + bitmap Feature : bitmap32 { + kWiFiNetworkInterface = 0x1; + kThreadNetworkInterface = 0x2; + kEthernetNetworkInterface = 0x4; + kPerDeviceCredentials = 0x8; + } + + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { + kUnencrypted = 0x1; + kWEP = 0x2; + kWPAPersonal = 0x4; + kWPA2Personal = 0x8; + kWPA3Personal = 0x10; + kWPA3MatterPDC = 0x20; + } + + struct NetworkInfoStruct { + octet_string<32> networkID = 0; + boolean connected = 1; + optional nullable octet_string<20> networkIdentifier = 2; + optional nullable octet_string<20> clientIdentifier = 3; + } + + struct ThreadInterfaceScanResultStruct { + int16u panId = 0; + int64u extendedPanId = 1; + char_string<16> networkName = 2; + int16u channel = 3; + int8u version = 4; + octet_string<8> extendedAddress = 5; + int8s rssi = 6; + int8u lqi = 7; + } + + struct WiFiInterfaceScanResultStruct { + WiFiSecurityBitmap security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBandEnum wiFiBand = 4; + int8s rssi = 5; + } + + readonly attribute access(read: administer) int8u maxNetworks = 0; + readonly attribute access(read: administer) NetworkInfoStruct networks[] = 1; + readonly attribute optional int8u scanMaxTimeSeconds = 2; + readonly attribute optional int8u connectMaxTimeSeconds = 3; + attribute access(write: administer) boolean interfaceEnabled = 4; + readonly attribute access(read: administer) nullable NetworkCommissioningStatusEnum lastNetworkingStatus = 5; + readonly attribute access(read: administer) nullable octet_string<32> lastNetworkID = 6; + readonly attribute access(read: administer) nullable int32s lastConnectErrorValue = 7; + readonly attribute optional WiFiBandEnum supportedWiFiBands[] = 8; + readonly attribute optional ThreadCapabilitiesBitmap supportedThreadFeatures = 9; + readonly attribute optional int16u threadVersion = 10; + 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 ScanNetworksRequest { + optional nullable octet_string<32> ssid = 0; + optional int64u breadcrumb = 1; + } + + response struct ScanNetworksResponse = 1 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional char_string debugText = 1; + optional WiFiInterfaceScanResultStruct wiFiScanResults[] = 2; + optional ThreadInterfaceScanResultStruct threadScanResults[] = 3; + } + + request struct AddOrUpdateWiFiNetworkRequest { + octet_string<32> ssid = 0; + octet_string<64> credentials = 1; + optional int64u breadcrumb = 2; + optional octet_string<140> networkIdentity = 3; + optional octet_string<20> clientIdentifier = 4; + optional octet_string<32> possessionNonce = 5; + } + + request struct AddOrUpdateThreadNetworkRequest { + octet_string<254> operationalDataset = 0; + optional int64u breadcrumb = 1; + } + + request struct RemoveNetworkRequest { + octet_string<32> networkID = 0; + optional int64u breadcrumb = 1; + } + + response struct NetworkConfigResponse = 5 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional char_string<512> debugText = 1; + optional int8u networkIndex = 2; + optional octet_string<140> clientIdentity = 3; + optional octet_string<64> possessionSignature = 4; + } + + request struct ConnectNetworkRequest { + octet_string<32> networkID = 0; + optional int64u breadcrumb = 1; + } + + response struct ConnectNetworkResponse = 7 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional char_string debugText = 1; + nullable int32s errorValue = 2; + } + + request struct ReorderNetworkRequest { + octet_string<32> networkID = 0; + int8u networkIndex = 1; + optional int64u breadcrumb = 2; + } + + request struct QueryIdentityRequest { + octet_string<20> keyIdentifier = 0; + optional octet_string<32> possessionNonce = 1; + } + + response struct QueryIdentityResponse = 10 { + octet_string<140> identity = 0; + optional octet_string<64> possessionSignature = 1; + } + + /** Detemine the set of networks the device sees as available. */ + command access(invoke: administer) ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; + /** Add or update the credentials for a given Wi-Fi network. */ + command access(invoke: administer) AddOrUpdateWiFiNetwork(AddOrUpdateWiFiNetworkRequest): NetworkConfigResponse = 2; + /** Add or update the credentials for a given Thread network. */ + command access(invoke: administer) AddOrUpdateThreadNetwork(AddOrUpdateThreadNetworkRequest): NetworkConfigResponse = 3; + /** Remove the definition of a given network (including its credentials). */ + command access(invoke: administer) RemoveNetwork(RemoveNetworkRequest): NetworkConfigResponse = 4; + /** Connect to the specified network, using previously-defined credentials. */ + command access(invoke: administer) ConnectNetwork(ConnectNetworkRequest): ConnectNetworkResponse = 6; + /** Modify the order in which networks will be presented in the Networks attribute. */ + command access(invoke: administer) ReorderNetwork(ReorderNetworkRequest): NetworkConfigResponse = 8; + /** Retrieve details about and optionally proof of possession of a network client identity. */ + command access(invoke: administer) QueryIdentity(QueryIdentityRequest): QueryIdentityResponse = 9; +} + +/** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ +cluster DiagnosticLogs = 50 { + revision 1; // NOTE: Default/not specifically set + + enum IntentEnum : enum8 { + kEndUserSupport = 0; + kNetworkDiag = 1; + kCrashLogs = 2; + } + + enum StatusEnum : enum8 { + kSuccess = 0; + kExhausted = 1; + kNoLogs = 2; + kBusy = 3; + kDenied = 4; + } + + enum TransferProtocolEnum : enum8 { + kResponsePayload = 0; + kBDX = 1; + } + + 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 RetrieveLogsRequestRequest { + IntentEnum intent = 0; + TransferProtocolEnum requestedProtocol = 1; + optional char_string<32> transferFileDesignator = 2; + } + + response struct RetrieveLogsResponse = 1 { + StatusEnum status = 0; + long_octet_string logContent = 1; + optional epoch_us UTCTimeStamp = 2; + optional systime_us timeSinceBoot = 3; + } + + /** Retrieving diagnostic logs from a Node */ + command RetrieveLogsRequest(RetrieveLogsRequestRequest): RetrieveLogsResponse = 0; +} + +/** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ +cluster GeneralDiagnostics = 51 { + revision 2; + + enum BootReasonEnum : enum8 { + kUnspecified = 0; + kPowerOnReboot = 1; + kBrownOutReset = 2; + kSoftwareWatchdogReset = 3; + kHardwareWatchdogReset = 4; + kSoftwareUpdateCompleted = 5; + kSoftwareReset = 6; + } + + enum HardwareFaultEnum : enum8 { + kUnspecified = 0; + kRadio = 1; + kSensor = 2; + kResettableOverTemp = 3; + kNonResettableOverTemp = 4; + kPowerSource = 5; + kVisualDisplayFault = 6; + kAudioOutputFault = 7; + kUserInterfaceFault = 8; + kNonVolatileMemoryError = 9; + kTamperDetected = 10; + } + + enum InterfaceTypeEnum : enum8 { + kUnspecified = 0; + kWiFi = 1; + kEthernet = 2; + kCellular = 3; + kThread = 4; + } + + enum NetworkFaultEnum : enum8 { + kUnspecified = 0; + kHardwareFailure = 1; + kNetworkJammed = 2; + kConnectionFailed = 3; + } + + enum RadioFaultEnum : enum8 { + kUnspecified = 0; + kWiFiFault = 1; + kCellularFault = 2; + kThreadFault = 3; + kNFCFault = 4; + kBLEFault = 5; + kEthernetFault = 6; + } + + bitmap Feature : bitmap32 { + kDataModelTest = 0x1; + } + + struct NetworkInterface { + char_string<32> name = 0; + boolean isOperational = 1; + nullable boolean offPremiseServicesReachableIPv4 = 2; + nullable boolean offPremiseServicesReachableIPv6 = 3; + octet_string<8> hardwareAddress = 4; + octet_string IPv4Addresses[] = 5; + octet_string IPv6Addresses[] = 6; + InterfaceTypeEnum type = 7; + } + + critical event HardwareFaultChange = 0 { + HardwareFaultEnum current[] = 0; + HardwareFaultEnum previous[] = 1; + } + + critical event RadioFaultChange = 1 { + RadioFaultEnum current[] = 0; + RadioFaultEnum previous[] = 1; + } + + critical event NetworkFaultChange = 2 { + NetworkFaultEnum current[] = 0; + NetworkFaultEnum previous[] = 1; + } + + critical event BootReason = 3 { + BootReasonEnum bootReason = 0; + } + + readonly attribute NetworkInterface networkInterfaces[] = 0; + readonly attribute int16u rebootCount = 1; + readonly attribute optional int64u upTime = 2; + readonly attribute optional int32u totalOperationalHours = 3; + readonly attribute optional BootReasonEnum bootReason = 4; + readonly attribute optional HardwareFaultEnum activeHardwareFaults[] = 5; + readonly attribute optional RadioFaultEnum activeRadioFaults[] = 6; + readonly attribute optional NetworkFaultEnum activeNetworkFaults[] = 7; + readonly attribute boolean testEventTriggersEnabled = 8; + 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 TestEventTriggerRequest { + octet_string<16> enableKey = 0; + int64u eventTrigger = 1; + } + + response struct TimeSnapshotResponse = 2 { + systime_ms systemTimeMs = 0; + nullable posix_ms posixTimeMs = 1; + } + + request struct PayloadTestRequestRequest { + octet_string<16> enableKey = 0; + int8u value = 1; + int16u count = 2; + } + + response struct PayloadTestResponse = 4 { + octet_string payload = 0; + } + + /** Provide a means for certification tests to trigger some test-plan-specific events */ + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + /** Take a snapshot of system time and epoch time. */ + command TimeSnapshot(): TimeSnapshotResponse = 1; + /** Request a variable length payload response. */ + command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3; +} + +/** This cluster exposes interactions with a switch device, for the purpose of using those interactions by other devices. +Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. +Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ +cluster Switch = 59 { + revision 1; + + bitmap Feature : bitmap32 { + kLatchingSwitch = 0x1; + kMomentarySwitch = 0x2; + kMomentarySwitchRelease = 0x4; + kMomentarySwitchLongPress = 0x8; + kMomentarySwitchMultiPress = 0x10; + } + + info event SwitchLatched = 0 { + int8u newPosition = 0; + } + + info event InitialPress = 1 { + int8u newPosition = 0; + } + + info event LongPress = 2 { + int8u newPosition = 0; + } + + info event ShortRelease = 3 { + int8u previousPosition = 0; + } + + info event LongRelease = 4 { + int8u previousPosition = 0; + } + + info event MultiPressOngoing = 5 { + int8u newPosition = 0; + int8u currentNumberOfPressesCounted = 1; + } + + info event MultiPressComplete = 6 { + int8u previousPosition = 0; + int8u totalNumberOfPressesCounted = 1; + } + + readonly attribute int8u numberOfPositions = 0; + readonly attribute int8u currentPosition = 1; + readonly attribute optional int8u multiPressMax = 2; + 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; +} + +/** Commands to trigger a Node to allow a new Administrator to commission it. */ +cluster AdministratorCommissioning = 60 { + revision 1; // NOTE: Default/not specifically set + + enum CommissioningWindowStatusEnum : enum8 { + kWindowNotOpen = 0; + kEnhancedWindowOpen = 1; + kBasicWindowOpen = 2; + } + + enum StatusCode : enum8 { + kBusy = 2; + kPAKEParameterError = 3; + kWindowNotOpen = 4; + } + + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable vendor_id adminVendorId = 2; + 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 OpenCommissioningWindowRequest { + int16u commissioningTimeout = 0; + octet_string PAKEPasscodeVerifier = 1; + int16u discriminator = 2; + int32u iterations = 3; + octet_string<32> salt = 4; + } + + request struct OpenBasicCommissioningWindowRequest { + int16u commissioningTimeout = 0; + } + + /** This command is used by a current Administrator to instruct a Node to go into commissioning mode using enhanced commissioning method. */ + timed command access(invoke: administer) OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0; + /** This command is used by a current Administrator to instruct a Node to go into commissioning mode using basic commissioning method, if the node supports it. */ + timed command access(invoke: administer) OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1; + /** This command is used by a current Administrator to instruct a Node to revoke any active Open Commissioning Window or Open Basic Commissioning Window command. */ + timed command access(invoke: administer) RevokeCommissioning(): DefaultSuccess = 2; +} + +/** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ +cluster OperationalCredentials = 62 { + revision 1; // NOTE: Default/not specifically set + + enum CertificateChainTypeEnum : enum8 { + kDACCertificate = 1; + kPAICertificate = 2; + } + + enum NodeOperationalCertStatusEnum : enum8 { + kOK = 0; + kInvalidPublicKey = 1; + kInvalidNodeOpId = 2; + kInvalidNOC = 3; + kMissingCsr = 4; + kTableFull = 5; + kInvalidAdminSubject = 6; + kFabricConflict = 9; + kLabelConflict = 10; + kInvalidFabricIndex = 11; + } + + fabric_scoped struct FabricDescriptorStruct { + octet_string<65> rootPublicKey = 1; + vendor_id vendorID = 2; + fabric_id fabricID = 3; + node_id nodeID = 4; + char_string<32> label = 5; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; + readonly attribute FabricDescriptorStruct fabrics[] = 1; + readonly attribute int8u supportedFabrics = 2; + readonly attribute int8u commissionedFabrics = 3; + readonly attribute octet_string trustedRootCertificates[] = 4; + readonly attribute int8u currentFabricIndex = 5; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct AttestationRequestRequest { + octet_string<32> attestationNonce = 0; + } + + response struct AttestationResponse = 1 { + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; + } + + request struct CertificateChainRequestRequest { + CertificateChainTypeEnum certificateType = 0; + } + + response struct CertificateChainResponse = 3 { + octet_string<600> certificate = 0; + } + + request struct CSRRequestRequest { + octet_string<32> CSRNonce = 0; + optional boolean isForUpdateNOC = 1; + } + + response struct CSRResponse = 5 { + octet_string NOCSRElements = 0; + octet_string attestationSignature = 1; + } + + request struct AddNOCRequest { + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; + int64u caseAdminSubject = 3; + vendor_id adminVendorId = 4; + } + + request struct UpdateNOCRequest { + octet_string NOCValue = 0; + optional octet_string ICACValue = 1; + } + + response struct NOCResponse = 8 { + NodeOperationalCertStatusEnum statusCode = 0; + optional fabric_idx fabricIndex = 1; + optional char_string<128> debugText = 2; + } + + request struct UpdateFabricLabelRequest { + char_string<32> label = 0; + } + + request struct RemoveFabricRequest { + fabric_idx fabricIndex = 0; + } + + request struct AddTrustedRootCertificateRequest { + octet_string rootCACertificate = 0; + } + + /** Sender is requesting attestation information from the receiver. */ + command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; + /** Sender is requesting a device attestation certificate from the receiver. */ + command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; + /** Sender is requesting a certificate signing request (CSR) from the receiver. */ + command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; + /** Sender is requesting to add the new node operational certificates. */ + command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; + /** Sender is requesting to update the node operational certificates. */ + fabric command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; + /** This command SHALL be used by an Administrative Node to set the user-visible Label field for a given Fabric, as reflected by entries in the Fabrics attribute. */ + fabric command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + /** This command is used by Administrative Nodes to remove a given fabric index and delete all associated fabric-scoped data. */ + command access(invoke: administer) RemoveFabric(RemoveFabricRequest): NOCResponse = 10; + /** This command SHALL add a Trusted Root CA Certificate, provided as its CHIP Certificate representation. */ + command access(invoke: administer) AddTrustedRootCertificate(AddTrustedRootCertificateRequest): DefaultSuccess = 11; +} + +/** The Group Key Management Cluster is the mechanism by which group keys are managed. */ +cluster GroupKeyManagement = 63 { + revision 1; // NOTE: Default/not specifically set + + enum GroupKeySecurityPolicyEnum : enum8 { + kTrustFirst = 0; + kCacheAndSync = 1; + } + + bitmap Feature : bitmap32 { + kCacheAndSync = 0x1; + } + + fabric_scoped struct GroupInfoMapStruct { + group_id groupId = 1; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct GroupKeyMapStruct { + group_id groupId = 1; + int16u groupKeySetID = 2; + fabric_idx fabricIndex = 254; + } + + struct GroupKeySetStruct { + int16u groupKeySetID = 0; + GroupKeySecurityPolicyEnum groupKeySecurityPolicy = 1; + nullable octet_string<16> epochKey0 = 2; + nullable epoch_us epochStartTime0 = 3; + nullable octet_string<16> epochKey1 = 4; + nullable epoch_us epochStartTime1 = 5; + nullable octet_string<16> epochKey2 = 6; + nullable epoch_us epochStartTime2 = 7; + } + + attribute access(write: manage) GroupKeyMapStruct groupKeyMap[] = 0; + readonly attribute GroupInfoMapStruct groupTable[] = 1; + readonly attribute int16u maxGroupsPerFabric = 2; + readonly attribute int16u maxGroupKeysPerFabric = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct KeySetWriteRequest { + GroupKeySetStruct groupKeySet = 0; + } + + request struct KeySetReadRequest { + int16u groupKeySetID = 0; + } + + response struct KeySetReadResponse = 2 { + GroupKeySetStruct groupKeySet = 0; + } + + request struct KeySetRemoveRequest { + int16u groupKeySetID = 0; + } + + response struct KeySetReadAllIndicesResponse = 5 { + int16u groupKeySetIDs[] = 0; + } + + /** Write a new set of keys for the given key set id. */ + fabric command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; + /** Read the keys for a given key set id. */ + fabric command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; + /** Revoke a Root Key from a Group */ + fabric command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; + /** Return the list of Group Key Sets associated with the accessing fabric */ + fabric command access(invoke: administer) KeySetReadAllIndices(): KeySetReadAllIndicesResponse = 4; +} + +endpoint 0 { + device type ma_rootdevice = 22, version 1; + + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + callback attribute featureMap; + callback attribute clusterRevision; + } + + server cluster AccessControl { + emits event AccessControlEntryChanged; + emits event AccessControlExtensionChanged; + callback attribute acl; + callback attribute extension; + callback attribute subjectsPerAccessControlEntry; + callback attribute targetsPerAccessControlEntry; + callback attribute accessControlEntriesPerFabric; + callback attribute attributeList; + ram attribute featureMap default = 0; + callback attribute clusterRevision; + } + + server cluster BasicInformation { + emits event StartUp; + emits event ShutDown; + emits event Leave; + callback attribute dataModelRevision; + callback attribute vendorName; + callback attribute vendorID; + callback attribute productName; + callback attribute productID; + persist attribute nodeLabel; + callback attribute location; + callback attribute hardwareVersion; + callback attribute hardwareVersionString; + callback attribute softwareVersion; + callback attribute softwareVersionString; + callback attribute manufacturingDate; + callback attribute partNumber; + callback attribute productURL; + callback attribute productLabel; + callback attribute serialNumber; + persist attribute localConfigDisabled default = 0; + callback attribute uniqueID; + callback attribute capabilityMinima; + callback attribute specificationVersion; + callback attribute maxPathsPerInvoke; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 3; + } + + server cluster GeneralCommissioning { + ram attribute breadcrumb default = 0x0000000000000000; + callback attribute basicCommissioningInfo; + callback attribute regulatoryConfig; + callback attribute locationCapability; + callback attribute supportsConcurrentConnection; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 0x0001; + + handle command ArmFailSafe; + handle command ArmFailSafeResponse; + handle command SetRegulatoryConfig; + handle command SetRegulatoryConfigResponse; + handle command CommissioningComplete; + handle command CommissioningCompleteResponse; + } + + server cluster NetworkCommissioning { + ram attribute maxNetworks; + callback attribute networks; + ram attribute scanMaxTimeSeconds; + ram attribute connectMaxTimeSeconds; + ram attribute interfaceEnabled; + ram attribute lastNetworkingStatus; + ram attribute lastNetworkID; + ram attribute lastConnectErrorValue; + ram attribute featureMap default = 1; + ram attribute clusterRevision default = 0x0001; + + handle command ScanNetworks; + handle command ScanNetworksResponse; + handle command AddOrUpdateWiFiNetwork; + handle command AddOrUpdateThreadNetwork; + handle command RemoveNetwork; + handle command NetworkConfigResponse; + handle command ConnectNetwork; + handle command ConnectNetworkResponse; + handle command ReorderNetwork; + } + + server cluster DiagnosticLogs { + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command RetrieveLogsRequest; + } + + server cluster GeneralDiagnostics { + emits event BootReason; + callback attribute networkInterfaces; + callback attribute rebootCount; + callback attribute upTime; + callback attribute totalOperationalHours; + callback attribute bootReason; + callback attribute activeHardwareFaults; + callback attribute activeRadioFaults; + callback attribute activeNetworkFaults; + callback attribute testEventTriggersEnabled default = false; + callback attribute featureMap; + callback attribute clusterRevision; + + handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; + } + + server cluster AdministratorCommissioning { + callback attribute windowStatus; + callback attribute adminFabricIndex; + callback attribute adminVendorId; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 0x0001; + + handle command OpenCommissioningWindow; + handle command OpenBasicCommissioningWindow; + handle command RevokeCommissioning; + } + + server cluster OperationalCredentials { + callback attribute NOCs; + callback attribute fabrics; + callback attribute supportedFabrics; + callback attribute commissionedFabrics; + callback attribute trustedRootCertificates; + callback attribute currentFabricIndex; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 0x0001; + + handle command AttestationRequest; + handle command AttestationResponse; + handle command CertificateChainRequest; + handle command CertificateChainResponse; + handle command CSRRequest; + handle command CSRResponse; + handle command AddNOC; + handle command UpdateNOC; + handle command NOCResponse; + handle command UpdateFabricLabel; + handle command RemoveFabric; + handle command AddTrustedRootCertificate; + } + + server cluster GroupKeyManagement { + callback attribute groupKeyMap; + callback attribute groupTable; + callback attribute maxGroupsPerFabric; + callback attribute maxGroupKeysPerFabric; + callback attribute featureMap; + callback attribute clusterRevision; + + handle command KeySetWrite; + handle command KeySetRead; + handle command KeySetReadResponse; + handle command KeySetRemove; + handle command KeySetReadAllIndices; + handle command KeySetReadAllIndicesResponse; + } +} +endpoint 1 { + device type ma_powersource = 17, version 1; + device type ma_genericswitch = 15, version 1; + + + server cluster Identify { + ram attribute identifyTime default = 0x0; + ram attribute identifyType default = 0x00; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 4; + + handle command Identify; + handle command TriggerEffect; + } + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + callback attribute tagList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap; + callback attribute clusterRevision; + } + + server cluster PowerSource { + persist attribute status default = 1; + persist attribute order default = 1; + persist attribute description default = "Battery"; + persist attribute batVoltage; + persist attribute batPercentRemaining default = 100; + persist attribute batTimeRemaining; + persist attribute batChargeLevel; + ram attribute batReplacementNeeded; + ram attribute batReplaceability; + ram attribute batPresent; + ram attribute batReplacementDescription; + persist attribute batQuantity default = 1; + callback attribute endpointList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0x0A; + ram attribute clusterRevision default = 1; + } + + server cluster Switch { + emits event InitialPress; + emits event LongPress; + emits event ShortRelease; + emits event LongRelease; + persist attribute numberOfPositions default = 3; + persist attribute currentPosition default = 0; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0xE; + ram attribute clusterRevision default = 1; + } +} + + diff --git a/examples/chef/devices/rootnode_genericswitch_2dfff6e516.zap b/examples/chef/devices/rootnode_genericswitch_2dfff6e516.zap new file mode 100644 index 00000000000000..1f84a7aab45a71 --- /dev/null +++ b/examples/chef/devices/rootnode_genericswitch_2dfff6e516.zap @@ -0,0 +1,2804 @@ +{ + "fileFormat": 2, + "featureLevel": 102, + "creator": "zap", + "keyValuePairs": [ + { + "key": "commandDiscovery", + "value": "1" + }, + { + "key": "defaultResponsePolicy", + "value": "always" + }, + { + "key": "manufacturerCodes", + "value": "0x1002" + } + ], + "package": [ + { + "pathRelativity": "relativeToZap", + "path": "../../../src/app/zap-templates/zcl/zcl.json", + "type": "zcl-properties", + "category": "matter", + "version": 1, + "description": "Matter SDK ZCL data" + }, + { + "pathRelativity": "relativeToZap", + "path": "../../../src/app/zap-templates/app-templates.json", + "type": "gen-templates-json", + "category": "matter", + "version": "chip-v1" + } + ], + "endpointTypes": [ + { + "id": 1, + "name": "MA-rootdevice", + "deviceTypeRef": { + "code": 22, + "profileId": 259, + "label": "MA-rootdevice", + "name": "MA-rootdevice" + }, + "deviceTypes": [ + { + "code": 22, + "profileId": 259, + "label": "MA-rootdevice", + "name": "MA-rootdevice" + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 22 + ], + "deviceTypeName": "MA-rootdevice", + "deviceTypeCode": 22, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Access Control", + "code": 31, + "mfgCode": null, + "define": "ACCESS_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "ACL", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Extension", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SubjectsPerAccessControlEntry", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TargetsPerAccessControlEntry", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AccessControlEntriesPerFabric", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "AccessControlEntryChanged", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "AccessControlExtensionChanged", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Basic Information", + "code": 40, + "mfgCode": null, + "define": "BASIC_INFORMATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DataModelRevision", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorName", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorID", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "vendor_id", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductName", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductID", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NodeLabel", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "NVM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Location", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersion", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersionString", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersion", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersionString", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ManufacturingDate", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartNumber", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductURL", + "code": 13, + "mfgCode": null, + "side": "server", + "type": "long_char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductLabel", + "code": 14, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SerialNumber", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "LocalConfigDisabled", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "NVM", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UniqueID", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CapabilityMinima", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "CapabilityMinimaStruct", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SpecificationVersion", + "code": 21, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxPathsPerInvoke", + "code": 22, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "StartUp", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "ShutDown", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "Leave", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "General Commissioning", + "code": 48, + "mfgCode": null, + "define": "GENERAL_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ArmFailSafe", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ArmFailSafeResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "SetRegulatoryConfig", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "SetRegulatoryConfigResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "CommissioningComplete", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CommissioningCompleteResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "Breadcrumb", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "BasicCommissioningInfo", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "BasicCommissioningInfo", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RegulatoryConfig", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "RegulatoryLocationTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LocationCapability", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "RegulatoryLocationTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportsConcurrentConnection", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Network Commissioning", + "code": 49, + "mfgCode": null, + "define": "NETWORK_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ScanNetworks", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ScanNetworksResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "AddOrUpdateWiFiNetwork", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "AddOrUpdateThreadNetwork", + "code": 3, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RemoveNetwork", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "NetworkConfigResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "ConnectNetwork", + "code": 6, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ConnectNetworkResponse", + "code": 7, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "ReorderNetwork", + "code": 8, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "MaxNetworks", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Networks", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ScanMaxTimeSeconds", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ConnectMaxTimeSeconds", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "InterfaceEnabled", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkingStatus", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "NetworkCommissioningStatusEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkID", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastConnectErrorValue", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int32s", + "included": 1, + "storageOption": "RAM", + "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": "1", + "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": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Diagnostic Logs", + "code": 50, + "mfgCode": null, + "define": "DIAGNOSTIC_LOGS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "RetrieveLogsRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "General Diagnostics", + "code": 51, + "mfgCode": null, + "define": "GENERAL_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "TestEventTrigger", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "NetworkInterfaces", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RebootCount", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TotalOperationalHours", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BootReason", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "BootReasonEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveHardwareFaults", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveRadioFaults", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveNetworkFaults", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TestEventTriggersEnabled", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "false", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "BootReason", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Administrator Commissioning", + "code": 60, + "mfgCode": null, + "define": "ADMINISTRATOR_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "OpenCommissioningWindow", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "OpenBasicCommissioningWindow", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RevokeCommissioning", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "WindowStatus", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "CommissioningWindowStatusEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AdminFabricIndex", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "fabric_idx", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AdminVendorId", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "vendor_id", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Operational Credentials", + "code": 62, + "mfgCode": null, + "define": "OPERATIONAL_CREDENTIALS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "AttestationRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "AttestationResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "CertificateChainRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CertificateChainResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "CSRRequest", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CSRResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "AddNOC", + "code": 6, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "UpdateNOC", + "code": 7, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "NOCResponse", + "code": 8, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "UpdateFabricLabel", + "code": 9, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RemoveFabric", + "code": 10, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "AddTrustedRootCertificate", + "code": 11, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "NOCs", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Fabrics", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SupportedFabrics", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CommissionedFabrics", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TrustedRootCertificates", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentFabricIndex", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Group Key Management", + "code": 63, + "mfgCode": null, + "define": "GROUP_KEY_MANAGEMENT_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "KeySetWrite", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetRead", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetReadResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "KeySetRemove", + "code": 3, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetReadAllIndices", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetReadAllIndicesResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "GroupKeyMap", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GroupTable", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxGroupsPerFabric", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxGroupKeysPerFabric", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + }, + { + "id": 2, + "name": "Anonymous Endpoint Type", + "deviceTypeRef": { + "code": 15, + "profileId": 259, + "label": "MA-genericswitch", + "name": "MA-genericswitch" + }, + "deviceTypes": [ + { + "code": 15, + "profileId": 259, + "label": "MA-genericswitch", + "name": "MA-genericswitch" + }, + { + "code": 17, + "profileId": 259, + "label": "MA-powersource", + "name": "MA-powersource" + } + ], + "deviceVersions": [ + 1, + 1 + ], + "deviceIdentifiers": [ + 15, + 17 + ], + "deviceTypeName": "MA-genericswitch", + "deviceTypeCode": 15, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "Identify", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TriggerEffect", + "code": 64, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "IdentifyTime", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "IdentifyType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "IdentifyTypeEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "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": "4", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TagList", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Power Source", + "code": 47, + "mfgCode": null, + "define": "POWER_SOURCE_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "Status", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "PowerSourceStatusEnum", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Order", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Description", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "Battery", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BatVoltage", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BatPercentRemaining", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "100", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BatTimeRemaining", + "code": 13, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BatChargeLevel", + "code": 14, + "mfgCode": null, + "side": "server", + "type": "BatChargeLevelEnum", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BatReplacementNeeded", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BatReplaceability", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "BatReplaceabilityEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BatPresent", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BatReplacementDescription", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BatQuantity", + "code": 25, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EndpointList", + "code": 31, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0A", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Switch", + "code": 59, + "mfgCode": null, + "define": "SWITCH_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "NumberOfPositions", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentPosition", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xE", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "InitialPress", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "LongPress", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "ShortRelease", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "LongRelease", + "code": 4, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + } + ] + } + ], + "endpoints": [ + { + "endpointTypeName": "MA-rootdevice", + "endpointTypeIndex": 0, + "profileId": 259, + "endpointId": 0, + "networkId": 0, + "parentEndpointIdentifier": null + }, + { + "endpointTypeName": "Anonymous Endpoint Type", + "endpointTypeIndex": 1, + "profileId": 259, + "endpointId": 1, + "networkId": 0, + "parentEndpointIdentifier": null + } + ] +} \ No newline at end of file diff --git a/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter b/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter index 8e2d0166cc44a9..cda268e6d211f0 100644 --- a/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter +++ b/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter @@ -256,6 +256,265 @@ cluster BasicInformation = 40 { command MfgSpecificPing(): DefaultSuccess = 0; } +/** This cluster is used to describe the configuration and capabilities of a physical power source that provides power to the Node. */ +cluster PowerSource = 47 { + revision 1; // NOTE: Default/not specifically set + + enum BatApprovedChemistryEnum : enum16 { + kUnspecified = 0; + kAlkaline = 1; + kLithiumCarbonFluoride = 2; + kLithiumChromiumOxide = 3; + kLithiumCopperOxide = 4; + kLithiumIronDisulfide = 5; + kLithiumManganeseDioxide = 6; + kLithiumThionylChloride = 7; + kMagnesium = 8; + kMercuryOxide = 9; + kNickelOxyhydride = 10; + kSilverOxide = 11; + kZincAir = 12; + kZincCarbon = 13; + kZincChloride = 14; + kZincManganeseDioxide = 15; + kLeadAcid = 16; + kLithiumCobaltOxide = 17; + kLithiumIon = 18; + kLithiumIonPolymer = 19; + kLithiumIronPhosphate = 20; + kLithiumSulfur = 21; + kLithiumTitanate = 22; + kNickelCadmium = 23; + kNickelHydrogen = 24; + kNickelIron = 25; + kNickelMetalHydride = 26; + kNickelZinc = 27; + kSilverZinc = 28; + kSodiumIon = 29; + kSodiumSulfur = 30; + kZincBromide = 31; + kZincCerium = 32; + } + + enum BatChargeFaultEnum : enum8 { + kUnspecified = 0; + kAmbientTooHot = 1; + kAmbientTooCold = 2; + kBatteryTooHot = 3; + kBatteryTooCold = 4; + kBatteryAbsent = 5; + kBatteryOverVoltage = 6; + kBatteryUnderVoltage = 7; + kChargerOverVoltage = 8; + kChargerUnderVoltage = 9; + kSafetyTimeout = 10; + } + + enum BatChargeLevelEnum : enum8 { + kOK = 0; + kWarning = 1; + kCritical = 2; + } + + enum BatChargeStateEnum : enum8 { + kUnknown = 0; + kIsCharging = 1; + kIsAtFullCharge = 2; + kIsNotCharging = 3; + } + + enum BatCommonDesignationEnum : enum16 { + kUnspecified = 0; + kAAA = 1; + kAA = 2; + kC = 3; + kD = 4; + k4v5 = 5; + k6v0 = 6; + k9v0 = 7; + k12AA = 8; + kAAAA = 9; + kA = 10; + kB = 11; + kF = 12; + kN = 13; + kNo6 = 14; + kSubC = 15; + kA23 = 16; + kA27 = 17; + kBA5800 = 18; + kDuplex = 19; + k4SR44 = 20; + k523 = 21; + k531 = 22; + k15v0 = 23; + k22v5 = 24; + k30v0 = 25; + k45v0 = 26; + k67v5 = 27; + kJ = 28; + kCR123A = 29; + kCR2 = 30; + k2CR5 = 31; + kCRP2 = 32; + kCRV3 = 33; + kSR41 = 34; + kSR43 = 35; + kSR44 = 36; + kSR45 = 37; + kSR48 = 38; + kSR54 = 39; + kSR55 = 40; + kSR57 = 41; + kSR58 = 42; + kSR59 = 43; + kSR60 = 44; + kSR63 = 45; + kSR64 = 46; + kSR65 = 47; + kSR66 = 48; + kSR67 = 49; + kSR68 = 50; + kSR69 = 51; + kSR516 = 52; + kSR731 = 53; + kSR712 = 54; + kLR932 = 55; + kA5 = 56; + kA10 = 57; + kA13 = 58; + kA312 = 59; + kA675 = 60; + kAC41E = 61; + k10180 = 62; + k10280 = 63; + k10440 = 64; + k14250 = 65; + k14430 = 66; + k14500 = 67; + k14650 = 68; + k15270 = 69; + k16340 = 70; + kRCR123A = 71; + k17500 = 72; + k17670 = 73; + k18350 = 74; + k18500 = 75; + k18650 = 76; + k19670 = 77; + k25500 = 78; + k26650 = 79; + k32600 = 80; + } + + enum BatFaultEnum : enum8 { + kUnspecified = 0; + kOverTemp = 1; + kUnderTemp = 2; + } + + enum BatReplaceabilityEnum : enum8 { + kUnspecified = 0; + kNotReplaceable = 1; + kUserReplaceable = 2; + kFactoryReplaceable = 3; + } + + enum PowerSourceStatusEnum : enum8 { + kUnspecified = 0; + kActive = 1; + kStandby = 2; + kUnavailable = 3; + } + + enum WiredCurrentTypeEnum : enum8 { + kAC = 0; + kDC = 1; + } + + enum WiredFaultEnum : enum8 { + kUnspecified = 0; + kOverVoltage = 1; + kUnderVoltage = 2; + } + + bitmap Feature : bitmap32 { + kWired = 0x1; + kBattery = 0x2; + kRechargeable = 0x4; + kReplaceable = 0x8; + } + + struct BatChargeFaultChangeType { + BatChargeFaultEnum current[] = 0; + BatChargeFaultEnum previous[] = 1; + } + + struct BatFaultChangeType { + BatFaultEnum current[] = 0; + BatFaultEnum previous[] = 1; + } + + struct WiredFaultChangeType { + WiredFaultEnum current[] = 0; + WiredFaultEnum previous[] = 1; + } + + info event WiredFaultChange = 0 { + WiredFaultEnum current[] = 0; + WiredFaultEnum previous[] = 1; + } + + info event BatFaultChange = 1 { + BatFaultEnum current[] = 0; + BatFaultEnum previous[] = 1; + } + + info event BatChargeFaultChange = 2 { + BatChargeFaultEnum current[] = 0; + BatChargeFaultEnum previous[] = 1; + } + + readonly attribute PowerSourceStatusEnum status = 0; + readonly attribute int8u order = 1; + readonly attribute char_string<60> description = 2; + readonly attribute optional nullable int32u wiredAssessedInputVoltage = 3; + readonly attribute optional nullable int16u wiredAssessedInputFrequency = 4; + readonly attribute optional WiredCurrentTypeEnum wiredCurrentType = 5; + readonly attribute optional nullable int32u wiredAssessedCurrent = 6; + readonly attribute optional int32u wiredNominalVoltage = 7; + readonly attribute optional int32u wiredMaximumCurrent = 8; + readonly attribute optional boolean wiredPresent = 9; + readonly attribute optional WiredFaultEnum activeWiredFaults[] = 10; + readonly attribute optional nullable int32u batVoltage = 11; + readonly attribute optional nullable int8u batPercentRemaining = 12; + readonly attribute optional nullable int32u batTimeRemaining = 13; + readonly attribute optional BatChargeLevelEnum batChargeLevel = 14; + readonly attribute optional boolean batReplacementNeeded = 15; + readonly attribute optional BatReplaceabilityEnum batReplaceability = 16; + readonly attribute optional boolean batPresent = 17; + readonly attribute optional BatFaultEnum activeBatFaults[] = 18; + readonly attribute optional char_string<60> batReplacementDescription = 19; + readonly attribute optional BatCommonDesignationEnum batCommonDesignation = 20; + readonly attribute optional char_string<20> batANSIDesignation = 21; + readonly attribute optional char_string<20> batIECDesignation = 22; + readonly attribute optional BatApprovedChemistryEnum batApprovedChemistry = 23; + readonly attribute optional int32u batCapacity = 24; + readonly attribute optional int8u batQuantity = 25; + readonly attribute optional BatChargeStateEnum batChargeState = 26; + readonly attribute optional nullable int32u batTimeToFullCharge = 27; + readonly attribute optional boolean batFunctionalWhileCharging = 28; + readonly attribute optional nullable int32u batChargingCurrent = 29; + readonly attribute optional BatChargeFaultEnum activeBatChargeFaults[] = 30; + readonly attribute endpoint_no endpointList[] = 31; + 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; +} + /** This cluster is used to manage global aspects of the Commissioning flow. */ cluster GeneralCommissioning = 48 { revision 1; // NOTE: Default/not specifically set @@ -1166,6 +1425,7 @@ endpoint 0 { } } endpoint 1 { + device type ma_powersource = 17, version 1; device type ma_genericswitch = 15, version 1; @@ -1188,6 +1448,7 @@ endpoint 1 { callback attribute serverList; callback attribute clientList; callback attribute partsList; + callback attribute tagList; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute eventList; @@ -1196,9 +1457,31 @@ endpoint 1 { callback attribute clusterRevision; } + server cluster PowerSource { + persist attribute status default = 1; + persist attribute order default = 1; + persist attribute description default = "Battery"; + persist attribute batVoltage; + persist attribute batPercentRemaining default = 100; + persist attribute batTimeRemaining; + persist attribute batChargeLevel default = 0; + ram attribute batReplacementNeeded; + ram attribute batReplaceability; + ram attribute batPresent; + ram attribute batReplacementDescription; + persist attribute batQuantity default = 1; + callback attribute endpointList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0x0A; + ram attribute clusterRevision default = 1; + } + server cluster Switch { emits event SwitchLatched; - persist attribute numberOfPositions default = 2; + persist attribute numberOfPositions default = 5; persist attribute currentPosition default = 0; callback attribute generatedCommandList; callback attribute acceptedCommandList; diff --git a/examples/chef/devices/rootnode_genericswitch_9866e35d0b.zap b/examples/chef/devices/rootnode_genericswitch_9866e35d0b.zap index 172c6d31772296..8e62878f7a4e40 100644 --- a/examples/chef/devices/rootnode_genericswitch_9866e35d0b.zap +++ b/examples/chef/devices/rootnode_genericswitch_9866e35d0b.zap @@ -1,6 +1,6 @@ { "fileFormat": 2, - "featureLevel": 100, + "featureLevel": 102, "creator": "zap", "keyValuePairs": [ { @@ -29,6 +29,7 @@ "pathRelativity": "relativeToZap", "path": "../../../src/app/zap-templates/app-templates.json", "type": "gen-templates-json", + "category": "matter", "version": "chip-v1" } ], @@ -1935,13 +1936,21 @@ "profileId": 259, "label": "MA-genericswitch", "name": "MA-genericswitch" + }, + { + "code": 17, + "profileId": 259, + "label": "MA-powersource", + "name": "MA-powersource" } ], "deviceVersions": [ + 1, 1 ], "deviceIdentifiers": [ - 15 + 15, + 17 ], "deviceTypeName": "MA-genericswitch", "deviceTypeCode": 15, @@ -2175,6 +2184,22 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "TagList", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "GeneratedCommandList", "code": 65528, @@ -2273,6 +2298,320 @@ } ] }, + { + "name": "Power Source", + "code": 47, + "mfgCode": null, + "define": "POWER_SOURCE_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "Status", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "PowerSourceStatusEnum", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Order", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Description", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "Battery", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BatVoltage", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BatPercentRemaining", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "100", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BatTimeRemaining", + "code": 13, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BatChargeLevel", + "code": 14, + "mfgCode": null, + "side": "server", + "type": "BatChargeLevelEnum", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BatReplacementNeeded", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BatReplaceability", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "BatReplaceabilityEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BatPresent", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BatReplacementDescription", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BatQuantity", + "code": 25, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EndpointList", + "code": 31, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0A", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, { "name": "Switch", "code": 59, @@ -2291,7 +2630,7 @@ "storageOption": "NVM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "5", "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/chef/esp32/main/CMakeLists.txt b/examples/chef/esp32/main/CMakeLists.txt index ac436a7919637b..c6b37a0675fa4c 100644 --- a/examples/chef/esp32/main/CMakeLists.txt +++ b/examples/chef/esp32/main/CMakeLists.txt @@ -70,6 +70,7 @@ set(SRC_DIRS_LIST "${CMAKE_SOURCE_DIR}/../common/clusters/low-power/" "${CMAKE_SOURCE_DIR}/../common/clusters/media-input/" "${CMAKE_SOURCE_DIR}/../common/clusters/media-playback/" + "${CMAKE_SOURCE_DIR}/../common/clusters/switch/" "${CMAKE_SOURCE_DIR}/../common/clusters/target-navigator/" "${CMAKE_SOURCE_DIR}/../common/clusters/wake-on-lan/" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/app-common/app-common/zap-generated/attributes" diff --git a/examples/chef/esp32/main/main.cpp b/examples/chef/esp32/main/main.cpp index c5f29dc0f847d8..b61fcf22bc1d19 100644 --- a/examples/chef/esp32/main/main.cpp +++ b/examples/chef/esp32/main/main.cpp @@ -152,6 +152,8 @@ void printQRCode() app::Clusters::NetworkCommissioning::Instance sWiFiNetworkCommissioningInstance(0 /* Endpoint Id */, &(NetworkCommissioning::ESPWiFiDriver::GetInstance())); +extern void ApplicationInit(); + void InitServer(intptr_t) { // Start IM server @@ -172,6 +174,10 @@ void InitServer(intptr_t) // Register a function to receive events from the CHIP device layer. Note that calls to // this function will happen on the CHIP event loop thread, not the app_main thread. PlatformMgr().AddEventHandler(DeviceEventCallback, reinterpret_cast(nullptr)); + + // Application code should always be initialised after the initialisation of + // server. + ApplicationInit(); } extern "C" void app_main(void) diff --git a/examples/chef/linux/BUILD.gn b/examples/chef/linux/BUILD.gn index 264ced698b62e8..ce0bed596850ef 100644 --- a/examples/chef/linux/BUILD.gn +++ b/examples/chef/linux/BUILD.gn @@ -47,6 +47,7 @@ executable("${sample_name}") { "${project_dir}/common/chef-laundry-washer-mode.cpp", "${project_dir}/common/chef-operational-state-delegate-impl.cpp", "${project_dir}/common/chef-resource-monitoring-delegates.cpp", + "${project_dir}/common/chef-rpc-actions-worker.cpp", "${project_dir}/common/chef-rvc-mode-delegate.cpp", "${project_dir}/common/chef-rvc-operational-state-delegate.cpp", "${project_dir}/common/clusters/audio-output/AudioOutputManager.cpp", @@ -58,6 +59,8 @@ executable("${sample_name}") { "${project_dir}/common/clusters/low-power/LowPowerManager.cpp", "${project_dir}/common/clusters/media-input/MediaInputManager.cpp", "${project_dir}/common/clusters/media-playback/MediaPlaybackManager.cpp", + "${project_dir}/common/clusters/switch/SwitchEventHandler.cpp", + "${project_dir}/common/clusters/switch/SwitchManager.cpp", "${project_dir}/common/clusters/target-navigator/TargetNavigatorManager.cpp", "${project_dir}/common/clusters/wake-on-lan/WakeOnLanManager.cpp", "${project_dir}/common/stubs.cpp", @@ -80,6 +83,7 @@ executable("${sample_name}") { if (chip_enable_pw_rpc) { defines = [ "PW_RPC_ENABLED", + "PW_RPC_ACTIONS_SERVICE=1", "PW_RPC_ATTRIBUTE_SERVICE=1", "PW_RPC_BOOLEAN_STATE_SERVICE=1", "PW_RPC_BUTTON_SERVICE=1", @@ -107,6 +111,7 @@ executable("${sample_name}") { "$dir_pw_trace_tokenized", "$dir_pw_trace_tokenized:trace_rpc_service", "${chip_root}/config/linux/lib/pw_rpc:pw_rpc", + "${chip_root}/examples/common/pigweed:actions_service.nanopb_rpc", "${chip_root}/examples/common/pigweed:attributes_service.nanopb_rpc", "${chip_root}/examples/common/pigweed:boolean_state_service.nanopb_rpc", "${chip_root}/examples/common/pigweed:button_service.nanopb_rpc", diff --git a/examples/chef/linux/main.cpp b/examples/chef/linux/main.cpp index d799b4da3b53e6..7f54490eccf0de 100644 --- a/examples/chef/linux/main.cpp +++ b/examples/chef/linux/main.cpp @@ -29,10 +29,6 @@ using namespace chip::Shell; using namespace chip::app; using namespace chip::app::Clusters; -void ApplicationInit() {} - -void ApplicationShutdown() {} - int main(int argc, char * argv[]) { if (ChipLinuxAppInit(argc, argv) != 0) diff --git a/examples/chef/nrfconnect/CMakeLists.txt b/examples/chef/nrfconnect/CMakeLists.txt index 0e943cd90719f3..a22f6b6972bb15 100644 --- a/examples/chef/nrfconnect/CMakeLists.txt +++ b/examples/chef/nrfconnect/CMakeLists.txt @@ -99,6 +99,8 @@ target_sources(app PRIVATE ${CHEF}/common/clusters/low-power/LowPowerManager.cpp ${CHEF}/common/clusters/media-input/MediaInputManager.cpp ${CHEF}/common/clusters/media-playback/MediaPlaybackManager.cpp + ${CHEF}/common/clusters/switch/SwitchEventHandler.cpp + ${CHEF}/common/clusters/switch/SwitchManager.cpp ${CHEF}/common/clusters/target-navigator/TargetNavigatorManager.cpp ${CHEF}/common/clusters/wake-on-lan/WakeOnLanManager.cpp ${CHEF}/common/stubs.cpp diff --git a/examples/chef/nrfconnect/main.cpp b/examples/chef/nrfconnect/main.cpp index c79694e2e792a7..ca9d25655e3d52 100644 --- a/examples/chef/nrfconnect/main.cpp +++ b/examples/chef/nrfconnect/main.cpp @@ -64,6 +64,13 @@ chip::Crypto::PSAOperationalKeystore sPSAOperationalKeystore{}; #endif } // namespace +extern void ApplicationInit(); + +void InitServer(intptr_t) +{ + ApplicationInit(); +} + int main() { CHIP_ERROR err = CHIP_NO_ERROR; @@ -168,6 +175,8 @@ int main() cmd_app_server_init(); #endif + chip::DeviceLayer::PlatformMgr().ScheduleWork(InitServer); + #if CONFIG_CHIP_LIB_SHELL Engine::Root().RunMainLoop(); #endif diff --git a/examples/common/pigweed/BUILD.gn b/examples/common/pigweed/BUILD.gn index e056f2ef228a8a..c0178e419a1d5d 100644 --- a/examples/common/pigweed/BUILD.gn +++ b/examples/common/pigweed/BUILD.gn @@ -35,6 +35,14 @@ pw_proto_library("echo_service") { prefix = "echo_service" } +pw_proto_library("actions_service") { + sources = [ "protos/actions_service.proto" ] + inputs = [ "protos/actions_service.options" ] + deps = [ "$dir_pw_protobuf:common_protos" ] + strip_prefix = "protos" + prefix = "actions_service" +} + pw_proto_library("attributes_service") { sources = [ "protos/attributes_service.proto" ] inputs = [ "protos/attributes_service.options" ] diff --git a/examples/common/pigweed/protos/actions_service.options b/examples/common/pigweed/protos/actions_service.options new file mode 100644 index 00000000000000..24ce3e80648ae6 --- /dev/null +++ b/examples/common/pigweed/protos/actions_service.options @@ -0,0 +1 @@ +chip.rpc.ActionsRequest.actions max_count:16 // max action size diff --git a/examples/common/pigweed/protos/actions_service.proto b/examples/common/pigweed/protos/actions_service.proto new file mode 100644 index 00000000000000..dbf3a99ceb32ac --- /dev/null +++ b/examples/common/pigweed/protos/actions_service.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; + +package chip.rpc; + +import 'pw_protobuf_protos/common.proto'; + +enum ActionType { + WRITE_ATTRIBUTE = 0x00; // Write an cluster Attribute + RUN_COMMAND = 0x01; // Run a cluster Command + EMIT_EVENT = 0x02; // Emit a cluster Events +} + +message Action { + ActionType type = 1; // ActionType above + uint32 delayMs = 2; // Delay and run action after xx ms + uint32 actionId = 3; // Align with Cluster Attribute/Event/Command ID + optional uint32 arg1 = 4; // 1st attribute + optional uint32 arg2 = 5; // 2nd attribute + optional uint32 arg3 = 6; // 3rd attribute +} + +message ActionsRequest { + uint32 endpoint_id = 1; + uint32 cluster_id = 2; + repeated Action actions = 3; // Actions including Attribute Write / Event / Command +} + +service Actions { + rpc Set(ActionsRequest) returns (pw.protobuf.Empty){} +} diff --git a/examples/common/pigweed/rpc_console/py/BUILD.gn b/examples/common/pigweed/rpc_console/py/BUILD.gn index a050fb64747302..a03dc980872739 100644 --- a/examples/common/pigweed/rpc_console/py/BUILD.gn +++ b/examples/common/pigweed/rpc_console/py/BUILD.gn @@ -39,6 +39,7 @@ pw_python_package("chip_rpc") { "$dir_pw_rpc/py", "$dir_pw_system/py", "$dir_pw_tokenizer/py", + "${chip_root}/examples/common/pigweed:actions_service.python", "${chip_root}/examples/common/pigweed:attributes_service.python", "${chip_root}/examples/common/pigweed:boolean_state_service.python", "${chip_root}/examples/common/pigweed:button_service.python", diff --git a/examples/common/pigweed/rpc_console/py/chip_rpc/console.py b/examples/common/pigweed/rpc_console/py/chip_rpc/console.py index f5ed5b5ab4d582..1591722bfdbeab 100644 --- a/examples/common/pigweed/rpc_console/py/chip_rpc/console.py +++ b/examples/common/pigweed/rpc_console/py/chip_rpc/console.py @@ -46,6 +46,7 @@ # Protos # isort: off +from actions_service import actions_service_pb2 from attributes_service import attributes_service_pb2 from boolean_state_service import boolean_state_service_pb2 from button_service import button_service_pb2 @@ -128,6 +129,7 @@ def show_console(device: str, baudrate: int, # "set_wakeup_fd only works in main thread of the main interpreter" use_ipython=True, compiled_protos=[ + actions_service_pb2, attributes_service_pb2, boolean_state_service_pb2, button_service_pb2, diff --git a/examples/common/pigweed/rpc_services/Actions.h b/examples/common/pigweed/rpc_services/Actions.h new file mode 100644 index 00000000000000..a2cbba0cb49a7a --- /dev/null +++ b/examples/common/pigweed/rpc_services/Actions.h @@ -0,0 +1,127 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include + +#include "actions_service/actions_service.rpc.pb.h" +#include "app/util/attribute-storage.h" +#include "pigweed/rpc_services/internal/StatusUtils.h" +#include +#include +#include + +namespace chip { +namespace rpc { + +class Actions final : public pw_rpc::nanopb::Actions::Service +{ + /* + * RPC Actions Service is a debugging interface for writting Attributes, emitting Events, or + * running Commands batchwisely. Each action will be execute one by one according to the + * delayed time in ms. + * + * An Action is a abstract type of Attribute, Command, Event + * type : this defines the action is either a Attribute, Command, or Event + * delayMs : this define the relative delayed time in ms after last action + * actionId : this defines the ID of Attribute, Command or Event + * arg1, arg2, arg3 : it has up to 3 optional arguments which could be mapped to Attribute/Command/Event aruments + * + * An Action Request is composed of a batch of Actions + * + * The usage of Actions Service: + * 1. Create an Action Request by protos.chip.rpc.ActionsWrite + * 2. Append Actions one by one to the action request + * 3. After all action added to the request, call rpcs.chip.rpc.Actions.Set to execute that + * + * e.g. In rpc_console: + * + * # Init a RPC Action request which is for endpoint 1 and Switch Cluster (0x003B) + * In [1]: request=protos.chip.rpc.ActionsWrite(endpoint_id=1, cluster_id=int("0x003B", 16)) + * + * # Add an action to write attribute id 0x1 (CurrentPosition) with data 2 after 1000 ms (meaning right away) + * In [2]: request.actions.append(protos.chip.rpc.Action(type=protos.chip.rpc.ActionType.WRITE_ATTRIBUTE, delayMs=1000, + * actionId=1, arg1=2)) + * + * # Define the follow action to emit an event id 0x1 (InitialPress) with data 2 (NewPosition) after 1000 ms + * In [3]: message.actions.append(protos.chip.rpc.Action(type=protos.chip.rpc.ActionType.EMIT_EVENT, delayMs=1000, + * actionId=1, arg1=2)) + * + * # Define the follow action to emit an event id 0x2 (LongPress) with data 2 (NewPosition) after 2000 ms + * In [4]: message.actions.append(protos.chip.rpc.Action(type=protos.chip.rpc.ActionType.EMIT_EVENT, delayMs=2000, + * actionId=2, arg1=2)) + * + * # Define an action to write attribute id 0x1 (CurrentPosition) with data 0 after 2000 ms (meaning button bouncing back) + * In [5]: message.actions.append(protos.chip.rpc.Action(type=protos.chip.rpc.ActionType.WRITE_ATTRIBUTE, delayMs=2000, + * actionId=1, arg1=0)) + * + * # Define the follow action to emit an event id 0x4 (LongRelease) with data 2 (PreviousPosition) after 1000 ms + * In [6]: message.actions.append(protos.chip.rpc.Action(type=protos.chip.rpc.ActionType.EMIT_EVENT, delayMs=1000, + * actionId=4, arg1=2)) + * + * # Set the actions to device + * In [7]: rpcs.chip.rpc.Actions.Set(message, pw_rpc_timeout_s=10000) + * + */ +public: + enum class Type : uint8_t + { + Attribute = 0, + Command = 1, + Event = 2, + }; + + ::pw::Status Set(const chip_rpc_ActionsRequest & request, ::pw_protobuf_Empty & response) + + { + DeviceLayer::StackLock lock; + ChipLogProgress(NotSpecified, " request.endpoint_id=%d, request.cluster_id=%d", request.endpoint_id, request.cluster_id); + + for (int i = 0; i < request.actions_count; i++) + { + chip_rpc_Action action = request.actions[i]; + std::vector args; + if (action.has_arg1) + args.push_back(action.arg1); + if (action.has_arg2) + args.push_back(action.arg2); + if (action.has_arg3) + args.push_back(action.arg3); + + mActionsSubscribeCallback(request.endpoint_id, request.cluster_id, static_cast(action.type), action.delayMs, + action.actionId, args); + } + + return pw::OkStatus(); + } + + using RpcActionsSubscribeCallback = bool (*)(EndpointId endpointId, ClusterId clusterId, uint8_t type, uint32_t delayMs, + uint32_t actionId, std::vector args); + + void SubscribeActions(RpcActionsSubscribeCallback subscriber) { mActionsSubscribeCallback = subscriber; }; + +private: + RpcActionsSubscribeCallback mActionsSubscribeCallback; +}; + +} // namespace rpc +} // namespace chip diff --git a/examples/platform/esp32/Rpc.cpp b/examples/platform/esp32/Rpc.cpp index 61efb842f089b7..a3b61830b5a46a 100644 --- a/examples/platform/esp32/Rpc.cpp +++ b/examples/platform/esp32/Rpc.cpp @@ -52,6 +52,10 @@ #include "pigweed/rpc_services/Device.h" #endif // defined(PW_RPC_DEVICE_SERVICE) && PW_RPC_DEVICE_SERVICE +#if defined(PW_RPC_EVENT_SERVICE) && PW_RPC_EVENT_SERVICE +#include "pigweed/rpc_services/Event.h" +#endif // defined(PW_RPC_EVENT_SERVICE) && PW_RPC_EVENT_SERVICE + #if defined(PW_RPC_LIGHTING_SERVICE) && PW_RPC_LIGHTING_SERVICE #include "pigweed/rpc_services/Lighting.h" #endif // defined(PW_RPC_LIGHTING_SERVICE) && PW_RPC_LIGHTING_SERVICE @@ -275,6 +279,10 @@ static TaskHandle_t sRpcTaskHandle; StaticTask_t sRpcTaskBuffer; StackType_t sRpcTaskStack[RPC_TASK_STACK_SIZE]; +#if defined(PW_RPC_ACTIONS_SERVICE) && PW_RPC_ACTIONS_SERVICE +Actions actions_service; +#endif // defined(PW_RPC_ACTIONS_SERVICE) && PW_RPC_ACTIONS_SERVICE + #if defined(PW_RPC_ATTRIBUTE_SERVICE) && PW_RPC_ATTRIBUTE_SERVICE Attributes attributes_service; #endif // defined(PW_RPC_ATTRIBUTE_SERVICE) && PW_RPC_ATTRIBUTE_SERVICE @@ -295,6 +303,10 @@ Descriptor descriptor_service; Esp32Device device_service; #endif // defined(PW_RPC_DEVICE_SERVICE) && PW_RPC_DEVICE_SERVICE +#if defined(PW_RPC_EVENT_SERVICE) && PW_RPC_EVENT_SERVICE +Event event_service; +#endif // defined(PW_RPC_EVENT_SERVICE) && PW_RPC_EVENT_SERVICE + #if defined(PW_RPC_LIGHTING_SERVICE) && PW_RPC_LIGHTING_SERVICE Lighting lighting_service; #endif // defined(PW_RPC_LIGHTING_SERVICE) && PW_RPC_LIGHTING_SERVICE @@ -313,6 +325,10 @@ Esp32WiFi wifi_service; void RegisterServices(pw::rpc::Server & server) { +#if defined(PW_RPC_ACTIONS_SERVICE) && PW_RPC_ACTIONS_SERVICE + server.RegisterService(actions_service); +#endif // defined(PW_RPC_ACTIONS_SERVICE) && PW_RPC_ACTIONS_SERVICE + #if defined(PW_RPC_ATTRIBUTE_SERVICE) && PW_RPC_ATTRIBUTE_SERVICE server.RegisterService(attributes_service); #endif // defined(PW_RPC_ATTRIBUTE_SERVICE) && PW_RPC_ATTRIBUTE_SERVICE @@ -333,6 +349,10 @@ void RegisterServices(pw::rpc::Server & server) server.RegisterService(device_service); #endif // defined(PW_RPC_DEVICE_SERVICE) && PW_RPC_DEVICE_SERVICE +#if defined(PW_RPC_EVENT_SERVICE) && PW_RPC_EVENT_SERVICE + server.RegisterService(event_service); +#endif // defined(PW_RPC_EVENT_SERVICE) && PW_RPC_EVENT_SERVICE + #if defined(PW_RPC_LIGHTING_SERVICE) && PW_RPC_LIGHTING_SERVICE server.RegisterService(lighting_service); #endif // defined(PW_RPC_LIGHTING_SERVICE) && PW_RPC_LIGHTING_SERVICE @@ -353,6 +373,13 @@ void RegisterServices(pw::rpc::Server & server) } // namespace +#if defined(PW_RPC_ACTIONS_SERVICE) && PW_RPC_ACTIONS_SERVICE +void SubscribeActions(RpcActionsSubscribeCallback subscriber) +{ + actions_service.SubscribeActions(subscriber); +} +#endif // defined(PW_RPC_ACTIONS_SERVICE) && PW_RPC_ACTIONS_SERVICE + void RunRpcService(void *) { Start(RegisterServices, &logger_mutex); diff --git a/examples/platform/esp32/Rpc.h b/examples/platform/esp32/Rpc.h index 9b73e5cafca96b..ff1a5f319ac975 100644 --- a/examples/platform/esp32/Rpc.h +++ b/examples/platform/esp32/Rpc.h @@ -20,6 +20,18 @@ namespace chip { namespace rpc { +enum class ActionType : uint8_t +{ + WRITE_ATTRIBUTE = 0x00, // Write an cluster Attribute + RUN_COMMAND = 0x01, // Run a cluster Command + EMIT_EVENT = 0x02, // Emit a cluster Events +}; + +using RpcActionsSubscribeCallback = bool (*)(EndpointId endpointId, ClusterId clusterId, uint8_t type, uint32_t delayMs, + uint32_t actionId, std::vector args); + +void SubscribeActions(RpcActionsSubscribeCallback subscriber); + void Init(); } // namespace rpc diff --git a/examples/platform/linux/Rpc.cpp b/examples/platform/linux/Rpc.cpp index da6b73b9135c13..6e20e2aecf61b9 100644 --- a/examples/platform/linux/Rpc.cpp +++ b/examples/platform/linux/Rpc.cpp @@ -20,8 +20,16 @@ #include "pw_rpc_system_server/rpc_server.h" #include "pw_rpc_system_server/socket.h" +#include #include +#include "Rpc.h" +#include + +#if defined(PW_RPC_ACTIONS_SERVICE) && PW_RPC_ACTIONS_SERVICE +#include "pigweed/rpc_services/Actions.h" +#endif // defined(PW_RPC_ACTIONS_SERVICE) && PW_RPC_ACTIONS_SERVICE + #if defined(PW_RPC_ATTRIBUTE_SERVICE) && PW_RPC_ATTRIBUTE_SERVICE #include "pigweed/rpc_services/Attributes.h" #endif // defined(PW_RPC_ATTRIBUTE_SERVICE) && PW_RPC_ATTRIBUTE_SERVICE @@ -68,6 +76,10 @@ namespace chip { namespace rpc { namespace { +#if defined(PW_RPC_ACTIONS_SERVICE) && PW_RPC_ACTIONS_SERVICE +Actions actions_service; +#endif // defined(PW_RPC_ACTIONS_SERVICE) && PW_RPC_ACTIONS_SERVICE + #if defined(PW_RPC_ATTRIBUTE_SERVICE) && PW_RPC_ATTRIBUTE_SERVICE Attributes attributes_service; #endif // defined(PW_RPC_ATTRIBUTE_SERVICE) && PW_RPC_ATTRIBUTE_SERVICE @@ -94,6 +106,10 @@ pw::trace::TraceService trace_service(pw::trace::GetTokenizedTracer()); void RegisterServices(pw::rpc::Server & server) { +#if defined(PW_RPC_ACTIONS_SERVICE) && PW_RPC_ACTIONS_SERVICE + server.RegisterService(actions_service); +#endif // defined(PW_RPC_ACTIONS_SERVICE) && PW_RPC_ACTIONS_SERVICE + #if defined(PW_RPC_ATTRIBUTE_SERVICE) && PW_RPC_ATTRIBUTE_SERVICE server.RegisterService(attributes_service); #endif // defined(PW_RPC_ATTRIBUTE_SERVICE) && PW_RPC_ATTRIBUTE_SERVICE @@ -122,6 +138,13 @@ void RegisterServices(pw::rpc::Server & server) } // namespace +#if defined(PW_RPC_ACTIONS_SERVICE) && PW_RPC_ACTIONS_SERVICE +void SubscribeActions(RpcActionsSubscribeCallback subscriber) +{ + actions_service.SubscribeActions(subscriber); +} +#endif // defined(PW_RPC_ACTIONS_SERVICE) && PW_RPC_ACTIONS_SERVICE + void RunRpcService() { pw::rpc::system_server::Init(); diff --git a/examples/platform/linux/Rpc.h b/examples/platform/linux/Rpc.h index fbcfc6ed63f4f2..51f3f2e473bacb 100644 --- a/examples/platform/linux/Rpc.h +++ b/examples/platform/linux/Rpc.h @@ -18,9 +18,24 @@ #pragma once +#include +#include + namespace chip { namespace rpc { +enum class ActionType : uint8_t +{ + WRITE_ATTRIBUTE = 0x00, // Write an cluster Attribute + RUN_COMMAND = 0x01, // Run a cluster Command + EMIT_EVENT = 0x02, // Emit a cluster Events +}; + +using RpcActionsSubscribeCallback = bool (*)(EndpointId endpointId, ClusterId clusterId, uint8_t type, uint32_t delayMs, + uint32_t actionId, std::vector args); + +void SubscribeActions(RpcActionsSubscribeCallback subscriber); + int Init(uint16_t rpcServerPort); } // namespace rpc diff --git a/examples/platform/nrfconnect/Rpc.cpp b/examples/platform/nrfconnect/Rpc.cpp index 8b47215d6a0680..510b0ac8ac4c64 100644 --- a/examples/platform/nrfconnect/Rpc.cpp +++ b/examples/platform/nrfconnect/Rpc.cpp @@ -28,6 +28,10 @@ LOG_MODULE_DECLARE(app, CONFIG_CHIP_APP_LOG_LEVEL); +#if defined(PW_RPC_ACTIONS_SERVICE) && PW_RPC_ACTIONS_SERVICE +#include "pigweed/rpc_services/Actions.h" +#endif // defined(PW_RPC_ACTIONS_SERVICE) && PW_RPC_ACTIONS_SERVICE + #if defined(PW_RPC_ATTRIBUTE_SERVICE) && PW_RPC_ATTRIBUTE_SERVICE #include "pigweed/rpc_services/Attributes.h" #endif // defined(PW_RPC_ATTRIBUTE_SERVICE) && PW_RPC_ATTRIBUTE_SERVICE @@ -48,6 +52,10 @@ LOG_MODULE_DECLARE(app, CONFIG_CHIP_APP_LOG_LEVEL); #include "pigweed/rpc_services/Device.h" #endif // defined(PW_RPC_DEVICE_SERVICE) && PW_RPC_DEVICE_SERVICE +#if defined(PW_RPC_EVENT_SERVICE) && PW_RPC_EVENT_SERVICE +#include "pigweed/rpc_services/Event.h" +#endif // defined(PW_RPC_EVENT_SERVICE) && PW_RPC_EVENT_SERVICE + #if defined(PW_RPC_LIGHTING_SERVICE) && PW_RPC_LIGHTING_SERVICE #include "pigweed/rpc_services/Lighting.h" #endif // defined(PW_RPC_LIGHTING_SERVICE) && PW_RPC_LIGHTING_SERVICE @@ -85,6 +93,10 @@ size_t pw_trace_GetTraceTimeTicksPerSecond() namespace chip { namespace rpc { +#if defined(PW_RPC_ACTIONS_SERVICE) && PW_RPC_ACTIONS_SERVICE +Actions actions_service; +#endif // defined(PW_RPC_ACTIONS_SERVICE) && PW_RPC_ACTIONS_SERVICE + #if defined(PW_RPC_DEVICE_SERVICE) && PW_RPC_DEVICE_SERVICE namespace { @@ -159,6 +171,10 @@ Descriptor descriptor_service; NrfDevice device_service; #endif // defined(PW_RPC_DEVICE_SERVICE) && PW_RPC_DEVICE_SERVICE +#if defined(PW_RPC_EVENT_SERVICE) && PW_RPC_EVENT_SERVICE +Event event_service; +#endif // defined(PW_RPC_EVENT_SERVICE) && PW_RPC_EVENT_SERVICE + #if defined(PW_RPC_LIGHTING_SERVICE) && PW_RPC_LIGHTING_SERVICE Lighting lighting_service; #endif // defined(PW_RPC_LIGHTING_SERVICE) && PW_RPC_LIGHTING_SERVICE @@ -181,6 +197,10 @@ pw::trace::TraceService trace_service(pw::trace::GetTokenizedTracer()); void RegisterServices(pw::rpc::Server & server) { +#if defined(PW_RPC_ACTIONS_SERVICE) && PW_RPC_ACTIONS_SERVICE + server.RegisterService(actions_service); +#endif // defined(PW_RPC_ACTIONS_SERVICE) && PW_RPC_ACTIONS_SERVICE + #if defined(PW_RPC_ATTRIBUTE_SERVICE) && PW_RPC_ATTRIBUTE_SERVICE server.RegisterService(attributes_service); #endif // defined(PW_RPC_ATTRIBUTE_SERVICE) && PW_RPC_ATTRIBUTE_SERVICE @@ -201,6 +221,10 @@ void RegisterServices(pw::rpc::Server & server) server.RegisterService(device_service); #endif // defined(PW_RPC_DEVICE_SERVICE) && PW_RPC_DEVICE_SERVICE +#if defined(PW_RPC_EVENT_SERVICE) && PW_RPC_EVENT_SERVICE + server.RegisterService(event_service); +#endif // defined(PW_RPC_EVENT_SERVICE) && PW_RPC_EVENT_SERVICE + #if defined(PW_RPC_LIGHTING_SERVICE) && PW_RPC_LIGHTING_SERVICE server.RegisterService(lighting_service); #endif // defined(PW_RPC_LIGHTING_SERVICE) && PW_RPC_LIGHTING_SERVICE @@ -225,6 +249,13 @@ void RegisterServices(pw::rpc::Server & server) } // namespace +#if defined(PW_RPC_ACTIONS_SERVICE) && PW_RPC_ACTIONS_SERVICE +void SubscribeActions(RpcActionsSubscribeCallback subscriber) +{ + actions_service.SubscribeActions(subscriber); +} +#endif // defined(PW_RPC_ACTIONS_SERVICE) && PW_RPC_ACTIONS_SERVICE + void RunRpcService(void *, void *, void *) { Start(RegisterServices, &logger_mutex); diff --git a/examples/platform/nrfconnect/Rpc.h b/examples/platform/nrfconnect/Rpc.h index f0aeaf45b61fba..40efcb0750ca2b 100644 --- a/examples/platform/nrfconnect/Rpc.h +++ b/examples/platform/nrfconnect/Rpc.h @@ -23,6 +23,18 @@ namespace chip { namespace rpc { +enum class ActionType : uint8_t +{ + WRITE_ATTRIBUTE = 0x00, // Write an cluster Attribute + RUN_COMMAND = 0x01, // Run a cluster Command + EMIT_EVENT = 0x02, // Emit a cluster Events +}; + +using RpcActionsSubscribeCallback = bool (*)(EndpointId endpointId, ClusterId clusterId, uint8_t type, uint32_t delayMs, + uint32_t actionId, std::vector args); + +void SubscribeActions(RpcActionsSubscribeCallback subscriber); + class NrfButton; void RunRpcService(void *, void *, void *); From 6b8368981061fc0b606c99ec9858065f0d215054 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Mon, 27 May 2024 12:42:06 -0400 Subject: [PATCH 02/43] Use AddResponse instead of AddResponseData when no error checking is performed (#33598) Co-authored-by: Andrei Litvin --- .../tv-app/android/java/ContentAppCommandDelegate.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/tv-app/android/java/ContentAppCommandDelegate.cpp b/examples/tv-app/android/java/ContentAppCommandDelegate.cpp index a4a8d09396ae53..199ec7761be0c8 100644 --- a/examples/tv-app/android/java/ContentAppCommandDelegate.cpp +++ b/examples/tv-app/android/java/ContentAppCommandDelegate.cpp @@ -197,7 +197,7 @@ void ContentAppCommandDelegate::FormatResponseData(CommandHandlerInterface::Hand } else { - handlerContext.mCommandHandler.AddResponseData(handlerContext.mRequestPath, launchResponse); + handlerContext.mCommandHandler.AddResponse(handlerContext.mRequestPath, launchResponse); } break; } @@ -211,7 +211,7 @@ void ContentAppCommandDelegate::FormatResponseData(CommandHandlerInterface::Hand } else { - handlerContext.mCommandHandler.AddResponseData(handlerContext.mRequestPath, navigateTargetResponse); + handlerContext.mCommandHandler.AddResponse(handlerContext.mRequestPath, navigateTargetResponse); } break; } @@ -225,7 +225,7 @@ void ContentAppCommandDelegate::FormatResponseData(CommandHandlerInterface::Hand } else { - handlerContext.mCommandHandler.AddResponseData(handlerContext.mRequestPath, playbackResponse); + handlerContext.mCommandHandler.AddResponse(handlerContext.mRequestPath, playbackResponse); } break; } @@ -244,7 +244,7 @@ void ContentAppCommandDelegate::FormatResponseData(CommandHandlerInterface::Hand } else { - handlerContext.mCommandHandler.AddResponseData(handlerContext.mRequestPath, getSetupPINresponse); + handlerContext.mCommandHandler.AddResponse(handlerContext.mRequestPath, getSetupPINresponse); } break; } From 16d6475ef81f890371ab0d1b1f7e42ea4318d13a Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Mon, 27 May 2024 21:21:43 -0400 Subject: [PATCH 03/43] Minimize API surface that is templated for `CommandHandler` (#33620) * Define a EncodeToTLV inteface for the command handler * Slight documentation update * Comments update --- src/app/CommandHandler.h | 92 ++++++++++++++++++++++++++++++---------- 1 file changed, 70 insertions(+), 22 deletions(-) diff --git a/src/app/CommandHandler.h b/src/app/CommandHandler.h index cce19879a6c8a9..96b7af873554ed 100644 --- a/src/app/CommandHandler.h +++ b/src/app/CommandHandler.h @@ -57,6 +57,32 @@ namespace chip { namespace app { +/// Defines an abstract class of something that can be encoded +/// into a TLV with a given data tag +class EncoderToTLV +{ +public: + virtual ~EncoderToTLV() = default; + + virtual CHIP_ERROR Encode(TLV::TLVWriter &, TLV::Tag tag) = 0; +}; + +/// An `EncoderToTLV` the uses `DataModel::Encode` to encode things. +/// +/// Generally useful to encode things like ::Commands::::Type +/// structures. +template +class DataModelEncoderToTLV : public EncoderToTLV +{ +public: + DataModelEncoderToTLV(const T & value) : mValue(value) {} + + virtual CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) { return DataModel::Encode(writer, tag, mValue); } + +private: + const T & mValue; +}; + class CommandHandler { public: @@ -325,14 +351,37 @@ class CommandHandler * @param [in] aRequestCommandPath the concrete path of the command we are * responding to. * @param [in] aData the data for the response. + * + * NOTE: this is a convenience function for `AddResponseDataViaEncoder` */ template - CHIP_ERROR AddResponseData(const ConcreteCommandPath & aRequestCommandPath, const CommandData & aData) + inline CHIP_ERROR AddResponseData(const ConcreteCommandPath & aRequestCommandPath, const CommandData & aData) + { + DataModelEncoderToTLV encoder(aData); + return AddResponseDataViaEncoder(aRequestCommandPath, CommandData::GetCommandId(), encoder); + } + + /** + * API for adding a data response. The encoded is generally expected to encode + * a ClusterName::Commands::CommandName::Type struct, but any + * object should work. + * + * @param [in] aRequestCommandPath the concrete path of the command we are + * responding to. + * @param [in] commandId the command whose content is being encoded. + * @param [in] encoder - an encoder that places the command data structure for `commandId` + * into a TLV Writer. + * + * Most applications are likely to use `AddResponseData` as a more convenient + * one-call that auto-sets command ID and creates the underlying encoders. + */ + CHIP_ERROR AddResponseDataViaEncoder(const ConcreteCommandPath & aRequestCommandPath, CommandId commandId, + EncoderToTLV & encoder) { // Return early when response should not be sent out. VerifyOrReturnValue(ResponsesAccepted(), CHIP_NO_ERROR); - - return TryAddingResponse([&]() -> CHIP_ERROR { return TryAddResponseData(aRequestCommandPath, aData); }); + return TryAddingResponse( + [&]() -> CHIP_ERROR { return TryAddResponseDataViaEncoder(aRequestCommandPath, commandId, encoder); }); } /** @@ -350,9 +399,21 @@ class CommandHandler * @param [in] aData the data for the response. */ template - void AddResponse(const ConcreteCommandPath & aRequestCommandPath, const CommandData & aData) + inline void AddResponse(const ConcreteCommandPath & aRequestCommandPath, const CommandData & aData) { - if (AddResponseData(aRequestCommandPath, aData) != CHIP_NO_ERROR) + DataModelEncoderToTLV encoder(aData); + return AddResponseViaEncoder(aRequestCommandPath, CommandData::GetCommandId(), encoder); + } + + /** + * API for adding a response with a given encoder of TLV data. + * + * The encoder would generally encode a ClusterName::Commands::CommandName::Type with + * the corresponding `GetCommandId` call. + */ + void AddResponseViaEncoder(const ConcreteCommandPath & aRequestCommandPath, CommandId commandId, EncoderToTLV & encoder) + { + if (AddResponseDataViaEncoder(aRequestCommandPath, commandId, encoder) != CHIP_NO_ERROR) { AddStatus(aRequestCommandPath, Protocols::InteractionModel::Status::Failure); } @@ -630,7 +691,6 @@ class CommandHandler return PrepareInvokeResponseCommand(aResponseCommandPath, prepareParams); } - // TODO(#31627): It would be awesome if we could remove this template all together. /** * If this function fails, it may leave our TLV buffer in an inconsistent state. * Callers should snapshot as needed before calling this function, and roll back @@ -640,26 +700,14 @@ class CommandHandler * responding to. * @param [in] aData the data for the response. */ - template - CHIP_ERROR TryAddResponseData(const ConcreteCommandPath & aRequestCommandPath, const CommandData & aData) + CHIP_ERROR TryAddResponseDataViaEncoder(const ConcreteCommandPath & aRequestCommandPath, CommandId commandId, + EncoderToTLV & encoder) { - // This method, templated with CommandData, captures all the components needs - // from CommandData with as little code as possible. - // - // Previously, non-essential code was unnecessarily templated, leading to - // compilation and duplication N times. By isolating only the code segments - // that genuinely require templating, minimizes duplicate compiled code. - ConcreteCommandPath responseCommandPath = { aRequestCommandPath.mEndpointId, aRequestCommandPath.mClusterId, - CommandData::GetCommandId() }; + ConcreteCommandPath responseCommandPath = { aRequestCommandPath.mEndpointId, aRequestCommandPath.mClusterId, commandId }; ReturnErrorOnFailure(TryAddResponseDataPreEncode(aRequestCommandPath, responseCommandPath)); TLV::TLVWriter * writer = GetCommandDataIBTLVWriter(); VerifyOrReturnError(writer != nullptr, CHIP_ERROR_INCORRECT_STATE); - ReturnErrorOnFailure(DataModel::Encode(*writer, TLV::ContextTag(CommandDataIB::Tag::kFields), aData)); - - // FinishCommand technically should be refactored out as it is not a command that needs templating. - // But, because there is only a single function call, keeping it here takes less code. If there is - // ever more code between DataModel::Encode and the end of this function, it should be broken out into - // TryAddResponseDataPostEncode. + ReturnErrorOnFailure(encoder.Encode(*writer, TLV::ContextTag(CommandDataIB::Tag::kFields))); return FinishCommand(/* aEndDataStruct = */ false); } From b9eee2802ecfe6c9be96c2b9ef3e6c845c7954e9 Mon Sep 17 00:00:00 2001 From: Arkadiusz Bokowy Date: Tue, 28 May 2024 15:16:41 +0200 Subject: [PATCH 04/43] [Tizen] Add libatomic.so to QEMU Docker image (#33631) --- integrations/docker/images/base/chip-build/version | 2 +- .../docker/images/stage-3/chip-build-tizen-qemu/Dockerfile | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/integrations/docker/images/base/chip-build/version b/integrations/docker/images/base/chip-build/version index 9a59e96c18355c..05ab2a03dbdb4f 100644 --- a/integrations/docker/images/base/chip-build/version +++ b/integrations/docker/images/base/chip-build/version @@ -1 +1 @@ -52 : [NXP] Update K32W0 SDK to 2.6.14 \ No newline at end of file +53 : [Tizen] Add libatomic.so to QEMU Docker image diff --git a/integrations/docker/images/stage-3/chip-build-tizen-qemu/Dockerfile b/integrations/docker/images/stage-3/chip-build-tizen-qemu/Dockerfile index ff63e5c1940a01..8c38d19c1b3ed8 100644 --- a/integrations/docker/images/stage-3/chip-build-tizen-qemu/Dockerfile +++ b/integrations/docker/images/stage-3/chip-build-tizen-qemu/Dockerfile @@ -84,6 +84,7 @@ RUN set -x \ # Add extra libraries to the root image && guestfish --rw -a $TIZEN_IOT_IMAGE_ROOT -m /dev/sda copy-in \ $TIZEN_SDK_TOOLCHAIN/arm-tizen-linux-gnueabi/lib/libasan.so.* \ + $TIZEN_SDK_TOOLCHAIN/arm-tizen-linux-gnueabi/lib/libatomic.so.* \ $TIZEN_SDK_TOOLCHAIN/arm-tizen-linux-gnueabi/lib/libubsan.so.* \ $TIZEN_SDK_SYSROOT/usr/lib/libbluetooth-api.so.* \ $TIZEN_SDK_SYSROOT/usr/lib/libcapi-network-bluetooth.so.* \ From 4dac5367c3f20c0c3d6ea1f428b375bdfec0e0d7 Mon Sep 17 00:00:00 2001 From: Karsten Sperling <113487422+ksperling-apple@users.noreply.github.com> Date: Wed, 29 May 2024 01:44:55 +1200 Subject: [PATCH 05/43] Linux: Guard mallinfo() use behind check for __GLIBC__ (#33626) * Linux: Guard mallinfo() use behind check for __GLIBC__ * Use positive checks for __GLIBC__ rather than ifndef --- .../Linux/DiagnosticDataProviderImpl.cpp | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/platform/Linux/DiagnosticDataProviderImpl.cpp b/src/platform/Linux/DiagnosticDataProviderImpl.cpp index 5ee5558064afeb..bebe5827163fa9 100644 --- a/src/platform/Linux/DiagnosticDataProviderImpl.cpp +++ b/src/platform/Linux/DiagnosticDataProviderImpl.cpp @@ -74,8 +74,10 @@ enum class WiFiStatsCountType kWiFiOverrunCount }; +#if defined(__GLIBC__) // Static variable to store the maximum heap size static size_t maxHeapHighWatermark = 0; +#endif CHIP_ERROR GetEthernetStatsCount(EthernetStatsCountType type, uint64_t & count) { @@ -223,9 +225,7 @@ DiagnosticDataProviderImpl & DiagnosticDataProviderImpl::GetDefaultInstance() CHIP_ERROR DiagnosticDataProviderImpl::GetCurrentHeapFree(uint64_t & currentHeapFree) { -#ifndef __GLIBC__ - return CHIP_ERROR_NOT_IMPLEMENTED; -#else +#if defined(__GLIBC__) struct mallinfo mallocInfo = mallinfo(); // Get the current amount of heap memory, in bytes, that are not being utilized @@ -233,14 +233,14 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetCurrentHeapFree(uint64_t & currentHeap currentHeapFree = mallocInfo.fordblks; return CHIP_NO_ERROR; +#else + return CHIP_ERROR_NOT_IMPLEMENTED; #endif } CHIP_ERROR DiagnosticDataProviderImpl::GetCurrentHeapUsed(uint64_t & currentHeapUsed) { -#ifndef __GLIBC__ - return CHIP_ERROR_NOT_IMPLEMENTED; -#else +#if defined(__GLIBC__) struct mallinfo mallocInfo = mallinfo(); // Get the current amount of heap memory, in bytes, that are being used by @@ -253,14 +253,14 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetCurrentHeapUsed(uint64_t & currentHeap maxHeapHighWatermark = currentHeapUsed; } return CHIP_NO_ERROR; +#else + return CHIP_ERROR_NOT_IMPLEMENTED; #endif } CHIP_ERROR DiagnosticDataProviderImpl::GetCurrentHeapHighWatermark(uint64_t & currentHeapHighWatermark) { -#ifndef __GLIBC__ - return CHIP_ERROR_NOT_IMPLEMENTED; -#else +#if defined(__GLIBC__) struct mallinfo mallocInfo = mallinfo(); // The usecase of this function is embedded devices,on which we would need to intercept @@ -279,6 +279,8 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetCurrentHeapHighWatermark(uint64_t & cu currentHeapHighWatermark = maxHeapHighWatermark; return CHIP_NO_ERROR; +#else + return CHIP_ERROR_NOT_IMPLEMENTED; #endif } @@ -287,10 +289,12 @@ CHIP_ERROR DiagnosticDataProviderImpl::ResetWatermarks() // If implemented, the server SHALL set the value of the CurrentHeapHighWatermark attribute to the // value of the CurrentHeapUsed. +#if defined(__GLIBC__) // Get the current amount of heap memory, in bytes, that are being used by // the current running program and reset the max heap high watermark to current heap amount. struct mallinfo mallocInfo = mallinfo(); maxHeapHighWatermark = mallocInfo.uordblks; +#endif return CHIP_NO_ERROR; } From c7b4965356abe49439348548259199a8daec3e05 Mon Sep 17 00:00:00 2001 From: jamesharrow <93921463+jamesharrow@users.noreply.github.com> Date: Tue, 28 May 2024 14:45:33 +0100 Subject: [PATCH 06/43] Remove provisional from evse, evse mode, epm, eem, power topology (#33558) * XML file changes to remove apiMaturity="provisional" for clusters and features which are approved in Matter 1.3 * Removed stray text. * Updated after regen_all --- .../all-clusters-app.matter | 10 ++-- .../energy-management-app.matter | 10 ++-- .../electrical-energy-measurement-cluster.xml | 10 ++-- .../electrical-power-measurement-cluster.xml | 10 ++-- .../data-model/chip/energy-evse-cluster.xml | 60 +++++++++---------- .../chip/energy-evse-mode-cluster.xml | 2 +- .../chip/power-topology-cluster.xml | 2 +- .../data_model/controller-clusters.matter | 10 ++-- 8 files changed, 57 insertions(+), 57 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 03e3cc6ca3fe20..719293ab5f877a 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -3876,7 +3876,7 @@ cluster ValveConfigurationAndControl = 129 { } /** This cluster provides a mechanism for querying data about electrical power as measured by the server. */ -provisional cluster ElectricalPowerMeasurement = 144 { +cluster ElectricalPowerMeasurement = 144 { revision 1; enum MeasurementTypeEnum : enum16 { @@ -3981,7 +3981,7 @@ provisional cluster ElectricalPowerMeasurement = 144 { } /** This cluster provides a mechanism for querying data about the electrical energy imported or provided by the server. */ -provisional cluster ElectricalEnergyMeasurement = 145 { +cluster ElectricalEnergyMeasurement = 145 { revision 1; enum MeasurementTypeEnum : enum16 { @@ -4278,7 +4278,7 @@ provisional cluster DeviceEnergyManagement = 152 { } /** Electric Vehicle Supply Equipment (EVSE) is equipment used to charge an Electric Vehicle (EV) or Plug-In Hybrid Electric Vehicle. This cluster provides an interface to the functionality of Electric Vehicle Supply Equipment (EVSE) management. */ -provisional cluster EnergyEvse = 153 { +cluster EnergyEvse = 153 { revision 2; enum EnergyTransferStoppedReasonEnum : enum8 { @@ -4490,7 +4490,7 @@ provisional cluster EnergyPreference = 155 { } /** The Power Topology Cluster provides a mechanism for expressing how power is flowing between endpoints. */ -provisional cluster PowerTopology = 156 { +cluster PowerTopology = 156 { revision 1; bitmap Feature : bitmap32 { @@ -4511,7 +4511,7 @@ provisional cluster PowerTopology = 156 { } /** Attributes and commands for selecting a mode from a list of supported options. */ -provisional cluster EnergyEvseMode = 157 { +cluster EnergyEvseMode = 157 { revision 1; enum ModeTag : enum16 { diff --git a/examples/energy-management-app/energy-management-common/energy-management-app.matter b/examples/energy-management-app/energy-management-common/energy-management-app.matter index ea4e5db21a0b18..68db2eea271ec3 100644 --- a/examples/energy-management-app/energy-management-common/energy-management-app.matter +++ b/examples/energy-management-app/energy-management-common/energy-management-app.matter @@ -1237,7 +1237,7 @@ cluster GroupKeyManagement = 63 { } /** This cluster provides a mechanism for querying data about electrical power as measured by the server. */ -provisional cluster ElectricalPowerMeasurement = 144 { +cluster ElectricalPowerMeasurement = 144 { revision 1; enum MeasurementTypeEnum : enum16 { @@ -1342,7 +1342,7 @@ provisional cluster ElectricalPowerMeasurement = 144 { } /** This cluster provides a mechanism for querying data about the electrical energy imported or provided by the server. */ -provisional cluster ElectricalEnergyMeasurement = 145 { +cluster ElectricalEnergyMeasurement = 145 { revision 1; enum MeasurementTypeEnum : enum16 { @@ -1639,7 +1639,7 @@ provisional cluster DeviceEnergyManagement = 152 { } /** Electric Vehicle Supply Equipment (EVSE) is equipment used to charge an Electric Vehicle (EV) or Plug-In Hybrid Electric Vehicle. This cluster provides an interface to the functionality of Electric Vehicle Supply Equipment (EVSE) management. */ -provisional cluster EnergyEvse = 153 { +cluster EnergyEvse = 153 { revision 2; enum EnergyTransferStoppedReasonEnum : enum8 { @@ -1817,7 +1817,7 @@ provisional cluster EnergyEvse = 153 { } /** The Power Topology Cluster provides a mechanism for expressing how power is flowing between endpoints. */ -provisional cluster PowerTopology = 156 { +cluster PowerTopology = 156 { revision 1; bitmap Feature : bitmap32 { @@ -1838,7 +1838,7 @@ provisional cluster PowerTopology = 156 { } /** Attributes and commands for selecting a mode from a list of supported options. */ -provisional cluster EnergyEvseMode = 157 { +cluster EnergyEvseMode = 157 { revision 1; enum ModeTag : enum16 { diff --git a/src/app/zap-templates/zcl/data-model/chip/electrical-energy-measurement-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/electrical-energy-measurement-cluster.xml index 0a4039badf7c97..eb05052538d2de 100644 --- a/src/app/zap-templates/zcl/data-model/chip/electrical-energy-measurement-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/electrical-energy-measurement-cluster.xml @@ -16,7 +16,7 @@ limitations under the License. --> - + Electrical Energy Measurement Measurement & Sensing 0x0091 @@ -52,25 +52,25 @@ limitations under the License. PeriodicEnergyExported CumulativeEnergyReset - + CumulativeEnergyMeasured - + PeriodicEnergyMeasured - + - + diff --git a/src/app/zap-templates/zcl/data-model/chip/electrical-power-measurement-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/electrical-power-measurement-cluster.xml index 69be8e08570f39..7f49a643d1b1f9 100644 --- a/src/app/zap-templates/zcl/data-model/chip/electrical-power-measurement-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/electrical-power-measurement-cluster.xml @@ -16,7 +16,7 @@ limitations under the License. --> - + Electrical Power Measurement Measurement & Sensing 0x0090 @@ -82,18 +82,18 @@ limitations under the License. PowerFactor NeutralCurrent - + MeasurementPeriodRanges - + - + @@ -107,7 +107,7 @@ limitations under the License. - + diff --git a/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml index cbc0882ac1b3ac..5c22b8e93be8da 100644 --- a/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml @@ -14,7 +14,7 @@ limitations under the License. - + @@ -25,7 +25,7 @@ limitations under the License. - + @@ -34,7 +34,7 @@ limitations under the License. - + @@ -55,7 +55,7 @@ limitations under the License. - + @@ -86,7 +86,7 @@ limitations under the License. - + Energy EVSE Energy Management 0x0099 @@ -177,7 +177,7 @@ limitations under the License. Allows a client to disable the EVSE from charging and discharging. - + @@ -188,7 +188,7 @@ limitations under the License. Allows a client to enable the EVSE to discharge an EV. - + Allows a client to put the EVSE into a self-diagnostics mode. @@ -205,41 +205,41 @@ limitations under the License. The GetTargetsResponse is sent in response to the GetTargets Command. - + EVConnected - + - + EVNotDetected - - - - + + + + - + EnergyTransferStarted - - - + + + - + EnergyTransferStopped - - - - + + + + - + Fault - - - - + + + + - + RFID - + diff --git a/src/app/zap-templates/zcl/data-model/chip/energy-evse-mode-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/energy-evse-mode-cluster.xml index 22e5562ed33f7f..c4b702b701d174 100644 --- a/src/app/zap-templates/zcl/data-model/chip/energy-evse-mode-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/energy-evse-mode-cluster.xml @@ -24,7 +24,7 @@ limitations under the License. - + General Energy EVSE Mode 0x009D diff --git a/src/app/zap-templates/zcl/data-model/chip/power-topology-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/power-topology-cluster.xml index 2fdddcbe3560da..3bca0bd43ee8af 100644 --- a/src/app/zap-templates/zcl/data-model/chip/power-topology-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/power-topology-cluster.xml @@ -17,7 +17,7 @@ limitations under the License. - + Measurement & Sensing Power Topology 0x009C diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index dcc22df982b9e5..cd310219ea88d2 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -4112,7 +4112,7 @@ cluster ValveConfigurationAndControl = 129 { } /** This cluster provides a mechanism for querying data about electrical power as measured by the server. */ -provisional cluster ElectricalPowerMeasurement = 144 { +cluster ElectricalPowerMeasurement = 144 { revision 1; enum MeasurementTypeEnum : enum16 { @@ -4217,7 +4217,7 @@ provisional cluster ElectricalPowerMeasurement = 144 { } /** This cluster provides a mechanism for querying data about the electrical energy imported or provided by the server. */ -provisional cluster ElectricalEnergyMeasurement = 145 { +cluster ElectricalEnergyMeasurement = 145 { revision 1; enum MeasurementTypeEnum : enum16 { @@ -4803,7 +4803,7 @@ provisional cluster DeviceEnergyManagement = 152 { } /** Electric Vehicle Supply Equipment (EVSE) is equipment used to charge an Electric Vehicle (EV) or Plug-In Hybrid Electric Vehicle. This cluster provides an interface to the functionality of Electric Vehicle Supply Equipment (EVSE) management. */ -provisional cluster EnergyEvse = 153 { +cluster EnergyEvse = 153 { revision 2; enum EnergyTransferStoppedReasonEnum : enum8 { @@ -5015,7 +5015,7 @@ provisional cluster EnergyPreference = 155 { } /** The Power Topology Cluster provides a mechanism for expressing how power is flowing between endpoints. */ -provisional cluster PowerTopology = 156 { +cluster PowerTopology = 156 { revision 1; bitmap Feature : bitmap32 { @@ -5036,7 +5036,7 @@ provisional cluster PowerTopology = 156 { } /** Attributes and commands for selecting a mode from a list of supported options. */ -provisional cluster EnergyEvseMode = 157 { +cluster EnergyEvseMode = 157 { revision 1; enum ModeTag : enum16 { From 533df0c7ab1b9d7b7bb41e4ab119985c0bfe43ca Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 28 May 2024 10:19:41 -0400 Subject: [PATCH 07/43] Fix test by making darwin-framework-tool use the same command timeout as chip-tool. (#33633) The commands now take a bit longer to time out on the exchange level, so we were hitting the test timeout. --- .../commands/clusters/ModelCommandBridge.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/darwin-framework-tool/commands/clusters/ModelCommandBridge.h b/examples/darwin-framework-tool/commands/clusters/ModelCommandBridge.h index 447d2c2ae5ccf6..2deb7cfb4cac5e 100644 --- a/examples/darwin-framework-tool/commands/clusters/ModelCommandBridge.h +++ b/examples/darwin-framework-tool/commands/clusters/ModelCommandBridge.h @@ -38,7 +38,7 @@ class ModelCommand : public CHIPCommandBridge /////////// CHIPCommand Interface ///////// CHIP_ERROR RunCommand() override; - chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(10); } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(20); } virtual CHIP_ERROR SendCommand(MTRBaseDevice * _Nonnull device, chip::EndpointId endPointId) = 0; From 5656870a131ae7611c838a3c82ececc7796c8235 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 28 May 2024 13:26:49 -0400 Subject: [PATCH 08/43] Start the helper apps for the MTRDevice pool test as part of the test. (#33604) We're actually hitting random failures where the apps get started, but over 15 minutes pass before the test tries to commission them, which causes them to close their commissioning windows, which makes the test fail. The fix is to just start the apps right when we're about to need them. --- .github/workflows/darwin.yaml | 13 +++---- .../CHIPTests/MTRCommissionableBrowserTests.m | 9 ++--- .../CHIPTests/MTRPerControllerStorageTests.m | 34 +++++++++++++------ .../TestHelpers/MTRTestServerAppRunner.m | 2 +- 4 files changed, 30 insertions(+), 28 deletions(-) diff --git a/.github/workflows/darwin.yaml b/.github/workflows/darwin.yaml index ad2a513209cc65..ba9c0f1d9f02c3 100644 --- a/.github/workflows/darwin.yaml +++ b/.github/workflows/darwin.yaml @@ -97,10 +97,10 @@ jobs: bootstrap-logs-framework-${{ matrix.options.flavor }} - name: Build example All Clusters Server run: | - scripts/examples/gn_build_example.sh examples/all-clusters-app/linux out/debug chip_config_network_layer_ble=false + scripts/examples/gn_build_example.sh examples/all-clusters-app/linux out/debug/all-clusters-app chip_config_network_layer_ble=false - name: Build example OTA Provider run: | - scripts/examples/gn_build_example.sh examples/ota-provider-app/linux out/debug chip_config_network_layer_ble=false + scripts/examples/gn_build_example.sh examples/ota-provider-app/linux out/debug/ota-provider-app chip_config_network_layer_ble=false - name: Build example OTA Requestor run: | scripts/examples/gn_build_example.sh examples/ota-requestor-app/linux out/debug/ota-requestor-app chip_config_network_layer_ble=false non_spec_compliant_ota_action_delay_floor=0 @@ -113,13 +113,8 @@ jobs: run: | mkdir -p /tmp/darwin/framework-tests echo "This is a simple log" > /tmp/darwin/framework-tests/end_user_support_log.txt - ../../../out/debug/chip-all-clusters-app --interface-id -1 --end_user_support_log /tmp/darwin/framework-tests/end_user_support_log.txt > >(tee /tmp/darwin/framework-tests/all-cluster-app.log) 2> >(tee /tmp/darwin/framework-tests/all-cluster-app-err.log >&2) & - ../../../out/debug/chip-all-clusters-app --interface-id -1 --dac_provider ../../../credentials/development/commissioner_dut/struct_cd_origin_pid_vid_correct/test_case_vector.json --product-id 32768 --discriminator 3839 --secured-device-port 5539 --KVS /tmp/chip-all-clusters-app-kvs2 > >(tee /tmp/darwin/framework-tests/all-cluster-app-origin-vid.log) 2> >(tee /tmp/darwin/framework-tests/all-cluster-app-origin-vid-err.log >&2) & - ../../../out/debug/chip-all-clusters-app --interface-id -1 --discriminator 101 --passcode 1001 --KVS /tmp/chip-all-clusters-app-kvs101 --secured-device-port 5531 & - ../../../out/debug/chip-all-clusters-app --interface-id -1 --discriminator 102 --passcode 1002 --KVS /tmp/chip-all-clusters-app-kvs102 --secured-device-port 5532 & - ../../../out/debug/chip-all-clusters-app --interface-id -1 --discriminator 103 --passcode 1003 --KVS /tmp/chip-all-clusters-app-kvs103 --secured-device-port 5533 & - ../../../out/debug/chip-all-clusters-app --interface-id -1 --discriminator 104 --passcode 1004 --KVS /tmp/chip-all-clusters-app-kvs104 --secured-device-port 5534 & - ../../../out/debug/chip-all-clusters-app --interface-id -1 --discriminator 105 --passcode 1005 --KVS /tmp/chip-all-clusters-app-kvs105 --secured-device-port 5535 & + ../../../out/debug/all-clusters-app/chip-all-clusters-app --interface-id -1 --end_user_support_log /tmp/darwin/framework-tests/end_user_support_log.txt > >(tee /tmp/darwin/framework-tests/all-cluster-app.log) 2> >(tee /tmp/darwin/framework-tests/all-cluster-app-err.log >&2) & + ../../../out/debug/all-clusters-app/chip-all-clusters-app --interface-id -1 --dac_provider ../../../credentials/development/commissioner_dut/struct_cd_origin_pid_vid_correct/test_case_vector.json --product-id 32768 --discriminator 3839 --secured-device-port 5539 --KVS /tmp/chip-all-clusters-app-kvs2 > >(tee /tmp/darwin/framework-tests/all-cluster-app-origin-vid.log) 2> >(tee /tmp/darwin/framework-tests/all-cluster-app-origin-vid-err.log >&2) & export TEST_RUNNER_ASAN_OPTIONS=__CURRENT_VALUE__:detect_stack_use_after_return=1 diff --git a/src/darwin/Framework/CHIPTests/MTRCommissionableBrowserTests.m b/src/darwin/Framework/CHIPTests/MTRCommissionableBrowserTests.m index 4253625af80ff7..047ce4f8588816 100644 --- a/src/darwin/Framework/CHIPTests/MTRCommissionableBrowserTests.m +++ b/src/darwin/Framework/CHIPTests/MTRCommissionableBrowserTests.m @@ -34,13 +34,8 @@ static const uint16_t kTestProductId2 = 0x8001u; static const uint16_t kTestDiscriminator1 = 3840u; static const uint16_t kTestDiscriminator2 = 3839u; -static const uint16_t kTestDiscriminator3 = 101u; -static const uint16_t kTestDiscriminator4 = 102u; -static const uint16_t kTestDiscriminator5 = 103u; -static const uint16_t kTestDiscriminator6 = 104u; -static const uint16_t kTestDiscriminator7 = 105u; static const uint16_t kDiscoverDeviceTimeoutInSeconds = 10; -static const uint16_t kExpectedDiscoveredDevicesCount = 7; +static const uint16_t kExpectedDiscoveredDevicesCount = 2; // Singleton controller we use. static MTRDeviceController * sController = nil; @@ -102,7 +97,7 @@ - (void)controller:(MTRDeviceController *)controller didFindCommissionableDevice XCTAssertEqual(instanceName.length, 16); // The instance name is random, so just ensure the len is right. XCTAssertEqualObjects(vendorId, @(kTestVendorId)); XCTAssertTrue([productId isEqual:@(kTestProductId1)] || [productId isEqual:@(kTestProductId2)]); - XCTAssertTrue([discriminator isEqual:@(kTestDiscriminator1)] || [discriminator isEqual:@(kTestDiscriminator2)] || [discriminator isEqual:@(kTestDiscriminator3)] || [discriminator isEqual:@(kTestDiscriminator4)] || [discriminator isEqual:@(kTestDiscriminator5)] || [discriminator isEqual:@(kTestDiscriminator6)] || [discriminator isEqual:@(kTestDiscriminator7)]); + XCTAssertTrue([discriminator isEqual:@(kTestDiscriminator1)] || [discriminator isEqual:@(kTestDiscriminator2)]); XCTAssertEqual(commissioningMode, YES); NSLog(@"Found Device (%@) with discriminator: %@ (vendor: %@, product: %@)", instanceName, discriminator, vendorId, productId); diff --git a/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m b/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m index c5e39276323891..601cbcc9125536 100644 --- a/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m +++ b/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m @@ -29,6 +29,7 @@ #import "MTRTestKeys.h" #import "MTRTestPerControllerStorage.h" #import "MTRTestResetCommissioneeHelper.h" +#import "MTRTestServerAppRunner.h" static const uint16_t kPairingTimeoutInSeconds = 10; static const uint16_t kTimeoutInSeconds = 3; @@ -2147,7 +2148,7 @@ - (void)testSetMRPParametersWithRunningController } // TODO: This might also want to go in a separate test file, with some shared setup for commissioning devices per test -- (void)doTestSubscriptionPoolWithSize:(NSInteger)subscriptionPoolSize +- (void)doTestSubscriptionPoolWithSize:(NSInteger)subscriptionPoolSize deviceOnboardingPayloads:(NSDictionary *)deviceOnboardingPayloads { __auto_type * factory = [MTRDeviceControllerFactory sharedInstance]; XCTAssertNotNil(factory); @@ -2183,15 +2184,7 @@ - (void)doTestSubscriptionPoolWithSize:(NSInteger)subscriptionPoolSize XCTAssertEqualObjects(controller.controllerNodeID, nodeID); - // QRCodes generated for discriminators 101~105 and passcodes 1001~1005 NSArray * orderedDeviceIDs = @[ @(101), @(102), @(103), @(104), @(105) ]; - NSDictionary * deviceOnboardingPayloads = @{ - @(101) : @"MT:00000EBQ15IZC900000", - @(102) : @"MT:00000MNY16-AD900000", - @(103) : @"MT:00000UZ427GOD900000", - @(104) : @"MT:00000CQM00Z.D900000", - @(105) : @"MT:00000K0V01FDE900000", - }; // Commission 5 devices for (NSNumber * deviceID in orderedDeviceIDs) { @@ -2272,8 +2265,27 @@ - (void)doTestSubscriptionPoolWithSize:(NSInteger)subscriptionPoolSize - (void)testSubscriptionPool { - [self doTestSubscriptionPoolWithSize:1]; - [self doTestSubscriptionPoolWithSize:2]; + // QRCodes generated for discriminators 1111~1115 and passcodes 1001~1005 + NSDictionary * deviceOnboardingPayloads = @{ + @(101) : @"MT:00000UZ427U0D900000", + @(102) : @"MT:00000CQM00BED900000", + @(103) : @"MT:00000K0V01TRD900000", + @(104) : @"MT:00000SC11293E900000", + @(105) : @"MT:00000-O913RGE900000", + }; + + // Start our helper apps. + __auto_type * sortedKeys = [[deviceOnboardingPayloads allKeys] sortedArrayUsingSelector:@selector(compare:)]; + for (NSNumber * deviceID in sortedKeys) { + __auto_type * appRunner = [[MTRTestServerAppRunner alloc] initWithAppName:@"all-clusters" + arguments:@[] + payload:deviceOnboardingPayloads[deviceID] + testcase:self]; + XCTAssertNotNil(appRunner); + } + + [self doTestSubscriptionPoolWithSize:1 deviceOnboardingPayloads:deviceOnboardingPayloads]; + [self doTestSubscriptionPoolWithSize:2 deviceOnboardingPayloads:deviceOnboardingPayloads]; } @end diff --git a/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestServerAppRunner.m b/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestServerAppRunner.m index 83912e9eb2dc0b..18424ed332a6af 100644 --- a/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestServerAppRunner.m +++ b/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestServerAppRunner.m @@ -90,7 +90,7 @@ - (instancetype)initWithAppName:(NSString *)name arguments:(NSArray [testcase launchTask:_appTask]; - NSLog(@"Started %@ with arguments %@ stdout=%@ and stderr=%@", name, allArguments, outFile, errorFile); + NSLog(@"Started chip-%@-app with arguments %@ stdout=%@ and stderr=%@", name, allArguments, outFile, errorFile); return self; #endif // HAVE_NSTASK From af25f563b285d11ebf7899f9e7a4f9b514b887d3 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 28 May 2024 14:09:20 -0400 Subject: [PATCH 09/43] Decouple `CommandHandler.h/cpp` from the BUILD.gn build rules of app/interaction-model (#33595) * Initial version of splitting out command handler dependencies * Restyle * move privilege-storage based on dynamic server build rules...this is somewhat messy * More dynamic server fixes * Another gn fix for android/dynamic-server builds --------- Co-authored-by: Andrei Litvin --- .github/workflows/lint.yml | 1 - src/app/BUILD.gn | 65 +++++++++++++++++++++++++++++++++----- src/app/CommandHandler.cpp | 14 ++------ src/app/CommandHandler.h | 3 +- 4 files changed, 61 insertions(+), 22 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 4685948fd7bd12..bd5385580b9c22 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -98,7 +98,6 @@ jobs: --known-failure controller/ExamplePersistentStorage.cpp \ --known-failure controller/ExamplePersistentStorage.h \ --known-failure app/AttributeAccessToken.h \ - --known-failure app/CommandHandler.h \ --known-failure app/CommandHandlerInterface.h \ --known-failure app/CommandResponseSender.h \ --known-failure app/CommandSenderLegacyCallback.h \ diff --git a/src/app/BUILD.gn b/src/app/BUILD.gn index 4bb4a05a555d39..f49a40f398842a 100644 --- a/src/app/BUILD.gn +++ b/src/app/BUILD.gn @@ -179,9 +179,6 @@ static_library("interaction-model") { "ReadClient.h", # TODO: cpp is only included conditionally. Needs logic # fixing "ReadPrepareParams.h", - "RequiredPrivilege.h", - "StatusResponse.cpp", - "StatusResponse.h", "SubscriptionResumptionStorage.h", "TimedHandler.cpp", "TimedHandler.h", @@ -210,6 +207,7 @@ static_library("interaction-model") { public_deps = [ ":app_config", + ":command-handler", ":constants", ":paths", ":subscription-info-provider", @@ -248,8 +246,6 @@ static_library("interaction-model") { "dynamic_server/AccessControl.cpp", "dynamic_server/AccessControl.h", "dynamic_server/DynamicDispatcher.cpp", - "util/privilege-storage.cpp", - "util/privilege-storage.h", ] public_deps += [ @@ -301,6 +297,62 @@ static_library("attribute-access") { ] } +source_set("required-privileges") { + sources = [ "RequiredPrivilege.h" ] + + public_deps = [ + ":paths", + "${chip_root}/src/access:types", + ] + + if (chip_build_controller_dynamic_server) { + sources += [ + "util/privilege-storage.cpp", + "util/privilege-storage.h", + ] + + public_deps += [ + ":global-attributes", + "${chip_root}/src/access", + "${chip_root}/src/app/dynamic_server:mock-codegen-includes", + ] + + public_configs = [ ":config-controller-dynamic-server" ] + } +} + +source_set("status-response") { + sources = [ + "StatusResponse.cpp", + "StatusResponse.h", + ] + public_deps = [ + ":constants", + "${chip_root}/src/app/MessageDef", + "${chip_root}/src/messaging", + ] +} + +source_set("command-handler") { + sources = [ + "CommandHandler.cpp", + "CommandHandler.h", + "CommandHandlerExchangeInterface.h", + ] + + public_deps = [ + ":paths", + ":required-privileges", + ":status-response", + "${chip_root}/src/access:types", + "${chip_root}/src/app/MessageDef", + "${chip_root}/src/app/data-model", + "${chip_root}/src/app/util:callbacks", + "${chip_root}/src/lib/support", + "${chip_root}/src/messaging", + ] +} + # Note to developpers, instead of continuously adding files in the app librabry, it is recommand to create smaller source_sets that app can depend on. # This way, we can have a better understanding of dependencies and other componenets can depend on the different source_sets without needing to depend on the entire app library. static_library("app") { @@ -312,8 +364,6 @@ static_library("app") { "AttributePersistenceProvider.h", "ChunkedWriteCallback.cpp", "ChunkedWriteCallback.h", - "CommandHandler.cpp", - "CommandHandlerExchangeInterface.h", "CommandResponseHelper.h", "CommandResponseSender.cpp", "DefaultAttributePersistenceProvider.cpp", @@ -338,7 +388,6 @@ static_library("app") { # (app depending on im and im including these headers): # Name with _ so that linter does not recognize it # "CommandResponseSender._h" - # "CommandHandler._h" # "ReadHandler._h", # "WriteHandler._h" ] diff --git a/src/app/CommandHandler.cpp b/src/app/CommandHandler.cpp index 86ef22ab886212..6077e0934721f7 100644 --- a/src/app/CommandHandler.cpp +++ b/src/app/CommandHandler.cpp @@ -15,21 +15,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -/** - * @file - * This file defines object for a CHIP IM Invoke Command Handler - * - */ - -#include "CommandHandler.h" -#include "InteractionModelEngine.h" -#include "RequiredPrivilege.h" -#include "messaging/ExchangeContext.h" +#include #include #include #include +#include #include #include #include @@ -37,6 +28,7 @@ #include #include #include +#include #include #include diff --git a/src/app/CommandHandler.h b/src/app/CommandHandler.h index 96b7af873554ed..b06064c46a69be 100644 --- a/src/app/CommandHandler.h +++ b/src/app/CommandHandler.h @@ -30,9 +30,8 @@ #pragma once -#include "CommandPathRegistry.h" - #include +#include #include #include #include From 22a9dc3a9c0628f19e0edc0cafc89ddcecd82b18 Mon Sep 17 00:00:00 2001 From: Shubham Patil Date: Tue, 28 May 2024 23:53:08 +0530 Subject: [PATCH 10/43] setup_payload: Add support for parsing setup payloads in python impl (#32516) * setup_payload: Add support for parsing setup payloads in python impl - Base38 decode impl in python - use construct to generate/parse setup payload in python - Add cli to parse and generate using click - unit tests for parsing and verification using chip-tool - removed the older script which only generated the codes - replaced the usage of older utility with newer one * Restyled by isort * fix the requirements * Added some test dataset * always use latest bitarray --------- Co-authored-by: Restyled.io --- .github/workflows/build.yaml | 2 +- scripts/tools/bouffalolab/factory_qrcode.py | 4 +- .../tools/generate_esp32_chip_factory_bin.py | 2 +- .../generate_nrfconnect_chip_factory_data.py | 4 +- src/setup_payload/python/Base38.py | 23 ++ src/setup_payload/python/README.md | 17 +- src/setup_payload/python/SetupPayload.py | 220 ++++++++++++++++++ .../python/generate_setup_payload.py | 170 -------------- src/setup_payload/python/requirements.txt | 4 +- .../run_python_setup_payload_gen_test.py | 136 ----------- .../tests/run_python_setup_payload_test.py | 213 +++++++++++++++++ 11 files changed, 475 insertions(+), 320 deletions(-) create mode 100755 src/setup_payload/python/SetupPayload.py delete mode 100755 src/setup_payload/python/generate_setup_payload.py delete mode 100644 src/setup_payload/tests/run_python_setup_payload_gen_test.py create mode 100644 src/setup_payload/tests/run_python_setup_payload_test.py diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 03e3c76c625b7d..88588363d03ad4 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -333,7 +333,7 @@ jobs: scripts/run_in_build_env.sh 'virtualenv pyenv' source pyenv/bin/activate pip3 install -r src/setup_payload/python/requirements.txt - python3 src/setup_payload/tests/run_python_setup_payload_gen_test.py out/chip-tool + python3 src/setup_payload/tests/run_python_setup_payload_test.py out/chip-tool build_linux_python_lighting_device: name: Build on Linux (python lighting-app) diff --git a/scripts/tools/bouffalolab/factory_qrcode.py b/scripts/tools/bouffalolab/factory_qrcode.py index 1a7f6303495775..0e12d8349d4c91 100644 --- a/scripts/tools/bouffalolab/factory_qrcode.py +++ b/scripts/tools/bouffalolab/factory_qrcode.py @@ -20,13 +20,13 @@ try: import qrcode - from generate_setup_payload import CommissioningFlow, SetupPayload + from SetupPayload import CommissioningFlow, SetupPayload except ImportError: SDK_ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))) sys.path.append(os.path.join(SDK_ROOT, "src/setup_payload/python")) try: import qrcode - from generate_setup_payload import CommissioningFlow, SetupPayload + from SetupPayload import CommissioningFlow, SetupPayload except ModuleNotFoundError or ImportError: no_onboarding_modules = True else: diff --git a/scripts/tools/generate_esp32_chip_factory_bin.py b/scripts/tools/generate_esp32_chip_factory_bin.py index 262be540a9bfed..eab2ec6b43c229 100755 --- a/scripts/tools/generate_esp32_chip_factory_bin.py +++ b/scripts/tools/generate_esp32_chip_factory_bin.py @@ -30,7 +30,7 @@ sys.path.insert(0, os.path.join(CHIP_TOPDIR, 'scripts', 'tools', 'spake2p')) from spake2p import generate_verifier # noqa: E402 isort:skip sys.path.insert(0, os.path.join(CHIP_TOPDIR, 'src', 'setup_payload', 'python')) -from generate_setup_payload import CommissioningFlow, SetupPayload # noqa: E402 isort:skip +from SetupPayload import CommissioningFlow, SetupPayload # noqa: E402 isort:skip if os.getenv('IDF_PATH'): sys.path.insert(0, os.path.join(os.getenv('IDF_PATH'), diff --git a/scripts/tools/nrfconnect/generate_nrfconnect_chip_factory_data.py b/scripts/tools/nrfconnect/generate_nrfconnect_chip_factory_data.py index 78212cefd81e6e..ab70c69d7f9d53 100644 --- a/scripts/tools/nrfconnect/generate_nrfconnect_chip_factory_data.py +++ b/scripts/tools/nrfconnect/generate_nrfconnect_chip_factory_data.py @@ -32,13 +32,13 @@ try: import qrcode - from generate_setup_payload import CommissioningFlow, SetupPayload + from SetupPayload import CommissioningFlow, SetupPayload except ImportError: SDK_ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))) sys.path.append(os.path.join(SDK_ROOT, "src/setup_payload/python")) try: import qrcode - from generate_setup_payload import CommissioningFlow, SetupPayload + from SetupPayload import CommissioningFlow, SetupPayload except ModuleNotFoundError or ImportError: no_onboarding_modules = True else: diff --git a/src/setup_payload/python/Base38.py b/src/setup_payload/python/Base38.py index 23113f7ed25c8d..834ae9e1d520e7 100644 --- a/src/setup_payload/python/Base38.py +++ b/src/setup_payload/python/Base38.py @@ -24,6 +24,7 @@ RADIX = len(CODES) BASE38_CHARS_NEEDED_IN_CHUNK = [2, 4, 5] MAX_BYTES_IN_CHUNK = 3 +MAX_ENCODED_BYTES_IN_CHUNK = 5 def encode(bytes): @@ -47,3 +48,25 @@ def encode(bytes): base38_chars_needed -= 1 return qrcode + + +def decode(qrcode): + total_chars = len(qrcode) + decoded_bytes = bytearray() + + for i in range(0, total_chars, MAX_ENCODED_BYTES_IN_CHUNK): + if (i + MAX_ENCODED_BYTES_IN_CHUNK) > total_chars: + chars_in_chunk = total_chars - i + else: + chars_in_chunk = MAX_ENCODED_BYTES_IN_CHUNK + + value = 0 + for j in range(i + chars_in_chunk - 1, i - 1, -1): + value = value * RADIX + CODES.index(qrcode[j]) + + bytes_in_chunk = BASE38_CHARS_NEEDED_IN_CHUNK.index(chars_in_chunk) + 1 + for k in range(0, bytes_in_chunk): + decoded_bytes.append(value & 0xFF) + value = value >> 8 + + return decoded_bytes diff --git a/src/setup_payload/python/README.md b/src/setup_payload/python/README.md index 068bf553fb7e6b..a39496104300d1 100644 --- a/src/setup_payload/python/README.md +++ b/src/setup_payload/python/README.md @@ -1,19 +1,22 @@ -## Python tool to generate Matter onboarding codes +## Python tool to generate and parse Matter onboarding codes -Generates Manual Pairing Code and QR Code +Generates and parses Manual Pairing Code and QR Code #### example usage: +- Parse + ``` -./generate_setup_payload.py -h -./generate_setup_payload.py -d 3840 -p 20202021 -cf 0 -dm 2 -vid 65521 -pid 32768 +./SetupPayload.py parse MT:U9VJ0OMV172PX813210 +./SetupPayload.py parse 34970112332 ``` -- Output +- Generate ``` -Manualcode : 34970112332 -QRCode : MT:Y.K9042C00KA0648G00 +./SetupPayload.py generate --help +./SetupPayload.py generate -d 3840 -p 20202021 +./SetupPayload.py generate -d 3840 -p 20202021 --vendor-id 65521 --product-id 32768 -cf 0 -dm 2 ``` For more details please refer Matter Specification diff --git a/src/setup_payload/python/SetupPayload.py b/src/setup_payload/python/SetupPayload.py new file mode 100755 index 00000000000000..82a58d957eff08 --- /dev/null +++ b/src/setup_payload/python/SetupPayload.py @@ -0,0 +1,220 @@ +#!/usr/bin/env python3 +# +# Copyright (c) 2024 Project CHIP Authors +# All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import enum + +import Base38 +import click +from bitarray import bitarray +from bitarray.util import int2ba, zeros +from construct import BitsInteger, BitStruct, Enum +from stdnum.verhoeff import calc_check_digit + +# Format for constructing manualcode +manualcode_format = BitStruct( + 'version' / BitsInteger(1), + 'vid_pid_present' / BitsInteger(1), + 'discriminator' / BitsInteger(4), + 'pincode_lsb' / BitsInteger(14), + 'pincode_msb' / BitsInteger(13), + 'vid' / BitsInteger(16), + 'pid' / BitsInteger(16), + 'padding' / BitsInteger(7), # this is intentional as BitStruct only takes 8-bit aligned data +) + +# Format for constructing qrcode +# qrcode bytes are packed as lsb....msb, hence the order is reversed +qrcode_format = BitStruct( + 'padding' / BitsInteger(4), + 'pincode' / BitsInteger(27), + 'discriminator' / BitsInteger(12), + 'discovery' / BitsInteger(8), + 'flow' / Enum(BitsInteger(2), + Standard=0, UserIntent=1, Custom=2), + 'pid' / BitsInteger(16), + 'vid' / BitsInteger(16), + 'version' / BitsInteger(3), +) + + +class CommissioningFlow(enum.IntEnum): + Standard = 0, + UserIntent = 1, + Custom = 2 + + +class SetupPayload: + def __init__(self, discriminator, pincode, rendezvous=4, flow=CommissioningFlow.Standard, vid=0, pid=0): + self.long_discriminator = discriminator + self.short_discriminator = discriminator >> 8 + self.pincode = pincode + self.discovery = rendezvous + self.flow = flow + self.vid = vid + self.pid = pid + + def p_print(self): + print('{:<{}} :{}'.format('Flow', 24, self.flow)) + print('{:<{}} :{}'.format('Pincode', 24, self.pincode)) + print('{:<{}} :{}'.format('Short Discriminator', 24, self.short_discriminator)) + if self.long_discriminator: + print('{:<{}} :{}'.format('Long Discriminator', 24, self.long_discriminator)) + if self.discovery: + print('{:<{}} :{}'.format('Discovery Capabilities', 24, self.discovery)) + if self.vid is not None and self.pid is not None: + print('{:<{}} :{:<{}} (0x{:04x})'.format('Vendor Id', 24, self.vid, 6, self.vid)) + print('{:<{}} :{:<{}} (0x{:04x})'.format('Product Id', 24, self.pid, 6, self.pid)) + + def qrcode_dict(self): + return { + 'version': 0, + 'vid': self.vid, + 'pid': self.pid, + 'flow': int(self.flow), + 'discovery': self.discovery, + 'discriminator': self.long_discriminator, + 'pincode': self.pincode, + 'padding': 0, + } + + def manualcode_dict(self): + return { + 'version': 0, + 'vid_pid_present': 0 if self.flow == CommissioningFlow.Standard else 1, + 'discriminator': self.short_discriminator, + 'pincode_lsb': self.pincode & 0x3FFF, # 14 ls-bits + 'pincode_msb': self.pincode >> 14, # 13 ms-bits + 'vid': 0 if self.flow == CommissioningFlow.Standard else self.vid, + 'pid': 0 if self.flow == CommissioningFlow.Standard else self.pid, + 'padding': 0, + } + + def generate_qrcode(self): + data = qrcode_format.build(self.qrcode_dict()) + b38_encoded = Base38.encode(data[::-1]) # reversing + return 'MT:{}'.format(b38_encoded) + + def generate_manualcode(self): + CHUNK1_START = 0 + CHUNK1_LEN = 4 + CHUNK2_START = CHUNK1_START + CHUNK1_LEN + CHUNK2_LEN = 16 + CHUNK3_START = CHUNK2_START + CHUNK2_LEN + CHUNK3_LEN = 13 + + bytes = manualcode_format.build(self.manualcode_dict()) + bits = bitarray() + bits.frombytes(bytes) + + chunk1 = str(int(bits[CHUNK1_START:CHUNK1_START + CHUNK1_LEN].to01(), 2)).zfill(1) + chunk2 = str(int(bits[CHUNK2_START:CHUNK2_START + CHUNK2_LEN].to01(), 2)).zfill(5) + chunk3 = str(int(bits[CHUNK3_START:CHUNK3_START + CHUNK3_LEN].to01(), 2)).zfill(4) + chunk4 = str(self.vid).zfill(5) if self.flow != CommissioningFlow.Standard else '' + chunk5 = str(self.pid).zfill(5) if self.flow != CommissioningFlow.Standard else '' + payload = '{}{}{}{}{}'.format(chunk1, chunk2, chunk3, chunk4, chunk5) + return '{}{}'.format(payload, calc_check_digit(payload)) + + @staticmethod + def from_container(container, is_qrcode): + payload = None + if is_qrcode: + payload = SetupPayload(container['discriminator'], container['pincode'], + container['discovery'], CommissioningFlow(container['flow'].__int__()), + container['vid'], container['pid']) + else: + payload = SetupPayload(discriminator=container['discriminator'], + pincode=(container['pincode_msb'] << 14) | container['pincode_lsb'], + vid=container['vid'] if container['vid_pid_present'] else None, + pid=container['pid'] if container['vid_pid_present'] else None) + payload.short_discriminator = container['discriminator'] + payload.long_discriminator = None + payload.discovery = None + payload.flow = 2 if container['vid_pid_present'] else 0 + + return payload + + @staticmethod + def parse_qrcode(payload): + payload = payload[3:] # remove 'MT:' + b38_decoded = Base38.decode(payload)[::-1] + container = qrcode_format.parse(b38_decoded) + return SetupPayload.from_container(container, is_qrcode=True) + + @staticmethod + def parse_manualcode(payload): + payload_len = len(payload) + if payload_len != 11 and payload_len != 21: + print('Invalid length') + return None + + # if first digit is greater than 7 the its not v1 + if int(str(payload)[0]) > 7: + print('incorrect first digit') + return None + + if calc_check_digit(payload[:-1]) != str(payload)[-1]: + print('check digit mismatch') + return None + + # vid_pid_present bit position + is_long = int(str(payload)[0]) & (1 << 2) + + bits = int2ba(int(payload[0]), length=4) + bits += int2ba(int(payload[1:6]), length=16) + bits += int2ba(int(payload[6:10]), length=13) + bits += int2ba(int(payload[10:15]), length=16) if is_long else zeros(16) + bits += int2ba(int(payload[15:20]), length=16) if is_long else zeros(16) + bits += zeros(7) # padding + + container = manualcode_format.parse(bits.tobytes()) + return SetupPayload.from_container(container, is_qrcode=False) + + @staticmethod + def parse(payload): + if payload.startswith('MT:'): + return SetupPayload.parse_qrcode(payload) + else: + return SetupPayload.parse_manualcode(payload) + + +@click.group() +def cli(): + pass + + +@cli.command() +@click.argument('payload') +def parse(payload): + click.echo(f'Parsing payload: {payload}') + SetupPayload.parse(payload).p_print() + + +@cli.command() +@click.option('--discriminator', '-d', required=True, type=click.IntRange(0, 0xFFF), help='Discriminator') +@click.option('--passcode', '-p', required=True, type=click.IntRange(1, 0x5F5E0FE), help='setup pincode') +@click.option('--vendor-id', '-vid', type=click.IntRange(0, 0xFFFF), default=0, help='Vendor ID') +@click.option('--product-id', '-pid', type=click.IntRange(0, 0xFFFF), default=0, help='Product ID') +@click.option('--discovery-cap-bitmask', '-dm', type=click.IntRange(0, 7), default=4, help='Commissionable device discovery capability bitmask. 0:SoftAP, 1:BLE, 2:OnNetwork. Default: OnNetwork') +@click.option('--commissioning-flow', '-cf', type=click.IntRange(0, 2), default=0, help='Commissioning flow, 0:Standard, 1:User-Intent, 2:Custom') +def generate(passcode, discriminator, vendor_id, product_id, discovery_cap_bitmask, commissioning_flow): + payload = SetupPayload(discriminator, passcode, discovery_cap_bitmask, commissioning_flow, vendor_id, product_id) + print("Manualcode : {}".format(payload.generate_manualcode())) + print("QRCode : {}".format(payload.generate_qrcode())) + + +if __name__ == '__main__': + cli() diff --git a/src/setup_payload/python/generate_setup_payload.py b/src/setup_payload/python/generate_setup_payload.py deleted file mode 100755 index 28a834651214b1..00000000000000 --- a/src/setup_payload/python/generate_setup_payload.py +++ /dev/null @@ -1,170 +0,0 @@ -#!/usr/bin/env python3 -# -# Copyright (c) 2022 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. -# -import argparse -import enum -import sys - -import Base38 -from bitarray import bitarray -from stdnum.verhoeff import calc_check_digit - -# See section 5.1.4.1 Manual Pairing Code in the Matter specification v1.0 -MANUAL_DISCRIMINATOR_LEN = 4 -PINCODE_LEN = 27 - -MANUAL_CHUNK1_DISCRIMINATOR_MSBITS_LEN = 2 -MANUAL_CHUNK1_DISCRIMINATOR_MSBITS_POS = 0 -MANUAL_CHUNK1_VID_PID_PRESENT_BIT_POS = MANUAL_CHUNK1_DISCRIMINATOR_MSBITS_POS + MANUAL_CHUNK1_DISCRIMINATOR_MSBITS_LEN -MANUAL_CHUNK1_LEN = 1 - -MANUAL_CHUNK2_DISCRIMINATOR_LSBITS_LEN = 2 -MANUAL_CHUNK2_PINCODE_LSBITS_LEN = 14 -MANUAL_CHUNK2_PINCODE_LSBITS_POS = 0 -MANUAL_CHUNK2_DISCRIMINATOR_LSBITS_POS = MANUAL_CHUNK2_PINCODE_LSBITS_POS + MANUAL_CHUNK2_PINCODE_LSBITS_LEN -MANUAL_CHUNK2_LEN = 5 - -MANUAL_CHUNK3_PINCODE_MSBITS_LEN = 13 -MANUAL_CHUNK3_PINCODE_MSBITS_POS = 0 -MANUAL_CHUNK3_LEN = 4 - -MANUAL_VID_LEN = 5 -MANUAL_PID_LEN = 5 - -# See section 5.1.3. QR Code in the Matter specification v1.0 -QRCODE_VERSION_LEN = 3 -QRCODE_DISCRIMINATOR_LEN = 12 -QRCODE_VID_LEN = 16 -QRCODE_PID_LEN = 16 -QRCODE_COMMISSIONING_FLOW_LEN = 2 -QRCODE_DISCOVERY_CAP_BITMASK_LEN = 8 -QRCODE_PADDING_LEN = 4 -QRCODE_VERSION = 0 -QRCODE_PADDING = 0 - -INVALID_PASSCODES = [00000000, 11111111, 22222222, 33333333, 44444444, 55555555, - 66666666, 77777777, 88888888, 99999999, 12345678, 87654321] - - -class CommissioningFlow(enum.IntEnum): - Standard = 0, - UserIntent = 1, - Custom = 2 - - -class SetupPayload: - def __init__(self, discriminator, pincode, rendezvous=4, flow=CommissioningFlow.Standard, vid=0, pid=0): - self.long_discriminator = discriminator - self.short_discriminator = discriminator >> 8 - self.pincode = pincode - self.rendezvous = rendezvous - self.flow = flow - self.vid = vid - self.pid = pid - - def manual_chunk1(self): - discriminator_shift = (MANUAL_DISCRIMINATOR_LEN - MANUAL_CHUNK1_DISCRIMINATOR_MSBITS_LEN) - discriminator_mask = (1 << MANUAL_CHUNK1_DISCRIMINATOR_MSBITS_LEN) - 1 - discriminator_chunk = (self.short_discriminator >> discriminator_shift) & discriminator_mask - vid_pid_present_flag = 0 if self.flow == CommissioningFlow.Standard else 1 - return (discriminator_chunk << MANUAL_CHUNK1_DISCRIMINATOR_MSBITS_POS) | (vid_pid_present_flag << MANUAL_CHUNK1_VID_PID_PRESENT_BIT_POS) - - def manual_chunk2(self): - discriminator_mask = (1 << MANUAL_CHUNK2_DISCRIMINATOR_LSBITS_LEN) - 1 - pincode_mask = (1 << MANUAL_CHUNK2_PINCODE_LSBITS_LEN) - 1 - discriminator_chunk = self.short_discriminator & discriminator_mask - return ((self.pincode & pincode_mask) << MANUAL_CHUNK2_PINCODE_LSBITS_POS) | (discriminator_chunk << MANUAL_CHUNK2_DISCRIMINATOR_LSBITS_POS) - - def manual_chunk3(self): - pincode_shift = PINCODE_LEN - MANUAL_CHUNK3_PINCODE_MSBITS_LEN - pincode_mask = (1 << MANUAL_CHUNK3_PINCODE_MSBITS_LEN) - 1 - return ((self.pincode >> pincode_shift) & pincode_mask) << MANUAL_CHUNK3_PINCODE_MSBITS_POS - - def generate_manualcode(self): - payload = str(self.manual_chunk1()).zfill(MANUAL_CHUNK1_LEN) - payload += str(self.manual_chunk2()).zfill(MANUAL_CHUNK2_LEN) - payload += str(self.manual_chunk3()).zfill(MANUAL_CHUNK3_LEN) - - if self.flow != CommissioningFlow.Standard: - payload += str(self.vid).zfill(MANUAL_VID_LEN) - payload += str(self.pid).zfill(MANUAL_PID_LEN) - - payload += calc_check_digit(payload) - return payload - - def generate_qrcode(self): - qrcode_bit_string = '{0:b}'.format(QRCODE_PADDING).zfill(QRCODE_PADDING_LEN) - qrcode_bit_string += '{0:b}'.format(self.pincode).zfill(PINCODE_LEN) - qrcode_bit_string += '{0:b}'.format(self.long_discriminator).zfill(QRCODE_DISCRIMINATOR_LEN) - qrcode_bit_string += '{0:b}'.format(self.rendezvous).zfill(QRCODE_DISCOVERY_CAP_BITMASK_LEN) - qrcode_bit_string += '{0:b}'.format(int(self.flow)).zfill(QRCODE_COMMISSIONING_FLOW_LEN) - qrcode_bit_string += '{0:b}'.format(self.pid).zfill(QRCODE_PID_LEN) - qrcode_bit_string += '{0:b}'.format(self.vid).zfill(QRCODE_VID_LEN) - qrcode_bit_string += '{0:b}'.format(QRCODE_VERSION).zfill(QRCODE_VERSION_LEN) - - qrcode_bits = bitarray(qrcode_bit_string) - bytes = list(qrcode_bits.tobytes()) - bytes.reverse() - return 'MT:{}'.format(Base38.encode(bytes)) - - -def validate_args(args): - def check_int_range(value, min_value, max_value, name): - if value and ((value < min_value) or (value > max_value)): - print('{} is out of range, should be in range from {} to {}'.format(name, min_value, max_value)) - sys.exit(1) - - if args.passcode is not None: - if ((args.passcode < 0x0000001 and args.passcode > 0x5F5E0FE) or (args.passcode in INVALID_PASSCODES)): - print('Invalid passcode:' + str(args.passcode)) - sys.exit(1) - - check_int_range(args.discriminator, 0x0000, 0x0FFF, 'Discriminator') - check_int_range(args.product_id, 0x0000, 0xFFFF, 'Product id') - check_int_range(args.vendor_id, 0x0000, 0xFFFF, 'Vendor id') - check_int_range(args.discovery_cap_bitmask, 0x0001, 0x0007, 'Discovery Capability Mask') - - -def main(): - def any_base_int(s): return int(s, 0) - parser = argparse.ArgumentParser(description='Matter Manual and QRCode Setup Payload Generator Tool') - parser.add_argument('-d', '--discriminator', type=any_base_int, required=True, - help='The discriminator for pairing, range: 0x00-0x0FFF') - parser.add_argument('-p', '--passcode', type=any_base_int, required=True, - help='The setup passcode for pairing, range: 0x01-0x5F5E0FE') - parser.add_argument('-vid', '--vendor-id', type=any_base_int, default=0, help='Vendor id') - parser.add_argument('-pid', '--product-id', type=any_base_int, default=0, help='Product id') - parser.add_argument('-cf', '--commissioning-flow', type=any_base_int, default=0, - help='Device commissioning flow, 0:Standard, 1:User-Intent, 2:Custom. \ - Default is 0.', choices=[0, 1, 2]) - parser.add_argument('-dm', '--discovery-cap-bitmask', type=any_base_int, default=4, - help='Commissionable device discovery capability bitmask. \ - 0:SoftAP, 1:BLE, 2:OnNetwork. Default: OnNetwork') - args = parser.parse_args() - validate_args(args) - - payloads = SetupPayload(args.discriminator, args.passcode, args.discovery_cap_bitmask, - CommissioningFlow(args.commissioning_flow), args.vendor_id, args.product_id) - manualcode = payloads.generate_manualcode() - qrcode = payloads.generate_qrcode() - - print("Manualcode : {}".format(manualcode)) - print("QRCode : {}".format(qrcode)) - - -if __name__ == '__main__': - main() diff --git a/src/setup_payload/python/requirements.txt b/src/setup_payload/python/requirements.txt index 43800d601c7736..1026fa98d061c5 100644 --- a/src/setup_payload/python/requirements.txt +++ b/src/setup_payload/python/requirements.txt @@ -1,2 +1,4 @@ -bitarray==2.6.0 +bitarray>=2.8.1 +click>=8.1.3 +construct>=2.10.68 python_stdnum==1.18 diff --git a/src/setup_payload/tests/run_python_setup_payload_gen_test.py b/src/setup_payload/tests/run_python_setup_payload_gen_test.py deleted file mode 100644 index b52000c1a6fd98..00000000000000 --- a/src/setup_payload/tests/run_python_setup_payload_gen_test.py +++ /dev/null @@ -1,136 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright (c) 2023 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os -import re -import subprocess -import sys - -CHIP_TOPDIR = os.path.dirname(os.path.realpath(__file__))[:-len(os.path.join('src', 'setup_payload', 'tests'))] -sys.path.insert(0, os.path.join(CHIP_TOPDIR, 'src', 'setup_payload', 'python')) -from generate_setup_payload import CommissioningFlow, SetupPayload # noqa: E402 - - -def payload_param_dict(): - return { - 'Version': None, - 'VendorID': None, - 'ProductID': None, - 'Custom flow': None, - 'Discovery Bitmask': None, - 'Short discriminator': None, - 'Long discriminator': None, - 'Passcode': None - } - - -def remove_escape_sequence(data): - ansi_escape = re.compile(r'\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])') - result = ansi_escape.sub('', data) - return result - - -def parse_setup_payload(chip_tool, payload): - cmd_args = [chip_tool, 'payload', 'parse-setup-payload', payload] - data = subprocess.check_output(cmd_args).decode('utf-8') - data = remove_escape_sequence(data) - parsed_params = payload_param_dict() - for key in parsed_params: - k_st = data.find(key) - if k_st == -1: - continue - - # 1 is for ":" - k_end = k_st + len(key) + 1 - - k_nl = data.find('\n', k_end) - parsed_params[key] = data[k_end:k_nl].split()[0] - - return parsed_params - - -def generate_payloads(in_params): - payloads = SetupPayload(in_params['Long discriminator'], in_params['Passcode'], - in_params['Discovery Bitmask'], CommissioningFlow(in_params['Custom flow']), - in_params['VendorID'], in_params['ProductID']) - manualcode = payloads.generate_manualcode() - qrcode = payloads.generate_qrcode() - return manualcode, qrcode - - -def verify_payloads(in_params, manualcode_params, qrcode_params): - assert in_params['Version'] == int(manualcode_params['Version'], 0) - assert in_params['Passcode'] == int(manualcode_params['Passcode'], 0) - assert in_params['Short discriminator'] == int(manualcode_params['Short discriminator'], 0) - if in_params['Custom flow'] != 0: - assert in_params['VendorID'] == int(manualcode_params['VendorID'], 0) - assert in_params['ProductID'] == int(manualcode_params['ProductID'], 0) - - assert in_params['Version'] == int(qrcode_params['Version'], 0) - assert in_params['VendorID'] == int(qrcode_params['VendorID'], 0) - assert in_params['ProductID'] == int(qrcode_params['ProductID'], 0) - assert in_params['Custom flow'] == int(qrcode_params['Custom flow'], 0) - assert in_params['Discovery Bitmask'] == int(qrcode_params['Discovery Bitmask'], 0) - assert in_params['Passcode'] == int(qrcode_params['Passcode'], 0) - assert in_params['Long discriminator'] == int(qrcode_params['Long discriminator'], 0) - - -def get_payload_params(discriminator, passcode, discovery=4, flow=0, vid=0, pid=0, version=0): - p = payload_param_dict() - p['Version'] = version - p['VendorID'] = vid - p['ProductID'] = pid - p['Custom flow'] = flow - p['Discovery Bitmask'] = discovery - p['Long discriminator'] = discriminator - p['Short discriminator'] = discriminator >> 8 - p['Passcode'] = passcode - return p - - -def run_tests(chip_tool): - test_data_set = [ - get_payload_params(3840, 20202021), - get_payload_params(3781, 12349876, flow=1, vid=1, pid=1), - get_payload_params(2310, 23005908, flow=2, vid=0xFFF3, pid=0x8098), - get_payload_params(3091, 43338551, discovery=2, flow=2, vid=0x1123, pid=0x0012), - get_payload_params(80, 54757432, discovery=6, flow=2, vid=0x2345, pid=0x1023), - get_payload_params(174, 81235604, discovery=7, flow=1, vid=0x45, pid=0x10), - ] - - for test_params in test_data_set: - manualcode, qrcode = generate_payloads(test_params) - manualcode_params = parse_setup_payload(chip_tool, manualcode) - qrcode_params = parse_setup_payload(chip_tool, qrcode) - - print("Input parameters:", test_params) - print("Manualcode:", manualcode) - print("QRCode:", qrcode) - print("Manualcode parsed by chip-tool:", manualcode_params) - print("QRCode parsed by chip-tool:", qrcode_params) - print("") - - verify_payloads(test_params, manualcode_params, qrcode_params) - - -def main(): - if len(sys.argv) == 2: - chip_tool = sys.argv[1] - run_tests(chip_tool) - - -if __name__ == '__main__': - main() diff --git a/src/setup_payload/tests/run_python_setup_payload_test.py b/src/setup_payload/tests/run_python_setup_payload_test.py new file mode 100644 index 00000000000000..da62a45c05fe97 --- /dev/null +++ b/src/setup_payload/tests/run_python_setup_payload_test.py @@ -0,0 +1,213 @@ +#!/usr/bin/env python3 + +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os +import re +import subprocess +import sys + +CHIP_TOPDIR = os.path.dirname(os.path.realpath(__file__))[:-len(os.path.join('src', 'setup_payload', 'tests'))] +sys.path.insert(0, os.path.join(CHIP_TOPDIR, 'src', 'setup_payload', 'python')) +from SetupPayload import CommissioningFlow, SetupPayload # noqa: E402 + + +def payload_param_dict(): + return { + 'Version': None, + 'VendorID': None, + 'ProductID': None, + 'Custom flow': None, + 'Discovery Bitmask': None, + 'Short discriminator': None, + 'Long discriminator': None, + 'Passcode': None + } + + +def remove_escape_sequence(data): + ansi_escape = re.compile(r'\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])') + result = ansi_escape.sub('', data) + return result + + +def chip_tool_parse_setup_payload(chip_tool, payload): + cmd_args = [chip_tool, 'payload', 'parse-setup-payload', payload] + data = subprocess.check_output(cmd_args).decode('utf-8') + data = remove_escape_sequence(data) + parsed_params = payload_param_dict() + for key in parsed_params: + k_st = data.find(key) + if k_st == -1: + continue + + # 1 is for ":" + k_end = k_st + len(key) + 1 + + k_nl = data.find('\n', k_end) + parsed_params[key] = data[k_end:k_nl].split()[0] + + return parsed_params + + +def generate_payloads(in_params): + payloads = SetupPayload(in_params['Long discriminator'], in_params['Passcode'], + in_params['Discovery Bitmask'], CommissioningFlow(in_params['Custom flow']), + in_params['VendorID'], in_params['ProductID']) + manualcode = payloads.generate_manualcode() + qrcode = payloads.generate_qrcode() + return manualcode, qrcode + + +def verify_generated_payloads(in_params, manualcode_params, qrcode_params): + assert in_params['Version'] == int(manualcode_params['Version'], 0) + assert in_params['Passcode'] == int(manualcode_params['Passcode'], 0) + assert in_params['Short discriminator'] == int(manualcode_params['Short discriminator'], 0) + if in_params['Custom flow'] != 0: + assert in_params['VendorID'] == int(manualcode_params['VendorID'], 0) + assert in_params['ProductID'] == int(manualcode_params['ProductID'], 0) + + assert in_params['Version'] == int(qrcode_params['Version'], 0) + assert in_params['VendorID'] == int(qrcode_params['VendorID'], 0) + assert in_params['ProductID'] == int(qrcode_params['ProductID'], 0) + assert in_params['Custom flow'] == int(qrcode_params['Custom flow'], 0) + assert in_params['Discovery Bitmask'] == int(qrcode_params['Discovery Bitmask'], 0) + assert in_params['Passcode'] == int(qrcode_params['Passcode'], 0) + assert in_params['Long discriminator'] == int(qrcode_params['Long discriminator'], 0) + + +def get_payload_params(discriminator, passcode, discovery=4, flow=0, vid=0, pid=0, version=0, short_discriminator=None): + p = payload_param_dict() + p['Version'] = version + p['VendorID'] = vid + p['ProductID'] = pid + p['Custom flow'] = flow + p['Discovery Bitmask'] = discovery + p['Long discriminator'] = discriminator + p['Short discriminator'] = short_discriminator if short_discriminator is not None else (discriminator >> 8) + p['Passcode'] = passcode + return p + + +def test_code_generation(chip_tool): + test_data_set = [ + get_payload_params(3840, 20202021), + get_payload_params(3781, 12349876, flow=1, vid=1, pid=1), + get_payload_params(2310, 23005908, flow=2, vid=0xFFF3, pid=0x8098), + get_payload_params(3091, 43338551, discovery=2, flow=2, vid=0x1123, pid=0x0012), + get_payload_params(80, 54757432, discovery=6, flow=2, vid=0x2345, pid=0x1023), + get_payload_params(174, 81235604, discovery=7, flow=1, vid=0x45, pid=0x10), + ] + + for test_params in test_data_set: + manualcode, qrcode = generate_payloads(test_params) + manualcode_params = chip_tool_parse_setup_payload(chip_tool, manualcode) + qrcode_params = chip_tool_parse_setup_payload(chip_tool, qrcode) + + verify_generated_payloads(test_params, manualcode_params, qrcode_params) + + +def test_onboardingcode_parsing(): + # This test dataset is generated using `chip-tool payload parse-setup-payload ` + + test_data_set = [ + { + 'code': '34970112332', + 'res': get_payload_params(discriminator=None, passcode=20202021, discovery=None, + flow=0, vid=None, pid=None, version=0, short_discriminator=15), + }, + { + 'code': '745492075300001000013', + 'res': get_payload_params(discriminator=None, passcode=12349876, discovery=None, + flow=2, vid=1, pid=1, version=0, short_discriminator=14), + }, + { + 'code': '619156140465523329207', + 'res': get_payload_params(discriminator=None, passcode=23005908, discovery=None, + flow=2, vid=65523, pid=32920, version=0, short_discriminator=9), + }, + { + 'code': '702871264504387000187', + 'res': get_payload_params(discriminator=None, passcode=43338551, discovery=None, + flow=2, vid=4387, pid=18, version=0, short_discriminator=12), + }, + { + 'code': '402104334209029041311', + 'res': get_payload_params(discriminator=None, passcode=54757432, discovery=None, + flow=2, vid=9029, pid=4131, version=0, short_discriminator=0), + }, + { + 'code': '403732495800069000166', + 'res': get_payload_params(discriminator=None, passcode=81235604, discovery=None, + flow=2, vid=69, pid=16, version=0, short_discriminator=0), + }, + { + 'code': 'MT:U9VJ0OMV172PX813210', + 'res': get_payload_params(discriminator=3431, passcode=49910688, discovery=2, + flow=0, vid=4891, pid=2, version=0, short_discriminator=None), + }, + { + 'code': 'MT:00000CQM00KA0648G00', + 'res': get_payload_params(discriminator=3840, passcode=20202021, discovery=4, + flow=0, vid=0, pid=0, version=0, short_discriminator=None), + }, + { + 'code': 'MT:A3L90ARR15G6N57Y900', + 'res': get_payload_params(discriminator=3781, passcode=12349876, discovery=4, + flow=1, vid=1, pid=1, version=0, short_discriminator=None), + }, + { + 'code': 'MT:MZWA6G6026O2XP0II00', + 'res': get_payload_params(discriminator=2310, passcode=23005908, discovery=4, + flow=2, vid=65523, pid=32920, version=0, short_discriminator=None), + }, + { + 'code': 'MT:KSNK4M5113-JPR4UY00', + 'res': get_payload_params(discriminator=3091, passcode=43338551, discovery=2, + flow=2, vid=4387, pid=18, version=0, short_discriminator=12), + }, + { + 'code': 'MT:0A.T0P--00Y0OJ0.510', + 'res': get_payload_params(discriminator=80, passcode=54757432, discovery=6, + flow=2, vid=9029, pid=4131, version=0, short_discriminator=None), + }, + { + 'code': 'MT:EPX0482F26DAVY09R10', + 'res': get_payload_params(discriminator=174, passcode=81235604, discovery=7, + flow=1, vid=69, pid=16, version=0, short_discriminator=None), + }, + ] + + for test_payload in test_data_set: + payload = SetupPayload.parse(test_payload['code']) + + assert payload.long_discriminator == test_payload['res']['Long discriminator'] + assert payload.short_discriminator == test_payload['res']['Short discriminator'] + assert payload.pincode == test_payload['res']['Passcode'] + assert payload.discovery == test_payload['res']['Discovery Bitmask'] + assert payload.flow == test_payload['res']['Custom flow'] + assert payload.vid == test_payload['res']['VendorID'] + assert payload.pid == test_payload['res']['ProductID'] + + +def main(): + if len(sys.argv) == 2: + chip_tool = sys.argv[1] + test_code_generation(chip_tool) + test_onboardingcode_parsing() + + +if __name__ == '__main__': + main() From 6368d7da245331cc32651f0b1897d8576ae9366c Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 28 May 2024 15:25:57 -0400 Subject: [PATCH 11/43] Fix up guarantees around the "device cache primed" notification. (#33600) We should be dispatching this only if we did not previously have a primed device cache. testAttributeReportWithValue was renamed, because methods starting with "test" are run as actual tests, and that's not what it's supposed to be doing. --- src/darwin/Framework/CHIP/MTRDevice.mm | 90 +++++++------------ .../Framework/CHIPTests/MTRDeviceTests.m | 46 +++++++--- .../CHIPTests/MTRPerControllerStorageTests.m | 28 ++++-- 3 files changed, 82 insertions(+), 82 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDevice.mm b/src/darwin/Framework/CHIP/MTRDevice.mm index ffb0a5643d463e..4e916d14b101c8 100644 --- a/src/darwin/Framework/CHIP/MTRDevice.mm +++ b/src/darwin/Framework/CHIP/MTRDevice.mm @@ -376,7 +376,11 @@ @implementation MTRDevice { #ifdef DEBUG NSUInteger _unitTestAttributesReportedSinceLastCheck; #endif - BOOL _delegateDeviceCachePrimedCalled; + + // _deviceCachePrimed is true if we have the data that comes from an initial + // subscription priming report (whether it came from storage or from our + // subscription). + BOOL _deviceCachePrimed; // _persistedClusterData stores data that we have already persisted (when we have // cluster data persistence enabled). Nil when we have no persistence enabled. @@ -736,11 +740,6 @@ - (void)setDelegate:(id)delegate queue:(dispatch_queue_t)queu _weakDelegate = [MTRWeakReference weakReferenceWithObject:delegate]; _delegateQueue = queue; - // If Check if cache is already primed and client hasn't been informed yet, call the -deviceCachePrimed: callback - if (!_delegateDeviceCachePrimedCalled && [self _isCachePrimedWithInitialConfigurationData]) { - [self _callDelegateDeviceCachePrimed]; - } - if (setUpSubscription) { _initialSubscribeStart = [NSDate now]; if ([self _deviceUsesThread]) { @@ -915,7 +914,7 @@ - (BOOL)_callDelegateWithBlock:(void (^)(id))block - (void)_callDelegateDeviceCachePrimed { os_unfair_lock_assert_owner(&self->_lock); - _delegateDeviceCachePrimedCalled = [self _callDelegateWithBlock:^(id delegate) { + [self _callDelegateWithBlock:^(id delegate) { if ([delegate respondsToSelector:@selector(deviceCachePrimed:)]) { [delegate deviceCachePrimed:self]; } @@ -994,11 +993,6 @@ - (void)_handleSubscriptionEstablished [self _changeInternalState:MTRInternalDeviceStateInitialSubscriptionEstablished]; } - // As subscription is established, check if the delegate needs to be informed - if (!_delegateDeviceCachePrimedCalled) { - [self _callDelegateDeviceCachePrimed]; - } - [self _changeState:MTRDeviceStateReachable]; // No need to monitor connectivity after subscription establishment @@ -1480,6 +1474,13 @@ - (void)_scheduleClusterDataPersistence return; } + // If we have nothing stored at all yet, store directly, so we move into a + // primed state. + if (!_deviceCachePrimed) { + [self _persistClusterData]; + return; + } + // Ensure there is an array to keep the most recent report times if (!_mostRecentReportTimes) { _mostRecentReportTimes = [NSMutableArray array]; @@ -1525,7 +1526,7 @@ - (void)_scheduleClusterDataPersistence // Set current multiplier to [1, MaxMultiplier] _reportToPersistenceDelayCurrentMultiplier = 1 + (proportionTowardMinThreshold * (_storageBehaviorConfiguration.reportToPersistenceDelayMaxMultiplier - 1)); - MTR_LOG("%@ storage behavior: device reporting frequently - setting delay multiplied to %lf", self, _reportToPersistenceDelayCurrentMultiplier); + MTR_LOG("%@ storage behavior: device reporting frequently - setting delay multiplier to %lf", self, _reportToPersistenceDelayCurrentMultiplier); } else { _reportToPersistenceDelayCurrentMultiplier = 1; } @@ -1601,6 +1602,19 @@ - (void)_handleReportEnd _deviceConfigurationChanged = NO; } + // Do this after the _deviceConfigurationChanged check, so that we don't + // call deviceConfigurationChanged: immediately after telling our delegate + // we are now primed. + // + // TODO: Maybe we shouldn't dispatch deviceConfigurationChanged: for the + // initial priming bits? + if (!_deviceCachePrimed) { + // This is the end of the priming sequence of data reports, so we have + // all the data for the device now. + _deviceCachePrimed = YES; + [self _callDelegateDeviceCachePrimed]; + } + // For unit testing only #ifdef DEBUG id delegate = _weakDelegate.strongObject; @@ -3165,10 +3179,9 @@ - (void)setPersistedClusterData:(NSDictionary_lock); - - // Check if root node descriptor exists - MTRDeviceDataValueDictionary rootDescriptorPartsListDataValue = [self _cachedAttributeValueForPath:[MTRAttributePath attributePathWithEndpointID:@(kRootEndpointId) clusterID:@(MTRClusterIDTypeDescriptorID) attributeID:@(MTRAttributeIDTypeClusterDescriptorAttributePartsListID)]]; - if (!rootDescriptorPartsListDataValue || ![MTRArrayValueType isEqualToString:rootDescriptorPartsListDataValue[MTRTypeKey]]) { - return NO; - } - NSArray * partsList = rootDescriptorPartsListDataValue[MTRValueKey]; - if (![partsList isKindOfClass:[NSArray class]] || !partsList.count) { - MTR_LOG_ERROR("%@ unexpected type %@ for parts list %@", self, [partsList class], partsList); - return NO; - } - - // Check if we have cached descriptor clusters for each listed endpoint - for (NSDictionary * endpointDictionary in partsList) { - NSDictionary * endpointDataValue = endpointDictionary[MTRDataKey]; - if (![endpointDataValue isKindOfClass:[NSDictionary class]]) { - MTR_LOG_ERROR("%@ unexpected parts list dictionary %@ data value class %@", self, endpointDictionary, [endpointDataValue class]); - continue; - } - if (![MTRUnsignedIntegerValueType isEqual:endpointDataValue[MTRTypeKey]]) { - MTR_LOG_ERROR("%@ unexpected parts list data value %@ item type %@", self, endpointDataValue, endpointDataValue[MTRTypeKey]); - continue; - } - NSNumber * endpoint = endpointDataValue[MTRValueKey]; - if (![endpoint isKindOfClass:[NSNumber class]]) { - MTR_LOG_ERROR("%@ unexpected parts list item value class %@", self, [endpoint class]); - continue; - } - MTRDeviceDataValueDictionary descriptorDeviceTypeListDataValue = [self _cachedAttributeValueForPath:[MTRAttributePath attributePathWithEndpointID:endpoint clusterID:@(MTRClusterIDTypeDescriptorID) attributeID:@(MTRAttributeIDTypeClusterDescriptorAttributeDeviceTypeListID)]]; - if (![MTRArrayValueType isEqualToString:descriptorDeviceTypeListDataValue[MTRTypeKey]] || !descriptorDeviceTypeListDataValue[MTRValueKey]) { - return NO; - } - } - - return YES; -} - - (MTRBaseDevice *)newBaseDevice { return [MTRBaseDevice deviceWithNodeID:self.nodeID controller:self.deviceController]; diff --git a/src/darwin/Framework/CHIPTests/MTRDeviceTests.m b/src/darwin/Framework/CHIPTests/MTRDeviceTests.m index 7a26b31aa62b21..f0d6aee1a8556b 100644 --- a/src/darwin/Framework/CHIPTests/MTRDeviceTests.m +++ b/src/darwin/Framework/CHIPTests/MTRDeviceTests.m @@ -3669,7 +3669,7 @@ - (void)test035_TestMTRDeviceSubscriptionNotEstablishedOverXPC XCTAssertEqual([device _getInternalState], MTRInternalDeviceStateUnsubscribed); } -- (NSArray *> *)testAttributeReportWithValue:(unsigned int)testValue +- (NSArray *> *)_testAttributeReportWithValue:(unsigned int)testValue { return @[ @{ MTRAttributePathKey : [MTRAttributePath attributePathWithEndpointID:@(0) clusterID:@(MTRClusterIDTypeLevelControlID) attributeID:@(MTRAttributeIDTypeClusterLevelControlAttributeCurrentLevelID)], @@ -3696,7 +3696,7 @@ - (void)test036_TestStorageBehaviorConfiguration __block NSDate * reportEndTime = nil; __block NSDate * dataPersistedTime = nil; - XCTestExpectation * dataPersisted1 = [self expectationWithDescription:@"data persisted 1"]; + XCTestExpectation * dataPersistedInitial = [self expectationWithDescription:@"data persisted initial"]; delegate.onReportEnd = ^() { os_unfair_lock_lock(&lock); if (!reportEndTime) { @@ -3711,7 +3711,7 @@ - (void)test036_TestStorageBehaviorConfiguration dataPersistedTime = [NSDate now]; } os_unfair_lock_unlock(&lock); - [dataPersisted1 fulfill]; + [dataPersistedInitial fulfill]; }; // Do not subscribe - only inject sequence of reports to control the timing @@ -3732,11 +3732,29 @@ - (void)test036_TestStorageBehaviorConfiguration [device setDelegate:delegate queue:queue]; - // Use a mutable dictionary so the data value can be easily changed between reports + // Use a counter that will be incremented for each report as the value. unsigned int currentTestValue = 1; + // Initial setup: Inject report and see that the attribute persisted. No delay is + // expected for the first (priming) report. + [device unitTestInjectAttributeReport:[self _testAttributeReportWithValue:currentTestValue++] fromSubscription:YES]; + + [self waitForExpectations:@[ dataPersistedInitial ] timeout:60]; + + XCTestExpectation * dataPersisted1 = [self expectationWithDescription:@"data persisted 1"]; + delegate.onClusterDataPersisted = ^{ + os_unfair_lock_lock(&lock); + if (!dataPersistedTime) { + dataPersistedTime = [NSDate now]; + } + os_unfair_lock_unlock(&lock); + [dataPersisted1 fulfill]; + }; + // Test 1: Inject report and see that the attribute persisted, with a delay - [device unitTestInjectAttributeReport:[self testAttributeReportWithValue:currentTestValue++] fromSubscription:YES]; + reportEndTime = nil; + dataPersistedTime = nil; + [device unitTestInjectAttributeReport:[self _testAttributeReportWithValue:currentTestValue++] fromSubscription:YES]; [self waitForExpectations:@[ dataPersisted1 ] timeout:60]; @@ -3762,20 +3780,20 @@ - (void)test036_TestStorageBehaviorConfiguration // Test 2: Inject multiple reports with delay and see that the attribute persisted eventually reportEndTime = nil; dataPersistedTime = nil; - [device unitTestInjectAttributeReport:[self testAttributeReportWithValue:currentTestValue++] fromSubscription:YES]; + [device unitTestInjectAttributeReport:[self _testAttributeReportWithValue:currentTestValue++] fromSubscription:YES]; double frequentReportMultiplier = 0.5; usleep((useconds_t) (baseTestDelayTime * frequentReportMultiplier * USEC_PER_SEC)); - [device unitTestInjectAttributeReport:[self testAttributeReportWithValue:currentTestValue++] fromSubscription:YES]; + [device unitTestInjectAttributeReport:[self _testAttributeReportWithValue:currentTestValue++] fromSubscription:YES]; usleep((useconds_t) (baseTestDelayTime * frequentReportMultiplier * USEC_PER_SEC)); - [device unitTestInjectAttributeReport:[self testAttributeReportWithValue:currentTestValue++] fromSubscription:YES]; + [device unitTestInjectAttributeReport:[self _testAttributeReportWithValue:currentTestValue++] fromSubscription:YES]; usleep((useconds_t) (baseTestDelayTime * frequentReportMultiplier * USEC_PER_SEC)); - [device unitTestInjectAttributeReport:[self testAttributeReportWithValue:currentTestValue++] fromSubscription:YES]; + [device unitTestInjectAttributeReport:[self _testAttributeReportWithValue:currentTestValue++] fromSubscription:YES]; usleep((useconds_t) (baseTestDelayTime * frequentReportMultiplier * USEC_PER_SEC)); - [device unitTestInjectAttributeReport:[self testAttributeReportWithValue:currentTestValue++] fromSubscription:YES]; + [device unitTestInjectAttributeReport:[self _testAttributeReportWithValue:currentTestValue++] fromSubscription:YES]; // At this point, the threshold for reportToPersistenceDelayTimeMax should have hit, and persistence // should have happened with timer running down to persist again with the 5th report above. Need to @@ -3817,7 +3835,7 @@ - (void)test036_TestStorageBehaviorConfiguration ]]]; // Inject final report that makes MTRDevice recalculate delay with multiplier - [device unitTestInjectAttributeReport:[self testAttributeReportWithValue:currentTestValue++] fromSubscription:YES]; + [device unitTestInjectAttributeReport:[self _testAttributeReportWithValue:currentTestValue++] fromSubscription:YES]; [self waitForExpectations:@[ dataPersisted3 ] timeout:60]; @@ -3856,13 +3874,13 @@ - (void)test036_TestStorageBehaviorConfiguration ]]]; // Inject report that makes MTRDevice detect the device is reporting excessively - [device unitTestInjectAttributeReport:[self testAttributeReportWithValue:currentTestValue++] fromSubscription:YES]; + [device unitTestInjectAttributeReport:[self _testAttributeReportWithValue:currentTestValue++] fromSubscription:YES]; // Now keep reporting excessively for base delay time max times max multiplier, plus a bit more NSDate * excessiveStartTime = [NSDate now]; for (;;) { usleep((useconds_t) (baseTestDelayTime * 0.1 * USEC_PER_SEC)); - [device unitTestInjectAttributeReport:[self testAttributeReportWithValue:currentTestValue++] fromSubscription:YES]; + [device unitTestInjectAttributeReport:[self _testAttributeReportWithValue:currentTestValue++] fromSubscription:YES]; NSTimeInterval elapsed = -[excessiveStartTime timeIntervalSinceNow]; if (elapsed > (baseTestDelayTime * 2 * 5 * 1.2)) { break; @@ -3879,7 +3897,7 @@ - (void)test036_TestStorageBehaviorConfiguration // And inject a report to trigger MTRDevice to recalculate that this device is no longer // reporting excessively - [device unitTestInjectAttributeReport:[self testAttributeReportWithValue:currentTestValue++] fromSubscription:YES]; + [device unitTestInjectAttributeReport:[self _testAttributeReportWithValue:currentTestValue++] fromSubscription:YES]; [self waitForExpectations:@[ dataPersisted4 ] timeout:60]; diff --git a/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m b/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m index 601cbcc9125536..52b1ae36673b28 100644 --- a/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m +++ b/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m @@ -1437,29 +1437,29 @@ - (void)doDataStoreMTRDeviceTestWithStorageDelegate:(id * dataStoreClusterData = [controller.controllerDataStore getStoredClusterDataForNodeID:deviceID]; @@ -1498,6 +1498,9 @@ - (void)doDataStoreMTRDeviceTestWithStorageDelegate:(id Date: Tue, 28 May 2024 16:00:15 -0400 Subject: [PATCH 12/43] YAML documentation: Add section on step timeouts (#33640) --- docs/testing/yaml.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/docs/testing/yaml.md b/docs/testing/yaml.md index 107c761fbef71e..e7353d09697e30 100644 --- a/docs/testing/yaml.md +++ b/docs/testing/yaml.md @@ -279,6 +279,17 @@ function can be use. See [TestEqualities](https://github.com/project-chip/connectedhomeip/blob/master/src/app/tests/suites/TestEqualities.yaml) for an example of how to use this pseudo-cluster. +#### Setting step timeouts + +The timeout argument can be used for each individual test step to set the time +the runner will wait for a test step to complete before reporting a failure. + +Note that this timeout is different than the subscription report timeout and the +subscription report timeout is not currently adjustable in YAML. + +There several other options for configuring test steps as shown in the +[YAML schema](./yaml_schema.md) document. + ## Running YAML tests YAML scripts are parsed and run using a python-based runner program that parses @@ -304,6 +315,24 @@ There are several options for running tests locally. Because the YAML runner uses python, it is necessary to compile and install the chip python package before using any YAML runner script. +First activate the matter environment using either + +``` +. ./scripts/bootstrap.sh +``` + +or + +``` +. ./scripts/activate.sh +``` + +bootstrap.sh should be used for for the first setup, activate.sh may be used for +subsequent setups as it is faster. + +Next build the python wheels and create a venv (called `py` here, but any name +may be used) + ``` ./scripts/build_python.sh -i py source py/bin/activate From 6a330e85cdd7fd0859646c140a2564c3d4c58b7a Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Tue, 28 May 2024 15:50:30 -0700 Subject: [PATCH 13/43] [Bridge-App] Fix init typo for TempSensor2 (#33619) --- examples/bridge-app/linux/main.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/examples/bridge-app/linux/main.cpp b/examples/bridge-app/linux/main.cpp index 3643f5ea1eb02a..a894b5d0150ca6 100644 --- a/examples/bridge-app/linux/main.cpp +++ b/examples/bridge-app/linux/main.cpp @@ -899,13 +899,11 @@ void ApplicationInit() // Setup Mock Devices Light1.SetReachable(true); Light2.SetReachable(true); - Light1.SetChangeCallback(&HandleDeviceOnOffStatusChanged); Light2.SetChangeCallback(&HandleDeviceOnOffStatusChanged); TempSensor1.SetReachable(true); - TempSensor1.SetReachable(true); - + TempSensor2.SetReachable(true); TempSensor1.SetChangeCallback(&HandleDeviceTempSensorStatusChanged); TempSensor2.SetChangeCallback(&HandleDeviceTempSensorStatusChanged); @@ -914,7 +912,6 @@ void ApplicationInit() ActionLight2.SetReachable(true); ActionLight3.SetReachable(true); ActionLight4.SetReachable(true); - ActionLight1.SetChangeCallback(&HandleDeviceOnOffStatusChanged); ActionLight2.SetChangeCallback(&HandleDeviceOnOffStatusChanged); ActionLight3.SetChangeCallback(&HandleDeviceOnOffStatusChanged); @@ -929,7 +926,6 @@ void ApplicationInit() ComposedTempSensor2.SetReachable(true); ComposedPowerSource.SetReachable(true); ComposedPowerSource.SetBatChargeLevel(58); - ComposedTempSensor1.SetChangeCallback(&HandleDeviceTempSensorStatusChanged); ComposedTempSensor2.SetChangeCallback(&HandleDeviceTempSensorStatusChanged); ComposedPowerSource.SetChangeCallback(&HandleDevicePowerSourceStatusChanged); From 8c8889bb5bae6f3936f3a48faf267b09924a6c3c Mon Sep 17 00:00:00 2001 From: Karsten Sperling <113487422+ksperling-apple@users.noreply.github.com> Date: Wed, 29 May 2024 12:03:45 +1200 Subject: [PATCH 14/43] CASESessionManager should shut down AddressResolve::Resolver (#33607) CASESessionManager initializes the address resolver in its Init method, so it should also shut it down in Shutdown. --- src/app/CASESessionManager.cpp | 5 +++++ src/app/CASESessionManager.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/app/CASESessionManager.cpp b/src/app/CASESessionManager.cpp index 162ae7021a9f9f..dc2656338d791a 100644 --- a/src/app/CASESessionManager.cpp +++ b/src/app/CASESessionManager.cpp @@ -29,6 +29,11 @@ CHIP_ERROR CASESessionManager::Init(chip::System::Layer * systemLayer, const CAS return AddressResolve::Resolver::Instance().Init(systemLayer); } +void CASESessionManager::Shutdown() +{ + AddressResolve::Resolver::Instance().Shutdown(); +} + void CASESessionManager::FindOrEstablishSession(const ScopedNodeId & peerId, Callback::Callback * onConnection, Callback::Callback * onFailure, #if CHIP_DEVICE_CONFIG_ENABLE_AUTOMATIC_CASE_RETRIES diff --git a/src/app/CASESessionManager.h b/src/app/CASESessionManager.h index 38b39108b43b7e..e536a62cf80908 100644 --- a/src/app/CASESessionManager.h +++ b/src/app/CASESessionManager.h @@ -59,7 +59,7 @@ class CASESessionManager : public OperationalSessionReleaseDelegate, public Sess } CHIP_ERROR Init(chip::System::Layer * systemLayer, const CASESessionManagerConfig & params); - void Shutdown() {} + void Shutdown(); /** * Find an existing session for the given node ID, or trigger a new session From fc3591d656d383e274bf538a21b3b22d764d4ec3 Mon Sep 17 00:00:00 2001 From: Karsten Sperling <113487422+ksperling-apple@users.noreply.github.com> Date: Wed, 29 May 2024 22:35:11 +1200 Subject: [PATCH 15/43] Add Wi-Fi Network Management Cluster and use correct NIM device type id (#33519) * Add Wi-Fi Network Management Cluster and use correct NIM device type id * zap_regen_all * Change minimal CI job to build network-manager-app * Keep the minimal all-clusters-app build since it's required for merge * Cluster ID should be 0x0451 * zap_regen_all * Address review comments and other small tweaks - Factor out HaveNetworkCredentials() helper and use it consistently - Validate WPA credential in SetNetworkCredentials() - Don't emit an SSID change when only the passphrase changes - Use CHIPSafeCasts - Avoid std::bind (and we can't use std::bind_front yet) - Add a destructor that unregisters handlers * Address review comments - Rename Server -> WiFiNetworkManagementServer and move it up a namespace. - Move internal definitions into an anonymous namespace. --- .github/workflows/minimal-build.yaml | 24 +- .github/workflows/tests.yaml | 1 + docs/zap_clusters.md | 1 + examples/network-manager-app/linux/main.cpp | 12 + .../network-manager-app.matter | 37 +- .../network-manager-app.zap | 157 +++- scripts/rules.matterlint | 1 + src/app/CommandHandlerInterface.h | 2 + .../wifi-network-management-server.cpp | 176 ++++ .../wifi-network-management-server.h | 74 ++ src/app/common/templates/config-data.yaml | 2 + src/app/zap-templates/zcl/data-model/all.xml | 1 + .../zcl/data-model/chip/matter-devices.xml | 3 +- .../chip/wifi-network-management-cluster.xml | 44 + .../zcl/zcl-with-test-extensions.json | 4 +- src/app/zap-templates/zcl/zcl.json | 4 +- src/app/zap_cluster_list.json | 1 + .../data_model/controller-clusters.matter | 20 + .../chip/devicecontroller/ChipClusters.java | 254 ++++++ .../devicecontroller/ClusterIDMapping.java | 105 +++ .../devicecontroller/ClusterInfoMapping.java | 148 ++++ .../devicecontroller/ClusterReadMapping.java | 82 ++ .../devicecontroller/ClusterWriteMapping.java | 2 + .../clusters/WiFiNetworkManagementCluster.kt | 786 ++++++++++++++++++ .../java/matter/controller/cluster/files.gni | 1 + .../CHIPAttributeTLVValueDecoder.cpp | 164 ++++ .../CHIPEventTLVValueDecoder.cpp | 10 + .../python/chip/clusters/CHIPClusters.py | 58 ++ .../python/chip/clusters/Objects.py | 169 ++++ .../CHIP/templates/availability.yaml | 4 + .../MTRAttributeSpecifiedCheck.mm | 33 + .../MTRAttributeTLVValueDecoder.mm | 30 + .../CHIP/zap-generated/MTRBaseClusters.h | 76 ++ .../CHIP/zap-generated/MTRBaseClusters.mm | 285 +++++++ .../CHIP/zap-generated/MTRClusterConstants.h | 14 + .../CHIP/zap-generated/MTRClusterNames.mm | 41 + .../CHIP/zap-generated/MTRClusters.h | 42 + .../CHIP/zap-generated/MTRClusters.mm | 70 ++ .../zap-generated/MTRCommandPayloadsObjc.h | 47 ++ .../zap-generated/MTRCommandPayloadsObjc.mm | 152 ++++ .../MTRCommandPayloads_Internal.h | 12 + .../zap-generated/MTRCommandTimedCheck.mm | 12 + .../zap-generated/MTRDeviceTypeMetadata.mm | 2 +- .../zap-generated/MTREventTLVValueDecoder.mm | 15 + .../zap-generated/attributes/Accessors.cpp | 99 +++ .../zap-generated/attributes/Accessors.h | 18 + .../app-common/zap-generated/callback.h | 43 + .../app-common/zap-generated/cluster-enums.h | 2 + .../zap-generated/cluster-objects.cpp | 94 +++ .../zap-generated/cluster-objects.h | 151 ++++ .../app-common/zap-generated/ids/Attributes.h | 34 + .../app-common/zap-generated/ids/Clusters.h | 3 + .../app-common/zap-generated/ids/Commands.h | 14 + .../zap-generated/cluster/Commands.h | 113 +++ .../cluster/logging/DataModelLogger.cpp | 60 ++ .../cluster/logging/DataModelLogger.h | 3 + .../zap-generated/cluster/Commands.h | 718 ++++++++++++++++ 57 files changed, 4515 insertions(+), 15 deletions(-) create mode 100644 src/app/clusters/wifi-network-management-server/wifi-network-management-server.cpp create mode 100644 src/app/clusters/wifi-network-management-server/wifi-network-management-server.h create mode 100644 src/app/zap-templates/zcl/data-model/chip/wifi-network-management-cluster.xml create mode 100644 src/controller/java/generated/java/matter/controller/cluster/clusters/WiFiNetworkManagementCluster.kt diff --git a/.github/workflows/minimal-build.yaml b/.github/workflows/minimal-build.yaml index 46f1d0b1fce68e..ac11a145c7fa4e 100644 --- a/.github/workflows/minimal-build.yaml +++ b/.github/workflows/minimal-build.yaml @@ -26,7 +26,7 @@ concurrency: cancel-in-progress: true jobs: - minimal: + minimal-all-clusters: name: Linux / configure build of all-clusters-app if: github.actor != 'restyled-io[bot]' @@ -47,3 +47,25 @@ jobs: - name: Configure and build All Clusters App run: | CC=gcc CXX=g++ scripts/configure --project=examples/all-clusters-app/linux && ./ninja-build + + minimal-network-manager: + name: Linux / configure build of network-manager-app + + if: github.actor != 'restyled-io[bot]' + runs-on: ubuntu-latest + + container: + image: ghcr.io/project-chip/chip-build-minimal:50 + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Checkout submodules # but don't bootstrap! + uses: ./.github/actions/checkout-submodules + with: + platform: linux + + - name: Configure and build Network Manager App + run: | + CC=gcc CXX=g++ scripts/configure --project=examples/network-manager-app/linux && ./ninja-build diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 57bc3971d44ea3..4dc5a4cc48218f 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -189,6 +189,7 @@ jobs: src/app/zap-templates/zcl/data-model/chip/wake-on-lan-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/washer-controls-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/wifi-network-diagnostics-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/wifi-network-management-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/window-covering.xml \ src/app/zap-templates/zcl/data-model/chip/temperature-control-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/matter-devices.xml \ diff --git a/docs/zap_clusters.md b/docs/zap_clusters.md index eedfb7190e2f27..a11a552bf023a6 100644 --- a/docs/zap_clusters.md +++ b/docs/zap_clusters.md @@ -112,6 +112,7 @@ Generally regenerate using one of: | 1069 | 0x42D | Pm10ConcentrationMeasurement | | 1070 | 0x42E | TotalVolatileOrganicCompoundsConcentrationMeasurement | | 1071 | 0x42F | RadonConcentrationMeasurement | +| 1105 | 0x451 | WiFiNetworkManagement | | 1283 | 0x503 | WakeOnLan | | 1284 | 0x504 | Channel | | 1285 | 0x505 | TargetNavigator | diff --git a/examples/network-manager-app/linux/main.cpp b/examples/network-manager-app/linux/main.cpp index 362ecb3100ad6a..ee6763a6d3d47d 100644 --- a/examples/network-manager-app/linux/main.cpp +++ b/examples/network-manager-app/linux/main.cpp @@ -16,13 +16,22 @@ */ #include +#include +#include +#include using namespace chip; using namespace chip::app; +using namespace chip::app::Clusters; void ApplicationInit() {} void ApplicationShutdown() {} +ByteSpan ByteSpanFromCharSpan(CharSpan span) +{ + return ByteSpan(Uint8::from_const_char(span.data()), span.size()); +} + int main(int argc, char * argv[]) { if (ChipLinuxAppInit(argc, argv) != 0) @@ -30,6 +39,9 @@ int main(int argc, char * argv[]) return -1; } + WiFiNetworkManagementServer::Instance().SetNetworkCredentials(ByteSpanFromCharSpan("MatterAP"_span), + ByteSpanFromCharSpan("Setec Astronomy"_span)); + ChipLinuxAppMainLoop(); return 0; } diff --git a/examples/network-manager-app/network-manager-common/network-manager-app.matter b/examples/network-manager-app/network-manager-common/network-manager-app.matter index 8c935fbe9f9f08..935be20690a105 100644 --- a/examples/network-manager-app/network-manager-common/network-manager-app.matter +++ b/examples/network-manager-app/network-manager-common/network-manager-app.matter @@ -1175,6 +1175,26 @@ cluster GroupKeyManagement = 63 { fabric command access(invoke: administer) KeySetReadAllIndices(): KeySetReadAllIndicesResponse = 4; } +/** Functionality to retrieve operational information about a managed Wi-Fi network. */ +cluster WiFiNetworkManagement = 1105 { + revision 1; + + readonly attribute nullable octet_string<32> ssid = 1; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + response struct NetworkPassphraseResponse = 1 { + octet_string<64> passphrase = 0; + } + + /** Request the current WPA-Personal passphrase or PSK associated with the managed Wi-Fi network. */ + command access(invoke: administer) NetworkPassphraseRequest(): NetworkPassphraseResponse = 0; +} + endpoint 0 { device type ma_rootdevice = 22, version 1; @@ -1280,7 +1300,7 @@ endpoint 0 { callback attribute acceptedCommandList; callback attribute attributeList; callback attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 0; } server cluster GeneralDiagnostics { @@ -1425,7 +1445,7 @@ endpoint 0 { } } endpoint 1 { - device type ma_network_infrastructure_manager = 4293984272, version 1; + device type ma_network_infrastructure_manager = 144, version 1; server cluster Descriptor { @@ -1440,6 +1460,19 @@ endpoint 1 { callback attribute featureMap; callback attribute clusterRevision; } + + server cluster WiFiNetworkManagement { + callback attribute ssid; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command NetworkPassphraseRequest; + handle command NetworkPassphraseResponse; + } } diff --git a/examples/network-manager-app/network-manager-common/network-manager-app.zap b/examples/network-manager-app/network-manager-common/network-manager-app.zap index d144300c7dada7..46cb4b19598ca8 100644 --- a/examples/network-manager-app/network-manager-common/network-manager-app.zap +++ b/examples/network-manager-app/network-manager-common/network-manager-app.zap @@ -1,6 +1,6 @@ { "fileFormat": 2, - "featureLevel": 100, + "featureLevel": 102, "creator": "zap", "keyValuePairs": [ { @@ -13,7 +13,7 @@ }, { "key": "manufacturerCodes", - "value": "0x1002" + "value": "0xFFF1" } ], "package": [ @@ -29,6 +29,7 @@ "pathRelativity": "relativeToZap", "path": "../../../src/app/zap-templates/app-templates.json", "type": "gen-templates-json", + "category": "matter", "version": "chip-v1" } ], @@ -1352,10 +1353,10 @@ "side": "server", "type": "int16u", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "0", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3016,14 +3017,14 @@ "id": 2, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "code": 4293984272, + "code": 144, "profileId": 259, "label": "MA-network-infrastructure-manager", "name": "MA-network-infrastructure-manager" }, "deviceTypes": [ { - "code": 4293984272, + "code": 144, "profileId": 259, "label": "MA-network-infrastructure-manager", "name": "MA-network-infrastructure-manager" @@ -3033,10 +3034,10 @@ 1 ], "deviceIdentifiers": [ - 4293984272 + 144 ], "deviceTypeName": "MA-network-infrastructure-manager", - "deviceTypeCode": 4293984272, + "deviceTypeCode": 144, "deviceTypeProfileId": 259, "clusters": [ { @@ -3208,6 +3209,146 @@ "reportableChange": 0 } ] + }, + { + "name": "Wi-Fi Network Management", + "code": 1105, + "mfgCode": null, + "define": "WIFI_NETWORK_MANAGEMENT_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "NetworkPassphraseRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "NetworkPassphraseResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "SSID", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] } ] } diff --git a/scripts/rules.matterlint b/scripts/rules.matterlint index e876bae22094c6..037ed829a15a11 100644 --- a/scripts/rules.matterlint +++ b/scripts/rules.matterlint @@ -97,6 +97,7 @@ load "../src/app/zap-templates/zcl/data-model/chip/user-label-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/wake-on-lan-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/washer-controls-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/wifi-network-diagnostics-cluster.xml"; +load "../src/app/zap-templates/zcl/data-model/chip/wifi-network-management-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/window-covering.xml"; load "../src/app/zap-templates/zcl/data-model/chip/temperature-control-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/refrigerator-alarm.xml"; diff --git a/src/app/CommandHandlerInterface.h b/src/app/CommandHandlerInterface.h index 6ec2547befa1d0..d36a41e37f076c 100644 --- a/src/app/CommandHandlerInterface.h +++ b/src/app/CommandHandlerInterface.h @@ -23,8 +23,10 @@ #include #include #include // So we can encode lists +#include #include #include +#include namespace chip { namespace app { diff --git a/src/app/clusters/wifi-network-management-server/wifi-network-management-server.cpp b/src/app/clusters/wifi-network-management-server/wifi-network-management-server.cpp new file mode 100644 index 00000000000000..1a739e354bd3df --- /dev/null +++ b/src/app/clusters/wifi-network-management-server/wifi-network-management-server.cpp @@ -0,0 +1,176 @@ +/** + * + * Copyright (c) 2024 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "wifi-network-management-server.h" + +#include +#include +#include +#include +#include +#include + +#include +#include + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::WiFiNetworkManagement::Attributes; +using namespace chip::app::Clusters::WiFiNetworkManagement::Commands; +using namespace std::placeholders; + +namespace chip { +namespace app { +namespace Clusters { + +namespace { + +// TODO: Move this into lib/support somewhere and also use it network-commissioning.cpp +bool IsValidWpaPersonalCredential(ByteSpan credential) +{ + // As per spec section 11.9.7.3. AddOrUpdateWiFiNetwork Command + if (8 <= credential.size() && credential.size() <= 63) // passphrase + { + return true; + } + if (credential.size() == 64) // raw hex psk + { + return std::all_of(credential.begin(), credential.end(), [](auto c) { return std::isxdigit(c); }); + } + return false; +} + +Global gWiFiNetworkManagementServerInstance; + +} // namespace + +WiFiNetworkManagementServer & WiFiNetworkManagementServer::Instance() +{ + return gWiFiNetworkManagementServerInstance.get(); +} + +WiFiNetworkManagementServer::WiFiNetworkManagementServer() : + AttributeAccessInterface(NullOptional, WiFiNetworkManagement::Id), + CommandHandlerInterface(NullOptional, WiFiNetworkManagement::Id) +{} + +WiFiNetworkManagementServer::~WiFiNetworkManagementServer() +{ + unregisterAttributeAccessOverride(this); + InteractionModelEngine::GetInstance()->UnregisterCommandHandler(this); +} + +CHIP_ERROR WiFiNetworkManagementServer::Init(EndpointId endpoint) +{ + VerifyOrReturnError(endpoint != kInvalidEndpointId, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(mEndpointId == kInvalidEndpointId, CHIP_ERROR_INCORRECT_STATE); + + mEndpointId = endpoint; + VerifyOrReturnError(registerAttributeAccessOverride(this), CHIP_ERROR_INTERNAL); + ReturnErrorOnFailure(InteractionModelEngine::GetInstance()->RegisterCommandHandler(this)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR WiFiNetworkManagementServer::ClearNetworkCredentials() +{ + VerifyOrReturnError(HaveNetworkCredentials(), CHIP_NO_ERROR); + + mSsidLen = 0; + mPassphrase.SetLength(0); + MatterReportingAttributeChangeCallback(mEndpointId, WiFiNetworkManagement::Id, Ssid::Id); + return CHIP_NO_ERROR; +} + +CHIP_ERROR WiFiNetworkManagementServer::SetNetworkCredentials(ByteSpan ssid, ByteSpan passphrase) +{ + VerifyOrReturnError(1 <= ssid.size() && ssid.size() <= sizeof(mSsid), CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(IsValidWpaPersonalCredential(passphrase), CHIP_ERROR_INVALID_ARGUMENT); + + bool ssidChanged = !SsidSpan().data_equal(ssid); + bool passphraseChanged = !PassphraseSpan().data_equal(passphrase); + VerifyOrReturnError(ssidChanged || passphraseChanged, CHIP_NO_ERROR); + + memcpy(mSsid, ssid.data(), ssid.size()); + mSsidLen = static_cast(ssid.size()); + + VerifyOrDie(mPassphrase.SetLength(passphrase.size()) == CHIP_NO_ERROR); + memcpy(mPassphrase.Bytes(), passphrase.data(), passphrase.size()); + + // Note: The spec currently defines no way to signal a passphrase change + if (ssidChanged) + { + MatterReportingAttributeChangeCallback(mEndpointId, WiFiNetworkManagement::Id, Ssid::Id); + } + return CHIP_NO_ERROR; +} + +CHIP_ERROR WiFiNetworkManagementServer::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) +{ + switch (aPath.mAttributeId) + { + case Ssid::Id: + return HaveNetworkCredentials() ? aEncoder.Encode(SsidSpan()) : aEncoder.EncodeNull(); + } + return CHIP_NO_ERROR; +} + +void WiFiNetworkManagementServer::InvokeCommand(HandlerContext & ctx) +{ + switch (ctx.mRequestPath.mCommandId) + { + case NetworkPassphraseRequest::Id: + HandleCommand( + ctx, [this](HandlerContext & aCtx, const auto & req) { HandleNetworkPassphraseRequest(aCtx, req); }); + return; + } +} + +void WiFiNetworkManagementServer::HandleNetworkPassphraseRequest(HandlerContext & ctx, + const NetworkPassphraseRequest::DecodableType & req) +{ + if (HaveNetworkCredentials()) + { + NetworkPassphraseResponse::Type response; + response.passphrase = mPassphrase.Span(); + ctx.mCommandHandler.AddResponse(ctx.mRequestPath, response); + } + else + { + // TODO: Status code TBC: https://github.com/CHIP-Specifications/connectedhomeip-spec/issues/9234 + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Protocols::InteractionModel::Status::InvalidInState); + } +} + +} // namespace Clusters +} // namespace app +} // namespace chip + +#if defined(MATTER_DM_WIFI_NETWORK_MANAGEMENT_CLUSTER_SERVER_ENDPOINT_COUNT) && \ + MATTER_DM_WIFI_NETWORK_MANAGEMENT_CLUSTER_SERVER_ENDPOINT_COUNT > 1 +#error Only a single Wi-Fi Network Management Cluster instance is supported. +#endif + +void MatterWiFiNetworkManagementPluginServerInitCallback() {} + +void emberAfWiFiNetworkManagementClusterServerInitCallback(EndpointId endpoint) +{ + // We could delay constructing the instance until this point; however it's not + // clear if this is inconvenient in terms of forcing the application to initialize + // the network credentials later than it otherwise would. + LogErrorOnFailure(chip::app::Clusters::WiFiNetworkManagementServer::Instance().Init(endpoint)); +} diff --git a/src/app/clusters/wifi-network-management-server/wifi-network-management-server.h b/src/app/clusters/wifi-network-management-server/wifi-network-management-server.h new file mode 100644 index 00000000000000..aa3cba89636a77 --- /dev/null +++ b/src/app/clusters/wifi-network-management-server/wifi-network-management-server.h @@ -0,0 +1,74 @@ +/** + * + * Copyright (c) 2024 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include +#include +#include +#include + +void emberAfWiFiNetworkManagementClusterServerInitCallback(chip::EndpointId); + +namespace chip { +namespace app { +namespace Clusters { + +class WiFiNetworkManagementServer : private AttributeAccessInterface, private CommandHandlerInterface +{ +public: + static WiFiNetworkManagementServer & Instance(); + + CHIP_ERROR ClearNetworkCredentials(); + CHIP_ERROR SetNetworkCredentials(ByteSpan ssid, ByteSpan passphrase); + +private: + friend Global; + friend void ::emberAfWiFiNetworkManagementClusterServerInitCallback(chip::EndpointId); + + WiFiNetworkManagementServer(); + ~WiFiNetworkManagementServer(); + CHIP_ERROR Init(EndpointId endpoint); + + WiFiNetworkManagementServer(WiFiNetworkManagementServer const &) = delete; + WiFiNetworkManagementServer & operator=(WiFiNetworkManagementServer const &) = delete; + + CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; + void InvokeCommand(HandlerContext & handlerContext) override; + + void HandleNetworkPassphraseRequest(HandlerContext & ctx, + const WiFiNetworkManagement::Commands::NetworkPassphraseRequest::DecodableType & req); + + EndpointId mEndpointId = kInvalidEndpointId; + + uint8_t mSsid[32]; + uint8_t mSsidLen = 0; + static_assert(std::numeric_limits::max() >= sizeof(mSsid)); + ByteSpan SsidSpan() const { return ByteSpan(mSsid, mSsidLen); } + + Crypto::SensitiveDataBuffer<64> mPassphrase; + ByteSpan PassphraseSpan() const { return mPassphrase.Span(); } + + bool HaveNetworkCredentials() { return mSsidLen > 0; } +}; + +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/common/templates/config-data.yaml b/src/app/common/templates/config-data.yaml index 875cdbcdbd1514..83d1b682153ed7 100644 --- a/src/app/common/templates/config-data.yaml +++ b/src/app/common/templates/config-data.yaml @@ -40,6 +40,7 @@ CommandHandlerInterfaceOnlyClusters: - Device Energy Management Mode - Electrical Power Measurement - Electrical Energy Measurement + - Wi-Fi Network Management # We need a more configurable way of deciding which clusters have which init functions.... # See https://github.com/project-chip/connectedhomeip/issues/4369 @@ -57,6 +58,7 @@ ClustersWithInitFunctions: - Mode Select - Sample MEI - Scenes Management + - Wi-Fi Network Management ClustersWithAttributeChangedFunctions: - Bridged Device Basic diff --git a/src/app/zap-templates/zcl/data-model/all.xml b/src/app/zap-templates/zcl/data-model/all.xml index 86d2085718291d..9686aa74eed0d0 100644 --- a/src/app/zap-templates/zcl/data-model/all.xml +++ b/src/app/zap-templates/zcl/data-model/all.xml @@ -104,6 +104,7 @@ + diff --git a/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml b/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml index 795f7a71cf54bc..83a462c4a64a4a 100644 --- a/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml +++ b/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml @@ -2420,11 +2420,12 @@ limitations under the License. CHIP Matter Network Infrastructure Manager 0x0103 - 0xFFF10010 + 0x0090 Simple Endpoint + diff --git a/src/app/zap-templates/zcl/data-model/chip/wifi-network-management-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/wifi-network-management-cluster.xml new file mode 100644 index 00000000000000..f05faad4dae4d2 --- /dev/null +++ b/src/app/zap-templates/zcl/data-model/chip/wifi-network-management-cluster.xml @@ -0,0 +1,44 @@ + + + + + + + Network Infrastructure + Wi-Fi Network Management + 0x0451 + WIFI_NETWORK_MANAGEMENT_CLUSTER + Functionality to retrieve operational information about a managed Wi-Fi network. + + true + true + + + + + SSID + + + Request the current WPA-Personal passphrase or PSK associated with the managed Wi-Fi network. + + + + This is the response to a NetworkPassphraseRequest. + + + + diff --git a/src/app/zap-templates/zcl/zcl-with-test-extensions.json b/src/app/zap-templates/zcl/zcl-with-test-extensions.json index 7213b96cf0e012..f3aa6ef0b47f48 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -125,6 +125,7 @@ "wake-on-lan-cluster.xml", "washer-controls-cluster.xml", "wifi-network-diagnostics-cluster.xml", + "wifi-network-management-cluster.xml", "window-covering.xml", "matter-devices.xml", "sample-mei-cluster.xml", @@ -633,7 +634,8 @@ ], "Power Topology": ["FeatureMap"], "Valve Configuration and Control": ["RemainingDuration"], - "Boolean State Configuration": ["CurrentSensitivityLevel"] + "Boolean State Configuration": ["CurrentSensitivityLevel"], + "Wi-Fi Network Management": ["SSID"] }, "defaultReportingPolicy": "mandatory", "ZCLDataTypes": ["ARRAY", "BITMAP", "ENUM", "NUMBER", "STRING", "STRUCT"], diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index 8a4159e98f7eb8..d85f850b2c9483 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -123,6 +123,7 @@ "wake-on-lan-cluster.xml", "washer-controls-cluster.xml", "wifi-network-diagnostics-cluster.xml", + "wifi-network-management-cluster.xml", "window-covering.xml", "matter-devices.xml", "sample-mei-cluster.xml", @@ -631,7 +632,8 @@ ], "Power Topology": ["FeatureMap"], "Valve Configuration and Control": ["RemainingDuration"], - "Boolean State Configuration": ["CurrentSensitivityLevel"] + "Boolean State Configuration": ["CurrentSensitivityLevel"], + "Wi-Fi Network Management": ["SSID"] }, "defaultReportingPolicy": "mandatory", "ZCLDataTypes": ["ARRAY", "BITMAP", "ENUM", "NUMBER", "STRING", "STRUCT"], diff --git a/src/app/zap_cluster_list.json b/src/app/zap_cluster_list.json index 2edfb272ad23e1..d86979f40adc9e 100644 --- a/src/app/zap_cluster_list.json +++ b/src/app/zap_cluster_list.json @@ -306,6 +306,7 @@ "LAUNDRY_WASHER_CONTROLS_CLUSTER": ["laundry-washer-controls-server"], "LAUNDRY_DRYER_CONTROLS_CLUSTER": ["laundry-dryer-controls-server"], "WIFI_NETWORK_DIAGNOSTICS_CLUSTER": ["wifi-network-diagnostics-server"], + "WIFI_NETWORK_MANAGEMENT_CLUSTER": ["wifi-network-management-server"], "WINDOW_COVERING_CLUSTER": ["window-covering-server"], "ZLL_COMMISSIONING_CLUSTER": [] } diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index cd310219ea88d2..bc59cbe055e139 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -7654,6 +7654,26 @@ cluster RadonConcentrationMeasurement = 1071 { readonly attribute int16u clusterRevision = 65533; } +/** Functionality to retrieve operational information about a managed Wi-Fi network. */ +cluster WiFiNetworkManagement = 1105 { + revision 1; + + readonly attribute nullable octet_string<32> ssid = 1; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + response struct NetworkPassphraseResponse = 1 { + octet_string<64> passphrase = 0; + } + + /** Request the current WPA-Personal passphrase or PSK associated with the managed Wi-Fi network. */ + command access(invoke: administer) NetworkPassphraseRequest(): NetworkPassphraseResponse = 0; +} + /** This cluster provides an interface for managing low power mode on a device that supports the Wake On LAN protocol. */ cluster WakeOnLan = 1283 { revision 1; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java index 2e64d37cd62b11..7a6caeb9532993 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java @@ -52829,6 +52829,260 @@ public void onSuccess(byte[] tlv) { } } + public static class WiFiNetworkManagementCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 1105L; + + private static final long SSID_ATTRIBUTE_ID = 1L; + private static final long GENERATED_COMMAND_LIST_ATTRIBUTE_ID = 65528L; + private static final long ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID = 65529L; + private static final long EVENT_LIST_ATTRIBUTE_ID = 65530L; + private static final long ATTRIBUTE_LIST_ATTRIBUTE_ID = 65531L; + private static final long FEATURE_MAP_ATTRIBUTE_ID = 65532L; + private static final long CLUSTER_REVISION_ATTRIBUTE_ID = 65533L; + + public WiFiNetworkManagementCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId, CLUSTER_ID); + } + + @Override + @Deprecated + public long initWithDevice(long devicePtr, int endpointId) { + return 0L; + } + + public void networkPassphraseRequest(NetworkPassphraseResponseCallback callback) { + networkPassphraseRequest(callback, 0); + } + + public void networkPassphraseRequest(NetworkPassphraseResponseCallback callback, int timedInvokeTimeoutMs) { + final long commandId = 0L; + + ArrayList elements = new ArrayList<>(); + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + final long passphraseFieldID = 0L; + byte[] passphrase = null; + for (StructElement element: invokeStructValue.value()) { + if (element.contextTagNum() == passphraseFieldID) { + if (element.value(BaseTLVType.class).type() == TLVType.ByteArray) { + ByteArrayType castingValue = element.value(ByteArrayType.class); + passphrase = castingValue.value(byte[].class); + } + } + } + callback.onSuccess(passphrase); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public interface NetworkPassphraseResponseCallback extends BaseClusterCallback { + void onSuccess(byte[] passphrase); + } + + public interface SsidAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable byte[] value); + } + + public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface AcceptedCommandListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface EventListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface AttributeListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public void readSsidAttribute( + SsidAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SSID_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable byte[] value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SSID_ATTRIBUTE_ID, true); + } + + public void subscribeSsidAttribute( + SsidAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SSID_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable byte[] value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SSID_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, GENERATED_COMMAND_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, GENERATED_COMMAND_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readEventListAttribute( + EventListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, EVENT_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, EVENT_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeEventListAttribute( + EventListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, EVENT_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, EVENT_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readAttributeListAttribute( + AttributeListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ATTRIBUTE_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ATTRIBUTE_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeAttributeListAttribute( + AttributeListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ATTRIBUTE_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ATTRIBUTE_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readFeatureMapAttribute( + LongAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FEATURE_MAP_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, FEATURE_MAP_ATTRIBUTE_ID, true); + } + + public void subscribeFeatureMapAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FEATURE_MAP_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, FEATURE_MAP_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readClusterRevisionAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CLUSTER_REVISION_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CLUSTER_REVISION_ATTRIBUTE_ID, true); + } + + public void subscribeClusterRevisionAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CLUSTER_REVISION_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CLUSTER_REVISION_ATTRIBUTE_ID, minInterval, maxInterval); + } + } + public static class WakeOnLanCluster extends BaseChipCluster { public static final long CLUSTER_ID = 1283L; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java index 3437b8a981e476..506d7386935c47 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java @@ -328,6 +328,9 @@ public static BaseCluster getCluster(long clusterId) { if (clusterId == RadonConcentrationMeasurement.ID) { return new RadonConcentrationMeasurement(); } + if (clusterId == WiFiNetworkManagement.ID) { + return new WiFiNetworkManagement(); + } if (clusterId == WakeOnLan.ID) { return new WakeOnLan(); } @@ -14313,6 +14316,108 @@ public long getCommandID(String name) throws IllegalArgumentException { return Command.valueOf(name).getID(); } } + public static class WiFiNetworkManagement implements BaseCluster { + public static final long ID = 1105L; + public long getID() { + return ID; + } + + public enum Attribute { + Ssid(1L), + GeneratedCommandList(65528L), + AcceptedCommandList(65529L), + EventList(65530L), + AttributeList(65531L), + FeatureMap(65532L), + ClusterRevision(65533L),; + private final long id; + Attribute(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Attribute value(long id) throws NoSuchFieldError { + for (Attribute attribute : Attribute.values()) { + if (attribute.getID() == id) { + return attribute; + } + } + throw new NoSuchFieldError(); + } + } + + public enum Event {; + private final long id; + Event(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Event value(long id) throws NoSuchFieldError { + for (Event event : Event.values()) { + if (event.getID() == id) { + return event; + } + } + throw new NoSuchFieldError(); + } + } + + public enum Command { + NetworkPassphraseRequest(0L),; + private final long id; + Command(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Command value(long id) throws NoSuchFieldError { + for (Command command : Command.values()) { + if (command.getID() == id) { + return command; + } + } + throw new NoSuchFieldError(); + } + }@Override + public String getAttributeName(long id) throws NoSuchFieldError { + return Attribute.value(id).toString(); + } + + @Override + public String getEventName(long id) throws NoSuchFieldError { + return Event.value(id).toString(); + } + + @Override + public String getCommandName(long id) throws NoSuchFieldError { + return Command.value(id).toString(); + } + + @Override + public long getAttributeID(String name) throws IllegalArgumentException { + return Attribute.valueOf(name).getID(); + } + + @Override + public long getEventID(String name) throws IllegalArgumentException { + return Event.valueOf(name).getID(); + } + + @Override + public long getCommandID(String name) throws IllegalArgumentException { + return Command.valueOf(name).getID(); + } + } public static class WakeOnLan implements BaseCluster { public static final long ID = 1283L; public long getID() { diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java index 4ded328fad6ed5..d7c4134c812d9d 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java @@ -17299,6 +17299,133 @@ public void onError(Exception ex) { } } + + public static class DelegatedWiFiNetworkManagementClusterNetworkPassphraseResponseCallback implements ChipClusters.WiFiNetworkManagementCluster.NetworkPassphraseResponseCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(byte[] passphrase) { + Map responseValues = new LinkedHashMap<>(); + + CommandResponseInfo passphraseResponseValue = new CommandResponseInfo("passphrase", "byte[]"); + responseValues.put(passphraseResponseValue, passphrase); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } + public static class DelegatedWiFiNetworkManagementClusterSsidAttributeCallback implements ChipClusters.WiFiNetworkManagementCluster.SsidAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable byte[] value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "byte[]"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedWiFiNetworkManagementClusterGeneratedCommandListAttributeCallback implements ChipClusters.WiFiNetworkManagementCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedWiFiNetworkManagementClusterAcceptedCommandListAttributeCallback implements ChipClusters.WiFiNetworkManagementCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedWiFiNetworkManagementClusterEventListAttributeCallback implements ChipClusters.WiFiNetworkManagementCluster.EventListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedWiFiNetworkManagementClusterAttributeListAttributeCallback implements ChipClusters.WiFiNetworkManagementCluster.AttributeListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + public static class DelegatedWakeOnLanClusterGeneratedCommandListAttributeCallback implements ChipClusters.WakeOnLanCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override @@ -21177,6 +21304,10 @@ public Map initializeClusterMap() { (ptr, endpointId) -> new ChipClusters.RadonConcentrationMeasurementCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("radonConcentrationMeasurement", radonConcentrationMeasurementClusterInfo); + ClusterInfo wiFiNetworkManagementClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.WiFiNetworkManagementCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("wiFiNetworkManagement", wiFiNetworkManagementClusterInfo); + ClusterInfo wakeOnLanClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.WakeOnLanCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("wakeOnLan", wakeOnLanClusterInfo); @@ -21353,6 +21484,7 @@ public void combineCommand(Map destination, Map> getCommandMap() { commandMap.put("radonConcentrationMeasurement", radonConcentrationMeasurementClusterInteractionInfoMap); + Map wiFiNetworkManagementClusterInteractionInfoMap = new LinkedHashMap<>(); + + Map wiFiNetworkManagementnetworkPassphraseRequestCommandParams = new LinkedHashMap(); + InteractionInfo wiFiNetworkManagementnetworkPassphraseRequestInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WiFiNetworkManagementCluster) cluster) + .networkPassphraseRequest((ChipClusters.WiFiNetworkManagementCluster.NetworkPassphraseResponseCallback) callback + ); + }, + () -> new DelegatedWiFiNetworkManagementClusterNetworkPassphraseResponseCallback(), + wiFiNetworkManagementnetworkPassphraseRequestCommandParams + ); + wiFiNetworkManagementClusterInteractionInfoMap.put("networkPassphraseRequest", wiFiNetworkManagementnetworkPassphraseRequestInteractionInfo); + + commandMap.put("wiFiNetworkManagement", wiFiNetworkManagementClusterInteractionInfoMap); + Map wakeOnLanClusterInteractionInfoMap = new LinkedHashMap<>(); commandMap.put("wakeOnLan", wakeOnLanClusterInteractionInfoMap); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java index cc18af0810cc10..e75473bc0869b8 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java @@ -16529,6 +16529,87 @@ private static Map readRadonConcentrationMeasurementInt return result; } + private static Map readWiFiNetworkManagementInteractionInfo() { + Map result = new LinkedHashMap<>();Map readWiFiNetworkManagementSsidCommandParams = new LinkedHashMap(); + InteractionInfo readWiFiNetworkManagementSsidAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WiFiNetworkManagementCluster) cluster).readSsidAttribute( + (ChipClusters.WiFiNetworkManagementCluster.SsidAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedWiFiNetworkManagementClusterSsidAttributeCallback(), + readWiFiNetworkManagementSsidCommandParams + ); + result.put("readSsidAttribute", readWiFiNetworkManagementSsidAttributeInteractionInfo); + Map readWiFiNetworkManagementGeneratedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readWiFiNetworkManagementGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WiFiNetworkManagementCluster) cluster).readGeneratedCommandListAttribute( + (ChipClusters.WiFiNetworkManagementCluster.GeneratedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedWiFiNetworkManagementClusterGeneratedCommandListAttributeCallback(), + readWiFiNetworkManagementGeneratedCommandListCommandParams + ); + result.put("readGeneratedCommandListAttribute", readWiFiNetworkManagementGeneratedCommandListAttributeInteractionInfo); + Map readWiFiNetworkManagementAcceptedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readWiFiNetworkManagementAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WiFiNetworkManagementCluster) cluster).readAcceptedCommandListAttribute( + (ChipClusters.WiFiNetworkManagementCluster.AcceptedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedWiFiNetworkManagementClusterAcceptedCommandListAttributeCallback(), + readWiFiNetworkManagementAcceptedCommandListCommandParams + ); + result.put("readAcceptedCommandListAttribute", readWiFiNetworkManagementAcceptedCommandListAttributeInteractionInfo); + Map readWiFiNetworkManagementEventListCommandParams = new LinkedHashMap(); + InteractionInfo readWiFiNetworkManagementEventListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WiFiNetworkManagementCluster) cluster).readEventListAttribute( + (ChipClusters.WiFiNetworkManagementCluster.EventListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedWiFiNetworkManagementClusterEventListAttributeCallback(), + readWiFiNetworkManagementEventListCommandParams + ); + result.put("readEventListAttribute", readWiFiNetworkManagementEventListAttributeInteractionInfo); + Map readWiFiNetworkManagementAttributeListCommandParams = new LinkedHashMap(); + InteractionInfo readWiFiNetworkManagementAttributeListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WiFiNetworkManagementCluster) cluster).readAttributeListAttribute( + (ChipClusters.WiFiNetworkManagementCluster.AttributeListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedWiFiNetworkManagementClusterAttributeListAttributeCallback(), + readWiFiNetworkManagementAttributeListCommandParams + ); + result.put("readAttributeListAttribute", readWiFiNetworkManagementAttributeListAttributeInteractionInfo); + Map readWiFiNetworkManagementFeatureMapCommandParams = new LinkedHashMap(); + InteractionInfo readWiFiNetworkManagementFeatureMapAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WiFiNetworkManagementCluster) cluster).readFeatureMapAttribute( + (ChipClusters.LongAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readWiFiNetworkManagementFeatureMapCommandParams + ); + result.put("readFeatureMapAttribute", readWiFiNetworkManagementFeatureMapAttributeInteractionInfo); + Map readWiFiNetworkManagementClusterRevisionCommandParams = new LinkedHashMap(); + InteractionInfo readWiFiNetworkManagementClusterRevisionAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WiFiNetworkManagementCluster) cluster).readClusterRevisionAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readWiFiNetworkManagementClusterRevisionCommandParams + ); + result.put("readClusterRevisionAttribute", readWiFiNetworkManagementClusterRevisionAttributeInteractionInfo); + + return result; + } private static Map readWakeOnLanInteractionInfo() { Map result = new LinkedHashMap<>();Map readWakeOnLanMACAddressCommandParams = new LinkedHashMap(); InteractionInfo readWakeOnLanMACAddressAttributeInteractionInfo = new InteractionInfo( @@ -20588,6 +20669,7 @@ public Map> getReadAttributeMap() { put("pm10ConcentrationMeasurement", readPm10ConcentrationMeasurementInteractionInfo()); put("totalVolatileOrganicCompoundsConcentrationMeasurement", readTotalVolatileOrganicCompoundsConcentrationMeasurementInteractionInfo()); put("radonConcentrationMeasurement", readRadonConcentrationMeasurementInteractionInfo()); + put("wiFiNetworkManagement", readWiFiNetworkManagementInteractionInfo()); put("wakeOnLan", readWakeOnLanInteractionInfo()); put("channel", readChannelInteractionInfo()); put("targetNavigator", readTargetNavigatorInteractionInfo()); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java index 0e5a32b23f04c4..93f3a7790eb8fa 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java @@ -3636,6 +3636,8 @@ public Map> getWriteAttributeMap() { writeAttributeMap.put("totalVolatileOrganicCompoundsConcentrationMeasurement", writeTotalVolatileOrganicCompoundsConcentrationMeasurementInteractionInfo); Map writeRadonConcentrationMeasurementInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("radonConcentrationMeasurement", writeRadonConcentrationMeasurementInteractionInfo); + Map writeWiFiNetworkManagementInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("wiFiNetworkManagement", writeWiFiNetworkManagementInteractionInfo); Map writeWakeOnLanInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("wakeOnLan", writeWakeOnLanInteractionInfo); Map writeChannelInteractionInfo = new LinkedHashMap<>(); diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/WiFiNetworkManagementCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/WiFiNetworkManagementCluster.kt new file mode 100644 index 00000000000000..5deb4b8317d3a4 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/WiFiNetworkManagementCluster.kt @@ -0,0 +1,786 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package matter.controller.cluster.clusters + +import java.time.Duration +import java.util.logging.Level +import java.util.logging.Logger +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.transform +import matter.controller.InvokeRequest +import matter.controller.InvokeResponse +import matter.controller.MatterController +import matter.controller.ReadData +import matter.controller.ReadRequest +import matter.controller.SubscribeRequest +import matter.controller.SubscriptionState +import matter.controller.UIntSubscriptionState +import matter.controller.UShortSubscriptionState +import matter.controller.cluster.structs.* +import matter.controller.model.AttributePath +import matter.controller.model.CommandPath +import matter.tlv.AnonymousTag +import matter.tlv.ContextSpecificTag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class WiFiNetworkManagementCluster( + private val controller: MatterController, + private val endpointId: UShort +) { + class NetworkPassphraseResponse(val passphrase: ByteArray) + + class SsidAttribute(val value: ByteArray?) + + sealed class SsidAttributeSubscriptionState { + data class Success(val value: ByteArray?) : SsidAttributeSubscriptionState() + + data class Error(val exception: Exception) : SsidAttributeSubscriptionState() + + object SubscriptionEstablished : SsidAttributeSubscriptionState() + } + + class GeneratedCommandListAttribute(val value: List) + + sealed class GeneratedCommandListAttributeSubscriptionState { + data class Success(val value: List) : GeneratedCommandListAttributeSubscriptionState() + + data class Error(val exception: Exception) : GeneratedCommandListAttributeSubscriptionState() + + object SubscriptionEstablished : GeneratedCommandListAttributeSubscriptionState() + } + + class AcceptedCommandListAttribute(val value: List) + + sealed class AcceptedCommandListAttributeSubscriptionState { + data class Success(val value: List) : AcceptedCommandListAttributeSubscriptionState() + + data class Error(val exception: Exception) : AcceptedCommandListAttributeSubscriptionState() + + object SubscriptionEstablished : AcceptedCommandListAttributeSubscriptionState() + } + + class EventListAttribute(val value: List) + + sealed class EventListAttributeSubscriptionState { + data class Success(val value: List) : EventListAttributeSubscriptionState() + + data class Error(val exception: Exception) : EventListAttributeSubscriptionState() + + object SubscriptionEstablished : EventListAttributeSubscriptionState() + } + + class AttributeListAttribute(val value: List) + + sealed class AttributeListAttributeSubscriptionState { + data class Success(val value: List) : AttributeListAttributeSubscriptionState() + + data class Error(val exception: Exception) : AttributeListAttributeSubscriptionState() + + object SubscriptionEstablished : AttributeListAttributeSubscriptionState() + } + + suspend fun networkPassphraseRequest( + timedInvokeTimeout: Duration? = null + ): NetworkPassphraseResponse { + val commandId: UInt = 0u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + tlvWriter.endStructure() + + val request: InvokeRequest = + InvokeRequest( + CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), + tlvPayload = tlvWriter.getEncoded(), + timedRequest = timedInvokeTimeout + ) + + val response: InvokeResponse = controller.invoke(request) + logger.log(Level.FINE, "Invoke command succeeded: ${response}") + + val tlvReader = TlvReader(response.payload) + tlvReader.enterStructure(AnonymousTag) + val TAG_PASSPHRASE: Int = 0 + var passphrase_decoded: ByteArray? = null + + while (!tlvReader.isEndOfContainer()) { + val tag = tlvReader.peekElement().tag + + if (tag == ContextSpecificTag(TAG_PASSPHRASE)) { + passphrase_decoded = tlvReader.getByteArray(tag) + } else { + tlvReader.skipElement() + } + } + + if (passphrase_decoded == null) { + throw IllegalStateException("passphrase not found in TLV") + } + + tlvReader.exitContainer() + + return NetworkPassphraseResponse(passphrase_decoded) + } + + suspend fun readSsidAttribute(): SsidAttribute { + val ATTRIBUTE_ID: UInt = 1u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Ssid attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: ByteArray? = + if (!tlvReader.isNull()) { + tlvReader.getByteArray(AnonymousTag) + } else { + tlvReader.getNull(AnonymousTag) + null + } + + return SsidAttribute(decodedValue) + } + + suspend fun subscribeSsidAttribute( + minInterval: Int, + maxInterval: Int + ): Flow { + val ATTRIBUTE_ID: UInt = 1u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()) + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + SsidAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Ssid attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: ByteArray? = + if (!tlvReader.isNull()) { + tlvReader.getByteArray(AnonymousTag) + } else { + tlvReader.getNull(AnonymousTag) + null + } + + decodedValue?.let { emit(SsidAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(SsidAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readGeneratedCommandListAttribute(): GeneratedCommandListAttribute { + val ATTRIBUTE_ID: UInt = 65528u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Generatedcommandlist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return GeneratedCommandListAttribute(decodedValue) + } + + suspend fun subscribeGeneratedCommandListAttribute( + minInterval: Int, + maxInterval: Int + ): Flow { + val ATTRIBUTE_ID: UInt = 65528u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()) + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + GeneratedCommandListAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Generatedcommandlist attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(GeneratedCommandListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(GeneratedCommandListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readAcceptedCommandListAttribute(): AcceptedCommandListAttribute { + val ATTRIBUTE_ID: UInt = 65529u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Acceptedcommandlist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return AcceptedCommandListAttribute(decodedValue) + } + + suspend fun subscribeAcceptedCommandListAttribute( + minInterval: Int, + maxInterval: Int + ): Flow { + val ATTRIBUTE_ID: UInt = 65529u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()) + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + AcceptedCommandListAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Acceptedcommandlist attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(AcceptedCommandListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(AcceptedCommandListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readEventListAttribute(): EventListAttribute { + val ATTRIBUTE_ID: UInt = 65530u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Eventlist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return EventListAttribute(decodedValue) + } + + suspend fun subscribeEventListAttribute( + minInterval: Int, + maxInterval: Int + ): Flow { + val ATTRIBUTE_ID: UInt = 65530u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()) + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + EventListAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Eventlist attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(EventListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(EventListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readAttributeListAttribute(): AttributeListAttribute { + val ATTRIBUTE_ID: UInt = 65531u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Attributelist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return AttributeListAttribute(decodedValue) + } + + suspend fun subscribeAttributeListAttribute( + minInterval: Int, + maxInterval: Int + ): Flow { + val ATTRIBUTE_ID: UInt = 65531u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()) + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + AttributeListAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Attributelist attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(AttributeListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(AttributeListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readFeatureMapAttribute(): UInt { + val ATTRIBUTE_ID: UInt = 65532u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Featuremap attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt = tlvReader.getUInt(AnonymousTag) + + return decodedValue + } + + suspend fun subscribeFeatureMapAttribute( + minInterval: Int, + maxInterval: Int + ): Flow { + val ATTRIBUTE_ID: UInt = 65532u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()) + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UIntSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Featuremap attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt = tlvReader.getUInt(AnonymousTag) + + emit(UIntSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(UIntSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readClusterRevisionAttribute(): UShort { + val ATTRIBUTE_ID: UInt = 65533u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Clusterrevision attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UShort = tlvReader.getUShort(AnonymousTag) + + return decodedValue + } + + suspend fun subscribeClusterRevisionAttribute( + minInterval: Int, + maxInterval: Int + ): Flow { + val ATTRIBUTE_ID: UInt = 65533u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()) + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UShortSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Clusterrevision attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UShort = tlvReader.getUShort(AnonymousTag) + + emit(UShortSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(UShortSubscriptionState.SubscriptionEstablished) + } + } + } + } + + companion object { + private val logger = Logger.getLogger(WiFiNetworkManagementCluster::class.java.name) + const val CLUSTER_ID: UInt = 1105u + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/files.gni b/src/controller/java/generated/java/matter/controller/cluster/files.gni index f62cee23bdd5b3..e58b346b307ab7 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/files.gni +++ b/src/controller/java/generated/java/matter/controller/cluster/files.gni @@ -341,5 +341,6 @@ matter_clusters_sources = [ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/ValveConfigurationAndControlCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/WakeOnLanCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/WiFiNetworkDiagnosticsCluster.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/WiFiNetworkManagementCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/WindowCoveringCluster.kt", ] \ No newline at end of file diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index 2400ba818c7cb9..ff10df38c79f9c 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -37156,6 +37156,170 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } + case app::Clusters::WiFiNetworkManagement::Id: { + using namespace app::Clusters::WiFiNetworkManagement; + switch (aPath.mAttributeId) + { + case Attributes::Ssid::Id: { + using TypeInfo = Attributes::Ssid::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + jbyteArray valueByteArray = env->NewByteArray(static_cast(cppValue.Value().size())); + env->SetByteArrayRegion(valueByteArray, 0, static_cast(cppValue.Value().size()), + reinterpret_cast(cppValue.Value().data())); + value = valueByteArray; + } + return value; + } + case Attributes::GeneratedCommandList::Id: { + using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AcceptedCommandList::Id: { + using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::EventList::Id: { + using TypeInfo = Attributes::EventList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AttributeList::Id: { + using TypeInfo = Attributes::AttributeList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::FeatureMap::Id: { + using TypeInfo = Attributes::FeatureMap::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + jlong jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::ClusterRevision::Id: { + using TypeInfo = Attributes::ClusterRevision::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + break; + } + break; + } case app::Clusters::WakeOnLan::Id: { using namespace app::Clusters::WakeOnLan; switch (aPath.mAttributeId) diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp index 370e510894c121..7f210566b9aa37 100644 --- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp @@ -7389,6 +7389,16 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } + case app::Clusters::WiFiNetworkManagement::Id: { + using namespace app::Clusters::WiFiNetworkManagement; + switch (aPath.mEventId) + { + default: + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + break; + } + break; + } case app::Clusters::WakeOnLan::Id: { using namespace app::Clusters::WakeOnLan; switch (aPath.mEventId) diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 3bc715829f27db..6acd5596b06d50 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -11535,6 +11535,62 @@ class ChipClusters: }, }, } + _WI_FI_NETWORK_MANAGEMENT_CLUSTER_INFO = { + "clusterName": "WiFiNetworkManagement", + "clusterId": 0x00000451, + "commands": { + 0x00000000: { + "commandId": 0x00000000, + "commandName": "NetworkPassphraseRequest", + "args": { + }, + }, + }, + "attributes": { + 0x00000001: { + "attributeName": "Ssid", + "attributeId": 0x00000001, + "type": "bytes", + "reportable": True, + }, + 0x0000FFF8: { + "attributeName": "GeneratedCommandList", + "attributeId": 0x0000FFF8, + "type": "int", + "reportable": True, + }, + 0x0000FFF9: { + "attributeName": "AcceptedCommandList", + "attributeId": 0x0000FFF9, + "type": "int", + "reportable": True, + }, + 0x0000FFFA: { + "attributeName": "EventList", + "attributeId": 0x0000FFFA, + "type": "int", + "reportable": True, + }, + 0x0000FFFB: { + "attributeName": "AttributeList", + "attributeId": 0x0000FFFB, + "type": "int", + "reportable": True, + }, + 0x0000FFFC: { + "attributeName": "FeatureMap", + "attributeId": 0x0000FFFC, + "type": "int", + "reportable": True, + }, + 0x0000FFFD: { + "attributeName": "ClusterRevision", + "attributeId": 0x0000FFFD, + "type": "int", + "reportable": True, + }, + }, + } _WAKE_ON_LAN_CLUSTER_INFO = { "clusterName": "WakeOnLan", "clusterId": 0x00000503, @@ -14638,6 +14694,7 @@ class ChipClusters: 0x0000042D: _PM10_CONCENTRATION_MEASUREMENT_CLUSTER_INFO, 0x0000042E: _TOTAL_VOLATILE_ORGANIC_COMPOUNDS_CONCENTRATION_MEASUREMENT_CLUSTER_INFO, 0x0000042F: _RADON_CONCENTRATION_MEASUREMENT_CLUSTER_INFO, + 0x00000451: _WI_FI_NETWORK_MANAGEMENT_CLUSTER_INFO, 0x00000503: _WAKE_ON_LAN_CLUSTER_INFO, 0x00000504: _CHANNEL_CLUSTER_INFO, 0x00000505: _TARGET_NAVIGATOR_CLUSTER_INFO, @@ -14759,6 +14816,7 @@ class ChipClusters: "Pm10ConcentrationMeasurement": _PM10_CONCENTRATION_MEASUREMENT_CLUSTER_INFO, "TotalVolatileOrganicCompoundsConcentrationMeasurement": _TOTAL_VOLATILE_ORGANIC_COMPOUNDS_CONCENTRATION_MEASUREMENT_CLUSTER_INFO, "RadonConcentrationMeasurement": _RADON_CONCENTRATION_MEASUREMENT_CLUSTER_INFO, + "WiFiNetworkManagement": _WI_FI_NETWORK_MANAGEMENT_CLUSTER_INFO, "WakeOnLan": _WAKE_ON_LAN_CLUSTER_INFO, "Channel": _CHANNEL_CLUSTER_INFO, "TargetNavigator": _TARGET_NAVIGATOR_CLUSTER_INFO, diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index cd411b93d43301..c2db68c0ecfd4c 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -40230,6 +40230,175 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: 'uint' = 0 +@dataclass +class WiFiNetworkManagement(Cluster): + id: typing.ClassVar[int] = 0x00000451 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="ssid", Tag=0x00000001, Type=typing.Union[Nullable, bytes]), + ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="featureMap", Tag=0x0000FFFC, Type=uint), + ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), + ]) + + ssid: 'typing.Union[Nullable, bytes]' = None + generatedCommandList: 'typing.List[uint]' = None + acceptedCommandList: 'typing.List[uint]' = None + eventList: 'typing.List[uint]' = None + attributeList: 'typing.List[uint]' = None + featureMap: 'uint' = None + clusterRevision: 'uint' = None + + class Commands: + @dataclass + class NetworkPassphraseRequest(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000451 + command_id: typing.ClassVar[int] = 0x00000000 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = 'NetworkPassphraseResponse' + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ]) + + @dataclass + class NetworkPassphraseResponse(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000451 + command_id: typing.ClassVar[int] = 0x00000001 + is_client: typing.ClassVar[bool] = False + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="passphrase", Tag=0, Type=bytes), + ]) + + passphrase: 'bytes' = b"" + + class Attributes: + @dataclass + class Ssid(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000451 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000001 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[Nullable, bytes]) + + value: 'typing.Union[Nullable, bytes]' = NullValue + + @dataclass + class GeneratedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000451 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFF8 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class AcceptedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000451 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFF9 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class EventList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000451 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFA + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class AttributeList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000451 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFB + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class FeatureMap(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000451 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFC + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass + class ClusterRevision(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000451 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFD + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass class WakeOnLan(Cluster): id: typing.ClassVar[int] = 0x00000503 diff --git a/src/darwin/Framework/CHIP/templates/availability.yaml b/src/darwin/Framework/CHIP/templates/availability.yaml index 5c5439003862b9..97199ad7bda19a 100644 --- a/src/darwin/Framework/CHIP/templates/availability.yaml +++ b/src/darwin/Framework/CHIP/templates/availability.yaml @@ -9687,3 +9687,7 @@ - release: "Future" versions: "future" + provisional: + clusters: + # Targeting Fall 2024 + - WiFiNetworkManagement diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm index cb98d807f3495d..a6ab1d6beee61c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm @@ -5288,6 +5288,36 @@ static BOOL AttributeIsSpecifiedInRadonConcentrationMeasurementCluster(Attribute } } } +static BOOL AttributeIsSpecifiedInWiFiNetworkManagementCluster(AttributeId aAttributeId) +{ + using namespace Clusters::WiFiNetworkManagement; + switch (aAttributeId) { + case Attributes::Ssid::Id: { + return YES; + } + case Attributes::GeneratedCommandList::Id: { + return YES; + } + case Attributes::AcceptedCommandList::Id: { + return YES; + } + case Attributes::EventList::Id: { + return YES; + } + case Attributes::AttributeList::Id: { + return YES; + } + case Attributes::FeatureMap::Id: { + return YES; + } + case Attributes::ClusterRevision::Id: { + return YES; + } + default: { + return NO; + } + } +} static BOOL AttributeIsSpecifiedInWakeOnLANCluster(AttributeId aAttributeId) { using namespace Clusters::WakeOnLan; @@ -6804,6 +6834,9 @@ BOOL MTRAttributeIsSpecified(ClusterId aClusterId, AttributeId aAttributeId) case Clusters::RadonConcentrationMeasurement::Id: { return AttributeIsSpecifiedInRadonConcentrationMeasurementCluster(aAttributeId); } + case Clusters::WiFiNetworkManagement::Id: { + return AttributeIsSpecifiedInWiFiNetworkManagementCluster(aAttributeId); + } case Clusters::WakeOnLan::Id: { return AttributeIsSpecifiedInWakeOnLANCluster(aAttributeId); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index bae1643f3beb39..f5b2ca3d7dd743 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -15219,6 +15219,33 @@ static id _Nullable DecodeAttributeValueForRadonConcentrationMeasurementCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } +static id _Nullable DecodeAttributeValueForWiFiNetworkManagementCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::WiFiNetworkManagement; + switch (aAttributeId) { + case Attributes::Ssid::Id: { + using TypeInfo = Attributes::Ssid::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSData * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = AsData(cppValue.Value()); + } + return value; + } + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} static id _Nullable DecodeAttributeValueForWakeOnLANCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { using namespace Clusters::WakeOnLan; @@ -19593,6 +19620,9 @@ id _Nullable MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::T case Clusters::RadonConcentrationMeasurement::Id: { return DecodeAttributeValueForRadonConcentrationMeasurementCluster(aPath.mAttributeId, aReader, aError); } + case Clusters::WiFiNetworkManagement::Id: { + return DecodeAttributeValueForWiFiNetworkManagementCluster(aPath.mAttributeId, aReader, aError); + } case Clusters::WakeOnLan::Id: { return DecodeAttributeValueForWakeOnLANCluster(aPath.mAttributeId, aReader, aError); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 3c7624201d0484..d5e7efa37f08bd 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -12989,6 +12989,82 @@ MTR_AVAILABLE(ios(17.6), macos(14.6), watchos(10.6), tvos(17.6)) @end +/** + * Cluster Wi-Fi Network Management + * + * Functionality to retrieve operational information about a managed Wi-Fi network. + */ +MTR_PROVISIONALLY_AVAILABLE +@interface MTRBaseClusterWiFiNetworkManagement : MTRGenericBaseCluster + +/** + * Command NetworkPassphraseRequest + * + * Request the current WPA-Personal passphrase or PSK associated with the managed Wi-Fi network. + */ +- (void)networkPassphraseRequestWithParams:(MTRWiFiNetworkManagementClusterNetworkPassphraseRequestParams * _Nullable)params completion:(void (^)(MTRWiFiNetworkManagementClusterNetworkPassphraseResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)networkPassphraseRequestWithCompletion:(void (^)(MTRWiFiNetworkManagementClusterNetworkPassphraseResponseParams * _Nullable data, NSError * _Nullable error))completion + MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeSSIDWithCompletion:(void (^)(NSData * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeSSIDWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSData * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeSSIDWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSData * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +@interface MTRBaseClusterWiFiNetworkManagement (Availability) + +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ +- (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue MTR_PROVISIONALLY_AVAILABLE; + +@end + /** * Cluster Wake on LAN * diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index b375488f292fc8..8155fed2e794f1 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -92894,6 +92894,291 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC @end +@implementation MTRBaseClusterWiFiNetworkManagement + +- (void)networkPassphraseRequestWithCompletion:(void (^)(MTRWiFiNetworkManagementClusterNetworkPassphraseResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + [self networkPassphraseRequestWithParams:nil completion:completion]; +} +- (void)networkPassphraseRequestWithParams:(MTRWiFiNetworkManagementClusterNetworkPassphraseRequestParams * _Nullable)params completion:(void (^)(MTRWiFiNetworkManagementClusterNetworkPassphraseResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + if (params == nil) { + params = [[MTRWiFiNetworkManagementClusterNetworkPassphraseRequestParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = WiFiNetworkManagement::Commands::NetworkPassphraseRequest::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRWiFiNetworkManagementClusterNetworkPassphraseResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)readAttributeSSIDWithCompletion:(void (^)(NSData * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WiFiNetworkManagement::Attributes::Ssid::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeSSIDWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSData * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = WiFiNetworkManagement::Attributes::Ssid::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeSSIDWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSData * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WiFiNetworkManagement::Attributes::Ssid::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WiFiNetworkManagement::Attributes::GeneratedCommandList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = WiFiNetworkManagement::Attributes::GeneratedCommandList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WiFiNetworkManagement::Attributes::GeneratedCommandList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WiFiNetworkManagement::Attributes::AcceptedCommandList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = WiFiNetworkManagement::Attributes::AcceptedCommandList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WiFiNetworkManagement::Attributes::AcceptedCommandList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WiFiNetworkManagement::Attributes::EventList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = WiFiNetworkManagement::Attributes::EventList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WiFiNetworkManagement::Attributes::EventList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WiFiNetworkManagement::Attributes::AttributeList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = WiFiNetworkManagement::Attributes::AttributeList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WiFiNetworkManagement::Attributes::AttributeList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WiFiNetworkManagement::Attributes::FeatureMap::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = WiFiNetworkManagement::Attributes::FeatureMap::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WiFiNetworkManagement::Attributes::FeatureMap::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WiFiNetworkManagement::Attributes::ClusterRevision::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = WiFiNetworkManagement::Attributes::ClusterRevision::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WiFiNetworkManagement::Attributes::ClusterRevision::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +@end + @implementation MTRBaseClusterWakeOnLAN - (void)readAttributeMACAddressWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index 5c3f6a080fdd7b..0627e1d7937536 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -184,6 +184,7 @@ typedef NS_ENUM(uint32_t, MTRClusterIDType) { MTRClusterIDTypePM10ConcentrationMeasurementID MTR_AVAILABLE(ios(17.6), macos(14.6), watchos(10.6), tvos(17.6)) = 0x0000042D, MTRClusterIDTypeTotalVolatileOrganicCompoundsConcentrationMeasurementID MTR_AVAILABLE(ios(17.6), macos(14.6), watchos(10.6), tvos(17.6)) = 0x0000042E, MTRClusterIDTypeRadonConcentrationMeasurementID MTR_AVAILABLE(ios(17.6), macos(14.6), watchos(10.6), tvos(17.6)) = 0x0000042F, + MTRClusterIDTypeWiFiNetworkManagementID MTR_PROVISIONALLY_AVAILABLE = 0x00000451, MTRClusterIDTypeWakeOnLANID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000503, MTRClusterIDTypeChannelID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000504, MTRClusterIDTypeTargetNavigatorID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000505, @@ -4361,6 +4362,15 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRAttributeIDTypeClusterRadonConcentrationMeasurementAttributeFeatureMapID MTR_AVAILABLE(ios(17.6), macos(14.6), watchos(10.6), tvos(17.6)) = MTRAttributeIDTypeGlobalAttributeFeatureMapID, MTRAttributeIDTypeClusterRadonConcentrationMeasurementAttributeClusterRevisionID MTR_AVAILABLE(ios(17.6), macos(14.6), watchos(10.6), tvos(17.6)) = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster WiFiNetworkManagement attributes + MTRAttributeIDTypeClusterWiFiNetworkManagementAttributeSSIDID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + MTRAttributeIDTypeClusterWiFiNetworkManagementAttributeGeneratedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, + MTRAttributeIDTypeClusterWiFiNetworkManagementAttributeAcceptedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, + MTRAttributeIDTypeClusterWiFiNetworkManagementAttributeEventListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeEventListID, + MTRAttributeIDTypeClusterWiFiNetworkManagementAttributeAttributeListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAttributeListID, + MTRAttributeIDTypeClusterWiFiNetworkManagementAttributeFeatureMapID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeFeatureMapID, + MTRAttributeIDTypeClusterWiFiNetworkManagementAttributeClusterRevisionID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster WakeOnLan deprecated attribute names MTRClusterWakeOnLanAttributeMACAddressID MTR_DEPRECATED("Please use MTRAttributeIDTypeClusterWakeOnLANAttributeMACAddressID", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)) @@ -6575,6 +6585,10 @@ typedef NS_ENUM(uint32_t, MTRCommandIDType) { MTRCommandIDTypeClusterColorControlCommandMoveColorTemperatureID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x0000004B, MTRCommandIDTypeClusterColorControlCommandStepColorTemperatureID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x0000004C, + // Cluster WiFiNetworkManagement commands + MTRCommandIDTypeClusterWiFiNetworkManagementCommandNetworkPassphraseRequestID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + MTRCommandIDTypeClusterWiFiNetworkManagementCommandNetworkPassphraseResponseID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + // Cluster Channel deprecated command id names MTRClusterChannelCommandChangeChannelID MTR_DEPRECATED("Please use MTRCommandIDTypeClusterChannelCommandChangeChannelID", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)) diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm index 474c5cacf47679..7b8402cabc2fda 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm @@ -318,6 +318,9 @@ case MTRClusterIDTypeRadonConcentrationMeasurementID: result = @"RadonConcentrationMeasurement"; break; + case MTRClusterIDTypeWiFiNetworkManagementID: + result = @"WiFiNetworkManagement"; + break; case MTRClusterIDTypeWakeOnLANID: result = @"WakeOnLAN"; break; @@ -7212,6 +7215,44 @@ break; } + case MTRClusterIDTypeWiFiNetworkManagementID: + + switch (attributeID) { + + // Cluster WiFiNetworkManagement attributes + case MTRAttributeIDTypeClusterWiFiNetworkManagementAttributeSSIDID: + result = @"SSID"; + break; + + case MTRAttributeIDTypeClusterWiFiNetworkManagementAttributeGeneratedCommandListID: + result = @"GeneratedCommandList"; + break; + + case MTRAttributeIDTypeClusterWiFiNetworkManagementAttributeAcceptedCommandListID: + result = @"AcceptedCommandList"; + break; + + case MTRAttributeIDTypeClusterWiFiNetworkManagementAttributeEventListID: + result = @"EventList"; + break; + + case MTRAttributeIDTypeClusterWiFiNetworkManagementAttributeAttributeListID: + result = @"AttributeList"; + break; + + case MTRAttributeIDTypeClusterWiFiNetworkManagementAttributeFeatureMapID: + result = @"FeatureMap"; + break; + + case MTRAttributeIDTypeClusterWiFiNetworkManagementAttributeClusterRevisionID: + result = @"ClusterRevision"; + break; + + default: + result = [NSString stringWithFormat:@"", attributeID]; + break; + } + case MTRClusterIDTypeWakeOnLANID: switch (attributeID) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index 6e4e0f80b44d00..34d469730f1c94 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -5993,6 +5993,48 @@ MTR_AVAILABLE(ios(17.6), macos(14.6), watchos(10.6), tvos(17.6)) @end +/** + * Cluster Wi-Fi Network Management + * Functionality to retrieve operational information about a managed Wi-Fi network. + */ +MTR_PROVISIONALLY_AVAILABLE +@interface MTRClusterWiFiNetworkManagement : MTRGenericCluster + +- (void)networkPassphraseRequestWithParams:(MTRWiFiNetworkManagementClusterNetworkPassphraseRequestParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRWiFiNetworkManagementClusterNetworkPassphraseResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)networkPassphraseRequestWithExpectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRWiFiNetworkManagementClusterNetworkPassphraseResponseParams * _Nullable data, NSError * _Nullable error))completion + MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeSSIDWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +@interface MTRClusterWiFiNetworkManagement (Availability) + +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ +- (instancetype _Nullable)initWithDevice:(MTRDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue MTR_PROVISIONALLY_AVAILABLE; + +@end + /** * Cluster Wake on LAN * This cluster provides an interface for managing low power mode on a device that supports the Wake On LAN protocol. diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index db279250cac8bf..2605a37007449c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -16768,6 +16768,76 @@ @implementation MTRClusterRadonConcentrationMeasurement @end +@implementation MTRClusterWiFiNetworkManagement + +- (void)networkPassphraseRequestWithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completion:(void (^)(MTRWiFiNetworkManagementClusterNetworkPassphraseResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + [self networkPassphraseRequestWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; +} +- (void)networkPassphraseRequestWithParams:(MTRWiFiNetworkManagementClusterNetworkPassphraseRequestParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRWiFiNetworkManagementClusterNetworkPassphraseResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + if (params == nil) { + params = [[MTRWiFiNetworkManagementClusterNetworkPassphraseRequestParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = WiFiNetworkManagement::Commands::NetworkPassphraseRequest::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRWiFiNetworkManagementClusterNetworkPassphraseResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} + +- (NSDictionary * _Nullable)readAttributeSSIDWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWiFiNetworkManagementID) attributeID:@(MTRAttributeIDTypeClusterWiFiNetworkManagementAttributeSSIDID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWiFiNetworkManagementID) attributeID:@(MTRAttributeIDTypeClusterWiFiNetworkManagementAttributeGeneratedCommandListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWiFiNetworkManagementID) attributeID:@(MTRAttributeIDTypeClusterWiFiNetworkManagementAttributeAcceptedCommandListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWiFiNetworkManagementID) attributeID:@(MTRAttributeIDTypeClusterWiFiNetworkManagementAttributeEventListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWiFiNetworkManagementID) attributeID:@(MTRAttributeIDTypeClusterWiFiNetworkManagementAttributeAttributeListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWiFiNetworkManagementID) attributeID:@(MTRAttributeIDTypeClusterWiFiNetworkManagementAttributeFeatureMapID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWiFiNetworkManagementID) attributeID:@(MTRAttributeIDTypeClusterWiFiNetworkManagementAttributeClusterRevisionID) params:params]; +} + +@end + @implementation MTRClusterWakeOnLAN - (NSDictionary * _Nullable)readAttributeMACAddressWithParams:(MTRReadParams * _Nullable)params diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h index 1d1552200b5b1c..cfd06dee343cc0 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h @@ -8512,6 +8512,53 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTRWiFiNetworkManagementClusterNetworkPassphraseRequestParams : NSObject +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRWiFiNetworkManagementClusterNetworkPassphraseResponseParams : NSObject + +@property (nonatomic, copy) NSData * _Nonnull passphrase MTR_PROVISIONALLY_AVAILABLE; + +/** + * Initialize an MTRWiFiNetworkManagementClusterNetworkPassphraseResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_PROVISIONALLY_AVAILABLE; +@end + MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRChannelClusterChangeChannelParams : NSObject diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index 3105c9a9d21f80..af9752c200df41 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -23968,6 +23968,158 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end +@implementation MTRWiFiNetworkManagementClusterNetworkPassphraseRequestParams +- (instancetype)init +{ + if (self = [super init]) { + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRWiFiNetworkManagementClusterNetworkPassphraseRequestParams alloc] init]; + + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +@end + +@implementation MTRWiFiNetworkManagementClusterNetworkPassphraseRequestParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::WiFiNetworkManagement::Commands::NetworkPassphraseRequest::Type encodableStruct; + ListFreer listFreer; + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRWiFiNetworkManagementClusterNetworkPassphraseResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _passphrase = [NSData data]; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRWiFiNetworkManagementClusterNetworkPassphraseResponseParams alloc] init]; + + other.passphrase = self.passphrase; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: passphrase:%@; >", NSStringFromClass([self class]), [_passphrase base64EncodedStringWithOptions:0]]; + return descriptionString; +} + +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::WiFiNetworkManagement::Commands::NetworkPassphraseResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRWiFiNetworkManagementClusterNetworkPassphraseResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::WiFiNetworkManagement::Commands::NetworkPassphraseResponse::DecodableType &)decodableStruct +{ + { + self.passphrase = AsData(decodableStruct.passphrase); + } + return CHIP_NO_ERROR; +} + +@end + @implementation MTRChannelClusterChangeChannelParams - (instancetype)init { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h index 2579d3bc49a9bd..2b629efdc5a24d 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h @@ -1570,6 +1570,18 @@ NS_ASSUME_NONNULL_BEGIN @end +@interface MTRWiFiNetworkManagementClusterNetworkPassphraseRequestParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRWiFiNetworkManagementClusterNetworkPassphraseResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::WiFiNetworkManagement::Commands::NetworkPassphraseResponse::DecodableType &)decodableStruct; + +@end + @interface MTRChannelClusterChangeChannelParams (InternalMethods) - (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm index 685ca8f4f035a9..0ea5a38336bb2a 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm @@ -956,6 +956,15 @@ static BOOL CommandNeedsTimedInvokeInRadonConcentrationMeasurementCluster(Attrib } } } +static BOOL CommandNeedsTimedInvokeInWiFiNetworkManagementCluster(AttributeId aAttributeId) +{ + using namespace Clusters::WiFiNetworkManagement; + switch (aAttributeId) { + default: { + return NO; + } + } +} static BOOL CommandNeedsTimedInvokeInWakeOnLANCluster(AttributeId aAttributeId) { using namespace Clusters::WakeOnLan; @@ -1419,6 +1428,9 @@ BOOL MTRCommandNeedsTimedInvoke(NSNumber * _Nonnull aClusterID, NSNumber * _Nonn case Clusters::RadonConcentrationMeasurement::Id: { return CommandNeedsTimedInvokeInRadonConcentrationMeasurementCluster(commandID); } + case Clusters::WiFiNetworkManagement::Id: { + return CommandNeedsTimedInvokeInWiFiNetworkManagementCluster(commandID); + } case Clusters::WakeOnLan::Id: { return CommandNeedsTimedInvokeInWakeOnLANCluster(commandID); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRDeviceTypeMetadata.mm b/src/darwin/Framework/CHIP/zap-generated/MTRDeviceTypeMetadata.mm index 46427cba7fab3b..06042f32f9f1d8 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRDeviceTypeMetadata.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRDeviceTypeMetadata.mm @@ -71,6 +71,7 @@ { 0x0000007A, DeviceTypeClass::Simple, "Matter Extractor Hood" }, { 0x0000007B, DeviceTypeClass::Simple, "Matter Oven" }, { 0x0000007C, DeviceTypeClass::Simple, "Matter Laundry Dryer" }, + { 0x00000090, DeviceTypeClass::Simple, "Matter Network Infrastructure Manager" }, { 0x00000100, DeviceTypeClass::Simple, "Matter On/Off Light" }, { 0x00000101, DeviceTypeClass::Simple, "Matter Dimmable Light" }, { 0x00000103, DeviceTypeClass::Simple, "Matter On/Off Light Switch" }, @@ -96,7 +97,6 @@ { 0x00000510, DeviceTypeClass::Utility, "Matter Electrical Sensor" }, { 0x00000840, DeviceTypeClass::Simple, "Matter Control Bridge" }, { 0x00000850, DeviceTypeClass::Simple, "Matter On/Off Sensor" }, - { 0xFFF10010, DeviceTypeClass::Simple, "Matter Network Infrastructure Manager" }, }; static_assert(ExtractVendorFromMEI(0xFFF10001) != 0, "Must have class defined for \"Matter Orphan Clusters\" if it's a standard device type"); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm index 3e36773ffebd99..9fc3cd16b8235a 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm @@ -4035,6 +4035,18 @@ static id _Nullable DecodeEventPayloadForRadonConcentrationMeasurementCluster(Ev *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; return nil; } +static id _Nullable DecodeEventPayloadForWiFiNetworkManagementCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::WiFiNetworkManagement; + switch (aEventId) { + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + return nil; +} static id _Nullable DecodeEventPayloadForWakeOnLANCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { using namespace Clusters::WakeOnLan; @@ -4836,6 +4848,9 @@ id _Nullable MTRDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVRead case Clusters::RadonConcentrationMeasurement::Id: { return DecodeEventPayloadForRadonConcentrationMeasurementCluster(aPath.mEventId, aReader, aError); } + case Clusters::WiFiNetworkManagement::Id: { + return DecodeEventPayloadForWiFiNetworkManagementCluster(aPath.mEventId, aReader, aError); + } case Clusters::WakeOnLan::Id: { return DecodeEventPayloadForWakeOnLANCluster(aPath.mEventId, aReader, aError); } diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp index 78c93070ca6d03..78448839fc5e93 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp @@ -34570,6 +34570,105 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu } // namespace Attributes } // namespace RadonConcentrationMeasurement +namespace WiFiNetworkManagement { +namespace Attributes { + +namespace FeatureMap { + +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::WiFiNetworkManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::WiFiNetworkManagement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE, + markDirty); +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::WiFiNetworkManagement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); +} + +} // namespace FeatureMap + +namespace ClusterRevision { + +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::WiFiNetworkManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::WiFiNetworkManagement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::WiFiNetworkManagement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace WiFiNetworkManagement + namespace WakeOnLan { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index e51fb1999e9ce8..d7c5c77d861bd0 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h @@ -5316,6 +5316,24 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu } // namespace Attributes } // namespace RadonConcentrationMeasurement +namespace WiFiNetworkManagement { +namespace Attributes { + +namespace FeatureMap { +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * value); // bitmap32 +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty); +} // namespace FeatureMap + +namespace ClusterRevision { +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value); // int16u +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace WiFiNetworkManagement + namespace WakeOnLan { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/callback.h b/zzz_generated/app-common/app-common/zap-generated/callback.h index 350190a22e5762..a3a86e3b222917 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -533,6 +533,11 @@ void emberAfTotalVolatileOrganicCompoundsConcentrationMeasurementClusterInitCall */ void emberAfRadonConcentrationMeasurementClusterInitCallback(chip::EndpointId endpoint); +/** + * @param endpoint Endpoint that is being initialized + */ +void emberAfWiFiNetworkManagementClusterInitCallback(chip::EndpointId endpoint); + /** * @param endpoint Endpoint that is being initialized */ @@ -4488,6 +4493,44 @@ chip::Protocols::InteractionModel::Status MatterRadonConcentrationMeasurementClu */ void emberAfRadonConcentrationMeasurementClusterServerTickCallback(chip::EndpointId endpoint); +// +// Wi-Fi Network Management Cluster +// + +/** + * @param endpoint Endpoint that is being initialized + */ +void emberAfWiFiNetworkManagementClusterServerInitCallback(chip::EndpointId endpoint); + +/** + * @param endpoint Endpoint that is being shutdown + */ +void MatterWiFiNetworkManagementClusterServerShutdownCallback(chip::EndpointId endpoint); + +/** + * @param endpoint Endpoint that is being initialized + */ +void emberAfWiFiNetworkManagementClusterClientInitCallback(chip::EndpointId endpoint); + +/** + * @param attributePath Concrete attribute path that changed + */ +void MatterWiFiNetworkManagementClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); + +/** + * @param attributePath Concrete attribute path to be changed + * @param attributeType Attribute type + * @param size Attribute size + * @param value Attribute value + */ +chip::Protocols::InteractionModel::Status MatterWiFiNetworkManagementClusterServerPreAttributeChangedCallback( + const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); + +/** + * @param endpoint Endpoint that is being served + */ +void emberAfWiFiNetworkManagementClusterServerTickCallback(chip::EndpointId endpoint); + // // Wake on LAN Cluster // diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h index 42a54b95ee944f..bad7df9b4b8fa8 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h @@ -4309,6 +4309,8 @@ enum class Feature : uint32_t }; } // namespace RadonConcentrationMeasurement +namespace WiFiNetworkManagement {} // namespace WiFiNetworkManagement + namespace WakeOnLan {} // namespace WakeOnLan namespace Channel { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp index 32b62631ed30fd..3e72137d33179a 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp @@ -22865,6 +22865,93 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events {} // namespace Events } // namespace RadonConcentrationMeasurement +namespace WiFiNetworkManagement { + +namespace Commands { +namespace NetworkPassphraseRequest { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + } +} +} // namespace NetworkPassphraseRequest. +namespace NetworkPassphraseResponse { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kPassphrase), passphrase); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kPassphrase)) + { + err = DataModel::Decode(reader, passphrase); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace NetworkPassphraseResponse. +} // namespace Commands + +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::Ssid::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, ssid); + case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, generatedCommandList); + case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, acceptedCommandList); + case Attributes::EventList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, eventList); + case Attributes::AttributeList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, attributeList); + case Attributes::FeatureMap::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, featureMap); + case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, clusterRevision); + default: + return CHIP_NO_ERROR; + } +} +} // namespace Attributes + +namespace Events {} // namespace Events + +} // namespace WiFiNetworkManagement namespace WakeOnLan { namespace Commands {} // namespace Commands @@ -30345,6 +30432,13 @@ bool CommandIsFabricScoped(ClusterId aCluster, CommandId aCommand) return false; } } + case Clusters::WiFiNetworkManagement::Id: { + switch (aCommand) + { + default: + return false; + } + } case Clusters::Channel::Id: { switch (aCommand) { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 89c36f3c6f147d..9dbcdfe8dcad68 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -34846,6 +34846,157 @@ struct TypeInfo }; } // namespace Attributes } // namespace RadonConcentrationMeasurement +namespace WiFiNetworkManagement { + +namespace Commands { +// Forward-declarations so we can reference these later. + +namespace NetworkPassphraseRequest { +struct Type; +struct DecodableType; +} // namespace NetworkPassphraseRequest + +namespace NetworkPassphraseResponse { +struct Type; +struct DecodableType; +} // namespace NetworkPassphraseResponse + +} // namespace Commands + +namespace Commands { +namespace NetworkPassphraseRequest { +enum class Fields : uint8_t +{ +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::NetworkPassphraseRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WiFiNetworkManagement::Id; } + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = Clusters::WiFiNetworkManagement::Commands::NetworkPassphraseResponse::DecodableType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::NetworkPassphraseRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WiFiNetworkManagement::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace NetworkPassphraseRequest +namespace NetworkPassphraseResponse { +enum class Fields : uint8_t +{ + kPassphrase = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::NetworkPassphraseResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WiFiNetworkManagement::Id; } + + chip::ByteSpan passphrase; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::NetworkPassphraseResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WiFiNetworkManagement::Id; } + + chip::ByteSpan passphrase; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace NetworkPassphraseResponse +} // namespace Commands + +namespace Attributes { + +namespace Ssid { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::WiFiNetworkManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::Ssid::Id; } + static constexpr bool MustUseTimedWrite() { return false; } + static constexpr size_t MaxLength() { return 32; } +}; +} // namespace Ssid +namespace GeneratedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::WiFiNetworkManagement::Id; } +}; +} // namespace GeneratedCommandList +namespace AcceptedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::WiFiNetworkManagement::Id; } +}; +} // namespace AcceptedCommandList +namespace EventList { +struct TypeInfo : public Clusters::Globals::Attributes::EventList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::WiFiNetworkManagement::Id; } +}; +} // namespace EventList +namespace AttributeList { +struct TypeInfo : public Clusters::Globals::Attributes::AttributeList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::WiFiNetworkManagement::Id; } +}; +} // namespace AttributeList +namespace FeatureMap { +struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::WiFiNetworkManagement::Id; } +}; +} // namespace FeatureMap +namespace ClusterRevision { +struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::WiFiNetworkManagement::Id; } +}; +} // namespace ClusterRevision + +struct TypeInfo +{ + struct DecodableType + { + static constexpr ClusterId GetClusterId() { return Clusters::WiFiNetworkManagement::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); + + Attributes::Ssid::TypeInfo::DecodableType ssid; + Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; + Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; + Attributes::EventList::TypeInfo::DecodableType eventList; + Attributes::AttributeList::TypeInfo::DecodableType attributeList; + Attributes::FeatureMap::TypeInfo::DecodableType featureMap = static_cast(0); + Attributes::ClusterRevision::TypeInfo::DecodableType clusterRevision = static_cast(0); + }; +}; +} // namespace Attributes +} // namespace WiFiNetworkManagement namespace WakeOnLan { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h index 8ff6313abe5940..b67160ef01706d 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h @@ -6583,6 +6583,40 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace Attributes } // namespace RadonConcentrationMeasurement +namespace WiFiNetworkManagement { +namespace Attributes { + +namespace Ssid { +static constexpr AttributeId Id = 0x00000001; +} // namespace Ssid + +namespace GeneratedCommandList { +static constexpr AttributeId Id = Globals::Attributes::GeneratedCommandList::Id; +} // namespace GeneratedCommandList + +namespace AcceptedCommandList { +static constexpr AttributeId Id = Globals::Attributes::AcceptedCommandList::Id; +} // namespace AcceptedCommandList + +namespace EventList { +static constexpr AttributeId Id = Globals::Attributes::EventList::Id; +} // namespace EventList + +namespace AttributeList { +static constexpr AttributeId Id = Globals::Attributes::AttributeList::Id; +} // namespace AttributeList + +namespace FeatureMap { +static constexpr AttributeId Id = Globals::Attributes::FeatureMap::Id; +} // namespace FeatureMap + +namespace ClusterRevision { +static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace WiFiNetworkManagement + namespace WakeOnLan { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h index f457887220abad..1f790f889726f2 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h @@ -325,6 +325,9 @@ static constexpr ClusterId Id = 0x0000042E; namespace RadonConcentrationMeasurement { static constexpr ClusterId Id = 0x0000042F; } // namespace RadonConcentrationMeasurement +namespace WiFiNetworkManagement { +static constexpr ClusterId Id = 0x00000451; +} // namespace WiFiNetworkManagement namespace WakeOnLan { static constexpr ClusterId Id = 0x00000503; } // namespace WakeOnLan diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h index da8b04c98c1963..d7ba0b240864fb 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h @@ -1381,6 +1381,20 @@ static constexpr CommandId Id = 0x0000004C; } // namespace Commands } // namespace ColorControl +namespace WiFiNetworkManagement { +namespace Commands { + +namespace NetworkPassphraseRequest { +static constexpr CommandId Id = 0x00000000; +} // namespace NetworkPassphraseRequest + +namespace NetworkPassphraseResponse { +static constexpr CommandId Id = 0x00000001; +} // namespace NetworkPassphraseResponse + +} // namespace Commands +} // namespace WiFiNetworkManagement + namespace Channel { namespace Commands { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 8a3081edc0dc1b..012407529d1369 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -135,6 +135,7 @@ | Pm10ConcentrationMeasurement | 0x042D | | TotalVolatileOrganicCompoundsConcentrationMeasurement | 0x042E | | RadonConcentrationMeasurement | 0x042F | +| WiFiNetworkManagement | 0x0451 | | WakeOnLan | 0x0503 | | Channel | 0x0504 | | TargetNavigator | 0x0505 | @@ -11017,6 +11018,61 @@ class ColorControlStepColorTemperature : public ClusterCommand | Events: | | \*----------------------------------------------------------------------------*/ +/*----------------------------------------------------------------------------*\ +| Cluster WiFiNetworkManagement | 0x0451 | +|------------------------------------------------------------------------------| +| Commands: | | +| * NetworkPassphraseRequest | 0x00 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * Ssid | 0x0001 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + +/* + * Command NetworkPassphraseRequest + */ +class WiFiNetworkManagementNetworkPassphraseRequest : public ClusterCommand +{ +public: + WiFiNetworkManagementNetworkPassphraseRequest(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("network-passphrase-request", credsIssuerConfig) + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WiFiNetworkManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WiFiNetworkManagement::Commands::NetworkPassphraseRequest::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WiFiNetworkManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WiFiNetworkManagement::Commands::NetworkPassphraseRequest::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::WiFiNetworkManagement::Commands::NetworkPassphraseRequest::Type mRequest; +}; + /*----------------------------------------------------------------------------*\ | Cluster WakeOnLan | 0x0503 | |------------------------------------------------------------------------------| @@ -24507,6 +24563,62 @@ void registerClusterRadonConcentrationMeasurement(Commands & commands, Credentia commands.RegisterCluster(clusterName, clusterCommands); } +void registerClusterWiFiNetworkManagement(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) +{ + using namespace chip::app::Clusters::WiFiNetworkManagement; + + const char * clusterName = "WiFiNetworkManagement"; + + commands_list clusterCommands = { + // + // Commands + // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // + // + // Attributes + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "ssid", Attributes::Ssid::Id, credsIssuerConfig), // + make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + make_unique>(Id, credsIssuerConfig), // + make_unique>>( + Id, "ssid", Attributes::Ssid::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>>( + Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "event-list", Attributes::EventList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "attribute-list", Attributes::AttributeList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "feature-map", 0, UINT32_MAX, Attributes::FeatureMap::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "cluster-revision", 0, UINT16_MAX, Attributes::ClusterRevision::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "ssid", Attributes::Ssid::Id, credsIssuerConfig), // + make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + // + // Events + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + }; + + commands.RegisterCluster(clusterName, clusterCommands); +} void registerClusterWakeOnLan(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) { using namespace chip::app::Clusters::WakeOnLan; @@ -26861,6 +26973,7 @@ void registerClusters(Commands & commands, CredentialIssuerCommands * credsIssue registerClusterPm10ConcentrationMeasurement(commands, credsIssuerConfig); registerClusterTotalVolatileOrganicCompoundsConcentrationMeasurement(commands, credsIssuerConfig); registerClusterRadonConcentrationMeasurement(commands, credsIssuerConfig); + registerClusterWiFiNetworkManagement(commands, credsIssuerConfig); registerClusterWakeOnLan(commands, credsIssuerConfig); registerClusterChannel(commands, credsIssuerConfig); registerClusterTargetNavigator(commands, credsIssuerConfig); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index fde5089bab8a7c..0d31e0f6074c81 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -7719,6 +7719,14 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; } +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const WiFiNetworkManagement::Commands::NetworkPassphraseResponse::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + ReturnErrorOnFailure(DataModelLogger::LogValue("passphrase", indent + 1, value.passphrase)); + DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; +} CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const Channel::Commands::ChangeChannelResponse::DecodableType & value) { @@ -16089,6 +16097,47 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } + case WiFiNetworkManagement::Id: { + switch (path.mAttributeId) + { + case WiFiNetworkManagement::Attributes::Ssid::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("SSID", 1, value); + } + case WiFiNetworkManagement::Attributes::GeneratedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + } + case WiFiNetworkManagement::Attributes::AcceptedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + } + case WiFiNetworkManagement::Attributes::EventList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("EventList", 1, value); + } + case WiFiNetworkManagement::Attributes::AttributeList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AttributeList", 1, value); + } + case WiFiNetworkManagement::Attributes::FeatureMap::Id: { + uint32_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("FeatureMap", 1, value); + } + case WiFiNetworkManagement::Attributes::ClusterRevision::Id: { + uint16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ClusterRevision", 1, value); + } + } + break; + } case WakeOnLan::Id: { switch (path.mAttributeId) { @@ -18438,6 +18487,17 @@ CHIP_ERROR DataModelLogger::LogCommand(const chip::app::ConcreteCommandPath & pa } break; } + case WiFiNetworkManagement::Id: { + switch (path.mCommandId) + { + case WiFiNetworkManagement::Commands::NetworkPassphraseResponse::Id: { + WiFiNetworkManagement::Commands::NetworkPassphraseResponse::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("NetworkPassphraseResponse", 1, value); + } + } + break; + } case Channel::Id: { switch (path.mCommandId) { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h index 1c790b5e002039..ca39e2ae069060 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h @@ -735,6 +735,9 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::Thermostat::Commands::GetWeeklyScheduleResponse::DecodableType & value); +static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::WiFiNetworkManagement::Commands::NetworkPassphraseResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::Channel::Commands::ChangeChannelResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index c3034217db9c05..59bdd11dcb1cb3 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -137,6 +137,7 @@ | Pm10ConcentrationMeasurement | 0x042D | | TotalVolatileOrganicCompoundsConcentrationMeasurement | 0x042E | | RadonConcentrationMeasurement | 0x042F | +| WiFiNetworkManagement | 0x0451 | | WakeOnLan | 0x0503 | | Channel | 0x0504 | | TargetNavigator | 0x0505 | @@ -143040,6 +143041,674 @@ class SubscribeAttributeRadonConcentrationMeasurementClusterRevision : public Su } }; +#if MTR_ENABLE_PROVISIONAL +/*----------------------------------------------------------------------------*\ +| Cluster WiFiNetworkManagement | 0x0451 | +|------------------------------------------------------------------------------| +| Commands: | | +| * NetworkPassphraseRequest | 0x00 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * Ssid | 0x0001 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + +#if MTR_ENABLE_PROVISIONAL +/* + * Command NetworkPassphraseRequest + */ +class WiFiNetworkManagementNetworkPassphraseRequest : public ClusterCommand { +public: + WiFiNetworkManagementNetworkPassphraseRequest() + : ClusterCommand("network-passphrase-request") + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WiFiNetworkManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WiFiNetworkManagement::Commands::NetworkPassphraseRequest::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterWiFiNetworkManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWiFiNetworkManagementClusterNetworkPassphraseRequestParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster networkPassphraseRequestWithParams:params completion: + ^(MTRWiFiNetworkManagementClusterNetworkPassphraseResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::WiFiNetworkManagement::Commands::NetworkPassphraseResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters::WiFiNetworkManagement::Commands::NetworkPassphraseResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: +}; + +#endif // MTR_ENABLE_PROVISIONAL + +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute Ssid + */ +class ReadWiFiNetworkManagementSsid : public ReadAttribute { +public: + ReadWiFiNetworkManagementSsid() + : ReadAttribute("ssid") + { + } + + ~ReadWiFiNetworkManagementSsid() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WiFiNetworkManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::WiFiNetworkManagement::Attributes::Ssid::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterWiFiNetworkManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeSSIDWithCompletion:^(NSData * _Nullable value, NSError * _Nullable error) { + NSLog(@"WiFiNetworkManagement.SSID response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("WiFiNetworkManagement SSID read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeWiFiNetworkManagementSsid : public SubscribeAttribute { +public: + SubscribeAttributeWiFiNetworkManagementSsid() + : SubscribeAttribute("ssid") + { + } + + ~SubscribeAttributeWiFiNetworkManagementSsid() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WiFiNetworkManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::WiFiNetworkManagement::Attributes::Ssid::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterWiFiNetworkManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeSSIDWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSData * _Nullable value, NSError * _Nullable error) { + NSLog(@"WiFiNetworkManagement.SSID response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute GeneratedCommandList + */ +class ReadWiFiNetworkManagementGeneratedCommandList : public ReadAttribute { +public: + ReadWiFiNetworkManagementGeneratedCommandList() + : ReadAttribute("generated-command-list") + { + } + + ~ReadWiFiNetworkManagementGeneratedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WiFiNetworkManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::WiFiNetworkManagement::Attributes::GeneratedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterWiFiNetworkManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"WiFiNetworkManagement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("WiFiNetworkManagement GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeWiFiNetworkManagementGeneratedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeWiFiNetworkManagementGeneratedCommandList() + : SubscribeAttribute("generated-command-list") + { + } + + ~SubscribeAttributeWiFiNetworkManagementGeneratedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WiFiNetworkManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::WiFiNetworkManagement::Attributes::GeneratedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterWiFiNetworkManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeGeneratedCommandListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"WiFiNetworkManagement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute AcceptedCommandList + */ +class ReadWiFiNetworkManagementAcceptedCommandList : public ReadAttribute { +public: + ReadWiFiNetworkManagementAcceptedCommandList() + : ReadAttribute("accepted-command-list") + { + } + + ~ReadWiFiNetworkManagementAcceptedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WiFiNetworkManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::WiFiNetworkManagement::Attributes::AcceptedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterWiFiNetworkManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"WiFiNetworkManagement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("WiFiNetworkManagement AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeWiFiNetworkManagementAcceptedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeWiFiNetworkManagementAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") + { + } + + ~SubscribeAttributeWiFiNetworkManagementAcceptedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WiFiNetworkManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::WiFiNetworkManagement::Attributes::AcceptedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterWiFiNetworkManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeAcceptedCommandListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"WiFiNetworkManagement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute EventList + */ +class ReadWiFiNetworkManagementEventList : public ReadAttribute { +public: + ReadWiFiNetworkManagementEventList() + : ReadAttribute("event-list") + { + } + + ~ReadWiFiNetworkManagementEventList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WiFiNetworkManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::WiFiNetworkManagement::Attributes::EventList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterWiFiNetworkManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"WiFiNetworkManagement.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("WiFiNetworkManagement EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeWiFiNetworkManagementEventList : public SubscribeAttribute { +public: + SubscribeAttributeWiFiNetworkManagementEventList() + : SubscribeAttribute("event-list") + { + } + + ~SubscribeAttributeWiFiNetworkManagementEventList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WiFiNetworkManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::WiFiNetworkManagement::Attributes::EventList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterWiFiNetworkManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeEventListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"WiFiNetworkManagement.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute AttributeList + */ +class ReadWiFiNetworkManagementAttributeList : public ReadAttribute { +public: + ReadWiFiNetworkManagementAttributeList() + : ReadAttribute("attribute-list") + { + } + + ~ReadWiFiNetworkManagementAttributeList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WiFiNetworkManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::WiFiNetworkManagement::Attributes::AttributeList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterWiFiNetworkManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"WiFiNetworkManagement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("WiFiNetworkManagement AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeWiFiNetworkManagementAttributeList : public SubscribeAttribute { +public: + SubscribeAttributeWiFiNetworkManagementAttributeList() + : SubscribeAttribute("attribute-list") + { + } + + ~SubscribeAttributeWiFiNetworkManagementAttributeList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WiFiNetworkManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::WiFiNetworkManagement::Attributes::AttributeList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterWiFiNetworkManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeAttributeListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"WiFiNetworkManagement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute FeatureMap + */ +class ReadWiFiNetworkManagementFeatureMap : public ReadAttribute { +public: + ReadWiFiNetworkManagementFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadWiFiNetworkManagementFeatureMap() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WiFiNetworkManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::WiFiNetworkManagement::Attributes::FeatureMap::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterWiFiNetworkManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"WiFiNetworkManagement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("WiFiNetworkManagement FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeWiFiNetworkManagementFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeWiFiNetworkManagementFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeWiFiNetworkManagementFeatureMap() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WiFiNetworkManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::WiFiNetworkManagement::Attributes::FeatureMap::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterWiFiNetworkManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeFeatureMapWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"WiFiNetworkManagement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute ClusterRevision + */ +class ReadWiFiNetworkManagementClusterRevision : public ReadAttribute { +public: + ReadWiFiNetworkManagementClusterRevision() + : ReadAttribute("cluster-revision") + { + } + + ~ReadWiFiNetworkManagementClusterRevision() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WiFiNetworkManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::WiFiNetworkManagement::Attributes::ClusterRevision::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterWiFiNetworkManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"WiFiNetworkManagement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("WiFiNetworkManagement ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeWiFiNetworkManagementClusterRevision : public SubscribeAttribute { +public: + SubscribeAttributeWiFiNetworkManagementClusterRevision() + : SubscribeAttribute("cluster-revision") + { + } + + ~SubscribeAttributeWiFiNetworkManagementClusterRevision() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WiFiNetworkManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::WiFiNetworkManagement::Attributes::ClusterRevision::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterWiFiNetworkManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeClusterRevisionWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"WiFiNetworkManagement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#endif // MTR_ENABLE_PROVISIONAL /*----------------------------------------------------------------------------*\ | Cluster WakeOnLan | 0x0503 | |------------------------------------------------------------------------------| @@ -187891,6 +188560,54 @@ void registerClusterRadonConcentrationMeasurement(Commands & commands) commands.RegisterCluster(clusterName, clusterCommands); } +void registerClusterWiFiNetworkManagement(Commands & commands) +{ +#if MTR_ENABLE_PROVISIONAL + using namespace chip::app::Clusters::WiFiNetworkManagement; + + const char * clusterName = "WiFiNetworkManagement"; + + commands_list clusterCommands = { + make_unique(Id), // +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL + make_unique(Id), // + make_unique(Id), // + make_unique(Id), // +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL + }; + + commands.RegisterCluster(clusterName, clusterCommands); +#endif // MTR_ENABLE_PROVISIONAL +} void registerClusterWakeOnLan(Commands & commands) { using namespace chip::app::Clusters::WakeOnLan; @@ -189301,6 +190018,7 @@ void registerClusters(Commands & commands) registerClusterPm10ConcentrationMeasurement(commands); registerClusterTotalVolatileOrganicCompoundsConcentrationMeasurement(commands); registerClusterRadonConcentrationMeasurement(commands); + registerClusterWiFiNetworkManagement(commands); registerClusterWakeOnLan(commands); registerClusterChannel(commands); registerClusterTargetNavigator(commands); From 8e5b1e15f5eb3433cc119d9e17e880b65240c19e Mon Sep 17 00:00:00 2001 From: Boris Date: Wed, 29 May 2024 20:02:07 +0800 Subject: [PATCH 16/43] fix build error "more than one files found with path 'META-INF/main.kotlin_module'" (#33648) --- examples/android/CHIPTool/app/build.gradle | 3 --- src/controller/java/BUILD.gn | 22 +++++++++++++++++++--- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/examples/android/CHIPTool/app/build.gradle b/examples/android/CHIPTool/app/build.gradle index 368930259ea66a..4502b7f7a18897 100644 --- a/examples/android/CHIPTool/app/build.gradle +++ b/examples/android/CHIPTool/app/build.gradle @@ -43,9 +43,6 @@ android { targetCompatibility JavaVersion.VERSION_1_8 } - packagingOptions { - exclude 'META-INF/main.kotlin_module' - } buildFeatures { viewBinding = true diff --git a/src/controller/java/BUILD.gn b/src/controller/java/BUILD.gn index e22c50cd023788..ec522e367c60f4 100644 --- a/src/controller/java/BUILD.gn +++ b/src/controller/java/BUILD.gn @@ -262,7 +262,11 @@ kotlin_library("tlv") { "src/matter/tlv/values.kt", ] - kotlinc_flags = [ "-Xlint:deprecation" ] + kotlinc_flags = [ + "-Xlint:deprecation", + "-module-name", + "com.matter.tlv", + ] } kotlin_library("tlv_reader_test") { @@ -323,7 +327,11 @@ kotlin_library("jsontlv") { "src/matter/jsontlv/types.kt", ] - kotlinc_flags = [ "-Xlint:deprecation" ] + kotlinc_flags = [ + "-Xlint:deprecation", + "-module-name", + "com.matter.matterjson", + ] } kotlin_library("json_to_tlv_to_json_test") { @@ -363,6 +371,10 @@ kotlin_library("onboarding_payload") { "src/matter/onboardingpayload/Verhoeff.kt", "src/matter/onboardingpayload/Verhoeff10.kt", ] + kotlinc_flags = [ + "-module-name", + "com.matter.onboarding", + ] } kotlin_library("onboardingpayload_manual_code_test") { @@ -404,7 +416,11 @@ kotlin_library("chipcluster") { sources = structs_sources sources += eventstructs_sources - kotlinc_flags = [ "-Xlint:deprecation" ] + kotlinc_flags = [ + "-Xlint:deprecation", + "-module-name", + "com.matter.chipcluster", + ] } kotlin_library("chipcluster_test") { From f3f3ba623c6a22914dc7d1daae5cfd6a4555d40f Mon Sep 17 00:00:00 2001 From: Arkadiusz Bokowy Date: Wed, 29 May 2024 14:06:12 +0200 Subject: [PATCH 17/43] Use progress log level for non-error messages (#33613) --- src/app/tests/suites/certification/Test_TC_CADMIN_1_5.yaml | 2 +- src/app/tests/suites/certification/Test_TC_CADMIN_1_7.yaml | 6 +++--- src/app/tests/suites/certification/Test_TC_CADMIN_1_8.yaml | 6 +++--- src/app/tests/suites/certification/Test_TC_CADMIN_1_9.yaml | 4 ++-- .../platform/internal/GenericPlatformManagerImpl.ipp | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/app/tests/suites/certification/Test_TC_CADMIN_1_5.yaml b/src/app/tests/suites/certification/Test_TC_CADMIN_1_5.yaml index 83c3617ab23343..8efb3b86885c5e 100644 --- a/src/app/tests/suites/certification/Test_TC_CADMIN_1_5.yaml +++ b/src/app/tests/suites/certification/Test_TC_CADMIN_1_5.yaml @@ -186,7 +186,7 @@ tests: [1663841939.843550][13897:13897] CHIP:DL: NVS set: chip-counters/total-operational-hours = 0 (0x0) [1663841939.843617][13897:13897] CHIP:DL: Inet Layer shutdown - [1663841939.843673][13897:13897] CHIP:DL: BLE shutdown + [1663841939.843673][13897:13897] CHIP:DL: BLE Layer shutdown [1663841939.843727][13897:13897] CHIP:DL: System Layer shutdown [1663841939.844009][13897:13897] CHIP:TOO: Run command failure: ../../examples/chip-tool/commands/pairing/PairingCommand.cpp:151: CHIP Error 0x00000003: Incorrect state cluster: "LogCommands" diff --git a/src/app/tests/suites/certification/Test_TC_CADMIN_1_7.yaml b/src/app/tests/suites/certification/Test_TC_CADMIN_1_7.yaml index b7518730e87f65..f684e6090415ca 100644 --- a/src/app/tests/suites/certification/Test_TC_CADMIN_1_7.yaml +++ b/src/app/tests/suites/certification/Test_TC_CADMIN_1_7.yaml @@ -102,7 +102,7 @@ tests: [1663841939.843550][13897:13897] CHIP:DL: NVS set: chip-counters/total-operational-hours = 0 (0x0) [1663841939.843617][13897:13897] CHIP:DL: Inet Layer shutdown - [1663841939.843673][13897:13897] CHIP:DL: BLE shutdown + [1663841939.843673][13897:13897] CHIP:DL: BLE Layer shutdown [1663841939.843727][13897:13897] CHIP:DL: System Layer shutdown [1663841939.844009][13897:13897] CHIP:TOO: Run command failure: ../../examples/chip-tool/commands/pairing/PairingCommand.cpp:151: CHIP Error 0x00000003: Incorrect state disabled: true @@ -161,7 +161,7 @@ tests: [1665481996.786704][4913:4913] CHIP:DL: renamed tmp file to file (/tmp/chip_counters.ini) [1665481996.786930][4913:4913] CHIP:DL: NVS set: chip-counters/total-operational-hours = 0 (0x0) [1665481996.786999][4913:4913] CHIP:DL: Inet Layer shutdown - [1665481996.787065][4913:4913] CHIP:DL: BLE shutdown + [1665481996.787065][4913:4913] CHIP:DL: BLE Layer shutdown [1665481996.787123][4913:4913] CHIP:DL: System Layer shutdown [1665481996.787363][4913:4913] CHIP:TOO: Run command failure: ../../commands/pairing/PairingCommand.cpp:164: CHIP Error 0x00000003: Incorrect state disabled: true @@ -284,7 +284,7 @@ tests: [1678796869.645576][648903:648903] CHIP:DL: NVS set: chip-counters/total-operational-hours = 0 (0x0) [1678796869.645584][648903:648903] CHIP:DL: Inet Layer shutdown - [1678796869.645589][648903:648903] CHIP:DL: BLE shutdown + [1678796869.645589][648903:648903] CHIP:DL: BLE Layer shutdown [1678796869.645596][648903:648903] CHIP:DL: System Layer shutdown [1678796869.645693][648903:648903] CHIP:TOO: Run command failure: ../../commands/pairing/PairingCommand.cpp:215: CHIP Error 0x00000003: Incorrect state disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_CADMIN_1_8.yaml b/src/app/tests/suites/certification/Test_TC_CADMIN_1_8.yaml index 4f26a7153f362a..f0a45e9bd04248 100644 --- a/src/app/tests/suites/certification/Test_TC_CADMIN_1_8.yaml +++ b/src/app/tests/suites/certification/Test_TC_CADMIN_1_8.yaml @@ -100,7 +100,7 @@ tests: [1663842366.887733][13938:13938] CHIP:DL: NVS set: chip-counters/total-operational-hours = 0 (0x0) [1663842366.887797][13938:13938] CHIP:DL: Inet Layer shutdown - [1663842366.887851][13938:13938] CHIP:DL: BLE shutdown + [1663842366.887851][13938:13938] CHIP:DL: BLE Layer shutdown [1663842366.887905][13938:13938] CHIP:DL: System Layer shutdown [1663842366.888154][13938:13938] CHIP:TOO: Run command failure: ../../examples/chip-tool/commands/common/CHIPCommand.cpp:454: CHIP Error 0x00000032: Timeout disabled: true @@ -154,7 +154,7 @@ tests: verify you got the following message in the TH_CR2(CHIP-TOOL) log [1700552012.724377][27528:27528] CHIP:DL: Inet Layer shutdown - [1700552012.724405][27528:27528] CHIP:DL: BLE shutdown + [1700552012.724405][27528:27528] CHIP:DL: BLE Layer shutdown [1700552012.724445][27528:27528] CHIP:DL: System Layer shutdown [1700552012.725294][27528:27528] CHIP:TOO: Run command failure: ../../examples/chip-tool/commands/common/CHIPCommand.cpp:589: CHIP Error 0x00000032: Timeout disabled: true @@ -276,7 +276,7 @@ tests: Verify you got the following message in the TH_CR3(Chip-tool) log [1700552012.724377][27528:27528] CHIP:DL: Inet Layer shutdown - [1700552012.724405][27528:27528] CHIP:DL: BLE shutdown + [1700552012.724405][27528:27528] CHIP:DL: BLE Layer shutdown [1700552012.724445][27528:27528] CHIP:DL: System Layer shutdown [1700552012.725294][27528:27528] CHIP:TOO: Run command failure: ../../examples/chip-tool/commands/common/CHIPCommand.cpp:589: CHIP Error 0x00000032: Timeout disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_CADMIN_1_9.yaml b/src/app/tests/suites/certification/Test_TC_CADMIN_1_9.yaml index a3d2de3641699e..5ee85f98a48a72 100644 --- a/src/app/tests/suites/certification/Test_TC_CADMIN_1_9.yaml +++ b/src/app/tests/suites/certification/Test_TC_CADMIN_1_9.yaml @@ -551,7 +551,7 @@ tests: [1665484807.015876][5399:5399] CHIP:DL: renamed tmp file to file (/tmp/chip_counters.ini) [1665484807.016042][5399:5399] CHIP:DL: NVS set: chip-counters/total-operational-hours = 0 (0x0) [1665484807.016108][5399:5399] CHIP:DL: Inet Layer shutdown - [1665484807.016163][5399:5399] CHIP:DL: BLE shutdown + [1665484807.016163][5399:5399] CHIP:DL: BLE Layer shutdown [1665484807.016215][5399:5399] CHIP:DL: System Layer shutdown [1665484807.016460][5399:5399] CHIP:TOO: Run command failure: ../../commands/pairing/PairingCommand.cpp:164: CHIP Error 0x00000003: Incorrect state cluster: "LogCommands" @@ -589,7 +589,7 @@ tests: [1665484807.015876][5399:5399] CHIP:DL: renamed tmp file to file (/tmp/chip_counters.ini) [1665484807.016042][5399:5399] CHIP:DL: NVS set: chip-counters/total-operational-hours = 0 (0x0) [1665484807.016108][5399:5399] CHIP:DL: Inet Layer shutdown - [1665484807.016163][5399:5399] CHIP:DL: BLE shutdown + [1665484807.016163][5399:5399] CHIP:DL: BLE Layer shutdown [1665484807.016215][5399:5399] CHIP:DL: System Layer shutdown [1665484807.016460][5399:5399] CHIP:TOO: Run command failure: ../../commands/pairing/PairingCommand.cpp:164: CHIP Error 0x00000003: Incorrect state cluster: "LogCommands" diff --git a/src/include/platform/internal/GenericPlatformManagerImpl.ipp b/src/include/platform/internal/GenericPlatformManagerImpl.ipp index 64878f5928cd9b..589dd4ccbe4584 100644 --- a/src/include/platform/internal/GenericPlatformManagerImpl.ipp +++ b/src/include/platform/internal/GenericPlatformManagerImpl.ipp @@ -139,7 +139,7 @@ exit: template void GenericPlatformManagerImpl::_Shutdown() { - ChipLogError(DeviceLayer, "Inet Layer shutdown"); + ChipLogProgress(DeviceLayer, "Inet Layer shutdown"); UDPEndPointManager()->Shutdown(); #if INET_CONFIG_ENABLE_TCP_ENDPOINT @@ -147,11 +147,11 @@ void GenericPlatformManagerImpl::_Shutdown() #endif #if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE - ChipLogError(DeviceLayer, "BLE shutdown"); + ChipLogProgress(DeviceLayer, "BLE Layer shutdown"); BLEMgr().Shutdown(); #endif - ChipLogError(DeviceLayer, "System Layer shutdown"); + ChipLogProgress(DeviceLayer, "System Layer shutdown"); SystemLayer().Shutdown(); } From 194d91876a4ddd367619f02bdf763c45afaa4bcc Mon Sep 17 00:00:00 2001 From: Rob Bultman Date: Wed, 29 May 2024 08:54:58 -0400 Subject: [PATCH 18/43] Removed provisional from MWO mode and control clusters (#33548) * Removed provisional from MWO * Commit after regen * Commit after regen * Make some attributes provisional --- .../all-clusters-common/all-clusters-app.matter | 2 +- .../microwave-oven-common/microwave-oven-app.matter | 4 ++-- .../zcl/data-model/chip/microwave-oven-control-cluster.xml | 6 +++--- .../zcl/data-model/chip/microwave-oven-mode-cluster.xml | 2 +- src/controller/data_model/controller-clusters.matter | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 719293ab5f877a..804d1eae5fbd32 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -3334,7 +3334,7 @@ cluster DishwasherAlarm = 93 { } /** Attributes and commands for selecting a mode from a list of supported options. */ -provisional cluster MicrowaveOvenMode = 94 { +cluster MicrowaveOvenMode = 94 { revision 1; enum ModeTag : enum16 { diff --git a/examples/microwave-oven-app/microwave-oven-common/microwave-oven-app.matter b/examples/microwave-oven-app/microwave-oven-common/microwave-oven-app.matter index 40b3087bb836e3..bc4a43383fa2a9 100644 --- a/examples/microwave-oven-app/microwave-oven-common/microwave-oven-app.matter +++ b/examples/microwave-oven-app/microwave-oven-common/microwave-oven-app.matter @@ -1012,7 +1012,7 @@ cluster GroupKeyManagement = 63 { } /** Attributes and commands for selecting a mode from a list of supported options. */ -provisional cluster MicrowaveOvenMode = 94 { +cluster MicrowaveOvenMode = 94 { revision 1; enum ModeTag : enum16 { @@ -1046,7 +1046,7 @@ provisional cluster MicrowaveOvenMode = 94 { } /** Attributes and commands for configuring the microwave oven control, and reporting cooking stats. */ -provisional cluster MicrowaveOvenControl = 95 { +cluster MicrowaveOvenControl = 95 { revision 1; // NOTE: Default/not specifically set bitmap Feature : bitmap32 { diff --git a/src/app/zap-templates/zcl/data-model/chip/microwave-oven-control-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/microwave-oven-control-cluster.xml index 5567bc99461893..954bd898b6aa00 100644 --- a/src/app/zap-templates/zcl/data-model/chip/microwave-oven-control-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/microwave-oven-control-cluster.xml @@ -18,7 +18,7 @@ limitations under the License. - + Microwave Oven Control Appliances Attributes and commands for configuring the microwave oven control, and reporting cooking stats. @@ -47,8 +47,8 @@ limitations under the License. MinPower MaxPower PowerStep - SupportedWatts - SelectedWattIndex + SupportedWatts + SelectedWattIndex WattRating diff --git a/src/app/zap-templates/zcl/data-model/chip/microwave-oven-mode-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/microwave-oven-mode-cluster.xml index b26f022f3cc9b4..3e4e9cfe84d86c 100644 --- a/src/app/zap-templates/zcl/data-model/chip/microwave-oven-mode-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/microwave-oven-mode-cluster.xml @@ -23,7 +23,7 @@ limitations under the License. - + General Microwave Oven Mode 0x005E diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index bc59cbe055e139..e18d1cbe4a0193 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -3526,7 +3526,7 @@ cluster DishwasherAlarm = 93 { } /** Attributes and commands for selecting a mode from a list of supported options. */ -provisional cluster MicrowaveOvenMode = 94 { +cluster MicrowaveOvenMode = 94 { revision 1; enum ModeTag : enum16 { @@ -3560,7 +3560,7 @@ provisional cluster MicrowaveOvenMode = 94 { } /** Attributes and commands for configuring the microwave oven control, and reporting cooking stats. */ -provisional cluster MicrowaveOvenControl = 95 { +cluster MicrowaveOvenControl = 95 { revision 1; // NOTE: Default/not specifically set bitmap Feature : bitmap32 { From 6d51857f9f6f85643e01dc93f076cb7b153fb19c Mon Sep 17 00:00:00 2001 From: lpbeliveau-silabs <112982107+lpbeliveau-silabs@users.noreply.github.com> Date: Wed, 29 May 2024 09:30:52 -0400 Subject: [PATCH 19/43] ifdefing scenes table and server to allow building without the scenes cluster (#33641) --- examples/lighting-app/silabs/src/AppTask.cpp | 1 - .../color-control-server/color-control-server.cpp | 7 ++++--- .../clusters/color-control-server/color-control-server.h | 9 ++++++++- src/app/clusters/level-control/level-control.cpp | 6 ++++-- src/app/clusters/level-control/level-control.h | 7 ++++++- src/app/clusters/on-off-server/on-off-server.cpp | 9 ++++++--- src/app/clusters/on-off-server/on-off-server.h | 9 ++++++++- 7 files changed, 36 insertions(+), 12 deletions(-) diff --git a/examples/lighting-app/silabs/src/AppTask.cpp b/examples/lighting-app/silabs/src/AppTask.cpp index 338d6d85e2ef51..4f74ca7f348e78 100644 --- a/examples/lighting-app/silabs/src/AppTask.cpp +++ b/examples/lighting-app/silabs/src/AppTask.cpp @@ -24,7 +24,6 @@ #include "LEDWidget.h" #include -#include #include #include #include diff --git a/src/app/clusters/color-control-server/color-control-server.cpp b/src/app/clusters/color-control-server/color-control-server.cpp index 508f4b691bb0d1..784bca88b85955 100644 --- a/src/app/clusters/color-control-server/color-control-server.cpp +++ b/src/app/clusters/color-control-server/color-control-server.cpp @@ -431,15 +431,16 @@ ColorControlServer & ColorControlServer::Instance() return instance; } +#ifdef MATTER_DM_PLUGIN_SCENES_MANAGEMENT chip::scenes::SceneHandler * ColorControlServer::GetSceneHandler() { - -#if defined(MATTER_DM_PLUGIN_SCENES_MANAGEMENT) && CHIP_CONFIG_SCENES_USE_DEFAULT_HANDLERS +#if CHIP_CONFIG_SCENES_USE_DEFAULT_HANDLERS return &sColorControlSceneHandler; #else return nullptr; -#endif // defined(MATTER_DM_PLUGIN_SCENES_MANAGEMENT) && CHIP_CONFIG_SCENES_USE_DEFAULT_HANDLERS +#endif // CHIP_CONFIG_SCENES_USE_DEFAULT_HANDLERS } +#endif // ifdef MATTER_DM_PLUGIN_SCENES_MANAGEMENT bool ColorControlServer::HasFeature(chip::EndpointId endpoint, Feature feature) { diff --git a/src/app/clusters/color-control-server/color-control-server.h b/src/app/clusters/color-control-server/color-control-server.h index 72dabb5600ff33..f453c6f02872e4 100644 --- a/src/app/clusters/color-control-server/color-control-server.h +++ b/src/app/clusters/color-control-server/color-control-server.h @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -28,6 +27,10 @@ #include #include +#ifdef MATTER_DM_PLUGIN_SCENES_MANAGEMENT +#include +#endif + /********************************************************** * Defines and Macros *********************************************************/ @@ -134,7 +137,9 @@ class ColorControlServer *********************************************************/ static ColorControlServer & Instance(); +#ifdef MATTER_DM_PLUGIN_SCENES_MANAGEMENT chip::scenes::SceneHandler * GetSceneHandler(); +#endif bool HasFeature(chip::EndpointId endpoint, Feature feature); chip::Protocols::InteractionModel::Status stopAllColorTransitions(chip::EndpointId endpoint); @@ -272,7 +277,9 @@ class ColorControlServer EmberEventControl eventControls[kColorControlClusterServerMaxEndpointCount]; +#ifdef MATTER_DM_PLUGIN_SCENES_MANAGEMENT friend class DefaultColorControlSceneHandler; +#endif }; /********************************************************** diff --git a/src/app/clusters/level-control/level-control.cpp b/src/app/clusters/level-control/level-control.cpp index b93bf50927c5eb..2ee9f2cfa54c04 100644 --- a/src/app/clusters/level-control/level-control.cpp +++ b/src/app/clusters/level-control/level-control.cpp @@ -608,14 +608,16 @@ Status MoveToLevel(EndpointId endpointId, const Commands::MoveToLevel::Decodable INVALID_STORED_LEVEL); // Don't revert to the stored level } +#ifdef MATTER_DM_PLUGIN_SCENES_MANAGEMENT chip::scenes::SceneHandler * GetSceneHandler() { -#if defined(MATTER_DM_PLUGIN_SCENES_MANAGEMENT) && CHIP_CONFIG_SCENES_USE_DEFAULT_HANDLERS +#if CHIP_CONFIG_SCENES_USE_DEFAULT_HANDLERS return &sLevelControlSceneHandler; #else return nullptr; -#endif // defined(MATTER_DM_PLUGIN_SCENES_MANAGEMENT) && CHIP_CONFIG_SCENES_USE_DEFAULT_HANDLERS +#endif // CHIP_CONFIG_SCENES_USE_DEFAULT_HANDLERS } +#endif // ifdef MATTER_DM_PLUGIN_SCENES_MANAGEMENT } // namespace LevelControlServer diff --git a/src/app/clusters/level-control/level-control.h b/src/app/clusters/level-control/level-control.h index 95497cc117e6d2..0240c921acd8b4 100644 --- a/src/app/clusters/level-control/level-control.h +++ b/src/app/clusters/level-control/level-control.h @@ -28,9 +28,12 @@ #include #include -#include #include +#ifdef MATTER_DM_PLUGIN_SCENES_MANAGEMENT +#include +#endif + /** @brief Level Control Cluster Server Post Init * * Following resolution of the Level Control state at startup for this endpoint, perform any @@ -53,6 +56,8 @@ chip::Protocols::InteractionModel::Status MoveToLevel(chip::EndpointId endpointId, const chip::app::Clusters::LevelControl::Commands::MoveToLevel::DecodableType & commandData); +#ifdef MATTER_DM_PLUGIN_SCENES_MANAGEMENT chip::scenes::SceneHandler * GetSceneHandler(); +#endif } // namespace LevelControlServer diff --git a/src/app/clusters/on-off-server/on-off-server.cpp b/src/app/clusters/on-off-server/on-off-server.cpp index bc71044ae44075..aadac6c6e2e630 100644 --- a/src/app/clusters/on-off-server/on-off-server.cpp +++ b/src/app/clusters/on-off-server/on-off-server.cpp @@ -15,6 +15,8 @@ * limitations under the License. */ +#include + #include "on-off-server.h" #include @@ -299,15 +301,16 @@ OnOffServer & OnOffServer::Instance() return instance; } +#ifdef MATTER_DM_PLUGIN_SCENES_MANAGEMENT chip::scenes::SceneHandler * OnOffServer::GetSceneHandler() { - -#if defined(MATTER_DM_PLUGIN_SCENES_MANAGEMENT) && CHIP_CONFIG_SCENES_USE_DEFAULT_HANDLERS +#if CHIP_CONFIG_SCENES_USE_DEFAULT_HANDLERS return &sOnOffSceneHandler; #else return nullptr; -#endif // defined(MATTER_DM_PLUGIN_SCENES_MANAGEMENT) && CHIP_CONFIG_SCENES_USE_DEFAULT_HANDLERS +#endif // CHIP_CONFIG_SCENES_USE_DEFAULT_HANDLERS } +#endif // ifdef MATTER_DM_PLUGIN_SCENES_MANAGEMENT bool OnOffServer::HasFeature(chip::EndpointId endpoint, Feature feature) { diff --git a/src/app/clusters/on-off-server/on-off-server.h b/src/app/clusters/on-off-server/on-off-server.h index 2cb5b62958a6c7..9bf8a5d4b03208 100644 --- a/src/app/clusters/on-off-server/on-off-server.h +++ b/src/app/clusters/on-off-server/on-off-server.h @@ -20,12 +20,15 @@ #include #include #include -#include #include #include #include #include +#ifdef MATTER_DM_PLUGIN_SCENES_MANAGEMENT +#include +#endif + /********************************************************** * Defines and Macros *********************************************************/ @@ -50,7 +53,9 @@ class OnOffServer static OnOffServer & Instance(); +#ifdef MATTER_DM_PLUGIN_SCENES_MANAGEMENT chip::scenes::SceneHandler * GetSceneHandler(); +#endif bool offCommand(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath); bool onCommand(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath); @@ -97,7 +102,9 @@ class OnOffServer static OnOffServer instance; chip::System::Clock::Timestamp nextDesiredOnWithTimedOffTimestamp; +#ifdef MATTER_DM_PLUGIN_SCENES_MANAGEMENT friend class DefaultOnOffSceneHandler; +#endif }; struct OnOffEffect From fd280252ee498d4bdb06f6353e9552a74d2fd1e3 Mon Sep 17 00:00:00 2001 From: lpbeliveau-silabs <112982107+lpbeliveau-silabs@users.noreply.github.com> Date: Wed, 29 May 2024 10:02:16 -0400 Subject: [PATCH 20/43] re-enable icd in lock-app (#33634) --- examples/lock-app/silabs/openthread.gni | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/lock-app/silabs/openthread.gni b/examples/lock-app/silabs/openthread.gni index 970d3a05c3aefc..3423049a9a8f79 100644 --- a/examples/lock-app/silabs/openthread.gni +++ b/examples/lock-app/silabs/openthread.gni @@ -28,7 +28,7 @@ openthread_external_platform = sl_enable_test_event_trigger = true # ICD Default configurations -chip_enable_icd_server = false +chip_enable_icd_server = true chip_subscription_timeout_resumption = false sl_use_subscription_syncing = true From 20b145798df30cf340073561a49b944050e12a57 Mon Sep 17 00:00:00 2001 From: Karsten Sperling <113487422+ksperling-apple@users.noreply.github.com> Date: Thu, 30 May 2024 03:52:11 +1200 Subject: [PATCH 21/43] Linux: Don't fail if glib is missing if we don't need it (#33647) This adds support for an `optional` property to the `pkg_config` template. --- build/chip/linux/BUILD.gn | 3 +- build/config/linux/pkg-config.py | 11 ++++-- build/config/linux/pkg_config.gni | 56 ++++++++++++++++++------------- 3 files changed, 43 insertions(+), 27 deletions(-) diff --git a/build/chip/linux/BUILD.gn b/build/chip/linux/BUILD.gn index c86f803a70f3d3..a530d5a611a25e 100644 --- a/build/chip/linux/BUILD.gn +++ b/build/chip/linux/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2020 Project CHIP Authors +# Copyright (c) 2020-2024 Project CHIP Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,4 +21,5 @@ pkg_config("glib") { "glib-2.0", "gio-unix-2.0", ] + optional = true # Only certain conditionally-compiled modules depend on glib } diff --git a/build/config/linux/pkg-config.py b/build/config/linux/pkg-config.py index 4d6e773a00d666..f44667242de807 100755 --- a/build/config/linux/pkg-config.py +++ b/build/config/linux/pkg-config.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # Copyright (c) 2013 The Chromium Authors. All rights reserved. -# Copyright (c) 2020 Project CHIP Authors +# Copyright (c) 2020-2024 Project CHIP Authors # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -127,6 +127,7 @@ def RewritePath(path, strip_prefix, sysroot): def main(): parser = OptionParser() parser.add_option('-d', '--debug', action='store_true') + parser.add_option('-o', '--optional', action='store_true') parser.add_option('-p', action='store', dest='pkg_config', type='string', default='pkg-config') parser.add_option('-v', action='append', dest='strip_out', type='string') @@ -209,6 +210,10 @@ def main(): try: flag_string = subprocess.check_output(cmd).decode('utf-8') except Exception: + if options.optional: + sys.stderr.write('Ignoring failure to run pkg-config for optional library.\n') + print(json.dumps([False])) # Output a GN array indicating missing optional packages + return 0 sys.stderr.write('Could not run pkg-config.\n') return 1 @@ -248,10 +253,10 @@ def main(): else: cflags.append(flag) - # Output a GN array, the first one is the cflags, the second are the libs. The + # Output a GN array, indicating success and our output lists. # JSON formatter prints GN compatible lists when everything is a list of # strings. - print(json.dumps([includes, cflags, libs, lib_dirs])) + print(json.dumps([True, includes, cflags, libs, lib_dirs])) return 0 diff --git a/build/config/linux/pkg_config.gni b/build/config/linux/pkg_config.gni index 016defafbc3617..d6892d97fb976f 100644 --- a/build/config/linux/pkg_config.gni +++ b/build/config/linux/pkg_config.gni @@ -1,5 +1,5 @@ # Copyright (c) 2013 The Chromium Authors. All rights reserved. -# Copyright (c) 2020 Project CHIP Authors +# Copyright (c) 2020-2024 Project CHIP Authors # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -43,9 +43,14 @@ # # You can also use "extra args" to filter out results (see pkg-config.py): # extra_args = [ "-v, "foo" ] +# # To ignore libs and ldflags (only cflags/defines will be set, which is useful # when doing manual dynamic linking), set: # ignore_libs = true +# +# To allow the build to proceed if (any of) the requested packages are absent, set: +# optional = true +# In this case the resulting config object will be empty. import("//build_overrides/build.gni") import("${build_root}/config/sysroot.gni") @@ -109,37 +114,42 @@ template("pkg_config") { } else { args = pkg_config_args + invoker.packages } + if (defined(invoker.optional) && invoker.optional) { + args += [ "-o" ] + } if (defined(invoker.extra_args)) { args += invoker.extra_args } + # pkgresult = [present, includes, cflags, libs, lib_dirs] pkgresult = exec_script(pkg_config_script, args, "value") - cflags = pkgresult[1] + if (pkgresult[0]) { + cflags = pkgresult[2] - foreach(include, pkgresult[0]) { - cflags += [ "-I$include" ] - } + foreach(include, pkgresult[1]) { + cflags += [ "-I$include" ] + } - if (!defined(invoker.ignore_libs) || !invoker.ignore_libs) { - libs = pkgresult[2] - lib_dirs = pkgresult[3] - } + if (!defined(invoker.ignore_libs) || !invoker.ignore_libs) { + libs = pkgresult[3] + lib_dirs = pkgresult[4] + } - # Link libraries statically for OSS-Fuzz fuzzer build - if (oss_fuzz) { - libs = [] - ldflags = [ "-Wl,-Bstatic" ] - foreach(lib, pkgresult[2]) { - ldflags += [ "-l$lib" ] + # Link libraries statically for OSS-Fuzz fuzzer build + if (oss_fuzz) { + libs = [] + ldflags = [ "-Wl,-Bstatic" ] + foreach(lib, pkgresult[3]) { + ldflags += [ "-l$lib" ] + } + ldflags += [ "-Wl,-Bdynamic" ] + lib_dirs = pkgresult[4] } - ldflags += [ "-Wl,-Bdynamic" ] - lib_dirs = pkgresult[3] - } - forward_variables_from(invoker, - [ - "defines", - "visibility", - ]) + forward_variables_from(invoker, [ "defines" ]) + } } + + # Always forward visibility + forward_variables_from(invoker, [ "visibility" ]) } From 47ab39e106baa0c050121b1fc5064dd45255b1fb Mon Sep 17 00:00:00 2001 From: Karsten Sperling <113487422+ksperling-apple@users.noreply.github.com> Date: Thu, 30 May 2024 06:14:37 +1200 Subject: [PATCH 22/43] CI: Pick up new Tizen build container (#33653) --- .github/workflows/examples-tizen.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/examples-tizen.yaml b/.github/workflows/examples-tizen.yaml index 8be983a86136bf..17cd275e0d5b52 100644 --- a/.github/workflows/examples-tizen.yaml +++ b/.github/workflows/examples-tizen.yaml @@ -36,7 +36,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-tizen:50 + image: ghcr.io/project-chip/chip-build-tizen:53 options: --user root volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" From 3c47f8059dbec405ad54d6982cb28e1791674674 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 29 May 2024 15:20:50 -0400 Subject: [PATCH 23/43] Add a timeout argument to darwin-framework-tool data model commands. (#33639) chip-tool has one, and this will make it easier to use in YAMLs that run in both. --- .../commands/clusters/ModelCommandBridge.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/examples/darwin-framework-tool/commands/clusters/ModelCommandBridge.h b/examples/darwin-framework-tool/commands/clusters/ModelCommandBridge.h index 2deb7cfb4cac5e..8e5bb8f9842210 100644 --- a/examples/darwin-framework-tool/commands/clusters/ModelCommandBridge.h +++ b/examples/darwin-framework-tool/commands/clusters/ModelCommandBridge.h @@ -21,6 +21,10 @@ #include "../common/CHIPCommandBridge.h" #include +#define DFT_MODEL_COMMAND_DEFAULT_TIMEOUT 20 +#define DFT_STRINGIFY_HELPER(arg) #arg +#define DFT_STRINGIFY(arg) DFT_STRINGIFY_HELPER(arg) + class ModelCommand : public CHIPCommandBridge { public: @@ -30,6 +34,10 @@ class ModelCommand : public CHIPCommandBridge { AddArgument("node-id", 0, UINT64_MAX, &mNodeId); AddArgument("endpoint-id", 0, UINT16_MAX, &mEndPointId); + AddArgument( + "timeout", 0, UINT16_MAX, &mTimeout, + "Amount of time to allow the command to run for before considering it to have timed out. Defaults to " DFT_STRINGIFY( + DFT_MODEL_COMMAND_DEFAULT_TIMEOUT) " seconds."); } void Shutdown() override; @@ -38,11 +46,19 @@ class ModelCommand : public CHIPCommandBridge /////////// CHIPCommand Interface ///////// CHIP_ERROR RunCommand() override; - chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(20); } + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(DFT_MODEL_COMMAND_DEFAULT_TIMEOUT)); + } virtual CHIP_ERROR SendCommand(MTRBaseDevice * _Nonnull device, chip::EndpointId endPointId) = 0; private: chip::NodeId mNodeId; chip::EndpointId mEndPointId; + chip::Optional mTimeout; }; + +#undef DFT_STRINGIFY +#undef DFT_STRINGIFY_HELPER +#undef DFT_MODEL_COMMAND_DEFAULT_TIMEOUT From 2aeb939994ab0515dc321a5e2ba577f163cea31a Mon Sep 17 00:00:00 2001 From: Karsten Sperling <113487422+ksperling-apple@users.noreply.github.com> Date: Thu, 30 May 2024 10:16:00 +1200 Subject: [PATCH 24/43] CI: Use latest chip-build container for all workflows (#33669) And specifically pick up new Tizen build container for qemu for #33628 --- .github/workflows/bloat_check.yaml | 2 +- .github/workflows/build.yaml | 10 +++++----- .github/workflows/chef.yaml | 8 ++++---- .github/workflows/cirque.yaml | 2 +- .github/workflows/doxygen.yaml | 2 +- .github/workflows/examples-ameba.yaml | 2 +- .github/workflows/examples-asr.yaml | 2 +- .github/workflows/examples-bouffalolab.yaml | 2 +- .github/workflows/examples-cc13xx_26xx.yaml | 2 +- .github/workflows/examples-cc32xx.yaml | 2 +- .github/workflows/examples-efr32.yaml | 2 +- .github/workflows/examples-esp32.yaml | 4 ++-- .github/workflows/examples-infineon.yaml | 2 +- .github/workflows/examples-linux-arm.yaml | 2 +- .github/workflows/examples-linux-imx.yaml | 2 +- .github/workflows/examples-linux-standalone.yaml | 2 +- .github/workflows/examples-linux-tv-casting-app.yaml | 2 +- .github/workflows/examples-mbed.yaml | 2 +- .github/workflows/examples-mw320.yaml | 2 +- .github/workflows/examples-nrfconnect.yaml | 2 +- .github/workflows/examples-nuttx.yaml | 2 +- .github/workflows/examples-nxp.yaml | 2 +- .github/workflows/examples-openiotsdk.yaml | 2 +- .github/workflows/examples-qpg.yaml | 2 +- .github/workflows/examples-rw61x.yaml | 2 +- .github/workflows/examples-stm32.yaml | 2 +- .github/workflows/examples-telink.yaml | 2 +- .github/workflows/full-android.yaml | 2 +- .github/workflows/fuzzing-build.yaml | 2 +- .github/workflows/java-tests.yaml | 2 +- .github/workflows/minimal-build.yaml | 2 +- .github/workflows/qemu.yaml | 4 ++-- .github/workflows/release_artifacts.yaml | 4 ++-- .github/workflows/smoketest-android.yaml | 2 +- .github/workflows/tests.yaml | 4 ++-- .github/workflows/unit_integration_test.yaml | 2 +- .github/workflows/zap_regeneration.yaml | 2 +- .github/workflows/zap_templates.yaml | 2 +- 38 files changed, 49 insertions(+), 49 deletions(-) diff --git a/.github/workflows/bloat_check.yaml b/.github/workflows/bloat_check.yaml index b47b780c5e32b9..d4aa3a2fcc342c 100644 --- a/.github/workflows/bloat_check.yaml +++ b/.github/workflows/bloat_check.yaml @@ -34,7 +34,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build:50 + image: ghcr.io/project-chip/chip-build:53 steps: - name: Checkout diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 88588363d03ad4..190a71f2c167dd 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -42,7 +42,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:50 + image: ghcr.io/project-chip/chip-build:53 volumes: - "/:/runner-root-volume" - "/tmp/log_output:/tmp/test_logs" @@ -138,7 +138,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:50 + image: ghcr.io/project-chip/chip-build:53 volumes: - "/:/runner-root-volume" - "/tmp/log_output:/tmp/test_logs" @@ -281,7 +281,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:50 + image: ghcr.io/project-chip/chip-build:53 volumes: - "/:/runner-root-volume" - "/tmp/log_output:/tmp/test_logs" @@ -342,7 +342,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:50 + image: ghcr.io/project-chip/chip-build:53 volumes: - "/:/runner-root-volume" - "/tmp/log_output:/tmp/test_logs" @@ -451,7 +451,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:50 + image: ghcr.io/project-chip/chip-build:53 volumes: - "/:/runner-root-volume" - "/tmp/log_output:/tmp/test_logs" diff --git a/.github/workflows/chef.yaml b/.github/workflows/chef.yaml index 4cbc381d931f69..7531d97c00a10c 100644 --- a/.github/workflows/chef.yaml +++ b/.github/workflows/chef.yaml @@ -35,7 +35,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:50 + image: ghcr.io/project-chip/chip-build:53 options: --user root steps: @@ -56,7 +56,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-esp32:50 + image: ghcr.io/project-chip/chip-build-esp32:53 options: --user root steps: @@ -77,7 +77,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-nrf-platform:50 + image: ghcr.io/project-chip/chip-build-nrf-platform:53 options: --user root steps: @@ -98,7 +98,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-telink:50 + image: ghcr.io/project-chip/chip-build-telink:53 options: --user root steps: diff --git a/.github/workflows/cirque.yaml b/.github/workflows/cirque.yaml index 837e948da51ca3..1f30377b83dcf2 100644 --- a/.github/workflows/cirque.yaml +++ b/.github/workflows/cirque.yaml @@ -42,7 +42,7 @@ jobs: # need to run with privilege, which isn't supported by job.XXX.contaner # https://github.com/actions/container-action/issues/2 # container: - # image: ghcr.io/project-chip/chip-build-cirque:50 + # image: ghcr.io/project-chip/chip-build-cirque:53 # volumes: # - "/tmp:/tmp" # - "/dev/pts:/dev/pts" diff --git a/.github/workflows/doxygen.yaml b/.github/workflows/doxygen.yaml index 41228ea6996123..cdd535b382f3e5 100644 --- a/.github/workflows/doxygen.yaml +++ b/.github/workflows/doxygen.yaml @@ -81,7 +81,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build-doxygen:50 + image: ghcr.io/project-chip/chip-build-doxygen:53 if: github.actor != 'restyled-io[bot]' diff --git a/.github/workflows/examples-ameba.yaml b/.github/workflows/examples-ameba.yaml index cf97a7125d88c3..a75593e4240b81 100644 --- a/.github/workflows/examples-ameba.yaml +++ b/.github/workflows/examples-ameba.yaml @@ -38,7 +38,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-ameba:50 + image: ghcr.io/project-chip/chip-build-ameba:53 options: --user root steps: diff --git a/.github/workflows/examples-asr.yaml b/.github/workflows/examples-asr.yaml index 74b13f09d5b7a8..bd6287b1a7c656 100644 --- a/.github/workflows/examples-asr.yaml +++ b/.github/workflows/examples-asr.yaml @@ -36,7 +36,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-asr:50 + image: ghcr.io/project-chip/chip-build-asr:53 options: --user root steps: diff --git a/.github/workflows/examples-bouffalolab.yaml b/.github/workflows/examples-bouffalolab.yaml index bb08679879d594..ab1ba6acdb2360 100644 --- a/.github/workflows/examples-bouffalolab.yaml +++ b/.github/workflows/examples-bouffalolab.yaml @@ -37,7 +37,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-bouffalolab:50 + image: ghcr.io/project-chip/chip-build-bouffalolab:53 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-cc13xx_26xx.yaml b/.github/workflows/examples-cc13xx_26xx.yaml index 32f82d1840f0e8..8d26fe6fa88adc 100644 --- a/.github/workflows/examples-cc13xx_26xx.yaml +++ b/.github/workflows/examples-cc13xx_26xx.yaml @@ -38,7 +38,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-ti:50 + image: ghcr.io/project-chip/chip-build-ti:53 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-cc32xx.yaml b/.github/workflows/examples-cc32xx.yaml index f98444ff832c8d..e0509250c39a18 100644 --- a/.github/workflows/examples-cc32xx.yaml +++ b/.github/workflows/examples-cc32xx.yaml @@ -39,7 +39,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-ti:50 + image: ghcr.io/project-chip/chip-build-ti:53 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-efr32.yaml b/.github/workflows/examples-efr32.yaml index fff336dd1a636e..39d61fb09f2608 100644 --- a/.github/workflows/examples-efr32.yaml +++ b/.github/workflows/examples-efr32.yaml @@ -40,7 +40,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-efr32:50 + image: ghcr.io/project-chip/chip-build-efr32:53 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-esp32.yaml b/.github/workflows/examples-esp32.yaml index accfec7a8ed35d..c8170de4e0fec9 100644 --- a/.github/workflows/examples-esp32.yaml +++ b/.github/workflows/examples-esp32.yaml @@ -36,7 +36,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-esp32:50 + image: ghcr.io/project-chip/chip-build-esp32:53 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" @@ -126,7 +126,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-esp32:50 + image: ghcr.io/project-chip/chip-build-esp32:53 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/examples-infineon.yaml b/.github/workflows/examples-infineon.yaml index 68b868c8816305..a7a1fb1ab14b14 100644 --- a/.github/workflows/examples-infineon.yaml +++ b/.github/workflows/examples-infineon.yaml @@ -37,7 +37,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-infineon:50 + image: ghcr.io/project-chip/chip-build-infineon:53 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-linux-arm.yaml b/.github/workflows/examples-linux-arm.yaml index 379a0e8291901b..f8e7632c60e0ed 100644 --- a/.github/workflows/examples-linux-arm.yaml +++ b/.github/workflows/examples-linux-arm.yaml @@ -36,7 +36,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-crosscompile:50 + image: ghcr.io/project-chip/chip-build-crosscompile:53 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/examples-linux-imx.yaml b/.github/workflows/examples-linux-imx.yaml index 85296a193652d3..dd053382ccf079 100644 --- a/.github/workflows/examples-linux-imx.yaml +++ b/.github/workflows/examples-linux-imx.yaml @@ -36,7 +36,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-imx:50 + image: ghcr.io/project-chip/chip-build-imx:53 steps: - name: Checkout diff --git a/.github/workflows/examples-linux-standalone.yaml b/.github/workflows/examples-linux-standalone.yaml index 6ab36546dee02e..b020b0cff1a1a3 100644 --- a/.github/workflows/examples-linux-standalone.yaml +++ b/.github/workflows/examples-linux-standalone.yaml @@ -36,7 +36,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:50 + image: ghcr.io/project-chip/chip-build:53 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/examples-linux-tv-casting-app.yaml b/.github/workflows/examples-linux-tv-casting-app.yaml index dfae4ee568840c..84ab3bfa137c0e 100644 --- a/.github/workflows/examples-linux-tv-casting-app.yaml +++ b/.github/workflows/examples-linux-tv-casting-app.yaml @@ -36,7 +36,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:41 + image: ghcr.io/project-chip/chip-build:53 steps: - name: Checkout diff --git a/.github/workflows/examples-mbed.yaml b/.github/workflows/examples-mbed.yaml index 39c5d23f674697..a774fbf52f1ae7 100644 --- a/.github/workflows/examples-mbed.yaml +++ b/.github/workflows/examples-mbed.yaml @@ -42,7 +42,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-mbed-os:50 + image: ghcr.io/project-chip/chip-build-mbed-os:53 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/examples-mw320.yaml b/.github/workflows/examples-mw320.yaml index 0ffe67de0faa13..8b489aec59e5dd 100644 --- a/.github/workflows/examples-mw320.yaml +++ b/.github/workflows/examples-mw320.yaml @@ -39,7 +39,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:50 + image: ghcr.io/project-chip/chip-build:53 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-nrfconnect.yaml b/.github/workflows/examples-nrfconnect.yaml index fe3d0494b9e918..8689925c6f35f6 100644 --- a/.github/workflows/examples-nrfconnect.yaml +++ b/.github/workflows/examples-nrfconnect.yaml @@ -39,7 +39,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-nrf-platform:50 + image: ghcr.io/project-chip/chip-build-nrf-platform:53 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/examples-nuttx.yaml b/.github/workflows/examples-nuttx.yaml index bfe90b7363e4a6..a074e17bedb029 100644 --- a/.github/workflows/examples-nuttx.yaml +++ b/.github/workflows/examples-nuttx.yaml @@ -35,7 +35,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-nuttx:51 + image: ghcr.io/project-chip/chip-build-nuttx:53 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-nxp.yaml b/.github/workflows/examples-nxp.yaml index 2222253b3e760a..f437461ea8c5bb 100644 --- a/.github/workflows/examples-nxp.yaml +++ b/.github/workflows/examples-nxp.yaml @@ -39,7 +39,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-k32w:50 + image: ghcr.io/project-chip/chip-build-k32w:53 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-openiotsdk.yaml b/.github/workflows/examples-openiotsdk.yaml index cb3caeaf9f6338..c2fbe82b806bfa 100644 --- a/.github/workflows/examples-openiotsdk.yaml +++ b/.github/workflows/examples-openiotsdk.yaml @@ -40,7 +40,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-openiotsdk:50 + image: ghcr.io/project-chip/chip-build-openiotsdk:53 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" options: --privileged diff --git a/.github/workflows/examples-qpg.yaml b/.github/workflows/examples-qpg.yaml index bb800eb1016624..29bdb3f8abae12 100644 --- a/.github/workflows/examples-qpg.yaml +++ b/.github/workflows/examples-qpg.yaml @@ -39,7 +39,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:50 + image: ghcr.io/project-chip/chip-build:53 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-rw61x.yaml b/.github/workflows/examples-rw61x.yaml index 526c50d65405ff..efc56c2ec125c8 100644 --- a/.github/workflows/examples-rw61x.yaml +++ b/.github/workflows/examples-rw61x.yaml @@ -39,7 +39,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-rw61x:50 + image: ghcr.io/project-chip/chip-build-rw61x:53 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-stm32.yaml b/.github/workflows/examples-stm32.yaml index ffc20a7aafbe10..050ec72a48db5a 100644 --- a/.github/workflows/examples-stm32.yaml +++ b/.github/workflows/examples-stm32.yaml @@ -40,7 +40,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:50 + image: ghcr.io/project-chip/chip-build:53 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-telink.yaml b/.github/workflows/examples-telink.yaml index 9d83015ecf3d0e..331ee5543932e9 100644 --- a/.github/workflows/examples-telink.yaml +++ b/.github/workflows/examples-telink.yaml @@ -38,7 +38,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-telink:50 + image: ghcr.io/project-chip/chip-build-telink:53 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/full-android.yaml b/.github/workflows/full-android.yaml index 5f06f0c6c609d0..eec019ed11b85d 100644 --- a/.github/workflows/full-android.yaml +++ b/.github/workflows/full-android.yaml @@ -38,7 +38,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-android:50 + image: ghcr.io/project-chip/chip-build-android:53 volumes: - "/tmp/log_output:/tmp/test_logs" diff --git a/.github/workflows/fuzzing-build.yaml b/.github/workflows/fuzzing-build.yaml index ee3eebc254f5e9..55d0ccd18c75e1 100644 --- a/.github/workflows/fuzzing-build.yaml +++ b/.github/workflows/fuzzing-build.yaml @@ -33,7 +33,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:50 + image: ghcr.io/project-chip/chip-build:53 volumes: - "/tmp/log_output:/tmp/test_logs" diff --git a/.github/workflows/java-tests.yaml b/.github/workflows/java-tests.yaml index deab4d1f7e7e93..16bec4c8187ca3 100644 --- a/.github/workflows/java-tests.yaml +++ b/.github/workflows/java-tests.yaml @@ -42,7 +42,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build-java:50 + image: ghcr.io/project-chip/chip-build-java:53 options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 net.ipv4.conf.all.forwarding=0 net.ipv6.conf.all.forwarding=0" diff --git a/.github/workflows/minimal-build.yaml b/.github/workflows/minimal-build.yaml index ac11a145c7fa4e..7e2170baedf5b5 100644 --- a/.github/workflows/minimal-build.yaml +++ b/.github/workflows/minimal-build.yaml @@ -33,7 +33,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build-minimal:50 + image: ghcr.io/project-chip/chip-build-minimal:53 steps: - name: Checkout diff --git a/.github/workflows/qemu.yaml b/.github/workflows/qemu.yaml index 8e9816be2d329d..8129351ce9bf7c 100644 --- a/.github/workflows/qemu.yaml +++ b/.github/workflows/qemu.yaml @@ -40,7 +40,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-esp32-qemu:50 + image: ghcr.io/project-chip/chip-build-esp32-qemu:53 volumes: - "/tmp/log_output:/tmp/test_logs" @@ -78,7 +78,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-tizen-qemu:50 + image: ghcr.io/project-chip/chip-build-tizen-qemu:53 volumes: - "/tmp/log_output:/tmp/test_logs" diff --git a/.github/workflows/release_artifacts.yaml b/.github/workflows/release_artifacts.yaml index 80fdf053003569..2605f723edf5ff 100644 --- a/.github/workflows/release_artifacts.yaml +++ b/.github/workflows/release_artifacts.yaml @@ -32,7 +32,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build-esp32:50 + image: ghcr.io/project-chip/chip-build-esp32:53 steps: - name: Checkout @@ -64,7 +64,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build-efr32:50 + image: ghcr.io/project-chip/chip-build-efr32:53 steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/smoketest-android.yaml b/.github/workflows/smoketest-android.yaml index 3be4eed04fd66d..90afb58f5f06ec 100644 --- a/.github/workflows/smoketest-android.yaml +++ b/.github/workflows/smoketest-android.yaml @@ -37,7 +37,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-android:50 + image: ghcr.io/project-chip/chip-build-android:53 volumes: - "/:/runner-root-volume" - "/tmp/log_output:/tmp/test_logs" diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 4dc5a4cc48218f..f4031eb47104bc 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -49,7 +49,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build:50 + image: ghcr.io/project-chip/chip-build:53 options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1" @@ -440,7 +440,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build:50 + image: ghcr.io/project-chip/chip-build:53 options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 net.ipv4.conf.all.forwarding=0 net.ipv6.conf.all.forwarding=0" diff --git a/.github/workflows/unit_integration_test.yaml b/.github/workflows/unit_integration_test.yaml index 061f66e19818dd..fc209e42ea7b01 100644 --- a/.github/workflows/unit_integration_test.yaml +++ b/.github/workflows/unit_integration_test.yaml @@ -39,7 +39,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build:50 + image: ghcr.io/project-chip/chip-build:53 volumes: - "/:/runner-root-volume" - "/tmp/log_output:/tmp/test_logs" diff --git a/.github/workflows/zap_regeneration.yaml b/.github/workflows/zap_regeneration.yaml index a496dbdb4870f0..1ce0250f6a623e 100644 --- a/.github/workflows/zap_regeneration.yaml +++ b/.github/workflows/zap_regeneration.yaml @@ -30,7 +30,7 @@ jobs: runs-on: ubuntu-20.04 container: - image: ghcr.io/project-chip/chip-build:50 + image: ghcr.io/project-chip/chip-build:53 defaults: run: shell: sh diff --git a/.github/workflows/zap_templates.yaml b/.github/workflows/zap_templates.yaml index d1f066820d71fb..fb2d2de06becfd 100644 --- a/.github/workflows/zap_templates.yaml +++ b/.github/workflows/zap_templates.yaml @@ -34,7 +34,7 @@ jobs: runs-on: ubuntu-20.04 container: - image: ghcr.io/project-chip/chip-build:50 + image: ghcr.io/project-chip/chip-build:53 defaults: run: shell: sh From 1f1b750d815824123a12b6c08a69e3dbc6703ca2 Mon Sep 17 00:00:00 2001 From: C Freeman Date: Wed, 29 May 2024 19:33:25 -0400 Subject: [PATCH 25/43] ICD: mark attribues as provisional (#33617) --- .../zcl/data-model/chip/icd-management-cluster.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/zap-templates/zcl/data-model/chip/icd-management-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/icd-management-cluster.xml index 7015adadc2e5e1..0269b8f0f3dcad 100644 --- a/src/app/zap-templates/zcl/data-model/chip/icd-management-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/icd-management-cluster.xml @@ -36,7 +36,7 @@ limitations under the License. - + @@ -103,9 +103,9 @@ limitations under the License. ClientsSupportedPerFabric - UserActiveModeTriggerHint - UserActiveModeTriggerInstruction - OperatingMode + UserActiveModeTriggerHint + UserActiveModeTriggerInstruction + OperatingMode Register a client to the end device From 90c5cd45d633be1d4f11fa87ac1bd1295fbb40bb Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Wed, 29 May 2024 19:44:04 -0400 Subject: [PATCH 26/43] Post merge review updates for CommandHandler updates (#33658) * Several updates: comments and remove inline * Restyle * Move TryAddResponseData into the cpp instead of the header * Add override, virtual was a copy and paste * Name argument * Argument renaming and comment update * Move EncoderToTLV into DataModel as it looks like a more generic place, maybe we end up re-using it * Restyle * Update copyright year * Renames based on review comments * More renames of args * Fix compile * Slight comment update * More comment update after self-review * More comment update after self-review * Some renaming * Restyle * One more rename: EncodableType * EncodeTo should be const --- src/app/CommandHandler.cpp | 20 +++++ src/app/CommandHandler.h | 115 +++++++--------------------- src/app/data-model/BUILD.gn | 1 + src/app/data-model/EncodableToTLV.h | 62 +++++++++++++++ 4 files changed, 111 insertions(+), 87 deletions(-) create mode 100644 src/app/data-model/EncodableToTLV.h diff --git a/src/app/CommandHandler.cpp b/src/app/CommandHandler.cpp index 6077e0934721f7..309685491a8d82 100644 --- a/src/app/CommandHandler.cpp +++ b/src/app/CommandHandler.cpp @@ -113,6 +113,26 @@ Status CommandHandler::OnInvokeCommandRequest(CommandHandlerExchangeInterface & return status; } +CHIP_ERROR CommandHandler::TryAddResponseData(const ConcreteCommandPath & aRequestCommandPath, CommandId aResponseCommandId, + DataModel::EncodableToTLV & aEncodable) +{ + ConcreteCommandPath responseCommandPath = { aRequestCommandPath.mEndpointId, aRequestCommandPath.mClusterId, + aResponseCommandId }; + + InvokeResponseParameters prepareParams(aRequestCommandPath); + prepareParams.SetStartOrEndDataStruct(false); + + { + ScopedChange internalCallToAddResponse(mInternalCallToAddResponseData, true); + ReturnErrorOnFailure(PrepareInvokeResponseCommand(responseCommandPath, prepareParams)); + } + + TLV::TLVWriter * writer = GetCommandDataIBTLVWriter(); + VerifyOrReturnError(writer != nullptr, CHIP_ERROR_INCORRECT_STATE); + ReturnErrorOnFailure(aEncodable.EncodeTo(*writer, TLV::ContextTag(CommandDataIB::Tag::kFields))); + return FinishCommand(/* aEndDataStruct = */ false); +} + CHIP_ERROR CommandHandler::ValidateInvokeRequestMessageAndBuildRegistry(InvokeRequestMessage::Parser & invokeRequestMessage) { CHIP_ERROR err = CHIP_NO_ERROR; diff --git a/src/app/CommandHandler.h b/src/app/CommandHandler.h index b06064c46a69be..ae41ec1fe350fb 100644 --- a/src/app/CommandHandler.h +++ b/src/app/CommandHandler.h @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -56,32 +57,6 @@ namespace chip { namespace app { -/// Defines an abstract class of something that can be encoded -/// into a TLV with a given data tag -class EncoderToTLV -{ -public: - virtual ~EncoderToTLV() = default; - - virtual CHIP_ERROR Encode(TLV::TLVWriter &, TLV::Tag tag) = 0; -}; - -/// An `EncoderToTLV` the uses `DataModel::Encode` to encode things. -/// -/// Generally useful to encode things like ::Commands::::Type -/// structures. -template -class DataModelEncoderToTLV : public EncoderToTLV -{ -public: - DataModelEncoderToTLV(const T & value) : mValue(value) {} - - virtual CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) { return DataModel::Encode(writer, tag, mValue); } - -private: - const T & mValue; -}; - class CommandHandler { public: @@ -267,7 +242,7 @@ class CommandHandler * Adds the given command status and returns any failures in adding statuses (e.g. out * of buffer space) to the caller */ - CHIP_ERROR FallibleAddStatus(const ConcreteCommandPath & aCommandPath, const Protocols::InteractionModel::Status aStatus, + CHIP_ERROR FallibleAddStatus(const ConcreteCommandPath & aRequestCommandPath, const Protocols::InteractionModel::Status aStatus, const char * context = nullptr); /** @@ -277,9 +252,9 @@ class CommandHandler void AddStatus(const ConcreteCommandPath & aCommandPath, const Protocols::InteractionModel::Status aStatus, const char * context = nullptr); - CHIP_ERROR AddClusterSpecificSuccess(const ConcreteCommandPath & aCommandPath, ClusterStatus aClusterStatus); + CHIP_ERROR AddClusterSpecificSuccess(const ConcreteCommandPath & aRequestCommandPath, ClusterStatus aClusterStatus); - CHIP_ERROR AddClusterSpecificFailure(const ConcreteCommandPath & aCommandPath, ClusterStatus aClusterStatus); + CHIP_ERROR AddClusterSpecificFailure(const ConcreteCommandPath & aRequestCommandPath, ClusterStatus aClusterStatus); /** * This adds a new CommandDataIB element into InvokeResponses for the associated @@ -350,37 +325,34 @@ class CommandHandler * @param [in] aRequestCommandPath the concrete path of the command we are * responding to. * @param [in] aData the data for the response. - * - * NOTE: this is a convenience function for `AddResponseDataViaEncoder` */ template - inline CHIP_ERROR AddResponseData(const ConcreteCommandPath & aRequestCommandPath, const CommandData & aData) + CHIP_ERROR AddResponseData(const ConcreteCommandPath & aRequestCommandPath, const CommandData & aData) { - DataModelEncoderToTLV encoder(aData); - return AddResponseDataViaEncoder(aRequestCommandPath, CommandData::GetCommandId(), encoder); + DataModel::EncodableType encoder(aData); + return AddResponseData(aRequestCommandPath, CommandData::GetCommandId(), encoder); } /** - * API for adding a data response. The encoded is generally expected to encode - * a ClusterName::Commands::CommandName::Type struct, but any - * object should work. + * API for adding a data response. The `aEncodable` is generally expected to encode + * a ClusterName::Commands::CommandName::Type struct, however any object should work. * * @param [in] aRequestCommandPath the concrete path of the command we are * responding to. - * @param [in] commandId the command whose content is being encoded. - * @param [in] encoder - an encoder that places the command data structure for `commandId` - * into a TLV Writer. + * @param [in] aResponseCommandId the command whose content is being encoded. + * @param [in] aEncodable - an encodable that places the command data structure + * for `aResponseCommandId` into a TLV Writer. * * Most applications are likely to use `AddResponseData` as a more convenient * one-call that auto-sets command ID and creates the underlying encoders. */ - CHIP_ERROR AddResponseDataViaEncoder(const ConcreteCommandPath & aRequestCommandPath, CommandId commandId, - EncoderToTLV & encoder) + CHIP_ERROR AddResponseData(const ConcreteCommandPath & aRequestCommandPath, CommandId aResponseCommandId, + DataModel::EncodableToTLV & aEncodable) { // Return early when response should not be sent out. VerifyOrReturnValue(ResponsesAccepted(), CHIP_NO_ERROR); return TryAddingResponse( - [&]() -> CHIP_ERROR { return TryAddResponseDataViaEncoder(aRequestCommandPath, commandId, encoder); }); + [&]() -> CHIP_ERROR { return TryAddResponseData(aRequestCommandPath, aResponseCommandId, aEncodable); }); } /** @@ -398,21 +370,22 @@ class CommandHandler * @param [in] aData the data for the response. */ template - inline void AddResponse(const ConcreteCommandPath & aRequestCommandPath, const CommandData & aData) + void AddResponse(const ConcreteCommandPath & aRequestCommandPath, const CommandData & aData) { - DataModelEncoderToTLV encoder(aData); - return AddResponseViaEncoder(aRequestCommandPath, CommandData::GetCommandId(), encoder); + DataModel::EncodableType encodable(aData); + return AddResponse(aRequestCommandPath, CommandData::GetCommandId(), encodable); } /** - * API for adding a response with a given encoder of TLV data. + * API for adding a response with a given encodable of TLV data. * - * The encoder would generally encode a ClusterName::Commands::CommandName::Type with + * The encodable would generally encode a ClusterName::Commands::CommandName::Type with * the corresponding `GetCommandId` call. */ - void AddResponseViaEncoder(const ConcreteCommandPath & aRequestCommandPath, CommandId commandId, EncoderToTLV & encoder) + void AddResponse(const ConcreteCommandPath & aRequestCommandPath, CommandId aResponseCommandId, + DataModel::EncodableToTLV & aEncodable) { - if (AddResponseDataViaEncoder(aRequestCommandPath, commandId, encoder) != CHIP_NO_ERROR) + if (AddResponseData(aRequestCommandPath, aResponseCommandId, aEncodable) != CHIP_NO_ERROR) { AddStatus(aRequestCommandPath, Protocols::InteractionModel::Status::Failure); } @@ -666,49 +639,17 @@ class CommandHandler CHIP_ERROR AddStatusInternal(const ConcreteCommandPath & aCommandPath, const StatusIB & aStatus); - /** - * Non-templated function called before DataModel::Encode when attempting to add a response, - * which does all the work needed before encoding the actual type-dependent data into the buffer. - * - * **Important:** If this function fails, the TLV buffer may be left in an inconsistent state. - * Callers should create snapshots as necessary before invoking this function and implement - * rollback mechanisms if needed. - * - * **Usage:** This function is intended to be called exclusively by TryAddResponseData. It was - * factored out to optimize code size. - * - * @param aRequestCommandPath The concrete path of the command being responded to. - * @param aResponseCommandPath The concrete path of the command response. - */ - CHIP_ERROR TryAddResponseDataPreEncode(const ConcreteCommandPath & aRequestCommandPath, - const ConcreteCommandPath & aResponseCommandPath) - { - InvokeResponseParameters prepareParams(aRequestCommandPath); - prepareParams.SetStartOrEndDataStruct(false); - - ScopedChange internalCallToAddResponse(mInternalCallToAddResponseData, true); - return PrepareInvokeResponseCommand(aResponseCommandPath, prepareParams); - } - /** * If this function fails, it may leave our TLV buffer in an inconsistent state. * Callers should snapshot as needed before calling this function, and roll back * as needed afterward. * - * @param [in] aRequestCommandPath the concrete path of the command we are - * responding to. - * @param [in] aData the data for the response. + * @param [in] aRequestCommandPath the concrete path of the command we are responding to + * @param [in] aResponseCommandId the id of the command to encode + * @param [in] aEncodable the data to encode for the given aResponseCommandId */ - CHIP_ERROR TryAddResponseDataViaEncoder(const ConcreteCommandPath & aRequestCommandPath, CommandId commandId, - EncoderToTLV & encoder) - { - ConcreteCommandPath responseCommandPath = { aRequestCommandPath.mEndpointId, aRequestCommandPath.mClusterId, commandId }; - ReturnErrorOnFailure(TryAddResponseDataPreEncode(aRequestCommandPath, responseCommandPath)); - TLV::TLVWriter * writer = GetCommandDataIBTLVWriter(); - VerifyOrReturnError(writer != nullptr, CHIP_ERROR_INCORRECT_STATE); - ReturnErrorOnFailure(encoder.Encode(*writer, TLV::ContextTag(CommandDataIB::Tag::kFields))); - return FinishCommand(/* aEndDataStruct = */ false); - } + CHIP_ERROR TryAddResponseData(const ConcreteCommandPath & aRequestCommandPath, CommandId aResponseCommandId, + DataModel::EncodableToTLV & aEncodable); void SetExchangeInterface(CommandHandlerExchangeInterface * commandResponder); diff --git a/src/app/data-model/BUILD.gn b/src/app/data-model/BUILD.gn index 6f38c056282e68..d61b30a68d9611 100644 --- a/src/app/data-model/BUILD.gn +++ b/src/app/data-model/BUILD.gn @@ -18,6 +18,7 @@ source_set("data-model") { "BasicTypes.h", "DecodableList.h", "Decode.h", + "EncodableToTLV.h", "Encode.h", "FabricScoped.h", "FabricScopedPreEncodedValue.cpp", diff --git a/src/app/data-model/EncodableToTLV.h b/src/app/data-model/EncodableToTLV.h new file mode 100644 index 00000000000000..d8b039141c226d --- /dev/null +++ b/src/app/data-model/EncodableToTLV.h @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include + +namespace chip { +namespace app { +namespace DataModel { + +/// Defines an abstract class of something that can be encoded +/// into a TLV with a given data tag +class EncodableToTLV +{ +public: + virtual ~EncodableToTLV() = default; + + virtual CHIP_ERROR EncodeTo(TLV::TLVWriter & writer, TLV::Tag tag) const = 0; +}; + +/// An `EncodableToTLV` that uses `DataModel::Encode` to encode things in one call. +/// +/// Applicable to any type for which `chip::app::DataModel::Encode` works. In +/// particular, types like ::Commands::::Type +/// can be used as a type here. +template +class EncodableType : public EncodableToTLV +{ +public: + /// Encodes the given value via `DataModel::Encode` when the underlying + /// encode is called. + /// + /// LIFETIME NOTE: uses a reference to value, so value must live longer than + /// this object. + EncodableType(const T & value) : mValue(value) {} + + CHIP_ERROR EncodeTo(TLV::TLVWriter & writer, TLV::Tag tag) const override { return DataModel::Encode(writer, tag, mValue); } + +private: + const T & mValue; +}; + +} // namespace DataModel +} // namespace app +} // namespace chip From be60b122b5c39799fd1024aca91a9d430a033e81 Mon Sep 17 00:00:00 2001 From: C Freeman Date: Wed, 29 May 2024 19:57:29 -0400 Subject: [PATCH 27/43] Python documentation: Add a bit more detail on how to run locally (#33644) --- docs/testing/python.md | 62 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 55 insertions(+), 7 deletions(-) diff --git a/docs/testing/python.md b/docs/testing/python.md index 1f946a38333ecd..51f734ace3ab15 100644 --- a/docs/testing/python.md +++ b/docs/testing/python.md @@ -480,16 +480,64 @@ second_ctrl = fa.new_fabric_admin.NewController(nodeId=node_id) # Running tests locally -You can run the python script as-is for local testing against an already-running -DUT +## Setup -`./scripts/tests/run_python_test.py` is a convenient script to fire up an -example DUT on the host, with factory reset support +The scripts require the python wheel to be compiled and installed before +running. To compile and install the wheel, do the following: -`./scripts/tests/run_python_test.py --factoryreset --app --app-args "whatever" --script --script-args "whatever"` +First activate the matter environment using either + +``` +. ./scripts/bootstrap.sh +``` + +or + +``` +. ./scripts/activate.sh +``` + +bootstrap.sh should be used for for the first setup, activate.sh may be used for +subsequent setups as it is faster. + +Next build the python wheels and create / activate a venv (called `py` here, but +any name may be used) + +``` +./scripts/build_python.sh -i py +source py/bin/activate +``` + +## Running tests -Note that devices must be commissioned by the python test harness to run tests. -chip-tool and the python test harness DO NOT share a fabric. +- Note that devices must be commissioned by the python test harness to run + tests. chip-tool and the python test harness DO NOT share a fabric. + +Once the wheel is installed, you can run the python script as a normal python +file for local testing against an already-running DUT. This can be an example +app on the host computer (running in a different terminal), or a separate device +that will be commissioned either over BLE or WiFi. + +For example, to run the TC-ACE-1.2 tests against an un-commissioned DUT: + +``` +python3 src/python_testing/TC_ACE_1_2.py --commissioning-method on-network --qr-code MT:-24J0AFN00KA0648G00 +``` + +Some tests require additional arguments (ex. PIXITs or configuration variables +for the CI). These arguments can be passed as sets of key-value pairs using the +`---arg` command line arguments. For example + +``` +--int-arg PIXIT.ACE.APPENDPOINT:1 PIXIT.ACE.APPDEVTYPEID:0x0100 --string-arg PIXIT.ACE.APPCLUSTER:OnOff PIXIT.ACE.APPATTRIBUTE:OnOff +``` + +## Local host app testing + +`./scripts/tests/run_python_test.py` is a convenient script that starts an +example DUT on the host and includes factory reset support + +`./scripts/tests/run_python_test.py --factoryreset --app --app-args "whatever" --script --script-args "whatever"` # Running tests in CI From 896f802e689fbb31744d50134a6a8b2a3d67fb52 Mon Sep 17 00:00:00 2001 From: Karsten Sperling <113487422+ksperling-apple@users.noreply.github.com> Date: Thu, 30 May 2024 13:51:23 +1200 Subject: [PATCH 28/43] Linux: link with libatomic (#33628) Use of atomic builtins (__atomic_*) can require -latomic depending on what gets inlined (or not) on a particular platform. --- build/config/compiler/BUILD.gn | 1 + 1 file changed, 1 insertion(+) diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn index 63b5eef6003b1b..1e634152a61d49 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn @@ -356,6 +356,7 @@ config("runtime_default") { } if (current_os == "linux" || current_os == "tizen" || current_os == "webos") { libs = [ + "atomic", "dl", "pthread", "rt", From c419e2f528358642a29bd5701957a519f52b07e4 Mon Sep 17 00:00:00 2001 From: Amine Alami <43780877+Alami-Amine@users.noreply.github.com> Date: Thu, 30 May 2024 13:48:19 +0200 Subject: [PATCH 29/43] Fix issue related to teardown of some App Tests (#33654) * Fix issue related to teardown of some App Tests * Update comment Co-authored-by: Boris Zbarsky --------- Co-authored-by: Boris Zbarsky --- src/app/tests/AppTestContext.cpp | 12 ++++++++++++ src/app/tests/BUILD.gn | 14 ++------------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/app/tests/AppTestContext.cpp b/src/app/tests/AppTestContext.cpp index eca7a2db76c83b..ff1154dafbb306 100644 --- a/src/app/tests/AppTestContext.cpp +++ b/src/app/tests/AppTestContext.cpp @@ -49,6 +49,18 @@ void AppContext::SetUpTestSuite() void AppContext::TearDownTestSuite() { + // Some test suites finish with unprocessed work left in the platform manager event queue. + // This can particularly be a problem when this unprocessed work involves reporting engine runs, + // since those can take a while and cause later tests to not reach their queued work before + // their timeouts hit. This is only an issue in setups where all unit tests are compiled into + // a single file (e.g. nRF CI (Zephyr native_posix)). + // + // Work around this issue by doing a DrainAndServiceIO() here to attempt to flush out any queued-up work. + // + // TODO: Solve the underlying issue where test suites leave unprocessed work. Or is this actually + // the right solution? + LoopbackMessagingContext::DrainAndServiceIO(); + chip::DeviceLayer::PlatformMgr().Shutdown(); LoopbackMessagingContext::TearDownTestSuite(); } diff --git a/src/app/tests/BUILD.gn b/src/app/tests/BUILD.gn index df6737a713e6e4..28408773e15edf 100644 --- a/src/app/tests/BUILD.gn +++ b/src/app/tests/BUILD.gn @@ -123,6 +123,7 @@ chip_test_suite_using_nltest("tests") { output_name = "libAppTests" test_sources = [ + "TestAclAttribute.cpp", "TestAclEvent.cpp", "TestAttributeAccessInterfaceCache.cpp", "TestAttributePathExpandIterator.cpp", @@ -151,6 +152,7 @@ chip_test_suite_using_nltest("tests") { "TestPendingResponseTrackerImpl.cpp", "TestPowerSourceCluster.cpp", "TestReadInteraction.cpp", + "TestReportScheduler.cpp", "TestReportingEngine.cpp", "TestStatusIB.cpp", "TestStatusResponseMessage.cpp", @@ -164,8 +166,6 @@ chip_test_suite_using_nltest("tests") { test_sources += [ "TestFailSafeContext.cpp" ] } - test_sources += [ "TestAclAttribute.cpp" ] - # DefaultICDClientStorage assumes that raw AES key is used by the application if (chip_crypto != "psa") { test_sources += [ "TestDefaultICDClientStorage.cpp" ] @@ -189,16 +189,6 @@ chip_test_suite_using_nltest("tests") { test_sources += [ "TestEventLogging.cpp" ] } - # The platform manager is not properly clearing queues in test teardown, which results in - # DrainIO calls not being able to run in expected time (5seconds) if unprocessed reported engine - # runs are remaining, causing tests to crash in Open IoT SDK and Zephyr tests since they are - # running all tests in one file. We need to figure out how to properly clean the event queues - # before enabling this test for these platforms. - if (chip_device_platform != "nrfconnect" && - chip_device_platform != "openiotsdk") { - test_sources += [ "TestReportScheduler.cpp" ] - } - cflags = [ "-Wconversion" ] public_deps = [ From 201d5faaa16c4bc845fd16b668221765f28dea57 Mon Sep 17 00:00:00 2001 From: C Freeman Date: Thu, 30 May 2024 10:46:29 -0400 Subject: [PATCH 30/43] Update DM XML scraper script (#33452) * scraper updates re-write this msg * Restyled by isort --------- Co-authored-by: Restyled.io --- scripts/spec_xml/generate_spec_xml.py | 103 +++++++++++++++++++------- 1 file changed, 77 insertions(+), 26 deletions(-) diff --git a/scripts/spec_xml/generate_spec_xml.py b/scripts/spec_xml/generate_spec_xml.py index b947b997665251..ecdd47e6a6904f 100755 --- a/scripts/spec_xml/generate_spec_xml.py +++ b/scripts/spec_xml/generate_spec_xml.py @@ -20,6 +20,8 @@ import re import subprocess import sys +import xml.etree.ElementTree as ElementTree +from pathlib import Path import click @@ -36,6 +38,20 @@ def get_xml_path(filename, output_dir): return os.path.abspath(os.path.join(output_dir, xml)) +def make_asciidoc(target: str, include_in_progress: bool, spec_dir: str, dry_run: bool) -> str: + cmd = ['make', 'PRINT_FILENAMES=1'] + if include_in_progress: + cmd.append('INCLUDE_IN_PROGRESS=1') + cmd.append(target) + if dry_run: + print(cmd) + return '' + else: + ret = subprocess.check_output(cmd, cwd=spec_dir).decode('UTF-8').rstrip() + print(ret) + return ret + + @click.command() @click.option( '--scraper', @@ -56,16 +72,21 @@ def get_xml_path(filename, output_dir): default=False, is_flag=True, help='Flag for dry run') -def main(scraper, spec_root, output_dir, dry_run): +@click.option( + '--include-in-progress', + default=True, + type=bool, + help='Include in-progress items from spec') +def main(scraper, spec_root, output_dir, dry_run, include_in_progress): # Clusters need to be scraped first because the cluster directory is passed to the device type directory - scrape_clusters(scraper, spec_root, output_dir, dry_run) - scrape_device_types(scraper, spec_root, output_dir, dry_run) + scrape_clusters(scraper, spec_root, output_dir, dry_run, include_in_progress) + scrape_device_types(scraper, spec_root, output_dir, dry_run, include_in_progress) if not dry_run: dump_versions(scraper, spec_root, output_dir) dump_cluster_ids(output_dir) -def scrape_clusters(scraper, spec_root, output_dir, dry_run): +def scrape_clusters(scraper, spec_root, output_dir, dry_run, include_in_progress): src_dir = os.path.abspath(os.path.join(spec_root, 'src')) sdm_clusters_dir = os.path.abspath( os.path.join(src_dir, 'service_device_management')) @@ -74,22 +95,25 @@ def scrape_clusters(scraper, spec_root, output_dir, dry_run): media_clusters_dir = os.path.abspath( os.path.join(app_clusters_dir, 'media')) clusters_output_dir = os.path.abspath(os.path.join(output_dir, 'clusters')) - dm_clusters_list = ['ACL-Cluster.adoc', 'Binding-Cluster.adoc', 'bridge-clusters.adoc', - 'Descriptor-Cluster.adoc', 'Group-Key-Management-Cluster.adoc', 'ICDManagement.adoc', - 'Label-Cluster.adoc'] - sdm_exclude_list = ['AdminAssistedCommissioningFlows.adoc', 'BulkDataExchange.adoc', 'CommissioningFlows.adoc', - 'DeviceCommissioningFlows.adoc', 'DistributedComplianceLedger.adoc', 'OTAFileFormat.adoc'] - app_exclude_list = ['appliances.adoc', 'closures.adoc', 'general.adoc', - 'hvac.adoc', 'lighting.adoc', 'meas_and_sense.adoc', 'robots.adoc'] - media_exclude_list = ['media.adoc', 'VideoPlayerArchitecture.adoc'] if not os.path.exists(clusters_output_dir): os.makedirs(clusters_output_dir) + print('Generating main spec to get file include list - this make take a few minutes') + main_out = make_asciidoc('pdf', include_in_progress, spec_root, dry_run) + print('Generating cluster spec to get file include list - this make take a few minutes') + cluster_out = make_asciidoc('pdf-appclusters-book', include_in_progress, spec_root, dry_run) + def scrape_cluster(filename: str) -> None: + base = Path(filename).stem + if base not in main_out and base not in cluster_out: + print(f'skipping file: {base} as it is not compiled into the asciidoc') + return xml_path = get_xml_path(filename, clusters_output_dir) cmd = [scraper, 'cluster', '-i', filename, '-o', - xml_path, '-nd', '--define', 'in-progress'] + xml_path, '-nd'] + if include_in_progress: + cmd.extend(['--define', 'in-progress']) if dry_run: print(cmd) else: @@ -97,19 +121,38 @@ def scrape_cluster(filename: str) -> None: def scrape_all_clusters(dir: str, exclude_list: list[str] = []) -> None: for filename in glob.glob(f'{dir}/*.adoc'): - if os.path.basename(filename) in exclude_list: - continue scrape_cluster(filename) - scrape_all_clusters(sdm_clusters_dir, sdm_exclude_list) - scrape_all_clusters(app_clusters_dir, app_exclude_list) - scrape_all_clusters(media_clusters_dir, media_exclude_list) - for f in dm_clusters_list: - filename = f'{dm_clusters_dir}/{f}' - scrape_cluster(filename) - - -def scrape_device_types(scraper, spec_root, output_dir, dry_run): + scrape_all_clusters(dm_clusters_dir) + scrape_all_clusters(sdm_clusters_dir) + scrape_all_clusters(app_clusters_dir) + scrape_all_clusters(media_clusters_dir) + + for xml_path in glob.glob(f'{clusters_output_dir}/*.xml'): + tree = ElementTree.parse(f'{xml_path}') + root = tree.getroot() + cluster = next(root.iter('cluster')) + # If there's no cluster ID table, this isn't a cluster + try: + next(cluster.iter('clusterIds')) + except StopIteration: + # If there's no cluster ID table, this isn't a cluster just some kind of intro adoc + print(f'Removing file {xml_path} as it does not include any cluster definitions') + os.remove(xml_path) + continue + # For now, we're going to manually remove the word "Cluster" from the cluster name field + # to make the diff easier. The update to 1.2.4 of the scraper added this. + # TODO: submit a separate PR with JUST this change revered and remove this code. + with open(xml_path, 'rb') as input: + xml_str = input.read() + + original_name = bytes(cluster.attrib['name'], 'utf-8') + replacement_name = bytes(cluster.attrib['name'].removesuffix(" Cluster"), 'utf-8') + with open(xml_path, 'wb') as output: + output.write(xml_str.replace(original_name, replacement_name)) + + +def scrape_device_types(scraper, spec_root, output_dir, dry_run, include_in_progress): device_type_dir = os.path.abspath( os.path.join(spec_root, 'src', 'device_types')) device_types_output_dir = os.path.abspath( @@ -119,9 +162,16 @@ def scrape_device_types(scraper, spec_root, output_dir, dry_run): if not os.path.exists(device_types_output_dir): os.makedirs(device_types_output_dir) + print('Generating device type library to get file include list - this make take a few minutes') + device_type_output = make_asciidoc('pdf-devicelibrary-book', include_in_progress, spec_root, dry_run) + def scrape_device_type(filename: str) -> None: + base = Path(filename).stem + if base not in device_type_output: + print(f'skipping file: {filename} as it is not compiled into the asciidoc') + return xml_path = get_xml_path(filename, device_types_output_dir) - cmd = [scraper, 'devicetype', '-c', clusters_output_dir, + cmd = [scraper, 'devicetype', '-c', '-cls', clusters_output_dir, '-nd', '-i', filename, '-o', xml_path] if dry_run: print(cmd) @@ -187,7 +237,8 @@ def dump_cluster_ids(output_dir): json_file = os.path.join(clusters_output_dir, 'cluster_ids.json') with open(json_file, "w") as outfile: - json.dump(json_dict, outfile, indent=2) + json.dump(json_dict, outfile, indent=4) + outfile.write('\n') if __name__ == '__main__': From a76d1624cb222749592c8cd56550ec95c5ab2b9b Mon Sep 17 00:00:00 2001 From: Jeff Tung <100387939+jtung-apple@users.noreply.github.com> Date: Thu, 30 May 2024 09:18:22 -0700 Subject: [PATCH 31/43] [Darwin] MTRDeviceConnectivityMonitor stopMonitoring crash fix (#33666) * [Darwin] MTRDeviceConnectivityMonitor stopMonitoring crash fix * Update src/darwin/Framework/CHIP/MTRDevice.mm Co-authored-by: Boris Zbarsky --------- Co-authored-by: Boris Zbarsky --- src/darwin/Framework/CHIP/MTRDevice.mm | 44 ++++++++++--------- .../CHIP/MTRDeviceConnectivityMonitor.mm | 9 +++- 2 files changed, 30 insertions(+), 23 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDevice.mm b/src/darwin/Framework/CHIP/MTRDevice.mm index 4e916d14b101c8..98af8fb4ab16c2 100644 --- a/src/darwin/Framework/CHIP/MTRDevice.mm +++ b/src/darwin/Framework/CHIP/MTRDevice.mm @@ -395,8 +395,8 @@ @implementation MTRDevice { NSMutableSet * _persistedClusters; // When we last failed to subscribe to the device (either via - // _setupSubscription or via the auto-resubscribe behavior of the - // ReadClient). Nil if we have had no such failures. + // _setupSubscriptionWithReason or via the auto-resubscribe behavior + // of the ReadClient). Nil if we have had no such failures. NSDate * _Nullable _lastSubscriptionFailureTime; MTRDeviceConnectivityMonitor * _connectivityMonitor; @@ -745,10 +745,10 @@ - (void)setDelegate:(id)delegate queue:(dispatch_queue_t)queu if ([self _deviceUsesThread]) { [self _scheduleSubscriptionPoolWork:^{ std::lock_guard lock(self->_lock); - [self _setupSubscription]; + [self _setupSubscriptionWithReason:@"delegate is set and scheduled subscription is happening"]; } inNanoseconds:0 description:@"MTRDevice setDelegate first subscription"]; } else { - [self _setupSubscription]; + [self _setupSubscriptionWithReason:@"delegate is set and subscription is needed"]; } } } @@ -788,14 +788,14 @@ - (void)nodeMayBeAdvertisingOperational MTR_LOG("%@ saw new operational advertisement", self); - [self _triggerResubscribeWithReason:"operational advertisement seen" + [self _triggerResubscribeWithReason:@"operational advertisement seen" nodeLikelyReachable:YES]; } // Trigger a resubscribe as needed. nodeLikelyReachable should be YES if we // have reason to suspect the node is now reachable, NO if we have no idea // whether it might be. -- (void)_triggerResubscribeWithReason:(const char *)reason nodeLikelyReachable:(BOOL)nodeLikelyReachable +- (void)_triggerResubscribeWithReason:(NSString *)reason nodeLikelyReachable:(BOOL)nodeLikelyReachable { assertChipStackLockedByCurrentThread(); @@ -814,7 +814,7 @@ - (void)_triggerResubscribeWithReason:(const char *)reason nodeLikelyReachable:( // establish a CASE session. And at that point, our subscription will // trigger the state change as needed. if (self.reattemptingSubscription) { - [self _reattemptSubscriptionNowIfNeeded]; + [self _reattemptSubscriptionNowIfNeededWithReason:reason]; } else { readClientToResubscribe = self->_currentReadClient; subscriptionCallback = self->_currentSubscriptionCallback; @@ -829,7 +829,7 @@ - (void)_triggerResubscribeWithReason:(const char *)reason nodeLikelyReachable:( // here (e.g. still booting up), but should try again reasonably quickly. subscriptionCallback->ResetResubscriptionBackoff(); } - readClientToResubscribe->TriggerResubscribeIfScheduled(reason); + readClientToResubscribe->TriggerResubscribeIfScheduled(reason.UTF8String); } } @@ -893,7 +893,7 @@ - (void)_readThroughSkipped // ReadClient in there. If the dispatch fails, that's fine; it means our // controller has shut down, so nothing to be done. [_deviceController asyncDispatchToMatterQueue:^{ - [self _triggerResubscribeWithReason:"read-through skipped while not subscribed" nodeLikelyReachable:NO]; + [self _triggerResubscribeWithReason:@"read-through skipped while not subscribed" nodeLikelyReachable:NO]; } errorHandler:nil]; } @@ -1160,7 +1160,7 @@ - (void)_handleResubscriptionNeededWithDelay:(NSNumber *)resubscriptionDelayMs // this block is run -- if other triggering events had happened, this would become a no-op. auto resubscriptionBlock = ^{ [self->_deviceController asyncDispatchToMatterQueue:^{ - [self _triggerResubscribeWithReason:"ResubscriptionNeeded timer fired" nodeLikelyReachable:NO]; + [self _triggerResubscribeWithReason:@"ResubscriptionNeeded timer fired" nodeLikelyReachable:NO]; } errorHandler:^(NSError * _Nonnull error) { // If controller is not running, clear work item from the subscription queue MTR_LOG_ERROR("%@ could not dispatch to matter queue for resubscription - error %@", self, error); @@ -1235,17 +1235,17 @@ - (void)_handleSubscriptionReset:(NSNumber * _Nullable)retryDelay // If we started subscription or session establishment but failed, remove item from the subscription pool so we can re-queue. [self _clearSubscriptionPoolWork]; - // Call _reattemptSubscriptionNowIfNeeded when timer fires - if subscription is + // Call _reattemptSubscriptionNowIfNeededWithReason when timer fires - if subscription is // in a better state at that time this will be a no-op. auto resubscriptionBlock = ^{ os_unfair_lock_lock(&self->_lock); - [self _reattemptSubscriptionNowIfNeeded]; + [self _reattemptSubscriptionNowIfNeededWithReason:@"got subscription reset"]; os_unfair_lock_unlock(&self->_lock); }; int64_t resubscriptionDelayNs = static_cast(secondsToWait * NSEC_PER_SEC); if ([self _deviceUsesThread]) { - // For Thread-enabled devices, schedule the _reattemptSubscriptionNowIfNeeded call to run in the subscription pool + // For Thread-enabled devices, schedule the _reattemptSubscriptionNowIfNeededWithReason call to run in the subscription pool [self _scheduleSubscriptionPoolWork:resubscriptionBlock inNanoseconds:resubscriptionDelayNs description:@"MTRDevice resubscription"]; } else { // For non-Thread-enabled devices, just call the resubscription block after the specified time @@ -1253,7 +1253,7 @@ - (void)_handleSubscriptionReset:(NSNumber * _Nullable)retryDelay } } -- (void)_reattemptSubscriptionNowIfNeeded +- (void)_reattemptSubscriptionNowIfNeededWithReason:(NSString *)reason { os_unfair_lock_assert_owner(&self->_lock); if (!self.reattemptingSubscription) { @@ -1262,7 +1262,7 @@ - (void)_reattemptSubscriptionNowIfNeeded MTR_LOG("%@ reattempting subscription", self); self.reattemptingSubscription = NO; - [self _setupSubscription]; + [self _setupSubscriptionWithReason:reason]; } - (void)_handleUnsolicitedMessageFromPublisher @@ -1284,8 +1284,8 @@ - (void)_handleUnsolicitedMessageFromPublisher // reestablishment, this starts the attempt right away // TODO: This doesn't really make sense. If we _don't_ have a live // ReadClient how did we get this notification and if we _do_ have an active - // ReadClient, this call or _setupSubscription would be no-ops. - [self _reattemptSubscriptionNowIfNeeded]; + // ReadClient, this call or _setupSubscriptionWithReason would be no-ops. + [self _reattemptSubscriptionNowIfNeededWithReason:@"got unsolicited message from publisher"]; } - (void)_markDeviceAsUnreachableIfNeverSubscribed @@ -1941,7 +1941,7 @@ - (void)_setupConnectivityMonitoring self->_connectivityMonitor = [[MTRDeviceConnectivityMonitor alloc] initWithCompressedFabricID:compressedFabricID nodeID:self.nodeID]; [self->_connectivityMonitor startMonitoringWithHandler:^{ [self->_deviceController asyncDispatchToMatterQueue:^{ - [self _triggerResubscribeWithReason:"device connectivity changed" nodeLikelyReachable:YES]; + [self _triggerResubscribeWithReason:@"device connectivity changed" nodeLikelyReachable:YES]; } errorHandler:nil]; } queue:self.queue]; @@ -1959,12 +1959,12 @@ - (void)_stopConnectivityMonitoring } // assume lock is held -- (void)_setupSubscription +- (void)_setupSubscriptionWithReason:(NSString *)reason { os_unfair_lock_assert_owner(&self->_lock); if (![self _subscriptionsAllowed]) { - MTR_LOG("_setupSubscription: Subscriptions not allowed. Do not set up subscription"); + MTR_LOG("%@ _setupSubscription: Subscriptions not allowed. Do not set up subscription", self); return; } @@ -1986,6 +1986,8 @@ - (void)_setupSubscription [self _changeInternalState:MTRInternalDeviceStateSubscribing]; + MTR_LOG("%@ setting up subscription with reason: %@", self, reason); + // Set up a timer to mark as not reachable if it takes too long to set up a subscription MTRWeakReference * weakSelf = [MTRWeakReference weakReferenceWithObject:self]; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, static_cast(kSecondsToWaitBeforeMarkingUnreachableAfterSettingUpSubscription) * static_cast(NSEC_PER_SEC)), self.queue, ^{ @@ -3512,7 +3514,7 @@ - (void)_deviceMayBeReachable MTR_LOG("%@ _deviceMayBeReachable called", self); - [self _triggerResubscribeWithReason:"SPI client indicated the device may now be reachable" + [self _triggerResubscribeWithReason:@"SPI client indicated the device may now be reachable" nodeLikelyReachable:YES]; } diff --git a/src/darwin/Framework/CHIP/MTRDeviceConnectivityMonitor.mm b/src/darwin/Framework/CHIP/MTRDeviceConnectivityMonitor.mm index 3df270be9ce62e..6a9ac601d41b6f 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceConnectivityMonitor.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceConnectivityMonitor.mm @@ -258,7 +258,7 @@ - (void)_stopMonitoring dispatch_after(dispatch_time(DISPATCH_TIME_NOW, kSharedConnectionLingerIntervalSeconds * NSEC_PER_SEC), sSharedResolverQueue, ^{ std::lock_guard lock(sConnectivityMonitorLock); - if (!sConnectivityMonitorCount) { + if (!sConnectivityMonitorCount && sSharedResolverConnection) { MTR_LOG("MTRDeviceConnectivityMonitor: Closing shared resolver connection"); DNSServiceRefDeallocate(sSharedResolverConnection); sSharedResolverConnection = NULL; @@ -271,9 +271,14 @@ - (void)_stopMonitoring - (void)stopMonitoring { + MTR_LOG("%@ stop connectivity monitoring for %@", self, self->_instanceName); + std::lock_guard lock(sConnectivityMonitorLock); + if (!sSharedResolverConnection || !sSharedResolverQueue) { + MTR_LOG("%@ shared resolver connection already stopped - nothing to do", self); + } + // DNSServiceRefDeallocate must be called on the same queue set on the shared connection. dispatch_async(sSharedResolverQueue, ^{ - MTR_LOG("%@ stop connectivity monitoring for %@", self, self->_instanceName); std::lock_guard lock(sConnectivityMonitorLock); [self _stopMonitoring]; }); From 1057dafa3f04af76913ffb7c69b27398e040da30 Mon Sep 17 00:00:00 2001 From: Karsten Sperling <113487422+ksperling-apple@users.noreply.github.com> Date: Fri, 31 May 2024 07:47:32 +1200 Subject: [PATCH 32/43] Darwin: Keep MTRCommissionableBrowser around until OnBleScanStopped (#33674) * Darwin: Keep MTRCommissionableBrowser around until OnBleScanStopped Because the BLE platform implementation uses a separate dispatch queue, StopBleScan() does not synchrnously stop any further use of the current BleScannerDelegate. Keep the MTRCommissionableBrowser that contains the delegate alive until OnBleScanStopped to avoid a UAF. * restyle * Retain owner in Stop() instead of Start() * More review comments --- .../CHIP/MTRCommissionableBrowser.mm | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRCommissionableBrowser.mm b/src/darwin/Framework/CHIP/MTRCommissionableBrowser.mm index 2b3e2814ecd220..276fb5e3460682 100644 --- a/src/darwin/Framework/CHIP/MTRCommissionableBrowser.mm +++ b/src/darwin/Framework/CHIP/MTRCommissionableBrowser.mm @@ -61,6 +61,10 @@ @implementation MTRCommissionableBrowserResult #endif // CONFIG_NETWORK_LAYER_BLE { public: +#if CONFIG_NETWORK_LAYER_BLE + id mBleScannerDelegateOwner; +#endif // CONFIG_NETWORK_LAYER_BLE + CHIP_ERROR Start(id delegate, MTRDeviceController * controller, dispatch_queue_t queue) { assertChipStackLockedByCurrentThread(); @@ -90,7 +94,7 @@ CHIP_ERROR Start(id delegate, MTRDeviceControl chip::Inet::InterfaceId::Null(), this); } - CHIP_ERROR Stop() + CHIP_ERROR Stop(id owner) { assertChipStackLockedByCurrentThread(); @@ -109,7 +113,10 @@ CHIP_ERROR Stop() mDiscoveredResults = nil; #if CONFIG_NETWORK_LAYER_BLE - ReturnErrorOnFailure(PlatformMgrImpl().StopBleScan()); + mBleScannerDelegateOwner = owner; // retain the owner until OnBleScanStopped is called + PlatformMgrImpl().StopBleScan(); // doesn't actually fail, and if it did we'd want to carry on regardless +#else + (void) owner; #endif // CONFIG_NETWORK_LAYER_BLE return ChipDnssdStopBrowse(this); @@ -281,6 +288,7 @@ void OnBrowseStop(CHIP_ERROR error) override void OnBleScanAdd(BLE_CONNECTION_OBJECT connObj, const ChipBLEDeviceIdentificationInfo & info) override { assertChipStackLockedByCurrentThread(); + VerifyOrReturn(mDelegate != nil); auto result = [[MTRCommissionableBrowserResult alloc] init]; result.instanceName = [NSString stringWithUTF8String:kBleKey]; @@ -303,6 +311,7 @@ void OnBleScanAdd(BLE_CONNECTION_OBJECT connObj, const ChipBLEDeviceIdentificati void OnBleScanRemove(BLE_CONNECTION_OBJECT connObj) override { assertChipStackLockedByCurrentThread(); + VerifyOrReturn(mDelegate != nil); auto key = [NSString stringWithFormat:@"%@", connObj]; if ([mDiscoveredResults objectForKey:key] == nil) { @@ -319,6 +328,12 @@ void OnBleScanRemove(BLE_CONNECTION_OBJECT connObj) override [mDelegate controller:mController didFindCommissionableDevice:result]; }); } + + void OnBleScanStopped() override + { + mBleScannerDelegateOwner = nil; + } + #endif // CONFIG_NETWORK_LAYER_BLE private: @@ -360,7 +375,7 @@ - (BOOL)start - (BOOL)stop { - VerifyOrReturnValue(CHIP_NO_ERROR == _browser.Stop(), NO); + VerifyOrReturnValue(CHIP_NO_ERROR == _browser.Stop(self), NO); _delegate = nil; _controller = nil; _queue = nil; From 92f8cd05ddb37a5f49590d4dfe6fde5c85a92706 Mon Sep 17 00:00:00 2001 From: Jakub Latusek Date: Thu, 30 May 2024 21:52:05 +0200 Subject: [PATCH 33/43] Make StringToUUID constexpr (#33649) * Implement StringToUUID as constexpr * Change local variable to use one global constexpr * restyle * Typo * Remove strings from tizen and linux platform * refactor * Fix review issue --- src/ble/BLEEndPoint.cpp | 8 +- src/ble/BleLayer.cpp | 30 ++--- src/ble/BleLayer.h | 7 -- src/ble/BleUUID.cpp | 39 ------- src/ble/BleUUID.h | 70 +++++++++++- src/ble/tests/TestBleLayer.cpp | 42 +++---- src/ble/tests/TestBleUUID.cpp | 33 +++--- src/platform/Linux/bluez/BluezConnection.cpp | 8 +- src/platform/Linux/bluez/BluezEndpoint.cpp | 8 +- .../Linux/bluez/ChipDeviceScanner.cpp | 2 +- src/platform/Linux/bluez/Types.h | 12 -- src/platform/Tizen/BLEManagerImpl.cpp | 107 +++++------------- src/platform/Tizen/ChipDeviceScanner.cpp | 9 +- 13 files changed, 149 insertions(+), 226 deletions(-) diff --git a/src/ble/BLEEndPoint.cpp b/src/ble/BLEEndPoint.cpp index 0e69e590df7f49..78e74bdec78b1a 100644 --- a/src/ble/BLEEndPoint.cpp +++ b/src/ble/BLEEndPoint.cpp @@ -389,7 +389,7 @@ void BLEEndPoint::FinalizeClose(uint8_t oldState, uint8_t flags, CHIP_ERROR err) // Indicate close of chipConnection to peripheral via GATT unsubscribe. Keep end point allocated until // unsubscribe completes or times out, so platform doesn't close underlying BLE connection before // we're really sure the unsubscribe request has been sent. - if (!mBle->mPlatformDelegate->UnsubscribeCharacteristic(mConnObj, &CHIP_BLE_SVC_ID, &mBle->CHIP_BLE_CHAR_2_ID)) + if (!mBle->mPlatformDelegate->UnsubscribeCharacteristic(mConnObj, &CHIP_BLE_SVC_ID, &CHIP_BLE_CHAR_2_UUID)) { ChipLogError(Ble, "BtpEngine unsub failed"); @@ -750,7 +750,7 @@ CHIP_ERROR BLEEndPoint::HandleHandshakeConfirmationReceived() { // Subscribe to characteristic which peripheral will use to send indications. Prompts peripheral to send // BLE transport capabilities indication. - VerifyOrExit(mBle->mPlatformDelegate->SubscribeCharacteristic(mConnObj, &CHIP_BLE_SVC_ID, &mBle->CHIP_BLE_CHAR_2_ID), + VerifyOrExit(mBle->mPlatformDelegate->SubscribeCharacteristic(mConnObj, &CHIP_BLE_SVC_ID, &CHIP_BLE_CHAR_2_UUID), err = BLE_ERROR_GATT_SUBSCRIBE_FAILED); // We just sent a GATT subscribe request, so make sure to attempt unsubscribe on close. @@ -1313,14 +1313,14 @@ bool BLEEndPoint::SendWrite(PacketBufferHandle && buf) { mConnStateFlags.Set(ConnectionStateFlag::kGattOperationInFlight); - return mBle->mPlatformDelegate->SendWriteRequest(mConnObj, &CHIP_BLE_SVC_ID, &mBle->CHIP_BLE_CHAR_1_ID, std::move(buf)); + return mBle->mPlatformDelegate->SendWriteRequest(mConnObj, &CHIP_BLE_SVC_ID, &CHIP_BLE_CHAR_1_UUID, std::move(buf)); } bool BLEEndPoint::SendIndication(PacketBufferHandle && buf) { mConnStateFlags.Set(ConnectionStateFlag::kGattOperationInFlight); - return mBle->mPlatformDelegate->SendIndication(mConnObj, &CHIP_BLE_SVC_ID, &mBle->CHIP_BLE_CHAR_2_ID, std::move(buf)); + return mBle->mPlatformDelegate->SendIndication(mConnObj, &CHIP_BLE_SVC_ID, &CHIP_BLE_CHAR_2_UUID, std::move(buf)); } CHIP_ERROR BLEEndPoint::StartConnectTimer() diff --git a/src/ble/BleLayer.cpp b/src/ble/BleLayer.cpp index de1f8458402efa..3e1473a4a1c2c2 100644 --- a/src/ble/BleLayer.cpp +++ b/src/ble/BleLayer.cpp @@ -138,20 +138,6 @@ class BleEndPointPool // static BleEndPointPool sBLEEndPointPool; -// UUIDs used internally by BleLayer: - -const ChipBleUUID BleLayer::CHIP_BLE_CHAR_1_ID = { { // 18EE2EF5-263D-4559-959F-4F9C429F9D11 - 0x18, 0xEE, 0x2E, 0xF5, 0x26, 0x3D, 0x45, 0x59, 0x95, 0x9F, 0x4F, 0x9C, 0x42, - 0x9F, 0x9D, 0x11 } }; - -const ChipBleUUID BleLayer::CHIP_BLE_CHAR_2_ID = { { // 18EE2EF5-263D-4559-959F-4F9C429F9D12 - 0x18, 0xEE, 0x2E, 0xF5, 0x26, 0x3D, 0x45, 0x59, 0x95, 0x9F, 0x4F, 0x9C, 0x42, - 0x9F, 0x9D, 0x12 } }; - -const ChipBleUUID BleLayer::CHIP_BLE_CHAR_3_ID = { { // 64630238-8772-45F2-B87D-748A83218F04 - 0x64, 0x63, 0x02, 0x38, 0x87, 0x72, 0x45, 0xF2, 0xB8, 0x7D, 0x74, 0x8A, 0x83, - 0x21, 0x8F, 0x04 } }; - // BleTransportCapabilitiesRequestMessage implementation: void BleTransportCapabilitiesRequestMessage::SetSupportedProtocolVersion(uint8_t index, uint8_t version) @@ -486,7 +472,7 @@ bool BleLayer::HandleWriteReceived(BLE_CONNECTION_OBJECT connObj, const ChipBleU PacketBufferHandle && pBuf) { VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_SVC_ID, svcId), false, ChipLogError(Ble, "Write received on unknown svc")); - VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_CHAR_1_ID, charId), false, ChipLogError(Ble, "Write received on unknown char")); + VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_CHAR_1_UUID, charId), false, ChipLogError(Ble, "Write received on unknown char")); VerifyOrReturnError(!pBuf.IsNull(), false, ChipLogError(Ble, "Write received null buffer")); // Find matching connection end point. @@ -512,7 +498,7 @@ bool BleLayer::HandleIndicationReceived(BLE_CONNECTION_OBJECT connObj, const Chi PacketBufferHandle && pBuf) { VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_SVC_ID, svcId), false, ChipLogError(Ble, "Indication received on unknown svc")); - VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_CHAR_2_ID, charId), false, ChipLogError(Ble, "Indication received on unknown char")); + VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_CHAR_2_UUID, charId), false, ChipLogError(Ble, "Indication received on unknown char")); VerifyOrReturnError(!pBuf.IsNull(), false, ChipLogError(Ble, "Indication received null buffer")); // Find matching connection end point. @@ -528,7 +514,7 @@ bool BleLayer::HandleIndicationReceived(BLE_CONNECTION_OBJECT connObj, const Chi bool BleLayer::HandleWriteConfirmation(BLE_CONNECTION_OBJECT connObj, const ChipBleUUID * svcId, const ChipBleUUID * charId) { VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_SVC_ID, svcId), false, ChipLogError(Ble, "Write confirmation on unknown svc")); - VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_CHAR_1_ID, charId), false, ChipLogError(Ble, "Write confirmation on unknown char")); + VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_CHAR_1_UUID, charId), false, ChipLogError(Ble, "Write confirmation on unknown char")); HandleAckReceived(connObj); return true; @@ -537,7 +523,7 @@ bool BleLayer::HandleWriteConfirmation(BLE_CONNECTION_OBJECT connObj, const Chip bool BleLayer::HandleIndicationConfirmation(BLE_CONNECTION_OBJECT connObj, const ChipBleUUID * svcId, const ChipBleUUID * charId) { VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_SVC_ID, svcId), false, ChipLogError(Ble, "Indication confirmation on unknown svc")); - VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_CHAR_2_ID, charId), false, + VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_CHAR_2_UUID, charId), false, ChipLogError(Ble, "Indication confirmation on unknown char")); HandleAckReceived(connObj); @@ -558,7 +544,7 @@ void BleLayer::HandleAckReceived(BLE_CONNECTION_OBJECT connObj) bool BleLayer::HandleSubscribeReceived(BLE_CONNECTION_OBJECT connObj, const ChipBleUUID * svcId, const ChipBleUUID * charId) { VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_SVC_ID, svcId), false, ChipLogError(Ble, "Subscribe received on unknown svc")); - VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_CHAR_2_ID, charId) || UUIDsMatch(&CHIP_BLE_CHAR_3_ID, charId), false, + VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_CHAR_2_UUID, charId) || UUIDsMatch(&CHIP_BLE_CHAR_3_UUID, charId), false, ChipLogError(Ble, "Subscribe received on unknown char")); // Find end point already associated with BLE connection, if any. @@ -572,7 +558,7 @@ bool BleLayer::HandleSubscribeReceived(BLE_CONNECTION_OBJECT connObj, const Chip bool BleLayer::HandleSubscribeComplete(BLE_CONNECTION_OBJECT connObj, const ChipBleUUID * svcId, const ChipBleUUID * charId) { VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_SVC_ID, svcId), false, ChipLogError(Ble, "Subscribe complete on unknown svc")); - VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_CHAR_2_ID, charId) || UUIDsMatch(&CHIP_BLE_CHAR_3_ID, charId), false, + VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_CHAR_2_UUID, charId) || UUIDsMatch(&CHIP_BLE_CHAR_3_UUID, charId), false, ChipLogError(Ble, "Subscribe complete on unknown char")); BLEEndPoint * endPoint = sBLEEndPointPool.Find(connObj); @@ -585,7 +571,7 @@ bool BleLayer::HandleSubscribeComplete(BLE_CONNECTION_OBJECT connObj, const Chip bool BleLayer::HandleUnsubscribeReceived(BLE_CONNECTION_OBJECT connObj, const ChipBleUUID * svcId, const ChipBleUUID * charId) { VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_SVC_ID, svcId), false, ChipLogError(Ble, "Unsubscribe received on unknown svc")); - VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_CHAR_2_ID, charId) || UUIDsMatch(&CHIP_BLE_CHAR_3_ID, charId), false, + VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_CHAR_2_UUID, charId) || UUIDsMatch(&CHIP_BLE_CHAR_3_UUID, charId), false, ChipLogError(Ble, "Unsubscribe received on unknown char")); // Find end point already associated with BLE connection, if any. @@ -599,7 +585,7 @@ bool BleLayer::HandleUnsubscribeReceived(BLE_CONNECTION_OBJECT connObj, const Ch bool BleLayer::HandleUnsubscribeComplete(BLE_CONNECTION_OBJECT connObj, const ChipBleUUID * svcId, const ChipBleUUID * charId) { VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_SVC_ID, svcId), false, ChipLogError(Ble, "Unsubscribe complete on unknown svc")); - VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_CHAR_2_ID, charId) || UUIDsMatch(&CHIP_BLE_CHAR_3_ID, charId), false, + VerifyOrReturnError(UUIDsMatch(&CHIP_BLE_CHAR_2_UUID, charId) || UUIDsMatch(&CHIP_BLE_CHAR_3_UUID, charId), false, ChipLogError(Ble, "Unsubscribe complete on unknown char")); // Find end point already associated with BLE connection, if any. diff --git a/src/ble/BleLayer.h b/src/ble/BleLayer.h index e7d619fe13420e..7056a09e5e14d6 100644 --- a/src/ble/BleLayer.h +++ b/src/ble/BleLayer.h @@ -313,13 +313,6 @@ class DLL_EXPORT BleLayer private: // Private data members: - // UUID of CHIP service characteristic used for central writes. - static const ChipBleUUID CHIP_BLE_CHAR_1_ID; - // UUID of CHIP service characteristic used for peripheral indications. - static const ChipBleUUID CHIP_BLE_CHAR_2_ID; - // UUID of CHIP service characteristic used for additional data - static const ChipBleUUID CHIP_BLE_CHAR_3_ID; - BleConnectionDelegate * mConnectionDelegate; BlePlatformDelegate * mPlatformDelegate; BleApplicationDelegate * mApplicationDelegate; diff --git a/src/ble/BleUUID.cpp b/src/ble/BleUUID.cpp index 098595fd721e5c..f42fc982e403d6 100644 --- a/src/ble/BleUUID.cpp +++ b/src/ble/BleUUID.cpp @@ -26,15 +26,6 @@ namespace chip { namespace Ble { -const ChipBleUUID CHIP_BLE_SVC_ID = { { // 0000FFF6-0000-1000-8000-00805F9B34FB - 0x00, 0x00, 0xFF, 0xF6, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, - 0xFB } }; - -inline static uint8_t HexDigitToInt(const char c) -{ - return static_cast(c >= '0' && c <= '9' ? c - '0' : tolower(c) - 'a' + 10); -} - bool UUIDsMatch(const ChipBleUUID * idOne, const ChipBleUUID * idTwo) { if ((idOne == nullptr) || (idTwo == nullptr)) @@ -44,35 +35,5 @@ bool UUIDsMatch(const ChipBleUUID * idOne, const ChipBleUUID * idTwo) return (memcmp(idOne->bytes, idTwo->bytes, 16) == 0); } -// Convert a string like "0000FFF6-0000-1000-8000-00805F9B34FB" to binary UUID -bool StringToUUID(const char * str, ChipBleUUID & uuid) -{ - constexpr size_t NUM_UUID_NIBBLES = sizeof(uuid.bytes) * 2; - size_t nibbleId = 0; - - for (; *str; ++str) - { - if (*str == '-') // skip separators - continue; - - if (!isxdigit(*str)) // invalid character! - return false; - - if (nibbleId >= NUM_UUID_NIBBLES) // too long string! - return false; - - uint8_t & byte = uuid.bytes[nibbleId / 2]; - if (nibbleId % 2 == 0) - byte = static_cast(HexDigitToInt(*str) << 4); - else - byte = static_cast(byte | HexDigitToInt(*str)); - - ++nibbleId; - } - - // All bytes were initialized? - return nibbleId == NUM_UUID_NIBBLES; -} - } /* namespace Ble */ } /* namespace chip */ diff --git a/src/ble/BleUUID.h b/src/ble/BleUUID.h index 315af9e8c76a32..6470cfe36e8494 100644 --- a/src/ble/BleUUID.h +++ b/src/ble/BleUUID.h @@ -22,7 +22,9 @@ #error "Please include instead!" #endif +#include #include +#include namespace chip { namespace Ble { @@ -36,11 +38,73 @@ struct ChipBleUUID uint8_t bytes[16]; }; -// UUID of CHIP BLE service. Exposed for use in scan filter. -extern const ChipBleUUID CHIP_BLE_SVC_ID; +constexpr bool isValidHexChar(char c) +{ + return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F'); +} + +constexpr uint8_t HexDigitToInt(const char c) +{ + if (c >= '0' && c <= '9') + return static_cast(c - '0'); + else + return static_cast((c >= 'a' ? c - 'a' : c - 'A') + 10); +} bool UUIDsMatch(const ChipBleUUID * idOne, const ChipBleUUID * idTwo); -bool StringToUUID(const char * str, ChipBleUUID & uuid); + +/* + * StringToUUID converts a string representation of a UUID to a binary UUID. + * The string representation must be in the format "0000FFF6-0000-1000-8000-00805F9B34FB". + * The function returns a pair of a boolean indicating whether the conversion was successful + * and the binary UUID. + * + */ +template +constexpr std::pair StringToUUID(const char (&str)[N]) +{ + constexpr size_t UUID_LEN = 16; + constexpr size_t NUM_UUID_NIBBLES = UUID_LEN * 2; + static_assert(N >= NUM_UUID_NIBBLES); + ChipBleUUID uuid{}; + + size_t nibbleId = 0; + for (size_t i = 0; i < N - 1; ++i) + { + if (str[i] == '-') + continue; + if (!isValidHexChar(str[i])) + return { false, {} }; + if (nibbleId >= NUM_UUID_NIBBLES) + return { false, {} }; + uint8_t & byte = uuid.bytes[nibbleId / 2]; + if (nibbleId % 2 == 0) + byte = static_cast(HexDigitToInt(str[i]) << 4); + else + byte = static_cast(byte | HexDigitToInt(str[i])); + ++nibbleId; + } + return { nibbleId == NUM_UUID_NIBBLES, uuid }; +} + +#define StringToUUIDConstexpr(str) \ + []() { \ + constexpr std::pair res = ::chip::Ble::StringToUUID(str); \ + static_assert(res.first, "Argument: \"" #str "\" is not valid hex string"); \ + return res.second; \ + }(); + +// UUID of CHIP BLE service. +inline constexpr char CHIP_BLE_DESC_SHORT_UUID_STR[] = "2902"; +inline constexpr char CHIP_BLE_SERVICE_SHORT_UUID_STR[] = "FFF6"; +inline constexpr char CHIP_BLE_SERVICE_LONG_UUID_STR[] = "0000FFF6-0000-1000-8000-00805F9B34FB"; +inline constexpr char CHIP_BLE_CHAR_1_UUID_STR[] = "18EE2EF5-263D-4559-959F-4F9C429F9D11"; +inline constexpr char CHIP_BLE_CHAR_2_UUID_STR[] = "18EE2EF5-263D-4559-959F-4F9C429F9D12"; +inline constexpr char CHIP_BLE_CHAR_3_UUID_STR[] = "64630238-8772-45F2-B87D-748A83218F04"; +inline constexpr ChipBleUUID CHIP_BLE_SVC_ID = StringToUUIDConstexpr("0000FFF6-0000-1000-8000-00805F9B34FB"); +inline constexpr ChipBleUUID CHIP_BLE_CHAR_1_UUID = StringToUUIDConstexpr("18EE2EF5-263D-4559-959F-4F9C429F9D11"); +inline constexpr ChipBleUUID CHIP_BLE_CHAR_2_UUID = StringToUUIDConstexpr("18EE2EF5-263D-4559-959F-4F9C429F9D12"); +inline constexpr ChipBleUUID CHIP_BLE_CHAR_3_UUID = StringToUUIDConstexpr("64630238-8772-45F2-B87D-748A83218F04"); } /* namespace Ble */ } /* namespace chip */ diff --git a/src/ble/tests/TestBleLayer.cpp b/src/ble/tests/TestBleLayer.cpp index 9b79037acd0ea1..968293d8a72b8f 100644 --- a/src/ble/tests/TestBleLayer.cpp +++ b/src/ble/tests/TestBleLayer.cpp @@ -44,14 +44,6 @@ namespace Ble { namespace { constexpr ChipBleUUID uuidZero{}; -constexpr ChipBleUUID uuidSvc = { { 0x00, 0x00, 0xFF, 0xF6, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, - 0xFB } }; -constexpr ChipBleUUID uuidChar1 = { { 0x18, 0xEE, 0x2E, 0xF5, 0x26, 0x3D, 0x45, 0x59, 0x95, 0x9F, 0x4F, 0x9C, 0x42, 0x9F, 0x9D, - 0x11 } }; -constexpr ChipBleUUID uuidChar2 = { { 0x18, 0xEE, 0x2E, 0xF5, 0x26, 0x3D, 0x45, 0x59, 0x95, 0x9F, 0x4F, 0x9C, 0x42, 0x9F, 0x9D, - 0x12 } }; -constexpr ChipBleUUID uuidChar3 = { { 0x64, 0x63, 0x02, 0x38, 0x87, 0x72, 0x45, 0xF2, 0xB8, 0x7D, 0x74, 0x8A, 0x83, 0x21, 0x8F, - 0x04 } }; }; // namespace @@ -111,14 +103,14 @@ class TestBleLayer : public BleLayer, { constexpr uint8_t capReq[] = { 0x65, 0x6c, 0x54, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x06 }; auto buf = System::PacketBufferHandle::NewWithData(capReq, sizeof(capReq)); - return HandleWriteReceived(connObj, &uuidSvc, &uuidChar1, std::move(buf)); + return HandleWriteReceived(connObj, &CHIP_BLE_SVC_ID, &CHIP_BLE_CHAR_1_UUID, std::move(buf)); } // Processing subscription request after capabilities request should finalize // connection establishment. bool HandleSubscribeReceivedOnChar2(BLE_CONNECTION_OBJECT connObj) { - return HandleSubscribeReceived(connObj, &uuidSvc, &uuidChar2); + return HandleSubscribeReceived(connObj, &CHIP_BLE_SVC_ID, &CHIP_BLE_CHAR_2_UUID); } /// @@ -220,7 +212,7 @@ TEST_F(TestBleLayer, HandleSubscribeReceivedInvalidUUID) { auto connObj = GetConnectionObject(); EXPECT_FALSE(HandleSubscribeReceived(connObj, &uuidZero, &uuidZero)); - EXPECT_FALSE(HandleSubscribeReceived(connObj, &uuidSvc, &uuidChar1)); + EXPECT_FALSE(HandleSubscribeReceived(connObj, &CHIP_BLE_SVC_ID, &CHIP_BLE_CHAR_1_UUID)); } TEST_F(TestBleLayer, HandleSubscribeReceived) @@ -234,7 +226,7 @@ TEST_F(TestBleLayer, HandleSubscribeCompleteInvalidUUID) { auto connObj = GetConnectionObject(); EXPECT_FALSE(HandleSubscribeComplete(connObj, &uuidZero, &uuidZero)); - EXPECT_FALSE(HandleSubscribeComplete(connObj, &uuidSvc, &uuidChar1)); + EXPECT_FALSE(HandleSubscribeComplete(connObj, &CHIP_BLE_SVC_ID, &CHIP_BLE_CHAR_1_UUID)); } TEST_F(TestBleLayer, HandleSubscribeComplete) @@ -243,14 +235,14 @@ TEST_F(TestBleLayer, HandleSubscribeComplete) ASSERT_TRUE(HandleWriteReceivedCapabilitiesRequest(connObj)); ASSERT_TRUE(HandleSubscribeReceivedOnChar2(connObj)); - EXPECT_TRUE(HandleSubscribeComplete(connObj, &uuidSvc, &uuidChar2)); + EXPECT_TRUE(HandleSubscribeComplete(connObj, &CHIP_BLE_SVC_ID, &CHIP_BLE_CHAR_2_UUID)); } TEST_F(TestBleLayer, HandleUnsubscribeReceivedInvalidUUID) { auto connObj = GetConnectionObject(); EXPECT_FALSE(HandleUnsubscribeReceived(connObj, &uuidZero, &uuidZero)); - EXPECT_FALSE(HandleUnsubscribeReceived(connObj, &uuidSvc, &uuidChar1)); + EXPECT_FALSE(HandleUnsubscribeReceived(connObj, &CHIP_BLE_SVC_ID, &CHIP_BLE_CHAR_1_UUID)); } TEST_F(TestBleLayer, HandleUnsubscribeReceived) @@ -259,14 +251,14 @@ TEST_F(TestBleLayer, HandleUnsubscribeReceived) ASSERT_TRUE(HandleWriteReceivedCapabilitiesRequest(connObj)); ASSERT_TRUE(HandleSubscribeReceivedOnChar2(connObj)); - EXPECT_TRUE(HandleUnsubscribeReceived(connObj, &uuidSvc, &uuidChar2)); + EXPECT_TRUE(HandleUnsubscribeReceived(connObj, &CHIP_BLE_SVC_ID, &CHIP_BLE_CHAR_2_UUID)); } TEST_F(TestBleLayer, HandleUnsubscribeCompleteInvalidUUID) { auto connObj = GetConnectionObject(); EXPECT_FALSE(HandleUnsubscribeComplete(connObj, &uuidZero, &uuidZero)); - EXPECT_FALSE(HandleUnsubscribeComplete(connObj, &uuidSvc, &uuidChar1)); + EXPECT_FALSE(HandleUnsubscribeComplete(connObj, &CHIP_BLE_SVC_ID, &CHIP_BLE_CHAR_1_UUID)); } TEST_F(TestBleLayer, HandleUnsubscribeComplete) @@ -275,7 +267,7 @@ TEST_F(TestBleLayer, HandleUnsubscribeComplete) ASSERT_TRUE(HandleWriteReceivedCapabilitiesRequest(connObj)); ASSERT_TRUE(HandleSubscribeReceivedOnChar2(connObj)); - EXPECT_TRUE(HandleUnsubscribeComplete(connObj, &uuidSvc, &uuidChar2)); + EXPECT_TRUE(HandleUnsubscribeComplete(connObj, &CHIP_BLE_SVC_ID, &CHIP_BLE_CHAR_2_UUID)); } TEST_F(TestBleLayer, HandleWriteReceivedInvalidUUID) @@ -285,7 +277,7 @@ TEST_F(TestBleLayer, HandleWriteReceivedInvalidUUID) ASSERT_FALSE(buf.IsNull()); EXPECT_FALSE(HandleWriteReceived(connObj, &uuidZero, &uuidZero, buf.Retain())); - EXPECT_FALSE(HandleWriteReceived(connObj, &uuidSvc, &uuidChar3, std::move(buf))); + EXPECT_FALSE(HandleWriteReceived(connObj, &CHIP_BLE_SVC_ID, &CHIP_BLE_CHAR_3_UUID, std::move(buf))); } TEST_F(TestBleLayer, HandleWriteReceived) @@ -300,14 +292,14 @@ TEST_F(TestBleLayer, HandleWriteReceived) auto buf = System::PacketBufferHandle::NewWithData(data, sizeof(data)); ASSERT_FALSE(buf.IsNull()); - EXPECT_TRUE(HandleWriteReceived(connObj, &uuidSvc, &uuidChar1, std::move(buf))); + EXPECT_TRUE(HandleWriteReceived(connObj, &CHIP_BLE_SVC_ID, &CHIP_BLE_CHAR_1_UUID, std::move(buf))); } TEST_F(TestBleLayer, HandleWriteConfirmationInvalidUUID) { auto connObj = GetConnectionObject(); EXPECT_FALSE(HandleWriteConfirmation(connObj, &uuidZero, &uuidZero)); - EXPECT_FALSE(HandleWriteConfirmation(connObj, &uuidSvc, &uuidChar2)); + EXPECT_FALSE(HandleWriteConfirmation(connObj, &CHIP_BLE_SVC_ID, &CHIP_BLE_CHAR_2_UUID)); } TEST_F(TestBleLayer, HandleWriteConfirmationUninitialized) @@ -320,7 +312,7 @@ TEST_F(TestBleLayer, HandleWriteConfirmation) auto connObj = GetConnectionObject(); ASSERT_TRUE(HandleWriteReceivedCapabilitiesRequest(connObj)); - EXPECT_TRUE(HandleWriteConfirmation(connObj, &uuidSvc, &uuidChar1)); + EXPECT_TRUE(HandleWriteConfirmation(connObj, &CHIP_BLE_SVC_ID, &CHIP_BLE_CHAR_1_UUID)); } TEST_F(TestBleLayer, HandleIndicationReceivedInvalidUUID) @@ -330,7 +322,7 @@ TEST_F(TestBleLayer, HandleIndicationReceivedInvalidUUID) ASSERT_FALSE(buf.IsNull()); EXPECT_FALSE(HandleIndicationReceived(connObj, &uuidZero, &uuidZero, buf.Retain())); - EXPECT_FALSE(HandleIndicationReceived(connObj, &uuidSvc, &uuidChar1, std::move(buf))); + EXPECT_FALSE(HandleIndicationReceived(connObj, &CHIP_BLE_SVC_ID, &CHIP_BLE_CHAR_1_UUID, std::move(buf))); } TEST_F(TestBleLayer, HandleIndicationReceived) @@ -345,14 +337,14 @@ TEST_F(TestBleLayer, HandleIndicationReceived) auto buf = System::PacketBufferHandle::NewWithData(data, sizeof(data)); ASSERT_FALSE(buf.IsNull()); - EXPECT_TRUE(HandleIndicationReceived(connObj, &uuidSvc, &uuidChar2, std::move(buf))); + EXPECT_TRUE(HandleIndicationReceived(connObj, &CHIP_BLE_SVC_ID, &CHIP_BLE_CHAR_2_UUID, std::move(buf))); } TEST_F(TestBleLayer, HandleIndicationConfirmationInvalidUUID) { auto connObj = GetConnectionObject(); EXPECT_FALSE(HandleIndicationConfirmation(connObj, &uuidZero, &uuidZero)); - EXPECT_FALSE(HandleIndicationConfirmation(connObj, &uuidSvc, &uuidChar1)); + EXPECT_FALSE(HandleIndicationConfirmation(connObj, &CHIP_BLE_SVC_ID, &CHIP_BLE_CHAR_1_UUID)); } TEST_F(TestBleLayer, HandleIndicationConfirmation) @@ -360,7 +352,7 @@ TEST_F(TestBleLayer, HandleIndicationConfirmation) auto connObj = GetConnectionObject(); ASSERT_TRUE(HandleWriteReceivedCapabilitiesRequest(connObj)); - EXPECT_TRUE(HandleIndicationConfirmation(connObj, &uuidSvc, &uuidChar2)); + EXPECT_TRUE(HandleIndicationConfirmation(connObj, &CHIP_BLE_SVC_ID, &CHIP_BLE_CHAR_2_UUID)); } TEST_F(TestBleLayer, HandleConnectionError) diff --git a/src/ble/tests/TestBleUUID.cpp b/src/ble/tests/TestBleUUID.cpp index 4dbc6dd4c0fcdb..445535594fae4b 100644 --- a/src/ble/tests/TestBleUUID.cpp +++ b/src/ble/tests/TestBleUUID.cpp @@ -34,6 +34,9 @@ using namespace chip::Ble; namespace { +constexpr ChipBleUUID expectedUUID = { { 0x00, 0x00, 0xFF, 0xF6, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, + 0xFB } }; + TEST(TestBleUUID, CheckUUIDsMatch_NULL) { // Test that NULL pointer UUIDs are not equal @@ -43,46 +46,36 @@ TEST(TestBleUUID, CheckUUIDsMatch_NULL) TEST(TestBleUUID, CheckStringToUUID_ChipUUID) { // Test positive scenario - CHIP Service UUID - ChipBleUUID uuid; - EXPECT_TRUE(StringToUUID("0000FFF6-0000-1000-8000-00805F9B34FB", uuid)); - EXPECT_TRUE(UUIDsMatch(&uuid, &CHIP_BLE_SVC_ID)); + ChipBleUUID uuid = StringToUUIDConstexpr("0000FFF6-0000-1000-8000-00805F9B34FB"); + EXPECT_TRUE(UUIDsMatch(&uuid, &expectedUUID)); } TEST(TestBleUUID, CheckStringToUUID_ChipUUID_RandomCase) { // Test that letter case doesn't matter - ChipBleUUID uuid; - EXPECT_TRUE(StringToUUID("0000FfF6-0000-1000-8000-00805f9B34Fb", uuid)); - EXPECT_TRUE(UUIDsMatch(&uuid, &CHIP_BLE_SVC_ID)); + ChipBleUUID uuid = StringToUUIDConstexpr("0000FfF6-0000-1000-8000-00805f9B34Fb"); + EXPECT_TRUE(UUIDsMatch(&uuid, &expectedUUID)); } TEST(TestBleUUID, CheckStringToUUID_ChipUUID_NoSeparators) { // Test that separators don't matter - ChipBleUUID uuid; - EXPECT_TRUE(StringToUUID("0000FFF600001000800000805F9B34FB", uuid)); - EXPECT_TRUE(UUIDsMatch(&uuid, &CHIP_BLE_SVC_ID)); + ChipBleUUID uuid = StringToUUIDConstexpr("0000FFF600001000800000805F9B34FB"); + EXPECT_TRUE(UUIDsMatch(&uuid, &expectedUUID)); } TEST(TestBleUUID, CheckStringToUUID_TooLong) { // Test that even one more digit is too much - ChipBleUUID uuid; - EXPECT_FALSE(StringToUUID("0000FFF600001000800000805F9B34FB0", uuid)); -} - -TEST(TestBleUUID, CheckStringToUUID_TooShort) -{ - // Test that even one less digit is too little - ChipBleUUID uuid; - EXPECT_FALSE(StringToUUID("0000FFF600001000800000805F9B34F", uuid)); + auto result = StringToUUID("0000FFF600001000800000805F9B34FB0"); + EXPECT_FALSE(result.first); } TEST(TestBleUUID, CheckStringToUUID_InvalidChar) { // Test that non-hex digits don't pass - ChipBleUUID uuid; - EXPECT_FALSE(StringToUUID("0000GFF6-0000-1000-8000-00805F9B34FB0", uuid)); + auto result = StringToUUID("0000GFF6-0000-1000-8000-00805F9B34FB"); + EXPECT_FALSE(result.first); } } // namespace diff --git a/src/platform/Linux/bluez/BluezConnection.cpp b/src/platform/Linux/bluez/BluezConnection.cpp index eeb1e7fb8f1343..6ed15b5bb7cb45 100644 --- a/src/platform/Linux/bluez/BluezConnection.cpp +++ b/src/platform/Linux/bluez/BluezConnection.cpp @@ -94,7 +94,7 @@ CHIP_ERROR BluezConnection::Init(const BluezEndpoint & aEndpoint) if (service != nullptr) { if ((BluezIsServiceOnDevice(service, mDevice.get())) == TRUE && - (strcmp(bluez_gatt_service1_get_uuid(service), CHIP_BLE_UUID_SERVICE_STRING) == 0)) + (strcmp(bluez_gatt_service1_get_uuid(service), Ble::CHIP_BLE_SERVICE_LONG_UUID_STR) == 0)) { mService.reset(service); break; @@ -111,18 +111,18 @@ CHIP_ERROR BluezConnection::Init(const BluezEndpoint & aEndpoint) if (char1 != nullptr) { if ((BluezIsCharOnService(char1, mService.get()) == TRUE) && - (strcmp(bluez_gatt_characteristic1_get_uuid(char1), CHIP_PLAT_BLE_UUID_C1_STRING) == 0)) + (strcmp(bluez_gatt_characteristic1_get_uuid(char1), Ble::CHIP_BLE_CHAR_1_UUID_STR) == 0)) { mC1.reset(char1); } else if ((BluezIsCharOnService(char1, mService.get()) == TRUE) && - (strcmp(bluez_gatt_characteristic1_get_uuid(char1), CHIP_PLAT_BLE_UUID_C2_STRING) == 0)) + (strcmp(bluez_gatt_characteristic1_get_uuid(char1), Ble::CHIP_BLE_CHAR_2_UUID_STR) == 0)) { mC2.reset(char1); } #if CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING else if ((BluezIsCharOnService(char1, mService.get()) == TRUE) && - (strcmp(bluez_gatt_characteristic1_get_uuid(char1), CHIP_PLAT_BLE_UUID_C3_STRING) == 0)) + (strcmp(bluez_gatt_characteristic1_get_uuid(char1), Ble::CHIP_BLE_CHAR_3_UUID_STR) == 0)) { mC3.reset(char1); } diff --git a/src/platform/Linux/bluez/BluezEndpoint.cpp b/src/platform/Linux/bluez/BluezEndpoint.cpp index 151c09e09f662d..55b127e1b17014 100644 --- a/src/platform/Linux/bluez/BluezEndpoint.cpp +++ b/src/platform/Linux/bluez/BluezEndpoint.cpp @@ -438,10 +438,10 @@ void BluezEndpoint::SetupGattService() static const char * const c3_flags[] = { "read", nullptr }; #endif - mService.reset(CreateGattService(CHIP_BLE_UUID_SERVICE_SHORT_STRING)); + mService.reset(CreateGattService(Ble::CHIP_BLE_SERVICE_SHORT_UUID_STR)); // C1 characteristic - mC1.reset(CreateGattCharacteristic(mService.get(), "c1", CHIP_PLAT_BLE_UUID_C1_STRING, c1_flags)); + mC1.reset(CreateGattCharacteristic(mService.get(), "c1", Ble::CHIP_BLE_CHAR_1_UUID_STR, c1_flags)); g_signal_connect(mC1.get(), "handle-read-value", G_CALLBACK(+[](BluezGattCharacteristic1 * aChar, GDBusMethodInvocation * aInv, GVariant * aOpt, BluezEndpoint * self) { return self->BluezCharacteristicReadValue(aChar, aInv, aOpt); }), @@ -455,7 +455,7 @@ void BluezEndpoint::SetupGattService() g_signal_connect(mC1.get(), "handle-confirm", G_CALLBACK(BluezCharacteristicConfirmError), nullptr); // C2 characteristic - mC2.reset(CreateGattCharacteristic(mService.get(), "c2", CHIP_PLAT_BLE_UUID_C2_STRING, c2_flags)); + mC2.reset(CreateGattCharacteristic(mService.get(), "c2", Ble::CHIP_BLE_CHAR_2_UUID_STR, c2_flags)); g_signal_connect(mC2.get(), "handle-read-value", G_CALLBACK(+[](BluezGattCharacteristic1 * aChar, GDBusMethodInvocation * aInv, GVariant * aOpt, BluezEndpoint * self) { return self->BluezCharacteristicReadValue(aChar, aInv, aOpt); }), @@ -478,7 +478,7 @@ void BluezEndpoint::SetupGattService() #if CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING ChipLogDetail(DeviceLayer, "CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING is TRUE"); // Additional data characteristics - mC3.reset(CreateGattCharacteristic(mService.get(), "c3", CHIP_PLAT_BLE_UUID_C3_STRING, c3_flags)); + mC3.reset(CreateGattCharacteristic(mService.get(), "c3", Ble::CHIP_BLE_CHAR_3_UUID_STR, c3_flags)); g_signal_connect(mC3.get(), "handle-read-value", G_CALLBACK(+[](BluezGattCharacteristic1 * aChar, GDBusMethodInvocation * aInv, GVariant * aOpt, BluezEndpoint * self) { return self->BluezCharacteristicReadValue(aChar, aInv, aOpt); }), diff --git a/src/platform/Linux/bluez/ChipDeviceScanner.cpp b/src/platform/Linux/bluez/ChipDeviceScanner.cpp index dcb113b7f479c9..3323f1e7da57af 100644 --- a/src/platform/Linux/bluez/ChipDeviceScanner.cpp +++ b/src/platform/Linux/bluez/ChipDeviceScanner.cpp @@ -42,7 +42,7 @@ bool BluezGetChipDeviceInfo(BluezDevice1 & aDevice, chip::Ble::ChipBLEDeviceIden GVariant * serviceData = bluez_device1_get_service_data(&aDevice); VerifyOrReturnError(serviceData != nullptr, false); - GAutoPtr dataValue(g_variant_lookup_value(serviceData, CHIP_BLE_UUID_SERVICE_STRING, nullptr)); + GAutoPtr dataValue(g_variant_lookup_value(serviceData, Ble::CHIP_BLE_SERVICE_LONG_UUID_STR, nullptr)); VerifyOrReturnError(dataValue != nullptr, false); size_t dataLen = 0; diff --git a/src/platform/Linux/bluez/Types.h b/src/platform/Linux/bluez/Types.h index 95fd669efc1226..4bd2c89d9a7966 100644 --- a/src/platform/Linux/bluez/Types.h +++ b/src/platform/Linux/bluez/Types.h @@ -110,18 +110,6 @@ namespace Internal { #define ADVERTISING_INTERFACE BLUEZ_INTERFACE ".LEAdvertisement1" #define DEVICE_INTERFACE BLUEZ_INTERFACE ".Device1" -#define CHIP_PLAT_BLE_UUID_C1_STRING "18ee2ef5-263d-4559-959f-4f9c429f9d11" -#define CHIP_PLAT_BLE_UUID_C2_STRING "18ee2ef5-263d-4559-959f-4f9c429f9d12" -#define CHIP_PLAT_BLE_UUID_C3_STRING "64630238-8772-45F2-B87D-748A83218F04" - -#define CHIP_BLE_BASE_SERVICE_UUID_STRING "-0000-1000-8000-00805f9b34fb" -#define CHIP_BLE_SERVICE_PREFIX_LENGTH 8 -#define CHIP_BLE_BASE_SERVICE_PREFIX "0000" -#define CHIP_BLE_UUID_SERVICE_SHORT_STRING "fff6" - -#define CHIP_BLE_UUID_SERVICE_STRING \ - CHIP_BLE_BASE_SERVICE_PREFIX CHIP_BLE_UUID_SERVICE_SHORT_STRING CHIP_BLE_BASE_SERVICE_UUID_STRING - #define BLUEZ_ADV_TYPE_FLAGS 0x01 #define BLUEZ_ADV_TYPE_SERVICE_DATA 0x16 diff --git a/src/platform/Tizen/BLEManagerImpl.cpp b/src/platform/Tizen/BLEManagerImpl.cpp index a78efd9c944cce..944447d2e759df 100644 --- a/src/platform/Tizen/BLEManagerImpl.cpp +++ b/src/platform/Tizen/BLEManagerImpl.cpp @@ -74,14 +74,6 @@ namespace Internal { namespace { -/* CHIPoBLE UUID strings */ -constexpr char chip_ble_service_uuid[] = "0000FFF6-0000-1000-8000-00805F9B34FB"; -constexpr char chip_ble_char_c1_tx_uuid[] = "18EE2EF5-263D-4559-959F-4F9C429F9D11"; -constexpr char chip_ble_char_c2_rx_uuid[] = "18EE2EF5-263D-4559-959F-4F9C429F9D12"; - -constexpr char chip_ble_desc_uuid_short[] = "2902"; -constexpr char chip_ble_service_uuid_short[] = "FFF6"; - constexpr System::Clock::Timeout kNewConnectionScanTimeout = System::Clock::Seconds16(20); constexpr System::Clock::Timeout kConnectTimeout = System::Clock::Seconds16(20); constexpr System::Clock::Timeout kFastAdvertiseTimeout = @@ -582,12 +574,12 @@ CHIP_ERROR BLEManagerImpl::RegisterGATTServer() VerifyOrExit(ret == BT_ERROR_NONE, ChipLogError(DeviceLayer, "bt_gatt_server_create() failed: %s", get_error_message(ret))); // Create Service (BTP Service) - ret = bt_gatt_service_create(chip_ble_service_uuid, BT_GATT_SERVICE_TYPE_PRIMARY, &service); + ret = bt_gatt_service_create(Ble::CHIP_BLE_SERVICE_LONG_UUID_STR, BT_GATT_SERVICE_TYPE_PRIMARY, &service); VerifyOrExit(ret == BT_ERROR_NONE, ChipLogError(DeviceLayer, "bt_gatt_service_create() failed: %s", get_error_message(ret))); // Create 1st Characteristic (Client TX Buffer) ret = bt_gatt_characteristic_create( - chip_ble_char_c1_tx_uuid, BT_GATT_PERMISSION_WRITE, + Ble::CHIP_BLE_CHAR_1_UUID_STR, BT_GATT_PERMISSION_WRITE, BT_GATT_PROPERTY_WRITE, // Write Request is not coming if we use WITHOUT_RESPONSE property. Let's use WRITE property and // consider to use WITHOUT_RESPONSE property in the future according to the CHIP Spec 4.16.3.2. BTP // GATT Service @@ -611,7 +603,7 @@ CHIP_ERROR BLEManagerImpl::RegisterGATTServer() ChipLogError(DeviceLayer, "bt_gatt_service_add_characteristic() failed: %s", get_error_message(ret))); // Create 2nd Characteristic (Client RX Buffer) - ret = bt_gatt_characteristic_create(chip_ble_char_c2_rx_uuid, BT_GATT_PERMISSION_READ, + ret = bt_gatt_characteristic_create(Ble::CHIP_BLE_CHAR_2_UUID_STR, BT_GATT_PERMISSION_READ, BT_GATT_PROPERTY_READ | BT_GATT_PROPERTY_INDICATE, "CHIPoBLE_C2", strlen("CHIPoBLE_C2"), &char2); VerifyOrExit(ret == BT_ERROR_NONE, @@ -637,8 +629,8 @@ CHIP_ERROR BLEManagerImpl::RegisterGATTServer() get_error_message(ret))); // Create CCC Descriptor - ret = bt_gatt_descriptor_create(chip_ble_desc_uuid_short, BT_GATT_PERMISSION_READ | BT_GATT_PERMISSION_WRITE, desc_value, - sizeof(desc_value), &desc); + ret = bt_gatt_descriptor_create(Ble::CHIP_BLE_DESC_SHORT_UUID_STR, BT_GATT_PERMISSION_READ | BT_GATT_PERMISSION_WRITE, + desc_value, sizeof(desc_value), &desc); VerifyOrExit(ret == BT_ERROR_NONE, ChipLogError(DeviceLayer, "bt_gatt_descriptor_create() failed: %s", get_error_message(ret))); ret = bt_gatt_characteristic_add_descriptor(char2, desc); VerifyOrExit(ret == BT_ERROR_NONE, @@ -711,7 +703,8 @@ CHIP_ERROR BLEManagerImpl::StartBLEAdvertising() VerifyOrExit(err == CHIP_NO_ERROR, ChipLogError(DeviceLayer, "GetBLEDeviceIdentificationInfo() failed: %" CHIP_ERROR_FORMAT, err.Format())); - ret = bt_adapter_le_add_advertising_service_data(mAdvertiser, BT_ADAPTER_LE_PACKET_ADVERTISING, chip_ble_service_uuid_short, + ret = bt_adapter_le_add_advertising_service_data(mAdvertiser, BT_ADAPTER_LE_PACKET_ADVERTISING, + Ble::CHIP_BLE_SERVICE_SHORT_UUID_STR, reinterpret_cast(&deviceIdInfo), sizeof(deviceIdInfo)); VerifyOrExit(ret == BT_ERROR_NONE, ChipLogError(DeviceLayer, "bt_adapter_le_add_advertising_service_data() failed: %s", get_error_message(ret))); @@ -779,12 +772,12 @@ static bool __GattClientForeachCharCb(int total, int index, bt_gatt_h charHandle VerifyOrExit(ret == BT_ERROR_NONE, ChipLogError(DeviceLayer, "Failed to fetch GATT Attribute from CHAR handle: %s", get_error_message(ret))); - if (strcasecmp(uuid.get(), chip_ble_char_c1_tx_uuid) == 0) + if (strcasecmp(uuid.get(), Ble::CHIP_BLE_CHAR_1_UUID_STR) == 0) { ChipLogProgress(DeviceLayer, "CHIP Char C1 TX Found [%s]", StringOrNullMarker(uuid.get())); conn->gattCharC1Handle = charHandle; } - else if (strcasecmp(uuid.get(), chip_ble_char_c2_rx_uuid) == 0) + else if (strcasecmp(uuid.get(), Ble::CHIP_BLE_CHAR_2_UUID_STR) == 0) { ChipLogProgress(DeviceLayer, "CHIP Char C2 RX Found [%s]", StringOrNullMarker(uuid.get())); conn->gattCharC2Handle = charHandle; @@ -806,7 +799,7 @@ static bool __GattClientForeachServiceCb(int total, int index, bt_gatt_h svcHand VerifyOrExit(ret == BT_ERROR_NONE, ChipLogError(DeviceLayer, "Failed to fetch GATT Attribute from SVC handle: %s", get_error_message(ret))); - if (strcasecmp(uuid.get(), chip_ble_service_uuid) == 0) + if (strcasecmp(uuid.get(), chip::Ble::CHIP_BLE_SERVICE_LONG_UUID_STR) == 0) { ChipLogProgress(DeviceLayer, "CHIP Service UUID Found [%s]", StringOrNullMarker(uuid.get())); @@ -1142,36 +1135,21 @@ void BLEManagerImpl::HandlePlatformSpecificBLEEvent(const ChipDeviceEvent * apEv } break; case DeviceEventType::kPlatformTizenBLEWriteComplete: { - Ble::ChipBleUUID service_uuid; - Ble::ChipBleUUID char_write_uuid; - - StringToUUID(chip_ble_service_uuid, service_uuid); - StringToUUID(chip_ble_char_c1_tx_uuid, char_write_uuid); - - HandleWriteConfirmation(apEvent->Platform.BLEWriteComplete.mConnection, &service_uuid, &char_write_uuid); + HandleWriteConfirmation(apEvent->Platform.BLEWriteComplete.mConnection, &Ble::CHIP_BLE_SVC_ID, &Ble::CHIP_BLE_CHAR_1_UUID); break; } case DeviceEventType::kPlatformTizenBLESubscribeOpComplete: { - Ble::ChipBleUUID service_uuid; - Ble::ChipBleUUID char_notif_uuid; - - StringToUUID(chip_ble_service_uuid, service_uuid); - StringToUUID(chip_ble_char_c2_rx_uuid, char_notif_uuid); - if (apEvent->Platform.BLESubscribeOpComplete.mIsSubscribed) - HandleSubscribeComplete(apEvent->Platform.BLESubscribeOpComplete.mConnection, &service_uuid, &char_notif_uuid); + HandleSubscribeComplete(apEvent->Platform.BLESubscribeOpComplete.mConnection, &Ble::CHIP_BLE_SVC_ID, + &chip::Ble::CHIP_BLE_CHAR_2_UUID); else - HandleUnsubscribeComplete(apEvent->Platform.BLESubscribeOpComplete.mConnection, &service_uuid, &char_notif_uuid); + HandleUnsubscribeComplete(apEvent->Platform.BLESubscribeOpComplete.mConnection, &Ble::CHIP_BLE_SVC_ID, + &chip::Ble::CHIP_BLE_CHAR_2_UUID); break; } case DeviceEventType::kPlatformTizenBLEIndicationReceived: { - Ble::ChipBleUUID service_uuid; - Ble::ChipBleUUID char_notif_uuid; - - StringToUUID(chip_ble_service_uuid, service_uuid); - StringToUUID(chip_ble_char_c2_rx_uuid, char_notif_uuid); - - HandleIndicationReceived(apEvent->Platform.BLEIndicationReceived.mConnection, &service_uuid, &char_notif_uuid, + HandleIndicationReceived(apEvent->Platform.BLEIndicationReceived.mConnection, &Ble::CHIP_BLE_SVC_ID, + &chip::Ble::CHIP_BLE_CHAR_2_UUID, System::PacketBufferHandle::Adopt(apEvent->Platform.BLEIndicationReceived.mData)); break; } @@ -1182,43 +1160,29 @@ void BLEManagerImpl::HandlePlatformSpecificBLEEvent(const ChipDeviceEvent * apEv void BLEManagerImpl::_OnPlatformEvent(const ChipDeviceEvent * event) { - Ble::ChipBleUUID service_uuid; - Ble::ChipBleUUID char_notification_uuid; - Ble::ChipBleUUID char_write_uuid; - switch (event->Type) { case DeviceEventType::kCHIPoBLESubscribe: ChipLogProgress(DeviceLayer, "CHIPoBLESubscribe"); - StringToUUID(chip_ble_service_uuid, service_uuid); - StringToUUID(chip_ble_char_c2_rx_uuid, char_notification_uuid); - - HandleSubscribeReceived(event->CHIPoBLESubscribe.ConId, &service_uuid, &char_notification_uuid); + HandleSubscribeReceived(event->CHIPoBLESubscribe.ConId, &Ble::CHIP_BLE_SVC_ID, &Ble::CHIP_BLE_CHAR_2_UUID); NotifyBLEConnectionEstablished(event->CHIPoBLESubscribe.ConId, CHIP_NO_ERROR); break; case DeviceEventType::kCHIPoBLEUnsubscribe: ChipLogProgress(DeviceLayer, "CHIPoBLEUnsubscribe"); - StringToUUID(chip_ble_service_uuid, service_uuid); - StringToUUID(chip_ble_char_c2_rx_uuid, char_notification_uuid); - - HandleUnsubscribeReceived(event->CHIPoBLESubscribe.ConId, &service_uuid, &char_notification_uuid); + HandleUnsubscribeReceived(event->CHIPoBLESubscribe.ConId, &Ble::CHIP_BLE_SVC_ID, &Ble::CHIP_BLE_CHAR_2_UUID); break; case DeviceEventType::kCHIPoBLEWriteReceived: ChipLogProgress(DeviceLayer, "CHIPoBLEWriteReceived"); - StringToUUID(chip_ble_service_uuid, service_uuid); - StringToUUID(chip_ble_char_c1_tx_uuid, char_write_uuid); - HandleWriteReceived(event->CHIPoBLEWriteReceived.ConId, &service_uuid, &char_write_uuid, + HandleWriteReceived(event->CHIPoBLEWriteReceived.ConId, &Ble::CHIP_BLE_SVC_ID, &Ble::CHIP_BLE_CHAR_1_UUID, System::PacketBufferHandle::Adopt(event->CHIPoBLEWriteReceived.Data)); break; case DeviceEventType::kCHIPoBLEIndicateConfirm: ChipLogProgress(DeviceLayer, "CHIPoBLEIndicateConfirm"); - StringToUUID(chip_ble_service_uuid, service_uuid); - StringToUUID(chip_ble_char_c2_rx_uuid, char_notification_uuid); - HandleIndicationConfirmation(event->CHIPoBLEIndicateConfirm.ConId, &service_uuid, &char_notification_uuid); + HandleIndicationConfirmation(event->CHIPoBLEIndicateConfirm.ConId, &Ble::CHIP_BLE_SVC_ID, &Ble::CHIP_BLE_CHAR_2_UUID); break; case DeviceEventType::kCHIPoBLEConnectionError: ChipLogProgress(DeviceLayer, "CHIPoBLEConnectionError"); @@ -1241,19 +1205,14 @@ uint16_t BLEManagerImpl::GetMTU(BLE_CONNECTION_OBJECT conId) const bool BLEManagerImpl::SubscribeCharacteristic(BLE_CONNECTION_OBJECT conId, const Ble::ChipBleUUID * svcId, const Ble::ChipBleUUID * charId) { - Ble::ChipBleUUID service_uuid; - Ble::ChipBleUUID char_notif_uuid; int ret; ChipLogProgress(DeviceLayer, "SubscribeCharacteristic"); - StringToUUID(chip_ble_service_uuid, service_uuid); - StringToUUID(chip_ble_char_c2_rx_uuid, char_notif_uuid); - VerifyOrExit(conId != nullptr, ChipLogError(DeviceLayer, "Invalid Connection")); - VerifyOrExit(Ble::UUIDsMatch(svcId, &service_uuid), + VerifyOrExit(Ble::UUIDsMatch(svcId, &Ble::CHIP_BLE_SVC_ID), ChipLogError(DeviceLayer, "SubscribeCharacteristic() called with invalid service ID")); - VerifyOrExit(Ble::UUIDsMatch(charId, &char_notif_uuid), + VerifyOrExit(Ble::UUIDsMatch(charId, &Ble::CHIP_BLE_CHAR_2_UUID), ChipLogError(DeviceLayer, "SubscribeCharacteristic() called with invalid characteristic ID")); VerifyOrExit(conId->gattCharC2Handle != nullptr, ChipLogError(DeviceLayer, "Char C2 is null")); @@ -1274,19 +1233,14 @@ bool BLEManagerImpl::SubscribeCharacteristic(BLE_CONNECTION_OBJECT conId, const bool BLEManagerImpl::UnsubscribeCharacteristic(BLE_CONNECTION_OBJECT conId, const Ble::ChipBleUUID * svcId, const Ble::ChipBleUUID * charId) { - Ble::ChipBleUUID service_uuid; - Ble::ChipBleUUID char_notif_uuid; int ret; ChipLogProgress(DeviceLayer, "UnSubscribeCharacteristic"); - StringToUUID(chip_ble_service_uuid, service_uuid); - StringToUUID(chip_ble_char_c2_rx_uuid, char_notif_uuid); - VerifyOrExit(conId != nullptr, ChipLogError(DeviceLayer, "Invalid Connection")); - VerifyOrExit(Ble::UUIDsMatch(svcId, &service_uuid), + VerifyOrExit(Ble::UUIDsMatch(svcId, &Ble::CHIP_BLE_SVC_ID), ChipLogError(DeviceLayer, "UnSubscribeCharacteristic() called with invalid service ID")); - VerifyOrExit(Ble::UUIDsMatch(charId, &char_notif_uuid), + VerifyOrExit(Ble::UUIDsMatch(charId, &Ble::CHIP_BLE_CHAR_2_UUID), ChipLogError(DeviceLayer, "UnSubscribeCharacteristic() called with invalid characteristic ID")); VerifyOrExit(conId->gattCharC2Handle != nullptr, ChipLogError(DeviceLayer, "Char C2 is null")); @@ -1360,19 +1314,14 @@ bool BLEManagerImpl::SendIndication(BLE_CONNECTION_OBJECT conId, const Ble::Chip bool BLEManagerImpl::SendWriteRequest(BLE_CONNECTION_OBJECT conId, const Ble::ChipBleUUID * svcId, const Ble::ChipBleUUID * charId, System::PacketBufferHandle pBuf) { - Ble::ChipBleUUID service_uuid; - Ble::ChipBleUUID char_write_uuid; int ret; ChipLogProgress(DeviceLayer, "SendWriteRequest"); - StringToUUID(chip_ble_service_uuid, service_uuid); - StringToUUID(chip_ble_char_c1_tx_uuid, char_write_uuid); - VerifyOrExit(conId != nullptr, ChipLogError(DeviceLayer, "Invalid Connection")); - VerifyOrExit(Ble::UUIDsMatch(svcId, &service_uuid), + VerifyOrExit(Ble::UUIDsMatch(svcId, &Ble::CHIP_BLE_SVC_ID), ChipLogError(DeviceLayer, "SendWriteRequest() called with invalid service ID")); - VerifyOrExit(Ble::UUIDsMatch(charId, &char_write_uuid), + VerifyOrExit(Ble::UUIDsMatch(charId, &Ble::CHIP_BLE_CHAR_1_UUID), ChipLogError(DeviceLayer, "SendWriteRequest() called with invalid characteristic ID")); VerifyOrExit(conId->gattCharC1Handle != nullptr, ChipLogError(DeviceLayer, "Char C1 is null")); @@ -1455,7 +1404,7 @@ void BLEManagerImpl::InitiateScan(BleScanState scanType) } /* Send StartChipScan Request to Scanner Class */ - strcpy(data.service_uuid, chip_ble_service_uuid_short); + strcpy(data.service_uuid, Ble::CHIP_BLE_DESC_SHORT_UUID_STR); err = mDeviceScanner->StartChipScan(kNewConnectionScanTimeout, ScanFilterType::kServiceData, data); VerifyOrExit(err == CHIP_NO_ERROR, ChipLogError(DeviceLayer, "Failed to start BLE scan")); diff --git a/src/platform/Tizen/ChipDeviceScanner.cpp b/src/platform/Tizen/ChipDeviceScanner.cpp index aea5aabd7d0799..2b022f537d79b9 100644 --- a/src/platform/Tizen/ChipDeviceScanner.cpp +++ b/src/platform/Tizen/ChipDeviceScanner.cpp @@ -30,6 +30,7 @@ #include #include +#include #include #include #include @@ -40,10 +41,6 @@ namespace chip { namespace DeviceLayer { namespace Internal { -// CHIPoBLE UUID strings -const char chip_service_uuid[] = "0000FFF6-0000-1000-8000-00805F9B34FB"; -const char chip_service_uuid_short[] = "FFF6"; - ChipDeviceScanner::ChipDeviceScanner(ChipDeviceScannerDelegate * delegate) : mDelegate(delegate) {} ChipDeviceScanner::~ChipDeviceScanner() @@ -100,8 +97,8 @@ static bool __IsChipThingDevice(bt_adapter_le_device_scan_result_info_s * info, { for (int i = 0; i < count; i++) { - if (g_strcmp0(dataList[i].service_uuid, chip_service_uuid) == 0 || - g_strcmp0(dataList[i].service_uuid, chip_service_uuid_short) == 0) + if (g_strcmp0(dataList[i].service_uuid, chip::Ble::CHIP_BLE_CHAR_1_UUID_STR) == 0 || + g_strcmp0(dataList[i].service_uuid, chip::Ble::CHIP_BLE_SERVICE_SHORT_UUID_STR) == 0) { ChipLogProgress(DeviceLayer, "CHIP Thing Device Found! [Service Data UUID] = %s", dataList[i].service_uuid); // Print full Service Data From 17c5a0029e5a374be3c21ec4bf9ab22d5ff7710b Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Thu, 30 May 2024 22:41:35 +0200 Subject: [PATCH 34/43] [Python] Remove obsolete callback handling (#33665) The Call() function currently still has some callback handling code the completeEvent and callbackRes variables. These are only used when callbacks are in play, like pychip_DeviceController_Commission or pychip_DeviceController_OpenCommissioningWindow. When calling these functions CallAsyncWithCompleteCallback() needs to be used (and is beeing used in all cases). In practice, on single threaded applications this is not a problem. However, when calling the SDK from multiple threads, then another Call() Might accidentally release a call to CallAsyncWithCompleteCallback() early. --- src/controller/python/chip/ChipStack.py | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/src/controller/python/chip/ChipStack.py b/src/controller/python/chip/ChipStack.py index 35f9e24ef4db25..3a167bb6bc0a7a 100644 --- a/src/controller/python/chip/ChipStack.py +++ b/src/controller/python/chip/ChipStack.py @@ -32,8 +32,7 @@ import os import sys import time -from ctypes import (CFUNCTYPE, POINTER, Structure, c_bool, c_char_p, c_int64, c_uint8, c_uint16, c_uint32, c_ulong, c_void_p, - py_object, pythonapi) +from ctypes import CFUNCTYPE, Structure, c_bool, c_char_p, c_int64, c_uint8, c_uint16, c_uint32, c_void_p, py_object, pythonapi from threading import Condition, Event, Lock import chip.native @@ -194,9 +193,6 @@ def __call__(self): pythonapi.Py_DecRef(py_object(self)) -_CompleteFunct = CFUNCTYPE(None, c_void_p, c_void_p) -_ErrorFunct = CFUNCTYPE(None, c_void_p, c_void_p, - c_ulong, POINTER(DeviceStatusStruct)) _LogMessageFunct = CFUNCTYPE( None, c_int64, c_int64, c_char_p, c_uint8, c_char_p) _ChipThreadTaskRunnerFunct = CFUNCTYPE(None, py_object) @@ -272,21 +268,11 @@ def __init__(self, persistentStoragePath: str, installDefaultLogHandler=True, self.logger.addHandler(logHandler) self.logger.setLevel(logging.DEBUG) - def HandleComplete(appState, reqState): - self.callbackRes = True - self.completeEvent.set() - - def HandleError(appState, reqState, err, devStatusPtr): - self.callbackRes = self.ErrorToException(err, devStatusPtr) - self.completeEvent.set() - @_ChipThreadTaskRunnerFunct def HandleChipThreadRun(callback): callback() self.cbHandleChipThreadRun = HandleChipThreadRun - self.cbHandleComplete = _CompleteFunct(HandleComplete) - self.cbHandleError = _ErrorFunct(HandleError) # set by other modules(BLE) that require service by thread while thread blocks. self.blockingCB = None @@ -389,15 +375,9 @@ def Call(self, callFunct, timeoutMs: int = None): This function is a wrapper of PostTaskOnChipThread, which includes some handling of application specific logics. Calling this function on CHIP on CHIP mainloop thread will cause deadlock. ''' - # throw error if op in progress - self.callbackRes = None - self.completeEvent.clear() # TODO: Lock probably no longer necessary, see https://github.com/project-chip/connectedhomeip/issues/33321. with self.networkLock: res = self.PostTaskOnChipThread(callFunct).Wait(timeoutMs) - self.completeEvent.set() - if res == 0 and self.callbackRes is not None: - return self.callbackRes return res async def CallAsync(self, callFunct, timeoutMs: int = None): From 452cad3a36197d299660adb6b50d7a89041c7657 Mon Sep 17 00:00:00 2001 From: yunhanw-google Date: Thu, 30 May 2024 15:42:19 -0700 Subject: [PATCH 35/43] [chip-tool][ICD]Remove icd entry in icd client storage after unregisterClient in ICDManagemenet is triggered (#33671) * Remove icd entry in icd client storage after unregisterClient is triggered * Restyled by clang-format * address comments * Update ModelCommand.cpp * Restyled by clang-format --------- Co-authored-by: Restyled.io --- .../chip-tool/commands/clusters/ClusterCommand.h | 16 +++++++++++++++- .../chip-tool/commands/clusters/ModelCommand.cpp | 9 +++++++++ .../chip-tool/commands/clusters/ModelCommand.h | 2 ++ .../commands/clusters/ModelCommand.cpp | 5 +++++ 4 files changed, 31 insertions(+), 1 deletion(-) diff --git a/examples/chip-tool/commands/clusters/ClusterCommand.h b/examples/chip-tool/commands/clusters/ClusterCommand.h index 792588a886dffb..171c664481c9dd 100644 --- a/examples/chip-tool/commands/clusters/ClusterCommand.h +++ b/examples/chip-tool/commands/clusters/ClusterCommand.h @@ -55,6 +55,15 @@ class ClusterCommand : public InteractionModelCommands, public ModelCommand, pub return InteractionModelCommands::SendCommand(device, endpointId, clusterId, commandId, value); } + CHIP_ERROR SendCommand(chip::DeviceProxy * device, chip::EndpointId endpointId, chip::ClusterId clusterId, + chip::CommandId commandId, + const chip::app::Clusters::IcdManagement::Commands::UnregisterClient::Type & value) + { + ReturnErrorOnFailure(InteractionModelCommands::SendCommand(device, endpointId, clusterId, commandId, value)); + mScopedNodeId = chip::ScopedNodeId(value.checkInNodeID, device->GetSecureSession().Value()->GetFabricIndex()); + return CHIP_NO_ERROR; + } + CHIP_ERROR SendCommand(chip::DeviceProxy * device, chip::EndpointId endpointId, chip::ClusterId clusterId, chip::CommandId commandId, const chip::app::Clusters::DiagnosticLogs::Commands::RetrieveLogsRequest::Type & value) @@ -109,6 +118,11 @@ class ClusterCommand : public InteractionModelCommands, public ModelCommand, pub return; } } + if ((path.mEndpointId == chip::kRootEndpointId) && (path.mClusterId == chip::app::Clusters::IcdManagement::Id) && + (path.mCommandId == chip::app::Clusters::IcdManagement::Commands::UnregisterClient::Id)) + { + ModelCommand::ClearICDEntry(mScopedNodeId); + } } virtual void OnError(const chip::app::CommandSender * client, CHIP_ERROR error) override @@ -208,7 +222,7 @@ class ClusterCommand : public InteractionModelCommands, public ModelCommand, pub private: chip::ClusterId mClusterId; chip::CommandId mCommandId; - + chip::ScopedNodeId mScopedNodeId; CHIP_ERROR mError = CHIP_NO_ERROR; CustomArgument mPayload; }; diff --git a/examples/chip-tool/commands/clusters/ModelCommand.cpp b/examples/chip-tool/commands/clusters/ModelCommand.cpp index 94b2b36c5538a3..2a549e62d4668b 100644 --- a/examples/chip-tool/commands/clusters/ModelCommand.cpp +++ b/examples/chip-tool/commands/clusters/ModelCommand.cpp @@ -76,6 +76,15 @@ void ModelCommand::Shutdown() CHIPCommand::Shutdown(); } +void ModelCommand::ClearICDEntry(const chip::ScopedNodeId & nodeId) +{ + CHIP_ERROR deleteEntryError = CHIPCommand::sICDClientStorage.DeleteEntry(nodeId); + if (deleteEntryError != CHIP_NO_ERROR) + { + ChipLogError(chipTool, "Failed to delete ICD entry: %" CHIP_ERROR_FORMAT, deleteEntryError.Format()); + } +} + void ModelCommand::CheckPeerICDType() { if (mIsPeerLIT.HasValue()) diff --git a/examples/chip-tool/commands/clusters/ModelCommand.h b/examples/chip-tool/commands/clusters/ModelCommand.h index d4e8eac613f468..79c31cf865930d 100644 --- a/examples/chip-tool/commands/clusters/ModelCommand.h +++ b/examples/chip-tool/commands/clusters/ModelCommand.h @@ -67,6 +67,8 @@ class ModelCommand : public CHIPCommand virtual CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) { return CHIP_ERROR_BAD_REQUEST; }; + virtual void ClearICDEntry(const chip::ScopedNodeId & nodeId); + void Shutdown() override; protected: diff --git a/examples/tv-casting-app/tv-casting-common/commands/clusters/ModelCommand.cpp b/examples/tv-casting-app/tv-casting-common/commands/clusters/ModelCommand.cpp index 1210af574603f4..dafa11f2381fed 100644 --- a/examples/tv-casting-app/tv-casting-common/commands/clusters/ModelCommand.cpp +++ b/examples/tv-casting-app/tv-casting-common/commands/clusters/ModelCommand.cpp @@ -82,6 +82,11 @@ void ModelCommand::Shutdown() mOnDeviceConnectionFailureCallback.Cancel(); } +void ModelCommand::ClearICDEntry(const chip::ScopedNodeId & nodeId) +{ + ChipLogError(chipTool, "ClearICDEntry is not implemented in tv-casting-app"); +} + bool ModelCommand::IsPeerLIT() { // Does not support tv-casting-app From 55012bfe697b147677b841052ce7a6a3d3b12733 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 30 May 2024 19:34:18 -0400 Subject: [PATCH 36/43] Stop using human-readable release names in Darwin availability.yaml. (#33677) People are making assumptions based on those, and those assumptions will come back to bite them. Just switch to using UUIDs for the release names. --- .../CHIP/templates/MTRBaseClusters-src.zapt | 8 +-- .../CHIP/templates/MTRBaseClusters.zapt | 42 ++++++++-------- .../CHIP/templates/MTRClusterConstants.zapt | 50 +++++++++---------- .../CHIP/templates/MTRClusters-src.zapt | 6 +-- .../Framework/CHIP/templates/MTRClusters.zapt | 22 ++++---- .../templates/MTRCommandPayloadsObjc-src.zapt | 6 +-- .../templates/MTRCommandPayloadsObjc.zapt | 4 +- .../CHIP/templates/availability.yaml | 18 +++---- 8 files changed, 78 insertions(+), 78 deletions(-) diff --git a/src/darwin/Framework/CHIP/templates/MTRBaseClusters-src.zapt b/src/darwin/Framework/CHIP/templates/MTRBaseClusters-src.zapt index 9d6e786ce03149..0b8529b9c566c5 100644 --- a/src/darwin/Framework/CHIP/templates/MTRBaseClusters-src.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRBaseClusters-src.zapt @@ -116,7 +116,7 @@ MTR{{cluster}}Cluster{{command}}Params {{! This is used as the implementation for both the new-name and old-name bits, so check for both here. }} {{#if (or (isSupported (asUpperCamelCase parent.name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true)) (and (isSupported (compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name)) - (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name))))}} + (wasIntroducedBeforeRelease "267F4B03-3256-4056-A62D-5237640FDCFE" (compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name))))}} {{#*inline "attribute"}}Attribute{{asUpperCamelCase name preserveAcronyms=true}}{{/inline}} - (void)read{{>attribute}}With {{~#if_is_fabric_scoped_struct type~}} @@ -223,7 +223,7 @@ reportHandler:(void (^)({{asObjectiveCClass type parent.name}} * _Nullable value {{/if}} {{/unless}} -{{#if (and (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping name)) +{{#if (and (wasIntroducedBeforeRelease "267F4B03-3256-4056-A62D-5237640FDCFE" (compatClusterNameRemapping name)) (isSupported (compatClusterNameRemapping name)))}} @implementation MTRBaseCluster{{compatClusterNameRemapping name}} (Deprecated) @@ -231,7 +231,7 @@ reportHandler:(void (^)({{asObjectiveCClass type parent.name}} * _Nullable value {{#if (is_str_equal source 'client')}} {{! Takes two arguments: cluster name and command name, plus the ambient state where the command is "this" }} {{#*inline "commandImpl"}} -{{#if (and (wasIntroducedBeforeRelease "First major API revamp" cluster command=command) +{{#if (and (wasIntroducedBeforeRelease "267F4B03-3256-4056-A62D-5237640FDCFE" cluster command=command) (isSupported cluster command=command))}} - (void){{asLowerCamelCase command}}WithParams:(MTR{{cluster}}Cluster{{command}}Params * {{#unless commandHasRequiredField}}_Nullable{{/unless}})params completionHandler:({{>command_completion_type command=. compatRemapNames=true}})completionHandler { @@ -268,7 +268,7 @@ reportHandler:(void (^)({{asObjectiveCClass type parent.name}} * _Nullable value {{/zcl_commands}} {{#zcl_attributes_server removeKeys='isOptional'}} -{{#if (and (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name)) +{{#if (and (wasIntroducedBeforeRelease "267F4B03-3256-4056-A62D-5237640FDCFE" (compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name)) (isSupported (compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name)))}} {{#*inline "attribute"}}Attribute{{compatAttributeNameRemapping parent.name name}}{{/inline}} - (void)read{{>attribute}}With diff --git a/src/darwin/Framework/CHIP/templates/MTRBaseClusters.zapt b/src/darwin/Framework/CHIP/templates/MTRBaseClusters.zapt index 7488fda7019126..35d09c0f916431 100644 --- a/src/darwin/Framework/CHIP/templates/MTRBaseClusters.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRBaseClusters.zapt @@ -29,20 +29,20 @@ NS_ASSUME_NONNULL_BEGIN * * {{description}} */ -- (void){{asLowerCamelCase name}}WithParams:(MTR{{cluster}}Cluster{{command}}Params * {{#unless commandHasRequiredField }}_Nullable{{/unless}})params completion:({{>command_completion_type command=.}})completion {{availability cluster command=command minimalRelease="First major API revamp"}}; +- (void){{asLowerCamelCase name}}WithParams:(MTR{{cluster}}Cluster{{command}}Params * {{#unless commandHasRequiredField }}_Nullable{{/unless}})params completion:({{>command_completion_type command=.}})completion {{availability cluster command=command minimalRelease="267F4B03-3256-4056-A62D-5237640FDCFE"}}; {{#unless commandHasRequiredField}} - (void){{asLowerCamelCase name}}WithCompletion:({{>command_completion_type command=.}})completion {{! KeySetReadAllIndices grew this params-less API later _after_ it had already been shipped, so it needs to be special-cased here }} {{#if (and (isStrEqual command "KeySetReadAllIndices") (isStrEqual cluster "GroupKeyManagement"))}} -{{availability cluster command=command minimalRelease="Fall 2023"}}; +{{availability cluster command=command minimalRelease="3C23F160-13CE-4397-BC65-122B61E4D691"}}; {{else}} {{#if (isInConfigList (concat (asUpperCamelCase cluster preserveAcronyms=true) "::" (asUpperCamelCase command preserveAcronyms=true)) "LegacyCommandsWithOnlyOptionalArguments")}} -{{availability cluster command=command minimalRelease="Early 2024"}}; +{{availability cluster command=command minimalRelease="ADDB2DC1-4701-4696-87EB-87CD1123BE1A"}}; {{else}} -{{availability cluster command=command minimalRelease="First major API revamp"}}; +{{availability cluster command=command minimalRelease="267F4B03-3256-4056-A62D-5237640FDCFE"}}; {{/if}} {{/if}} {{/unless}} @@ -62,16 +62,16 @@ NS_ASSUME_NONNULL_BEGIN {{~else~}} Completion: {{~/if_is_fabric_scoped_struct~}} -(void (^)({{asObjectiveCClass type parent.name}} * _Nullable value, NSError * _Nullable error))completion {{availability (asUpperCamelCase parent.name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true) minimalRelease="First major API revamp"}}; +(void (^)({{asObjectiveCClass type parent.name}} * _Nullable value, NSError * _Nullable error))completion {{availability (asUpperCamelCase parent.name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true) minimalRelease="267F4B03-3256-4056-A62D-5237640FDCFE"}}; {{#if (or isWritableAttribute (isInConfigList (concat (asUpperCamelCase parent.name) "::" label) "DarwinForceWritable"))}} -- (void)write{{>attribute}}WithValue:({{asObjectiveCType type parent.name}})value completion:(MTRStatusCompletion)completion {{availability (asUpperCamelCase parent.name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true) minimalRelease="First major API revamp"}}; -- (void)write{{>attribute}}WithValue:({{asObjectiveCType type parent.name}})value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion {{availability (asUpperCamelCase parent.name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true) minimalRelease="First major API revamp"}}; +- (void)write{{>attribute}}WithValue:({{asObjectiveCType type parent.name}})value completion:(MTRStatusCompletion)completion {{availability (asUpperCamelCase parent.name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true) minimalRelease="267F4B03-3256-4056-A62D-5237640FDCFE"}}; +- (void)write{{>attribute}}WithValue:({{asObjectiveCType type parent.name}})value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion {{availability (asUpperCamelCase parent.name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true) minimalRelease="267F4B03-3256-4056-A62D-5237640FDCFE"}}; {{/if}} {{#if isReportableAttribute}} - (void) subscribe{{>attribute}}WithParams:(MTRSubscribeParams *)params -subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished reportHandler:(void (^)({{asObjectiveCClass type parent.name}} * _Nullable value, NSError * _Nullable error))reportHandler {{availability (asUpperCamelCase parent.name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true) minimalRelease="First major API revamp"}}; -+ (void) read{{>attribute}}WithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)({{asObjectiveCClass type parent.name}} * _Nullable value, NSError * _Nullable error))completion {{availability (asUpperCamelCase parent.name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true) minimalRelease="First major API revamp"}}; +subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished reportHandler:(void (^)({{asObjectiveCClass type parent.name}} * _Nullable value, NSError * _Nullable error))reportHandler {{availability (asUpperCamelCase parent.name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true) minimalRelease="267F4B03-3256-4056-A62D-5237640FDCFE"}}; ++ (void) read{{>attribute}}WithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)({{asObjectiveCClass type parent.name}} * _Nullable value, NSError * _Nullable error))completion {{availability (asUpperCamelCase parent.name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true) minimalRelease="267F4B03-3256-4056-A62D-5237640FDCFE"}}; {{/if}} {{/if}} {{/zcl_attributes_server}} @@ -89,7 +89,7 @@ subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptio */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID - queue:(dispatch_queue_t)queue {{availability (asUpperCamelCase name preserveAcronyms=true) minimalRelease="First major API revamp"}}; + queue:(dispatch_queue_t)queue {{availability (asUpperCamelCase name preserveAcronyms=true) minimalRelease="267F4B03-3256-4056-A62D-5237640FDCFE"}}; @end {{/if}} @@ -207,22 +207,22 @@ typedef NS_OPTIONS({{asUnderlyingZclType name}}, {{objCEnumName clusterName bitm {{/zcl_clusters}} {{#zcl_clusters}} -{{#if (and (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping name)) +{{#if (and (wasIntroducedBeforeRelease "267F4B03-3256-4056-A62D-5237640FDCFE" (compatClusterNameRemapping name)) (isSupported (compatClusterNameRemapping name)))}} @interface MTRBaseCluster{{compatClusterNameRemapping name}} (Deprecated) - (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint - queue:(dispatch_queue_t)queue {{availability (compatClusterNameRemapping name) deprecatedRelease="First major API revamp" deprecationMessage="Please use initWithDevice:endpointID:queue:"}}; + queue:(dispatch_queue_t)queue {{availability (compatClusterNameRemapping name) deprecatedRelease="267F4B03-3256-4056-A62D-5237640FDCFE" deprecationMessage="Please use initWithDevice:endpointID:queue:"}}; {{#zcl_commands}} {{#if (is_str_equal source 'client')}} {{! Takes two arguments: cluster name and command name, plus the ambient state where the command is "this" }} {{#*inline "commandDecl"}} -{{#if (and (wasIntroducedBeforeRelease "First major API revamp" cluster command=command) +{{#if (and (wasIntroducedBeforeRelease "267F4B03-3256-4056-A62D-5237640FDCFE" cluster command=command) (isSupported cluster command=command))}} - (void){{asLowerCamelCase command}}WithParams:(MTR{{cluster}}Cluster{{command}}Params * {{#unless commandHasRequiredField }}_Nullable{{/unless}})params completionHandler:({{>command_completion_type command=. compatRemapNames=true}})completionHandler - {{availability cluster command=command deprecatedRelease="First major API revamp" deprecationMessage=(concat "Please use " (asLowerCamelCase name) "WithParams:completion:")}}; + {{availability cluster command=command deprecatedRelease="267F4B03-3256-4056-A62D-5237640FDCFE" deprecationMessage=(concat "Please use " (asLowerCamelCase name) "WithParams:completion:")}}; {{#unless commandHasRequiredField}} {{! No need for these backwards-compat APIs for commands that never shipped them. }} {{#unless (isInConfigList @@ -232,7 +232,7 @@ typedef NS_OPTIONS({{asUnderlyingZclType name}}, {{objCEnumName clusterName bitm {{#unless (and (isStrEqual cluster "GroupKeyManagement") (isStrEqual command "KeySetReadAllIndices"))}} - (void){{asLowerCamelCase command}}WithCompletionHandler:({{>command_completion_type command=. compatRemapNames=true}})completionHandler - {{availability cluster command=command deprecatedRelease="First major API revamp" deprecationMessage=(concat "Please use " (asLowerCamelCase name) "WithCompletion:")}}; + {{availability cluster command=command deprecatedRelease="267F4B03-3256-4056-A62D-5237640FDCFE" deprecationMessage=(concat "Please use " (asLowerCamelCase name) "WithCompletion:")}}; {{/unless}} {{/unless}} {{/unless}} @@ -244,7 +244,7 @@ typedef NS_OPTIONS({{asUnderlyingZclType name}}, {{objCEnumName clusterName bitm {{/zcl_commands}} {{#zcl_attributes_server removeKeys='isOptional'}} -{{#if (and (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name)) +{{#if (and (wasIntroducedBeforeRelease "267F4B03-3256-4056-A62D-5237640FDCFE" (compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name)) (isSupported (compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name)))}} {{#*inline "attribute"}}Attribute{{compatAttributeNameRemapping parent.name name}}{{/inline}} - (void)read{{>attribute}}With @@ -253,17 +253,17 @@ typedef NS_OPTIONS({{asUnderlyingZclType name}}, {{objCEnumName clusterName bitm {{~else~}} CompletionHandler: {{~/if_is_fabric_scoped_struct~}} -(void (^)({{asObjectiveCClass type parent.name compatRemapClusterName=true}} * _Nullable value, NSError * _Nullable error))completionHandler {{availability (compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name) deprecatedRelease="First major API revamp" fabricScopedDeprecationMessage=(concat "Please use readAttribute" (asUpperCamelCase name preserveAcronyms=true) "WithParams:completion:") nonFabricScopedDeprecationMessage=(concat "Please use readAttribute" (asUpperCamelCase name preserveAcronyms=true) "WithCompletion:") type=type}}; +(void (^)({{asObjectiveCClass type parent.name compatRemapClusterName=true}} * _Nullable value, NSError * _Nullable error))completionHandler {{availability (compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name) deprecatedRelease="267F4B03-3256-4056-A62D-5237640FDCFE" fabricScopedDeprecationMessage=(concat "Please use readAttribute" (asUpperCamelCase name preserveAcronyms=true) "WithParams:completion:") nonFabricScopedDeprecationMessage=(concat "Please use readAttribute" (asUpperCamelCase name preserveAcronyms=true) "WithCompletion:") type=type}}; {{#if (or isWritableAttribute (isInConfigList (concat (asUpperCamelCase parent.name) "::" label) "DarwinForceWritable"))}} -- (void)write{{>attribute}}WithValue:({{asObjectiveCType type parent.name compatRemapClusterName=true}})value completionHandler:(MTRStatusCompletion)completionHandler {{availability (compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name) deprecatedRelease="First major API revamp" deprecationMessage=(concat "Please use writeAttribute" (asUpperCamelCase name preserveAcronyms=true) "WithValue:completion:")}}; -- (void)write{{>attribute}}WithValue:({{asObjectiveCType type parent.name compatRemapClusterName=true}})value params:(MTRWriteParams * _Nullable)params completionHandler:(MTRStatusCompletion)completionHandler {{availability (compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name) deprecatedRelease="First major API revamp" deprecationMessage=(concat "Please use writeAttribute" (asUpperCamelCase name preserveAcronyms=true) "WithValue:params:completion:")}}; +- (void)write{{>attribute}}WithValue:({{asObjectiveCType type parent.name compatRemapClusterName=true}})value completionHandler:(MTRStatusCompletion)completionHandler {{availability (compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name) deprecatedRelease="267F4B03-3256-4056-A62D-5237640FDCFE" deprecationMessage=(concat "Please use writeAttribute" (asUpperCamelCase name preserveAcronyms=true) "WithValue:completion:")}}; +- (void)write{{>attribute}}WithValue:({{asObjectiveCType type parent.name compatRemapClusterName=true}})value params:(MTRWriteParams * _Nullable)params completionHandler:(MTRStatusCompletion)completionHandler {{availability (compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name) deprecatedRelease="267F4B03-3256-4056-A62D-5237640FDCFE" deprecationMessage=(concat "Please use writeAttribute" (asUpperCamelCase name preserveAcronyms=true) "WithValue:params:completion:")}}; {{/if}} {{#if isReportableAttribute}} - (void) subscribe{{>attribute}}WithMinInterval:(NSNumber * _Nonnull)minInterval maxInterval:(NSNumber * _Nonnull)maxInterval params:(MTRSubscribeParams * _Nullable)params -subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler reportHandler:(void (^)({{asObjectiveCClass type parent.name compatRemapClusterName=true}} * _Nullable value, NSError * _Nullable error))reportHandler {{availability (compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name) deprecatedRelease="First major API revamp" deprecationMessage=(concat "Please use subscribeAttribute" (asUpperCamelCase name preserveAcronyms=true) "WithParams:subscriptionEstablished:")}}; -+ (void) read{{>attribute}}WithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completionHandler:(void (^)({{asObjectiveCClass type parent.name compatRemapClusterName=true}} * _Nullable value, NSError * _Nullable error))completionHandler {{availability (compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name) deprecatedRelease="First major API revamp" deprecationMessage=(concat "Please use readAttribute" (asUpperCamelCase name preserveAcronyms=true) "WithAttributeCache:endpoint:queue:completion:")}}; +subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler reportHandler:(void (^)({{asObjectiveCClass type parent.name compatRemapClusterName=true}} * _Nullable value, NSError * _Nullable error))reportHandler {{availability (compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name) deprecatedRelease="267F4B03-3256-4056-A62D-5237640FDCFE" deprecationMessage=(concat "Please use subscribeAttribute" (asUpperCamelCase name preserveAcronyms=true) "WithParams:subscriptionEstablished:")}}; ++ (void) read{{>attribute}}WithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completionHandler:(void (^)({{asObjectiveCClass type parent.name compatRemapClusterName=true}} * _Nullable value, NSError * _Nullable error))completionHandler {{availability (compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name) deprecatedRelease="267F4B03-3256-4056-A62D-5237640FDCFE" deprecationMessage=(concat "Please use readAttribute" (asUpperCamelCase name preserveAcronyms=true) "WithAttributeCache:endpoint:queue:completion:")}}; {{/if}} {{/if}} {{/zcl_attributes_server}} diff --git a/src/darwin/Framework/CHIP/templates/MTRClusterConstants.zapt b/src/darwin/Framework/CHIP/templates/MTRClusterConstants.zapt index ba2e57a45bc491..98d6d6b35431b1 100644 --- a/src/darwin/Framework/CHIP/templates/MTRClusterConstants.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRClusterConstants.zapt @@ -7,15 +7,15 @@ typedef NS_ENUM(uint32_t, MTRClusterIDType) { {{#zcl_clusters}} -{{#if (and (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping name) isForIds=true) +{{#if (and (wasIntroducedBeforeRelease "267F4B03-3256-4056-A62D-5237640FDCFE" (compatClusterNameRemapping name) isForIds=true) (isSupported (compatClusterNameRemapping name) isForIds=true))}} -MTRCluster{{compatClusterNameRemapping label}}ID {{availability (compatClusterNameRemapping name) deprecatedRelease="First major API revamp" deprecationMessage=(concat "Please use MTRClusterIDType" (asUpperCamelCase label preserveAcronyms=true) "ID") isForIds=true}} = {{asMEI manufacturerCode code}}, +MTRCluster{{compatClusterNameRemapping label}}ID {{availability (compatClusterNameRemapping name) deprecatedRelease="267F4B03-3256-4056-A62D-5237640FDCFE" deprecationMessage=(concat "Please use MTRClusterIDType" (asUpperCamelCase label preserveAcronyms=true) "ID") isForIds=true}} = {{asMEI manufacturerCode code}}, {{/if}} {{/zcl_clusters}} {{#zcl_clusters}} {{#if (isSupported (asUpperCamelCase label preserveAcronyms=true) isForIds=true)}} {{~#*inline "cluster"}}{{asUpperCamelCase label preserveAcronyms=true}}{{/inline~}} -MTRClusterIDType{{>cluster}}ID {{availability (asUpperCamelCase label preserveAcronyms=true) minimalRelease="First major API revamp" isForIds=true deprecationMessage=(concat "The " (asUpperCamelCase label preserveAcronyms=true) " cluster will be removed")}} = {{asMEI manufacturerCode code}}, +MTRClusterIDType{{>cluster}}ID {{availability (asUpperCamelCase label preserveAcronyms=true) minimalRelease="267F4B03-3256-4056-A62D-5237640FDCFE" isForIds=true deprecationMessage=(concat "The " (asUpperCamelCase label preserveAcronyms=true) " cluster will be removed")}} = {{asMEI manufacturerCode code}}, {{/if}} {{/zcl_clusters}} }; @@ -26,7 +26,7 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { // Deprecated global attribute names {{#zcl_attributes_server}} {{#unless clusterRef}} -{{#if (wasIntroducedBeforeRelease "First major API revamp" "" globalAttribute=(asUpperCamelCase label) isForIds=true)}} +{{#if (wasIntroducedBeforeRelease "267F4B03-3256-4056-A62D-5237640FDCFE" "" globalAttribute=(asUpperCamelCase label) isForIds=true)}} MTRClusterGlobalAttribute{{asUpperCamelCase label}}ID {{availability "" api="Deprecated global attribute names" deprecationMessage=(concat "Please use MTRAttributeIDTypeGlobalAttribute" (asUpperCamelCase label) "ID") isForIds=true}} = {{asMEI manufacturerCode code}}, @@ -39,7 +39,7 @@ MTRClusterGlobalAttribute{{asUpperCamelCase label}}ID {{~#*inline "attribute"}}{{asUpperCamelCase label preserveAcronyms=true}}{{/inline~}} {{#unless clusterRef}} {{#if (isSupported "" globalAttribute=(asUpperCamelCase label preserveAcronyms=true) isForIds=true)}} -MTRAttributeIDTypeGlobalAttribute{{>attribute}}ID {{availability "" globalAttribute=(asUpperCamelCase label preserveAcronyms=true) minimalRelease="First major API revamp" isForIds=true}} = {{asMEI manufacturerCode code}}, +MTRAttributeIDTypeGlobalAttribute{{>attribute}}ID {{availability "" globalAttribute=(asUpperCamelCase label preserveAcronyms=true) minimalRelease="267F4B03-3256-4056-A62D-5237640FDCFE" isForIds=true}} = {{asMEI manufacturerCode code}}, {{/if}} {{/unless}} {{/zcl_attributes_server}} @@ -48,7 +48,7 @@ MTRAttributeIDTypeGlobalAttribute{{>attribute}}ID {{availability "" globalAttrib {{#*inline "attributeIDs"}} {{#zcl_attributes_server}} {{#first}} -{{#if (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping ../clusterName) isForIds=true)}} +{{#if (wasIntroducedBeforeRelease "267F4B03-3256-4056-A62D-5237640FDCFE" (compatClusterNameRemapping ../clusterName) isForIds=true)}} {{#if (isSupported (compatClusterNameRemapping ../clusterName) isForIds=true)}} // Cluster {{compatClusterNameRemapping ../clusterName}} deprecated attribute names {{/if}} @@ -60,14 +60,14 @@ MTRAttributeIDTypeGlobalAttribute{{>attribute}}ID {{availability "" globalAttrib {{#if (isStrEqual (asUpperCamelCase ../clusterName) "Descriptor")}} {{#if (isStrEqual (asUpperCamelCase label) "DeviceTypeList")}} MTRClusterDescriptorAttributeDeviceTypeListID -{{availability "Descriptor" attribute="DeviceTypeList" deprecatedRelease="First major API revamp" deprecationMessage="Please use MTRAttributeIDTypeClusterDescriptorAttributeDeviceTypeListID" isForIds=true}} +{{availability "Descriptor" attribute="DeviceTypeList" deprecatedRelease="267F4B03-3256-4056-A62D-5237640FDCFE" deprecationMessage="Please use MTRAttributeIDTypeClusterDescriptorAttributeDeviceTypeListID" isForIds=true}} = {{asMEI manufacturerCode code}}, {{/if}} {{/if}} -{{#if (and (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping ../clusterName) attribute=(compatAttributeNameRemapping ../clusterName label) isForIds=true) +{{#if (and (wasIntroducedBeforeRelease "267F4B03-3256-4056-A62D-5237640FDCFE" (compatClusterNameRemapping ../clusterName) attribute=(compatAttributeNameRemapping ../clusterName label) isForIds=true) (isSupported (compatClusterNameRemapping ../clusterName) attribute=(compatAttributeNameRemapping ../clusterName label) isForIds=true))}} MTRCluster{{compatClusterNameRemapping ../clusterName}}Attribute{{compatAttributeNameRemapping ../clusterName label}}ID -{{availability (compatClusterNameRemapping ../clusterName) attribute=(compatAttributeNameRemapping ../clusterName label) deprecatedRelease="First major API revamp" deprecationMessage=(concat "Please use MTRAttributeIDTypeCluster" (asUpperCamelCase ../clusterName preserveAcronyms=true) "Attribute" (asUpperCamelCase label preserveAcronyms=true) "ID") isForIds=true}} = +{{availability (compatClusterNameRemapping ../clusterName) attribute=(compatAttributeNameRemapping ../clusterName label) deprecatedRelease="267F4B03-3256-4056-A62D-5237640FDCFE" deprecationMessage=(concat "Please use MTRAttributeIDTypeCluster" (asUpperCamelCase ../clusterName preserveAcronyms=true) "Attribute" (asUpperCamelCase label preserveAcronyms=true) "ID") isForIds=true}} = {{#if clusterRef}} {{asMEI manufacturerCode code}}, {{else}} @@ -89,20 +89,20 @@ MTRClusterGlobalAttribute{{asUpperCamelCase label}}ID, {{#if (and (isSupported (asUpperCamelCase ../clusterName preserveAcronyms=true) attribute=(asUpperCamelCase label preserveAcronyms=true) isForIds=true) (or clusterRef (isSupported "" globalAttribute=(asUpperCamelCase label preserveAcronyms=true) isForIds=true)))}} -MTRAttributeIDTypeCluster{{>cluster}}Attribute{{>attribute}}ID {{availability (asUpperCamelCase ../clusterName preserveAcronyms=true) attribute=(asUpperCamelCase label preserveAcronyms=true) minimalRelease="First major API revamp" isForIds=true deprecationMessage=(concat "The " (asUpperCamelCase label preserveAcronyms=true) " attribute will be removed")}} = +MTRAttributeIDTypeCluster{{>cluster}}Attribute{{>attribute}}ID {{availability (asUpperCamelCase ../clusterName preserveAcronyms=true) attribute=(asUpperCamelCase label preserveAcronyms=true) minimalRelease="267F4B03-3256-4056-A62D-5237640FDCFE" isForIds=true deprecationMessage=(concat "The " (asUpperCamelCase label preserveAcronyms=true) " attribute will be removed")}} = {{#if clusterRef}} {{asMEI manufacturerCode code}}, {{else}} MTRAttributeIDTypeGlobalAttribute{{asUpperCamelCase label}}ID, {{/if}} {{/if}} -{{! Anything which has an old name, and the new name was introduced in the "First after major API revamp" release or later - (or just after the "First major API revamp" release, but we don't have a good way to test for that), +{{! Anything which has an old name, and the new name was introduced in the "27C5E231-9EB5-4932-B4C1-10D88419D9CB" release or later + (or just after the "267F4B03-3256-4056-A62D-5237640FDCFE" release, but we don't have a good way to test for that), we need to generate the new-form id for the old name too, as long as it was not removed. }} {{#if (and (hasOldName (asUpperCamelCase ../clusterName preserveAcronyms=true) attribute=(asUpperCamelCase label preserveAcronyms=true) isForIds=true) - (not (wasIntroducedBeforeRelease "First after major API revamp" (asUpperCamelCase ../clusterName preserveAcronyms=true) attribute=(asUpperCamelCase label preserveAcronyms=true) isForIds=true)) + (not (wasIntroducedBeforeRelease "27C5E231-9EB5-4932-B4C1-10D88419D9CB" (asUpperCamelCase ../clusterName preserveAcronyms=true) attribute=(asUpperCamelCase label preserveAcronyms=true) isForIds=true)) (isSupported (compatClusterNameRemapping ../clusterName) attribute=(compatAttributeNameRemapping ../clusterName label) isForIds=true))}} -MTRAttributeIDTypeCluster{{compatClusterNameRemapping ../clusterName}}Attribute{{compatAttributeNameRemapping ../clusterName label}}ID {{availability (compatClusterNameRemapping ../clusterName) attribute=(compatAttributeNameRemapping ../clusterName label) isForIds=true minimalRelease="First major API revamp" deprecationMessage=(concat "Please use MTRAttributeIDType" (asUpperCamelCase ../clusterName preserveAcronyms=true) "Attribute" (asUpperCamelCase label preserveAcronyms=true) "ID")}} = MTRAttributeIDTypeCluster{{>cluster}}Attribute{{>attribute}}ID, +MTRAttributeIDTypeCluster{{compatClusterNameRemapping ../clusterName}}Attribute{{compatAttributeNameRemapping ../clusterName label}}ID {{availability (compatClusterNameRemapping ../clusterName) attribute=(compatAttributeNameRemapping ../clusterName label) isForIds=true minimalRelease="267F4B03-3256-4056-A62D-5237640FDCFE" deprecationMessage=(concat "Please use MTRAttributeIDType" (asUpperCamelCase ../clusterName preserveAcronyms=true) "Attribute" (asUpperCamelCase label preserveAcronyms=true) "ID")}} = MTRAttributeIDTypeCluster{{>cluster}}Attribute{{>attribute}}ID, {{/if}} {{#last}} @@ -121,7 +121,7 @@ typedef NS_ENUM(uint32_t, MTRCommandIDType) { {{#*inline "commandIDs"}} {{#zcl_commands}} {{#first}} -{{#if (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping ../clusterName) isForIds=true)}} +{{#if (wasIntroducedBeforeRelease "267F4B03-3256-4056-A62D-5237640FDCFE" (compatClusterNameRemapping ../clusterName) isForIds=true)}} {{#if (isSupported (compatClusterNameRemapping ../clusterName) isForIds=true)}} // Cluster {{compatClusterNameRemapping ../clusterName}} deprecated command id names {{/if}} @@ -129,10 +129,10 @@ typedef NS_ENUM(uint32_t, MTRCommandIDType) { {{/first}} {{! Takes two arguments: cluster name and command name, plus the ambient state where the command is "this" }} {{#*inline "commandIdDecl"}} -{{#if (and (wasIntroducedBeforeRelease "First major API revamp" cluster command=command isForIds=true) +{{#if (and (wasIntroducedBeforeRelease "267F4B03-3256-4056-A62D-5237640FDCFE" cluster command=command isForIds=true) (isSupported cluster command=command isForIds=true))}} MTRCluster{{cluster}}Command{{command}}ID -{{availability cluster command=command deprecatedRelease="First major API revamp" deprecationMessage=(concat "Please use MTRCommandIDTypeCluster" (asUpperCamelCase ../clusterName preserveAcronyms=true) "Command" (asUpperCamelCase name preserveAcronyms=true) "ID") isForIds=true}} +{{availability cluster command=command deprecatedRelease="267F4B03-3256-4056-A62D-5237640FDCFE" deprecationMessage=(concat "Please use MTRCommandIDTypeCluster" (asUpperCamelCase ../clusterName preserveAcronyms=true) "Command" (asUpperCamelCase name preserveAcronyms=true) "ID") isForIds=true}} = {{asMEI manufacturerCode code}}, {{/if}} {{/inline}} @@ -152,16 +152,16 @@ MTRCluster{{cluster}}Command{{command}}ID {{! Takes two arguments: cluster name and command name, plus the ambient state where the command is "this" }} {{#*inline "commandIdDecl"}} {{#if (isSupported cluster command=command isForIds=true)}} -MTRCommandIDTypeCluster{{cluster}}Command{{command}}ID {{availability cluster command=command minimalRelease="First major API revamp" isForIds=true deprecationMessage=(concat "The " command " command will be removed")}} = {{asMEI manufacturerCode code}}, +MTRCommandIDTypeCluster{{cluster}}Command{{command}}ID {{availability cluster command=command minimalRelease="267F4B03-3256-4056-A62D-5237640FDCFE" isForIds=true deprecationMessage=(concat "The " command " command will be removed")}} = {{asMEI manufacturerCode code}}, {{/if}} {{/inline}} {{> commandIdDecl cluster=(asUpperCamelCase ../clusterName preserveAcronyms=true) command=(asUpperCamelCase name preserveAcronyms=true)}} -{{! Anything which has an old name, and the new name was introduced in the "First after major API revamp" release or later - (or just after the "First major API revamp" release, but we don't have a good way to test for that), +{{! Anything which has an old name, and the new name was introduced in the "27C5E231-9EB5-4932-B4C1-10D88419D9CB" release or later + (or just after the "267F4B03-3256-4056-A62D-5237640FDCFE" release, but we don't have a good way to test for that), we need to generate the new-form id for the old name too, as long as it was not removed. }} {{#if (and (hasOldName (asUpperCamelCase ../clusterName preserveAcronyms=true) command=(asUpperCamelCase name preserveAcronyms=true) isForIds=true) - (not (wasIntroducedBeforeRelease "First after major API revamp" (asUpperCamelCase ../clusterName preserveAcronyms=true) command=(asUpperCamelCase name preserveAcronyms=true) isForIds=true)) + (not (wasIntroducedBeforeRelease "27C5E231-9EB5-4932-B4C1-10D88419D9CB" (asUpperCamelCase ../clusterName preserveAcronyms=true) command=(asUpperCamelCase name preserveAcronyms=true) isForIds=true)) (isSupported (compatClusterNameRemapping ../clusterName) command=(compatCommandNameRemapping ../clusterName name) isForIds=true))}} {{> commandIdDecl cluster=(compatClusterNameRemapping ../clusterName) command=(compatCommandNameRemapping ../clusterName name)}} @@ -183,16 +183,16 @@ typedef NS_ENUM(uint32_t, MTREventIDType) { {{#*inline "eventIDs"}} {{#zcl_events}} {{#first}} -{{#if (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping ../clusterName) isForIds=true)}} +{{#if (wasIntroducedBeforeRelease "267F4B03-3256-4056-A62D-5237640FDCFE" (compatClusterNameRemapping ../clusterName) isForIds=true)}} {{#if (isSupported (compatClusterNameRemapping ../clusterName))}} // Cluster {{compatClusterNameRemapping ../clusterName}} deprecated event names {{/if}} {{/if}} {{/first}} -{{#if (and (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping ../clusterName) event=(asUpperCamelCase name) isForIds=true) +{{#if (and (wasIntroducedBeforeRelease "267F4B03-3256-4056-A62D-5237640FDCFE" (compatClusterNameRemapping ../clusterName) event=(asUpperCamelCase name) isForIds=true) (isSupported (compatClusterNameRemapping ../clusterName) event=(asUpperCamelCase name) isForIds=true))}} MTRCluster{{compatClusterNameRemapping ../clusterName}}Event{{asUpperCamelCase name}}ID -{{availability (compatClusterNameRemapping ../clusterName) event=(asUpperCamelCase name) deprecatedRelease="First major API revamp" deprecationMessage=(concat "Please use MTREventIDTypeCluster" (asUpperCamelCase ../clusterName preserveAcronyms=true) "Event" (asUpperCamelCase name preserveAcronyms=true) "ID") isForIds=true}} +{{availability (compatClusterNameRemapping ../clusterName) event=(asUpperCamelCase name) deprecatedRelease="267F4B03-3256-4056-A62D-5237640FDCFE" deprecationMessage=(concat "Please use MTREventIDTypeCluster" (asUpperCamelCase ../clusterName preserveAcronyms=true) "Event" (asUpperCamelCase name preserveAcronyms=true) "ID") isForIds=true}} = {{asMEI manufacturerCode code}}, {{/if}} {{#last}} @@ -208,7 +208,7 @@ MTRCluster{{compatClusterNameRemapping ../clusterName}}Event{{asUpperCamelCase n {{/if}} {{/first}} {{#if (isSupported (asUpperCamelCase ../clusterName preserveAcronyms=true) event=(asUpperCamelCase name preserveAcronyms=true) isForIds=true)}} -MTREventIDTypeCluster{{>cluster}}Event{{>event}}ID {{availability (asUpperCamelCase ../clusterName preserveAcronyms=true) event=(asUpperCamelCase name preserveAcronyms=true) minimalRelease="First major API revamp" isForIds=true}} = {{asMEI manufacturerCode code}}, +MTREventIDTypeCluster{{>cluster}}Event{{>event}}ID {{availability (asUpperCamelCase ../clusterName preserveAcronyms=true) event=(asUpperCamelCase name preserveAcronyms=true) minimalRelease="267F4B03-3256-4056-A62D-5237640FDCFE" isForIds=true}} = {{asMEI manufacturerCode code}}, {{/if}} {{#last}} diff --git a/src/darwin/Framework/CHIP/templates/MTRClusters-src.zapt b/src/darwin/Framework/CHIP/templates/MTRClusters-src.zapt index c42b95e71ef9b7..c73e8aeb70d023 100644 --- a/src/darwin/Framework/CHIP/templates/MTRClusters-src.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRClusters-src.zapt @@ -103,7 +103,7 @@ MTR{{cluster}}Cluster{{command}}Params (isSupported "" globalAttribute=(asUpperCamelCase label preserveAcronyms=true))) (or (isSupported (asUpperCamelCase parent.name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true)) (and (isSupported (compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name)) - (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name)))))}} + (wasIntroducedBeforeRelease "267F4B03-3256-4056-A62D-5237640FDCFE" (compatClusterNameRemapping parent.name) attribute=(compatAttributeNameRemapping parent.name name)))))}} {{#*inline "cluster"}}{{asUpperCamelCase parent.name preserveAcronyms=true}}{{/inline}} {{#*inline "attribute"}}Attribute{{asUpperCamelCase name preserveAcronyms=true}}{{/inline}} - (NSDictionary * _Nullable)read{{>attribute}}WithParams:(MTRReadParams * _Nullable)params { @@ -143,7 +143,7 @@ MTR{{cluster}}Cluster{{command}}Params {{/if}} {{/unless}} -{{#if (and (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping name)) +{{#if (and (wasIntroducedBeforeRelease "267F4B03-3256-4056-A62D-5237640FDCFE" (compatClusterNameRemapping name)) (isSupported (compatClusterNameRemapping name)))}} @implementation MTRCluster{{compatClusterNameRemapping name}} (Deprecated) @@ -156,7 +156,7 @@ MTR{{cluster}}Cluster{{command}}Params {{#if (is_str_equal source 'client')}} {{! Takes two arguments: cluster name and command name, plus the ambient state where the command is "this" }} {{#*inline "commandImpl"}} -{{#if (and (wasIntroducedBeforeRelease "First major API revamp" cluster command=command) +{{#if (and (wasIntroducedBeforeRelease "267F4B03-3256-4056-A62D-5237640FDCFE" cluster command=command) (isSupported cluster command=command))}} - (void){{asLowerCamelCase command}}WithParams:(MTR{{cluster}}Cluster{{command}}Params * {{#unless commandHasRequiredField}}_Nullable{{/unless}})params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completionHandler:({{>command_completion_type command=. compatRemapNames=true}})completionHandler { diff --git a/src/darwin/Framework/CHIP/templates/MTRClusters.zapt b/src/darwin/Framework/CHIP/templates/MTRClusters.zapt index 4ea998e04b6f86..ebcd299d0871f4 100644 --- a/src/darwin/Framework/CHIP/templates/MTRClusters.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRClusters.zapt @@ -24,20 +24,20 @@ NS_ASSUME_NONNULL_BEGIN {{! Takes two arguments: cluster name and command name, plus the ambient state where the command is "this" }} {{#*inline "commandDecl"}} {{#if (isSupported cluster command=command)}} -- (void){{asLowerCamelCase name}}WithParams:(MTR{{cluster}}Cluster{{command}}Params * {{#unless commandHasRequiredField}}_Nullable{{/unless}})params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:({{>command_completion_type command=.}})completion {{availability cluster command=command minimalRelease="First major API revamp"}}; +- (void){{asLowerCamelCase name}}WithParams:(MTR{{cluster}}Cluster{{command}}Params * {{#unless commandHasRequiredField}}_Nullable{{/unless}})params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:({{>command_completion_type command=.}})completion {{availability cluster command=command minimalRelease="267F4B03-3256-4056-A62D-5237640FDCFE"}}; {{#unless commandHasRequiredField}} - (void){{asLowerCamelCase name}}WithExpectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:({{>command_completion_type command=.}})completion {{! KeySetReadAllIndices grew this params-less API later _after_ it had already been shipped, so it needs to be special-cased here }} {{#if (and (isStrEqual command "KeySetReadAllIndices") (isStrEqual cluster "GroupKeyManagement"))}} -{{availability cluster command=command minimalRelease="Fall 2023"}}; +{{availability cluster command=command minimalRelease="3C23F160-13CE-4397-BC65-122B61E4D691"}}; {{else}} {{#if (isInConfigList (concat (asUpperCamelCase cluster preserveAcronyms=true) "::" (asUpperCamelCase command preserveAcronyms=true)) "LegacyCommandsWithOnlyOptionalArguments")}} -{{availability cluster command=command minimalRelease="Early 2024"}}; +{{availability cluster command=command minimalRelease="ADDB2DC1-4701-4696-87EB-87CD1123BE1A"}}; {{else}} -{{availability cluster command=command minimalRelease="First major API revamp"}}; +{{availability cluster command=command minimalRelease="267F4B03-3256-4056-A62D-5237640FDCFE"}}; {{/if}} {{/if}} {{/unless}} @@ -85,7 +85,7 @@ NS_ASSUME_NONNULL_BEGIN */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID - queue:(dispatch_queue_t)queue {{availability (asUpperCamelCase name preserveAcronyms=true) minimalRelease="First major API revamp"}}; + queue:(dispatch_queue_t)queue {{availability (asUpperCamelCase name preserveAcronyms=true) minimalRelease="267F4B03-3256-4056-A62D-5237640FDCFE"}}; @end @@ -104,21 +104,21 @@ NS_ASSUME_NONNULL_BEGIN {{/zcl_clusters}} {{#zcl_clusters}} -{{#if (and (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping name)) +{{#if (and (wasIntroducedBeforeRelease "267F4B03-3256-4056-A62D-5237640FDCFE" (compatClusterNameRemapping name)) (isSupported (compatClusterNameRemapping name)))}} @interface MTRCluster{{compatClusterNameRemapping name}} (Deprecated) - (nullable instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint - queue:(dispatch_queue_t)queue {{availability (compatClusterNameRemapping name) deprecatedRelease="First major API revamp" deprecationMessage="Please use initWithDevice:endpoindID:queue:"}}; + queue:(dispatch_queue_t)queue {{availability (compatClusterNameRemapping name) deprecatedRelease="267F4B03-3256-4056-A62D-5237640FDCFE" deprecationMessage="Please use initWithDevice:endpoindID:queue:"}}; {{#zcl_commands}} {{#if (is_str_equal source 'client')}} {{! Takes two arguments: cluster name and command name, plus the ambient state where the command is "this" }} {{#*inline "commandDecl"}} -{{#if (and (wasIntroducedBeforeRelease "First major API revamp" cluster command=command) +{{#if (and (wasIntroducedBeforeRelease "267F4B03-3256-4056-A62D-5237640FDCFE" cluster command=command) (isSupported cluster command=command))}} -- (void){{asLowerCamelCase command}}WithParams:(MTR{{cluster}}Cluster{{command}}Params * {{#unless commandHasRequiredField}}_Nullable{{/unless}})params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completionHandler:({{>command_completion_type command=. compatRemapNames=true}})completionHandler {{availability cluster command=command deprecatedRelease="First major API revamp" deprecationMessage=(concat "Please use " (asLowerCamelCase name) "WithParams:expectedValues:expectedValueInterval:completion:")}}; +- (void){{asLowerCamelCase command}}WithParams:(MTR{{cluster}}Cluster{{command}}Params * {{#unless commandHasRequiredField}}_Nullable{{/unless}})params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completionHandler:({{>command_completion_type command=. compatRemapNames=true}})completionHandler {{availability cluster command=command deprecatedRelease="267F4B03-3256-4056-A62D-5237640FDCFE" deprecationMessage=(concat "Please use " (asLowerCamelCase name) "WithParams:expectedValues:expectedValueInterval:completion:")}}; {{#unless commandHasRequiredField}} {{! No need for these backwards-compat APIs for commands that never shipped them. }} {{#unless (isInConfigList @@ -127,7 +127,7 @@ NS_ASSUME_NONNULL_BEGIN {{! KeySetReadAllIndices grew this params-less API later _after_ it had already been shipped, so it needs to be special-cased here }} {{#unless (and (isStrEqual cluster "GroupKeyManagement") (isStrEqual command "KeySetReadAllIndices"))}} -- (void){{asLowerCamelCase command}}WithExpectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completionHandler:({{>command_completion_type command=. compatRemapNames=true}})completionHandler {{availability cluster command=command deprecatedRelease="First major API revamp" deprecationMessage=(concat "Please use " (asLowerCamelCase name) "WithExpectedValues:expectedValueInterval:completion:")}}; +- (void){{asLowerCamelCase command}}WithExpectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completionHandler:({{>command_completion_type command=. compatRemapNames=true}})completionHandler {{availability cluster command=command deprecatedRelease="267F4B03-3256-4056-A62D-5237640FDCFE" deprecationMessage=(concat "Please use " (asLowerCamelCase name) "WithExpectedValues:expectedValueInterval:completion:")}}; {{/unless}} {{/unless}} {{/unless}} @@ -140,7 +140,7 @@ NS_ASSUME_NONNULL_BEGIN {{~#zcl_attributes_server}} {{~#*inline "attributeDecls"}} {{#unless (isStrEqual attribute (asUpperCamelCase name preserveAcronyms=true))}} -- (NSDictionary *)readAttribute{{attribute}}WithParams:(MTRReadParams * _Nullable)params {{availability cluster attribute=attribute deprecatedRelease="First major API revamp" deprecationMessage=(concat "Please use readAttribute" (asUpperCamelCase name preserveAcronyms=true) "WithParams on MTRCluster" (asUpperCamelCase parent.name preserveAcronyms=true))}}; +- (NSDictionary *)readAttribute{{attribute}}WithParams:(MTRReadParams * _Nullable)params {{availability cluster attribute=attribute deprecatedRelease="267F4B03-3256-4056-A62D-5237640FDCFE" deprecationMessage=(concat "Please use readAttribute" (asUpperCamelCase name preserveAcronyms=true) "WithParams on MTRCluster" (asUpperCamelCase parent.name preserveAcronyms=true))}}; {{#if (or isWritableAttribute (isInConfigList (concat (asUpperCamelCase parent.name) "::" label) "DarwinForceWritable"))}} - (void)writeAttribute{{attribute}}WithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs {{availability cluster attribute=attribute deprecationMessage=(concat "Please use writeAttribute" (asUpperCamelCase name preserveAcronyms=true) "WithValue on MTRCluster" (asUpperCamelCase parent.name preserveAcronyms=true))}}; diff --git a/src/darwin/Framework/CHIP/templates/MTRCommandPayloadsObjc-src.zapt b/src/darwin/Framework/CHIP/templates/MTRCommandPayloadsObjc-src.zapt index 783fe2aff9555f..4179d5a905ce07 100644 --- a/src/darwin/Framework/CHIP/templates/MTRCommandPayloadsObjc-src.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRCommandPayloadsObjc-src.zapt @@ -31,7 +31,7 @@ NS_ASSUME_NONNULL_BEGIN {{>init_struct_member label=label type=type cluster=parent.parent.name}} {{/zcl_command_arguments}} {{#if (or (isStrEqual source "client") - (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping parent.name) command=(compatCommandNameRemapping parent.name name)))}} + (wasIntroducedBeforeRelease "267F4B03-3256-4056-A62D-5237640FDCFE" (compatClusterNameRemapping parent.name) command=(compatCommandNameRemapping parent.name name)))}} _timedInvokeTimeoutMs = nil; {{/if}} {{#if (isStrEqual source "client")}} @@ -49,7 +49,7 @@ NS_ASSUME_NONNULL_BEGIN other.{{asStructPropertyName label}} = self.{{asStructPropertyName label}}; {{/zcl_command_arguments}} {{#if (or (isStrEqual source "client") - (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping parent.name) command=(compatCommandNameRemapping parent.name name)))}} + (wasIntroducedBeforeRelease "267F4B03-3256-4056-A62D-5237640FDCFE" (compatClusterNameRemapping parent.name) command=(compatCommandNameRemapping parent.name name)))}} other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; {{/if}} {{#if (isStrEqual source "client")}} @@ -210,7 +210,7 @@ NS_ASSUME_NONNULL_BEGIN {{#if (isStrEqual source "client")}} @dynamic timedInvokeTimeoutMs; @dynamic serverSideProcessingTimeout; -{{else if (wasIntroducedBeforeRelease "First major API revamp" cluster command=command)}} +{{else if (wasIntroducedBeforeRelease "267F4B03-3256-4056-A62D-5237640FDCFE" cluster command=command)}} @dynamic timedInvokeTimeoutMs; {{/if}} @end diff --git a/src/darwin/Framework/CHIP/templates/MTRCommandPayloadsObjc.zapt b/src/darwin/Framework/CHIP/templates/MTRCommandPayloadsObjc.zapt index 686b502405a64c..6e8cfd6ff9b36d 100644 --- a/src/darwin/Framework/CHIP/templates/MTRCommandPayloadsObjc.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRCommandPayloadsObjc.zapt @@ -55,7 +55,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; {{! This is using the pre-renaming names for the isAvailableBefore test, because the pre-rename things inherit from the post-rename ones and need to have this selector.}} -{{else if (wasIntroducedBeforeRelease "First major API revamp" (compatClusterNameRemapping parent.name) command=(compatCommandNameRemapping parent.name name))}} +{{else if (wasIntroducedBeforeRelease "267F4B03-3256-4056-A62D-5237640FDCFE" (compatClusterNameRemapping parent.name) command=(compatCommandNameRemapping parent.name name))}} /** * Controls whether the command is a timed command (using Timed Invoke). * @@ -86,7 +86,7 @@ NS_ASSUME_NONNULL_BEGIN * schema for this command. */ - (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue - error:(NSError * __autoreleasing *)error {{availability cluster command=command deprecationMessage="This command has been removed" minimalRelease="Fall 2023"}}; + error:(NSError * __autoreleasing *)error {{availability cluster command=command deprecationMessage="This command has been removed" minimalRelease="3C23F160-13CE-4397-BC65-122B61E4D691"}}; {{/if}} @end {{/if}} diff --git a/src/darwin/Framework/CHIP/templates/availability.yaml b/src/darwin/Framework/CHIP/templates/availability.yaml index 97199ad7bda19a..637f92de14f824 100644 --- a/src/darwin/Framework/CHIP/templates/availability.yaml +++ b/src/darwin/Framework/CHIP/templates/availability.yaml @@ -72,7 +72,7 @@ # "provisional" to make sure all the things that should have # been omitted have been. -- release: "Initial release" +- release: "0E17B7EB-314F-4264-BDA8-AD6A93120B15" versions: iOS: "16.1" macOS: "13.0" @@ -4774,7 +4774,7 @@ - PulseWidthModulation - TimeSynchronization -- release: "First dot-release" +- release: "FD8D09B4-6CF7-4EBA-BD4F-7EDE872E3098" versions: iOS: "16.2" macOS: "13.1" @@ -4830,7 +4830,7 @@ Descriptor: DeviceTypeStruct: DeviceType -- release: "First major API revamp" +- release: "267F4B03-3256-4056-A62D-5237640FDCFE" # First major API revamp versions: iOS: "16.4" macOS: "13.3" @@ -6787,7 +6787,7 @@ HeatSetpointPresent: HeatSetpointFieldPresent CoolSetpointPresent: CoolSetpointFieldPresent -- release: "First after major API revamp" +- release: "27C5E231-9EB5-4932-B4C1-10D88419D9CB" # First after major API revamp versions: iOS: "16.5" macOS: "13.4" @@ -7095,7 +7095,7 @@ PumpFeature: LocalOperation: Local -- release: "Fall 2023" +- release: "3C23F160-13CE-4397-BC65-122B61E4D691" versions: iOS: "17.0" macOS: "14.0" @@ -7560,7 +7560,7 @@ - TimeFailure - MissingTrustedTimeSource -- release: "Fall 2023 #2" +- release: "F7CA8603-6336-4E63-A216-30EE3F77CE8B" versions: iOS: "17.1" macOS: "14.1" @@ -7625,7 +7625,7 @@ - ProxyDiscovery - ProxyValid -- release: "Fall 2023 #3" +- release: "A188F985-88AC-4F0B-8968-C887132CEF9E" versions: iOS: "17.2" macOS: "14.2" @@ -7771,7 +7771,7 @@ Feature: DeadFrontBehavior: DeadFront -- release: "Early 2024" +- release: "ADDB2DC1-4701-4696-87EB-87CD1123BE1A" versions: iOS: "17.4" macOS: "14.4" @@ -8509,7 +8509,7 @@ ContentLaunchStatusEnum: - URLNotAvailable -- release: "Middle of 2024" +- release: "FB974A56-BCF5-46CB-91EF-B5D096E84375" versions: iOS: "17.6" macOS: "14.6" From b3fc1d08238b8f062f58d4fa5d2ec86a97553614 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Thu, 30 May 2024 23:29:17 -0700 Subject: [PATCH 37/43] [Fabric-Bridge] Refactor device management from main (#33618) * [Fabric-Bridge] Refactor device management from main * Address review comments --- examples/fabric-bridge-app/linux/BUILD.gn | 2 + examples/fabric-bridge-app/linux/Device.cpp | 6 +- .../fabric-bridge-app/linux/DeviceManager.cpp | 130 +++++++++ .../linux/include/DeviceManager.h | 68 +++++ examples/fabric-bridge-app/linux/main.cpp | 265 ++++-------------- 5 files changed, 260 insertions(+), 211 deletions(-) create mode 100644 examples/fabric-bridge-app/linux/DeviceManager.cpp create mode 100644 examples/fabric-bridge-app/linux/include/DeviceManager.h diff --git a/examples/fabric-bridge-app/linux/BUILD.gn b/examples/fabric-bridge-app/linux/BUILD.gn index 21c93344416b62..ea7e6e0b31b331 100644 --- a/examples/fabric-bridge-app/linux/BUILD.gn +++ b/examples/fabric-bridge-app/linux/BUILD.gn @@ -22,7 +22,9 @@ executable("fabric-bridge-app") { sources = [ "${chip_root}/examples/fabric-bridge-app/fabric-bridge-common/include/CHIPProjectAppConfig.h", "Device.cpp", + "DeviceManager.cpp", "include/Device.h", + "include/DeviceManager.h", "main.cpp", ] diff --git a/examples/fabric-bridge-app/linux/Device.cpp b/examples/fabric-bridge-app/linux/Device.cpp index 40cd8c007e8baa..4cf72a281113b6 100644 --- a/examples/fabric-bridge-app/linux/Device.cpp +++ b/examples/fabric-bridge-app/linux/Device.cpp @@ -46,11 +46,11 @@ void Device::SetReachable(bool aReachable) if (aReachable) { - ChipLogProgress(DeviceLayer, "Device[%s]: ONLINE", mName); + ChipLogProgress(NotSpecified, "Device[%s]: ONLINE", mName); } else { - ChipLogProgress(DeviceLayer, "Device[%s]: OFFLINE", mName); + ChipLogProgress(NotSpecified, "Device[%s]: OFFLINE", mName); } if (changed) @@ -63,7 +63,7 @@ void Device::SetName(const char * szName) { bool changed = (strncmp(mName, szName, sizeof(mName)) != 0); - ChipLogProgress(DeviceLayer, "Device[%s]: New Name=\"%s\"", mName, szName); + ChipLogProgress(NotSpecified, "Device[%s]: New Name=\"%s\"", mName, szName); chip::Platform::CopyString(mName, szName); diff --git a/examples/fabric-bridge-app/linux/DeviceManager.cpp b/examples/fabric-bridge-app/linux/DeviceManager.cpp new file mode 100644 index 00000000000000..a5ffe68445949b --- /dev/null +++ b/examples/fabric-bridge-app/linux/DeviceManager.cpp @@ -0,0 +1,130 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "DeviceManager.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +using namespace chip; +using namespace chip::app; +using namespace chip::Credentials; +using namespace chip::Inet; +using namespace chip::Transport; +using namespace chip::DeviceLayer; +using namespace chip::app::Clusters; + +namespace { +constexpr uint8_t kMaxRetries = 10; +} // namespace + +DeviceManager::DeviceManager() +{ + memset(mDevices, 0, sizeof(mDevices)); + mFirstDynamicEndpointId = static_cast( + static_cast(emberAfEndpointFromIndex(static_cast(emberAfFixedEndpointCount() - 1))) + 1); + mCurrentEndpointId = mFirstDynamicEndpointId; +} + +int DeviceManager::AddDeviceEndpoint(Device * dev, EmberAfEndpointType * ep, + const chip::Span & deviceTypeList, + const chip::Span & dataVersionStorage, chip::EndpointId parentEndpointId) +{ + uint8_t index = 0; + while (index < CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT) + { + if (nullptr == mDevices[index]) + { + mDevices[index] = dev; + CHIP_ERROR err; + int retryCount = 0; + while (retryCount < kMaxRetries) + { + DeviceLayer::StackLock lock; + dev->SetEndpointId(mCurrentEndpointId); + dev->SetParentEndpointId(parentEndpointId); + err = + emberAfSetDynamicEndpoint(index, mCurrentEndpointId, ep, dataVersionStorage, deviceTypeList, parentEndpointId); + if (err == CHIP_NO_ERROR) + { + ChipLogProgress(NotSpecified, "Added device %s to dynamic endpoint %d (index=%d)", dev->GetName(), + mCurrentEndpointId, index); + return index; + } + if (err != CHIP_ERROR_ENDPOINT_EXISTS) + { + return -1; // Return error as endpoint addition failed due to an error other than endpoint already exists + } + // Increment the endpoint ID and handle wrap condition + if (++mCurrentEndpointId < mFirstDynamicEndpointId) + { + mCurrentEndpointId = mFirstDynamicEndpointId; + } + retryCount++; + } + ChipLogError(NotSpecified, "Failed to add dynamic endpoint after %d retries", kMaxRetries); + return -1; // Return error as all retries are exhausted + } + index++; + } + ChipLogProgress(NotSpecified, "Failed to add dynamic endpoint: No endpoints available!"); + return -1; +} + +int DeviceManager::RemoveDeviceEndpoint(Device * dev) +{ + uint8_t index = 0; + while (index < CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT) + { + if (mDevices[index] == dev) + { + DeviceLayer::StackLock lock; + // Silence complaints about unused ep when progress logging + // disabled. + [[maybe_unused]] EndpointId ep = emberAfClearDynamicEndpoint(index); + mDevices[index] = nullptr; + ChipLogProgress(NotSpecified, "Removed device %s from dynamic endpoint %d (index=%d)", dev->GetName(), ep, index); + return index; + } + index++; + } + return -1; +} + +Device * DeviceManager::GetDevice(uint16_t index) const +{ + if (index < CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT) + { + return mDevices[index]; + } + return nullptr; +} diff --git a/examples/fabric-bridge-app/linux/include/DeviceManager.h b/examples/fabric-bridge-app/linux/include/DeviceManager.h new file mode 100644 index 00000000000000..8e87c9059bcb78 --- /dev/null +++ b/examples/fabric-bridge-app/linux/include/DeviceManager.h @@ -0,0 +1,68 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#include "Device.h" + +class DeviceManager +{ +public: + DeviceManager(); + + /** + * @brief Adds a device to a dynamic endpoint. + * + * This function attempts to add a device to a dynamic endpoint. It tries to find an available + * endpoint slot and retries the addition process up to a specified maximum number of times if + * the endpoint already exists. If the addition is successful, it returns the index of the + * dynamic endpoint; otherwise, it returns -1. + * + * @param dev A pointer to the device to be added. + * @param ep A pointer to the endpoint type. + * @param deviceTypeList A span containing the list of device types. + * @param dataVersionStorage A span containing the data version storage. + * @param parentEndpointId The parent endpoint ID. Defaults to an invalid endpoint ID. + * @return int The index of the dynamic endpoint if successful, -1 otherwise. + */ + int AddDeviceEndpoint(Device * dev, EmberAfEndpointType * ep, const chip::Span & deviceTypeList, + const chip::Span & dataVersionStorage, + chip::EndpointId parentEndpointId = chip::kInvalidEndpointId); + + /** + * @brief Removes a device from a dynamic endpoint. + * + * This function attempts to remove a device from a dynamic endpoint by iterating through the + * available endpoints and checking if the device matches. If the device is found, it clears the + * dynamic endpoint, logs the removal, and returns the index of the removed endpoint. + * If the device is not found, it returns -1. + * + * @param dev A pointer to the device to be removed. + * @return int The index of the removed dynamic endpoint if successful, -1 otherwise. + */ + int RemoveDeviceEndpoint(Device * dev); + + Device * GetDevice(uint16_t index) const; + +private: + chip::EndpointId mCurrentEndpointId; + chip::EndpointId mFirstDynamicEndpointId; + Device * mDevices[CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT + 1]; +}; diff --git a/examples/fabric-bridge-app/linux/main.cpp b/examples/fabric-bridge-app/linux/main.cpp index d639cea1ca0697..600d4a2a376d55 100644 --- a/examples/fabric-bridge-app/linux/main.cpp +++ b/examples/fabric-bridge-app/linux/main.cpp @@ -17,54 +17,27 @@ */ #include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include "CommissionableInit.h" #include "Device.h" +#include "DeviceManager.h" + +#include +#include -#include -#include #include #include #include using namespace chip; -using namespace chip::app; -using namespace chip::Credentials; -using namespace chip::Inet; -using namespace chip::Transport; -using namespace chip::DeviceLayer; -using namespace chip::app::Clusters; #define POLL_INTERVAL_MS (100) +#define ZCL_DESCRIPTOR_CLUSTER_REVISION (1u) +#define ZCL_BRIDGED_DEVICE_BASIC_INFORMATION_CLUSTER_REVISION (2u) +#define ZCL_BRIDGED_DEVICE_BASIC_INFORMATION_FEATURE_MAP (0u) namespace { -EndpointId gCurrentEndpointId; -EndpointId gFirstDynamicEndpointId; -Device * gDevices[CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT + 1]; - bool KeyboardHit() { int bytesWaiting; @@ -81,7 +54,7 @@ void BridgePollingThread() int ch = getchar(); if (ch == 'e') { - ChipLogProgress(DeviceLayer, "Exiting....."); + ChipLogProgress(NotSpecified, "Exiting....."); exit(0); } continue; @@ -92,213 +65,89 @@ void BridgePollingThread() } } -} // namespace - -// REVISION DEFINITIONS: -// ================================================================================= - -#define ZCL_DESCRIPTOR_CLUSTER_REVISION (1u) -#define ZCL_BRIDGED_DEVICE_BASIC_INFORMATION_CLUSTER_REVISION (2u) -#define ZCL_BRIDGED_DEVICE_BASIC_INFORMATION_FEATURE_MAP (0u) - -// --------------------------------------------------------------------------- - -int AddDeviceEndpoint(Device * dev, EmberAfEndpointType * ep, const Span & deviceTypeList, - const Span & dataVersionStorage, chip::EndpointId parentEndpointId = chip::kInvalidEndpointId) -{ - uint8_t index = 0; - const int maxRetries = 10; // Set the maximum number of retries - while (index < CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT) - { - if (nullptr == gDevices[index]) - { - gDevices[index] = dev; - CHIP_ERROR err; - int retryCount = 0; - while (retryCount < maxRetries) - { - DeviceLayer::StackLock lock; - dev->SetEndpointId(gCurrentEndpointId); - dev->SetParentEndpointId(parentEndpointId); - err = - emberAfSetDynamicEndpoint(index, gCurrentEndpointId, ep, dataVersionStorage, deviceTypeList, parentEndpointId); - if (err == CHIP_NO_ERROR) - { - ChipLogProgress(DeviceLayer, "Added device %s to dynamic endpoint %d (index=%d)", dev->GetName(), - gCurrentEndpointId, index); - return index; - } - if (err != CHIP_ERROR_ENDPOINT_EXISTS) - { - return -1; // Return error as endpoint addition failed due to an error other than endpoint already exists - } - // Increment the endpoint ID and handle wrap condition - if (++gCurrentEndpointId < gFirstDynamicEndpointId) - { - gCurrentEndpointId = gFirstDynamicEndpointId; - } - retryCount++; - } - ChipLogError(DeviceLayer, "Failed to add dynamic endpoint after %d retries", maxRetries); - return -1; // Return error as all retries are exhausted - } - index++; - } - ChipLogProgress(DeviceLayer, "Failed to add dynamic endpoint: No endpoints available!"); - return -1; -} +DeviceManager gDeviceManager; -int RemoveDeviceEndpoint(Device * dev) -{ - uint8_t index = 0; - while (index < CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT) - { - if (gDevices[index] == dev) - { - DeviceLayer::StackLock lock; - // Silence complaints about unused ep when progress logging - // disabled. - [[maybe_unused]] EndpointId ep = emberAfClearDynamicEndpoint(index); - gDevices[index] = nullptr; - ChipLogProgress(DeviceLayer, "Removed device %s from dynamic endpoint %d (index=%d)", dev->GetName(), ep, index); - return index; - } - index++; - } - return -1; -} +} // namespace -namespace { -void CallReportingCallback(intptr_t closure) +void ApplicationInit() { - auto path = reinterpret_cast(closure); - MatterReportingAttributeChangeCallback(*path); - Platform::Delete(path); + // Start a thread for bridge polling + std::thread pollingThread(BridgePollingThread); + pollingThread.detach(); } -void ScheduleReportingCallback(Device * dev, ClusterId cluster, AttributeId attribute) -{ - auto * path = Platform::New(dev->GetEndpointId(), cluster, attribute); - PlatformMgr().ScheduleWork(CallReportingCallback, reinterpret_cast(path)); -} -} // anonymous namespace +void ApplicationShutdown() {} -void HandleDeviceStatusChanged(Device * dev, Device::Changed_t itemChangedMask) +int main(int argc, char * argv[]) { - if (itemChangedMask & Device::kChanged_Reachable) - { - ScheduleReportingCallback(dev, BridgedDeviceBasicInformation::Id, BridgedDeviceBasicInformation::Attributes::Reachable::Id); - } - - if (itemChangedMask & Device::kChanged_Name) + if (ChipLinuxAppInit(argc, argv) != 0) { - ScheduleReportingCallback(dev, BridgedDeviceBasicInformation::Id, BridgedDeviceBasicInformation::Attributes::NodeLabel::Id); + return -1; } -} - -Protocols::InteractionModel::Status HandleReadBridgedDeviceBasicAttribute(Device * dev, chip::AttributeId attributeId, - uint8_t * buffer, uint16_t maxReadLength) -{ - using namespace BridgedDeviceBasicInformation::Attributes; - - ChipLogProgress(DeviceLayer, "HandleReadBridgedDeviceBasicAttribute: attrId=%d, maxReadLength=%d", attributeId, maxReadLength); - if ((attributeId == Reachable::Id) && (maxReadLength == 1)) - { - *buffer = dev->IsReachable() ? 1 : 0; - } - else if ((attributeId == NodeLabel::Id) && (maxReadLength == 32)) - { - MutableByteSpan zclNameSpan(buffer, maxReadLength); - MakeZclCharString(zclNameSpan, dev->GetName()); - } - else if ((attributeId == ClusterRevision::Id) && (maxReadLength == 2)) - { - uint16_t rev = ZCL_BRIDGED_DEVICE_BASIC_INFORMATION_CLUSTER_REVISION; - memcpy(buffer, &rev, sizeof(rev)); - } - else if ((attributeId == FeatureMap::Id) && (maxReadLength == 4)) - { - uint32_t featureMap = ZCL_BRIDGED_DEVICE_BASIC_INFORMATION_FEATURE_MAP; - memcpy(buffer, &featureMap, sizeof(featureMap)); - } - else - { - return Protocols::InteractionModel::Status::Failure; - } + ChipLinuxAppMainLoop(); - return Protocols::InteractionModel::Status::Success; + return 0; } +// External attribute read callback function Protocols::InteractionModel::Status emberAfExternalAttributeReadCallback(EndpointId endpoint, ClusterId clusterId, const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer, uint16_t maxReadLength) { - uint16_t endpointIndex = emberAfGetDynamicIndexFromEndpoint(endpoint); + uint16_t endpointIndex = emberAfGetDynamicIndexFromEndpoint(endpoint); + AttributeId attributeId = attributeMetadata->attributeId; - Protocols::InteractionModel::Status ret = Protocols::InteractionModel::Status::Failure; - - if ((endpointIndex < CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT) && (gDevices[endpointIndex] != nullptr)) + Device * dev = gDeviceManager.GetDevice(endpointIndex); + if (dev != nullptr && clusterId == app::Clusters::BridgedDeviceBasicInformation::Id) { - Device * dev = gDevices[endpointIndex]; + using namespace app::Clusters::BridgedDeviceBasicInformation::Attributes; + ChipLogProgress(NotSpecified, "HandleReadBridgedDeviceBasicAttribute: attrId=%d, maxReadLength=%d", attributeId, + maxReadLength); - if (clusterId == BridgedDeviceBasicInformation::Id) + if ((attributeId == Reachable::Id) && (maxReadLength == 1)) + { + *buffer = dev->IsReachable() ? 1 : 0; + } + else if ((attributeId == NodeLabel::Id) && (maxReadLength == 32)) + { + MutableByteSpan zclNameSpan(buffer, maxReadLength); + MakeZclCharString(zclNameSpan, dev->GetName()); + } + else if ((attributeId == ClusterRevision::Id) && (maxReadLength == 2)) + { + uint16_t rev = ZCL_BRIDGED_DEVICE_BASIC_INFORMATION_CLUSTER_REVISION; + memcpy(buffer, &rev, sizeof(rev)); + } + else if ((attributeId == FeatureMap::Id) && (maxReadLength == 4)) + { + uint32_t featureMap = ZCL_BRIDGED_DEVICE_BASIC_INFORMATION_FEATURE_MAP; + memcpy(buffer, &featureMap, sizeof(featureMap)); + } + else { - ret = HandleReadBridgedDeviceBasicAttribute(dev, attributeMetadata->attributeId, buffer, maxReadLength); + return Protocols::InteractionModel::Status::Failure; } + return Protocols::InteractionModel::Status::Success; } - return ret; + return Protocols::InteractionModel::Status::Failure; } +// External attribute write callback function Protocols::InteractionModel::Status emberAfExternalAttributeWriteCallback(EndpointId endpoint, ClusterId clusterId, const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer) { - uint16_t endpointIndex = emberAfGetDynamicIndexFromEndpoint(endpoint); - + uint16_t endpointIndex = emberAfGetDynamicIndexFromEndpoint(endpoint); Protocols::InteractionModel::Status ret = Protocols::InteractionModel::Status::Failure; - if (endpointIndex < CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT) + Device * dev = gDeviceManager.GetDevice(endpointIndex); + if (dev != nullptr && dev->IsReachable()) { - Device * dev = gDevices[endpointIndex]; - - if (dev->IsReachable()) - { - ChipLogProgress(DeviceLayer, "emberAfExternalAttributeWriteCallback: ep=%d, clusterId=%d", endpoint, clusterId); - ret = Protocols::InteractionModel::Status::Success; - } + ChipLogProgress(NotSpecified, "emberAfExternalAttributeWriteCallback: ep=%d, clusterId=%d", endpoint, clusterId); + ret = Protocols::InteractionModel::Status::Success; } return ret; } - -void ApplicationInit() -{ - // Clear out the device database - memset(gDevices, 0, sizeof(gDevices)); - - // Set starting endpoint id where dynamic endpoints will be assigned, which - // will be the next consecutive endpoint id after the last fixed endpoint. - gFirstDynamicEndpointId = static_cast( - static_cast(emberAfEndpointFromIndex(static_cast(emberAfFixedEndpointCount() - 1))) + 1); - gCurrentEndpointId = gFirstDynamicEndpointId; - - // Start a thread for bridge polling - std::thread pollingThread(BridgePollingThread); - pollingThread.detach(); -} - -void ApplicationShutdown() {} - -int main(int argc, char * argv[]) -{ - if (ChipLinuxAppInit(argc, argv) != 0) - { - return -1; - } - - ChipLinuxAppMainLoop(); - - return 0; -} From 60b721525fc22081883d396aa5e3ac761ee518d9 Mon Sep 17 00:00:00 2001 From: C Freeman Date: Fri, 31 May 2024 03:41:47 -0400 Subject: [PATCH 38/43] Global attribute tests: Remove (#33599) Removes scripts associated with the test deletion in https://github.com/CHIP-Specifications/chip-test-plans/pull/4104 and https://github.com/CHIP-Specifications/chip-test-plans/pull/4184 --- .github/workflows/tests.yaml | 2 - .../certification/Test_TC_ACFREMON_1_1.yaml | 183 ---- .../suites/certification/Test_TC_ACL_1_1.yaml | 100 --- .../suites/certification/Test_TC_ACT_1_1.yaml | 224 ----- .../certification/Test_TC_AIRQUAL_1_1.yaml | 137 --- .../certification/Test_TC_ALOGIN_1_12.yaml | 93 -- .../certification/Test_TC_APBSC_1_10.yaml | 124 --- .../Test_TC_APPLAUNCHER_1_3.yaml | 124 --- .../Test_TC_APPOBSERVER_1_13.yaml | 94 -- .../Test_TC_AUDIOOUTPUT_1_8.yaml | 103 --- .../certification/Test_TC_BIND_1_1.yaml | 91 -- .../certification/Test_TC_BINFO_1_1.yaml | 257 ------ .../certification/Test_TC_BOOLCFG_1_1.yaml | 292 ------ .../certification/Test_TC_BOOL_1_1.yaml | 102 --- .../certification/Test_TC_BRBINFO_1_1.yaml | 272 ------ .../suites/certification/Test_TC_CC_1_1.yaml | 850 ------------------ .../certification/Test_TC_CGEN_1_1.yaml | 92 -- .../certification/Test_TC_CHANNEL_1_6.yaml | 178 ---- .../certification/Test_TC_CONCON_1_14.yaml | 149 --- .../Test_TC_CONTENTLAUNCHER_1_11.yaml | 151 ---- .../certification/Test_TC_DEMM_1_1.yaml | 116 --- .../certification/Test_TC_DESC_1_1.yaml | 114 --- .../certification/Test_TC_DGETH_1_1.yaml | 216 ----- .../certification/Test_TC_DGGEN_1_1.yaml | 193 ---- .../certification/Test_TC_DGSW_1_1.yaml | 166 ---- .../certification/Test_TC_DGTHREAD_1_1.yaml | 318 ------- .../certification/Test_TC_DGWIFI_1_1.yaml | 195 ---- .../certification/Test_TC_DISHALM_1_1.yaml | 114 --- .../certification/Test_TC_DISHM_1_1.yaml | 106 --- .../certification/Test_TC_DLOG_1_1.yaml | 91 -- .../certification/Test_TC_DRLK_1_1.yaml | 544 ----------- .../certification/Test_TC_DRYERCTRL_1_1.yaml | 91 -- .../certification/Test_TC_EEVSEM_1_1.yaml | 116 --- .../certification/Test_TC_EEVSE_1_1.yaml | 301 ------- .../suites/certification/Test_TC_FAN_1_1.yaml | 217 ----- .../certification/Test_TC_FLABEL_1_1.yaml | 93 -- .../suites/certification/Test_TC_FLW_1_1.yaml | 103 --- .../certification/Test_TC_GRPKEY_1_1.yaml | 105 --- .../suites/certification/Test_TC_G_1_1.yaml | 103 --- .../certification/Test_TC_HEPAFREMON_1_1.yaml | 183 ---- .../suites/certification/Test_TC_ILL_1_1.yaml | 114 --- .../suites/certification/Test_TC_I_1_1.yaml | 136 --- .../Test_TC_KEYPADINPUT_1_2.yaml | 128 --- .../certification/Test_TC_LCFG_1_1.yaml | 93 -- .../certification/Test_TC_LOWPOWER_1_1.yaml | 93 -- .../certification/Test_TC_LUNIT_1_2.yaml | 117 --- .../suites/certification/Test_TC_LVL_1_1.yaml | 224 ----- .../suites/certification/Test_TC_LWM_1_1.yaml | 128 --- .../certification/Test_TC_MEDIAINPUT_1_4.yaml | 128 --- .../Test_TC_MEDIAPLAYBACK_1_7.yaml | 266 ------ .../suites/certification/Test_TC_MOD_1_1.yaml | 125 --- .../certification/Test_TC_MWOM_1_1.yaml | 94 -- .../suites/certification/Test_TC_OCC_1_1.yaml | 198 ---- .../suites/certification/Test_TC_OO_1_1.yaml | 207 ----- .../certification/Test_TC_OPCREDS_1_2.yaml | 121 --- .../certification/Test_TC_OTCCM_1_1.yaml | 101 --- .../suites/certification/Test_TC_PRS_1_1.yaml | 169 ---- .../certification/Test_TC_PSCFG_1_1.yaml | 93 -- .../suites/certification/Test_TC_PS_1_1.yaml | 211 ----- .../certification/Test_TC_REFALM_1_1.yaml | 116 --- .../suites/certification/Test_TC_RH_1_1.yaml | 103 --- .../certification/Test_TC_RVCCLEANM_1_1.yaml | 99 -- .../certification/Test_TC_RVCOPSTATE_1_1.yaml | 162 ---- .../certification/Test_TC_RVCRUNM_1_1.yaml | 99 -- .../suites/certification/Test_TC_S_1_1.yaml | 132 --- .../certification/Test_TC_TCCM_1_1.yaml | 129 --- .../certification/Test_TC_TGTNAV_1_9.yaml | 104 --- .../certification/Test_TC_TIMESYNC_1_1.yaml | 400 --------- .../suites/certification/Test_TC_TMP_1_1.yaml | 101 --- .../certification/Test_TC_TSUIC_1_1.yaml | 102 --- .../certification/Test_TC_ULABEL_1_1.yaml | 93 -- .../certification/Test_TC_VALCC_1_1.yaml | 186 ---- .../certification/Test_TC_WAKEONLAN_1_5.yaml | 104 --- .../certification/Test_TC_WASHERCTRL_1_1.yaml | 140 --- src/app/tests/suites/ciTests.json | 143 +-- src/app/tests/suites/manualTests.json | 6 +- src/python_testing/TC_OPSTATE_1_1.py | 53 -- src/python_testing/TC_OVENOPSTATE_1_1.py | 53 -- 78 files changed, 36 insertions(+), 12138 deletions(-) delete mode 100644 src/app/tests/suites/certification/Test_TC_ACFREMON_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_ACL_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_ACT_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_AIRQUAL_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_ALOGIN_1_12.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_APBSC_1_10.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_APPLAUNCHER_1_3.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_APPOBSERVER_1_13.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_AUDIOOUTPUT_1_8.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_BIND_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_BINFO_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_BOOLCFG_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_BOOL_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_BRBINFO_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_CC_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_CGEN_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_CHANNEL_1_6.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_CONCON_1_14.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_CONTENTLAUNCHER_1_11.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_DEMM_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_DESC_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_DGETH_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_DGGEN_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_DGSW_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_DGTHREAD_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_DGWIFI_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_DISHALM_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_DISHM_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_DLOG_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_DRLK_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_DRYERCTRL_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_EEVSEM_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_EEVSE_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_FAN_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_FLABEL_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_FLW_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_GRPKEY_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_G_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_HEPAFREMON_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_ILL_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_I_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_KEYPADINPUT_1_2.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_LCFG_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_LOWPOWER_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_LUNIT_1_2.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_LVL_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_LWM_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_MEDIAINPUT_1_4.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_MEDIAPLAYBACK_1_7.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_MOD_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_MWOM_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_OCC_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_OO_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_OPCREDS_1_2.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_OTCCM_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_PRS_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_PSCFG_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_PS_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_REFALM_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_RH_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_RVCCLEANM_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_RVCOPSTATE_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_RVCRUNM_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_S_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_TCCM_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_TGTNAV_1_9.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_TIMESYNC_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_TMP_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_TSUIC_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_ULABEL_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_VALCC_1_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_WAKEONLAN_1_5.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_WASHERCTRL_1_1.yaml delete mode 100644 src/python_testing/TC_OPSTATE_1_1.py delete mode 100644 src/python_testing/TC_OVENOPSTATE_1_1.py diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index f4031eb47104bc..8b3588c6fdf13c 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -536,13 +536,11 @@ jobs: scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --script "src/python_testing/TestMatterTestingSupport.py" --script-args "--trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --script "src/python_testing/TestSpecParsingSupport.py" --script-args "--trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' scripts/run_in_python_env.sh out/venv './scripts/tests/TestTimeSyncTrustedTimeSourceRunner.py' - scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_OPSTATE_1_1.py" --script-args "--endpoint 1 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_OPSTATE_2_1.py" --script-args "--endpoint 1 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_OPSTATE_2_2.py" --script-args "--endpoint 1 --int-arg PIXIT.WAITTIME.COUNTDOWN:5 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_OPSTATE_2_3.py" --script-args "--endpoint 1 --int-arg PIXIT.WAITTIME.COUNTDOWN:5 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_OPSTATE_2_4.py" --script-args "--endpoint 1 --int-arg PIXIT.OPSTATE.ErrorEventGen:1 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_OPSTATE_2_5.py" --script-args "--endpoint 1 --int-arg PIXIT.WAITTIME.REBOOT:5 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' - scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_OVENOPSTATE_1_1.py" --script-args "--endpoint 1 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_OVENOPSTATE_2_1.py" --script-args "--endpoint 1 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_OVENOPSTATE_2_2.py" --script-args "--endpoint 1 --int-arg PIXIT.WAITTIME.COUNTDOWN:5 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_OVENOPSTATE_2_3.py" --script-args "--endpoint 1 --int-arg PIXIT.WAITTIME.COUNTDOWN:5 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' diff --git a/src/app/tests/suites/certification/Test_TC_ACFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_ACFREMON_1_1.yaml deleted file mode 100644 index 3f4a7cc16bbd57..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_ACFREMON_1_1.yaml +++ /dev/null @@ -1,183 +0,0 @@ -# Copyright (c) 2023 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 165.1.1. [TC-ACFREMON-1.1] Global Attributes with DUT as Server - -PICS: - - ACFREMON.S - -config: - nodeId: 0x12344321 - cluster: "Activated Carbon Filter Monitoring" - endpoint: 1 - -tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads from the DUT the ClusterRevision attribute." - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 1 - constraints: - type: int16u - - - label: "Step 3a: TH reads from the DUT the FeatureMap attribute." - command: "readAttribute" - attribute: "FeatureMap" - PICS: "!ACFREMON.S.F00 && !ACFREMON.S.F01 && !ACFREMON.S.F02" - response: - value: 0 - constraints: - type: bitmap32 - - - label: - "Step 3b: Given ACFREMON.S.F00(Condition) ensure featuremap has the - correct bit set" - command: "readAttribute" - attribute: "FeatureMap" - PICS: ACFREMON.S.F00 - response: - constraints: - type: bitmap32 - hasMasksSet: [0x1] - - - label: - "Step 3c: Given ACFREMON.S.F01(Warning) ensure featuremap has the - correct bit set" - command: "readAttribute" - attribute: "FeatureMap" - PICS: ACFREMON.S.F01 - response: - constraints: - type: bitmap32 - hasMasksSet: [0x2] - - - label: - "Step 3d: Given ACFREMON.S.F02(ReplacementProductList) ensure - featuremap has the correct bit set" - command: "readAttribute" - attribute: "FeatureMap" - PICS: ACFREMON.S.F02 - response: - constraints: - type: bitmap32 - hasMasksSet: [0x4] - - - label: "Step 4a: TH reads from the DUT the AttributeList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [2, 65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 4a: TH reads from the DUT the AttributeList attribute." - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [2, 65528, 65529, 65531, 65532, 65533] - - - label: - "Step 4b: TH reads the feature dependent(ACFREMON.S.F00) attribute in - AttributeList" - PICS: ACFREMON.S.F00 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 2] - - - label: - "Step 4c: TH reads the optional attribute InPlaceIndicator - (ACFREMON.S.A0003) in AttributeList" - PICS: ACFREMON.S.A0003 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [3] - - - label: - "Step 4d: TH reads the optional attribute LastChangedTime - (ACFREMON.S.A0004) in AttributeList" - PICS: ACFREMON.S.A0004 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [4] - - - label: - "Step 4e: TH reads the optional attribute ReplacementProductList - (ACFREMON.S.F02) in AttributeList" - PICS: ACFREMON.S.F02 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [5] - - - label: "Step 5: TH reads EventList attribute from DUT" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list - - - label: "Step 6a: TH reads from the DUT the AcceptedCommandList attribute." - PICS: "!ACFREMON.S.C00.Rsp" - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - value: [] - constraints: - type: list - - - label: - "Step 6b: TH reads the optional command (ResetCondition) in - AcceptedCommandList" - PICS: ACFREMON.S.C00.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0] - - - label: "Step 7: TH reads from the DUT the GeneratedCommandList attribute." - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_ACL_1_1.yaml b/src/app/tests/suites/certification/Test_TC_ACL_1_1.yaml deleted file mode 100644 index 1f33f19854e874..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_ACL_1_1.yaml +++ /dev/null @@ -1,100 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 133.1.1. [TC-ACL-1.1] Global attributes - -PICS: - - ACL.S - -config: - nodeId: 0x12344321 - cluster: "Access Control" - endpoint: 0 - -tests: - - label: "Step 1: Wait for the commissioned device to be retrieved" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads ClusterRevision attribute from DUT" - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 1 - constraints: - type: int16u - - - label: "Step 3: TH reads FeatureMap attribute from DUT" - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: "Step 4a: TH reads AttributeList attribute from DUT" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 2, 3, 4, 65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 4a: TH reads AttributeList attribute from DUT" - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 2, 3, 4, 65528, 65529, 65531, 65532, 65533] - - - label: "Step 4b: TH reads optional attribute (Extension) in AttributeList" - PICS: ACL.S.A0001 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [1] - - - label: "Step 5: TH reads EventList attribute from DUT" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list - contains: [0, 1] - - - label: "Step 6: TH reads AcceptedCommandList attribute from DUT" - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - value: [] - constraints: - type: list - - - label: "Step 7: TH reads GeneratedCommandList attribute from DUT" - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_ACT_1_1.yaml b/src/app/tests/suites/certification/Test_TC_ACT_1_1.yaml deleted file mode 100644 index 50ebde13e9a2de..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_ACT_1_1.yaml +++ /dev/null @@ -1,224 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 77.1.1. [TC-ACT-1.1] Global attributes with server as DUT - -PICS: - - ACT.S - -config: - nodeId: 0x12344321 - cluster: "Actions" - endpoint: 1 - -tests: - - label: "Step 1: Wait for the commissioned device to be retrieved" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads from the DUT the ClusterRevision attribute." - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 1 - constraints: - type: int16u - - - label: "Step 3: TH reads from the DUT the FeatureMap attribute." - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: "Step 4a: TH reads from the DUT the AttributeList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 4a: Read the global attribute: AttributeList" - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 65528, 65529, 65531, 65532, 65533] - - - label: "Step 4b: Read the optional attribute(SetupURL) in AttributeList" - PICS: ACT.S.A0002 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [2] - - #Issue: https://github.com/project-chip/connectedhomeip/issues/26721 - - label: "Step 5: TH reads EventList attribute from DUT" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list - contains: [0, 1] - - # Checking only type check all commands are optional - - label: - "Step 6a: TH Read the optional command (InstantAction) in - AcceptedCommandList" - PICS: ACT.S.C00.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0x0] - - - label: - "Step 6b: TH Read the optional command (InstantActionWithTransition) - in AcceptedCommandList" - PICS: ACT.S.C01.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0x01] - - - label: - "Step 6C: TH Read the optional command (StartAction) in - AcceptedCommandList" - PICS: ACT.S.C02.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0x02] - - - label: - "Step 6d: TH Read the optional command (StartActionWithDuration) in - AcceptedCommandList" - PICS: ACT.S.C03.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0x03] - - - label: - "Step 6e: TH Read the optional command (StopAction) in - AcceptedCommandList" - PICS: ACT.S.C04.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0x04] - - label: - "Step 6f: TH Read the optional command (PauseAction) in - AcceptedCommandList" - PICS: ACT.S.C05.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0x05] - - - label: - "Step 6g: TH Read the optional command (PauseActionWithDuration) in - AcceptedCommandList" - PICS: ACT.S.C06.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0x06] - - - label: - "Step 6h: TH Read the optional command (ResumeAction) in - AcceptedCommandList" - PICS: ACT.S.C07.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0x07] - - - label: - "Step 6i: TH Read the optional command (EnableAction) in - AcceptedCommandList" - PICS: ACT.S.C08.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0x08] - - label: - "Step 6j: TH Read the optional command (EnableActionWithDuration) in - AcceptedCommandList" - PICS: ACT.S.C09.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0x09] - - - label: - "Step 6k: TH Read the optional command (DisableAction) in - AcceptedCommandList" - PICS: ACT.S.C0a.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0x0a] - - - label: - "Step 6l: TH Read the optional command (DisableActionWithDuration) in - AcceptedCommandList" - PICS: ACT.S.C0b.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0x0b] - - - label: "Step 7: TH reads from the DUT the GeneratedCommandList attribute." - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_AIRQUAL_1_1.yaml b/src/app/tests/suites/certification/Test_TC_AIRQUAL_1_1.yaml deleted file mode 100644 index 5bb595f91fa807..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_AIRQUAL_1_1.yaml +++ /dev/null @@ -1,137 +0,0 @@ -# Copyright (c) 2023 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 164.1.1. [TC-AIRQUAL-1.1] Global Attributes with DUT as Server - -PICS: - - AIRQUAL.S - -config: - nodeId: 0x12344321 - cluster: "Air Quality" - endpoint: 1 - -tests: - - label: "Step 1: Wait for the commissioned device to be retrieved" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads from the DUT the ClusterRevision attribute." - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 1 - constraints: - type: int16u - - - label: "Step 3a: TH reads from the DUT the FeatureMap attribute." - command: "readAttribute" - attribute: "FeatureMap" - PICS: - "!AIRQUAL.S.F00 && !AIRQUAL.S.F01 && !AIRQUAL.S.F02 && !AIRQUAL.S.F03" - response: - value: 0 - constraints: - type: bitmap32 - - - label: - "Step 3b: Given AIRQUAL.S.F00(Fair) ensure featuremap has the correct - bit set" - command: "readAttribute" - attribute: "FeatureMap" - PICS: AIRQUAL.S.F00 - response: - constraints: - type: bitmap32 - hasMasksSet: [0x1] - - - label: - "Step 3c: Given AIRQUAL.S.F01(Moderate) ensure featuremap has the - correct bit set" - command: "readAttribute" - attribute: "FeatureMap" - PICS: AIRQUAL.S.F01 - response: - constraints: - type: bitmap32 - hasMasksSet: [0x2] - - - label: - "Step 3d: Given AIRQUAL.S.F02(VeryPoor) ensure featuremap has the - correct bit set" - command: "readAttribute" - attribute: "FeatureMap" - PICS: AIRQUAL.S.F02 - response: - constraints: - type: bitmap32 - hasMasksSet: [0x4] - - - label: - "Step 3e: Given AIRQUAL.S.F03(ExtremelyPoor) ensure featuremap has the - correct bit set" - command: "readAttribute" - attribute: "FeatureMap" - PICS: AIRQUAL.S.F03 - response: - constraints: - type: bitmap32 - hasMasksSet: [0x8] - - - label: "Step 4: TH reads from the DUT the AttributeList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 4: TH reads from the DUT the AttributeList attribute." - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 65528, 65529, 65531, 65532, 65533] - - - label: "Step 5: TH reads from the DUT the EventList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list - - - label: "Step 6: TH reads from the DUT the AcceptedCommandList attribute." - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [] - - - label: "Step 7: TH reads from the DUT the GeneratedCommandList attribute." - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_ALOGIN_1_12.yaml b/src/app/tests/suites/certification/Test_TC_ALOGIN_1_12.yaml deleted file mode 100644 index 25e6457fd786f9..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_ALOGIN_1_12.yaml +++ /dev/null @@ -1,93 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: - 19.1.12. [TC-ALOGIN-1.12] Global attributes - Account Login Cluster (DUT as - Server) - -PICS: - - ALOGIN.S - -config: - nodeId: 0x12344321 - cluster: "Account Login" - endpoint: 3 - -tests: - - label: "Wait for the commissioned device to be retrieved" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 1: TH reads the ClusterRevision attribute from the DUT" - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 2 - constraints: - type: int16u - - - label: "Step 2: TH reads the FeatureMap attribute from the DUT" - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: "Step 3: TH reads the AttributeList attribute from the DUT" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 3a: TH reads the AttributeList attribute from the DUT" - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [65528, 65529, 65531, 65532, 65533] - - - label: "Step 4: TH reads the AcceptedCommandList attribute from the DUT" - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0, 2, 3] - - - label: "Step 5: TH reads the GeneratedCommandList attribute from the DUT" - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - constraints: - type: list - contains: [1] - - - label: "Step 6: TH reads the EventList attribute from the DUT" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_APBSC_1_10.yaml b/src/app/tests/suites/certification/Test_TC_APBSC_1_10.yaml deleted file mode 100644 index 44e11d6cb3b53e..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_APBSC_1_10.yaml +++ /dev/null @@ -1,124 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: - 19.1.10. [TC-APBSC-1.10] Global attributes - Application Basic Cluster (DUT - as Server) - -PICS: - - APBSC.S - -config: - nodeId: 0x12344321 - cluster: "Application Basic" - endpoint: 3 - -tests: - - label: "Wait for the commissioned device to be retrieved" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 1: TH reads the ClusterRevision attribute from the DUT" - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 1 - constraints: - type: int16u - - - label: "Step 2: TH reads the FeatureMap attribute from the DUT" - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: "Step 3a: TH reads the AttributeList attribute from the DUT" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: - [2, 4, 5, 6, 7, 65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 3a: TH reads the AttributeList attribute from the DUT" - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [2, 4, 5, 6, 7, 65528, 65529, 65531, 65532, 65533] - - - label: - "Step 3b: TH reads the optional attribute(VendorName) in AttributeList" - PICS: APBSC.S.A0000 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0] - - - label: - "Step 3c: TH reads the optional attribute(VendorID) in AttributeList" - PICS: APBSC.S.A0001 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [1] - - - label: - "Step 3d: TH reads the optional attribute(ProductID) in AttributeList" - PICS: APBSC.S.A0003 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [3] - - - label: "Step 4: TH reads the AcceptedCommandList attribute from the DUT" - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - value: [] - constraints: - type: list - - - label: "Step 5: TH reads the GeneratedCommandList attribute from the DUT" - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [] - constraints: - type: list - - - label: "Step 6: TH reads the EventList attribute from the DUT" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_APPLAUNCHER_1_3.yaml b/src/app/tests/suites/certification/Test_TC_APPLAUNCHER_1_3.yaml deleted file mode 100644 index e7f3817a6a8084..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_APPLAUNCHER_1_3.yaml +++ /dev/null @@ -1,124 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: - 19.1.3. [TC-APPLAUNCHER-1.3] Global attributes - Application Launcher - Cluster (DUT as Server) - -PICS: - - APPLAUNCHER.S - -config: - nodeId: 0x12344321 - cluster: "Application Launcher" - endpoint: 1 - -tests: - - label: "Step 0: Wait for the commissioned device to be retrieved" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 1: TH reads the ClusterRevision attribute from the DUT" - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 1 - constraints: - type: int16u - - - label: "Step 2a: TH reads the FeatureMap attribute from the DUT" - PICS: APPLAUNCHER.S.F00 - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 1 - constraints: - type: bitmap32 - - - label: "Step 2b: TH reads the FeatureMap attribute from the DUT" - PICS: " !APPLAUNCHER.S.F00 " - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: "Step 3a: TH reads the AttributeList attribute from the DUT" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 3a: TH reads the AttributeList attribute from the DUT" - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [65528, 65529, 65531, 65532, 65533] - - - label: - "Step 3b: TH reads the optional attribute(CatalogList) in - AttributeList" - PICS: APPLAUNCHER.S.A0000 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0] - - - label: - "Step 3c: TH reads the optional attribute(CurrentApp) in AttributeList" - PICS: APPLAUNCHER.S.A0001 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [1] - - - label: "Step 4: TH reads the AcceptedCommandList attribute from the DUT" - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0, 1, 2] - - - label: "Step 5: TH reads the GeneratedCommandList attribute from the DUT" - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - constraints: - type: list - contains: [3] - - - label: "Step 6: TH reads the EventList attribute from the DUT" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_APPOBSERVER_1_13.yaml b/src/app/tests/suites/certification/Test_TC_APPOBSERVER_1_13.yaml deleted file mode 100644 index 509b0232e88ec6..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_APPOBSERVER_1_13.yaml +++ /dev/null @@ -1,94 +0,0 @@ -# Copyright (c) 2023 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default - -name: - 19.1.13. [TC-APPOBSERVER-1.13] Global attributes - Content App Observer - Cluster (DUT as Server) - -PICS: - - APPOBSERVER.S - -config: - nodeId: 0x12344321 - cluster: "ContentAppObserver" - endpoint: 1 - -tests: - - label: "Step 0: Wait for the commissioned device to be retrieved" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 1: TH reads the ClusterRevision attribute from the DUT" - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 1 - constraints: - type: int16u - - - label: "Step 2: TH reads the FeatureMap attribute from the DUT" - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: "Step 3: TH reads the AttributeList attribute from the DUT" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 3: TH reads the AttributeList attribute from the DUT" - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [65528, 65529, 65531, 65532, 65533] - - - label: "Step 4: TH reads the AcceptedCommandList attribute from the DUT" - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0] - - - label: "Step 5: TH reads the GeneratedCommandList attribute from the DUT" - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - constraints: - type: list - contains: [1] - - - label: "Step 6: TH reads the EventList attribute from the DUT" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_AUDIOOUTPUT_1_8.yaml b/src/app/tests/suites/certification/Test_TC_AUDIOOUTPUT_1_8.yaml deleted file mode 100644 index 49d43cb8a23659..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_AUDIOOUTPUT_1_8.yaml +++ /dev/null @@ -1,103 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: - 19.1.8. [TC-AUDIOOUTPUT-1.8] Global attributes - Audio Output Cluster(DUT as - Server) - -PICS: - - AUDIOOUTPUT.S - -config: - nodeId: 0x12344321 - cluster: "Audio Output" - endpoint: 1 - -tests: - - label: "Step 0: Wait for the commissioned device to be retrieved" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 1: TH reads the ClusterRevision attribute from the DUT" - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 1 - constraints: - type: int16u - - - label: "Step 2a: TH reads the FeatureMap attribute from the DUT" - PICS: AUDIOOUTPUT.S.F00 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x1] - - - label: "Step 2b: TTH reads the FeatureMap attribute from the DUT" - PICS: " !AUDIOOUTPUT.S.F00 " - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksClear: [0x1] - - - label: "Step 3: TH reads the AttributeList attribute from the DUT" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 3: TH reads the AttributeList attribute from the DUT" - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 65528, 65529, 65531, 65532, 65533] - - - label: "Step 4: TH reads the AcceptedCommandList attribute from the DUT" - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0] - - - label: "Step 5: TH reads the GeneratedCommandList attribute from the DUT" - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [] - constraints: - type: list - - - label: "Step 6: TH reads the EventList attribute from the DUT" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_BIND_1_1.yaml b/src/app/tests/suites/certification/Test_TC_BIND_1_1.yaml deleted file mode 100644 index a6c7b0024ffea6..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_BIND_1_1.yaml +++ /dev/null @@ -1,91 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 116.1.1. [TC-BIND-1.1] Global Attributes with DUT as Server - -PICS: - - BIND.S - -config: - nodeId: 0x12344321 - cluster: "Binding" - endpoint: 1 - -tests: - - label: "Step 1: Wait for the commissioned device to be retrieved" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads the ClusterRevision from DUT" - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 1 - constraints: - type: int16u - - - label: "Step 3: TH reads the FeatureMap from DUT" - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: "Step 4: TH reads AttributeList from DUT" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 4: TH reads AttributeList from DUT" - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 65528, 65529, 65531, 65532, 65533] - - - label: "Step 5: TH reads EventList attribute from DUT" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list - - - label: "Step 6: TH reads AcceptedCommandList attribute from DUT" - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - value: [] - constraints: - type: list - - - label: "Step 7: TH reads GeneratedCommandList attribute from DUT" - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_BINFO_1_1.yaml b/src/app/tests/suites/certification/Test_TC_BINFO_1_1.yaml deleted file mode 100644 index 6a9c2eb23074b9..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_BINFO_1_1.yaml +++ /dev/null @@ -1,257 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 12.1.1. [TC-BINFO-1.1] Global Attributes with DUT as Server - -PICS: - - BINFO.S - -config: - nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 - -tests: - - label: "Step 1: Wait for the commissioned device to be retrieved" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads the ClusterRevision from DUT" - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 3 - constraints: - type: int16u - - - label: "Step 3: TH reads the FeatureMap from DUT" - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: "Step 4a: TH reads AttributeList from DUT" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: - [ - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 19, - 65528, - 65529, - 65530, - 65531, - 65532, - 65533, - ] - - - label: "Step 4a: TH reads AttributeList from DUT" - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: - [ - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 19, - 65528, - 65529, - 65531, - 65532, - 65533, - ] - - - label: - "Step 4b: TH reads optional attribute(ManufacturingDate) in - attributeList" - PICS: BINFO.S.A000b - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [11] - - - label: "Step 4c: TH reads optional attribute(PartNumber) in attributeList" - PICS: BINFO.S.A000c - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [12] - - - label: "Step 4d: TH reads optional attribute(ProductURL) in attributeList" - PICS: BINFO.S.A000d - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [13] - - - label: - "Step 4e: TH reads optional attribute(ProductLabel) in attributeList" - PICS: BINFO.S.A000e - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [14] - - - label: - "Step 4f: TH reads optional attribute(SerialNumber) in attributeList" - PICS: BINFO.S.A000f - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [15] - - - label: - "Step 4g: TH reads optional attribute(LocalConfigDisabled) in - attributeList" - PICS: BINFO.S.A0010 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [16] - - - label: "Step 4h: TH reads optional attribute(Reachable) in attributeList" - PICS: BINFO.S.A0011 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [17] - - - label: "Step 4i: TH reads optional attribute(UniqueID) in attributeList" - PICS: BINFO.S.A0012 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [18] - - - label: - "Step 4j: TH reads optional attribute(ProductAppearance) in - attributeList" - PICS: BINFO.S.A0014 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [20] - - - label: "Step 5a: TH reads EventList from DUT" - PICS: - " !BINFO.S.E00 && !BINFO.S.E01 && !BINFO.S.E02 && !BINFO.S.A0011 && - PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list - - - label: "Step 5b: TH reads BINFO.S.E00(StartUp) event in EventList" - PICS: BINFO.S.E00 && PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list - contains: [0] - - - label: "Step 5c: TH reads BINFO.S.E01(ShutDown) event in EventList" - PICS: BINFO.S.E01 && PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list - contains: [1] - - - label: "Step 5d: TH reads BINFO.S.E02(Leave) event in EventList" - PICS: BINFO.S.E02 && PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list - contains: [2] - - - label: "Step 5e: TH reads (ReachableChanged) event in EventList" - PICS: BINFO.S.A0011 && PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list - contains: [3] - - - label: "Step 6: TH reads from the DUT the AcceptedCommandList attribute." - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [] - - - label: "Step 7: TH reads from the DUT the GeneratedCommandList attribute." - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_BOOLCFG_1_1.yaml b/src/app/tests/suites/certification/Test_TC_BOOLCFG_1_1.yaml deleted file mode 100644 index d8294f379d108a..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_BOOLCFG_1_1.yaml +++ /dev/null @@ -1,292 +0,0 @@ -# Copyright (c) 2024 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 69.1.1. [TC-BOOLCFG-1.1] Global attributes with server as DUT - -PICS: - - BOOLCFG.S - -config: - nodeId: 0x12344321 - cluster: "Boolean State Configuration" - endpoint: 1 - -tests: - - label: "Step 1: Wait for the commissioned device to be retrieved" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: Read the global attribute: ClusterRevision" - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 1 - constraints: - type: int16u - - - label: "Step 3a: Read the global attribute: FeatureMap" - command: "readAttribute" - attribute: "FeatureMap" - PICS: - ( !BOOLCFG.S.F00 && !BOOLCFG.S.F01 && !BOOLCFG.S.F02 && !BOOLCFG.S.F03 - ) - response: - value: 0 - constraints: - type: bitmap32 - - - label: - "Step 3b: Given BOOLCFG.S.F00(VIS) ensure featuremap has the correct - bit set" - command: "readAttribute" - attribute: "FeatureMap" - PICS: BOOLCFG.S.F00 - response: - constraints: - type: bitmap32 - hasMasksSet: [0x1] - - - label: - "Step 3c: Given BOOLCFG.S.F01(AUD) ensure featuremap has the correct - bit set" - command: "readAttribute" - attribute: "FeatureMap" - PICS: BOOLCFG.S.F01 - response: - constraints: - type: bitmap32 - hasMasksSet: [0x2] - - - label: - "Step 3d: Given BOOLCFG.S.F02(SPRS) ensure featuremap has the correct - bit set" - command: "readAttribute" - attribute: "FeatureMap" - PICS: BOOLCFG.S.F02 - response: - constraints: - type: bitmap32 - hasMasksSet: [0x4] - - - label: - "Step 3d: Given BOOLCFG.S.F03(SENSLVL) ensure featuremap has the - correct bit set" - command: "readAttribute" - attribute: "FeatureMap" - PICS: BOOLCFG.S.F03 - response: - constraints: - type: bitmap32 - hasMasksSet: [0x8] - - - label: "Step 4a: Read the global attribute: AttributeList" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 4a: Read the global attribute: AttributeList" - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [65528, 65529, 65531, 65532, 65533] - - - label: - "Step 4b: Read the feature dependent(BOOLCFG.S.F00) attribute in - AttributeList" - PICS: BOOLCFG.S.F00 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [3, 6] - - - label: - "Step 4c: Read the feature dependent(BOOLCFG.S.F00) optional attribute - in AttributeList" - PICS: BOOLCFG.S.F00 && BOOLCFG.S.A0005 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [5] - - - label: - "Step 4d: Read the feature dependent(BOOLCFG.S.F01) attribute in - AttributeList" - PICS: BOOLCFG.S.F01 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [3, 6] - - - label: - "Step 4e: Read the feature dependent(BOOLCFG.S.F01) optional attribute - in AttributeList" - PICS: BOOLCFG.S.F01 && BOOLCFG.S.A0005 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [5] - - - label: - "Step 4f: Read the feature dependent(BOOLCFG.S.F02) attribute in - AttributeList" - PICS: BOOLCFG.S.F02 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [4] - - - label: - "Step 4g: Read the feature dependent(BOOLCFG.S.F03) attribute in - AttributeList" - PICS: BOOLCFG.S.F03 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1] - - - label: - "Step 4h: Read the feature dependent(BOOLCFG.S.F03) optional attribute - in AttributeList" - PICS: BOOLCFG.S.F03 && BOOLCFG.S.A0002 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [2] - - - label: - "Step 4i: TH reads optional (SensorFault) attribute in AttributeList" - PICS: BOOLCFG.S.A0007 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [7] - - - label: "Step 5a: Read the global attribute: EventList" - PICS: - PICS_EVENT_LIST_ENABLED && !BOOLCFG.S.F00 && !BOOLCFG.S.F01 && - !BOOLCFG.S.E01 - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list - - - label: - "Step 5b: Read the feature dependent(BOOLCFG.S.F00) - (AlarmsStateChanged) event in EventList" - PICS: PICS_EVENT_LIST_ENABLED && BOOLCFG.S.F00 - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list - contains: [0] - - - label: - "Step 5c: Read the feature dependent(BOOLCFG.S.F01) - (AlarmsStateChanged) event in EventList" - PICS: PICS_EVENT_LIST_ENABLED && BOOLCFG.S.F01 - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list - contains: [0] - - - label: "Step 5d: Read the optional (SensorFault) event in EventList" - PICS: PICS_EVENT_LIST_ENABLED && BOOLCFG.S.E01 - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list - contains: [1] - - - label: "Step 6a: Read the global attribute: AcceptedCommandList" - PICS: ( !BOOLCFG.S.F00 && !BOOLCFG.S.F01 && !BOOLCFG.S.F02 ) - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - value: [] - constraints: - type: list - - - label: - "Step 6b: Read the feature dependent(BOOLCFG.S.F02) (SuppressAlarm) - command in AcceptedCommandList" - PICS: BOOLCFG.S.F02 - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0] - - - label: - "Step 6c: Read the feature dependent(BOOLCFG.S.F00) - (EnableDisableAlarm) command in AcceptedCommandList" - PICS: BOOLCFG.S.F00 - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [1] - - - label: - "Step 6d: Read the feature dependent(BOOLCFG.S.F01) - (EnableDisableAlarm) command in AcceptedCommandList" - PICS: BOOLCFG.S.F01 - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [1] - - - label: "Step 7: Read the global attribute: GeneratedCommandList" - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_BOOL_1_1.yaml b/src/app/tests/suites/certification/Test_TC_BOOL_1_1.yaml deleted file mode 100644 index d9055041616007..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_BOOL_1_1.yaml +++ /dev/null @@ -1,102 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 68.1.1. [TC-BOOL-1.1] Global attributes with server as DUT - -PICS: - - BOOL.S - -config: - nodeId: 0x12344321 - cluster: "Boolean State" - endpoint: 1 - -tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads from the DUT the ClusterRevision attribute" - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 1 - constraints: - type: int16u - - - label: "Step 3: TH reads from the DUT the FeatureMap attribute" - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: "Step 4: TH reads from the DUT the AttributeList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 4: TH reads from the DUT the AttributeList attribute." - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 65528, 65529, 65531, 65532, 65533] - - - label: "Step 5: TH reads from the DUT the EventList attribute" - PICS: BOOL.S.E00 && PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [0] - constraints: - type: list - - - label: "Step 5: TH reads from the DUT the EventList attribute" - PICS: " !BOOL.S.E00 && PICS_EVENT_LIST_ENABLED " - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list - - - label: "Step 6: TH reads from the DUT the AcceptedCommandList attribute" - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - value: [] - constraints: - type: list - - - label: "Step 7: TH reads from the DUT the GeneratedCommandList attribute" - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_BRBINFO_1_1.yaml b/src/app/tests/suites/certification/Test_TC_BRBINFO_1_1.yaml deleted file mode 100644 index ef95ddd67bb3b9..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_BRBINFO_1_1.yaml +++ /dev/null @@ -1,272 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default - -name: - 130.1.1. [TC-BRBINFO-1.1] Global Attributes for Bridged Device Basic - Information Cluster Cluster [DUT-Server] - -PICS: - - BRBINFO.S - -config: - nodeId: 0x12344321 - cluster: "Bridged Device Basic Information" - endpoint: 3 - -tests: - - label: "Step 1: Wait for the commissioned device to be retrieved" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - #Issue: https://github.com/project-chip/connectedhomeip/issues/30467 - - label: "Step 2: TH reads the ClusterRevision from DUT" - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 2 - constraints: - type: int16u - - - label: "Step 3: TH reads the FeatureMap from DUT" - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: "Step 4a: TH reads AttributeList from DUT" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [17, 65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 4a: TH reads AttributeList from DUT" - PICS: " !PICS_EVENT_LIST_ENABLED " - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [17, 65528, 65529, 65531, 65532, 65533] - - - label: "Step 4b: TH reads optional attribute(VendorName) in AttributeList" - PICS: BRBINFO.S.A0001 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [1] - - - label: "Step 4c: TH reads optional attribute(VendorID) in AttributeList" - PICS: BRBINFO.S.A0002 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [2] - - - label: - "Step 4d: TH reads optional attribute(ProductName) in AttributeList" - PICS: BRBINFO.S.A0003 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [3] - - - label: "Step 4e: TH reads optional attribute(NodeLabel) in AttributeList" - PICS: BRBINFO.S.A0005 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [5] - - - label: - "Step 4f: TH reads optional attribute(HardwareVersion) in - AttributeList" - PICS: BRBINFO.S.A0007 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [7] - - - label: - "Step 4g: TH reads optional attribute(HardwareVersionString) in - AttributeList" - PICS: BRBINFO.S.A0008 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [8] - - - label: - "Step 4h: TH reads optional attribute(SoftwareVersion) in - AttributeList" - PICS: BRBINFO.S.A0009 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [9] - - - label: - "Step 4i: TH reads optional attribute(SoftwareVersionString) in - AttributeList" - PICS: BRBINFO.S.A000a - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [10] - - - label: - "Step 4j: TH reads optional attribute(ManufacturingDate) in - AttributeList" - PICS: BRBINFO.S.A000b - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [11] - - - label: "Step 4k: TH reads optional attribute(PartNumber) in AttributeList" - PICS: BRBINFO.S.A000c - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [12] - - - label: "Step 4l: TH reads optional attribute(ProductURL) in AttributeList" - PICS: BRBINFO.S.A000d - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [13] - - - label: - "Step 4m: TH reads optional attribute(ProductLabel) in AttributeList" - PICS: BRBINFO.S.A000e - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [14] - - - label: - "Step 4n: TH reads optional attribute(SerialNumber) in AttributeList" - PICS: BRBINFO.S.A000f - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [15] - - - label: "Step 4o: TH reads optional attribute(UniqueID) in AttributeList" - PICS: BRBINFO.S.A0012 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [18] - - - label: - "Step 4p: TH reads optional attribute(ProductAppearance) in - AttributeList" - PICS: BRBINFO.S.A0014 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [20] - - - label: "Step 5a: TH reads from the DUT the EventList attribute" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list - contains: [3] - - - label: "Step 5b: TH reads optional event(StartUp) in EventList" - PICS: BRBINFO.S.E00 && PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list - contains: [0] - - - label: "Step 5c: TH reads optional attribute(ShutDown) in EventList" - PICS: BRBINFO.S.E01 && PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list - contains: [1] - - - label: "Step 5d TH reads optional attribute(Leave) in EventList" - PICS: BRBINFO.S.E02 && PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list - contains: [2] - - - label: "Step 6: TH reads AcceptedCommandList from DUT" - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - value: [] - constraints: - type: list - - - label: "Step 7: TH1 reads GeneratedCommandList from DUT" - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_CC_1_1.yaml b/src/app/tests/suites/certification/Test_TC_CC_1_1.yaml deleted file mode 100644 index b80e541799ba32..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_CC_1_1.yaml +++ /dev/null @@ -1,850 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 25.1.1. [TC-CC-1.1] Global attributes with server as DUT - -PICS: - - CC.S - -config: - nodeId: 0x12344321 - cluster: "Color Control" - endpoint: 1 - -tests: - - label: "Step 1: Commission DUT to TH" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: - "Step 2: TH reads from the DUT the (0xFFFD) ClusterRevision attribute" - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 6 - constraints: - type: int16u - - - label: "Step 3a: TH reads from the DUT the (0xFFFC) FeatureMap attribute" - PICS: ( !CC.S.F00 && !CC.S.F01 && !CC.S.F02 && !CC.S.F03 && !CC.S.F04 ) - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: - "Step 3b: Given CC.S.F00(HS) ensure featuremap has the correct bit set" - PICS: CC.S.F00 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x1] - - - label: - "Step 3c: Given CC.S.F01(EHue) ensure featuremap has the correct bit - set" - PICS: CC.S.F01 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x2] - - - label: - "Step 3d: Given CC.S.F02(CL) ensure featuremap has the correct bit set" - PICS: CC.S.F02 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x4] - - - label: - "Step 3e: Given CC.S.F03(XY) ensure featuremap has the correct bit set" - PICS: CC.S.F03 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x8] - - - label: - "Step 3f: Given CC.S.F04(CT) ensure featuremap has the correct bit set" - PICS: CC.S.F04 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x10] - - - label: - "Step 4a: TH reads from the DUT the (0xFFFB) AttributeList attribute" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: - [ - 8, - 15, - 16, - 16385, - 16394, - 65528, - 65529, - 65530, - 65531, - 65532, - 65533, - ] - - - label: - "Step 4a: TH reads from the DUT the (0xFFFB) AttributeList attribute" - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: - [8, 15, 16, 16385, 16394, 65528, 65529, 65531, 65532, 65533] - - - label: - "Step 4b: TH reads feature dependent attribute (CurrentHue) in - AttributeList" - PICS: CC.S.F00 && CC.S.A0000 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0] - - - label: - "Step 4c: TH reads feature dependent attribute (CurrentSaturation) in - AttributeList" - PICS: CC.S.F00 && CC.S.A0001 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [1] - - - label: - "Step 4d: TH reads the optional attribute(RemainingTime) in - AttributeList" - PICS: CC.S.A0002 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [2] - - - label: - "Step 4e: TH reads feature dependent attribute (CurrentX) in - AttributeList" - PICS: CC.S.F03 && CC.S.A0003 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [3] - - - label: - "Step 4f: TH reads feature dependent attribute (CurrentY) in - AttributeList" - PICS: CC.S.F03 && CC.S.A0004 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [4] - - - label: - "Step 4g: TH reads the optional attribute(DriftCompensation) in - AttributeList" - PICS: CC.S.A0005 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [5] - - - label: - "Step 4h: TH reads the optional attribute(CompensationText) in - AttributeList" - PICS: CC.S.A0006 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [6] - - - label: - "Step 4i: TH reads feature dependent attribute - (ColorTemperatureMireds) in AttributeList" - PICS: CC.S.F04 && CC.S.A0007 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [7] - - - label: "Step 4j: TH reads the Primary1X attribute in AttributeList" - PICS: CC.S.A0011 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [17] - - - label: "Step 4k: TH reads the Primary1Y attribute in AttributeList" - PICS: CC.S.A0012 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [18] - - - label: - "Step 4l: TH reads the Primary1Intensity attribute in AttributeList" - PICS: CC.S.A0013 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [19] - - - label: "Step 4m: TH reads the Primary2X attribute in AttributeList" - PICS: CC.S.A0015 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [21] - - - label: "Step 4n: TH reads the Primary2Y attribute in AttributeList" - PICS: CC.S.A0016 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [22] - - - label: - "Step 4o: TH reads the Primary2Intensity attribute in AttributeList" - PICS: CC.S.A0017 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [23] - - - label: "Step 4p: TH reads the Primary3X attribute in AttributeList" - PICS: CC.S.A0019 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [25] - - - label: "Step 4q: TH reads the Primary3Y attribute in AttributeList" - PICS: CC.S.A001a - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [26] - - - label: - "Step 4r: TH reads the Primary3Intensity attribute in AttributeList" - PICS: CC.S.A001b - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [27] - - - label: "Step 4s: TH reads the Primary4X attribute in AttributeList" - PICS: CC.S.A0020 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [32] - - - label: "Step 4t: TH reads the Primary4Y attribute in AttributeList" - PICS: CC.S.A0021 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [33] - - - label: - "Step 4u: TH reads the Primary4Intensity attribute in AttributeList" - PICS: CC.S.A0022 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [34] - - - label: "Step 4v: TH reads the Primary5X attribute in AttributeList" - PICS: CC.S.A0024 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [36] - - - label: "Step 4w: TH reads the Primary5Y attribute in AttributeList" - PICS: CC.S.A0025 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [37] - - - label: - "Step 4x: TH reads the Primary5Intensity attribute in AttributeList" - PICS: CC.S.A0026 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [38] - - - label: "Step 4y: TH reads the Primary6X attribute in AttributeList" - PICS: CC.S.A0028 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [40] - - - label: "Step 4z: TH reads the Primary6Y attribute in AttributeList" - PICS: CC.S.A0029 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [41] - - - label: - "Step 4a1: TH reads the Primary6Intensity attribute in AttributeList" - PICS: CC.S.A002a - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [42] - - - label: - "Step 4a2: TH reads the optional attribute(WhitePointX) in - AttributeList" - PICS: CC.S.A0030 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [48] - - - label: - "Step 4a3: TH reads the optional attribute(WhitePointY) in - AttributeList" - PICS: CC.S.A0031 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [49] - - - label: - "Step 4a4: TH reads the optional attribute(ColorPointRX) in - AttributeList" - PICS: CC.S.A0032 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [50] - - - label: - "Step 4a5: TH reads the optional attribute(ColorPointRY) in - AttributeList" - PICS: CC.S.A0033 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [51] - - - label: - "Step 4a6: TH reads the optional attribute(ColorPointRIntensity) in - AttributeList" - PICS: CC.S.A0034 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [52] - - - label: - "Step 4a7: TH reads the optional attribute(ColorPointGX) in - AttributeList" - PICS: CC.S.A0036 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [54] - - - label: - "Step 4a8: TH reads the optional attribute(ColorPointGY) in - AttributeList" - PICS: CC.S.A0037 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [55] - - - label: - "Step 4a9: TH reads the optional attribute(ColorPointGIntensity) in - AttributeList" - PICS: CC.S.A0038 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [56] - - - label: - "Step 4a10: TH reads the optional attribute(ColorPointBX) in - AttributeList" - PICS: CC.S.A003a - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [58] - - - label: - "Step 4a11: TH reads the optional attribute(ColorPointBY) in - AttributeList" - PICS: CC.S.A003b - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [59] - - - label: - "Step 4a12: TH reads the optional attribute(ColorPointBIntensity) in - AttributeList" - PICS: CC.S.A003c - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [60] - - - label: - "Step 4a13: TH reads feature dependent attribute (EnhancedCurrentHue) - in AttributeList" - PICS: CC.S.F01 && CC.S.A4000 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [16384] - - - label: - "Step 4a14: TH reads feature dependent attribute (ColorLoopActive) in - AttributeList" - PICS: CC.S.F02 && CC.S.A4002 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [16386] - - - label: - "Step 4a15: TH reads feature dependent attribute (ColorLoopDirection) - in AttributeList" - PICS: CC.S.F02 && CC.S.A4003 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [16387] - - - label: - "Step 4a16: TH reads feature dependent attribute (ColorLoopTime) in - AttributeList" - PICS: CC.S.F02 && CC.S.A4004 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [16388] - - - label: - "Step 4a17: TH reads feature dependent attribute - (ColorLoopStartEnhancedHue) in AttributeList" - PICS: CC.S.F02 && CC.S.A4005 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [16389] - - - label: - "Step 4a18: TH reads feature dependent attribute - (ColorLoopStoredEnhancedHue) in AttributeList" - PICS: CC.S.F02 && CC.S.A4006 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [16390] - - - label: - "Step 4a19: TH reads feature dependent attribute - (ColorTempPhysicalMinMireds) in AttributeList" - PICS: CC.S.F04 && CC.S.A400b - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [16395] - - - label: - "Step 4a20: TH reads feature dependent attribute - (ColorTempPhysicalMaxMireds) in AttributeList" - PICS: CC.S.F04 && CC.S.A400c - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [16396] - - - label: - "Step 4a21:TH reads feature dependent attribute - (CoupleColorTempToLevelMinMireds) in AttributeList" - PICS: CC.S.F04 && CC.S.A400d - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [16397] - - - label: - "Step 4a22: TH reads feature dependent attribute - (StartUpColorTemperatureMireds) in AttributeList" - PICS: CC.S.F04 && CC.S.A4010 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [16400] - - - label: "Step 5: TH reads from the DUT the (0xFFFA) EventList attribute" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list - - - label: - "Step 6a: TH reads feature dependent command(MoveToHue) in - AcceptedCommandList" - PICS: CC.S.F00 && CC.S.C00.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0] - - - label: - "Step 6b: TH reads feature dependent command(MoveHue) in - AcceptedCommandList" - PICS: CC.S.F00 && CC.S.C01.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [1] - - - label: - "Step 6c: TH reads feature dependent command(StepHue) in - AcceptedCommandList" - PICS: CC.S.F00 && CC.S.C02.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [2] - - - label: - "Step 6d: TH reads feature dependent command(MoveToSaturation) in - AcceptedCommandList" - PICS: CC.S.F00 && CC.S.C03.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [3] - - - label: - "Step 6e: TH reads feature dependent command(MoveSaturation) in - AcceptedCommandList" - PICS: CC.S.F00 && CC.S.C04.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [4] - - - label: - "Step 6f: TH reads feature dependent command(StepSaturation) in - AcceptedCommandList" - PICS: CC.S.F00 && CC.S.C05.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [5] - - - label: - "Step 6g: TH reads feature dependent command(MoveToHueAndSaturation) - in AcceptedCommandList" - PICS: CC.S.F00 && CC.S.C06.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [6] - - - label: - "Step 6h: TH reads feature dependent command(MoveToColor) in - AcceptedCommandList" - PICS: CC.S.F03 && CC.S.C07.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [7] - - - label: - "Step 6i: TH reads feature dependent command(MoveColor) in - AcceptedCommandList" - PICS: CC.S.F03 && CC.S.C08.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [8] - - - label: - "Step 6j: TH reads feature dependent command(StepColor) in - AcceptedCommandList" - PICS: CC.S.F03 && CC.S.C09.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [9] - - - label: - "Step 6k: TH reads feature dependent command(MoveToColorTemperature) - in AcceptedCommandList" - PICS: CC.S.F04 && CC.S.C0a.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [10] - - - label: - "Step 6l: TH reads feature dependent command(EnhancedMoveToHue) in - AcceptedCommandList" - PICS: CC.S.F01 && CC.S.C40.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [64] - - - label: - "Step 6m: TH reads feature dependent command(EnhancedMoveHue) in - AcceptedCommandList" - PICS: CC.S.F01 && CC.S.C41.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [65] - - - label: - "Step 6n: TH reads feature dependent command(EnhancedStepHue) in - AcceptedCommandList" - PICS: CC.S.F01 && CC.S.C42.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [66] - - - label: - "Step 6o:TH reads feature dependent - command(EnhancedMoveToHueAndSaturation) in AcceptedCommandList" - PICS: CC.S.F01 && CC.S.C43.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [67] - - - label: - "Step 6p: TH reads feature dependent command(ColorLoopSet) in - AcceptedCommandList" - PICS: CC.S.F02 && CC.S.C44.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [68] - - - label: - "Step 6q: TH reads feature dependent command(StopMoveStep) in - AcceptedCommandList" - PICS: CC.S.F00 && CC.S.F03 && CC.S.F04 && CC.S.C47.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [71] - - - label: - "Step 6r: TH reads feature dependent command(StopMoveStep) in - AcceptedCommandList" - PICS: CC.S.F04 && CC.S.C4b.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [75] - - - label: - "Step 6s: TH reads feature dependent command(StepColorTemperature) in - AcceptedCommandList" - PICS: CC.S.F04 && CC.S.C4c.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [76] - - - label: - "Step 7: TH reads from the DUT the (0xFFF8) GeneratedCommandList - attribute" - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_CGEN_1_1.yaml b/src/app/tests/suites/certification/Test_TC_CGEN_1_1.yaml deleted file mode 100644 index 983b77c6b33a4f..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_CGEN_1_1.yaml +++ /dev/null @@ -1,92 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 90.1. [TC-CGEN-1.1] Global Attributes [DUT-Server] - -PICS: - - CGEN.S - -config: - nodeId: 0x12344321 - cluster: "General Commissioning" - endpoint: 0 - -tests: - - label: "Step 1: Wait for the commissioned device to be retrieved" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: Read the global attribute: ClusterRevision" - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 1 - constraints: - type: int16u - - - label: "Step 3: Read the global attribute: FeatureMap" - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: "Step 4: Read the global attribute: AttributeList" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: - [0, 1, 2, 3, 4, 65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 4: Read the global attribute: AttributeList" - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 2, 3, 4, 65528, 65529, 65531, 65532, 65533] - - - label: "Step 5: Read the global attribute: EventList" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list - - - label: "Step 6: Read the global attribute: AcceptedCommandList" - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0, 2, 4] - - - label: "Step 7: Read the global attribute: GeneratedCommandList" - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - constraints: - type: list - contains: [1, 3, 5] diff --git a/src/app/tests/suites/certification/Test_TC_CHANNEL_1_6.yaml b/src/app/tests/suites/certification/Test_TC_CHANNEL_1_6.yaml deleted file mode 100644 index fb0379c14734f2..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_CHANNEL_1_6.yaml +++ /dev/null @@ -1,178 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: - 19.1.6. [TC-CHANNEL-1.6] Global attributes - Channel Cluster (DUT as Server) - -PICS: - - CHANNEL.S - -config: - nodeId: 0x12344321 - cluster: "Channel" - endpoint: 1 - -tests: - - label: "Wait for the commissioned device to be retrieved" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 1: read the global attribute: ClusterRevision" - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 2 - constraints: - type: int16u - - - label: "Step 2a: Read the global attribute: FeatureMap" - PICS: ( !CHANNEL.S.F00 && !CHANNEL.S.F01 ) - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: - "Step 2b: Given CCHANNEL.S.F00(CL) ensure featuremap has the correct - bit set" - PICS: CHANNEL.S.F00 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x1] - - - label: - "Step 2c: Given CHANNEL.S.F01(LI) ensure featuremap has the correct - bit set" - PICS: CHANNEL.S.F01 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x2] - - - label: "Step 3a: Read the global attribute: AttributeList" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 3a: Read the global attribute: AttributeList" - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [65528, 65529, 65531, 65532, 65533] - - - label: "Step 3b: Read the optional attribute(ChannelList): AttributeList" - PICS: CHANNEL.S.A0000 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0] - - - label: "Step 3c: Reading optional attribute(Lineup) in AttributeList" - PICS: CHANNEL.S.A0001 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [1] - - - label: - "Step 3d: Read the optional attribute(CurrentChannel): AttributeList" - PICS: CHANNEL.S.A0002 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [2] - - - label: - "Step 4a: Read the optional command(ChangeChannel) in - AcceptedCommandList" - PICS: CHANNEL.S.C00.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0] - - - label: - "Step 4b: Read the optional command(ChangeChannelByNumber) in - AcceptedCommandList" - PICS: CHANNEL.S.C02.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [2] - - - label: - "Step 4c: Read the optional command(SkipChannel) in - AcceptedCommandList" - PICS: CHANNEL.S.C03.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [3] - - - label: "Step 5a: Read the global attribute: GeneratedCommandList" - PICS: ( !CHANNEL.S.F00 && !CHANNEL.S.F01 ) - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [] - constraints: - type: list - - - label: "Step 5b: Read the global attribute: GeneratedCommandList" - PICS: CHANNEL.S.F00 || CHANNEL.S.F01 - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - constraints: - type: list - contains: [1] - - - label: "Step 6: Read the global attribute: EventList" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_CONCON_1_14.yaml b/src/app/tests/suites/certification/Test_TC_CONCON_1_14.yaml deleted file mode 100644 index 1b9c2215d3e0ce..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_CONCON_1_14.yaml +++ /dev/null @@ -1,149 +0,0 @@ -# Copyright (c) 2023 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default - -name: - 19.1.14. [TC-CONCON-1.14] Global attributes - Content Control Cluster (DUT - as Server) - -PICS: - - CONCON.S - -config: - nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 - -tests: - - label: "Step 1: TH reads the ClusterRevision attribute from the DUT" - verification: | - ./chip-tool contentcontrol read cluster-revision 1 1 - - [1704869094.517260][4293:4295] CHIP:DMG: } - [1704869094.517545][4293:4295] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_050F Attribute 0x0000_FFFD DataVersion: 1251967611 - [1704869094.517631][4293:4295] CHIP:TOO: ClusterRevision: 1 - [1704869094.518028][4293:4295] CHIP:EM: <<< [E:20721i S:28265 M:144462024 (Ack:200262914)] (S) Msg TX to 1:0000000000000001 [EF1D] [UDP:[fe80::e65f:1ff:fe49:ae1b%wlan0]:5640] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1704869094.518235][4293:4295] CHIP:EM: Flushed pending ack for MessageCounter:200262914 on exchange 20721i - disabled: true - - label: "Step 2: TH reads the FeatureMap attribute from the DUT" - - verification: | - ./chip-tool contentcontrol read feature-map 1 1 - - [1704869124.605470][4296:4298] CHIP:DMG: InteractionModelRevision = 11 - [1704869124.605531][4296:4298] CHIP:DMG: } - [1704869124.605872][4296:4298] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_050F Attribute 0x0000_FFFC DataVersion: 1251967611 - [1704869124.605970][4296:4298] CHIP:TOO: FeatureMap: 0 - [1704869124.606460][4296:4298] CHIP:EM: <<< [E:55393i S:13705 M:14084931 (Ack:173736992)] (S) Msg TX to 1:0000000000000001 [EF1D] [UDP:[fe80::e65f:1ff:fe49:ae1b%wlan0]:5640] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1704869124.606702][4296:4298] CHIP:EM: Flushed pending ack for MessageCounter:173736992 on exchange 55393i - [1704869124.607077][4296:4296] CHIP:CTL: Shutting down the commissioner - disabled: true - - - label: "Step 3: TH reads the AttributeList attribute from the DUT" - verification: | - ./chip-tool contentcontrol read attribute-list 1 1 - - [1704869156.246646][4299:4301] CHIP:DMG: InteractionModelRevision = 11 - [1704869156.246689][4299:4301] CHIP:DMG: } - [1704869156.247013][4299:4301] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_050F Attribute 0x0000_FFFB DataVersion: 1251967611 - [1704869156.248939][4299:4301] CHIP:TOO: AttributeList: 13 entries - [1704869156.248979][4299:4301] CHIP:TOO: [1]: 0 - [1704869156.249005][4299:4301] CHIP:TOO: [2]: 1 - [1704869156.249031][4299:4301] CHIP:TOO: [3]: 2 - [1704869156.249055][4299:4301] CHIP:TOO: [4]: 3 - [1704869156.249080][4299:4301] CHIP:TOO: [5]: 4 - [1704869156.249105][4299:4301] CHIP:TOO: [6]: 5 - [1704869156.249130][4299:4301] CHIP:TOO: [7]: 6 - [1704869156.249154][4299:4301] CHIP:TOO: [8]: 7 - [1704869156.249180][4299:4301] CHIP:TOO: [9]: 65528 - [1704869156.249204][4299:4301] CHIP:TOO: [10]: 65529 - [1704869156.249229][4299:4301] CHIP:TOO: [11]: 65531 - [1704869156.249254][4299:4301] CHIP:TOO: [12]: 65532 - [1704869156.249279][4299:4301] CHIP:TOO: [13]: 65533 - [1704869156.249630][4299:4301] CHIP:EM: <<< [E:14371i S:6146 M:117952128 (Ack:180483729)] (S) Msg TX to 1:0000000000000001 [EF1D] [UDP:[fe80::e65f:1ff:fe49:ae1b%wlan0]:5640] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1704869156.249770][4299:4301] CHIP:EM: Flushed pending ack for MessageCounter:180483729 on exchange 14371i - disabled: true - - - label: "Step 4: TH reads the AcceptedCommandList attribute from the DUT" - verification: | - ./chip-tool contentcontrol read accepted-command-list 1 1 - [1704869442.419331][4306:4308] CHIP:DMG: SuppressResponse = true, - [1704869442.419358][4306:4308] CHIP:DMG: InteractionModelRevision = 11 - [1704869442.419382][4306:4308] CHIP:DMG: } - [1704869442.419678][4306:4308] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_050F Attribute 0x0000_FFF9 DataVersion: 1251967611 - [1704869442.419774][4306:4308] CHIP:TOO: AcceptedCommandList: 10 entries - [1704869442.419808][4306:4308] CHIP:TOO: [1]: 0 - [1704869442.419835][4306:4308] CHIP:TOO: [2]: 1 - [1704869442.419860][4306:4308] CHIP:TOO: [3]: 3 - [1704869442.419885][4306:4308] CHIP:TOO: [4]: 4 - [1704869442.419909][4306:4308] CHIP:TOO: [5]: 5 - [1704869442.419933][4306:4308] CHIP:TOO: [6]: 6 - [1704869442.419958][4306:4308] CHIP:TOO: [7]: 7 - [1704869442.419982][4306:4308] CHIP:TOO: [8]: 8 - [1704869442.420006][4306:4308] CHIP:TOO: [9]: 9 - [1704869442.420031][4306:4308] CHIP:TOO: [10]: 10 - [1704869442.420310][4306:4308] CHIP:EM: <<< [E:22515i S:37055 M:163291838 (Ack:95370016)] (S) Msg TX to 1:0000000000000001 [EF1D] [UDP:[fe80::e65f:1ff:fe49:ae1a%wlan0]:5640] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1704869442.420470][4306:4308] CHIP:EM: Flushed pending ack for MessageCounter:95370016 on exchange 22515i - disabled: true - - - label: "Step 5: TH reads the GeneratedCommandList attribute from the DUT" - verification: | - ./chip-tool contentcontrol read generated-command-list 1 1 - - [1704869486.142562][4311:4313] CHIP:DMG: SuppressResponse = true, - [1704869486.142591][4311:4313] CHIP:DMG: InteractionModelRevision = 11 - [1704869486.142617][4311:4313] CHIP:DMG: } - [1704869486.142837][4311:4313] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_050F Attribute 0x0000_FFF8 DataVersion: 1251967611 - [1704869486.142903][4311:4313] CHIP:TOO: GeneratedCommandList: 1 entries - [1704869486.142938][4311:4313] CHIP:TOO: [1]: 2 - [1704869486.143197][4311:4313] CHIP:EM: <<< [E:58684i S:20913 M:112498974 (Ack:84853992)] (S) Msg TX to 1:0000000000000001 [EF1D] [UDP:[fe80::e65f:1ff:fe49:ae1a%wlan0]:5640] --- Type 0000:10 (SecureChannel:StandaloneAck) - disabled: true - - - label: "Step 6: TH reads the EventList attribute from the DUT" - verification: | - ./chip-tool contentcontrol read event-list 1 1 - - [1704869518.133231][4314:4316] CHIP:EM: Rxd Ack; Removing MessageCounter:245792542 from Retrans Table on exchange 18480i - [1704869518.133334][4314:4316] CHIP:DMG: ReportDataMessage = - [1704869518.133370][4314:4316] CHIP:DMG: { - [1704869518.133398][4314:4316] CHIP:DMG: AttributeReportIBs = - [1704869518.133440][4314:4316] CHIP:DMG: [ - [1704869518.133472][4314:4316] CHIP:DMG: AttributeReportIB = - [1704869518.133515][4314:4316] CHIP:DMG: { - [1704869518.133549][4314:4316] CHIP:DMG: AttributeStatusIB = - [1704869518.133594][4314:4316] CHIP:DMG: { - [1704869518.133631][4314:4316] CHIP:DMG: AttributePathIB = - [1704869518.133674][4314:4316] CHIP:DMG: { - [1704869518.133720][4314:4316] CHIP:DMG: Endpoint = 0x1, - [1704869518.133764][4314:4316] CHIP:DMG: Cluster = 0x50f, - [1704869518.133809][4314:4316] CHIP:DMG: Attribute = 0x0000_FFFA, - [1704869518.133850][4314:4316] CHIP:DMG: } - [1704869518.133946][4314:4316] CHIP:DMG: - [1704869518.133988][4314:4316] CHIP:DMG: StatusIB = - [1704869518.134031][4314:4316] CHIP:DMG: { - [1704869518.134072][4314:4316] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), - [1704869518.134144][4314:4316] CHIP:DMG: }, - [1704869518.134189][4314:4316] CHIP:DMG: - [1704869518.134226][4314:4316] CHIP:DMG: }, - [1704869518.134268][4314:4316] CHIP:DMG: - [1704869518.134324][4314:4316] CHIP:DMG: }, - [1704869518.134368][4314:4316] CHIP:DMG: - [1704869518.134398][4314:4316] CHIP:DMG: ], - [1704869518.134438][4314:4316] CHIP:DMG: - [1704869518.134469][4314:4316] CHIP:DMG: SuppressResponse = true, - [1704869518.134501][4314:4316] CHIP:DMG: InteractionModelRevision = 11 - [1704869518.134531][4314:4316] CHIP:DMG: } - [1704869518.134726][4314:4316] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) - [1704869518.135007][4314:4316] CHIP:EM: <<< [E:18480i S:40415 M:245792543 (Ack:116804273)] (S) Msg TX to 1:0000000000000001 [EF1D] [UDP:[fe80::e65f:1ff:fe49:ae1a%wlan0]:5640] --- Type 0000:10 (SecureChannel:StandaloneAck) - disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_CONTENTLAUNCHER_1_11.yaml b/src/app/tests/suites/certification/Test_TC_CONTENTLAUNCHER_1_11.yaml deleted file mode 100644 index a30b8ce2df79e2..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_CONTENTLAUNCHER_1_11.yaml +++ /dev/null @@ -1,151 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: - 19.1.11. [TC-CONTENTLAUNCHER-1.11] Global attributes - Content Launcher - Cluster (DUT as Server) - -PICS: - - CONTENTLAUNCHER.S - -config: - nodeId: 0x12344321 - cluster: "Content Launcher" - endpoint: 1 - -tests: - - label: "Wait for the commissioned device to be retrieved" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 1: TH reads the ClusterRevision attribute from the DUT" - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 2 - constraints: - type: int16u - - - label: "Step 2a: TH reads the FeatureMap attribute from the DUT" - PICS: ( !CONTENTLAUNCHER.S.F00 && !CONTENTLAUNCHER.S.F01 ) - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: - "Step 2b: Given CONTENTLAUNCHER.S.F00 (CS) ensure featuremap has the - correct bit set" - PICS: CONTENTLAUNCHER.S.F00 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x1] - - - label: - "Step 2c: Given CONTENTLAUNCHER.S.F01(UP) ensure featuremap has the - correct bit set" - PICS: CONTENTLAUNCHER.S.F01 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x2] - - - label: "Step 3a: TH reads the AttributeList attribute from the DUT" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 3a: TH reads the AttributeList attribute from the DUT" - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [65528, 65529, 65531, 65532, 65533] - - - label: - "Step 3b: TH reads the optional attribute(AcceptHeader): AttributeList" - PICS: CONTENTLAUNCHER.S.A0000 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0] - - - label: - "Step 3c: TH reads the optional - attribute(SupportedStreamingProtocols): AttributeList" - PICS: CONTENTLAUNCHER.S.A0001 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [1] - - - label: - "Step 4a: TH reads the optional command(LaunchContent) in - AcceptedCommandList attribute" - PICS: CONTENTLAUNCHER.C.C00.Tx - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0] - - - label: - "Step 4b: TH reads the optional command(LaunchURL) in - AcceptedCommandList attribute" - PICS: CONTENTLAUNCHER.C.C01.Tx - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [1] - - - label: "Step 5: TH reads the GeneratedCommandList attribute from the DUT" - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - constraints: - type: list - contains: [2] - - - label: "Step 6: TH reads the EventList attribute from the DUT" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_DEMM_1_1.yaml b/src/app/tests/suites/certification/Test_TC_DEMM_1_1.yaml deleted file mode 100644 index b2f927d14fd554..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_DEMM_1_1.yaml +++ /dev/null @@ -1,116 +0,0 @@ -# Copyright (c) 2024 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 241.1.1. [TC-DEMM-1.1] Global attributes with DUT as Server - -PICS: - - DEMM.S - -config: - nodeId: 0x12344321 - cluster: "Device Energy Management Mode" - endpoint: 1 - -tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads from the DUT the ClusterRevision attribute" - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 1 - constraints: - type: int16u - - #https://github.com/project-chip/connectedhomeip/issues/31599 - - label: "Step 3: TH reads from the DUT the FeatureMap attribute" - verification: | - ./chip-tool deviceenergymanagementmode read feature-map 1 1 - - On the TH(Chip-tool) Log, Verify featureMap value is 0 and below is the sample log provided for the raspi platform: - - [1707803263.396282][12695:12697] CHIP:DMG: } - [1707803263.396447][12695:12697] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_009F Attribute 0x0000_FFFC DataVersion: 3404644350 - [1707803263.396492][12695:12697] CHIP:TOO: FeatureMap: 0 - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_SKIP_SAMPLE_APP - arguments: - values: - - name: "message" - value: "Enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: "Step 4: TH reads from the DUT the AttributeList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 4a: TH reads from the DUT the AttributeList attribute." - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 65528, 65529, 65531, 65532, 65533] - - - label: - "Step 4b: TH reads optional attribute (StartUpMode) in AttributeList - from DUT" - PICS: DEMM.S.A0002 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [2] - - - label: "Step 5: TH reads from the DUT the EventList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list - - - label: "Step 6: TH reads from the DUT the AcceptedCommandList attribute." - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - value: [0] - constraints: - type: list - - - label: "Step 7: TH reads from the DUT the GeneratedCommandList attribute." - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [1] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_DESC_1_1.yaml b/src/app/tests/suites/certification/Test_TC_DESC_1_1.yaml deleted file mode 100644 index cb6ce46a174404..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_DESC_1_1.yaml +++ /dev/null @@ -1,114 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 84.1.1. [TC-DESC-1.1] Global Attributes with DUT as Server - -PICS: - - DESC.S - -config: - nodeId: 0x12344321 - cluster: "Descriptor" - endpoint: 0 - -tests: - - label: "Step 1: Wait for the commissioned device to be retrieved" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads from the DUT the ClusterRevision attribute." - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 2 - constraints: - type: int16u - - - label: "Step 3: TH reads from the DUT the FeatureMap attribute." - PICS: "!DESC.S.F00" - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksClear: [0x1] - - - label: - "Step 3: TH reads from the DUT the FeatureMap attribute. 0x0001: SHALL - be included if and only if DESC.S.F00(TagList)" - PICS: DESC.S.F00 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x1] - - - label: "Step 4a: TH reads from the DUT the AttributeList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 2, 3, 65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 4a: TH reads from the DUT the AttributeList attribute." - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 2, 3, 65528, 65529, 65531, 65532, 65533] - - - label: - "Step 4b: TH reads from the DUT the AttributeList attribute. 0x0004: - SHALL be included if and only if DESC.S.F00" - PICS: DESC.S.F00 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [4] - - - label: "Step 5: TH reads from the DUT the EventList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list - - - label: "Step 6: TH reads AcceptedCommandList attribute from DUT" - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - value: [] - constraints: - type: list - - - label: "Step 7: TH reads GeneratedCommandList attribute from DUT" - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_DGETH_1_1.yaml b/src/app/tests/suites/certification/Test_TC_DGETH_1_1.yaml deleted file mode 100644 index 4c101adf4a3de8..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_DGETH_1_1.yaml +++ /dev/null @@ -1,216 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default - -name: 47.1.1. [TC-DGETH-1.1] Global Attributes with DUT as Server - -PICS: - - DGETH.S - -config: - nodeId: 0x12344321 - cluster: "Ethernet Network Diagnostics" - endpoint: 0 - -tests: - - label: "Step 1: Wait for the commissioned device to be retrieved" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads the ClusterRevision from DUT" - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 1 - constraints: - type: int16u - - - label: "Step 3a: TH reads the FeatureMap from DUT" - PICS: " !DGETH.S.F00 && !DGETH.S.F01" - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: - "Step 3b: Given DGETH.S.F00 ensure featuremap has the correct bit set" - PICS: DGETH.S.F00 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x1] - - - label: - "Step 3c: Given DGETH.S.F01 ensure featuremap has the correct bit set" - PICS: DGETH.S.F01 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x2] - - - label: "Step 4a: TH reads AttributeList from DUT" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 4a: TH reads AttributeList from DUT" - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [65528, 65529, 65531, 65532, 65533] - - - label: "Step 4b: TH reads optional attribute(PHYRate) in AttributeList" - PICS: DGETH.S.A0000 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0] - - - label: "Step 4c: TH reads optional attribute(FullDuplex) in AttributeList" - PICS: DGETH.S.A0001 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [1] - - - label: - "Step 4d: TH reads optional attribute(PacketRxCount) and Feature - dependent(DGETH.S.F00(PKTCNT)) in AttributeList" - PICS: DGETH.S.A0002 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [2] - - - label: - "Step 4e: TH reads optional attribute(PacketRxCount) and Feature - dependent(DGETH.S.F00(PKTCNT)) in AttributeList" - PICS: DGETH.S.A0003 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [3] - - - label: - "Step 4f: TH reads optional attribute(PacketRxCount) and Feature - dependent(DGETH.S.F01(ERRCNT)) in AttributeList" - PICS: DGETH.S.A0004 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [4] - - - label: - "Step 4g: TH reads optional attribute(PacketRxCount) and Feature - dependent(DGETH.S.F01(ERRCNT)) in AttributeList" - PICS: DGETH.S.A0005 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [5] - - - label: - "Step 4h: TH reads optional attribute(PacketRxCount) and Feature - dependent(DGETH.S.F01(ERRCNT)) in AttributeList" - PICS: DGETH.S.A0006 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [6] - - - label: - "Step 4i: TH reads optional attribute(CarrierDetect) in AttributeList" - PICS: DGETH.S.A0007 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [7] - - - label: - "Step 4j: TH reads optional attribute(TimeSinceReset) in AttributeList" - PICS: DGETH.S.A0008 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [8] - - - label: "Step 5: TH reads EventList from DUT" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list - - - label: "Step 6: TH reads AcceptedCommandList from DUT" - PICS: ( DGETH.S.F00 || DGETH.S.F01 ) - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0] - - - label: "Step 6: TH reads AcceptedCommandList from DUT" - PICS: " !DGETH.S.F00 && !DGETH.S.F01 " - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - value: [] - constraints: - type: list - - - label: "Step 7: TH reads GeneratedCommandList from DUT" - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_DGGEN_1_1.yaml b/src/app/tests/suites/certification/Test_TC_DGGEN_1_1.yaml deleted file mode 100644 index 6641fcf879939c..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_DGGEN_1_1.yaml +++ /dev/null @@ -1,193 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 88.1.1. [TC-DGGEN-1.1] Global Attributes with DUT as Server - -PICS: - - DGGEN.S - -config: - nodeId: 0x12344321 - cluster: "General Diagnostics" - endpoint: 0 - -tests: - - label: "Step 1: Wait for the commissioned device to be retrieved" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads from the DUT the ClusterRevision attribute." - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 2 - constraints: - type: int16u - - - label: "Step 3: TH reads from the DUT the FeatureMap attribute." - PICS: "!DGGEN.S.F00" - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: "Step 3: TH reads from the DUT the FeatureMap attribute." - PICS: DGGEN.S.F00 - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 1 - constraints: - type: bitmap32 - - - label: "Step 4a: TH reads from the DUT the AttributeList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 8, 65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 4a: TH reads from the DUT the AttributeList attribute." - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 8, 65528, 65529, 65531, 65532, 65533] - - - label: - "Step 4b: Validate presence of mandatory attribute(UpTime) in - AttributeList" - PICS: DGGEN.S.A0002 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [2] - - - label: - "Step 4c: TH reads optional attribute(TotalOperationalHours) in - AttributeList" - PICS: DGGEN.S.A0003 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [3] - - - label: "Step 4d: TH reads optional attribute(BootReason) in AttributeList" - PICS: DGGEN.S.A0004 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [4] - - - label: - "Step 4e: TH reads optional attribute(ActiveHardwareFaults) in - AttributeList" - PICS: DGGEN.S.A0005 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [5] - - - label: - "Step 4f: TH reads optional attribute(ActiveRadioFaults) in - AttributeList" - PICS: DGGEN.S.A0006 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [6] - - - label: - "Step 4g: TH reads optional attribute(ActiveNetworkFaults) in - AttributeList" - PICS: DGGEN.S.A0007 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [7] - - - label: "Step 5a: TH reads from the DUT the EventList attribute" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list - contains: [3] - - - label: - "Step 5b: TH reads optional event(HardwareFaultChange) in EventList" - PICS: DGGEN.S.E00 && PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list - contains: [0] - - - label: "Step 5c: TH reads optional event(RadioFaultChange) in EventList" - PICS: DGGEN.S.E01 && PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list - contains: [1] - - - label: "Step 5d: TH reads optional event(NetworkFaultChange) in EventList" - PICS: DGGEN.S.E02 && PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list - contains: [2] - - - label: "Step 6: TH reads from the DUT the AcceptedCommandList attribute" - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0, 1] - - - label: "Step 7: TH reads from the DUT the GeneratedCommandList attribute" - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - constraints: - type: list - contains: [2] diff --git a/src/app/tests/suites/certification/Test_TC_DGSW_1_1.yaml b/src/app/tests/suites/certification/Test_TC_DGSW_1_1.yaml deleted file mode 100644 index 0b516f079ca053..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_DGSW_1_1.yaml +++ /dev/null @@ -1,166 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default - -name: 44.1.1. [TC-DGSW-1.1] Global Attributes with DUT as Server - -PICS: - - DGSW.S - -config: - nodeId: 0x12344321 - cluster: "Software Diagnostics" - endpoint: 0 - -tests: - - label: "Step 1: Wait for the commissioned device to be retrieved" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads the ClusterRevision from DUT" - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 1 - constraints: - type: int16u - - - label: "Step 3a: TH reads the FeatureMap from DUT" - PICS: " !DGSW.S.F00 " - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: - "Step 3b: Given DGSW.S.F00(Watermarks) ensure featuremap has the - correct bit set" - PICS: DGSW.S.F00 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x1] - - - label: "Step 4a: TH reads AttributeList from DUT" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 4a: TH reads AttributeList from DUT" - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [65528, 65529, 65531, 65532, 65533] - - - label: - "Step 4b: TH reads optional attribute(ThreadMetrics) in AttributeList" - PICS: DGSW.S.A0000 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0] - - - label: - "Step 4c: TH reads optional attribute(CurrentHeapFree) in - AttributeList" - PICS: DGSW.S.A0001 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [1] - - - label: - "Step 4d: TH reads optional attribute(CurrentHeapUsed) in - AttributeList" - PICS: DGSW.S.A0002 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [2] - - - label: - "Step 4e: TH reads Feature dependent - attribute(CurrentHeapHighWatermark) in AttributeList" - PICS: ( DGSW.S.F00 || DGSW.S.A0003 ) - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [3] - - - label: "Step 5a: TH reads EventList from DUT" - PICS: DGSW.S.E00 && PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list - contains: [0] - - - label: "Step 5b: TH reads EventList from DUT" - PICS: " !DGSW.S.E00 && PICS_EVENT_LIST_ENABLED " - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list - - - label: "Step 6: TH reads AcceptedCommandList from DUT" - PICS: DGSW.S.F00 - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0] - - - label: "Step 6: TH reads AcceptedCommandList from DUT" - PICS: " !DGSW.S.F00 " - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - value: [] - constraints: - type: list - - - label: "Step 7: TH reads GeneratedCommandList from DUT" - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_DGTHREAD_1_1.yaml b/src/app/tests/suites/certification/Test_TC_DGTHREAD_1_1.yaml deleted file mode 100644 index d1c6cd1b889987..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_DGTHREAD_1_1.yaml +++ /dev/null @@ -1,318 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 50.1.1. [TC-DGTHREAD-1.1] Global Attributes [DUT-Server] - -PICS: - - DGTHREAD.S - -config: - nodeId: 0x12344321 - cluster: "Thread Network Diagnostics" - endpoint: 0 - -tests: - - label: "Step 1: Wait for the commissioned device to be retrieved" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads the ClusterRevision from DUT" - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 2 - constraints: - type: int16u - - - label: "Step 3a: TH reads the FeatureMap from DUT" - PICS: - " !DGTHREAD.S.F00 && !DGTHREAD.S.F01 && !DGTHREAD.S.F02 && - !DGTHREAD.S.F03 " - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: - "Step 3b: Given DGTHREAD.S.F00(PKTCNT) ensure featuremap has the - correct bit set" - PICS: DGTHREAD.S.F00 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x1] - - - label: - "Step 3c: Given DGTHREAD.S.F01(ERRCNT) ensure featuremap has the - correct bit set" - PICS: DGTHREAD.S.F01 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x2] - - - label: - "Step 3d: Given DGTHREAD.S.F02(MLECNT) ensure featuremap has the - correct bit set" - PICS: DGTHREAD.S.F02 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x4] - - - label: - "Step 3e: Given DGTHREAD.S.F03(MACCNT) ensure featuremap has the - correct bit set" - PICS: DGTHREAD.S.F03 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x8] - - - label: "Step 4a: TH reads mandatory attributes in AttributeList from DUT" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: - [ - 0, - 1, - 2, - 3, - 4, - 5, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 59, - 60, - 61, - 62, - 65528, - 65529, - 65530, - 65531, - 65532, - 65533, - ] - - - label: "Step 4a: TH reads mandatory attributes in AttributeList from DUT" - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: - [ - 0, - 1, - 2, - 3, - 4, - 5, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 59, - 60, - 61, - 62, - 65528, - 65529, - 65531, - 65532, - 65533, - ] - - - label: - "Step 4b: TH reads Feature dependent attribute(DGTHREAD.S.F01(ERRCNT)) - in attributeList" - PICS: DGTHREAD.S.A0006 && DGTHREAD.S.F01 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [6] - - - label: - "Step 4c: TH reads Feature dependent attribute - (DGTHREAD.S.F02(MLECNT)) in attributeList" - PICS: DGTHREAD.S.F02 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [14, 15, 16, 17, 18, 19, 20, 21] - - - label: - "Step 4d: TH reads Feature dependent attribute - (DGTHREAD.S.F03(MACCNT)) in attributeList" - PICS: DGTHREAD.S.F03 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: - [ - 22, - 23, - 24, - 25, - 26, - 27, - 28, - 29, - 30, - 31, - 32, - 33, - 34, - 35, - 36, - 37, - 38, - 39, - 40, - 41, - 42, - 43, - 44, - 45, - 46, - 47, - 48, - 49, - 50, - 51, - 52, - 53, - 54, - 55, - ] - - - label: - "Step 4e: TH reads the optional attribute (ActiveTimestamp) in - AttributeList" - PICS: DGTHREAD.S.A0038 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [56] - - - label: - "Step 4f: TH reads the optional attribute (PendingTimestamp) in - AttributeList" - PICS: DGTHREAD.S.A0039 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [57] - - - label: "Step 4g: TH reads the optional attribute (Delay) in AttributeList" - PICS: DGTHREAD.S.A003a - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [58] - - - label: "Step 5a: TH reads EventList from DUT" - PICS: " !DGTHREAD.S.E00 && !DGTHREAD.S.E01 && PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list - - - label: - "Step 5b: TH reads DGTHREAD.S.E00(ConnectionStatus) event in EventList" - PICS: DGTHREAD.S.E00 && PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list - contains: [0] - - - label: - "Step 5c: TH reads DGTHREAD.S.E01(NetworkFaultChange) event in - EventList" - PICS: DGTHREAD.S.E01 && PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list - contains: [1] - - - label: "Step 6: TH reads AcceptedCommandList from DUT" - PICS: " !DGTHREAD.S.F01 " - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - value: [] - constraints: - type: list - - - label: "Step 6: TH reads AcceptedCommandList from DUT" - PICS: DGTHREAD.S.F01 - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0] - - - label: "Step 7: TH reads GeneratedCommandList from DUT" - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_DGWIFI_1_1.yaml b/src/app/tests/suites/certification/Test_TC_DGWIFI_1_1.yaml deleted file mode 100644 index 8ac9fd1a0afd2e..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_DGWIFI_1_1.yaml +++ /dev/null @@ -1,195 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 53.1.1. [TC-DGWIFI-1.1] Global Attributes [DUT as Server] - -PICS: - - DGWIFI.S - -config: - nodeId: 0x12344321 - cluster: "WiFi Network Diagnostics" - endpoint: 0 - -tests: - - label: "Step 1: Wait for the commissioned device to be retrieved" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads the ClusterRevision from DUT" - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 1 - constraints: - type: int16u - - - label: "Step 3a: TH reads the FeatureMap from DUT" - PICS: ( !DGWIFI.S.F00 && !DGWIFI.S.F01 ) - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: - "Step 3b: Given DGWIFI.S.F00(PacketCounts) ensure featuremap has the - correct bit set" - PICS: DGWIFI.S.F00 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x1] - - - label: - "Step 3c: Given DGWIFI.S.F01(ErrorCounts) ensure featuremap has the - correct bit set" - PICS: DGWIFI.S.F01 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x2] - - - label: "Step 4a: TH reads AttributeList from DUT" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: - [0, 1, 2, 3, 4, 65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 4a: TH reads AttributeList from DUT" - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 2, 3, 4, 65528, 65529, 65531, 65532, 65533] - - - label: - "Step 4b: TH reads Feature dependent(DGWIFI.S.F00) attributes in - attributeList from DUT" - PICS: DGWIFI.S.F00 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [6, 7, 8, 9, 10] - - - label: - "Step 4c: TH reads Feature dependent(DGWIFI.S.F01) attributes in - attributeList from DUT" - PICS: DGWIFI.S.F01 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [5, 12] - - - label: - "Step 4d: TH reads optional attribute (CurrentMaxRate) in - AttributeList from DUT" - PICS: DGWIFI.S.A000b - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [11] - - - label: "Step 5a: TH reads EventList from DUT" - PICS: - " !DGWIFI.S.E00 && !DGWIFI.S.E01 && !DGWIFI.S.E02 && - PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list - - - label: - "Step 5b: TH reads optional attribute (Disconnection) in EventList - from DUT" - PICS: DGWIFI.S.E00 && PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list - contains: [0] - - - label: - "Step 5c: TH reads optional attribute (AssociationFailure) in - EventList from DUT" - PICS: DGWIFI.S.E01 && PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list - contains: [1] - - - label: - "Step 5d: TH reads optional attribute (ConnectionStatus) in EventList - from DUT" - PICS: DGWIFI.S.E02 && PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list - contains: [2] - - - label: "Step 6a: TH reads AcceptedCommandList from DUT" - PICS: " !DGWIFI.S.F01 " - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - value: [] - constraints: - type: list - - - label: - "Step 6b: TH reads Feature dependent(DGWIFI.S.F01) command in - AcceptedCommandList from DUT" - PICS: DGWIFI.S.F01 - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0] - - - label: "Step 7: TH reads GeneratedCommandList from DUT" - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_DISHALM_1_1.yaml b/src/app/tests/suites/certification/Test_TC_DISHALM_1_1.yaml deleted file mode 100644 index c18c6fc6254636..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_DISHALM_1_1.yaml +++ /dev/null @@ -1,114 +0,0 @@ -# Copyright (c) 2023 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default - -name: 198.1.1. [TC-DISHALM-1.1] Global attributes with DUT as Server - -PICS: - - DISHALM.S - -config: - nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 - -tests: - - label: "Note" - verification: | - Step 5 is currently not supported and SHALL be skipped. - disabled: true - - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - verification: | - - disabled: true - - - label: "Step 2: TH reads from the DUT the ClusterRevision attribute." - verification: | - ./chip-tool dishwasheralarm read cluster-revision 1 1 - Verify the "ClusterRevision" value is of unit16 and reflects the highest revision number 1 on the TH(Chip-tool) and below is the sample log provided for the raspi platform: - - [1688447208.697823][4176:4178] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Attribute 0x0000_FFFD DataVersion: 1386394810 - [1688447208.701428][4176:4178] CHIP:TOO: ClusterRevision: 1 - [1688447208.701860][4176:4178] CHIP:EM: <<< [E:62008i S:18101 M:251225540 (Ack:117573954)] (S) Msg TX to 1:0000000000000001 [5AF3] --- Type 0000:10 (SecureChannel:StandaloneAck) - disabled: true - - - label: "Step 3: TH reads from the DUT the FeatureMap attribute." - verification: | - ./chip-tool dishwasheralarm read feature-map 1 1 - On TH(chip-tool), verify that DUT responds the Featuremap value as 1 and below is the sample log provided for the raspi platform: - - [1689841072.440418][2534:2536] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Attribute 0x0000_FFFC DataVersion: 3155962179 - [1689841072.440498][2534:2536] CHIP:TOO: FeatureMap: 1 - [1689841072.440655][2534:2536] CHIP:EM: <<< [E:51712i S:9959 M:43369330 (Ack:105494463)] (S) Msg TX to 1:0000000000000001 [C4B0] --- Type 0000:10 (SecureChannel:StandaloneAck) - disabled: true - - - label: "Step 4: TH reads from the DUT the AttributeList attribute." - verification: | - ./chip-tool dishwasheralarm read attribute-list 1 1 - Verify " AttributeList " value consists the list of mandatory attributes (0, 2, 3, 65533, 65532, 65531, 65529, 65528) and optional attributes(1) on the TH(Chip-tool) Log: - Below is the sample log provided for the raspi platform: - [1692613019.157928][10524:10526] CHIP:DMG: } - [1692613019.158276][10524:10526] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Attribute 0x0000_FFFB DataVersion: 2220437053 - [1692613019.158381][10524:10526] CHIP:TOO: AttributeList: 9 entries - [1692613019.158441][10524:10526] CHIP:TOO: [1]: 0 - [1692613019.158479][10524:10526] CHIP:TOO: [2]: 1 - [1692613019.158517][10524:10526] CHIP:TOO: [3]: 2 - [1692613019.158551][10524:10526] CHIP:TOO: [4]: 3 - [1692613019.158587][10524:10526] CHIP:TOO: [5]: 65528 - [1692613019.158622][10524:10526] CHIP:TOO: [6]: 65529 - [1692613019.158657][10524:10526] CHIP:TOO: [7]: 65531 - [1692613019.158692][10524:10526] CHIP:TOO: [8]: 65532 - [1692613019.158727][10524:10526] CHIP:TOO: [9]: 65533 - [1692613019.158909][10524:10526] CHIP:EM: <<< [E:17897i S:25614 M:15345399 (Ack:182319742)] (S) Msg TX to 1:0000000000000001 [5213] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1692613019.158968][10524:10526] CHIP:IN: (S) Sending msg 15345399 on secure session with LSID: 25614 - disabled: true - - - label: "Step 5: TH reads from the DUT the EventList attribute." - verification: | - ./chip-tool dishwasheralarm read event-list 1 1 - Verify " EventList attribute " consists the list may contain optional events(1) on the TH(Chip-tool) Log: - Below is the sample log provided for the raspi platform: - - [1689677416.105596][18367:18369] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Attribute 0x0000_FFFA DataVersion: 1517282962 - [1689677416.105625][18367:18369] CHIP:TOO: EventList: 1 entries - [1689677416.105635][18367:18369] CHIP:TOO: [1]: 0 - [1689677416.105696][18367:18369] CHIP:EM: <<< [E:51484i S:36714 M:192916227 (Ack:1705890)] (S) Msg TX to 1:0000000000000001 [BFDE] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1689677416.105710][18367:18369] CHIP:IN: (S) Sending msg 192916227 on secure session with LSID: 36714 - [1689677416.105737][18367:18369] CHIP:EM: Flushed pending ack for MessageCounter:1705890 on exchange 51484i - disabled: true - - - label: "Step 6: TH reads from the DUT the AcceptedCommandList attribute." - verification: | - ./chip-tool dishwasheralarm read accepted-command-list 1 1 - Verify " AcceptedCommandList " consists the list of supported events, which for this cluster should be an empty list on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: - - [1689841406.078608][2570:2572] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_005D Attribute 0x0000_FFF9 DataVersion: 3155962179 - [1689841406.078674][2570:2572] CHIP:TOO: AcceptedCommandList: 2 entries - [1689841406.078701][2570:2572] CHIP:TOO: [1]: 0 - [1689841406.078724][2570:2572] CHIP:TOO: [2]: 1 - [1689841406.078870][2570:2572] CHIP:EM: <<< [E:3182i S:59744 M:116852840 (Ack:196212236)] (S) Msg TX to 1:0000000000000001 [C4B0] --- Type 0000:10 (SecureChannel:StandaloneAck) - disabled: true - - - label: "Step 7: TH reads from the DUT the GeneratedCommandList attribute." - verification: | - ./chip-tool dishwasheralarm read generated-command-list 1 1 - Verify " GeneratedCommandList " consists the list of supported events, which for this cluster should be an empty list on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: - - [1688447564.178537][4220:4222] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0057 Attribute 0x0000_FFF8 DataVersion: 1795162772 - [1688447564.178684][4220:4222] CHIP:TOO: GeneratedCommandList: 0 entries - [1688447564.178984][4220:4222] CHIP:EM: <<< [E:5540i S:25125 M:256711779 (Ack:197472718)] (S) Msg TX to 1:0000000000000001 [10DB] --- Type 0000:10 (SecureChannel:StandaloneAck) - disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_DISHM_1_1.yaml b/src/app/tests/suites/certification/Test_TC_DISHM_1_1.yaml deleted file mode 100644 index da8a0924274e9e..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_DISHM_1_1.yaml +++ /dev/null @@ -1,106 +0,0 @@ -# Copyright (c) 2023 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default - -name: 263.1.1. [TC-DISHM-1.1] Global attributes with DUT as Server - -PICS: - - DISHM.S - -config: - nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 - -tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - verification: | - - disabled: true - - - label: "Step 2: TH reads from the DUT the ClusterRevision attribute." - verification: | - ./chip-tool dishwashermode read cluster-revision 1 1 - - Verify the "ClusterRevision" value is of unit16 and reflects the highest revision number 2 on the TH(Chip-tool) and below is the sample log provided for the raspi platform: - - CHIP:DMG : } - CHIP:TOO : Endpoint: 1 Cluster: 0x0000_0059 Attribute 0x0000_FFFD DataVersion: 2488070594 - CHIP:TOO : ClusterRevision: 2 - disabled: true - - - label: "Step 3: TH reads from the DUT the FeatureMap attribute." - verification: | - ./chip-tool dishwashermode read feature-map 1 1 - - On the TH(Chip-tool) Log, Verify featureMap value is 0 and below is the sample log provided for the raspi platform: - - [1690365613.351850][27441:27443] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0059 Attribute 0x0000_FFFC DataVersion: 1130015440 - [1690365613.351911][27441:27443] CHIP:TOO: FeatureMap: 1 - disabled: true - - - label: "Step 4: TH reads from the DUT the AttributeList attribute." - verification: | - ./chip-tool dishwashermode read attribute-list 1 1 - - Verify the "AttributeList " should include the mandatory attributes (values 0, 1), - - Global attributes (value 65533, 65532, 65531, 65529 and 65528) and - - List may include optional attribute(value 0x0002), if DISHM.S.A0002(StartUpMode) supports, on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: - - [1696402605.599359][7921:7923] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0059 Attribute 0x0000_FFFB DataVersion: 712950283 - [1696402605.599377][7921:7923] CHIP:TOO: AttributeList: 9 entries - [1696402605.599382][7921:7923] CHIP:TOO: [1]: 0 - [1696402605.599385][7921:7923] CHIP:TOO: [2]: 1 - [1696402605.599388][7921:7923] CHIP:TOO: [3]: 2 - [1696402605.599391][7921:7923] CHIP:TOO: [4]: 3 - [1696402605.599393][7921:7923] CHIP:TOO: [5]: 65528 - [1696402605.599396][7921:7923] CHIP:TOO: [6]: 65529 - [1696402605.599399][7921:7923] CHIP:TOO: [7]: 65531 - [1696402605.599402][7921:7923] CHIP:TOO: [8]: 65532 - [1696402605.599404][7921:7923] CHIP:TOO: [9]: 65533 - disabled: true - - - label: "Step 5: TH reads from the DUT the EventList attribute." - verification: | - ./chip-tool dishwashermode read event-list 1 1 - - * Step 5 is currently not supported and SHALL be skipped. - - [1696402636.316151][7926:7928] CHIP:DMG: } - [1696402636.316183][7926:7928] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) - disabled: true - - - label: "Step 6: TH reads from the DUT the AcceptedCommandList attribute." - verification: | - ./chip-tool dishwashermode read accepted-command-list 1 1 - - Verify the "AcceptedCommandList" contains a list of mandatory commands (value 0) on the TH (Chip-tool) and below is the sample log provided for the raspi platform: - - [1690365651.143190][27451:27453] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0059 Attribute 0x0000_FFF9 DataVersion: 1130015440 - [1690365651.143256][27451:27453] CHIP:TOO: AcceptedCommandList: 1 entries - [1690365651.143284][27451:27453] CHIP:TOO: [1]: 0 - disabled: true - - - label: "Step 7: TH reads from the DUT the GeneratedCommandList attribute." - verification: | - ./chip-tool dishwashermode read generated-command-list 1 1 - - Verify " GeneratedCommandList" contains a list of mandatory commands (value 1) on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: - - [1689997224.280302][360025:360027] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0059 Attribute 0x0000_FFF8 DataVersion: 1427220838 - [1689997224.280330][360025:360027] CHIP:TOO: GeneratedCommandList: 1 entries - [1689997224.280346][360025:360027] CHIP:TOO: [1]: 1 - disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_DLOG_1_1.yaml b/src/app/tests/suites/certification/Test_TC_DLOG_1_1.yaml deleted file mode 100644 index 7043c694d41241..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_DLOG_1_1.yaml +++ /dev/null @@ -1,91 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 56.1.1. [TC-DLOG-1.1] Global Attributes with DUT as Server - -PICS: - - DLOG.S - -config: - nodeId: 0x12344321 - cluster: "Diagnostic Logs" - endpoint: 0 - -tests: - - label: "Step 1: Wait for the commissioned device to be retrieved" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads the ClusterRevision from DUT" - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 1 - constraints: - type: int16u - - - label: "Step 3: TH reads the FeatureMap from DUT" - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: "Step 4: TH reads AttributeList from DUT" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 4: TH reads AttributeList from DUT" - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [65528, 65529, 65531, 65532, 65533] - - - label: "Step 5: TH reads EventList from DUT" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list - - - label: "Step 6: TH reads AcceptedCommandList from DUT" - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - value: [0] - constraints: - type: list - - - label: "Step 7: TH reads GeneratedCommandList from DUT" - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [1] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_1_1.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_1_1.yaml deleted file mode 100644 index 72cd8f941de50e..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_DRLK_1_1.yaml +++ /dev/null @@ -1,544 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 113.1.1. [TC-DRLK-1.1] Global Attributes [DUT-Server] - -PICS: - - DRLK.S - -config: - nodeId: 0x12344321 - cluster: "Door Lock" - endpoint: 1 - -tests: - - label: "Step 1: Wait for the commissioned device to be retrieved" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads the ClusterRevision from DUT" - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 7 - constraints: - type: int16u - - - label: "Step 3a: TH reads the FeatureMap from DUT" - PICS: - " !DRLK.S.F00 && !DRLK.S.F01 && !DRLK.S.F02 && !DRLK.S.F04 && - !DRLK.S.F05 && !DRLK.S.F06 && !DRLK.S.F07 && !DRLK.S.F08 && - !DRLK.S.F0a && !DRLK.S.F0b && !DRLK.S.F0c " - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: - "Step 3b: Given DRLK.S.F00(PIN) ensure featuremap has the correct bit - set" - PICS: DRLK.S.F00 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x1] - - - label: - "Step 3c: Given DRLK.S.F01(RID) ensure featuremap has the correct bit - set" - PICS: DRLK.S.F01 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x2] - - - label: - "Step 3d: Given DRLK.S.F02(FGP) ensure featuremap has the correct bit - set" - PICS: DRLK.S.F02 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x4] - - - label: - "Step 3e: Given DRLK.S.F04(WDSCH) ensure featuremap has the correct - bit set" - PICS: DRLK.S.F04 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x10] - - - label: - "Step 3f: Given DRLK.S.F05(DPS) ensure featuremap has the correct bit - set" - PICS: DRLK.S.F05 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x20] - - - label: - "Step 3g: Given DRLK.S.F06(FACE) ensure featuremap has the correct bit - set" - PICS: DRLK.S.F06 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x40] - - - label: - "Step 3h: Given DRLK.S.F07(COTA) ensure featuremap has the correct bit - set" - PICS: DRLK.S.F07 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x80] - - - label: - "Step 3i: Given DRLK.S.F08(USR) ensure featuremap has the correct bit - set" - PICS: DRLK.S.F08 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x100] - - - label: - "Step 3j: Given DRLK.S.F0a(YDSCH) ensure featuremap has the correct - bit set" - PICS: DRLK.S.F0a - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x400] - - - label: - "Step 3k: Given DRLK.S.F0b(HDSCH) ensure featuremap has the correct - bit set" - PICS: DRLK.S.F0b - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x800] - - - label: - "Step 3l: Given DRLK.S.F0c(UBOLT) ensure featuremap has the correct - bit set" - PICS: DRLK.S.F0c - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x1000] - - - label: "Step 4a: TH reads AttributeList from DUT" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: - [0, 1, 2, 37, 38, 65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 4a: TH reads AttributeList from DUT" - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 2, 37, 38, 65528, 65529, 65531, 65532, 65533] - - - label: - "Step 4b: TH reads Feature dependent(DRLK.S.F05) attributes in - AttributeList" - PICS: DRLK.S.F05 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [3] - - - label: - "Step 4c: TH reads Feature dependent(DRLK.S.F08) attributes in - AttributeList" - PICS: DRLK.S.F08 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [17, 27, 28] - - - label: - "Step 4d: TH reads Feature dependent(DRLK.S.F00) attributes in - AttributeList" - PICS: DRLK.S.F00 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [18, 23, 24] - - - label: - "Step 4e: TH reads Feature dependent(DRLK.S.F01) attributes in - AttributeList" - PICS: DRLK.S.F01 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [19, 25, 26] - - - label: - "Step 4f: TH reads Feature dependent(DRLK.S.F04) attribute in - AttributeList" - PICS: DRLK.S.F04 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [20] - - - label: - "Step 4g: TH reads Feature dependent(DRLK.S.F0a) attribute in - AttributeList" - PICS: DRLK.S.F0a - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [21] - - - label: - "Step 4h: TH reads Feature dependent(DRLK.S.F0b) attribute in - AttributeList" - PICS: DRLK.S.F0b - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [22] - - - label: - "Step 4i: TH reads Feature dependent(DRLK.S.F00 or DRLK.S.F01) - attributes in AttributeList" - PICS: DRLK.S.F00 || DRLK.S.F01 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [48, 49] - - - label: - "Step 4j: TH reads Feature dependent(DRLK.S.F07 or DRLK.S.F00) - attribute in AttributeList" - PICS: DRLK.S.F07 || DRLK.S.F00 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [51] - - - label: "Step 4k: TH reads optional attribute(Language) in AttributeList" - PICS: DRLK.S.A0021 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [33] - - - label: - "Step 4l: TH reads optional attribute(LEDSettings) in AttributeList" - PICS: DRLK.S.A0022 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [34] - - - label: - "Step 4m: TH reads optional attribute(AutoRelockTime) in AttributeList" - PICS: DRLK.S.A0023 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [35] - - - label: - "Step 4n: TH reads optional attribute(SoundVolume) in AttributeList" - PICS: DRLK.S.A0024 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [36] - - - label: - "Step 4o: TH reads optional attribute(DefaultConfigurationRegister) in - AttributeList" - PICS: DRLK.S.A0027 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [39] - - - label: - "Step 4p: TH reads optional attribute(EnableLocalProgramming) in - AttributeList" - PICS: DRLK.S.A0028 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [40] - - - label: - "Step 4q: TH reads optional attribute(EnableOneTouchLocking) in - AttributeList" - PICS: DRLK.S.A0029 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [41] - - - label: - "Step 4r: TH reads optional attribute(EnableInsideStatusLED) in - AttributeList" - PICS: DRLK.S.A002a - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [42] - - - label: - "Step 4s: TH reads optional attribute(EnablePrivacyModeButton) in - AttributeList" - PICS: DRLK.S.A002b - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [43] - - - label: - "Step 4t: TH reads optional attribute(LocalProgrammingFeatures) in - AttributeList" - PICS: DRLK.S.A002c - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [44] - - - label: "Step 5a: TH reads EventList from DUT" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list - contains: [0, 2, 3] - - - label: - "Step 5b: TH reads optional event(Door position sensor) in EventList" - PICS: DRLK.S.F05 && PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list - contains: [1] - - - label: - "Step 5c: TH reads optional event(User commands and database) in - EventList" - PICS: DRLK.S.F08 && PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list - contains: [4] - - - label: "Step 6a: TH reads AcceptedCommandList from DUT" - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0, 1] - - - label: - "Step 6b: TH reads Feature dependent commands(DRLK.S.F04) in - AcceptedCommandList" - PICS: DRLK.S.F04 - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [11, 12, 13] - - - label: - "Step 6c: TH reads Feature dependent commands(DRLK.S.F0a) in - AcceptedCommandList" - PICS: DRLK.S.F0a - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [14, 15, 16] - - - label: - "Step 6d: TH reads Feature dependent commands(DRLK.S.F0b) in - AcceptedCommandList" - PICS: DRLK.S.F0b - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [17, 18, 19] - - - label: - "Step 6e: TH reads Feature dependent commands(DRLK.S.F0c) in - AcceptedCommandList" - PICS: DRLK.S.F0c - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [39] - - - label: - "Step 6f: TH reads Feature dependent commands(DRLK.S.F08) in - AcceptedCommandList" - PICS: DRLK.S.F08 - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [26, 27, 29, 34, 36, 38] - - - label: - "Step 6g: TH reads optional commands(DRLK.S.C03.Rsp) in - AcceptedCommandList" - PICS: DRLK.S.C03.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [3] - - - label: - "Step 7a: TH reads Feature dependent command(DRLK.S.F04) in - GeneratedCommandList" - PICS: DRLK.S.F04 - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - constraints: - type: list - contains: [12] - - - label: - "Step 7b: TH reads Feature dependent command(DRLK.S.F0a) in - GeneratedCommandList" - PICS: DRLK.S.F0a - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - constraints: - type: list - contains: [15] - - - label: - "Step 7c: TH reads Feature dependent command(DRLK.S.F0b) in - GeneratedCommandList" - PICS: DRLK.S.F0b - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - constraints: - type: list - contains: [18] - - - label: - "Step 7d: TH reads Feature dependent command(DRLK.S.F08) in - GeneratedCommandList" - PICS: DRLK.S.F08 - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - constraints: - type: list - contains: [28, 35, 37] diff --git a/src/app/tests/suites/certification/Test_TC_DRYERCTRL_1_1.yaml b/src/app/tests/suites/certification/Test_TC_DRYERCTRL_1_1.yaml deleted file mode 100644 index 3edb48072708bd..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_DRYERCTRL_1_1.yaml +++ /dev/null @@ -1,91 +0,0 @@ -# Copyright (c) 2023 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 3.1.1. [TC-DRYERCTRL-1.1] Global attributes with server as DUT - -PICS: - - DRYERCTRL.S - -config: - nodeId: 0x12344321 - cluster: "Laundry Dryer Controls" - endpoint: 1 - -tests: - - label: "Step 1: Wait for the commissioned device to be retrieved" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step2: TH reads from the DUT the ClusterRevision attribute." - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 1 - constraints: - type: int16u - - - label: "Step 3: TH reads from the DUT the FeatureMap attribute." - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: "Step 4: TH reads from the DUT the AttributeList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 4: TH reads from the DUT the AttributeList attribute." - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 65528, 65529, 65531, 65532, 65533] - - - label: "Step 5: TH reads from the DUT the EventList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list - - - label: "Step 6: TH reads from the DUT the AcceptedCommandList attribute." - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - value: [] - constraints: - type: list - - - label: "Step 7: TH reads from the DUT the GeneratedCommandList attribute." - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_EEVSEM_1_1.yaml b/src/app/tests/suites/certification/Test_TC_EEVSEM_1_1.yaml deleted file mode 100644 index 769dc5d3cba3ac..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_EEVSEM_1_1.yaml +++ /dev/null @@ -1,116 +0,0 @@ -# Copyright (c) 2024 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 265.1.1. [TC-EEVSEM-1.1] Global Attributes with DUT as Server - -PICS: - - EEVSEM.S - -config: - nodeId: 0x12344321 - cluster: "Energy EVSE Mode" - endpoint: 1 - -tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads from the DUT the ClusterRevision attribute" - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 1 - constraints: - type: int16u - - #https://github.com/project-chip/connectedhomeip/issues/31599 - - label: "Step 3: TH reads from the DUT the FeatureMap attribute" - verification: | - ./chip-tool energyevsemode read feature-map 1 1 - - On the TH(Chip-tool) Log, Verify featureMap value is 0 and below is the sample log provided for the raspi platform: - - [1707803286.349129][12699:12701] CHIP:DMG: } - [1707803286.349183][12699:12701] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_009D Attribute 0x0000_FFFC DataVersion: 811903427 - [1707803286.349202][12699:12701] CHIP:TOO: FeatureMap: 0 - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_SKIP_SAMPLE_APP - arguments: - values: - - name: "message" - value: "Enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: "Step 4: TH reads from the DUT the AttributeList attribute" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 4a: TH reads AttributeList from DUT" - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 65528, 65529, 65531, 65532, 65533] - - - label: - "Step 4b: TH reads optional attribute (StartUpMode) in AttributeList - from DUT" - PICS: EEVSEM.S.A0002 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [2] - - - label: "Step 5: TH reads EventList from DUT" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list - - - label: "Step 6: TH reads AcceptedCommandList from DUT" - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - value: [0] - constraints: - type: list - - - label: "Step 7: TH reads GeneratedCommandList from DUT" - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [1] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_EEVSE_1_1.yaml b/src/app/tests/suites/certification/Test_TC_EEVSE_1_1.yaml deleted file mode 100644 index 0be6a9015ed5e9..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_EEVSE_1_1.yaml +++ /dev/null @@ -1,301 +0,0 @@ -# Copyright (c) 2024 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 265.1.1. [TC-EEVSE-1.1] Global Attributes with DUT as Server - -PICS: - - EEVSE.S - -config: - nodeId: 0x12344321 - cluster: "Energy EVSE" - endpoint: 1 - -tests: - - label: "Step 1: Wait for the commissioned device to be retrieved" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads from the DUT the ClusterRevision attribute" - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 2 - constraints: - type: int16u - - - label: "Step 3a: TH reads from the DUT the FeatureMap attribute" - PICS: - "!EEVSE.S.F00 && !EEVSE.S.F01 && !EEVSE.S.F02 && !EEVSE.S.F03 && - !EEVSE.S.F04" - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: - "Step 3b: Given EEVSE.S.F00(ChargingPreferences) ensure featuremap has - the correct bit set" - PICS: EEVSE.S.F00 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x1] - - - label: - "Step 3b: Given EEVSE.S.F01(SoCReporting) ensure featuremap has the - correct bit set" - PICS: EEVSE.S.F01 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x2] - - - label: - "Step 3b: Given EEVSE.S.F02(PlugAndCharge) ensure featuremap has the - correct bit set" - PICS: EEVSE.S.F02 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x4] - - - label: - "Step 3b: Given EEVSE.S.F03(RFID) ensure featuremap has the correct - bit set" - PICS: EEVSE.S.F03 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x8] - - - label: - "Step 3b: Given EEVSE.S.F04(V2X) ensure featuremap has the correct bit - set" - PICS: EEVSE.S.F04 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x10] - - - label: "Step 4a: TH reads from the DUT the AttributeList attribute" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: - [ - 0, - 1, - 2, - 3, - 5, - 6, - 7, - 64, - 65, - 66, - 65528, - 65529, - 65530, - 65531, - 65532, - 65533, - ] - - - label: "Step 4a: TH reads AttributeList from DUT" - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: - [ - 0, - 1, - 2, - 3, - 5, - 6, - 7, - 64, - 65, - 66, - 65528, - 65529, - 65531, - 65532, - 65533, - ] - - - label: - "Step 4b: TH reads optional attribute (UserMaximumChargeCurrent) in - AttributeList from DUT" - PICS: EEVSE.S.A0009 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [9] - - - label: - "Step 4c: TH reads optional attribute (RandomizationDelayWindow) in - AttributeList from DUT" - PICS: EEVSE.S.A000A - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [10] - - - label: - "Step 4d: TH reads optional attribute (V2X) in AttributeList from DUT" - PICS: EEVSE.S.F04 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [4, 8, 67] - - - label: - "Step 4e: TH reads optional attribute (ChargingPreferences) in - AttributeList from DUT" - PICS: EEVSE.S.F00 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [35, 36, 37, 38, 39] - - - label: - "Step 4e: TH reads optional attribute (SoCReporting) in AttributeList - from DUT" - PICS: EEVSE.S.F01 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [48, 49] - - - label: - "Step 4f: TH reads optional attribute (PlugAndCharge) in AttributeList - from DUT" - PICS: EEVSE.S.F02 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [50] - - - label: "Step 5a: TH reads EventList from DUT" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list - contains: [0, 1, 2, 3, 4] - - - label: "Step 5b: TH reads optional attribute (RFID) in EventList from DUT" - PICS: EEVSE.S.F03 && PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list - contains: [5] - - - label: "Step 6a: TH reads AcceptedCommandList from DUT" - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [1, 2] - - - label: - "Step 6b: TH reads the optional (StartDiagnostics) command in - AcceptedCommandList" - PICS: EEVSE.S.C04.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [4] - - - label: - "Step 6c: TH reads Feature dependent commands(EEVSE.S.F04) in - AcceptedCommandList" - PICS: EEVSE.S.F04 - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [3] - - - label: - "Step 6d: TH reads Feature dependent commands(ChargingPreferences) in - AcceptedCommandList" - PICS: EEVSE.S.F00 - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [5, 6, 7] - - - label: "Step 7a: TH reads GeneratedCommandList from DUT" - PICS: " !EEVSE.S.F00 " - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [] - constraints: - type: list - - - label: "Step 7b: TH reads GeneratedCommandList from DUT" - PICS: EEVSE.S.F00 - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - constraints: - type: list - contains: [0] diff --git a/src/app/tests/suites/certification/Test_TC_FAN_1_1.yaml b/src/app/tests/suites/certification/Test_TC_FAN_1_1.yaml deleted file mode 100644 index e8986134e769eb..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_FAN_1_1.yaml +++ /dev/null @@ -1,217 +0,0 @@ -# Copyright (c) 2023 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 263.1.1. [TC-FAN-1.1] Global attributes with DUT as Server - -PICS: - - FAN.S - -config: - nodeId: 0x12344321 - cluster: "Fan Control" - endpoint: 1 - -tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads from the DUT the ClusterRevision attribute." - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 4 - constraints: - type: int16u - - - label: "Step 3a: TH reads from the DUT the FeatureMap attribute." - command: "readAttribute" - attribute: "FeatureMap" - PICS: - " !FAN.S.F00 && !FAN.S.F01 && !FAN.S.F02 && !FAN.S.F03 && !FAN.S.F04 - && !FAN.S.F05 " - response: - value: 0 - constraints: - type: bitmap32 - - - label: - "Step 3b: Given FAN.S.F00(SPD) ensure featuremap has the correct bit - set" - command: "readAttribute" - attribute: "FeatureMap" - PICS: FAN.S.F00 - response: - constraints: - type: bitmap32 - hasMasksSet: [0x1] - - - label: - "Step 3c: Given FAN.S.F01(AUT) ensure featuremap has the correct bit - set" - command: "readAttribute" - attribute: "FeatureMap" - PICS: FAN.S.F01 - response: - constraints: - type: bitmap32 - hasMasksSet: [0x2] - - - label: - "Step 3d: Given FAN.S.F02(RCK) ensure featuremap has the correct bit - set" - command: "readAttribute" - attribute: "FeatureMap" - PICS: FAN.S.F02 - response: - constraints: - type: bitmap32 - hasMasksSet: [0x4] - - - label: - "Step 3e: Given FAN.S.F03(WND) ensure featuremap has the correct bit - set" - command: "readAttribute" - attribute: "FeatureMap" - PICS: FAN.S.F03 - response: - constraints: - type: bitmap32 - hasMasksSet: [0x8] - - - label: - "Step 3f: Given FAN.S.F04(STEP) ensure featuremap has the correct bit - set" - command: "readAttribute" - attribute: "FeatureMap" - PICS: FAN.S.F04 - response: - constraints: - type: bitmap32 - hasMasksSet: [0x10] - - - label: - "Step 3g: Given FAN.S.F05(DIR) ensure featuremap has the correct bit - set" - command: "readAttribute" - attribute: "FeatureMap" - PICS: FAN.S.F05 - response: - constraints: - type: bitmap32 - hasMasksSet: [0x20] - - - label: "Step 4a: TH reads from the DUT the AttributeList attribute" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 2, 3, 65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 4a: TH reads from the DUT the AttributeList attribute" - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 2, 3, 65528, 65529, 65531, 65532, 65533] - - - label: - "Step 4c: TH Reads the feature dependent FAN.S.F00 (SPD) attribute in - AttributeList" - PICS: FAN.S.F00 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [4, 5, 6] - - - label: - "Step 4d: TH Reads the feature dependent FAN.S.F02(RCK) attribute in - AttributeList" - PICS: FAN.S.F02 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [7, 8] - - - label: - "Step 4e: TH Reads the feature dependent FAN.S.F03(WND) attribute in - AttributeList" - PICS: FAN.S.F03 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [9, 10] - - - label: - "Step 4f: TH Reads the feature dependent FAN.S.F05(DIR) attribute in - AttributeList" - PICS: FAN.S.F05 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [11] - - - label: "Step 5: TH reads EventList attribute from DUT" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list - - - label: "Step 6:TH reads from the DUT the AcceptedCommandList attribute." - PICS: " !FAN.S.C00.Rsp " - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - value: [] - constraints: - type: list - - - label: - "Step 6: TH Reads the optional command (Step) in AcceptedCommandList" - PICS: FAN.S.C00.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0] - - - label: "Step 7: TH reads from the DUT the GeneratedCommandList attribute." - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_FLABEL_1_1.yaml b/src/app/tests/suites/certification/Test_TC_FLABEL_1_1.yaml deleted file mode 100644 index bc66790a65f18f..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_FLABEL_1_1.yaml +++ /dev/null @@ -1,93 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 110.1.1. [TC-FLABEL-1.1] Global Attributes with DUT as Server - -PICS: - - FLABEL.S - -config: - nodeId: 0x12344321 - cluster: "Fixed Label" - endpoint: 1 - -tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads from the DUT the ClusterRevision attribute." - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 1 - constraints: - type: int16u - - - label: "Step 3: TH reads from the DUT the FeatureMap attribute." - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: "Step 4: TH reads from the DUT the AttributeList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 4: TH reads from the DUT the AttributeList attribute." - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 65528, 65529, 65531, 65532, 65533] - - - label: "Step 5: TH reads from the DUT the EventList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list - - - label: "Step 6: TH reads from the DUT the AcceptedCommandList attribute." - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - value: [] - constraints: - type: list - - - label: "Step 7: TH reads from the DUT the GeneratedCommandList attribute." - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_FLW_1_1.yaml b/src/app/tests/suites/certification/Test_TC_FLW_1_1.yaml deleted file mode 100644 index c1b3de22020da0..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_FLW_1_1.yaml +++ /dev/null @@ -1,103 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 33.1.1. [TC-FLW-1.1] Global Attributes with DUT as Server - -PICS: - - FLW.S - -config: - nodeId: 0x12344321 - cluster: "Flow Measurement" - endpoint: 1 - -tests: - - label: - "Step 1:Commission DUT to TH (can be skipped if done in a preceding - test)." - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads from the DUT the ClusterRevision attribute." - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 3 - constraints: - type: int16u - - - label: "Step 3: TH reads from the DUT the FeatureMap attribute." - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: "Step 4a: TH reads from the DUT the AttributeList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 2, 65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 4a: TH reads from the DUT the AttributeList attribute." - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 2, 65528, 65529, 65531, 65532, 65533] - - - label: - "Step 4b: TH reads the optional attribute(Tolerance) in AttributeList" - PICS: FLW.S.A0003 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [3] - - - label: "Step 5: TH reads from the DUT the EventList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list - - - label: "Step 6: TH reads from the DUT the AcceptedCommandList attribute." - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - value: [] - constraints: - type: list - - - label: "Step 7: TH reads from the DUT the GeneratedCommandList attribute." - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_GRPKEY_1_1.yaml b/src/app/tests/suites/certification/Test_TC_GRPKEY_1_1.yaml deleted file mode 100644 index ea77cb6fb19f7d..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_GRPKEY_1_1.yaml +++ /dev/null @@ -1,105 +0,0 @@ -# Copyright (c) 2023 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 26.1.1. [TC-GRPKEY-1.1] Global Attributes with DUT as Server - -PICS: - - GRPKEY.S - -config: - nodeId: 0x12344321 - cluster: "Group Key Management" - endpoint: 0 - -tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads from the DUT the ClusterRevision attribute." - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 2 - constraints: - type: int16u - - - label: "Step 3a: TH reads from the DUT the FeatureMap attribute." - PICS: " !GRPKEY.S.F00 " - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: - "Step 3b: Given GRPKEY.S.F00(CS) ensure featuremap has the correct bit - set" - PICS: GRPKEY.S.F00 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x1] - - - label: "Step 4: TH reads from the DUT the AttributeList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 2, 3, 65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 4: TH reads from the DUT the AttributeList attribute." - PICS: " !PICS_EVENT_LIST_ENABLED " - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 2, 3, 65528, 65529, 65531, 65532, 65533] - - - label: "Step 5: TH reads from the DUT the EventList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list - - - label: "Step 6: TH reads from the DUT the AcceptedCommandList attribute." - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0, 1, 3, 4] - - - label: "Step 7: TH reads from the DUT the GeneratedCommandList attribute." - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - constraints: - type: list - contains: [2, 5] diff --git a/src/app/tests/suites/certification/Test_TC_G_1_1.yaml b/src/app/tests/suites/certification/Test_TC_G_1_1.yaml deleted file mode 100644 index 305dc43ae0de62..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_G_1_1.yaml +++ /dev/null @@ -1,103 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 121.1.1. [TC-G-1.1] Global Attributes with DUT as Server - -PICS: - - G.S - -config: - nodeId: 0x12344321 - cluster: "Groups" - endpoint: 1 - -tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads from the DUT the ClusterRevision attribute." - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 4 - constraints: - type: int16u - - - label: "Step 3a: TH reads from the DUT the FeatureMap attribute." - PICS: " !G.S.F00 " - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: "Step 3b: Given G.S.F00 ensure featuremap has the correct bit set" - PICS: G.S.F00 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x1] - - - label: "Step 4: TH reads from the DUT the AttributeList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 4: TH reads from the DUT the AttributeList attribute." - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 65528, 65529, 65531, 65532, 65533] - - - label: "Step 5: TH reads from the DUT the EventList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list - - - label: "Step 6: TH reads from the DUT the AcceptedCommandList attribute." - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0, 1, 2, 3, 4, 5] - - - label: "Step 7: TH reads from the DUT the GeneratedCommandList attribute." - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - constraints: - type: list - contains: [0, 1, 2, 3] diff --git a/src/app/tests/suites/certification/Test_TC_HEPAFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_HEPAFREMON_1_1.yaml deleted file mode 100644 index 5ae91d71678e31..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_HEPAFREMON_1_1.yaml +++ /dev/null @@ -1,183 +0,0 @@ -# Copyright (c) 2023 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 165.1.1. [TC-HEPAFREMON-1.1] Global Attributes with DUT as Server - -PICS: - - HEPAFREMON.S - -config: - nodeId: 0x12344321 - cluster: "HEPA Filter Monitoring" - endpoint: 1 - -tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads from the DUT the ClusterRevision attribute." - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 1 - constraints: - type: int16u - - - label: "Step 3a: TH reads from the DUT the FeatureMap attribute." - command: "readAttribute" - attribute: "FeatureMap" - PICS: "!HEPAFREMON.S.F00 && !HEPAFREMON.S.F01 && !HEPAFREMON.S.F02" - response: - value: 0 - constraints: - type: bitmap32 - - - label: - "Step 3b: Given HEPAFREMON.S.F00(Condition) ensure featuremap has the - correct bit set" - command: "readAttribute" - attribute: "FeatureMap" - PICS: HEPAFREMON.S.F00 - response: - constraints: - type: bitmap32 - hasMasksSet: [0x1] - - - label: - "Step 3c: Given HEPAFREMON.S.F01(Warning) ensure featuremap has the - correct bit set" - command: "readAttribute" - attribute: "FeatureMap" - PICS: HEPAFREMON.S.F01 - response: - constraints: - type: bitmap32 - hasMasksSet: [0x2] - - - label: - "Step 3d: Given HEPAFREMON.S.F02(ReplacementProductList) ensure - featuremap has the correct bit set" - command: "readAttribute" - attribute: "FeatureMap" - PICS: HEPAFREMON.S.F02 - response: - constraints: - type: bitmap32 - hasMasksSet: [0x4] - - - label: "Step 4: TH reads from the DUT the AttributeList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [2, 65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 4: TH reads from the DUT the AttributeList attribute." - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [2, 65528, 65529, 65531, 65532, 65533] - - - label: - "Step 4b: TH reads the feature dependent(HEPAFREMON.S.F00) attribute - in AttributeList" - PICS: HEPAFREMON.S.F00 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 2] - - - label: - "Step 4c: TH reads the optional attribute InPlaceIndicator - (HEPAFREMON.S.A0003) in AttributeList" - PICS: HEPAFREMON.S.A0003 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [3] - - - label: - "Step 4d: TH reads the optional attribute LastChangedTime - (HEPAFREMON.S.A0004) in AttributeList" - PICS: HEPAFREMON.S.A0004 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [4] - - - label: - "Step 4e: TH reads the optional attribute ReplacementProductList - (HEPAFREMON.S.F02) in AttributeList" - PICS: HEPAFREMON.S.F02 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [5] - - - label: "Step 5: TH reads from the DUT the EventList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list - - - label: "Step 6: TH reads from the DUT the AcceptedCommandList attribute." - PICS: "!HEPAFREMON.S.C00.Rsp" - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - value: [] - constraints: - type: list - - - label: - "Step 6: TH reads the optional command (ResetCondition) in - AcceptedCommandList" - PICS: HEPAFREMON.S.C00.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0] - - - label: "Step 7: TH reads from the DUT the GeneratedCommandList attribute." - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_ILL_1_1.yaml b/src/app/tests/suites/certification/Test_TC_ILL_1_1.yaml deleted file mode 100644 index 76f371c1145bf5..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_ILL_1_1.yaml +++ /dev/null @@ -1,114 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 71.1.1. [TC-ILL-1.1] Global attributes with server as DUT - -PICS: - - ILL.S - -config: - nodeId: 0x12344321 - cluster: "Illuminance Measurement" - endpoint: 1 - -tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads the ClusterRevision attribute from the DUT." - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 3 - constraints: - type: int16u - - - label: "Step 3: TH reads the FeatureMap attribute from the DUT." - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: "Step 4a: TH reads the AttributeList attribute from the DUT." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 2, 65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 4a: TH reads the AttributeList attribute from the DUT." - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 2, 65528, 65529, 65531, 65532, 65533] - - - label: - "Step 4b: TH reads the optional attribute(Tolerance) in AttributeList" - PICS: ILL.S.A0003 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [3] - - - label: - "Step 4c: TH reads the optional attribute(LightSensorType) in - AttributeList" - PICS: ILL.S.A0004 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [4] - - - label: "Step 5: TH reads the EventList attribute from the DUT." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list - - - label: "Step 6: TH reads the AcceptedCommandList attribute from the DUT." - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - value: [] - constraints: - type: list - - - label: "Step 7: TH reads the GeneratedCommandList attribute from the DUT." - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_I_1_1.yaml b/src/app/tests/suites/certification/Test_TC_I_1_1.yaml deleted file mode 100644 index ab2e3cffa89628..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_I_1_1.yaml +++ /dev/null @@ -1,136 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 57.1.1. [TC-I-1.1] Global Attributes with DUT as Server - -PICS: - - I.S - -config: - nodeId: 0x12344321 - cluster: "Identify" - endpoint: 1 - -tests: - - label: - "Step 1:Commission DUT to TH (can be skipped if done in a preceding - test)." - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads from the DUT the ClusterRevision attribute." - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 4 - constraints: - type: int16u - - - label: "Step 3: TH reads from the DUT the FeatureMap attribute." - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - #Commenting out the step FeatureMap attribute feature PICS I.S.F00(QRY) which is out of scope for matter V1.0 - #- label: "TH reads the FeatureMap attribute from the DUT" - # PICS: I.S.F00 - # command: "readAttribute" - # attribute: "FeatureMap" - # response: - # value: 1 - # constraints: - # type: bitmap32 - - - label: "Step 4: TH reads from the DUT the AttributeList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 4: TH reads from the DUT the AttributeList attribute." - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 65528, 65529, 65531, 65532, 65533] - - #Manufacturer specific event IDs check not possible - - label: "Step 5: TH reads from the DUT the EventList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list - - - label: "Step 6: TH reads from the DUT the AcceptedCommandList attribute." - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0] - - - label: - "Step 6: TH reads the optional command(TriggerEffect) in - AcceptedCommandList" - PICS: I.S.C40.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [64] - - #Commenting out the step IdentifyQuery (0x01) is not supported by Matter 1.0. - #- label: "TH reads the optional attribute(IdentifyQuery) in AcceptedCommandList" - # PICS: I.S.C01.Rsp - # command: "readAttribute" - # attribute: "AcceptedCommandList" - # response: - # constraints: - # type: list - # contains: [1] - - - label: "Step 7: TH reads from the DUT the GeneratedCommandList attribute." - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [] - constraints: - type: list - #Commenting out the step IdentifyQueryResponse (0x00) is not supported by Matter 1.0 - #- label: - # "TH reads the optional command(IdentifyQueryResponse) in - # GeneratedCommandList" - # PICS: I.S.C00.Tx - # command: "readAttribute" - # attribute: "GeneratedCommandList" - # response: - # value: [0] - # constraints: - # type: list diff --git a/src/app/tests/suites/certification/Test_TC_KEYPADINPUT_1_2.yaml b/src/app/tests/suites/certification/Test_TC_KEYPADINPUT_1_2.yaml deleted file mode 100644 index 20cd640da5dfd1..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_KEYPADINPUT_1_2.yaml +++ /dev/null @@ -1,128 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: - 19.1.2. [TC-KEYPADINPUT-1.2] Global attributes - Keypad Input Cluster (DUT - as Server) - -PICS: - - KEYPADINPUT.S - -config: - nodeId: 0x12344321 - cluster: "Keypad Input" - endpoint: 1 - -tests: - - label: - "Commission DUT to TH (can be skipped if done in a preceding test)." - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 1: TH reads the ClusterRevision attribute from the DUT" - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 1 - constraints: - type: int16u - - - label: "Step 2a: TH reads the FeatureMap attribute from the DUT" - PICS: " !KEYPADINPUT.S.F00 && KEYPADINPUT.S.F01 && !KEYPADINPUT.S.F02 " - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: - "Step 2b: Given (KEYPADINPUT.S.F00(NV)) FeatureMap bit mask is set or - not" - PICS: KEYPADINPUT.S.F00 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x1] - - - label: - "Step 2c: Given (KEYPADINPUT.S.F01(LK)) FeatureMap bit mask is set or - not" - PICS: KEYPADINPUT.S.F01 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x2] - - - label: - "Step 2d: Given (KEYPADINPUT.S.F02(NK)) FeatureMap bit mask is set or - not" - PICS: KEYPADINPUT.S.F02 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x4] - - - label: "Step 3a: TH reads the AttributeList attribute from the DUT" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 3a: TH reads the AttributeList attribute from the DUT" - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [65528, 65529, 65531, 65532, 65533] - - - label: "Step 4: TH reads the AcceptedCommandList attribute from the DUT" - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0] - - - label: "Step 5: TH reads the GeneratedCommandList attribute from the DUT" - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - constraints: - type: list - contains: [1] - - - label: "Step 6: TH reads the EventList attribute from the DUT" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_LCFG_1_1.yaml b/src/app/tests/suites/certification/Test_TC_LCFG_1_1.yaml deleted file mode 100644 index 6cd288c1a26d5d..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_LCFG_1_1.yaml +++ /dev/null @@ -1,93 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 101.1.1. [TC-LCFG-1.1] Global Attributes with DUT as Server - -PICS: - - LCFG.S - -config: - nodeId: 0x12344321 - cluster: "Localization Configuration" - endpoint: 0 - -tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads from the DUT the ClusterRevision attribute." - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 1 - constraints: - type: int16u - - - label: "Step 3: TH reads from the DUT the FeatureMap attribute." - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: "Step 4: TH reads from the DUT the AttributeList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 4: TH reads from the DUT the AttributeList attribute." - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 65528, 65529, 65531, 65532, 65533] - - - label: "Step 5: TH reads from the DUT the EventList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list - - - label: "Step 6: TH reads from the DUT the AcceptedCommandList attribute." - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - value: [] - constraints: - type: list - - - label: "Step 7: TH reads from the DUT the GeneratedCommandList attribute." - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_LOWPOWER_1_1.yaml b/src/app/tests/suites/certification/Test_TC_LOWPOWER_1_1.yaml deleted file mode 100644 index c71888c3477df0..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_LOWPOWER_1_1.yaml +++ /dev/null @@ -1,93 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: - 19.1.1. [TC-LOWPOWER-1.1] Global attributes - Low Power Cluster (DUT as - Server) - -PICS: - - LOWPOWER.S - -config: - nodeId: 0x12344321 - cluster: "Low Power" - endpoint: 1 - -tests: - - label: "Wait for the commissioned device to be retrieved" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 1: TH reads the ClusterRevision attribute from the DUT" - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 1 - constraints: - type: int16u - - - label: "Step 2: TH reads the FeatureMap attribute from the DUT" - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: "Step 3: TH reads the AttributeList attribute from the DUT" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - value: [65528, 65529, 65530, 65531, 65532, 65533] - constraints: - type: list - - - label: "Step 3: TH reads the AttributeList attribute from the DUT" - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - value: [65528, 65529, 65531, 65532, 65533] - constraints: - type: list - - - label: "Step 4: TH reads the AcceptedCommandList attribute from the DUT" - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - value: [0] - constraints: - type: list - - - label: "Step 5: TH reads the GeneratedCommandList attribute from the DUT" - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [] - constraints: - type: list - - - label: "Step 6: TH reads the EventList attribute from the DUT" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_LUNIT_1_2.yaml b/src/app/tests/suites/certification/Test_TC_LUNIT_1_2.yaml deleted file mode 100644 index ab55e650535f86..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_LUNIT_1_2.yaml +++ /dev/null @@ -1,117 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 108.1.2. [TC-LUNIT-1.2] Global Attributes with DUT as Server - -PICS: - - LUNIT.S - -config: - nodeId: 0x12344321 - cluster: "Unit Localization" - endpoint: 0 - -tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads from the DUT the ClusterRevision attribute." - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 1 - constraints: - type: int16u - - - label: "Step 3: TH reads from the DUT the FeatureMap attribute." - PICS: " !LUNIT.S.F00 " - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: - "Step 3: Given LUNIT.S.F00(TEMP) ensure featuremap has the correct bit - set" - PICS: LUNIT.S.F00 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x1] - - - label: "Step 4a: TH reads from the DUT the AttributeList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 4a: TH reads from the DUT the AttributeList attribute." - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [65528, 65529, 65531, 65532, 65533] - - - label: - "Step 4b: TH reads Feature dependent(LUNIT.S.F00) attribute in - AttributeList" - PICS: LUNIT.S.F00 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0] - - - label: "Step 5: TH reads from the DUT the EventList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list - - - label: "Step 6: TH reads from the DUT the AcceptedCommandList attribute." - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - value: [] - constraints: - type: list - - - label: "Step 7: TH reads from the DUT the GeneratedCommandList attribute." - - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_LVL_1_1.yaml b/src/app/tests/suites/certification/Test_TC_LVL_1_1.yaml deleted file mode 100644 index 76ca0f322f0e64..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_LVL_1_1.yaml +++ /dev/null @@ -1,224 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 18.1.1. [TC-LVL-1.1] Global Attributes with DUT as Server - -PICS: - - LVL.S - -config: - nodeId: 0x12344321 - cluster: "Level Control" - endpoint: 1 - -tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads from the DUT the ClusterRevision attribute." - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 5 - constraints: - type: int16u - - - label: "Step 3a: TH reads from the DUT the FeatureMap attribute." - PICS: " !LVL.S.F00 && !LVL.S.F01 && !LVL.S.F02 " - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: - "Step 3b: Given LVL.S.F00(OO) ensure featuremap has the correct bit - set" - PICS: LVL.S.F00 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x1] - - - label: - "Step 3c: Given LVL.S.F01(LT) ensure featuremap has the correct bit - set" - PICS: LVL.S.F01 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x2] - - - label: - "Step 3d: Given LVL.S.F02(FQ) ensure featuremap has the correct bit - set" - PICS: LVL.S.F02 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x4] - - - label: "Step 4: TH reads from the DUT the AttributeList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 15, 17, 65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 4: TH reads from the DUT the AttributeList attribute." - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 15, 17, 65528, 65529, 65531, 65532, 65533] - - - label: - "Step 4a: TH reads the optional attribute(StartUpCurrentLevel and - RemainingTime) in AttributeList" - PICS: LVL.S.F01 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [1, 16384] - - - label: - "Step 4b: TH reads the optional attribute(CurrentFrequency, - MinFrequency and MinFrequency) in AttributeList" - PICS: LVL.S.F02 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [4, 5, 6] - - - label: - "Step 4c: TH reads the optional attribute(MinLevel) in AttributeList" - PICS: LVL.S.A0002 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [2] - - - label: - "Step 4d: TH reads the optional attribute(MaxLevel) in AttributeList" - PICS: LVL.S.A0003 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [3] - - - label: - "Step 4e: TH reads the optional attribute(OnOffTransitionTime) in - AttributeList" - PICS: LVL.S.A0010 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [16] - - - label: - "Step 4f: TH reads the optional attribute(OnTransitionTime) in - AttributeList" - PICS: LVL.S.A0012 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [18] - - - label: - "Step 4g: TH reads the optional attribute(OffTransitionTime) in - AttributeList" - PICS: LVL.S.A0013 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [19] - - - label: - "Step 4h: TH reads the optional attribute(DefaultMoveRate) in - AttributeList" - PICS: LVL.S.A0014 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [20] - - - label: "Step 5: Read the global attribute: EventList" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list - - - label: "Step 6a: TH reads from the DUT the AcceptedCommandList attribute." - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0, 1, 2, 3, 4, 5, 6, 7] - - - label: - "Step 6a.1: TH reads the Feature-dependent(LVL.S.F02) command in - AcceptedCommandList" - PICS: LVL.S.F02 - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [8] - - - label: "Step 7: TH reads from the DUT the GeneratedCommandList attribute." - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_LWM_1_1.yaml b/src/app/tests/suites/certification/Test_TC_LWM_1_1.yaml deleted file mode 100644 index 0b8b51fcbe3f10..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_LWM_1_1.yaml +++ /dev/null @@ -1,128 +0,0 @@ -# Copyright (c) 2023 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 183.1.2. [TC-LWM-1.1] Cluster attributes with DUT as Server - -PICS: - - LWM.S - -config: - nodeId: 0x12344321 - cluster: "Laundry Washer Mode" - endpoint: 1 - -tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads from the DUT the ClusterRevision attribute." - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 2 - constraints: - type: int16u - - #Issue https://github.com/project-chip/connectedhomeip/issues/31551 - - label: - "Step 3:TH reads from the DUT the FeatureMap attribute., bit 0: SHALL - be 1 if and only if LWM.S.F00" - command: "readAttribute" - attribute: "FeatureMap" - PICS: LWM.S.F00 - response: - constraints: - type: bitmap32 - hasMasksSet: [0x1] - - - label: "Step 3: TH reads from the DUT the FeatureMap attribute." - command: "readAttribute" - attribute: "FeatureMap" - PICS: " !LWM.S.F00 " - response: - value: 0 - constraints: - type: bitmap32 - - - label: "Step 4a: TH reads from the DUT the AttributeList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 4a: TH reads from the DUT the AttributeList attribute." - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 65528, 65529, 65531, 65532, 65533] - - - label: - "Step 4b: TH reads the optional attribute(StartUpMode) in - AttributeList" - PICS: LWM.S.A0002 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [2] - - #Issue https://github.com/project-chip/connectedhomeip/issues/31551 - - label: - "Step 4c: TH reads the Feature dependent attribute in AttributeList" - PICS: LWM.S.F00 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [3] - - - label: "Step 5: TH reads from the DUT the EventList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list - - - label: "Step 6: TH reads from the DUT the AcceptedCommandList attribute." - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0] - - - label: "Step 7: TH reads from the DUT the GeneratedCommandList attribute." - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - constraints: - type: list - contains: [1] diff --git a/src/app/tests/suites/certification/Test_TC_MEDIAINPUT_1_4.yaml b/src/app/tests/suites/certification/Test_TC_MEDIAINPUT_1_4.yaml deleted file mode 100644 index 793d412532a3bd..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_MEDIAINPUT_1_4.yaml +++ /dev/null @@ -1,128 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: - 19.1.4. [TC-MEDIAINPUT-1.4] Global attributes - Media Input Cluster (DUT as - Server) - -PICS: - - MEDIAINPUT.S - -config: - nodeId: 0x12344321 - cluster: "Media Input" - endpoint: 1 - -tests: - - label: - "Step 0: Commission DUT to TH (can be skipped if done in a preceding - test)." - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 1: TH reads the ClusterRevision attribute from the DUT" - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 1 - constraints: - type: int16u - - - label: "Step 2: TH reads the FeatureMap attribute from the DUT" - PICS: " !MEDIAINPUT.S.F00 " - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: - "Step 2: Given MEDIAINPUT.S.F00(NU) ensure featuremap has the correct - bit set" - PICS: MEDIAINPUT.S.F00 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x1] - - - label: "Step 3a: TH reads the AttributeList attribute from the DUT" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 3a: TH reads the AttributeList attribute from the DUT" - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [65528, 65529, 65531, 65532, 65533] - - - label: - "Step 3b: TH reads the optional attribute(InputList) in AttributeList" - PICS: MEDIAINPUT.S.A0000 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0] - - - label: - "Step 3c: TH reads the optional attribute(CurrentInput) in - AttributeList" - PICS: MEDIAINPUT.S.A0001 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [1] - - - label: "Step 4: TH reads the AcceptedCommandList attribute from the DUT" - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0, 1, 2, 3] - - - label: "Step 5: TH reads the GeneratedCommandList attribute from the DUT" - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [] - constraints: - type: list - - - label: "Step 6: TH reads the EventList attribute from the DUT" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_MEDIAPLAYBACK_1_7.yaml b/src/app/tests/suites/certification/Test_TC_MEDIAPLAYBACK_1_7.yaml deleted file mode 100644 index c3b55fd4e3bbac..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_MEDIAPLAYBACK_1_7.yaml +++ /dev/null @@ -1,266 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: - 19.1.7. [TC-MEDIAPLAYBACK-1.7] Global attributes - Media Playback Cluster - (DUT as Server) - -PICS: - - MEDIAPLAYBACK.S - -config: - nodeId: 0x12344321 - cluster: "Media Playback" - endpoint: 1 - -tests: - - label: - "Commission DUT to TH (can be skipped if done in a preceding test)." - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 1: TH reads the ClusterRevision attribute from the DUT" - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 2 - constraints: - type: int16u - - - label: "Step 2a: TH reads the FeatureMap attribute from the DUT" - PICS: " !MEDIAPLAYBACK.S.F00 && !MEDIAPLAYBACK.S.F01 " - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: - "Step 2b: Given MEDIAPLAYBACK.S.F00(AS) ensure featuremap has the - correct bit set" - PICS: MEDIAPLAYBACK.S.F00 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x1] - - - label: - "Step 2c: Given MEDIAPLAYBACK.S.F01(VS) ensure featuremap has the - correct bit set" - PICS: MEDIAPLAYBACK.S.F01 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x2] - - - label: "Step 3a: TH reads the AttributeList attribute from the DUT" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 3a: TH reads the AttributeList attribute from the DUT" - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 65528, 65529, 65531, 65532, 65533] - - - label: - "Step 3b: TH reads the optional attribute(StartTime) in AttributeList" - PICS: MEDIAPLAYBACK.S.A0001 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [1] - - - label: - "Step 3c: TH reads the optional attribute(Duration) in AttributeList" - PICS: MEDIAPLAYBACK.S.A0002 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [2] - - - label: - "Step 3d: TH reads the optional attribute(SampledPosition) in - AttributeList" - PICS: MEDIAPLAYBACK.S.A0003 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [3] - - - label: - "Step 3e: TH reads the optional attribute(PlaybackSpeed) in - AttributeList" - PICS: MEDIAPLAYBACK.S.A0004 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [4] - - - label: - "Step 3f: TH reads the optional attribute(SeekRangeEnd) in - AttributeList" - PICS: MEDIAPLAYBACK.S.A0005 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [5] - - - label: - "Step 3g: TH reads the optional attribute(SeekRangeStart) in - AttributeList" - PICS: MEDIAPLAYBACK.S.A0006 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [6] - - - label: "Step 4a: TH reads the AcceptedCommandList attribute from the DUT" - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0, 1, 2] - - - label: - "Step 4b: TH reads the optional command(StartOver) in - AcceptedCommandList" - PICS: MEDIAPLAYBACK.S.C03.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [3] - - - label: - "Step 4c: TH reads the optional command(Previous) in - AcceptedCommandList" - PICS: MEDIAPLAYBACK.S.C04.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [4] - - - label: - "Step 4d: TH reads the optional command(Next) in AcceptedCommandList" - PICS: MEDIAPLAYBACK.S.C05.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [5] - - - label: - "Step 4e: TH reads the optional command(Rewind) in AcceptedCommandList" - PICS: MEDIAPLAYBACK.S.C06.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [6] - - - label: - "Step 4f: TH reads the optional command(FastForward) in - AcceptedCommandList" - PICS: MEDIAPLAYBACK.S.C07.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [7] - - - label: - "Step 4g: TH reads the optional command(SkipForward) in - AcceptedCommandList" - PICS: MEDIAPLAYBACK.S.C08.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [8] - - - label: - "Step 4h: TH reads the optional command(SkipBackward) in - AcceptedCommandList" - PICS: MEDIAPLAYBACK.S.C09.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [9] - - - label: - "Step 4i: TH reads the optional command(Seek) in AcceptedCommandList" - PICS: MEDIAPLAYBACK.S.C0b.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [11] - - - label: "Step 5: TH reads the GeneratedCommandList attribute from the DUT" - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - constraints: - type: list - contains: [10] - - - label: "Step 6: TH reads the EventList attribute from the DUT" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_MOD_1_1.yaml b/src/app/tests/suites/certification/Test_TC_MOD_1_1.yaml deleted file mode 100644 index dc00d3b0f2a39f..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_MOD_1_1.yaml +++ /dev/null @@ -1,125 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 78.1.1. [TC-MOD-1.1] Global attributes with server as DUT - -PICS: - - MOD.S - -config: - nodeId: 0x12344321 - cluster: "Mode Select" - endpoint: 1 - -tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads from the DUT the ClusterRevision attribute." - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 2 - constraints: - type: int16u - - - label: "Step 3: TH reads from the DUT the FeatureMap attribute." - PICS: MOD.S.F00 - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 1 - constraints: - type: bitmap32 - - - label: "Step 3: TH reads from the DUT the FeatureMap attribute." - PICS: " !MOD.S.F00 " - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: "Step 4a: TH reads from the DUT the AttributeList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 2, 3, 65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 4a: TH reads from the DUT the AttributeList attribute." - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 2, 3, 65528, 65529, 65531, 65532, 65533] - - - label: - "Step 4b: TH reads the optional attribute(StartUpMode) in - AttributeList from the DUT" - PICS: MOD.S.A0004 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [4] - - - label: - "Step 4c: TH reads the Feature dependent attribute(OnMode) in - AttributeList from the DUT" - PICS: MOD.S.F00 && MOD.S.A0005 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [5] - - - label: "Step 5: TH reads from the DUT the EventList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list - - - label: "Step 6: TH reads from the DUT the AcceptedCommandList attribute." - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0] - - - label: "Step 7: TH reads from the DUT the GeneratedCommandList attribute." - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_MWOM_1_1.yaml b/src/app/tests/suites/certification/Test_TC_MWOM_1_1.yaml deleted file mode 100644 index a35aa47a01870f..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_MWOM_1_1.yaml +++ /dev/null @@ -1,94 +0,0 @@ -# Copyright (c) 2024 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 263.1.1. [TC-MWOM-1.1] Global attributes with DUT as Server - -PICS: - - MWOM.S - -config: - nodeId: 0x12344321 - cluster: "Microwave Oven Mode" - endpoint: 1 - -tests: - - label: "Step 1: Wait for the commissioned device to be retrieved" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: Read the global attribute: ClusterRevision" - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 1 - constraints: - type: int16u - - - label: "Step 3: Read the global attribute: FeatureMap" - command: "readAttribute" - attribute: "FeatureMap" - PICS: "!MWOM.S.F00" - response: - value: 0 - constraints: - type: bitmap32 - - - label: "Step 4a: Read the global attribute: AttributeList" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 65528, 65529, 65530, 65531, 65532, 65533] - excludes: [2, 3] - - - label: "Step 4b: Read the global attribute: AttributeList" - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 65528, 65529, 65531, 65532, 65533] - excludes: [2, 3] - - - label: "Step 5: TH reads EventList attribute from DUT" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list - - - label: "Step 6: TH reads from the DUT the AcceptedCommandList attribute." - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - excludes: [0] - - - label: "Step 7: TH reads from the DUT the GeneratedCommandList attribute." - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - constraints: - type: list - excludes: [1] diff --git a/src/app/tests/suites/certification/Test_TC_OCC_1_1.yaml b/src/app/tests/suites/certification/Test_TC_OCC_1_1.yaml deleted file mode 100644 index b62cc83b374141..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_OCC_1_1.yaml +++ /dev/null @@ -1,198 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 24.1.1. [TC-OCC-1.1] Global attributes with server as DUT - -PICS: - - OCC.S - -config: - nodeId: 0x12344321 - cluster: "Occupancy Sensing" - endpoint: 1 - -tests: - - label: "Step 1: Commission DUT to TH" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: - "Step 2: TH reads from the DUT the (0xFFFD) ClusterRevision attribute" - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 4 - constraints: - type: int16u - - - label: "Step 3: TH reads from the DUT the (0xFFFC) FeatureMap attribute" - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: - "Step 4a: TH reads from the DUT the (0xFFFB) AttributeList attribute" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 2, 65528, 65529, 65530, 65531, 65532, 65533] - - - label: - "Step 4a: TH reads from the DUT the (0xFFFB) AttributeList attribute" - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 2, 65528, 65529, 65531, 65532, 65533] - - - label: - "Step 4b: TH reads optional attribute(PIROccupiedToUnoccupiedDelay) in - AttributeList" - PICS: OCC.S.A0010 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [16] - - - label: - "Step 4c: TH reads optional attribute(PIRUnoccupiedToOccupiedDelay) in - AttributeList" - PICS: OCC.S.A0011 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [17] - - - label: - "Step 4d: TH reads optional - attribute(PIRUnoccupiedToOccupiedThreshold) in AttributeList" - PICS: OCC.S.A0012 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [18] - - - label: - "Step 4e: TH reads optional - attribute(UltrasonicOccupiedToUnoccupiedDelay) in AttributeList" - PICS: OCC.S.A0020 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [32] - - - label: - "Step 4f: TH reads optional - attribute(UltrasonicUnoccupiedToOccupiedDelay) in AttributeList" - PICS: OCC.S.A0021 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [33] - - - label: - "Step 4g: TH reads optional - attribute(UltrasonicUnoccupiedToOccupiedThreshold) in AttributeList" - PICS: OCC.S.A0022 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [34] - - - label: - "Step 4h: TH reads optional - attribute(PhysicalContactOccupiedToUnoccupiedDelay) in AttributeList" - PICS: OCC.S.A0030 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [48] - - - label: - "Step 4i: TH reads the optional - attribute(PhysicalContactUnoccupiedToOccupiedDelay) in AttributeList" - PICS: OCC.S.A0031 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [49] - - - label: - "Step 4j: TH reads optional - attribute(PhysicalContactUnoccupiedToOccupiedThreshold) in - AttributeList" - PICS: OCC.S.A0032 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [50] - - - label: "Step 5: TH reads from the DUT the (0xFFFA) EventList attribute" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list - - - label: - "Step 6: TH reads from the DUT the (0xFFF9) AcceptedCommandList - attribute" - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - value: [] - constraints: - type: list - - - label: - "Step 7: TH reads from the DUT the (0xFFF8) GeneratedCommandList - attribute" - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_OO_1_1.yaml b/src/app/tests/suites/certification/Test_TC_OO_1_1.yaml deleted file mode 100644 index 5b44953041dac7..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_OO_1_1.yaml +++ /dev/null @@ -1,207 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 4.1.1. [TC-OO-1.1] Global Attributes with DUT as Server - -PICS: - - OO.S - -config: - nodeId: 0x12344321 - cluster: "On/Off" - endpoint: 1 - -tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - #Issue: https://github.com/project-chip/connectedhomeip/issues/29786 - - label: "Step 2: TH reads from the DUT the ClusterRevision attribute." - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 6 - constraints: - type: int16u - - - label: - "Step 3a: Given OO.S.F00(LT) ensure featuremap has the correct bit set" - command: "readAttribute" - attribute: "FeatureMap" - PICS: ( OO.S.F00 && !OO.S.F02 ) - response: - constraints: - type: bitmap32 - hasMasksSet: [0x1] - - label: - "Step 3b: Given OO.S.F00(LT) ensure featuremap has the correct bit set" - command: "readAttribute" - attribute: "FeatureMap" - PICS: ( !( OO.S.F00 && !OO.S.F02 ) ) - response: - constraints: - type: bitmap32 - hasMasksClear: [0x1] - - - label: - "Step 3c: Given OO.S.F01(DF) ensure featuremap has the correct bit set" - command: "readAttribute" - attribute: "FeatureMap" - PICS: ( OO.S.F01 && !OO.S.F02 ) - response: - constraints: - type: bitmap32 - hasMasksSet: [0x2] - - label: - "Step 3d: Given OO.S.F01(DF) ensure featuremap has the correct bit set" - command: "readAttribute" - attribute: "FeatureMap" - PICS: ( !( OO.S.F01 && !OO.S.F02 ) ) - response: - constraints: - type: bitmap32 - hasMasksClear: [0x2] - - - label: - "Step 3e: Given OO.S.F02(OFFONLY) TH reads from the DUT the FeatureMap - attribute." - command: "readAttribute" - attribute: "FeatureMap" - PICS: ( OO.S.F02 && !OO.S.F00 && !OO.S.F01 ) - response: - constraints: - type: bitmap32 - hasMasksSet: [0x4] - - label: - "Step 3f: Given OO.S.F02(OFFONLY) TH reads from the DUT the FeatureMap - attribute." - command: "readAttribute" - attribute: "FeatureMap" - PICS: ( !( OO.S.F02 && !OO.S.F00 && !OO.S.F01 ) ) - response: - constraints: - type: bitmap32 - hasMasksClear: [0x4] - - label: "Step 3g: All remaining shall be zero" - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksClear: [0xFFFFFFF8] - - - label: "Step 4a: TH reads from the DUT the AttributeList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 4a: TH reads from the DUT the AttributeList attribute." - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 65528, 65529, 65531, 65532, 65533] - - - label: - "Step 4b: TH reads the feature dependent(OO.S.F00) attribute in - AttributeList" - PICS: OO.S.F00 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [16384, 16385, 16386, 16387] - - - label: "Step 5: TH reads from the DUT the EventList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list - - - label: "Step 6a: TH reads from the DUT the AcceptedCommandList attribute." - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0] - - - label: - "Step 6b: TH reads the feature dependent(OO.S.F02) commands in - AcceptedCommandList" - command: "readAttribute" - attribute: "AcceptedCommandList" - PICS: ( !OO.S.F02 ) - response: - constraints: - type: list - contains: [1, 2] - - - label: - "Step 6c: TH reads the feature dependent(OO.S.F02) commands in - AcceptedCommandList" - command: "readAttribute" - attribute: "AcceptedCommandList" - PICS: OO.S.F02 - response: - constraints: - type: list - excludes: [1, 2] - - - label: - "Step 6d: TH reads the feature dependent(OO.S.F00) commands in - AcceptedCommandList" - command: "readAttribute" - attribute: "AcceptedCommandList" - PICS: OO.S.F00 - response: - constraints: - type: list - contains: [64, 65, 66] - - - label: - "Step 6e: TH reads the feature dependent(OO.S.F00) commands in - AcceptedCommandList" - command: "readAttribute" - attribute: "AcceptedCommandList" - PICS: ( !OO.S.F00 ) - response: - constraints: - type: list - excludes: [64, 65, 66] - - - label: "Step 7: TH reads from the DUT the GeneratedCommandList attribute." - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_OPCREDS_1_2.yaml b/src/app/tests/suites/certification/Test_TC_OPCREDS_1_2.yaml deleted file mode 100644 index cce8acd22655ca..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_OPCREDS_1_2.yaml +++ /dev/null @@ -1,121 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default - -name: 11.1.2. [TC-OPCREDS-1.2] Global Attributes with DUT as Server - -PICS: - - OPCREDS.S - -config: - nodeId: 0x12344321 - cluster: "Operational Credentials" - endpoint: 0 - -tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads from the DUT the ClusterRevision attribute." - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 1 - constraints: - type: int16u - - - label: "Step 3: TH reads from the DUT the FeatureMap attribute." - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: "Step 4: TH reads from the DUT the AttributeList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: - [ - 0xFFFD, - 0xFFFC, - 0xFFFB, - 0xFFFA, - 0xFFF9, - 0xFFF8, - 0x00, - 0x01, - 0x02, - 0x03, - 0x04, - 0x05, - ] - - - label: "Step 4: TH reads from the DUT the AttributeList attribute." - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: - [ - 0xFFFD, - 0xFFFC, - 0xFFFB, - 0xFFF9, - 0xFFF8, - 0x00, - 0x01, - 0x02, - 0x03, - 0x04, - 0x05, - ] - - - label: "Step 5: TH reads from the DUT the EventList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list - - - label: "Step 6: TH reads from the DUT the AcceptedCommandList attribute." - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0x00, 0x02, 0x04, 0x06, 0x07, 0x09, 0x0a, 0x0b] - - - label: "Step 7: TH reads from the DUT the GeneratedCommandList attribute." - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - constraints: - type: list - contains: [0x01, 0x03, 0x05, 0x08] diff --git a/src/app/tests/suites/certification/Test_TC_OTCCM_1_1.yaml b/src/app/tests/suites/certification/Test_TC_OTCCM_1_1.yaml deleted file mode 100644 index 008c608c9736ba..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_OTCCM_1_1.yaml +++ /dev/null @@ -1,101 +0,0 @@ -# Copyright (c) 2023 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 260.1.1. [TC-OTCCM-1.1] Global attributes with DUT as Server - -PICS: - - OTCCM.S - -config: - nodeId: 0x12344321 - cluster: "Oven Mode" - endpoint: 1 - -tests: - - label: "Step 1: Wait for the commissioned device to be retrieved" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads from the DUT the ClusterRevision attribute." - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 1 - constraints: - type: int16u - - - label: "Step 3: TH reads from the DUT the FeatureMap attribute." - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: "Step 4a: TH reads from the DUT the AttributeList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 4a: TH reads from the DUT the AttributeList attribute." - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 65528, 65529, 65531, 65532, 65533] - - - label: - "Step 4b: Read the optional attribute(StartUpMode) in AttributeList" - PICS: OTCCM.S.A0002 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [2] - - - label: "Step 5: TH reads from the DUT the EventList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list - - - label: "Step 6: TH reads from the DUT the AcceptedCommandList attribute." - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0] - - - label: "Step 7: TH reads from the DUT the GeneratedCommandList attribute." - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - constraints: - type: list - contains: [1] diff --git a/src/app/tests/suites/certification/Test_TC_PRS_1_1.yaml b/src/app/tests/suites/certification/Test_TC_PRS_1_1.yaml deleted file mode 100644 index 3d6f49e133bdd4..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_PRS_1_1.yaml +++ /dev/null @@ -1,169 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 36.1.1. [TC-PRS-1.1] Global Attributes with DUT as Server - -PICS: - - PRS.S - -config: - nodeId: 0x12344321 - cluster: "Pressure Measurement" - endpoint: 1 - -tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads from the DUT the ClusterRevision attribute." - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 3 - constraints: - type: int16u - - - label: "Step 3: TH reads from the DUT the FeatureMap attribute." - PICS: " !PRS.S.F00 " - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: - "Step 3: Given PRS.S.F00(EXT) ensure featuremap has the correct bit - set" - command: "readAttribute" - attribute: "FeatureMap" - PICS: PRS.S.F00 - response: - constraints: - type: bitmap32 - hasMasksSet: [0x1] - - - label: "Step 4a: TH reads from the DUT the AttributeList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 2, 65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 4a: TH reads from the DUT the AttributeList attribute." - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 2, 65528, 65529, 65531, 65532, 65533] - - - label: - "Step 4b: TH reads the optional attribute(ScaledValue) in - AttributeList" - PICS: PRS.S.A0010 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [16] - - - label: - "Step 4c: TH reads the optional attribute(MinScaledValue) in - AttributeList" - PICS: PRS.S.A0011 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [17] - - - label: - "Step 4d: TH reads the optional attribute(MaxScaledValue) in - AttributeList" - PICS: PRS.S.A0012 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [18] - - - label: "Step 4e: TH reads the optional attribute(Scale) in AttributeList" - PICS: PRS.S.A0014 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [20] - - - label: - "Step 4f: TH reads the optional attribute(Tolerance) in AttributeList" - PICS: PRS.S.A0003 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [3] - - - label: - "Step 4g: TH reads the optional attribute(ScaledTolerance) in - AttributeList" - PICS: PRS.S.A0013 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [19] - - - label: "Step 5: TH reads from the DUT the EventList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list - - - label: "Step 6: TH reads from the DUT the AcceptedCommandList attribute." - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - value: [] - constraints: - type: list - - - label: - "Step 7: TH reads from the DUT the GeneratedCommandList attribute." - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_PSCFG_1_1.yaml b/src/app/tests/suites/certification/Test_TC_PSCFG_1_1.yaml deleted file mode 100644 index d3ec7430f62bfe..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_PSCFG_1_1.yaml +++ /dev/null @@ -1,93 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 63.1.1. [TC-PSCFG-1.1] Global Attributes with DUT as Server - -PICS: - - PSCFG.S - -config: - nodeId: 0x12344321 - cluster: "Power Source Configuration" - endpoint: 0 - -tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads from the DUT the ClusterRevision attribute." - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 1 - constraints: - type: int16u - - - label: "Step 3: TH reads from the DUT the FeatureMap attribute." - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: "Step 4: TH reads from the DUT the AttributeList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 4: TH reads from the DUT the AttributeList attribute." - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 65528, 65529, 65531, 65532, 65533] - - - label: "Step 5: TH reads from the DUT the EventList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list - - - label: "Step 6: TH reads from the DUT the AcceptedCommandList attribute." - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - value: [] - constraints: - type: list - - - label: "Step 7: TH reads from the DUT the GeneratedCommandList attribute." - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_PS_1_1.yaml b/src/app/tests/suites/certification/Test_TC_PS_1_1.yaml deleted file mode 100644 index f0ac68665894fb..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_PS_1_1.yaml +++ /dev/null @@ -1,211 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 62.1.1. [TC-PS-1.1] Global Attributes with DUT as Server - -PICS: - - PS.S - -config: - nodeId: 0x12344321 - cluster: "Power Source" - endpoint: 1 - -tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: Test Harness Client reads ClusterRevision attribute." - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 2 - constraints: - type: int16u - - - label: "Step 3a: TH reads from the DUT the FeatureMap attribute." - PICS: " !PS.S.F00 && !PS.S.F01 && !PS.S.F02 && !PS.S.F03 " - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: - "Step 3b: Given PS.S.F00(WIRED) ensure featuremap has the correct bit - set" - PICS: PS.S.F00 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x1] - - - label: - "Step 3c: Given PS.S.F01(BAT) ensure featuremap has the correct bit - set" - PICS: PS.S.F01 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x2] - - - label: - "Step 3c: Given PS.S.F02(RECHG) ensure featuremap has the correct bit - set" - PICS: PS.S.F02 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x2, 0x4] - - - label: - "Step 3d: Given PS.S.F03(REPLC) ensure featuremap has the correct bit - set" - PICS: PS.S.F03 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x2, 0x8] - - - label: "Step 4: Test Harness Client reads AttributeList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: - [0, 1, 2, 0x1f, 65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 4: Test Harness Client reads AttributeList attribute." - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 2, 0x1f, 65528, 65529, 65531, 65532, 65533] - - - label: - "Step 4a: TH reads the Feature dependent(PS.S.F00-WIRED) attribute in - AttributeList" - PICS: PS.S.F00 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [5] - - - label: - "Step 4b: TH reads the Feature dependent(PS.S.F01-BAT) attribute in - AttributeList" - PICS: PS.S.F01 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [14, 15, 16] - - - label: - "Step 4c: TH reads the Feature dependent(PS.S.F02-RECHG) attribute in - AttributeList" - PICS: PS.S.F02 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [26, 28] - - - label: - "Step 4d: TH reads the Feature dependent(PS.S.F03-REPLC) attribute in - AttributeList" - PICS: PS.S.F03 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [19, 25] - - - label: "Step 5a: Test Harness Client reads EventList attribute." - PICS: "PICS_EVENT_LIST_ENABLED && !PS.S.E00 && !PS.S.E01 && !PS.S.E02 " - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list - - - label: "Step 5b: TH reads PS.S.E00(WiredFaultChange) event in EventList" - PICS: PICS_EVENT_LIST_ENABLED && PS.S.E00 - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list - contains: [0] - - - label: "Step 5c: TH reads PS.S.E01(BatFaultChange) event in EventList" - PICS: PICS_EVENT_LIST_ENABLED && PS.S.E01 - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list - contains: [1] - - - label: - "Step 5d: TH reads PS.S.E02(BatChargeFaultChange) event in EventList" - PICS: PICS_EVENT_LIST_ENABLED && PS.S.E02 - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list - contains: [2] - - - label: "Step 6: Test Harness Client reads AcceptedCommandList attribute." - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - value: [] - constraints: - type: list - - - label: "Step 7: Test Harness Client reads GeneratedCommandList attribute." - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_REFALM_1_1.yaml b/src/app/tests/suites/certification/Test_TC_REFALM_1_1.yaml deleted file mode 100644 index fd9a44944b8b49..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_REFALM_1_1.yaml +++ /dev/null @@ -1,116 +0,0 @@ -# Copyright (c) 2023 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 223.1.1. [TC-REFALM-1.1] Global attributes with DUT as Server - -PICS: - - REFALM.S - -config: - nodeId: 0x12344321 - cluster: "Refrigerator Alarm" - endpoint: 1 - -tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads from the DUT the ClusterRevision attribute" - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 1 - constraints: - type: int16u - - - label: "Step 3: TH reads from the DUT the FeatureMap attribute" - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: "Step 4: TH reads from the DUT the AttributeList attribute" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: - [ - 0x0000, - 0x0002, - 0x0003, - 0xfff8, - 0xfff9, - 0xfffa, - 0xfffb, - 0xfffc, - 0xfffd, - ] - excludes: [0x0001] - - - label: "Step 4: TH reads from the DUT the AttributeList attribute" - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: - [ - 0x0000, - 0x0002, - 0x0003, - 0xfff8, - 0xfff9, - 0xfffb, - 0xfffc, - 0xfffd, - ] - excludes: [0x0001] - - - label: "Step 5: TH reads from the DUT the EventList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list - - - label: "Step 6: TH reads from the DUT the AcceptedCommandList attribute." - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - value: [] - constraints: - type: list - - - label: "Step 7: TH reads from the DUT the GeneratedCommandList attribute." - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_RH_1_1.yaml b/src/app/tests/suites/certification/Test_TC_RH_1_1.yaml deleted file mode 100644 index 8281fc20386d14..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_RH_1_1.yaml +++ /dev/null @@ -1,103 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 9.1.1. [TC-RH-1.1] Global attributes with server as DUT - -PICS: - - RH.S - -config: - nodeId: 0x12344321 - cluster: "Relative Humidity Measurement" - endpoint: 1 - -tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads the ClusterRevision attribute from the DUT." - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 3 - constraints: - type: int16u - - - label: "Step 3: TH reads the FeatureMap attribute from the DUT." - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: "Step 4a: TH reads the AttributeList attribute from the DUT." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 2, 65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 4a: TH reads the AttributeList attribute from the DUT." - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 2, 65528, 65529, 65531, 65532, 65533] - - - label: - "Step 4b: TH reads the optional attribute(Tolerance) in AttributeList" - command: "readAttribute" - attribute: "AttributeList" - PICS: RH.S.A0003 - response: - constraints: - type: list - contains: [3] - - - label: "Step 5: TH reads the AcceptedCommandList attribute from the DUT." - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - value: [] - constraints: - type: list - - - label: "Step 6: TH reads the GeneratedCommandList attribute from the DUT." - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [] - constraints: - type: list - - - label: "Step 7: TH reads the EventList attribute from the DUT." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_RVCCLEANM_1_1.yaml b/src/app/tests/suites/certification/Test_TC_RVCCLEANM_1_1.yaml deleted file mode 100644 index 1a4dbae62cb01f..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_RVCCLEANM_1_1.yaml +++ /dev/null @@ -1,99 +0,0 @@ -# Copyright (c) 2023 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 78.1.1. [TC-RVCCLEANM-1.1] Global attributes with DUT as Server - -PICS: - - RVCCLEANM.S - -config: - nodeId: 0x12344321 - cluster: "RVC Clean Mode" - endpoint: 1 - -tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads from the DUT the ClusterRevision attribute." - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 2 - constraints: - type: int16u - - - label: "Step 3: TH reads from the DUT the FeatureMap attribute." - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: "Step 4a: TH reads from the DUT the AttributeList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 4a: TH reads from the DUT the AttributeList attribute." - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 65528, 65529, 65531, 65532, 65533] - - - label: "Step 5: TH reads from the DUT the EventList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list - - - label: - "Step 6: TH reads from the DUT the AcceptedCommandList attribute. - Check if it contains id 0x0 (ChangeToMode)" - PICS: RVCCLEANM.S.C00.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - value: [0] - constraints: - type: list - - - label: - "Step 7: TH reads from the DUT the GeneratedCommandList attribute. - Check if it contains id 0x1 (ChangeToModeResponse)" - PICS: RVCCLEANM.S.C01.Tx - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [1] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_RVCOPSTATE_1_1.yaml b/src/app/tests/suites/certification/Test_TC_RVCOPSTATE_1_1.yaml deleted file mode 100644 index ce4e4e35b87467..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_RVCOPSTATE_1_1.yaml +++ /dev/null @@ -1,162 +0,0 @@ -# Copyright (c) 2023 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 224.1.1. [TC-RVCOPSTATE-1.1] Global attributes [DUT as Server] - -PICS: - - RVCOPSTATE.S - -config: - nodeId: 0x12344321 - cluster: "RVC Operational State" - endpoint: 1 - -tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads from the DUT the ClusterRevision attribute" - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 1 - constraints: - type: int16u - - - label: "Step 3: TH reads from the DUT the FeatureMap attribute" - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: "Step 4a: TH reads from the DUT the AttributeList attribute" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: - [0, 1, 3, 4, 5, 65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 4a: TH reads from the DUT the AttributeList attribute" - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 3, 4, 5, 65528, 65529, 65531, 65532, 65533] - - - label: - "Step 4b: TH reads from the DUT the optional attribute(CountdownTime) - in the AttributeList from the DUT" - PICS: RVCOPSTATE.S.A0002 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [2] - - - label: "Step 5a: TH reads from the DUT the EventList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list - contains: [0x00] - - - label: - "Step 5b: TH reads from the DUT the optional - event(OperationCompletion) in EventList." - PICS: PICS_EVENT_LIST_ENABLED && RVCOPSTATE.S.E01 - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list - contains: [0x01] - - - label: - "Step 6a: TH reads the optional command(Pause) in AcceptedCommandList" - PICS: RVCOPSTATE.S.C00.Rsp || RVCOPSTATE.S.C03.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0, 3] - - - label: - "Step 6b: TH reads the optional command(Stop) in AcceptedCommandList" - PICS: RVCOPSTATE.S.C01.Rsp || RVCOPSTATE.S.C02.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [1, 2] - - - label: - "Step 6c: TH reads the optional command(Start) in AcceptedCommandList" - PICS: RVCOPSTATE.S.C02.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [2] - - - label: - "Step 6d: TH reads the optional command(Resume) in AcceptedCommandList" - PICS: RVCOPSTATE.S.C03.Rsp || RVCOPSTATE.S.C00.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0, 3] - - - label: "Step 7: TH reads from the DUT the GeneratedCommandList attribute" - PICS: - " !RVCOPSTATE.S.C00.Rsp && !RVCOPSTATE.S.C01.Rsp && - !RVCOPSTATE.S.C02.Rsp && !RVCOPSTATE.S.C03.Rsp " - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [] - constraints: - type: list - - - label: "Step 7: TH reads from the DUT the GeneratedCommandList attribute" - PICS: - " RVCOPSTATE.S.C00.Rsp || RVCOPSTATE.S.C01.Rsp || RVCOPSTATE.S.C02.Rsp - || RVCOPSTATE.S.C03.Rsp " - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - constraints: - type: list - contains: [4] diff --git a/src/app/tests/suites/certification/Test_TC_RVCRUNM_1_1.yaml b/src/app/tests/suites/certification/Test_TC_RVCRUNM_1_1.yaml deleted file mode 100644 index f9b4aed3db30c3..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_RVCRUNM_1_1.yaml +++ /dev/null @@ -1,99 +0,0 @@ -# Copyright (c) 2023 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 78.1.1. [TC-RVCRUNM-1.1] Global attributes with DUT as Server - -PICS: - - RVCRUNM.S - -config: - nodeId: 0x12344321 - cluster: "RVC Run Mode" - endpoint: 1 - -tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads from the DUT the ClusterRevision attribute." - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 2 - constraints: - type: int16u - - - label: "Step 3: TH reads from the DUT the FeatureMap attribute." - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: "Step 4a: TH reads from the DUT the AttributeList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 4a: TH reads from the DUT the AttributeList attribute." - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 65528, 65529, 65531, 65532, 65533] - - - label: "Step 5: TH reads from the DUT the EventList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list - - - label: - "Step 6: TH reads from the DUT the AcceptedCommandList attribute. - Check if it contains id 0x0 (ChangeToMode)" - PICS: RVCRUNM.S.C00.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - value: [0] - constraints: - type: list - - - label: - "Step 7: TH reads from the DUT the GeneratedCommandList attribute. - Check if it contains id 0x1 (ChangeToModeResponse)" - PICS: RVCRUNM.S.C01.Tx - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [1] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_S_1_1.yaml b/src/app/tests/suites/certification/Test_TC_S_1_1.yaml deleted file mode 100644 index c8a8c359e1cdc8..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_S_1_1.yaml +++ /dev/null @@ -1,132 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 123.1.1. [TC-S-1.1] Global attributes with DUT as Server - -PICS: - - S.S - -config: - nodeId: 0x12344321 - cluster: "Scenes Management" - endpoint: 1 - -tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads from the DUT the ClusterRevision attribute" - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 1 - constraints: - type: int16u - - - label: - "Step 3: TH reads FeatureMap NameSupport bit (global attribute 65532)" - PICS: (!S.S.F00) - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksClear: [0x1] - - - label: - "Step 3: TH reads FeatureMap NameSupport bit (global attribute 65532)" - PICS: (S.S.F00) - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x1] - - - label: - "Step 4a: TH reads AttributeList mandatory attributes(global attribute - 65531)" - PICS: S.S - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [1, 2, 65528, 65529, 65531, 65532, 65533] - - - label: - "Step 4b: TH reads the LastConfiguredBy optional attribute from the - AttributeList (global attribute 65531)" - PICS: S.S.A0000 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0] - - - label: "Step 5: TH reads from the DUT the EventList attribute" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list - contains: [] - - - label: "Step 6a: TH reads from the DUT the AcceptedCommandList attribute" - PICS: S.S - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0, 1, 2, 3, 4, 5, 6] - - - label: - "Step 6b: TH reads optional command(CopySceneResponse) - AcceptedCommandList (global attribute 65529)" - PICS: S.S.C40.Rsp - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [64] - - - label: "Step 7a: TH reads from the DUT the GeneratedCommandList attribute" - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - constraints: - type: list - contains: [0, 1, 2, 3, 4, 6] - - - label: - "Step 7b: TH reads Read optional command(CopySceneResponse) in - GeneratedCommandList (global attribute 65528)" - PICS: S.S.C40.Rsp - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - constraints: - type: list - contains: [64] diff --git a/src/app/tests/suites/certification/Test_TC_TCCM_1_1.yaml b/src/app/tests/suites/certification/Test_TC_TCCM_1_1.yaml deleted file mode 100644 index 4ee0ba303a1c61..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_TCCM_1_1.yaml +++ /dev/null @@ -1,129 +0,0 @@ -# Copyright (c) 2023 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 219.1.1. [TC-TCCM-1.1] Global attributes with DUT as Server - -PICS: - - TCCM.S - -config: - nodeId: 0x12344321 - cluster: "Refrigerator And Temperature Controlled Cabinet Mode" - endpoint: 1 - -tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads from the DUT the ClusterRevision attribute." - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 2 - constraints: - type: int16u - - #Issue https://github.com/project-chip/connectedhomeip/issues/31551 - - label: "Step 3: TH reads from the DUT the FeatureMap attribute." - command: "readAttribute" - attribute: "FeatureMap" - PICS: "!TCCM.S.F00" - response: - value: 0 - constraints: - type: bitmap32 - - - label: - "Step 3: TH reads from the DUT the FeatureMap attribute, bit 0: SHALL - be 1 if and only if TCCM.S.F00" - command: "readAttribute" - attribute: "FeatureMap" - PICS: TCCM.S.F00 - response: - constraints: - type: bitmap32 - hasMasksSet: [0x1] - - - label: "Step 4a: TH reads from the DUT the AttributeList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 4a: TH reads from the DUT the AttributeList attribute." - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 65528, 65529, 65531, 65532, 65533] - - - label: - "Step 4b: TH reads from the DUT the AttributeList attribute. 0x0002: - SHALL be included if and only if TCCM.S.A0002(StartUpMode)" - PICS: TCCM.S.A0002 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [2] - - #Issue https://github.com/project-chip/connectedhomeip/issues/31551 - - label: - "Step 4c: TH reads from the DUT the AttributeList attribute. 0x0003 - SHALL be included if and only if TCCM.S.F00" - PICS: TCCM.S.F00 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [3] - - - label: "Step 5: TH reads from the DUT the EventList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list - - - label: "Step 6: TH reads from the DUT the AcceptedCommandList attribute." - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0] - - - label: "Step 7: TH reads from the DUT the GeneratedCommandList attribute." - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - constraints: - type: list - contains: [1] diff --git a/src/app/tests/suites/certification/Test_TC_TGTNAV_1_9.yaml b/src/app/tests/suites/certification/Test_TC_TGTNAV_1_9.yaml deleted file mode 100644 index 55d7d295e4369e..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_TGTNAV_1_9.yaml +++ /dev/null @@ -1,104 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: - 19.1.9. [TC-TGTNAV-1.9] Global attributes - Target Navigator Cluster (DUT as - Server) - -PICS: - - TGTNAV.S - -config: - nodeId: 0x12344321 - cluster: "Target Navigator" - endpoint: 1 - -tests: - - label: "Wait for the commissioned device to be retrieved" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 1: TH reads the ClusterRevision attribute from the DUT" - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 2 - constraints: - type: int16u - - - label: "Step 2: TH reads the FeatureMap attribute from the DUT" - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: "Step 3a: TH reads the AttributeList attribute from the DUT" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 3a: TH reads the AttributeList attribute from the DUT" - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 65528, 65529, 65531, 65532, 65533] - - - label: - "Step 3b: TH reads the optional attribute(CurrentTarget) in - AttributeList" - PICS: TGTNAV.S.A0001 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [1] - - - label: "Step 4: TH reads the AcceptedCommandList attribute from the DUT" - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0] - - - label: "Step 5: TH reads the GeneratedCommandList attribute from the DUT" - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - constraints: - type: list - contains: [1] - - - label: "Step 6: TH reads the EventList attribute from the DUT" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_TIMESYNC_1_1.yaml b/src/app/tests/suites/certification/Test_TC_TIMESYNC_1_1.yaml deleted file mode 100644 index f9384780f54269..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_TIMESYNC_1_1.yaml +++ /dev/null @@ -1,400 +0,0 @@ -# Copyright (c) 2023 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 133.1.1. [TC-TIMESYNC-1.1] Global attributes with server as DUT - -PICS: - - TIMESYNC.S - -config: - nodeId: 0x12344321 - cluster: "Time Synchronization" - endpoint: 0 - -tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - ########################## - # TS 2: Cluster revision - ########################## - - label: "Step 2: TH reads from the DUT the ClusterRevision attribute." - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 2 - - ########################## - # TS 3: Feature map - ########################## - # TZ - - label: "Step 3: TH reads from the DUT the FeatureMap attribute." - PICS: TIMESYNC.S.F00 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x1] - - - label: - "Step 3b: Given !TIMESYNC.S.F00(TZ) ensure featuremap has the correct - bit clear" - PICS: "!TIMESYNC.S.F00" - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksClear: [0x1] - # NTPC - - label: - "Step 3c: Given TIMESYNC.S.F01(NTPC) ensure featuremap has the correct - bit set" - PICS: TIMESYNC.S.F01 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x2] - - - label: - "Step 3d: Given !TIMESYNC.S.F01(NTPC) ensure featuremap has the - correct bit clear" - PICS: "!TIMESYNC.S.F01" - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksClear: [0x2] - - # NTPS - - label: - "Step 3e: Given TIMESYNC.S.F02(NTPS) ensure featuremap has the correct - bit set" - PICS: TIMESYNC.S.F02 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x4] - - - label: - "Step 3f: Given !TIMESYNC.S.F02(NTPS) ensure featuremap has the - correct bit clear" - PICS: "!TIMESYNC.S.F02" - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksClear: [0x4] - - # TSC - - label: - "Step 3g: Given TIMESYNC.S.F03(TSC) ensure featuremap has the correct - bit set" - PICS: TIMESYNC.S.F03 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x8] - - - label: - "Step 3h: Given !TIMESYNC.S.F03(TSC) ensure featuremap has the correct - bit clear" - PICS: "!TIMESYNC.S.F03" - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksClear: [0x8] - - ########################## - # TS 3: Feature map - ########################## - # Mandatory entries - - label: "Step 4a: TH reads from the DUT the AttributeList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - contains: - [ - 0x0000, - 0x0001, - 0xFFF8, - 0xFFF9, - 0xFFFA, - 0xFFFB, - 0xFFFC, - 0xFFFD, - ] - - - label: "Step 4b: TH reads from the DUT the AttributeList attribute." - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - contains: [0x0000, 0x0001, 0xFFF8, 0xFFF9, 0xFFFB, 0xFFFC, 0xFFFD] - - # Optional - - label: "Step 4c: Check for optional attribute TimeSource in AttributeList" - PICS: TIMESYNC.S.A0002 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - contains: [0x0002] - - - label: - "Step 4d: Check for optional attribute TimeSource not in AttributeList" - PICS: "!TIMESYNC.S.A0002" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - excludes: [0x0002] - - # Feature TZ - - label: "Step 4e: Check for TZ feature-based attributes in AttributeList" - PICS: TIMESYNC.S.F00 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - contains: [0x0005, 0x0006, 0x0007, 0x0008, 0x000A, 0x000B] - - - label: - "Step 4f: Check for TZ feature-based attributes not in AttributeList" - PICS: "!TIMESYNC.S.F00" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - excludes: [0x0005, 0x0006, 0x0007, 0x0008, 0x000A, 0x000B] - - # Feature NTPC - - label: "Step 4g: Check for NTPC feature-based attributes in AttributeList" - PICS: TIMESYNC.S.F01 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - contains: [0x0004, 0x000C] - - - label: - "Step 4h: Check for NTPC feature-based attributes not in AttributeList" - PICS: "!TIMESYNC.S.F01" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - excludes: [0x0004, 0x000C] - - # Feature NTPS - - label: "Step 4i: Check for NTPS feature-based attributes in AttributeList" - PICS: TIMESYNC.S.F02 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - contains: [0x0009] - - - label: - "Step 4j: Check for NTPS feature-based attributes not in AttributeList" - PICS: "!TIMESYNC.S.F02" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - excludes: [0x0009] - - # Feature TSC - - label: "Step 4k: Check for TSC feature-based attributes in AttributeList" - PICS: TIMESYNC.S.F03 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - contains: [0x0003] - - - label: - "Step 4l: Check for TSC feature-based attributes not in AttributeList" - PICS: "!TIMESYNC.S.F03" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - excludes: [0x0003] - - # Note - additional exclusions not handled here - - ########################## - # TS 5: Event list - NOTE: disabled - ########################## - # mandatory - - label: "Step 5a: TH reads from the DUT the EventList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - constraints: - contains: [0x03] - - #Feature TZ - - label: "Step 5b: Check for TZ feature-based events in EventList" - PICS: PICS_EVENT_LIST_ENABLED && TIMESYNC.S.F00 - command: "readAttribute" - attribute: "EventList" - response: - constraints: - contains: [0x00, 0x01, 0x02] - - - label: "Step 5c: Check for TZ feature-based events not in EventList" - PICS: "PICS_EVENT_LIST_ENABLED && !TIMESYNC.S.F00" - command: "readAttribute" - attribute: "EventList" - response: - constraints: - excludes: [0x00, 0x01, 0x02] - - #Feature TSC - - label: "Step 5d: Check for TSC feature-based events in EventList" - PICS: PICS_EVENT_LIST_ENABLED && TIMESYNC.S.F03 - command: "readAttribute" - attribute: "EventList" - response: - constraints: - contains: [0x04] - - - label: "Step 5e: Check for TSC feature-based events not in EventList" - PICS: "PICS_EVENT_LIST_ENABLED && !TIMESYNC.S.F03" - command: "readAttribute" - attribute: "EventList" - response: - constraints: - excludes: [0x04] - - # Note - additional exclusions not handled here - - ########################## - # TS 6: AcceptedCommandList - ########################## - # mandatory - - label: "Step 6a: TH reads from the DUT the AcceptedCommandList attribute." - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - contains: [0x00] - - # Feature TZ - - label: - "Step 6b: Check for TZ feature-based commands in AcceptedCommandList" - PICS: TIMESYNC.S.F00 - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - contains: [0x02, 0x04] - - - label: - "Step 6c: Check for TZ feature-based commands in not - AcceptedCommandList" - PICS: "!TIMESYNC.S.F00" - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - excludes: [0x02, 0x04] - - # Feature NTPC - - label: - "Step 6d: Check for NTPC feature-based commands in AcceptedCommandList" - PICS: TIMESYNC.S.F01 - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - contains: [0x05] - - - label: - "Step 6e: Check for NTPC feature-based commands in not - AcceptedCommandList" - PICS: "!TIMESYNC.S.F01" - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - excludes: [0x05] - - # Feature TSC - - label: - "Step 6f: Check for TSC feature-based commands in AcceptedCommandList" - PICS: TIMESYNC.S.F03 - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - contains: [0x01] - - - label: - "Step 6g: Check for TSC feature-based commands in not - AcceptedCommandList" - PICS: "!TIMESYNC.S.F03" - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - excludes: [0x01] - - # NOTE: exclusions not checked - - ########################## - # TS 7: GeneratedCommandList - ########################## - # Feature TZ - - label: "Step 7a: TH reads from the DUT the GeneratedCommandList attribute" - PICS: TIMESYNC.S.F00 - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - constraints: - contains: [0x03] - - - label: - "Step 7b: Check for TZ feature-based commands in not - GeneratedCommandList" - PICS: "!TIMESYNC.S.F00" - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - constraints: - excludes: [0x03] diff --git a/src/app/tests/suites/certification/Test_TC_TMP_1_1.yaml b/src/app/tests/suites/certification/Test_TC_TMP_1_1.yaml deleted file mode 100644 index 48eea5b8d29552..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_TMP_1_1.yaml +++ /dev/null @@ -1,101 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 7.1.1. [TC-TMP-1.1] Global attributes with server as DUT - -PICS: - - TMP.S - -config: - nodeId: 0x12344321 - cluster: "Temperature Measurement" - endpoint: 1 - -tests: - - label: "Step 1: Wait for the commissioned device to be retrieved" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads ClusterRevision attribute from the DUT" - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 4 - constraints: - type: int16u - - - label: "Step 3: TH reads FeatureMap attribute from the DUT" - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: "Step 4a: TH reads the global attribute: AttributeList" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 2, 65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 4a: TH reads the global attribute: AttributeList" - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 2, 65528, 65529, 65531, 65532, 65533] - - - label: - "Step 4b: TH reads the optional attribute(Tolerance) in AttributeList" - PICS: TMP.S.A0003 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [3] - - - label: "Step 5: TH reads AcceptedCommandList attribute from the DUT" - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - value: [] - constraints: - type: list - - - label: "Step 6: TH reads GeneratedCommandList attribute from the DUT" - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [] - constraints: - type: list - - - label: "Step 7: TH reads EventList attribute from the DUT." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_TSUIC_1_1.yaml b/src/app/tests/suites/certification/Test_TC_TSUIC_1_1.yaml deleted file mode 100644 index 333a81dc7b71a8..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_TSUIC_1_1.yaml +++ /dev/null @@ -1,102 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 12.1.1. [TC-TSUIC-1.1] Global attributes with DUT as Server - -PICS: - - TSUIC.S - -config: - nodeId: 0x12344321 - cluster: "Thermostat User Interface Configuration" - endpoint: 1 - -tests: - - label: "Step 1: Commission DUT to TH" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads from the DUT the ClusterRevision attribute." - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 2 - constraints: - type: int16u - - - label: "Step 3: TH reads from the DUT the FeatureMap attribute." - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: "Step 4a: TH reads from the DUT the AttributeList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 4a: TH reads from the DUT the AttributeList attribute." - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 65528, 65529, 65531, 65532, 65533] - - - label: - "Step 4b: TH reads optional attribute(ScheduleProgrammingVisibility) - in AttributeList" - PICS: TSUIC.S.A0002 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [2] - - - label: "Step 5: TH reads from the DUT the EventList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list - - - label: "Step 6: TH reads from the DUT the GeneratedCommandList attribute." - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [] - constraints: - type: list - - - label: "Step 7: TH reads from the DUT the AcceptedCommandList attribute." - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_ULABEL_1_1.yaml b/src/app/tests/suites/certification/Test_TC_ULABEL_1_1.yaml deleted file mode 100644 index e78f650215c24f..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_ULABEL_1_1.yaml +++ /dev/null @@ -1,93 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 95.1.1. [TC-ULABEL-1.1] Global Attributes with DUT as Server - -PICS: - - ULABEL.S - -config: - nodeId: 0x12344321 - cluster: "User Label" - endpoint: 1 - -tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads from the DUT the ClusterRevision attribute." - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 1 - constraints: - type: int16u - - - label: "Step 3: TH reads from the DUT the FeatureMap attribute." - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: "Step 4: TH reads from the DUT the AttributeList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 4: TH reads from the DUT the AttributeList attribute." - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 65528, 65529, 65531, 65532, 65533] - - - label: "Step 5: TH reads from the DUT the EventList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list - - - label: "Step 6: TH reads from the DUT the AcceptedCommandList attribute." - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - value: [] - constraints: - type: list - - - label: "Step 7: TH reads from the DUT the GeneratedCommandList attribute." - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_VALCC_1_1.yaml b/src/app/tests/suites/certification/Test_TC_VALCC_1_1.yaml deleted file mode 100644 index cf00d40a21a02f..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_VALCC_1_1.yaml +++ /dev/null @@ -1,186 +0,0 @@ -# Copyright (c) 2024 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 62.1.1. [TC-VALCC-1.1] Global attributes with server as DUT - -PICS: - - VALCC.S - -config: - nodeId: 0x12344321 - cluster: "Valve Configuration and Control" - endpoint: 1 - -tests: - - label: "Step 1: Wait for the commissioned device to be retrieved" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: Read the global attribute: ClusterRevision" - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 1 - constraints: - type: int16u - - - label: "Step 3a: Read the global attribute: FeatureMap" - command: "readAttribute" - attribute: "FeatureMap" - PICS: ( !VALCC.S.F00 && !VALCC.S.F01 ) - response: - value: 0 - constraints: - type: bitmap32 - - - label: - "Step 3b: Given VALCC.S.F00(TS) ensure featuremap has the correct bit - set" - command: "readAttribute" - attribute: "FeatureMap" - PICS: VALCC.S.F00 - response: - constraints: - type: bitmap32 - hasMasksSet: [0x1] - - - label: - "Step 3c: Given VALCC.S.F01(LVL) ensure featuremap has the correct bit - set" - command: "readAttribute" - attribute: "FeatureMap" - PICS: VALCC.S.F01 - response: - constraints: - type: bitmap32 - hasMasksSet: [0x2] - - - label: "Step 4a: Read the global attribute: AttributeList" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 3, 4, 65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 4a: Read the global attribute: AttributeList" - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1, 3, 4, 65528, 65529, 65531, 65532, 65533] - - - label: - "Step 4b: Read the feature dependent(VALCC.S.F00) attribute in - AttributeList" - PICS: VALCC.S.F00 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [2] - - - label: - "Step 4c: Read the feature dependent(VALCC.S.F01) attribute in - AttributeList" - PICS: VALCC.S.F01 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [6, 7] - - - label: - "Step 4d: Read the feature dependent(VALCC.S.F01) optional attribute - in AttributeList" - PICS: VALCC.S.F01 && VALCC.S.A0008 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [8] - - - label: - "Step 4e: Read the feature dependent(VALCC.S.F01) optional attribute - in AttributeList" - PICS: VALCC.S.F01 && VALCC.S.A000a - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [10] - - - label: - "Step 4f: TH reads optional (ValveFault) attribute in AttributeList" - PICS: VALCC.S.A0009 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [9] - - - label: "Step 5a: Read the global attribute: EventList" - PICS: PICS_EVENT_LIST_ENABLED && !VALCC.S.E00 && !VALCC.S.E01 - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list - - - label: "Step 5b: Read the optional (ValveStateChanged) event in EventList" - PICS: PICS_EVENT_LIST_ENABLED && VALCC.S.E00 - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list - contains: [0] - - - label: "Step 5c: Read the optional (ValveFault) event in EventList" - PICS: PICS_EVENT_LIST_ENABLED && VALCC.S.E01 - command: "readAttribute" - attribute: "EventList" - response: - constraints: - type: list - contains: [1] - - - label: "Step 6: Read the global attribute: AcceptedCommandList" - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - constraints: - type: list - contains: [0, 1] - - - label: "Step 7: Read the global attribute: GeneratedCommandList" - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_WAKEONLAN_1_5.yaml b/src/app/tests/suites/certification/Test_TC_WAKEONLAN_1_5.yaml deleted file mode 100644 index 59de9edbd7a636..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_WAKEONLAN_1_5.yaml +++ /dev/null @@ -1,104 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: - 19.1.5. [TC-WAKEONLAN-1.5] Global attributes - Wake on LAN Cluster (DUT as - Server) - -PICS: - - WAKEONLAN.S - -config: - nodeId: 0x12344321 - cluster: "Wake on LAN" - endpoint: 1 - -tests: - - label: - "Commission DUT to TH (can be skipped if done in a preceding test)." - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 1: TH reads the ClusterRevision attribute from the DUT" - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 1 - constraints: - type: int16u - - - label: "Step 2: TH reads the FeatureMap attribute from the DUT" - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: "Step 3a: TH reads the AttributeList attribute from the DUT" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 3a: TH reads the AttributeList attribute from the DUT" - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [65528, 65529, 65531, 65532, 65533] - - - label: - "Step 3b: TH reads the optional attribute(MACAddress) in AttributeList" - PICS: WAKEONLAN.S.A0000 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0] - - - label: "Step 4: TH reads the global attribute: AcceptedCommandList" - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - value: [] - constraints: - type: list - - - label: "Step 5: TH reads the global attribute: GeneratedCommandList" - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [] - constraints: - type: list - - - label: "Step 6: TH reads the global attribute: EventList" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/certification/Test_TC_WASHERCTRL_1_1.yaml b/src/app/tests/suites/certification/Test_TC_WASHERCTRL_1_1.yaml deleted file mode 100644 index 61e4f130dca7dd..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_WASHERCTRL_1_1.yaml +++ /dev/null @@ -1,140 +0,0 @@ -# Copyright (c) 2023 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: 186.1.1. [TC-WASHERCTRL-1.1] Global Attributes with DUT as Server - -PICS: - - WASHERCTRL.S - -config: - nodeId: 0x12344321 - cluster: "Laundry Washer Controls" - endpoint: 1 - -tests: - - label: "Commission DUT to TH" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads from the DUT the ClusterRevision attribute" - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 1 - constraints: - type: int16u - - - label: - "Step 3: TH reads from the DUT the FeatureMap attribute. If - WASHERCTRL.S.F00(SPIN) & WASHERCTRL.S.F01(RINSE) are false" - PICS: "!WASHERCTRL.S.F00 && !WASHERCTRL.S.F01" - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 - constraints: - type: bitmap32 - - - label: - "Step 3: TH reads from the DUT the FeatureMap attribute, bit 0 set to - 1 if the DUT is capable of controlling the washer using the spin - attributes (WASHERCTRL.S.F00(SPIN) is true)" - PICS: WASHERCTRL.S.F00 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x1] - - - label: - "Step 3: TH reads from the DUT the FeatureMap attribute, bit 1 set to - 1 if the DUT supports rinse attributes (WASHERCTRL.S.F01(RINSE) is - true)" - PICS: WASHERCTRL.S.F01 - command: "readAttribute" - attribute: "FeatureMap" - response: - constraints: - type: bitmap32 - hasMasksSet: [0x2] - - - label: "Step 4a: TH reads from the DUT the AttributeList attribute" - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [65528, 65529, 65530, 65531, 65532, 65533] - - - label: "Step 4a: TH reads from the DUT the AttributeList attribute." - PICS: "!PICS_EVENT_LIST_ENABLED" - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [65528, 65529, 65531, 65532, 65533] - - - label: - "Step 4b: TH reads the feature dependent(WASHERCTRL.S.F00) attributes - in AttributeList from DUT." - PICS: WASHERCTRL.S.F00 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [0, 1] - - - label: - "Step 4c: TH reads the feature dependent(WASHERCTRL.S.F01) attributes - in AttributeList from DUT." - PICS: WASHERCTRL.S.F01 - command: "readAttribute" - attribute: "AttributeList" - response: - constraints: - type: list - contains: [2, 3] - - - label: "Step 5: TH reads from the DUT the EventList attribute." - PICS: PICS_EVENT_LIST_ENABLED - command: "readAttribute" - attribute: "EventList" - response: - value: [] - constraints: - type: list - - - label: "Step 6: TH reads from the DUT the AcceptedCommandList attribute." - command: "readAttribute" - attribute: "AcceptedCommandList" - response: - value: [] - constraints: - type: list - - - label: "Step 7: TH reads from the DUT the GeneratedCommandList attribute." - command: "readAttribute" - attribute: "GeneratedCommandList" - response: - value: [] - constraints: - type: list diff --git a/src/app/tests/suites/ciTests.json b/src/app/tests/suites/ciTests.json index 26efd799ad7efd..a77ecb9a3b2838 100644 --- a/src/app/tests/suites/ciTests.json +++ b/src/app/tests/suites/ciTests.json @@ -1,7 +1,6 @@ { "AccessControl": [ "TestAccessControlCluster", - "Test_TC_ACL_1_1", "Test_TC_ACL_2_1", "Test_TC_ACL_2_3", "Test_TC_ACL_2_4", @@ -14,12 +13,11 @@ ], "ContentAppObserver": [], "AccessControlEnforcement": ["Test_TC_ACE_1_1", "Test_TC_ACE_1_5"], - "BooleanState": ["Test_TC_BOOL_1_1", "Test_TC_BOOL_2_1"], - "Binding": ["Test_TC_BIND_1_1"], - "BridgedDeviceBasicInformation": ["Test_TC_BRBINFO_1_1"], - "Actions": ["Test_TC_ACT_1_1"], + "BooleanState": ["Test_TC_BOOL_2_1"], + "Binding": [], + "BridgedDeviceBasicInformation": [], + "Actions": [], "ColorControl": [ - "Test_TC_CC_1_1", "Test_TC_CC_2_1", "Test_TC_CC_3_2", "Test_TC_CC_3_3", @@ -42,65 +40,43 @@ "TestColorControl_9_2" ], "DeviceManagement": [ - "Test_TC_OPCREDS_1_2", "Test_TC_OPCREDS_3_7", - "Test_TC_BINFO_1_1", "Test_TC_BINFO_2_1", "Test_TC_BINFO_2_2", "Test_TC_CNET_1_3" ], - "Descriptor": ["Test_TC_DESC_1_1"], - "DeviceEnergyManagementMode": ["Test_TC_DEMM_1_1", "Test_TC_DEMM_2_1"], - "EthernetNetworkDiagnostics": [ - "Test_TC_DGETH_1_1", - "Test_TC_DGETH_2_1", - "Test_TC_DGETH_2_2" - ], - "DiagnosticsLogs": ["Test_TC_DLOG_1_1"], - "EnergyEVSE": ["Test_TC_EEVSE_1_1", "Test_TC_EEVSE_2_1"], + "Descriptor": [], + "DeviceEnergyManagementMode": ["Test_TC_DEMM_2_1"], + "EthernetNetworkDiagnostics": ["Test_TC_DGETH_2_1", "Test_TC_DGETH_2_2"], + "DiagnosticsLogs": [], + "EnergyEVSE": ["Test_TC_EEVSE_2_1"], "EnergyEVSEMode": [ - "Test_TC_EEVSEM_1_1", "Test_TC_EEVSEM_2_1", "Test_TC_EEVSEM_3_1", "Test_TC_EEVSEM_3_2", "Test_TC_EEVSEM_3_3" ], - "FlowMeasurement": ["Test_TC_FLW_1_1", "Test_TC_FLW_2_1"], - "FixedLabel": ["Test_TC_FLABEL_1_1", "Test_TC_FLABEL_2_1"], + "FlowMeasurement": ["Test_TC_FLW_2_1"], + "FixedLabel": ["Test_TC_FLABEL_2_1"], "FanControl": [ - "Test_TC_FAN_1_1", "Test_TC_FAN_2_1", "Test_TC_FAN_2_2", "Test_TC_FAN_2_3", "Test_TC_FAN_2_4", "Test_TC_FAN_3_6" ], - "GeneralCommissioning": ["Test_TC_CGEN_1_1", "Test_TC_CGEN_2_1"], - "GeneralDiagnostics": ["Test_TC_DGGEN_1_1"], - "GroupKeyManagement": ["Test_TC_GRPKEY_1_1", "Test_TC_GRPKEY_2_2"], + "GeneralCommissioning": ["Test_TC_CGEN_2_1"], + "GeneralDiagnostics": [], + "GroupKeyManagement": ["Test_TC_GRPKEY_2_2"], "IcdManagement": [ "TestIcdManagementCluster", "Test_TC_ICDM_1_1", "Test_TC_ICDM_3_4" ], - "Identify": [ - "Test_TC_I_1_1", - "Test_TC_I_2_1", - "Test_TC_I_2_2", - "Test_TC_I_2_3" - ], - "IlluminanceMeasurement": [ - "Test_TC_ILL_1_1", - "Test_TC_ILL_2_1", - "Test_TC_ILL_2_2" - ], - "OccupancySensing": [ - "Test_TC_OCC_1_1", - "Test_TC_OCC_2_1", - "Test_TC_OCC_2_3" - ], + "Identify": ["Test_TC_I_2_1", "Test_TC_I_2_2", "Test_TC_I_2_3"], + "IlluminanceMeasurement": ["Test_TC_ILL_2_1", "Test_TC_ILL_2_2"], + "OccupancySensing": ["Test_TC_OCC_2_1", "Test_TC_OCC_2_3"], "LevelControl": [ - "Test_TC_LVL_1_1", "Test_TC_LVL_2_1", "Test_TC_LVL_2_2", "Test_TC_LVL_3_1", @@ -109,50 +85,34 @@ "Test_TC_LVL_6_1", "Test_TC_LVL_7_1" ], - "LocalizationConfiguration": ["Test_TC_LCFG_1_1"], + "LocalizationConfiguration": [], "TimeFormatLocalization": ["Test_TC_LTIME_1_2", "Test_TC_LTIME_3_1"], - "UnitLocalization": ["Test_TC_LUNIT_1_2", "Test_TC_LUNIT_3_1"], + "UnitLocalization": ["Test_TC_LUNIT_3_1"], "UserLabel": [ - "Test_TC_ULABEL_1_1", "Test_TC_ULABEL_2_1", "Test_TC_ULABEL_2_2", "Test_TC_ULABEL_2_3", "Test_TC_ULABEL_2_4" ], "LaundryWasherMode": [ - "Test_TC_LWM_1_1", "Test_TC_LWM_2_1", "Test_TC_LWM_3_1", "Test_TC_LWM_3_2", "Test_TC_LWM_3_3" ], "LaundryWasherControl": [ - "Test_TC_WASHERCTRL_1_1", "Test_TC_WASHERCTRL_2_1", "Test_TC_WASHERCTRL_2_2" ], "OvenMode": [ - "Test_TC_OTCCM_1_1", "Test_TC_OTCCM_2_1", "Test_TC_OTCCM_3_1", "Test_TC_OTCCM_3_2", "Test_TC_OTCCM_3_3" ], - "LaundryDryerControl": ["Test_TC_DRYERCTRL_1_1", "Test_TC_DRYERCTRL_2_1"], + "LaundryDryerControl": ["Test_TC_DRYERCTRL_2_1"], "MediaControl": [ - "Test_TC_LOWPOWER_1_1", - "Test_TC_KEYPADINPUT_1_2", - "Test_TC_APPLAUNCHER_1_3", - "Test_TC_MEDIAINPUT_1_4", - "Test_TC_WAKEONLAN_1_5", - "Test_TC_CHANNEL_1_6", - "Test_TC_MEDIAPLAYBACK_1_7", - "Test_TC_AUDIOOUTPUT_1_8", - "Test_TC_TGTNAV_1_9", - "Test_TC_APBSC_1_10", - "Test_TC_CONTENTLAUNCHER_1_11", - "Test_TC_ALOGIN_1_12", "Test_TC_LOWPOWER_2_1", "Test_TC_KEYPADINPUT_3_2", "Test_TC_KEYPADINPUT_3_3", @@ -181,22 +141,13 @@ "Test_TC_CONTENTLAUNCHER_10_5", "Test_TC_CONTENTLAUNCHER_10_7" ], - "ModeSelect": ["Test_TC_MOD_1_1"], + "ModeSelect": [], "MultipleFabrics": [], "OTASoftwareUpdate": ["OTA_SuccessfulTransfer"], - "OnOff": [ - "Test_TC_OO_1_1", - "Test_TC_OO_2_1", - "Test_TC_OO_2_2", - "Test_TC_OO_2_4" - ], - "PowerSource": ["Test_TC_PS_1_1", "Test_TC_PS_2_1"], + "OnOff": ["Test_TC_OO_2_1", "Test_TC_OO_2_2", "Test_TC_OO_2_4"], + "PowerSource": ["Test_TC_PS_2_1"], "PowerTopology": ["Test_TC_PWRTL_1_1"], - "PressureMeasurement": [ - "Test_TC_PRS_1_1", - "Test_TC_PRS_2_1", - "Test_TC_PRS_2_2" - ], + "PressureMeasurement": ["Test_TC_PRS_2_1", "Test_TC_PRS_2_2"], "PumpConfigurationControl": [ "Test_TC_PCC_1_1", "Test_TC_PCC_2_1", @@ -204,15 +155,10 @@ "Test_TC_PCC_2_3", "Test_TC_PCC_2_4" ], - "PowerSourceConfiguration": ["Test_TC_PSCFG_1_1", "Test_TC_PSCFG_2_1"], - "RefrigeratorAlarm": ["Test_TC_REFALM_1_1", "Test_TC_REFALM_2_1"], - "RelativeHumidityMeasurement": ["Test_TC_RH_1_1", "Test_TC_RH_2_1"], - "RoboticVacuumCleaner": [ - "Test_TC_RVCCLEANM_1_1", - "Test_TC_RVCRUNM_1_1", - "Test_TC_RVCRUNM_3_1", - "Test_TC_RVCOPSTATE_1_1" - ], + "PowerSourceConfiguration": ["Test_TC_PSCFG_2_1"], + "RefrigeratorAlarm": ["Test_TC_REFALM_2_1"], + "RelativeHumidityMeasurement": ["Test_TC_RH_2_1"], + "RoboticVacuumCleaner": ["Test_TC_RVCRUNM_3_1"], "SecureChannel": [], "SmokeCOAlarm": [ "Test_TC_SMOKECO_1_1", @@ -225,7 +171,6 @@ ], "Switch": ["Test_TC_SWTCH_1_1", "Test_TC_SWTCH_2_1"], "TemperatureControlledCabinetMode": [ - "Test_TC_TCCM_1_1", "Test_TC_TCCM_3_1", "Test_TC_TCCM_3_2", "Test_TC_TCCM_3_3" @@ -238,26 +183,17 @@ "Test_TC_TCTL_3_2", "Test_TC_TCTL_3_3" ], - "TemperatureMeasurement": ["Test_TC_TMP_1_1", "Test_TC_TMP_2_1"], + "TemperatureMeasurement": ["Test_TC_TMP_2_1"], "Thermostat": ["Test_TC_TSTAT_1_1", "Test_TC_TSTAT_2_1"], - "ThermostatUserConfiguration": [ - "Test_TC_TSUIC_1_1", - "Test_TC_TSUIC_2_1", - "Test_TC_TSUIC_2_2" - ], + "ThermostatUserConfiguration": ["Test_TC_TSUIC_2_1", "Test_TC_TSUIC_2_2"], "ThreadNetworkDiagnostics": [ - "Test_TC_DGTHREAD_1_1", "Test_TC_DGTHREAD_2_1", "Test_TC_DGTHREAD_2_2", "Test_TC_DGTHREAD_2_3", "Test_TC_DGTHREAD_2_4" ], - "TimeSynchronization": ["Test_TC_TIMESYNC_1_1", "Test_TC_TIMESYNC_2_3"], - "WiFiNetworkDiagnostics": [ - "Test_TC_DGWIFI_1_1", - "Test_TC_DGWIFI_2_1", - "Test_TC_DGWIFI_2_3" - ], + "TimeSynchronization": ["Test_TC_TIMESYNC_2_3"], + "WiFiNetworkDiagnostics": ["Test_TC_DGWIFI_2_1", "Test_TC_DGWIFI_2_3"], "WindowCovering": [ "Test_TC_WNCV_1_1", "Test_TC_WNCV_2_1", @@ -326,7 +262,7 @@ "Test_AddNewFabricFromExistingFabric" ], "MultiAdmin": ["TestMultiAdmin"], - "SoftwareDiagnostics": ["Test_TC_DGSW_1_1"], + "SoftwareDiagnostics": [], "Subscriptions": [ "TestSubscribe_OnOff", "TestSubscribe_AdministratorCommissioning" @@ -335,7 +271,6 @@ "DL_UsersAndCredentials", "DL_LockUnlock", "DL_Schedules", - "Test_TC_DRLK_1_1", "Test_TC_DRLK_2_4", "Test_TC_DRLK_2_5", "Test_TC_DRLK_2_6", @@ -343,18 +278,12 @@ "Test_TC_DRLK_2_8", "Test_TC_DRLK_2_11" ], - "Groups": [ - "TestGroupMessaging", - "TestGroupsCluster", - "Test_TC_G_1_1", - "Test_TC_G_2_1" - ], + "Groups": ["TestGroupMessaging", "TestGroupsCluster", "Test_TC_G_2_1"], "ScenesManagement": [ "TestScenesFabricRemoval", "TestScenesFabricSceneInfo", "TestScenesMultiFabric", "TestScenesMaxCapacity", - "Test_TC_S_1_1", "Test_TC_S_2_1", "Test_TC_S_2_2", "Test_TC_S_2_3", @@ -363,12 +292,10 @@ "ResourceMonitoring": [ "TestActivatedCarbonFilterMonitoring", "TestHepaFilterMonitoring", - "Test_TC_ACFREMON_1_1", "Test_TC_ACFREMON_2_1", - "Test_TC_HEPAFREMON_1_1", "Test_TC_HEPAFREMON_2_1" ], - "AirQuality": ["Test_TC_AIRQUAL_1_1", "Test_TC_AIRQUAL_2_1"], + "AirQuality": ["Test_TC_AIRQUAL_2_1"], "ConcentrationMeasurement": [ "Test_TC_CDOCONC_1_1", "Test_TC_CDOCONC_2_1", diff --git a/src/app/tests/suites/manualTests.json b/src/app/tests/suites/manualTests.json index 0331f9eba773df..a12d2b75b8a90f 100644 --- a/src/app/tests/suites/manualTests.json +++ b/src/app/tests/suites/manualTests.json @@ -64,7 +64,6 @@ "Test_TC_DA_1_8" ], "DishwasherAlarm": [ - "Test_TC_DISHALM_1_1", "Test_TC_DISHALM_2_1", "Test_TC_DISHALM_3_1", "Test_TC_DISHALM_3_2", @@ -74,7 +73,6 @@ "Test_TC_DISHALM_3_6" ], "DishwasherMode": [ - "Test_TC_DISHM_1_1", "Test_TC_DISHM_1_2", "Test_TC_DISHM_2_1", "Test_TC_DISHM_3_1", @@ -170,10 +168,8 @@ "Test_TC_MC_11_2", "Test_TC_ALOGIN_12_2", "Test_TC_TGTNAV_8_2", - "Test_TC_APPOBSERVER_1_13", "Test_TC_APPOBSERVER_13_1", - "Test_TC_APPOBSERVER_13_2", - "Test_TC_CONCON_1_14" + "Test_TC_APPOBSERVER_13_2" ], "MultipleFabrics": [ "Test_TC_CADMIN_1_1", diff --git a/src/python_testing/TC_OPSTATE_1_1.py b/src/python_testing/TC_OPSTATE_1_1.py deleted file mode 100644 index 67caefc85862b5..00000000000000 --- a/src/python_testing/TC_OPSTATE_1_1.py +++ /dev/null @@ -1,53 +0,0 @@ -# -# Copyright (c) 2024 Project CHIP Authors -# All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - - -import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main -from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo - - -class TC_OPSTATE_1_1(MatterBaseTest, TC_OPSTATE_BASE): - def __init__(self, *args): - super().__init__(*args) - - test_info = TestInfo( - pics_code="OPSTATE", - cluster=Clusters.OperationalState - ) - - super().setup_base(test_info=test_info) - - def steps_TC_OPSTATE_1_1(self) -> list[TestStep]: - return self.STEPS_TC_OPSTATE_BASE_1_1() - - def pics_TC_OPSTATE_1_1(self) -> list[str]: - return ["OPSTATE.S"] - - @async_test_body - async def test_TC_OPSTATE_1_1(self): - endpoint = self.matter_test_config.endpoint - cluster_revision = 2 - feature_map = 0 - - await self.TEST_TC_OPSTATE_BASE_1_1(endpoint=endpoint, - cluster_revision=cluster_revision, - feature_map=feature_map) - - -if __name__ == "__main__": - default_matter_test_main() diff --git a/src/python_testing/TC_OVENOPSTATE_1_1.py b/src/python_testing/TC_OVENOPSTATE_1_1.py deleted file mode 100644 index 3e6b0a27fbab5d..00000000000000 --- a/src/python_testing/TC_OVENOPSTATE_1_1.py +++ /dev/null @@ -1,53 +0,0 @@ -# -# Copyright (c) 2024 Project CHIP Authors -# All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - - -import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main -from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo - - -class TC_OVENOPSTATE_1_1(MatterBaseTest, TC_OPSTATE_BASE): - def __init__(self, *args): - super().__init__(*args) - - test_info = TestInfo( - pics_code="OVENOPSTATE", - cluster=Clusters.OvenCavityOperationalState - ) - - super().setup_base(test_info=test_info) - - def steps_TC_OVENOPSTATE_1_1(self) -> list[TestStep]: - return self.STEPS_TC_OPSTATE_BASE_1_1() - - def pics_TC_OVENOPSTATE_1_1(self) -> list[str]: - return ["OVENOPSTATE.S"] - - @async_test_body - async def test_TC_OVENOPSTATE_1_1(self): - endpoint = self.matter_test_config.endpoint - cluster_revision = 1 - feature_map = 0 - - await self.TEST_TC_OPSTATE_BASE_1_1(endpoint=endpoint, - cluster_revision=cluster_revision, - feature_map=feature_map) - - -if __name__ == "__main__": - default_matter_test_main() From b790232baf1a257a396e9f7b598584896fc38365 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Fri, 31 May 2024 15:24:42 +0200 Subject: [PATCH 39/43] [Python] Add "automation" level to log defines (#33670) So far the automation log level was missing. Add it to the log level defines in the logging module. While at it, also rename to LOG_CATEGORY (instead of ERROR_CATEGORY) and remove duplicated log level definitions in ChipStack. --- src/controller/python/chip/ChipStack.py | 16 ++++------------ src/controller/python/chip/logging/__init__.py | 17 +++++++++-------- 2 files changed, 13 insertions(+), 20 deletions(-) diff --git a/src/controller/python/chip/ChipStack.py b/src/controller/python/chip/ChipStack.py index 3a167bb6bc0a7a..beeaedd6ae3327 100644 --- a/src/controller/python/chip/ChipStack.py +++ b/src/controller/python/chip/ChipStack.py @@ -36,6 +36,7 @@ from threading import Condition, Event, Lock import chip.native +from chip.logging import LOG_CATEGORY_AUTOMATION, LOG_CATEGORY_DETAIL, LOG_CATEGORY_ERROR, LOG_CATEGORY_PROGRESS from chip.native import PyChipError from .ChipUtility import ChipUtility @@ -78,23 +79,14 @@ class DeviceStatusStruct(Structure): class LogCategory(object): """Debug logging categories used by chip.""" - # NOTE: These values must correspond to those used in the chip C++ code. - Disabled = 0 - Error = 1 - Progress = 2 - Detail = 3 - Retain = 4 - @staticmethod def categoryToLogLevel(cat): - if cat == LogCategory.Error: + if cat == LOG_CATEGORY_ERROR: return logging.ERROR - elif cat == LogCategory.Progress: + elif cat == LOG_CATEGORY_PROGRESS: return logging.INFO - elif cat == LogCategory.Detail: + elif cat in (LOG_CATEGORY_DETAIL, LOG_CATEGORY_AUTOMATION): return logging.DEBUG - elif cat == LogCategory.Retain: - return logging.CRITICAL else: return logging.NOTSET diff --git a/src/controller/python/chip/logging/__init__.py b/src/controller/python/chip/logging/__init__.py index 047d3f4f8e97f5..aca671997d7299 100644 --- a/src/controller/python/chip/logging/__init__.py +++ b/src/controller/python/chip/logging/__init__.py @@ -19,11 +19,12 @@ from chip.logging.library_handle import _GetLoggingLibraryHandle from chip.logging.types import LogRedirectCallback_t -# Defines match support/logging/Constants.h (LogCategory enum) -ERROR_CATEGORY_NONE = 0 -ERROR_CATEGORY_ERROR = 1 -ERROR_CATEGORY_PROGRESS = 2 -ERROR_CATEGORY_DETAIL = 3 +# Defines match src/lib/support/logging/Constants.h (LogCategory enum) +LOG_CATEGORY_NONE = 0 +LOG_CATEGORY_ERROR = 1 +LOG_CATEGORY_PROGRESS = 2 +LOG_CATEGORY_DETAIL = 3 +LOG_CATEGORY_AUTOMATION = 4 @LogRedirectCallback_t @@ -34,11 +35,11 @@ def _RedirectToPythonLogging(category, module, message): logger = logging.getLogger('chip.native.%s' % module) - if category == ERROR_CATEGORY_ERROR: + if category == LOG_CATEGORY_ERROR: logger.error("%s", message) - elif category == ERROR_CATEGORY_PROGRESS: + elif category == LOG_CATEGORY_PROGRESS: logger.info("%s", message) - elif category == ERROR_CATEGORY_DETAIL: + elif category in (LOG_CATEGORY_DETAIL, LOG_CATEGORY_AUTOMATION): logger.debug("%s", message) else: # All logs are expected to have some reasonable category. This treats From f5fad3d48d09cebd6160cd8e4f3c3deab78ee663 Mon Sep 17 00:00:00 2001 From: C Freeman Date: Fri, 31 May 2024 17:31:38 -0400 Subject: [PATCH 40/43] TC-RVCRUNM-2.2: make error more verbose (#33643) * TC-RVCRUNM-2.2: make error more verbose * Restyled by autopep8 * more verboser --------- Co-authored-by: Restyled.io --- src/python_testing/TC_RVCRUNM_2_2.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/python_testing/TC_RVCRUNM_2_2.py b/src/python_testing/TC_RVCRUNM_2_2.py index d85d1ae53cb928..6680ada707a85e 100644 --- a/src/python_testing/TC_RVCRUNM_2_2.py +++ b/src/python_testing/TC_RVCRUNM_2_2.py @@ -154,7 +154,8 @@ async def test_TC_RVCRUNM_2_2(self): if self.mode_a not in self.supported_run_modes_dut or \ self.mode_b not in self.supported_run_modes_dut: - asserts.fail("PIXIT.RVCRUNM.MODE_A and PIXIT.RVCRUNM.MODE_B must be valid supported modes.") + asserts.fail( + f"PIXIT.RVCRUNM.MODE_A and PIXIT.RVCRUNM.MODE_B must be valid supported modes. Valid modes: {self.supported_run_modes_dut}, MODE_A: {self.mode_a}, MODE_B: {self.mode_b}") for tag in self.supported_run_modes[self.mode_a].modeTags: if tag.value == Clusters.RvcRunMode.Enums.ModeTag.kIdle: From 7ebc71fc584659d7e59a9c16e07caa421623e28a Mon Sep 17 00:00:00 2001 From: C Freeman Date: Fri, 31 May 2024 17:52:15 -0400 Subject: [PATCH 41/43] Python testing: id range check functions (#33510) * Python testing: id range check functions * add test to workflow * use range more directly * change to enums * isort * fix workflow --- .github/workflows/tests.yaml | 2 + src/python_testing/TestIdChecks.py | 214 +++++++++++++++++++++ src/python_testing/global_attribute_ids.py | 109 ++++++++++- 3 files changed, 324 insertions(+), 1 deletion(-) create mode 100644 src/python_testing/TestIdChecks.py diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 8b3588c6fdf13c..678b7b18195aa0 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -561,6 +561,8 @@ jobs: scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-rvc-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-rvc-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace_file json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_RVCOPSTATE_2_4.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values --endpoint 1 --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' scripts/run_in_python_env.sh out/venv './src/python_testing/test_testing/test_TC_DA_1_2.py' scripts/run_in_python_env.sh out/venv './src/python_testing/test_testing/test_TC_ICDM_2_1.py' + scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestIdChecks.py' + - name: Uploading core files uses: actions/upload-artifact@v4 if: ${{ failure() && !env.ACT }} diff --git a/src/python_testing/TestIdChecks.py b/src/python_testing/TestIdChecks.py new file mode 100644 index 00000000000000..8969807d5819e3 --- /dev/null +++ b/src/python_testing/TestIdChecks.py @@ -0,0 +1,214 @@ +# +# Copyright (c) 2024 Project CHIP Authors +# All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +from global_attribute_ids import (AttributeIdType, ClusterIdType, DeviceTypeIdType, attribute_id_type, cluster_id_type, + device_type_id_type, is_valid_attribute_id, is_valid_cluster_id, is_valid_device_type_id) +from matter_testing_support import MatterBaseTest, default_matter_test_main +from mobly import asserts + + +class TestIdChecks(MatterBaseTest): + def test_device_type_ids(self): + standard_good = [0x0000_0000, 0x0000_BFFF] + standard_bad = [0x0000_C000] + + manufacturer_good = [0x0001_0000, 0x0001_BFFF, 0xFFF0_0000, 0xFFF0_BFFF] + manufacturer_bad = [0x0001_C000, 0xFFF0_C000] + + test_good = [0xFFF1_0000, 0xFFF1_BFFF, 0xFFF4_0000, 0xFFF4_BFFF] + test_bad = [0xFFF1_C000, 0xFFF4_C000] + + prefix_bad = [0xFFF5_0000, 0xFFF5_BFFFF, 0xFFF5_C000] + + def check_standard(id): + id_type = device_type_id_type(id) + msg = f"Incorrect device type range assessment, expecting standard {id:08x}, type = {id_type}" + asserts.assert_equal(device_type_id_type(id), DeviceTypeIdType.kStandard, msg) + asserts.assert_true(is_valid_device_type_id(id_type, allow_test=True), msg) + asserts.assert_true(is_valid_device_type_id(id_type, allow_test=False), msg) + + def check_manufacturer(id): + id_type = device_type_id_type(id) + msg = f"Incorrect device type range assessment, expecting manufacturer {id:08x}, type = {id_type}" + asserts.assert_equal(device_type_id_type(id), DeviceTypeIdType.kManufacturer, msg) + asserts.assert_true(is_valid_device_type_id(id_type, allow_test=True), msg) + asserts.assert_true(is_valid_device_type_id(id_type, allow_test=False), msg) + + def check_test(id): + id_type = device_type_id_type(id) + msg = f"Incorrect device type range assessment, expecting test {id:08x}, type = {id_type}" + asserts.assert_equal(device_type_id_type(id), DeviceTypeIdType.kTest, msg) + asserts.assert_true(is_valid_device_type_id(id_type, allow_test=True), msg) + asserts.assert_false(is_valid_device_type_id(id_type, allow_test=False), msg) + + def check_all_bad(id): + id_type = device_type_id_type(id) + msg = f"Incorrect device type range assessment, expecting invalid {id:08x}, type = {id_type}" + asserts.assert_equal(device_type_id_type(id), DeviceTypeIdType.kInvalid, msg) + asserts.assert_false(is_valid_device_type_id(id_type, allow_test=True), msg) + asserts.assert_false(is_valid_device_type_id(id_type, allow_test=False), msg) + + for id in standard_good: + check_standard(id) + + for id in standard_bad: + check_all_bad(id) + + for id in manufacturer_good: + check_manufacturer(id) + + for id in manufacturer_bad: + check_all_bad(id) + + for id in test_good: + check_test(id) + + for id in test_bad: + check_all_bad(id) + + for id in prefix_bad: + check_all_bad(id) + + def test_cluster_ids(self): + standard_good = [0x0000_0000, 0x0000_7FFF] + standard_bad = [0x0000_8000] + + manufacturer_good = [0x0001_FC00, 0x0001_FFFE, 0xFFF0_FC00, 0xFFF0_FFFE] + manufacturer_bad = [0x0001_0000, 0x0001_7FFF, 0x0001_FFFF, 0xFFF0_0000, 0xFFF0_7FFF, 0xFFF0_FFFF] + + test_good = [0xFFF1_FC00, 0xFFF1_FFFE, 0xFFF4_FC00, 0xFFF4_FFFE] + test_bad = [0xFFF1_0000, 0xFFF1_7FFF, 0xFFF1_FFFF, 0xFFF4_0000, 0xFFF4_7FFF, 0xFFF4_FFFF] + + prefix_bad = [0xFFF5_0000, 0xFFF5_FC00, 0xFFF5_FFFF] + + def check_standard(id): + id_type = cluster_id_type(id) + msg = f"Incorrect cluster range assessment, expecting standard {id:08x}, type = {id_type}" + asserts.assert_equal(id_type, ClusterIdType.kStandard, msg) + asserts.assert_true(is_valid_cluster_id(id_type, allow_test=True), msg) + asserts.assert_true(is_valid_cluster_id(id_type, allow_test=False), msg) + + def check_manufacturer(id): + id_type = cluster_id_type(id) + msg = f"Incorrect cluster range assessment, expecting manufacturer {id:08x}, type = {id_type}" + asserts.assert_equal(id_type, ClusterIdType.kManufacturer, msg) + asserts.assert_true(is_valid_cluster_id(id_type, allow_test=True), msg) + asserts.assert_true(is_valid_cluster_id(id_type, allow_test=False), msg) + + def check_test(id): + id_type = cluster_id_type(id) + msg = f"Incorrect cluster range assessment, expecting test {id:08x}, type = {id_type}" + asserts.assert_equal(id_type, ClusterIdType.kTest, msg) + asserts.assert_true(is_valid_cluster_id(id_type, allow_test=True), msg) + asserts.assert_false(is_valid_cluster_id(id_type, allow_test=False), msg) + + def check_all_bad(id): + id_type = cluster_id_type(id) + msg = f"Incorrect cluster range assessment, expecting invalid {id:08x}, type = {id_type}" + asserts.assert_equal(id_type, ClusterIdType.kInvalid, msg) + asserts.assert_false(is_valid_cluster_id(id_type, allow_test=True), msg) + asserts.assert_false(is_valid_cluster_id(id_type, allow_test=False), msg) + + for id in standard_good: + check_standard(id) + + for id in standard_bad: + check_all_bad(id) + + for id in manufacturer_good: + check_manufacturer(id) + + for id in manufacturer_bad: + check_all_bad(id) + + for id in test_good: + check_test(id) + + for id in test_bad: + check_all_bad(id) + + for id in prefix_bad: + check_all_bad(id) + + def test_attribute_ids(self): + standard_global_good = [0x0000_F000, 0x0000_FFFE] + standard_global_bad = [0x0000_FFFF] + standard_non_global_good = [0x0000_0000, 0x0000_4FFF] + standard_non_global_bad = [0x0000_5000] + manufacturer_good = [0x0001_0000, 0x0001_4FFF, 0xFFF0_0000, 0xFFF0_4FFF] + manufacturer_bad = [0x0001_5000, 0x0001_F000, 0x0001_FFFFF, 0xFFF0_5000, 0xFFF0_F000, 0xFFF0_FFFF] + test_good = [0xFFF1_0000, 0xFFF1_4FFF, 0xFFF4_0000, 0xFFF4_4FFF] + test_bad = [0xFFF1_5000, 0xFFF1_F000, 0xFFF1_FFFFF, 0xFFF4_5000, 0xFFF4_F000, 0xFFF4_FFFF] + prefix_bad = [0xFFF5_0000, 0xFFF5_4FFF, 0xFFF5_5000, 0xFFF5_F000, 0xFFF5_FFFF] + + def check_standard_global(id): + id_type = attribute_id_type(id) + msg = f"Incorrect attribute range assessment, expecting standard global {id:08x}, type = {id_type}" + asserts.assert_equal(id_type, AttributeIdType.kStandardGlobal, msg) + asserts.assert_true(is_valid_attribute_id(id_type, allow_test=True), msg) + asserts.assert_true(is_valid_attribute_id(id_type, allow_test=False), msg) + + def check_standard_non_global(id): + id_type = attribute_id_type(id) + msg = f"Incorrect attribute range assessment, expecting standard non-global {id:08x}, type = {id_type}" + asserts.assert_equal(id_type, AttributeIdType.kStandardNonGlobal, msg) + asserts.assert_true(is_valid_attribute_id(id_type, allow_test=True), msg) + asserts.assert_true(is_valid_attribute_id(id_type, allow_test=False), msg) + + def check_manufacturer(id): + id_type = attribute_id_type(id) + msg = f"Incorrect attribute range assessment, expecting manufacturer {id:08x}, type = {id_type}" + asserts.assert_equal(id_type, AttributeIdType.kManufacturer, msg) + asserts.assert_true(is_valid_attribute_id(id_type, allow_test=True), msg) + asserts.assert_true(is_valid_attribute_id(id_type, allow_test=False), msg) + + def check_test(id): + id_type = attribute_id_type(id) + msg = f"Incorrect attribute range assessment, expecting test {id:08x}, type = {id_type}" + asserts.assert_equal(id_type, AttributeIdType.kTest, msg) + asserts.assert_true(is_valid_attribute_id(id_type, allow_test=True), msg) + asserts.assert_false(is_valid_attribute_id(id_type, allow_test=False), msg) + + def check_all_bad(id): + id_type = attribute_id_type(id) + msg = f"Incorrect attribute range assessment, expecting invalid {id:08x}, type = {id_type}" + asserts.assert_equal(id_type, AttributeIdType.kInvalid, msg) + asserts.assert_false(is_valid_attribute_id(id_type, allow_test=True), msg) + asserts.assert_false(is_valid_attribute_id(id_type, allow_test=False), msg) + + for id in standard_global_good: + check_standard_global(id) + for id in standard_global_bad: + check_all_bad(id) + for id in standard_non_global_good: + check_standard_non_global(id) + for id in standard_non_global_bad: + check_all_bad(id) + for id in manufacturer_good: + check_manufacturer(id) + for id in manufacturer_bad: + check_all_bad(id) + for id in test_good: + check_test(id) + for id in test_bad: + check_all_bad(id) + for id in prefix_bad: + check_all_bad(id) + + +if __name__ == "__main__": + default_matter_test_main() diff --git a/src/python_testing/global_attribute_ids.py b/src/python_testing/global_attribute_ids.py index 851148bd8f290f..e692adfdfb5a10 100644 --- a/src/python_testing/global_attribute_ids.py +++ b/src/python_testing/global_attribute_ids.py @@ -17,7 +17,7 @@ # This file should be removed once we have a good way to get this from the codegen or XML -from enum import IntEnum +from enum import Enum, IntEnum, auto class GlobalAttributeIds(IntEnum): @@ -38,3 +38,110 @@ def to_name(self) -> str: return "FeatureMap" if self == GlobalAttributeIds.CLUSTER_REVISION_ID: return "ClusterRevision" + + +class DeviceTypeIdType(Enum): + kInvalid = auto(), + kStandard = auto(), + kManufacturer = auto(), + kTest = auto(), + + +class ClusterIdType(Enum): + kInvalid = auto() + kStandard = auto(), + kManufacturer = auto(), + kTest = auto(), + + +class AttributeIdType(Enum): + kInvalid = auto() + kStandardGlobal = auto(), + kStandardNonGlobal = auto(), + kManufacturer = auto(), + kTest = auto(), + +# ID helper classes - this allows us to use the values from the prefix and suffix table directly +# because the class handles the non-inclusive range. + + +class IdRange(): + def __init__(self, min, max): + self.min_max = range(min, max+1) + + def __contains__(self, key): + return key in self.min_max + + +class PrefixIdRange(IdRange): + def __contains__(self, id: int): + return super().__contains__(id >> 16) + + +class SuffixIdRange(IdRange): + def __contains__(self, id: int): + return super().__contains__(id & 0xFFFF) + + +STANDARD_PREFIX = PrefixIdRange(0x0000, 0x0000) +MANUFACTURER_PREFIX = PrefixIdRange(0x0001, 0xFFF0) +TEST_PREFIX = PrefixIdRange(0xFFF1, 0xFFF4) + +DEVICE_TYPE_ID_RANGE_SUFFIX = SuffixIdRange(0x0000, 0xBFFF) +CLUSTER_ID_STANDARD_RANGE_SUFFIX = SuffixIdRange(0x0000, 0x7FFF) +CLUSTER_ID_MANUFACTURER_RANGE_SUFFIX = SuffixIdRange(0xFC00, 0xFFFE) +ATTRIBUTE_ID_GLOBAL_RANGE_SUFFIX = SuffixIdRange(0xF000, 0xFFFE) +ATTRIBUTE_ID_NON_GLOBAL_RANGE_SUFFIX = SuffixIdRange(0x0000, 0x4FFF) + + +def device_type_id_type(id: int) -> DeviceTypeIdType: + if id in STANDARD_PREFIX and id in DEVICE_TYPE_ID_RANGE_SUFFIX: + return DeviceTypeIdType.kStandard + if id in MANUFACTURER_PREFIX and id in DEVICE_TYPE_ID_RANGE_SUFFIX: + return DeviceTypeIdType.kManufacturer + if id in TEST_PREFIX and id in DEVICE_TYPE_ID_RANGE_SUFFIX: + return DeviceTypeIdType.kTest + return DeviceTypeIdType.kInvalid + + +def is_valid_device_type_id(id_type: DeviceTypeIdType, allow_test=False) -> bool: + valid = [DeviceTypeIdType.kStandard, DeviceTypeIdType.kManufacturer] + if allow_test: + valid.append(DeviceTypeIdType.kTest) + return id_type in valid + + +def cluster_id_type(id: int) -> ClusterIdType: + if id in STANDARD_PREFIX and id in CLUSTER_ID_STANDARD_RANGE_SUFFIX: + return ClusterIdType.kStandard + if id in MANUFACTURER_PREFIX and id in CLUSTER_ID_MANUFACTURER_RANGE_SUFFIX: + return ClusterIdType.kManufacturer + if id in TEST_PREFIX and id in CLUSTER_ID_MANUFACTURER_RANGE_SUFFIX: + return ClusterIdType.kTest + return ClusterIdType.kInvalid + + +def is_valid_cluster_id(id_type: ClusterIdType, allow_test: bool = False) -> bool: + valid = [ClusterIdType.kStandard, ClusterIdType.kManufacturer] + if allow_test: + valid.append(ClusterIdType.kTest) + return id_type in valid + + +def attribute_id_type(id: int) -> AttributeIdType: + if id in STANDARD_PREFIX and id in ATTRIBUTE_ID_NON_GLOBAL_RANGE_SUFFIX: + return AttributeIdType.kStandardNonGlobal + if id in STANDARD_PREFIX and id in ATTRIBUTE_ID_GLOBAL_RANGE_SUFFIX: + return AttributeIdType.kStandardGlobal + if id in MANUFACTURER_PREFIX and id in ATTRIBUTE_ID_NON_GLOBAL_RANGE_SUFFIX: + return AttributeIdType.kManufacturer + if id in TEST_PREFIX and id in ATTRIBUTE_ID_NON_GLOBAL_RANGE_SUFFIX: + return AttributeIdType.kTest + return AttributeIdType.kInvalid + + +def is_valid_attribute_id(id_type: AttributeIdType, allow_test: bool = False): + valid = [AttributeIdType.kStandardGlobal, AttributeIdType.kStandardNonGlobal, AttributeIdType.kManufacturer] + if allow_test: + valid.append(AttributeIdType.kTest) + return id_type in valid From de5a9618aed651f3a7d919f708a3820e4f196995 Mon Sep 17 00:00:00 2001 From: shripad621git <79364691+shripad621git@users.noreply.github.com> Date: Sat, 1 Jun 2024 06:55:37 +0530 Subject: [PATCH 42/43] [ESP32] Unregistering wifi and IP event handlers before factory reset to avoid random crashes due to PostEventQueue failure. (#33684) * Unregistering wifi and IP event handlers before factory reset to avoid random crashes due to post event queue failure * Restyled by clang-format * Fix the CI failure in lit-icd app --------- Co-authored-by: Restyled.io --- src/platform/ESP32/ConfigurationManagerImpl.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/platform/ESP32/ConfigurationManagerImpl.cpp b/src/platform/ESP32/ConfigurationManagerImpl.cpp index 55c8758bb85fe7..e03ec70ce8192b 100644 --- a/src/platform/ESP32/ConfigurationManagerImpl.cpp +++ b/src/platform/ESP32/ConfigurationManagerImpl.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #if CHIP_DEVICE_CONFIG_ENABLE_ETHERNET @@ -404,6 +405,22 @@ void ConfigurationManagerImpl::DoFactoryReset(intptr_t arg) { CHIP_ERROR err; + // Unregistering the wifi and IP event handlers from the esp_default_event_loop() + err = ESP32Utils::MapError(esp_event_handler_unregister(IP_EVENT, ESP_EVENT_ANY_ID, PlatformManagerImpl::HandleESPSystemEvent)); + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "Failed to unregister IP event handler"); + } + +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI + err = + ESP32Utils::MapError(esp_event_handler_unregister(WIFI_EVENT, ESP_EVENT_ANY_ID, PlatformManagerImpl::HandleESPSystemEvent)); + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "Failed to unregister wifi event handler"); + } +#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI + ChipLogProgress(DeviceLayer, "Performing factory reset"); // Erase all values in the chip-config NVS namespace. From a23560db4796f90e73276f065080470590455ac3 Mon Sep 17 00:00:00 2001 From: shripad621git <79364691+shripad621git@users.noreply.github.com> Date: Sat, 1 Jun 2024 07:24:57 +0530 Subject: [PATCH 43/43] Removind Schedule Lammda function from ConnectivityManagerWifi implementation (#33542) --- src/platform/ESP32/ConnectivityManagerImpl_WiFi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/ESP32/ConnectivityManagerImpl_WiFi.cpp b/src/platform/ESP32/ConnectivityManagerImpl_WiFi.cpp index a3e369a85917aa..bbeaf6cdbc7169 100644 --- a/src/platform/ESP32/ConnectivityManagerImpl_WiFi.cpp +++ b/src/platform/ESP32/ConnectivityManagerImpl_WiFi.cpp @@ -780,7 +780,7 @@ void ConnectivityManagerImpl::ChangeWiFiStationState(WiFiStationState newState) ChipLogProgress(DeviceLayer, "WiFi station state change: %s -> %s", WiFiStationStateToStr(mWiFiStationState), WiFiStationStateToStr(newState)); mWiFiStationState = newState; - SystemLayer().ScheduleLambda([]() { NetworkCommissioning::ESPWiFiDriver::GetInstance().OnNetworkStatusChange(); }); + NetworkCommissioning::ESPWiFiDriver::GetInstance().OnNetworkStatusChange(); } }