From f86480928509a3b71f00dfa8492e749afcae66c0 Mon Sep 17 00:00:00 2001 From: "Lo,Chin-Ran" Date: Wed, 24 Jun 2026 10:12:29 +0800 Subject: [PATCH 1/6] Add ambient context sensor device Signed-off-by: Lo,Chin-Ran --- .../device-factory/BUILD.gn | 1 + .../device-factory/DeviceFactory.h | 8 + .../device-factory/enabled_devices.cmake | 2 + .../device-factory/enabled_devices.gni | 4 + .../enabled_devices_config.h.in | 1 + .../AmbientContextSensorDevice.cpp | 64 ++++ .../AmbientContextSensorDevice.h | 49 +++ .../devices/ambient-context-sensor/BUILD.gn | 33 ++ .../ambient-context-sensor/impl/BUILD.gn | 30 ++ .../LoggingAmbientContextSensorDevice.cpp | 157 ++++++++++ .../impl/LoggingAmbientContextSensorDevice.h | 64 ++++ .../posix/AppCommandDelegate.cpp | 286 ++++++++++++++++++ examples/all-devices-app/posix/BUILD.gn | 1 + .../posix/ClusterTypeMappings.cpp | 7 + examples/all-devices-app/posix/main.cpp | 6 + scripts/build/build/targets.py | 1 + .../build/testdata/all_targets_linux_x64.txt | 8 +- 17 files changed, 718 insertions(+), 4 deletions(-) create mode 100644 examples/all-devices-app/all-devices-common/devices/ambient-context-sensor/AmbientContextSensorDevice.cpp create mode 100644 examples/all-devices-app/all-devices-common/devices/ambient-context-sensor/AmbientContextSensorDevice.h create mode 100644 examples/all-devices-app/all-devices-common/devices/ambient-context-sensor/BUILD.gn create mode 100644 examples/all-devices-app/all-devices-common/devices/ambient-context-sensor/impl/BUILD.gn create mode 100644 examples/all-devices-app/all-devices-common/devices/ambient-context-sensor/impl/LoggingAmbientContextSensorDevice.cpp create mode 100644 examples/all-devices-app/all-devices-common/devices/ambient-context-sensor/impl/LoggingAmbientContextSensorDevice.h diff --git a/examples/all-devices-app/all-devices-common/device-factory/BUILD.gn b/examples/all-devices-app/all-devices-common/device-factory/BUILD.gn index 4f3f4581379451..acc4ac7ec6a24c 100644 --- a/examples/all-devices-app/all-devices-common/device-factory/BUILD.gn +++ b/examples/all-devices-app/all-devices-common/device-factory/BUILD.gn @@ -33,6 +33,7 @@ source_set("device-factory") { "${chip_root}/examples/all-devices-app/all-devices-common/devices/aggregator", "${chip_root}/examples/all-devices-app/all-devices-common/devices/air-purifier/impl:logging", "${chip_root}/examples/all-devices-app/all-devices-common/devices/air-quality-sensor", + "${chip_root}/examples/all-devices-app/all-devices-common/devices/ambient-context-sensor/impl:logging", "${chip_root}/examples/all-devices-app/all-devices-common/devices/boolean-state-sensor", "${chip_root}/examples/all-devices-app/all-devices-common/devices/bridged-node", "${chip_root}/examples/all-devices-app/all-devices-common/devices/chime", diff --git a/examples/all-devices-app/all-devices-common/device-factory/DeviceFactory.h b/examples/all-devices-app/all-devices-common/device-factory/DeviceFactory.h index cd32a7e55b23d3..7a8e0766279124 100644 --- a/examples/all-devices-app/all-devices-common/device-factory/DeviceFactory.h +++ b/examples/all-devices-app/all-devices-common/device-factory/DeviceFactory.h @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -205,6 +206,13 @@ class DeviceFactory }); }); } + if constexpr (ALL_DEVICES_ENABLE_AMBIENT_CONTEXT_SENSOR) + { + RegisterCreator("ambient-context-sensor", [this]() { + VerifyOrDie(mContext.has_value()); + return std::make_unique(mContext->timerDelegate); + }); + } if constexpr (ALL_DEVICES_ENABLE_BRIDGED_NODE) { RegisterCreator("bridged-node", [this](const std::string & nodeLabel) { diff --git a/examples/all-devices-app/all-devices-common/device-factory/enabled_devices.cmake b/examples/all-devices-app/all-devices-common/device-factory/enabled_devices.cmake index 2e56d2d2880fc5..68836b6876ea80 100644 --- a/examples/all-devices-app/all-devices-common/device-factory/enabled_devices.cmake +++ b/examples/all-devices-app/all-devices-common/device-factory/enabled_devices.cmake @@ -41,6 +41,7 @@ set(ALL_DEVICES_DEVICE_SOURCES "${ALL_DEVICES_COMMON_DIR}/devices/air-purifier/AirPurifierDevice.cpp" "${ALL_DEVICES_COMMON_DIR}/devices/air-purifier/impl/LoggingAirPurifierDevice.cpp" "${ALL_DEVICES_COMMON_DIR}/devices/air-quality-sensor/AirQualitySensorDevice.cpp" + "${ALL_DEVICES_COMMON_DIR}/devices/ambient-context-sensor/AmbientContextSensorDevice.cpp" "${ALL_DEVICES_COMMON_DIR}/devices/boolean-state-sensor/BooleanStateSensorDevice.cpp" "${ALL_DEVICES_COMMON_DIR}/devices/bridged-node/BridgedNodeDevice.cpp" "${ALL_DEVICES_COMMON_DIR}/devices/chime/ChimeDevice.cpp" @@ -147,6 +148,7 @@ foreach(_key aggregator air-purifier air-quality-sensor + ambient-context-sensor bridged-node chime contact-sensor diff --git a/examples/all-devices-app/all-devices-common/device-factory/enabled_devices.gni b/examples/all-devices-app/all-devices-common/device-factory/enabled_devices.gni index 22f30d8ca04c57..bf17370d6c4e09 100644 --- a/examples/all-devices-app/all-devices-common/device-factory/enabled_devices.gni +++ b/examples/all-devices-app/all-devices-common/device-factory/enabled_devices.gni @@ -54,6 +54,10 @@ _available_devices = [ "air-quality-sensor", "AIR_QUALITY_SENSOR", ], + [ + "ambient-context-sensor", + "AMBIENT_CONTEXT_SENSOR", + ], [ "bridged-node", "BRIDGED_NODE", diff --git a/examples/all-devices-app/all-devices-common/device-factory/enabled_devices_config.h.in b/examples/all-devices-app/all-devices-common/device-factory/enabled_devices_config.h.in index 0e65047dfd55da..a1804119221d80 100644 --- a/examples/all-devices-app/all-devices-common/device-factory/enabled_devices_config.h.in +++ b/examples/all-devices-app/all-devices-common/device-factory/enabled_devices_config.h.in @@ -10,6 +10,7 @@ #cmakedefine01 ALL_DEVICES_ENABLE_AGGREGATOR #cmakedefine01 ALL_DEVICES_ENABLE_AIR_PURIFIER #cmakedefine01 ALL_DEVICES_ENABLE_AIR_QUALITY_SENSOR +#cmakedevice01 ALL_DEVICES_ENABLE_AMBIENT_CONTEXT_SENSOR #cmakedefine01 ALL_DEVICES_ENABLE_BRIDGED_NODE #cmakedefine01 ALL_DEVICES_ENABLE_CHIME #cmakedefine01 ALL_DEVICES_ENABLE_CONTACT_SENSOR diff --git a/examples/all-devices-app/all-devices-common/devices/ambient-context-sensor/AmbientContextSensorDevice.cpp b/examples/all-devices-app/all-devices-common/devices/ambient-context-sensor/AmbientContextSensorDevice.cpp new file mode 100644 index 00000000000000..753dbc4c99063f --- /dev/null +++ b/examples/all-devices-app/all-devices-common/devices/ambient-context-sensor/AmbientContextSensorDevice.cpp @@ -0,0 +1,64 @@ +/* + * + * Copyright (c) 2026 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 +#include +#include + +using namespace chip::app::Clusters; + +namespace chip::app { + +AmbientContextSensorDevice::AmbientContextSensorDevice(AmbientContextSensingConfig config, TimerDelegate & timerDelegate) : + SingleEndpointDevice(Span(&Device::Type::kAmbientContextSensor, 1)), mConfig(config), + mTimerDelegate(timerDelegate) +{} + +CHIP_ERROR AmbientContextSensorDevice::Register(chip::EndpointId endpoint, CodeDrivenDataModelProvider & provider, + EndpointComposition composition) +{ + ReturnErrorOnFailure(RegisterDescriptor(endpoint, provider, composition)); + + // Create the identify cluster. + mIdentifyCluster.Create(IdentifyCluster::Config(endpoint, mTimerDelegate)); + ReturnErrorOnFailure(provider.AddCluster(mIdentifyCluster.Registration())); + + // Update the config with the actual endpoint ID + mConfig.mEndpointId = endpoint; + + // Create the ambient context sensing cluster + mAmbientContextSensingCluster.Create(mConfig); + ReturnErrorOnFailure(provider.AddCluster(mAmbientContextSensingCluster.Registration())); + + return provider.AddEndpoint(mEndpointRegistration); +} + +void AmbientContextSensorDevice::Unregister(CodeDrivenDataModelProvider & provider) +{ + UnregisterDescriptor(provider); + if (mAmbientContextSensingCluster.IsConstructed()) + { + LogErrorOnFailure(provider.RemoveCluster(&mAmbientContextSensingCluster.Cluster())); + mAmbientContextSensingCluster.Destroy(); + } + if (mIdentifyCluster.IsConstructed()) + { + LogErrorOnFailure(provider.RemoveCluster(&mIdentifyCluster.Cluster())); + mIdentifyCluster.Destroy(); + } +} + +} // namespace chip::app diff --git a/examples/all-devices-app/all-devices-common/devices/ambient-context-sensor/AmbientContextSensorDevice.h b/examples/all-devices-app/all-devices-common/devices/ambient-context-sensor/AmbientContextSensorDevice.h new file mode 100644 index 00000000000000..d24ab0d2275666 --- /dev/null +++ b/examples/all-devices-app/all-devices-common/devices/ambient-context-sensor/AmbientContextSensorDevice.h @@ -0,0 +1,49 @@ +/* + * + * Copyright (c) 2026 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 + +namespace chip::app { + +class AmbientContextSensorDevice : public SingleEndpointDevice +{ +public: + using AmbientContextSensingConfig = Clusters::AmbientContextSensingCluster::Config; + + AmbientContextSensorDevice(AmbientContextSensingConfig config, TimerDelegate & timerDelegate); + ~AmbientContextSensorDevice() override = default; + + // DeviceInterface pure virtual lifecycle hooks + CHIP_ERROR Register(chip::EndpointId endpoint, CodeDrivenDataModelProvider & provider, + EndpointComposition composition = {}) override; + void Unregister(CodeDrivenDataModelProvider & provider) override; + + Clusters::IdentifyCluster & IdentifyCluster() { return mIdentifyCluster.Cluster(); } + Clusters::AmbientContextSensingCluster & AmbientContextSensingCluster() { return mAmbientContextSensingCluster.Cluster(); } + +protected: + AmbientContextSensingConfig mConfig; + TimerDelegate & mTimerDelegate; + LazyRegisteredServerCluster mIdentifyCluster; + LazyRegisteredServerCluster mAmbientContextSensingCluster; +}; + +} // namespace chip::app diff --git a/examples/all-devices-app/all-devices-common/devices/ambient-context-sensor/BUILD.gn b/examples/all-devices-app/all-devices-common/devices/ambient-context-sensor/BUILD.gn new file mode 100644 index 00000000000000..c8322b39ec1fa0 --- /dev/null +++ b/examples/all-devices-app/all-devices-common/devices/ambient-context-sensor/BUILD.gn @@ -0,0 +1,33 @@ +# Copyright (c) 2026 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/build.gni") +import("//build_overrides/chip.gni") + +source_set("ambient-context-sensor") { + sources = [ + "AmbientContextSensorDevice.cpp", + "AmbientContextSensorDevice.h", + ] + + public_deps = [ + "${chip_root}/examples/all-devices-app/all-devices-common/devices/interface:single-endpoint-device", + "${chip_root}/src/app/clusters/identify-server", + "${chip_root}/src/app/clusters/ambient-context-sensing-server", + "${chip_root}/src/data-model-providers/codedriven", + "${chip_root}/src/lib/core:error", + "${chip_root}/src/lib/support", + "${chip_root}/zzz_generated/app-common/devices/", + ] +} diff --git a/examples/all-devices-app/all-devices-common/devices/ambient-context-sensor/impl/BUILD.gn b/examples/all-devices-app/all-devices-common/devices/ambient-context-sensor/impl/BUILD.gn new file mode 100644 index 00000000000000..561c927d97a48a --- /dev/null +++ b/examples/all-devices-app/all-devices-common/devices/ambient-context-sensor/impl/BUILD.gn @@ -0,0 +1,30 @@ +# Copyright (c) 2026 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/build.gni") +import("//build_overrides/chip.gni") + +#source_set("toggling") { +source_set("logging") { + sources = [ + "LoggingAmbientContextSensorDevice.cpp", + "LoggingAmbientContextSensorDevice.h", + ] + + public_deps = [ + "${chip_root}/examples/all-devices-app/all-devices-common/devices/ambient-context-sensor", + "${chip_root}/src/lib/support", + "${chip_root}/src/platform", + ] +} diff --git a/examples/all-devices-app/all-devices-common/devices/ambient-context-sensor/impl/LoggingAmbientContextSensorDevice.cpp b/examples/all-devices-app/all-devices-common/devices/ambient-context-sensor/impl/LoggingAmbientContextSensorDevice.cpp new file mode 100644 index 00000000000000..92c0429a7913b9 --- /dev/null +++ b/examples/all-devices-app/all-devices-common/devices/ambient-context-sensor/impl/LoggingAmbientContextSensorDevice.cpp @@ -0,0 +1,157 @@ +/* + * + * Copyright (c) 2026 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 "LoggingAmbientContextSensorDevice.h" +#include +#include +#include + +namespace chip::app::Clusters::AmbientContextSensing { + +constexpr uint32_t g_kFeatures_all = static_cast(Feature::kHumanActivity) | + static_cast(Feature::kObjectCounting) | static_cast(Feature::kObjectIdentification) | + static_cast(Feature::kSoundIdentification) | static_cast(Feature::kPredictedActivity); + +LoggingAmbientContextSensorDevice::LoggingAmbientContextSensorDevice(TimerDelegate & timerDelegate) : + AmbientContextSensorDevice( + // Initialize with kInvalidEndpointId. The actual endpoint ID will be set + // when Register() is called by the application with a valid endpoint ID. + AmbientContextSensingConfig{kInvalidEndpointId, *this, timerDelegate} + .WithFeatures(AmbientContextSensing::Feature(g_kFeatures_all)) + .WithHoldTime(10, + { + .holdTimeMin = 1, + .holdTimeMax = 300, + .holdTimeDefault = 10, + }), timerDelegate) +{ + // AmbientContextSensingDelegate + for (auto & v : mAmbientContextTypeSupportedBuf) + { + v = SemanticTagType{}; + } + + for (auto & v : mPredictActivityBuf) + { + v = PredictActivity{}; + } + + mPredictedActivityList = Span(mPredictActivityBuf, 0); + for (auto & v : mAmbientContextTypeListUsed) + { + v = false; + } +} + +CHIP_ERROR LoggingAmbientContextSensorDevice::Register(EndpointId endpoint, CodeDrivenDataModelProvider & provider, + EndpointComposition composition) +{ + return AmbientContextSensorDevice::Register(endpoint, provider, composition); +} + +void LoggingAmbientContextSensorDevice::Unregister(CodeDrivenDataModelProvider & provider) +{ + AmbientContextSensorDevice::Unregister(provider); +} + +// AmbientContextSensingDelegate implementation +SemanticTagType * LoggingAmbientContextSensorDevice::GetAmbientContextTypeSupportedBuf(size_t size) +{ + VerifyOrReturnError(size <= kMaxACTypeSupported_s, nullptr); + return mAmbientContextTypeSupportedBuf; +} + +CHIP_ERROR LoggingAmbientContextSensorDevice::SetPredictedActivity(const Span & predictedActivityList) +{ + VerifyOrReturnError(predictedActivityList.size() <= kMaxPredictedActivity_s, CHIP_ERROR_INVALID_ARGUMENT); + + // Copy the input predicted activity to local array + for (size_t i = 0; i < predictedActivityList.size(); i++) + { + const auto & src = predictedActivityList[i]; + auto & dst = mPredictActivityBuf[i]; + dst.mInfo = src; + + if (!src.ambientContextType.HasValue()) + { + dst.mInfo.ambientContextType.ClearValue(); + continue; + } + + // Copy tags + const auto & acTypeList = src.ambientContextType.Value(); + const auto tagCount = acTypeList.size(); + VerifyOrReturnError(tagCount <= kMaxPredictedACType, CHIP_ERROR_INVALID_ARGUMENT); + dst.mOwnedTags = std::make_unique(tagCount); + + for (size_t t = 0; t < tagCount; t++) + { + dst.mOwnedTags[t] = acTypeList[t]; + } + + dst.mInfo.ambientContextType.SetValue( + DataModel::List(dst.mOwnedTags.get(), static_cast(tagCount))); + } + mPredictedActivityList = Span(mPredictActivityBuf, predictedActivityList.size()); + + return CHIP_NO_ERROR; +} + +DetectFuncResult LoggingAmbientContextSensorDevice::FindAndUseAvailableDetection() +{ + uint8_t i; + for (i = 0; i < kMaxSimultaneousDetectionLimit; i++) + { + if (mAmbientContextTypeListUsed[i] == false) + { + break; + } + } + if (i >= kMaxSimultaneousDetectionLimit) + { + // Can't find the available space + return { .res = CHIP_ERROR_INCORRECT_STATE }; + } + mAmbientContextTypeListUsed[i] = true; + + return { .res = CHIP_NO_ERROR, .id = i }; +} + +AmbientContextSensed * LoggingAmbientContextSensorDevice::GetAllocedDetection(const uint8_t id) +{ + VerifyOrReturnError(id < kMaxSimultaneousDetectionLimit, nullptr); + VerifyOrReturnError(mAmbientContextTypeListUsed[id] == true, nullptr); + return &mAmbientContextTypeList[id]; +} + +CHIP_ERROR LoggingAmbientContextSensorDevice::DelDetection(const uint8_t & id) +{ + VerifyOrReturnError(id < kMaxSimultaneousDetectionLimit, CHIP_ERROR_INVALID_ARGUMENT); + mAmbientContextTypeListUsed[id] = false; + + return CHIP_NO_ERROR; +} + +uint64_t LoggingAmbientContextSensorDevice::GetEpochNow() +{ + using namespace chip::System::Clock; + Milliseconds64 timestamp_ms(0); + CHIP_ERROR err = System::SystemClock().GetClock_RealTimeMS(timestamp_ms); + + return (err == CHIP_NO_ERROR) ? (timestamp_ms.count()) : (0); +} + +} // namespace chip::app::Clusters::AmbientContextSensing diff --git a/examples/all-devices-app/all-devices-common/devices/ambient-context-sensor/impl/LoggingAmbientContextSensorDevice.h b/examples/all-devices-app/all-devices-common/devices/ambient-context-sensor/impl/LoggingAmbientContextSensorDevice.h new file mode 100644 index 00000000000000..1e8d90385d437f --- /dev/null +++ b/examples/all-devices-app/all-devices-common/devices/ambient-context-sensor/impl/LoggingAmbientContextSensorDevice.h @@ -0,0 +1,64 @@ +/* + * + * Copyright (c) 2026 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 + +namespace chip::app::Clusters::AmbientContextSensing { + +// Use the smaller value for not consuming too much resources +constexpr uint8_t kMaxACTypeSupported_s = 20; +constexpr uint8_t kMaxPredictedActivity_s = 3; + + +/** + * @brief A basic implementation of an Ambient Context Sensor Device. + * + * This class serves as a simple example of an ambient context sensor. + */ +class LoggingAmbientContextSensorDevice : public AmbientContextSensorDevice, public AmbientContextSensingDelegate +{ +public: + LoggingAmbientContextSensorDevice(TimerDelegate & timerDelegate); + ~LoggingAmbientContextSensorDevice() override = default; + + CHIP_ERROR Register(EndpointId endpoint, CodeDrivenDataModelProvider & provider, EndpointComposition composition = {}) override; + void Unregister(CodeDrivenDataModelProvider & provider) override; + + SemanticTagType * GetAmbientContextTypeSupportedBuf(size_t size) override; + CHIP_ERROR SetPredictedActivity(const Span & predictedActivityList) override; + Span & GetPredictedActivity() override { return mPredictedActivityList; }; + DetectFuncResult FindAndUseAvailableDetection() override; + AmbientContextSensed * GetAllocedDetection(const uint8_t id) override; + CHIP_ERROR DelDetection(const uint8_t & id) override; + uint64_t GetEpochNow() override; + +private: + SemanticTagType mAmbientContextTypeSupportedBuf[kMaxACTypeSupported_s]; + + PredictActivity mPredictActivityBuf[kMaxPredictedActivity_s]; + Span mPredictedActivityList; + + // From spec, constraint of AmbientContextType is 1 to SimultaneousDetectionLimit. + AmbientContextSensed mAmbientContextTypeList[kMaxSimultaneousDetectionLimit]; + bool mAmbientContextTypeListUsed[kMaxSimultaneousDetectionLimit]; +}; + +} //chip::app::Clusters::AmbientContextSensing diff --git a/examples/all-devices-app/posix/AppCommandDelegate.cpp b/examples/all-devices-app/posix/AppCommandDelegate.cpp index 772b5bcb027b33..1bce205ad6bd32 100644 --- a/examples/all-devices-app/posix/AppCommandDelegate.cpp +++ b/examples/all-devices-app/posix/AppCommandDelegate.cpp @@ -18,6 +18,7 @@ #include "include/AppCommandDelegate.h" #include +#include #include #include #include @@ -26,6 +27,7 @@ using namespace chip; using namespace chip::app; +using namespace chip::app::Clusters; namespace { @@ -124,6 +126,286 @@ class SetHoldTimeCommandHandler : public AllDevicesAppNamedPipeCommandHandler } }; +class SetAmbientContextSupportCommandHandler : public AllDevicesAppNamedPipeCommandHandler +{ +public: + const char * GetName() const override { return "SetAmbientContextSupport"; } + void Handle(const Json::Value & json, AllDevicesAppCommandDelegate * delegate, EndpointId endpointId) override + { + auto * cluster = + delegate->GetClusterImplementationRegistry().GetClusterByEndpoint( + endpointId); + if (!cluster) + { + ChipLogError(AppServer, "AmbientContextSensingCluster not found on endpoint %d", endpointId); + return; + } + // Validate AmbientContextType exists and is an array + if (!json.isMember("AmbientContextType") || !json["AmbientContextType"].isArray()) + { + std::string inputJson = json.toStyledString(); + ChipLogError(AppServer, "Missing or invalid AmbientContextType array: %s", inputJson.c_str()); + return; + } + const Json::Value & actArray = json["AmbientContextType"]; + if (actArray.empty()) + { + ChipLogError(AppServer, "AmbientContextType array is empty"); + return; + } + Span semanticTags; + std::unique_ptr tagBuf = + std::make_unique(actArray.size()); + for (Json::ArrayIndex i = 0; i < actArray.size(); i++) + { + Json::Value item = actArray[i]; + if (!item.isObject() || !item.isMember("TypeId") || !item.isMember("TagId")) + { + std::string inputJson = json.toStyledString(); + ChipLogError(AppServer, "AmbientContextType[%u], missing/invalid TypeId/TagId in %s", static_cast(i), + inputJson.c_str()); + return; + } + uint8_t typeId = static_cast(item["TypeId"].asUInt()); + uint8_t tagId = static_cast(item["TagId"].asUInt()); + + ChipLogDetail(AppServer, "AmbientContextType[%u] -> (TypeId, TagId) = (%u, %u)", static_cast(i), typeId, + tagId); + tagBuf[i].namespaceID = typeId; + tagBuf[i].tag = tagId; + } + semanticTags = Span(tagBuf.get(), actArray.size()); + LogErrorOnFailure(cluster->SetAmbientContextTypeSupported(semanticTags)); + } +}; + +class AddAmbientContextDetectCommandHandler : public AllDevicesAppNamedPipeCommandHandler +{ +public: + const char * GetName() const override { return "AddAmbientContextDetect"; } + bool GetAmbientContextType(const Json::Value & actArray, + std::vector & semanticTags) + { + // Validate AmbientContextType exists and is an array + if (actArray.empty()) + { + ChipLogError(AppServer, "AmbientContextType array is empty"); + return false; + } + for (Json::ArrayIndex i = 0; i < actArray.size(); i++) + { + Json::Value item = actArray[i]; + if (!item.isObject() || !item.isMember("TypeId") || !item.isMember("TagId")) + { + ChipLogError(AppServer, "AmbientContextType[%u], missing/invalid TypeId/TagId", static_cast(i)); + return false; + } + uint8_t typeId = static_cast(item["TypeId"].asUInt()); + uint8_t tagId = static_cast(item["TagId"].asUInt()); + + Globals::Structs::SemanticTagStruct::Type tag = { + .namespaceID = typeId, + .tag = tagId, + }; + semanticTags.push_back(tag); + } + return true; + } + + void Handle(const Json::Value & json, AllDevicesAppCommandDelegate * delegate, EndpointId endpointId) override + { + auto * cluster = + delegate->GetClusterImplementationRegistry().GetClusterByEndpoint( + endpointId); + if (!cluster) + { + ChipLogError(AppServer, "AmbientContextSensingCluster not found on endpoint %d", endpointId); + return; + } + // Validate AmbientContextType exists and is an array + if (!json.isMember("AmbientContextType") || !json["AmbientContextType"].isArray()) + { + std::string inputJson = json.toStyledString(); + ChipLogError(AppServer, "Missing or invalid AmbientContextType array: %s", inputJson.c_str()); + return; + } + const Json::Value & actArray = json["AmbientContextType"]; + if (actArray.empty()) + { + ChipLogError(AppServer, "AmbientContextType array is empty"); + return; + } + std::vector semanticTags; + semanticTags.reserve(actArray.size()); + if (!GetAmbientContextType(actArray, semanticTags)) + { + ChipLogError(AppServer, "Incorrect or unsupported detection"); + return; + } + auto tagList = + chip::app::DataModel::List(semanticTags.data(), semanticTags.size()); + AmbientContextSensing::Structs::AmbientContextTypeStruct::Type ACSType = { .ambientContextSensed = tagList }; + // Add DetectionConfidence + if (json.isMember("DetectionConfidence")) + { + auto confidenceValue = json["DetectionConfidence"].asUInt(); + if ((confidenceValue == 0) || (confidenceValue > 100)) + { + ChipLogError(AppServer, "Incorrect or unsupported confidence value"); + return; + } + ACSType.detectionConfidence.SetValue(static_cast(confidenceValue)); + } + LogErrorOnFailure(cluster->AddDetection(ACSType)); + } +}; + +class SetPredictedActivityCommandHandler : public AllDevicesAppNamedPipeCommandHandler +{ +public: + const char * GetName() const override { return "SetPredictedActivity"; } + bool GetAmbientContextType(const Json::Value & actArray, + std::vector & semanticTags) + { + // Validate AmbientContextType exists and is an array + if (actArray.empty()) + { + ChipLogError(AppServer, "AmbientContextType array is empty"); + return false; + } + for (Json::ArrayIndex i = 0; i < actArray.size(); i++) + { + Json::Value item = actArray[i]; + if (!item.isObject() || !item.isMember("TypeId") || !item.isMember("TagId")) + { + ChipLogError(AppServer, "AmbientContextType[%u], missing/invalid TypeId/TagId", static_cast(i)); + return false; + } + uint8_t typeId = static_cast(item["TypeId"].asUInt()); + uint8_t tagId = static_cast(item["TagId"].asUInt()); + + Globals::Structs::SemanticTagStruct::Type tag = { + .namespaceID = typeId, + .tag = tagId, + }; + semanticTags.push_back(tag); + } + return true; + } + void Handle(const Json::Value & json, AllDevicesAppCommandDelegate * delegate, EndpointId endpointId) override + { + auto * cluster = + delegate->GetClusterImplementationRegistry().GetClusterByEndpoint( + endpointId); + if (!cluster) + { + ChipLogError(AppServer, "AmbientContextSensingCluster not found on endpoint %d", endpointId); + return; + } + // Validate PredictedActivity exists and is an array + if (!json.isMember("PredAct") || !json["PredAct"].isArray()) + { + std::string inputJson = json.toStyledString(); + ChipLogError(AppServer, "Missing or invalid PredictedActivity array: %s", inputJson.c_str()); + return; + } + const Json::Value & predictArray = json["PredAct"]; + if (predictArray.empty()) + { + ChipLogError(AppServer, "PredictedActivity array is empty"); + return; + } + std::unique_ptr predictArrayBuf = + std::make_unique(predictArray.size()); + std::vector> allSemanticTags; + allSemanticTags.resize(predictArray.size()); + + for (Json::ArrayIndex i = 0; i < predictArray.size(); i++) + { + Json::Value item = predictArray[i]; + if (!item.isObject() || !item.isMember("StartTStamp") || !item.isMember("EndTStamp") || + !item.isMember("Conf")) + { + std::string inputJson = json.toStyledString(); + ChipLogError(AppServer, "PredictedActivity[%u], missing/invalid fields in %s", static_cast(i), + inputJson.c_str()); + return; + } + AmbientContextSensing::Structs::PredictedActivityStruct::Type predictAct; + predictAct.startTimestamp = item["StartTStamp"].asUInt(); + predictAct.endTimestamp = item["EndTStamp"].asUInt(); + VerifyOrReturn(predictAct.startTimestamp < predictAct.endTimestamp, + ChipLogError(AppServer, "PredictedActivity, incorrect startTime/endTime")); + predictAct.confidence = static_cast(item["Conf"].asUInt()); + + if (item.isMember("CrowdDetect")) + { + predictAct.crowdDetected.SetValue(static_cast(item["CrowdDetect"].asBool())); + } + if (item.isMember("CrowdCnt")) + { + predictAct.crowdCount.SetValue(static_cast(item["CrowdCnt"].asUInt())); + } + // Validate AmbientContextType exists and is an array + if (!item.isMember("AmbientContextType") || !item["AmbientContextType"].isArray()) + { + std::string inputJson = item.toStyledString(); + ChipLogError(AppServer, "Missing or invalid AmbientContextType array: %s", inputJson.c_str()); + return; + } + const Json::Value & actArray = item["AmbientContextType"]; + if (actArray.empty()) + { + ChipLogError(AppServer, "AmbientContextType array is empty"); + return; + } + auto & semanticTags = allSemanticTags[i]; + semanticTags.clear(); + semanticTags.reserve(actArray.size()); + if (!GetAmbientContextType(actArray, semanticTags)) + { + ChipLogError(AppServer, "Incorrect or unsupported detection"); + return; + } + + auto tagList = + chip::app::DataModel::List(semanticTags.data(), semanticTags.size()); + predictAct.ambientContextType.SetValue(tagList); + predictArrayBuf[i] = predictAct; + } + Span predictedActivityArray = + Span(predictArrayBuf.get(), predictArray.size()); + TEMPORARY_RETURN_IGNORED cluster->SetPredictedActivity(predictedActivityArray); + } +}; + + +class SetObjCountCommandHandler : public AllDevicesAppNamedPipeCommandHandler +{ +public: + const char * GetName() const override { return "SetObjCount"; } + void Handle(const Json::Value & json, AllDevicesAppCommandDelegate * delegate, EndpointId endpointId) override + { + auto * cluster = + delegate->GetClusterImplementationRegistry().GetClusterByEndpoint( + endpointId); + if (!cluster) + { + ChipLogError(AppServer, "AmbientContextSensingCluster not found on endpoint %d", endpointId); + return; + } + uint16_t objCount; + // Add ObjectCount + if (!json.isMember("ObjectCount")) + { + ChipLogError(AppServer, "Missing or invalid value for ObjectCount"); + return; + } + objCount = static_cast(json["ObjectCount"].asUInt()); + TEMPORARY_RETURN_IGNORED cluster->SetObjectCount(objCount); + } +}; + class SetBooleanStateCommandHandler : public AllDevicesAppNamedPipeCommandHandler { public: @@ -248,6 +530,10 @@ void AllDevicesAppCommandDelegate::RegisterCommandHandlers() RegisterCommandHandler(std::make_unique()); RegisterCommandHandler(std::make_unique()); RegisterCommandHandler(std::make_unique()); + RegisterCommandHandler(std::make_unique()); + RegisterCommandHandler(std::make_unique()); + RegisterCommandHandler(std::make_unique()); + RegisterCommandHandler(std::make_unique()); RegisterCommandHandler(std::make_unique()); RegisterCommandHandler(std::make_unique()); } diff --git a/examples/all-devices-app/posix/BUILD.gn b/examples/all-devices-app/posix/BUILD.gn index 03b59e6a14ce3e..d66a70f05316cf 100644 --- a/examples/all-devices-app/posix/BUILD.gn +++ b/examples/all-devices-app/posix/BUILD.gn @@ -39,6 +39,7 @@ executable("all-devices-app") { "${chip_root}/examples/all-devices-app/all-devices-common/device-factory", "${chip_root}/examples/all-devices-app/all-devices-common/devices/aggregator", "${chip_root}/examples/all-devices-app/all-devices-common/devices/air-purifier", + "${chip_root}/examples/all-devices-app/all-devices-common/devices/ambient-context-sensor", "${chip_root}/examples/all-devices-app/all-devices-common/devices/boolean-state-sensor", "${chip_root}/examples/all-devices-app/all-devices-common/devices/bridged-node", "${chip_root}/examples/all-devices-app/all-devices-common/devices/chime", diff --git a/examples/all-devices-app/posix/ClusterTypeMappings.cpp b/examples/all-devices-app/posix/ClusterTypeMappings.cpp index 43ee73c2c5eba8..3027b780cb8737 100644 --- a/examples/all-devices-app/posix/ClusterTypeMappings.cpp +++ b/examples/all-devices-app/posix/ClusterTypeMappings.cpp @@ -17,6 +17,7 @@ #include "AllDevicesAppClusterImplementationRegistry.h" +#include #include #include #include @@ -36,6 +37,12 @@ const char * GetClusterTypeName() return "chip::app::Clusters::OccupancySensingCluster"; } +template <> +const char * GetClusterTypeName() +{ + return "chip::app::Clusters::AmbientContextSensingCluster"; +} + template <> const char * GetClusterTypeName() { diff --git a/examples/all-devices-app/posix/main.cpp b/examples/all-devices-app/posix/main.cpp index 5c0e03ef8e5e0d..c96a6cb99ad1d2 100644 --- a/examples/all-devices-app/posix/main.cpp +++ b/examples/all-devices-app/posix/main.cpp @@ -277,6 +277,12 @@ void SetupNamedPipe(CodeDrivenDataModelDevices & devices, const char * namedPipe gAllDevicesAppCommandDelegate.GetClusterImplementationRegistry() .RegisterClusterInstance(&lightDevice->OnOffCluster()); } + else if (config.type == "ambient-context-sensor") + { + auto * ambientContextSensorDevice = static_cast(device); + gAllDevicesAppCommandDelegate.GetClusterImplementationRegistry() + .RegisterClusterInstance(&ambientContextSensorDevice->AmbientContextSensingCluster()); + } } gAllDevicesAppCommandDelegate.GetClusterImplementationRegistry() diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index 354cc3f105966d..1f9bc6acded23c 100644 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -46,6 +46,7 @@ # keep-sorted: start 'aggregator', 'air-purifier', + 'ambient-context-sensor', 'bridged-node', 'chime', 'contact-sensor', diff --git a/scripts/build/testdata/all_targets_linux_x64.txt b/scripts/build/testdata/all_targets_linux_x64.txt index 867f328ed473c2..2776bd900549fa 100644 --- a/scripts/build/testdata/all_targets_linux_x64.txt +++ b/scripts/build/testdata/all_targets_linux_x64.txt @@ -5,11 +5,11 @@ bouffalolab-{bl602-night-light,bl602dk,bl616cldk,bl616dk,bl704ldk,bl706-night-li cc32xx-{air-purifier,lock} ti-cc13x4_26x4-{lighting,lock,pump,pump-controller}[-ftd][-mtd] cyw30739-{cyw30739b2_p5_evk_01,cyw30739b2_p5_evk_02,cyw30739b2_p5_evk_03,cyw930739m2evb_01,cyw930739m2evb_02}-{light,light-switch,lock,thermostat} -efr32-{brd2601b,brd2605a,brd2703a,brd2704b,brd2708a,brd2911a,brd4186a,brd4186c,brd4187a,brd4187c,brd4316a,brd4317a,brd4318a,brd4319a,brd4338a,brd4342a,brd4343a}-{air-quality-sensor-app,all-devices,all-devices-aggregator,all-devices-air-purifier,all-devices-bridged-node,all-devices-chime,all-devices-contact-sensor,all-devices-cooktop,all-devices-device-energy-management,all-devices-dimmable-light,all-devices-dimmable-plug-in-unit,all-devices-extractor-hood,all-devices-fan,all-devices-flow-sensor,all-devices-generic-switch,all-devices-humidity-sensor,all-devices-light-sensor,all-devices-mounted-dimmable-load-control,all-devices-mounted-on-off-control,all-devices-occupancy-sensor,all-devices-on-off-light,all-devices-on-off-light-switch,all-devices-on-off-plug-in-unit,all-devices-oven,all-devices-power-source,all-devices-pressure-sensor,all-devices-proximity-ranger,all-devices-rain-sensor,all-devices-refrigerator,all-devices-soil-sensor,all-devices-speaker,all-devices-temperature-sensor,all-devices-water-freeze-detector,all-devices-water-leak-detector,all-devices-water-valve,closure,evse,light,lock,pump,smoke-co-alarm,switch,thermostat,unit-test,water-heater,window-covering}[-additional-data-advertising][-heap-monitoring][-icd][-ipv4][-low-power][-no-logging][-no-openthread-cli][-openthread-mtd][-rpc][-shell][-show-qr-code][-siwx917][-skip-rps-generation][-uart-log][-use-ot-coap-lib][-use-ot-lib][-wf200][-wifi][-with-ota-requestor] -esp32-{c3devkit,devkitc,m5stack,p4functionev,qemu}-{all-clusters,all-clusters-minimal,all-devices,all-devices-aggregator,all-devices-air-purifier,all-devices-bridged-node,all-devices-chime,all-devices-contact-sensor,all-devices-cooktop,all-devices-device-energy-management,all-devices-dimmable-light,all-devices-dimmable-plug-in-unit,all-devices-extractor-hood,all-devices-fan,all-devices-flow-sensor,all-devices-generic-switch,all-devices-humidity-sensor,all-devices-light-sensor,all-devices-mounted-dimmable-load-control,all-devices-mounted-on-off-control,all-devices-occupancy-sensor,all-devices-on-off-light,all-devices-on-off-light-switch,all-devices-on-off-plug-in-unit,all-devices-oven,all-devices-power-source,all-devices-pressure-sensor,all-devices-proximity-ranger,all-devices-rain-sensor,all-devices-refrigerator,all-devices-soil-sensor,all-devices-speaker,all-devices-temperature-sensor,all-devices-water-freeze-detector,all-devices-water-leak-detector,all-devices-water-valve,bridge,energy-gateway,evse,light,lock,ota-provider,ota-requestor,shell,temperature-measurement,tests,water-heater}[-ipv6only][-rpc][-tracing] +efr32-{brd2601b,brd2605a,brd2703a,brd2704b,brd2708a,brd2911a,brd4186a,brd4186c,brd4187a,brd4187c,brd4316a,brd4317a,brd4318a,brd4319a,brd4338a,brd4342a,brd4343a}-{air-quality-sensor-app,all-devices,all-devices-aggregator,all-devices-air-purifier,all-devices-ambient-context-sensor,all-devices-bridged-node,all-devices-chime,all-devices-contact-sensor,all-devices-cooktop,all-devices-device-energy-management,all-devices-dimmable-light,all-devices-dimmable-plug-in-unit,all-devices-extractor-hood,all-devices-fan,all-devices-flow-sensor,all-devices-generic-switch,all-devices-humidity-sensor,all-devices-light-sensor,all-devices-mounted-dimmable-load-control,all-devices-mounted-on-off-control,all-devices-occupancy-sensor,all-devices-on-off-light,all-devices-on-off-light-switch,all-devices-on-off-plug-in-unit,all-devices-oven,all-devices-power-source,all-devices-pressure-sensor,all-devices-proximity-ranger,all-devices-rain-sensor,all-devices-refrigerator,all-devices-soil-sensor,all-devices-speaker,all-devices-temperature-sensor,all-devices-water-freeze-detector,all-devices-water-leak-detector,all-devices-water-valve,closure,evse,light,lock,pump,smoke-co-alarm,switch,thermostat,unit-test,water-heater,window-covering}[-additional-data-advertising][-heap-monitoring][-icd][-ipv4][-low-power][-no-logging][-no-openthread-cli][-openthread-mtd][-rpc][-shell][-show-qr-code][-siwx917][-skip-rps-generation][-uart-log][-use-ot-coap-lib][-use-ot-lib][-wf200][-wifi][-with-ota-requestor] +esp32-{c3devkit,devkitc,m5stack,p4functionev,qemu}-{all-clusters,all-clusters-minimal,all-devices,all-devices-aggregator,all-devices-air-purifier,all-devices-ambient-context-sensor,all-devices-bridged-node,all-devices-chime,all-devices-contact-sensor,all-devices-cooktop,all-devices-device-energy-management,all-devices-dimmable-light,all-devices-dimmable-plug-in-unit,all-devices-extractor-hood,all-devices-fan,all-devices-flow-sensor,all-devices-generic-switch,all-devices-humidity-sensor,all-devices-light-sensor,all-devices-mounted-dimmable-load-control,all-devices-mounted-on-off-control,all-devices-occupancy-sensor,all-devices-on-off-light,all-devices-on-off-light-switch,all-devices-on-off-plug-in-unit,all-devices-oven,all-devices-power-source,all-devices-pressure-sensor,all-devices-proximity-ranger,all-devices-rain-sensor,all-devices-refrigerator,all-devices-soil-sensor,all-devices-speaker,all-devices-temperature-sensor,all-devices-water-freeze-detector,all-devices-water-leak-detector,all-devices-water-valve,bridge,energy-gateway,evse,light,lock,ota-provider,ota-requestor,shell,temperature-measurement,tests,water-heater}[-ipv6only][-rpc][-tracing] genio-lighting-app linux-fake-tests[-asan][-boringssl][-clang][-coverage][-dmalloc][-libfuzzer][-mbedtls][-ossfuzz][-psa][-pw-fuzztest][-tsan][-ubsan] -linux-{arm,arm64,x64}-{address-resolve-tool,air-purifier,air-quality-sensor,all-clusters,all-clusters-minimal,all-devices,all-devices-aggregator,all-devices-air-purifier,all-devices-bridged-node,all-devices-chime,all-devices-contact-sensor,all-devices-cooktop,all-devices-device-energy-management,all-devices-dimmable-light,all-devices-dimmable-plug-in-unit,all-devices-extractor-hood,all-devices-fan,all-devices-flow-sensor,all-devices-generic-switch,all-devices-humidity-sensor,all-devices-light-sensor,all-devices-mounted-dimmable-load-control,all-devices-mounted-on-off-control,all-devices-occupancy-sensor,all-devices-on-off-light,all-devices-on-off-light-switch,all-devices-on-off-plug-in-unit,all-devices-oven,all-devices-power-source,all-devices-pressure-sensor,all-devices-proximity-ranger,all-devices-rain-sensor,all-devices-refrigerator,all-devices-soil-sensor,all-devices-speaker,all-devices-temperature-sensor,all-devices-water-freeze-detector,all-devices-water-leak-detector,all-devices-water-valve,bridge,camera,camera-controller,chip-cert,chip-tool,closure,contact-sensor,dishwasher,energy-gateway,evse,fabric-admin,fabric-bridge,fabric-sync,java-matter-controller,jf-admin-app,jf-control-app,kotlin-matter-controller,light,light-data-model-no-unique-id,lit-icd,lock,microwave-oven,minmdns,network-manager,ota-provider,ota-requestor,python-bindings,refrigerator,rpc-console,rvc,shell,simulated-app1,simulated-app2,terms-and-conditions,tests,thermostat,tv-app,tv-casting-app,water-heater,water-leak-detector}[-asan][-boringssl][-chip-casting-simplified][-clang][-coverage][-disable-dnssd-tests][-dmalloc][-enable-dnssd-tests][-endpoint-unique-id][-evse-test-event][-googletest][-ipv6only][-libfuzzer][-libnl][-mbedtls][-minmdns-verbose][-msan][-nfc-commission][-nlfaultinject][-no-ble][-no-groupcast][-no-interactive][-no-shell][-no-thread][-no-wifi][-no-wifipaf][-nodeps][-openthread-endpoint][-ossfuzz][-platform-mdns][-psa][-pw-fuzztest][-rpc][-same-event-loop][-terms-and-conditions][-test][-tsan][-ubsan][-unified][-webrtc][-with-ui] +linux-{arm,arm64,x64}-{address-resolve-tool,air-purifier,air-quality-sensor,all-clusters,all-clusters-minimal,all-devices,all-devices-aggregator,all-devices-air-purifier,all-devices-ambient-context-sensor,all-devices-bridged-node,all-devices-chime,all-devices-contact-sensor,all-devices-cooktop,all-devices-device-energy-management,all-devices-dimmable-light,all-devices-dimmable-plug-in-unit,all-devices-extractor-hood,all-devices-fan,all-devices-flow-sensor,all-devices-generic-switch,all-devices-humidity-sensor,all-devices-light-sensor,all-devices-mounted-dimmable-load-control,all-devices-mounted-on-off-control,all-devices-occupancy-sensor,all-devices-on-off-light,all-devices-on-off-light-switch,all-devices-on-off-plug-in-unit,all-devices-oven,all-devices-power-source,all-devices-pressure-sensor,all-devices-proximity-ranger,all-devices-rain-sensor,all-devices-refrigerator,all-devices-soil-sensor,all-devices-speaker,all-devices-temperature-sensor,all-devices-water-freeze-detector,all-devices-water-leak-detector,all-devices-water-valve,bridge,camera,camera-controller,chip-cert,chip-tool,closure,contact-sensor,dishwasher,energy-gateway,evse,fabric-admin,fabric-bridge,fabric-sync,java-matter-controller,jf-admin-app,jf-control-app,kotlin-matter-controller,light,light-data-model-no-unique-id,lit-icd,lock,microwave-oven,minmdns,network-manager,ota-provider,ota-requestor,python-bindings,refrigerator,rpc-console,rvc,shell,simulated-app1,simulated-app2,terms-and-conditions,tests,thermostat,tv-app,tv-casting-app,water-heater,water-leak-detector}[-asan][-boringssl][-chip-casting-simplified][-clang][-coverage][-disable-dnssd-tests][-dmalloc][-enable-dnssd-tests][-endpoint-unique-id][-evse-test-event][-googletest][-ipv6only][-libfuzzer][-libnl][-mbedtls][-minmdns-verbose][-msan][-nfc-commission][-nlfaultinject][-no-ble][-no-groupcast][-no-interactive][-no-shell][-no-thread][-no-wifi][-no-wifipaf][-nodeps][-openthread-endpoint][-ossfuzz][-platform-mdns][-psa][-pw-fuzztest][-rpc][-same-event-loop][-terms-and-conditions][-test][-tsan][-ubsan][-unified][-webrtc][-with-ui] linux-x64-efr32-test-runner[-clang] imx-{all-clusters-app,all-clusters-minimal-app,chip-tool,lighting-app,ota-provider-app,thermostat}[-ele][-release][-trusty] infineon-psoc6-{all-clusters,all-clusters-minimal,light,lock}[-ota][-trustm][-updateimage] @@ -21,4 +21,4 @@ qpg-qpg6200-{light,light-switch,lock,persistent-storage,shell,thermostat}[-updat realtek-{rtl8777g,rtl87x2g}-{all-clusters,light-switch,lighting,lock,ota-requestor,thermostat,window} stm32-stm32wb5mm-dk-light tizen-{arm,arm64}-{all-clusters,chip-tool,light,tests}[-asan][-coverage][-no-ble][-no-thread][-no-wifi][-ubsan][-with-ui] -telink-{tl3218x,tl3218x_ml3m,tl3218x_retention,tl7218x,tl7218x_ml7g,tl7218x_ml7m,tl7218x_retention,tlsr9118bdk40d,tlsr9518adk80d,tlsr9528a,tlsr9528a_retention}-{air-quality-sensor,all-clusters,all-clusters-minimal,all-devices,all-devices-aggregator,all-devices-air-purifier,all-devices-bridged-node,all-devices-chime,all-devices-contact-sensor,all-devices-cooktop,all-devices-device-energy-management,all-devices-dimmable-light,all-devices-dimmable-plug-in-unit,all-devices-extractor-hood,all-devices-fan,all-devices-flow-sensor,all-devices-generic-switch,all-devices-humidity-sensor,all-devices-light-sensor,all-devices-mounted-dimmable-load-control,all-devices-mounted-on-off-control,all-devices-occupancy-sensor,all-devices-on-off-light,all-devices-on-off-light-switch,all-devices-on-off-plug-in-unit,all-devices-oven,all-devices-power-source,all-devices-pressure-sensor,all-devices-proximity-ranger,all-devices-rain-sensor,all-devices-refrigerator,all-devices-soil-sensor,all-devices-speaker,all-devices-temperature-sensor,all-devices-water-freeze-detector,all-devices-water-leak-detector,all-devices-water-valve,bridge,contact-sensor,light,light-switch,lock,ota-requestor,pump,pump-controller,shell,smoke-co-alarm,temperature-measurement,thermostat,window-covering}[-4mb][-compress-lzma][-dfu-smp][-factory-data][-log-all][-log-error][-log-none][-log-progress][-mars][-nfc-payload][-ota][-precompiled-ot][-rpc][-shell][-tflm][-thread-analyzer][-usb] +telink-{tl3218x,tl3218x_ml3m,tl3218x_retention,tl7218x,tl7218x_ml7g,tl7218x_ml7m,tl7218x_retention,tlsr9118bdk40d,tlsr9518adk80d,tlsr9528a,tlsr9528a_retention}-{air-quality-sensor,all-clusters,all-clusters-minimal,all-devices,all-devices-aggregator,all-devices-air-purifier,all-devices-ambient-context-sensor,all-devices-bridged-node,all-devices-chime,all-devices-contact-sensor,all-devices-cooktop,all-devices-device-energy-management,all-devices-dimmable-light,all-devices-dimmable-plug-in-unit,all-devices-extractor-hood,all-devices-fan,all-devices-flow-sensor,all-devices-generic-switch,all-devices-humidity-sensor,all-devices-light-sensor,all-devices-mounted-dimmable-load-control,all-devices-mounted-on-off-control,all-devices-occupancy-sensor,all-devices-on-off-light,all-devices-on-off-light-switch,all-devices-on-off-plug-in-unit,all-devices-oven,all-devices-power-source,all-devices-pressure-sensor,all-devices-proximity-ranger,all-devices-rain-sensor,all-devices-refrigerator,all-devices-soil-sensor,all-devices-speaker,all-devices-temperature-sensor,all-devices-water-freeze-detector,all-devices-water-leak-detector,all-devices-water-valve,bridge,contact-sensor,light,light-switch,lock,ota-requestor,pump,pump-controller,shell,smoke-co-alarm,temperature-measurement,thermostat,window-covering}[-4mb][-compress-lzma][-dfu-smp][-factory-data][-log-all][-log-error][-log-none][-log-progress][-mars][-nfc-payload][-ota][-precompiled-ot][-rpc][-shell][-tflm][-thread-analyzer][-usb] From 142f6c6be5a1e3772ce3051e8e17f1a4b2721328 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 25 Jun 2026 06:36:01 +0000 Subject: [PATCH 2/6] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .../device-factory/DeviceFactory.h | 3 ++- .../AmbientContextSensorDevice.h | 2 +- .../impl/LoggingAmbientContextSensorDevice.cpp | 7 ++++--- .../impl/LoggingAmbientContextSensorDevice.h | 3 +-- .../all-devices-app/posix/AppCommandDelegate.cpp | 14 +++++--------- examples/all-devices-app/posix/main.cpp | 3 ++- 6 files changed, 15 insertions(+), 17 deletions(-) diff --git a/examples/all-devices-app/all-devices-common/device-factory/DeviceFactory.h b/examples/all-devices-app/all-devices-common/device-factory/DeviceFactory.h index 7a8e0766279124..58bbf1eacd0f39 100644 --- a/examples/all-devices-app/all-devices-common/device-factory/DeviceFactory.h +++ b/examples/all-devices-app/all-devices-common/device-factory/DeviceFactory.h @@ -210,7 +210,8 @@ class DeviceFactory { RegisterCreator("ambient-context-sensor", [this]() { VerifyOrDie(mContext.has_value()); - return std::make_unique(mContext->timerDelegate); + return std::make_unique( + mContext->timerDelegate); }); } if constexpr (ALL_DEVICES_ENABLE_BRIDGED_NODE) diff --git a/examples/all-devices-app/all-devices-common/devices/ambient-context-sensor/AmbientContextSensorDevice.h b/examples/all-devices-app/all-devices-common/devices/ambient-context-sensor/AmbientContextSensorDevice.h index d24ab0d2275666..7ce18a5d3f1d59 100644 --- a/examples/all-devices-app/all-devices-common/devices/ambient-context-sensor/AmbientContextSensorDevice.h +++ b/examples/all-devices-app/all-devices-common/devices/ambient-context-sensor/AmbientContextSensorDevice.h @@ -16,8 +16,8 @@ */ #pragma once -#include #include +#include #include #include diff --git a/examples/all-devices-app/all-devices-common/devices/ambient-context-sensor/impl/LoggingAmbientContextSensorDevice.cpp b/examples/all-devices-app/all-devices-common/devices/ambient-context-sensor/impl/LoggingAmbientContextSensorDevice.cpp index 92c0429a7913b9..f662cb55fe4190 100644 --- a/examples/all-devices-app/all-devices-common/devices/ambient-context-sensor/impl/LoggingAmbientContextSensorDevice.cpp +++ b/examples/all-devices-app/all-devices-common/devices/ambient-context-sensor/impl/LoggingAmbientContextSensorDevice.cpp @@ -29,14 +29,15 @@ LoggingAmbientContextSensorDevice::LoggingAmbientContextSensorDevice(TimerDelega AmbientContextSensorDevice( // Initialize with kInvalidEndpointId. The actual endpoint ID will be set // when Register() is called by the application with a valid endpoint ID. - AmbientContextSensingConfig{kInvalidEndpointId, *this, timerDelegate} + AmbientContextSensingConfig{ kInvalidEndpointId, *this, timerDelegate } .WithFeatures(AmbientContextSensing::Feature(g_kFeatures_all)) .WithHoldTime(10, { .holdTimeMin = 1, .holdTimeMax = 300, .holdTimeDefault = 10, - }), timerDelegate) + }), + timerDelegate) { // AmbientContextSensingDelegate for (auto & v : mAmbientContextTypeSupportedBuf) @@ -57,7 +58,7 @@ LoggingAmbientContextSensorDevice::LoggingAmbientContextSensorDevice(TimerDelega } CHIP_ERROR LoggingAmbientContextSensorDevice::Register(EndpointId endpoint, CodeDrivenDataModelProvider & provider, - EndpointComposition composition) + EndpointComposition composition) { return AmbientContextSensorDevice::Register(endpoint, provider, composition); } diff --git a/examples/all-devices-app/all-devices-common/devices/ambient-context-sensor/impl/LoggingAmbientContextSensorDevice.h b/examples/all-devices-app/all-devices-common/devices/ambient-context-sensor/impl/LoggingAmbientContextSensorDevice.h index 1e8d90385d437f..d6f3257021db00 100644 --- a/examples/all-devices-app/all-devices-common/devices/ambient-context-sensor/impl/LoggingAmbientContextSensorDevice.h +++ b/examples/all-devices-app/all-devices-common/devices/ambient-context-sensor/impl/LoggingAmbientContextSensorDevice.h @@ -27,7 +27,6 @@ namespace chip::app::Clusters::AmbientContextSensing { constexpr uint8_t kMaxACTypeSupported_s = 20; constexpr uint8_t kMaxPredictedActivity_s = 3; - /** * @brief A basic implementation of an Ambient Context Sensor Device. * @@ -61,4 +60,4 @@ class LoggingAmbientContextSensorDevice : public AmbientContextSensorDevice, pub bool mAmbientContextTypeListUsed[kMaxSimultaneousDetectionLimit]; }; -} //chip::app::Clusters::AmbientContextSensing +} // namespace chip::app::Clusters::AmbientContextSensing diff --git a/examples/all-devices-app/posix/AppCommandDelegate.cpp b/examples/all-devices-app/posix/AppCommandDelegate.cpp index 1bce205ad6bd32..dd72ed99b7d540 100644 --- a/examples/all-devices-app/posix/AppCommandDelegate.cpp +++ b/examples/all-devices-app/posix/AppCommandDelegate.cpp @@ -183,8 +183,7 @@ class AddAmbientContextDetectCommandHandler : public AllDevicesAppNamedPipeComma { public: const char * GetName() const override { return "AddAmbientContextDetect"; } - bool GetAmbientContextType(const Json::Value & actArray, - std::vector & semanticTags) + bool GetAmbientContextType(const Json::Value & actArray, std::vector & semanticTags) { // Validate AmbientContextType exists and is an array if (actArray.empty()) @@ -264,8 +263,7 @@ class SetPredictedActivityCommandHandler : public AllDevicesAppNamedPipeCommandH { public: const char * GetName() const override { return "SetPredictedActivity"; } - bool GetAmbientContextType(const Json::Value & actArray, - std::vector & semanticTags) + bool GetAmbientContextType(const Json::Value & actArray, std::vector & semanticTags) { // Validate AmbientContextType exists and is an array if (actArray.empty()) @@ -323,8 +321,7 @@ class SetPredictedActivityCommandHandler : public AllDevicesAppNamedPipeCommandH for (Json::ArrayIndex i = 0; i < predictArray.size(); i++) { Json::Value item = predictArray[i]; - if (!item.isObject() || !item.isMember("StartTStamp") || !item.isMember("EndTStamp") || - !item.isMember("Conf")) + if (!item.isObject() || !item.isMember("StartTStamp") || !item.isMember("EndTStamp") || !item.isMember("Conf")) { std::string inputJson = json.toStyledString(); ChipLogError(AppServer, "PredictedActivity[%u], missing/invalid fields in %s", static_cast(i), @@ -368,8 +365,8 @@ class SetPredictedActivityCommandHandler : public AllDevicesAppNamedPipeCommandH return; } - auto tagList = - chip::app::DataModel::List(semanticTags.data(), semanticTags.size()); + auto tagList = chip::app::DataModel::List(semanticTags.data(), + semanticTags.size()); predictAct.ambientContextType.SetValue(tagList); predictArrayBuf[i] = predictAct; } @@ -379,7 +376,6 @@ class SetPredictedActivityCommandHandler : public AllDevicesAppNamedPipeCommandH } }; - class SetObjCountCommandHandler : public AllDevicesAppNamedPipeCommandHandler { public: diff --git a/examples/all-devices-app/posix/main.cpp b/examples/all-devices-app/posix/main.cpp index c96a6cb99ad1d2..ed3bffe950092e 100644 --- a/examples/all-devices-app/posix/main.cpp +++ b/examples/all-devices-app/posix/main.cpp @@ -281,7 +281,8 @@ void SetupNamedPipe(CodeDrivenDataModelDevices & devices, const char * namedPipe { auto * ambientContextSensorDevice = static_cast(device); gAllDevicesAppCommandDelegate.GetClusterImplementationRegistry() - .RegisterClusterInstance(&ambientContextSensorDevice->AmbientContextSensingCluster()); + .RegisterClusterInstance( + &ambientContextSensorDevice->AmbientContextSensingCluster()); } } From 919b00473ed229ad07330e2ce9b528dbb0ead563 Mon Sep 17 00:00:00 2001 From: "Lo,Chin-Ran" Date: Thu, 25 Jun 2026 15:06:53 +0800 Subject: [PATCH 3/6] Fix a typo Remove the duplicate function Add more input checking Signed-off-by: Lo,Chin-Ran --- .../enabled_devices_config.h.in | 2 +- .../posix/AppCommandDelegate.cpp | 90 +++++++------------ 2 files changed, 35 insertions(+), 57 deletions(-) diff --git a/examples/all-devices-app/all-devices-common/device-factory/enabled_devices_config.h.in b/examples/all-devices-app/all-devices-common/device-factory/enabled_devices_config.h.in index a1804119221d80..6f375911dc60ce 100644 --- a/examples/all-devices-app/all-devices-common/device-factory/enabled_devices_config.h.in +++ b/examples/all-devices-app/all-devices-common/device-factory/enabled_devices_config.h.in @@ -10,7 +10,7 @@ #cmakedefine01 ALL_DEVICES_ENABLE_AGGREGATOR #cmakedefine01 ALL_DEVICES_ENABLE_AIR_PURIFIER #cmakedefine01 ALL_DEVICES_ENABLE_AIR_QUALITY_SENSOR -#cmakedevice01 ALL_DEVICES_ENABLE_AMBIENT_CONTEXT_SENSOR +#cmakedefine01 ALL_DEVICES_ENABLE_AMBIENT_CONTEXT_SENSOR #cmakedefine01 ALL_DEVICES_ENABLE_BRIDGED_NODE #cmakedefine01 ALL_DEVICES_ENABLE_CHIME #cmakedefine01 ALL_DEVICES_ENABLE_CONTACT_SENSOR diff --git a/examples/all-devices-app/posix/AppCommandDelegate.cpp b/examples/all-devices-app/posix/AppCommandDelegate.cpp index dd72ed99b7d540..1db833eb5283b3 100644 --- a/examples/all-devices-app/posix/AppCommandDelegate.cpp +++ b/examples/all-devices-app/posix/AppCommandDelegate.cpp @@ -179,38 +179,38 @@ class SetAmbientContextSupportCommandHandler : public AllDevicesAppNamedPipeComm } }; -class AddAmbientContextDetectCommandHandler : public AllDevicesAppNamedPipeCommandHandler +static bool GetAmbientContextType(const Json::Value & actArray, std::vector & semanticTags) { -public: - const char * GetName() const override { return "AddAmbientContextDetect"; } - bool GetAmbientContextType(const Json::Value & actArray, std::vector & semanticTags) + // Validate AmbientContextType exists and is an array + if (actArray.empty()) { - // Validate AmbientContextType exists and is an array - if (actArray.empty()) + ChipLogError(AppServer, "AmbientContextType array is empty"); + return false; + } + for (Json::ArrayIndex i = 0; i < actArray.size(); i++) + { + Json::Value item = actArray[i]; + if (!item.isObject() || !item.isMember("TypeId") || !item.isMember("TagId")) { - ChipLogError(AppServer, "AmbientContextType array is empty"); + ChipLogError(AppServer, "AmbientContextType[%u], missing/invalid TypeId/TagId", static_cast(i)); return false; } - for (Json::ArrayIndex i = 0; i < actArray.size(); i++) - { - Json::Value item = actArray[i]; - if (!item.isObject() || !item.isMember("TypeId") || !item.isMember("TagId")) - { - ChipLogError(AppServer, "AmbientContextType[%u], missing/invalid TypeId/TagId", static_cast(i)); - return false; - } - uint8_t typeId = static_cast(item["TypeId"].asUInt()); - uint8_t tagId = static_cast(item["TagId"].asUInt()); - - Globals::Structs::SemanticTagStruct::Type tag = { - .namespaceID = typeId, - .tag = tagId, - }; - semanticTags.push_back(tag); - } - return true; + uint8_t typeId = static_cast(item["TypeId"].asUInt()); + uint8_t tagId = static_cast(item["TagId"].asUInt()); + + Globals::Structs::SemanticTagStruct::Type tag = { + .namespaceID = typeId, + .tag = tagId, + }; + semanticTags.push_back(tag); } + return true; +} +class AddAmbientContextDetectCommandHandler : public AllDevicesAppNamedPipeCommandHandler +{ +public: + const char * GetName() const override { return "AddAmbientContextDetect"; } void Handle(const Json::Value & json, AllDevicesAppCommandDelegate * delegate, EndpointId endpointId) override { auto * cluster = @@ -236,7 +236,7 @@ class AddAmbientContextDetectCommandHandler : public AllDevicesAppNamedPipeComma } std::vector semanticTags; semanticTags.reserve(actArray.size()); - if (!GetAmbientContextType(actArray, semanticTags)) + if (!::GetAmbientContextType(actArray, semanticTags)) { ChipLogError(AppServer, "Incorrect or unsupported detection"); return; @@ -263,33 +263,6 @@ class SetPredictedActivityCommandHandler : public AllDevicesAppNamedPipeCommandH { public: const char * GetName() const override { return "SetPredictedActivity"; } - bool GetAmbientContextType(const Json::Value & actArray, std::vector & semanticTags) - { - // Validate AmbientContextType exists and is an array - if (actArray.empty()) - { - ChipLogError(AppServer, "AmbientContextType array is empty"); - return false; - } - for (Json::ArrayIndex i = 0; i < actArray.size(); i++) - { - Json::Value item = actArray[i]; - if (!item.isObject() || !item.isMember("TypeId") || !item.isMember("TagId")) - { - ChipLogError(AppServer, "AmbientContextType[%u], missing/invalid TypeId/TagId", static_cast(i)); - return false; - } - uint8_t typeId = static_cast(item["TypeId"].asUInt()); - uint8_t tagId = static_cast(item["TagId"].asUInt()); - - Globals::Structs::SemanticTagStruct::Type tag = { - .namespaceID = typeId, - .tag = tagId, - }; - semanticTags.push_back(tag); - } - return true; - } void Handle(const Json::Value & json, AllDevicesAppCommandDelegate * delegate, EndpointId endpointId) override { auto * cluster = @@ -333,8 +306,13 @@ class SetPredictedActivityCommandHandler : public AllDevicesAppNamedPipeCommandH predictAct.endTimestamp = item["EndTStamp"].asUInt(); VerifyOrReturn(predictAct.startTimestamp < predictAct.endTimestamp, ChipLogError(AppServer, "PredictedActivity, incorrect startTime/endTime")); - predictAct.confidence = static_cast(item["Conf"].asUInt()); - + auto confidenceValue = item["Conf"].asUInt(); + if (confidenceValue > 100) + { + ChipLogError(AppServer, "PredictedActivity, incorrect confidence value"); + return; + } + predictAct.confidence = static_cast(confidenceValue); if (item.isMember("CrowdDetect")) { predictAct.crowdDetected.SetValue(static_cast(item["CrowdDetect"].asBool())); @@ -359,7 +337,7 @@ class SetPredictedActivityCommandHandler : public AllDevicesAppNamedPipeCommandH auto & semanticTags = allSemanticTags[i]; semanticTags.clear(); semanticTags.reserve(actArray.size()); - if (!GetAmbientContextType(actArray, semanticTags)) + if (!::GetAmbientContextType(actArray, semanticTags)) { ChipLogError(AppServer, "Incorrect or unsupported detection"); return; From 69825a6cb4acb20ae4cf2a62023b9bc271e3cd86 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 25 Jun 2026 07:08:40 +0000 Subject: [PATCH 4/6] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- examples/all-devices-app/posix/AppCommandDelegate.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/all-devices-app/posix/AppCommandDelegate.cpp b/examples/all-devices-app/posix/AppCommandDelegate.cpp index 1db833eb5283b3..950e116282d37e 100644 --- a/examples/all-devices-app/posix/AppCommandDelegate.cpp +++ b/examples/all-devices-app/posix/AppCommandDelegate.cpp @@ -179,7 +179,8 @@ class SetAmbientContextSupportCommandHandler : public AllDevicesAppNamedPipeComm } }; -static bool GetAmbientContextType(const Json::Value & actArray, std::vector & semanticTags) +static bool GetAmbientContextType(const Json::Value & actArray, + std::vector & semanticTags) { // Validate AmbientContextType exists and is an array if (actArray.empty()) @@ -202,7 +203,7 @@ static bool GetAmbientContextType(const Json::Value & actArray, std::vector Date: Thu, 25 Jun 2026 07:07:49 +0000 Subject: [PATCH 5/6] Restyled by gn --- .../all-devices-common/devices/ambient-context-sensor/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/all-devices-app/all-devices-common/devices/ambient-context-sensor/BUILD.gn b/examples/all-devices-app/all-devices-common/devices/ambient-context-sensor/BUILD.gn index c8322b39ec1fa0..0460dd3a300368 100644 --- a/examples/all-devices-app/all-devices-common/devices/ambient-context-sensor/BUILD.gn +++ b/examples/all-devices-app/all-devices-common/devices/ambient-context-sensor/BUILD.gn @@ -23,8 +23,8 @@ source_set("ambient-context-sensor") { public_deps = [ "${chip_root}/examples/all-devices-app/all-devices-common/devices/interface:single-endpoint-device", - "${chip_root}/src/app/clusters/identify-server", "${chip_root}/src/app/clusters/ambient-context-sensing-server", + "${chip_root}/src/app/clusters/identify-server", "${chip_root}/src/data-model-providers/codedriven", "${chip_root}/src/lib/core:error", "${chip_root}/src/lib/support", From d809827324bae183b9ba2a45faf990307c4913ad Mon Sep 17 00:00:00 2001 From: "Lo,Chin-Ran" Date: Thu, 25 Jun 2026 15:46:22 +0800 Subject: [PATCH 6/6] Add the missing file to .cmake Signed-off-by: Lo,Chin-Ran --- .../all-devices-common/device-factory/enabled_devices.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/all-devices-app/all-devices-common/device-factory/enabled_devices.cmake b/examples/all-devices-app/all-devices-common/device-factory/enabled_devices.cmake index 68836b6876ea80..4eb20a9e182fd2 100644 --- a/examples/all-devices-app/all-devices-common/device-factory/enabled_devices.cmake +++ b/examples/all-devices-app/all-devices-common/device-factory/enabled_devices.cmake @@ -42,6 +42,7 @@ set(ALL_DEVICES_DEVICE_SOURCES "${ALL_DEVICES_COMMON_DIR}/devices/air-purifier/impl/LoggingAirPurifierDevice.cpp" "${ALL_DEVICES_COMMON_DIR}/devices/air-quality-sensor/AirQualitySensorDevice.cpp" "${ALL_DEVICES_COMMON_DIR}/devices/ambient-context-sensor/AmbientContextSensorDevice.cpp" + "${ALL_DEVICES_COMMON_DIR}/devices/ambient-context-sensor/impl/LoggingAmbientContextSensorDevice.cpp" "${ALL_DEVICES_COMMON_DIR}/devices/boolean-state-sensor/BooleanStateSensorDevice.cpp" "${ALL_DEVICES_COMMON_DIR}/devices/bridged-node/BridgedNodeDevice.cpp" "${ALL_DEVICES_COMMON_DIR}/devices/chime/ChimeDevice.cpp"