From 7e53ba43702ddf4f09390c41f4ff3e2ed8e51363 Mon Sep 17 00:00:00 2001 From: Erwin Pan Date: Wed, 6 Dec 2023 01:53:00 +0800 Subject: [PATCH] [Chef] Fix AirQualitySensor to support RPC write (#30822) * Fix AirQualitySensor to support RPC write 1. Support Write Attributes through RPC 2. Support Multiple Endpoints for AirQuality / Concentration Measurement Clusters 3. Fix comformance issues caught by TC_DeviceConformance.py * Restyled by whitespace * Restyled by clang-format * Update ZAP version and fix compilation issues * Restyled by clang-format --------- Co-authored-by: Restyled.io --- examples/chef/common/chef-air-quality.cpp | 52 ++- examples/chef/common/chef-air-quality.h | 30 ++ .../common/chef-concentration-measurement.cpp | 360 ++++++++++++++---- .../common/chef-concentration-measurement.h | 39 ++ examples/chef/common/stubs.cpp | 100 +++++ ...ootnode_airqualitysensor_e63187f6c9.matter | 9 +- .../rootnode_airqualitysensor_e63187f6c9.zap | 62 +-- 7 files changed, 517 insertions(+), 135 deletions(-) create mode 100644 examples/chef/common/chef-air-quality.h create mode 100644 examples/chef/common/chef-concentration-measurement.h diff --git a/examples/chef/common/chef-air-quality.cpp b/examples/chef/common/chef-air-quality.cpp index a9869963b5217a..f74f4ea546753f 100644 --- a/examples/chef/common/chef-air-quality.cpp +++ b/examples/chef/common/chef-air-quality.cpp @@ -19,6 +19,7 @@ #include #include #include +#include using namespace chip; using namespace chip::app; @@ -30,10 +31,57 @@ using namespace chip::app::Clusters::AirQuality; static chip::BitMask airQualityFeatures(Feature::kFair, Feature::kModerate, Feature::kVeryPoor, Feature::kExtremelyPoor); -static Instance gAirQualityClusterInstance = Instance(1, airQualityFeatures); +static std::map gAirQualityClusterInstance{}; void emberAfAirQualityClusterInitCallback(chip::EndpointId endpointId) { - gAirQualityClusterInstance.Init(); + Instance * clusterInstance = new Instance(1, airQualityFeatures); + clusterInstance->Init(); + gAirQualityClusterInstance[1] = clusterInstance; +} + +EmberAfStatus chefAirQualityWriteCallback(EndpointId endpoint, ClusterId clusterId, + const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer) +{ + EmberAfStatus ret = EMBER_ZCL_STATUS_SUCCESS; + + if (gAirQualityClusterInstance.find(endpoint) == gAirQualityClusterInstance.end()) + { + ChipLogError(DeviceLayer, "Invalid Endpoind ID: %d", endpoint); + return EMBER_ZCL_STATUS_UNSUPPORTED_ENDPOINT; + } + + Instance * clusterInstance = gAirQualityClusterInstance[endpoint]; + AttributeId attributeId = attributeMetadata->attributeId; + + switch (attributeId) + { + case chip::app::Clusters::AirQuality::Attributes::AirQuality::Id: { + AirQualityEnum m = static_cast(buffer[0]); + Protocols::InteractionModel::Status status = clusterInstance->UpdateAirQuality(m); + if (Protocols::InteractionModel::Status::Success == status) + { + break; + } + ret = EMBER_ZCL_STATUS_UNSUPPORTED_WRITE; + ChipLogError(DeviceLayer, "Invalid Attribute Update status: %d", static_cast(status)); + } + break; + default: + ret = EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE; + ChipLogError(DeviceLayer, "Unsupported Attribute ID: %d", static_cast(attributeId)); + break; + } + + return ret; +} + +EmberAfStatus chefAirQualityReadCallback(EndpointId endpoint, ClusterId clusterId, + const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer, + uint16_t maxReadLength) +{ + EmberAfStatus ret = EMBER_ZCL_STATUS_SUCCESS; + + return ret; } #endif diff --git a/examples/chef/common/chef-air-quality.h b/examples/chef/common/chef-air-quality.h new file mode 100644 index 00000000000000..0749d4d1afe662 --- /dev/null +++ b/examples/chef/common/chef-air-quality.h @@ -0,0 +1,30 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include +#include +#include +#include +#include +#include + +#ifdef EMBER_AF_PLUGIN_AIR_QUALITY_SERVER +EmberAfStatus chefAirQualityWriteCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, + const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer); +EmberAfStatus chefAirQualityReadCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, + const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer, + uint16_t maxReadLength); +#endif diff --git a/examples/chef/common/chef-concentration-measurement.cpp b/examples/chef/common/chef-concentration-measurement.cpp index b769013288eb4c..90c6f85d3b99d1 100644 --- a/examples/chef/common/chef-concentration-measurement.cpp +++ b/examples/chef/common/chef-concentration-measurement.cpp @@ -19,9 +19,12 @@ #include #include #include +#include +#include using namespace chip; using namespace chip::app; +using namespace chip::app::DataModel; using namespace chip::app::Clusters; #if defined(EMBER_AF_PLUGIN_CARBON_MONOXIDE_CONCENTRATION_MEASUREMENT_SERVER) || \ @@ -36,125 +39,330 @@ using namespace chip::app::Clusters; defined(EMBER_AF_PLUGIN_RADON_CONCENTRATION_MEASUREMENT_SERVER) #include using namespace chip::app::Clusters::ConcentrationMeasurement; -#endif -#ifdef EMBER_AF_PLUGIN_CARBON_DIOXIDE_CONCENTRATION_MEASUREMENT_SERVER -static Instance gCarbonDioxideConcentrationMeasurementInstance = - CreateNumericMeasurementAndLevelIndicationConcentrationCluster( - EndpointId(1), CarbonDioxideConcentrationMeasurement::Id, MeasurementMediumEnum::kAir, MeasurementUnitEnum::kPpm); +static std::map *> gCarbonMonoxideConcentrationMeasurementInstance{}; +static std::map *> gCarbonDioxideConcentrationMeasurementInstance{}; -void emberAfCarbonDioxideConcentrationMeasurementClusterInitCallback(EndpointId endpoint) +static std::map *> gNitrogenDioxideConcentrationMeasurementInstance{}; +static std::map *> gOzoneConcentrationMeasurementInstance{}; +static std::map *> gPm25ConcentrationMeasurementInstance{}; +static std::map *> gFormaldehydeConcentrationMeasurementInstance{}; +static std::map *> gPm1ConcentrationMeasurementInstance{}; +static std::map *> gPm10ConcentrationMeasurementInstance{}; +static std::map *> gRadonConcentrationMeasurementInstance{}; +static std::map *> + gTotalVolatileOrganicCompoundsConcentrationMeasurementInstance{}; + +template +EmberAfStatus chefConcentrationMeasurementWriteCallback( + std::map *> & map, + AttributeId measuredValueId, chip::EndpointId endpoint, chip::ClusterId clusterId, + const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer) +{ + EmberAfStatus ret = EMBER_ZCL_STATUS_SUCCESS; + + if (map.find(endpoint) == map.end()) + { + ChipLogError(DeviceLayer, "Invalid Endpoind ID: %d", endpoint); + return EMBER_ZCL_STATUS_UNSUPPORTED_ENDPOINT; + } + + Instance * clusterInstance = map[endpoint]; + AttributeId attributeId = attributeMetadata->attributeId; + + if (attributeId == measuredValueId) + { + float newValue = 0; + uint16_t tlvLen = *(uint16_t *) buffer; + chip::TLV::TLVReader reader; + reader.Init(buffer + sizeof(uint16_t), tlvLen); + reader.Next(); + reader.Get(newValue); + + ChipLogDetail(DeviceLayer, "TLV Type %d, Length %d \n", static_cast(reader.GetType()), tlvLen); + // 2 bytes buf length + 5 bytes TLV for float + ChipLogDetail(DeviceLayer, "buffer: %02x%02x%02x%02x%02x%02x%02x \n", buffer[0], buffer[1], buffer[2], buffer[3], buffer[4], + buffer[5], buffer[6]); + + CHIP_ERROR err = clusterInstance->SetMeasuredValue(MakeNullable(newValue)); + if (CHIP_NO_ERROR == err) + { + ChipLogDetail(DeviceLayer, "Updated EP:%d, Cluster: 0x%04x to MeasuredValue: %f", endpoint, clusterId, newValue); + } + else + { + ret = EMBER_ZCL_STATUS_UNSUPPORTED_WRITE; + ChipLogError(DeviceLayer, "Invalid Attribute Update status: %" CHIP_ERROR_FORMAT, err.Format()); + } + } + else + { + ret = EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE; + ChipLogError(DeviceLayer, "Unsupported Attribute ID: %d", static_cast(attributeId)); + } + + return ret; +} + +EmberAfStatus chefConcentrationMeasurementWriteCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, + const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer) { - VerifyOrDie(1 == endpoint); - gCarbonDioxideConcentrationMeasurementInstance.Init(); + EmberAfStatus ret = EMBER_ZCL_STATUS_SUCCESS; + + switch (clusterId) + { + case Clusters::CarbonMonoxideConcentrationMeasurement::Id: + ret = chefConcentrationMeasurementWriteCallback( + gCarbonMonoxideConcentrationMeasurementInstance, CarbonMonoxideConcentrationMeasurement::Attributes::MeasuredValue::Id, + endpoint, clusterId, attributeMetadata, buffer); + break; + case Clusters::CarbonDioxideConcentrationMeasurement::Id: + ret = chefConcentrationMeasurementWriteCallback( + gCarbonDioxideConcentrationMeasurementInstance, CarbonDioxideConcentrationMeasurement::Attributes::MeasuredValue::Id, + endpoint, clusterId, attributeMetadata, buffer); + break; + case Clusters::NitrogenDioxideConcentrationMeasurement::Id: + ret = chefConcentrationMeasurementWriteCallback( + gNitrogenDioxideConcentrationMeasurementInstance, + NitrogenDioxideConcentrationMeasurement::Attributes::MeasuredValue::Id, endpoint, clusterId, attributeMetadata, buffer); + break; + case Clusters::OzoneConcentrationMeasurement::Id: + ret = chefConcentrationMeasurementWriteCallback( + gOzoneConcentrationMeasurementInstance, OzoneConcentrationMeasurement::Attributes::MeasuredValue::Id, endpoint, + clusterId, attributeMetadata, buffer); + break; + case Clusters::Pm25ConcentrationMeasurement::Id: + ret = chefConcentrationMeasurementWriteCallback( + gPm25ConcentrationMeasurementInstance, Pm25ConcentrationMeasurement::Attributes::MeasuredValue::Id, endpoint, clusterId, + attributeMetadata, buffer); + break; + case Clusters::FormaldehydeConcentrationMeasurement::Id: + ret = chefConcentrationMeasurementWriteCallback( + gFormaldehydeConcentrationMeasurementInstance, FormaldehydeConcentrationMeasurement::Attributes::MeasuredValue::Id, + endpoint, clusterId, attributeMetadata, buffer); + break; + case Clusters::Pm1ConcentrationMeasurement::Id: + ret = chefConcentrationMeasurementWriteCallback( + gPm1ConcentrationMeasurementInstance, Pm1ConcentrationMeasurement::Attributes::MeasuredValue::Id, endpoint, clusterId, + attributeMetadata, buffer); + break; + case Clusters::Pm10ConcentrationMeasurement::Id: + ret = chefConcentrationMeasurementWriteCallback( + gPm10ConcentrationMeasurementInstance, Pm10ConcentrationMeasurement::Attributes::MeasuredValue::Id, endpoint, clusterId, + attributeMetadata, buffer); + break; + case Clusters::RadonConcentrationMeasurement::Id: + ret = chefConcentrationMeasurementWriteCallback( + gRadonConcentrationMeasurementInstance, RadonConcentrationMeasurement::Attributes::MeasuredValue::Id, endpoint, + clusterId, attributeMetadata, buffer); + break; + case Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::Id: + ret = chefConcentrationMeasurementWriteCallback( + gTotalVolatileOrganicCompoundsConcentrationMeasurementInstance, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::MeasuredValue::Id, endpoint, clusterId, + attributeMetadata, buffer); + break; + + default: + break; + } + + return ret; +} + +EmberAfStatus chefConcentrationMeasurementReadCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, + const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer, + uint16_t maxReadLength) +{ + EmberAfStatus ret = EMBER_ZCL_STATUS_SUCCESS; + + return ret; } #endif #ifdef EMBER_AF_PLUGIN_CARBON_MONOXIDE_CONCENTRATION_MEASUREMENT_SERVER -static Instance gCarbonMonoxideConcentrationMeasurementInstance = - CreateNumericMeasurementAndLevelIndicationConcentrationCluster( - EndpointId(1), CarbonMonoxideConcentrationMeasurement::Id, MeasurementMediumEnum::kAir, MeasurementUnitEnum::kPpm); - void emberAfCarbonMonoxideConcentrationMeasurementClusterInitCallback(EndpointId endpoint) { - VerifyOrDie(1 == endpoint); - gCarbonMonoxideConcentrationMeasurementInstance.Init(); + gCarbonMonoxideConcentrationMeasurementInstance[EndpointId(endpoint)] = new Instance( + EndpointId(endpoint), CarbonMonoxideConcentrationMeasurement::Id, MeasurementMediumEnum::kAir, MeasurementUnitEnum::kPpb); + gCarbonMonoxideConcentrationMeasurementInstance[EndpointId(endpoint)]->Init(); + gCarbonMonoxideConcentrationMeasurementInstance[EndpointId(endpoint)]->SetMeasuredValue(MakeNullable(401.0f)); + gCarbonMonoxideConcentrationMeasurementInstance[EndpointId(endpoint)]->SetMinMeasuredValue(MakeNullable(50.0f)); + gCarbonMonoxideConcentrationMeasurementInstance[EndpointId(endpoint)]->SetMaxMeasuredValue(MakeNullable(1500.0f)); + gCarbonMonoxideConcentrationMeasurementInstance[EndpointId(endpoint)]->SetPeakMeasuredValue(MakeNullable(511.0f)); + gCarbonMonoxideConcentrationMeasurementInstance[EndpointId(endpoint)]->SetPeakMeasuredValueWindow(3600); + gCarbonMonoxideConcentrationMeasurementInstance[EndpointId(endpoint)]->SetAverageMeasuredValue(MakeNullable(213.0f)); + gCarbonMonoxideConcentrationMeasurementInstance[EndpointId(endpoint)]->SetAverageMeasuredValueWindow(3600); + gCarbonMonoxideConcentrationMeasurementInstance[EndpointId(endpoint)]->SetUncertainty(10.0f); + gCarbonMonoxideConcentrationMeasurementInstance[EndpointId(endpoint)]->SetLevelValue(LevelValueEnum::kHigh); } #endif -#ifdef EMBER_AF_PLUGIN_NITROGEN_DIOXIDE_CONCENTRATION_MEASUREMENT_SERVER -static Instance gNitrogenDioxideConcentrationMeasurementInstance = - CreateNumericMeasurementAndLevelIndicationConcentrationCluster( - EndpointId(1), NitrogenDioxideConcentrationMeasurement::Id, MeasurementMediumEnum::kAir, MeasurementUnitEnum::kPpm); - -void emberAfNitrogenDioxideConcentrationMeasurementClusterInitCallback(EndpointId endpoint) +#ifdef EMBER_AF_PLUGIN_CARBON_DIOXIDE_CONCENTRATION_MEASUREMENT_SERVER +void emberAfCarbonDioxideConcentrationMeasurementClusterInitCallback(EndpointId endpoint) { - VerifyOrDie(1 == endpoint); - gNitrogenDioxideConcentrationMeasurementInstance.Init(); + gCarbonDioxideConcentrationMeasurementInstance[EndpointId(endpoint)] = new Instance( + EndpointId(endpoint), CarbonDioxideConcentrationMeasurement::Id, MeasurementMediumEnum::kAir, MeasurementUnitEnum::kPpm); + gCarbonDioxideConcentrationMeasurementInstance[EndpointId(endpoint)]->Init(); + gCarbonDioxideConcentrationMeasurementInstance[EndpointId(endpoint)]->SetMeasuredValue(MakeNullable(458.0f)); + gCarbonDioxideConcentrationMeasurementInstance[EndpointId(endpoint)]->SetMinMeasuredValue(MakeNullable(300.0f)); + gCarbonDioxideConcentrationMeasurementInstance[EndpointId(endpoint)]->SetMaxMeasuredValue(MakeNullable(2000.0f)); + gCarbonDioxideConcentrationMeasurementInstance[EndpointId(endpoint)]->SetPeakMeasuredValue(MakeNullable(523.0f)); + gCarbonDioxideConcentrationMeasurementInstance[EndpointId(endpoint)]->SetPeakMeasuredValueWindow(3600); + gCarbonDioxideConcentrationMeasurementInstance[EndpointId(endpoint)]->SetAverageMeasuredValue(MakeNullable(421.0f)); + gCarbonDioxideConcentrationMeasurementInstance[EndpointId(endpoint)]->SetAverageMeasuredValueWindow(3600); + gCarbonDioxideConcentrationMeasurementInstance[EndpointId(endpoint)]->SetUncertainty(5.0f); + gCarbonDioxideConcentrationMeasurementInstance[EndpointId(endpoint)]->SetLevelValue(LevelValueEnum::kLow); } #endif -#ifdef EMBER_AF_PLUGIN_PM1_CONCENTRATION_MEASUREMENT_SERVER -static Instance gPm1ConcentrationMeasurementInstance = - CreateNumericMeasurementAndLevelIndicationConcentrationCluster( - EndpointId(1), Pm1ConcentrationMeasurement::Id, MeasurementMediumEnum::kAir, MeasurementUnitEnum::kPpm); - -void emberAfPm1ConcentrationMeasurementClusterInitCallback(EndpointId endpoint) +#ifdef EMBER_AF_PLUGIN_NITROGEN_DIOXIDE_CONCENTRATION_MEASUREMENT_SERVER +void emberAfNitrogenDioxideConcentrationMeasurementClusterInitCallback(EndpointId endpoint) { - VerifyOrDie(1 == endpoint); - gPm1ConcentrationMeasurementInstance.Init(); + gNitrogenDioxideConcentrationMeasurementInstance[EndpointId(endpoint)] = new Instance( + EndpointId(endpoint), NitrogenDioxideConcentrationMeasurement::Id, MeasurementMediumEnum::kAir, MeasurementUnitEnum::kPpb); + gNitrogenDioxideConcentrationMeasurementInstance[EndpointId(endpoint)]->Init(); + gNitrogenDioxideConcentrationMeasurementInstance[EndpointId(endpoint)]->SetMeasuredValue(MakeNullable(3.0f)); + gNitrogenDioxideConcentrationMeasurementInstance[EndpointId(endpoint)]->SetMinMeasuredValue(MakeNullable(1.0f)); + gNitrogenDioxideConcentrationMeasurementInstance[EndpointId(endpoint)]->SetMaxMeasuredValue(MakeNullable(150.0f)); + gNitrogenDioxideConcentrationMeasurementInstance[EndpointId(endpoint)]->SetPeakMeasuredValue(MakeNullable(3.0f)); + gNitrogenDioxideConcentrationMeasurementInstance[EndpointId(endpoint)]->SetPeakMeasuredValueWindow(120); + gNitrogenDioxideConcentrationMeasurementInstance[EndpointId(endpoint)]->SetAverageMeasuredValue(MakeNullable(3.0f)); + gNitrogenDioxideConcentrationMeasurementInstance[EndpointId(endpoint)]->SetAverageMeasuredValueWindow(120); + gNitrogenDioxideConcentrationMeasurementInstance[EndpointId(endpoint)]->SetUncertainty(1.0f); + gNitrogenDioxideConcentrationMeasurementInstance[EndpointId(endpoint)]->SetLevelValue(LevelValueEnum::kLow); } #endif -#ifdef EMBER_AF_PLUGIN_PM10_CONCENTRATION_MEASUREMENT_SERVER -static Instance gPm10ConcentrationMeasurementInstance = - CreateNumericMeasurementAndLevelIndicationConcentrationCluster( - EndpointId(1), Pm10ConcentrationMeasurement::Id, MeasurementMediumEnum::kAir, MeasurementUnitEnum::kPpm); - -void emberAfPm10ConcentrationMeasurementClusterInitCallback(EndpointId endpoint) +#ifdef EMBER_AF_PLUGIN_OZONE_CONCENTRATION_MEASUREMENT_SERVER +void emberAfOzoneConcentrationMeasurementClusterInitCallback(EndpointId endpoint) { - VerifyOrDie(1 == endpoint); - gPm10ConcentrationMeasurementInstance.Init(); + gOzoneConcentrationMeasurementInstance[EndpointId(endpoint)] = new Instance( + EndpointId(endpoint), OzoneConcentrationMeasurement::Id, MeasurementMediumEnum::kAir, MeasurementUnitEnum::kPpm); + gOzoneConcentrationMeasurementInstance[EndpointId(endpoint)]->Init(); + gOzoneConcentrationMeasurementInstance[EndpointId(endpoint)]->SetMeasuredValue(MakeNullable(10.0f)); + gOzoneConcentrationMeasurementInstance[EndpointId(endpoint)]->SetMinMeasuredValue(MakeNullable(3.0f)); + gOzoneConcentrationMeasurementInstance[EndpointId(endpoint)]->SetMaxMeasuredValue(MakeNullable(300.0f)); + gOzoneConcentrationMeasurementInstance[EndpointId(endpoint)]->SetPeakMeasuredValue(MakeNullable(50.0f)); + gOzoneConcentrationMeasurementInstance[EndpointId(endpoint)]->SetPeakMeasuredValueWindow(3600); + gOzoneConcentrationMeasurementInstance[EndpointId(endpoint)]->SetAverageMeasuredValue(MakeNullable(20.0f)); + gOzoneConcentrationMeasurementInstance[EndpointId(endpoint)]->SetAverageMeasuredValueWindow(3600); + gOzoneConcentrationMeasurementInstance[EndpointId(endpoint)]->SetUncertainty(0.0f); + gOzoneConcentrationMeasurementInstance[EndpointId(endpoint)]->SetLevelValue(LevelValueEnum::kLow); } #endif #ifdef EMBER_AF_PLUGIN_PM2__5_CONCENTRATION_MEASUREMENT_SERVER -static Instance gPm25ConcentrationMeasurementInstance = - CreateNumericMeasurementAndLevelIndicationConcentrationCluster( - EndpointId(1), Pm25ConcentrationMeasurement::Id, MeasurementMediumEnum::kAir, MeasurementUnitEnum::kPpm); - void emberAfPm25ConcentrationMeasurementClusterInitCallback(EndpointId endpoint) { - VerifyOrDie(1 == endpoint); - gPm25ConcentrationMeasurementInstance.Init(); + gPm25ConcentrationMeasurementInstance[EndpointId(endpoint)] = new Instance( + EndpointId(endpoint), Pm25ConcentrationMeasurement::Id, MeasurementMediumEnum::kAir, MeasurementUnitEnum::kUgm3); + gPm25ConcentrationMeasurementInstance[EndpointId(endpoint)]->Init(); + gPm25ConcentrationMeasurementInstance[EndpointId(endpoint)]->SetMeasuredValue(MakeNullable(42.0f)); + gPm25ConcentrationMeasurementInstance[EndpointId(endpoint)]->SetMinMeasuredValue(MakeNullable(1.0f)); + gPm25ConcentrationMeasurementInstance[EndpointId(endpoint)]->SetMaxMeasuredValue(MakeNullable(400.0f)); + gPm25ConcentrationMeasurementInstance[EndpointId(endpoint)]->SetPeakMeasuredValue(MakeNullable(90.0f)); + gPm25ConcentrationMeasurementInstance[EndpointId(endpoint)]->SetPeakMeasuredValueWindow(3600); + gPm25ConcentrationMeasurementInstance[EndpointId(endpoint)]->SetAverageMeasuredValue(MakeNullable(35.0f)); + gPm25ConcentrationMeasurementInstance[EndpointId(endpoint)]->SetAverageMeasuredValueWindow(3600); + gPm25ConcentrationMeasurementInstance[EndpointId(endpoint)]->SetUncertainty(4.0f); + gPm25ConcentrationMeasurementInstance[EndpointId(endpoint)]->SetLevelValue(LevelValueEnum::kMedium); } #endif -#ifdef EMBER_AF_PLUGIN_RADON_CONCENTRATION_MEASUREMENT_SERVER -static Instance gRadonConcentrationMeasurementInstance = - CreateNumericMeasurementAndLevelIndicationConcentrationCluster( - EndpointId(1), RadonConcentrationMeasurement::Id, MeasurementMediumEnum::kAir, MeasurementUnitEnum::kPpm); - -void emberAfRadonConcentrationMeasurementClusterInitCallback(EndpointId endpoint) +#ifdef EMBER_AF_PLUGIN_FORMALDEHYDE_CONCENTRATION_MEASUREMENT_SERVER +void emberAfFormaldehydeConcentrationMeasurementClusterInitCallback(EndpointId endpoint) { - VerifyOrDie(1 == endpoint); - gRadonConcentrationMeasurementInstance.Init(); + gFormaldehydeConcentrationMeasurementInstance[EndpointId(endpoint)] = new Instance( + EndpointId(endpoint), FormaldehydeConcentrationMeasurement::Id, MeasurementMediumEnum::kAir, MeasurementUnitEnum::kMgm3); + gFormaldehydeConcentrationMeasurementInstance[EndpointId(endpoint)]->Init(); + gFormaldehydeConcentrationMeasurementInstance[EndpointId(endpoint)]->SetMeasuredValue(MakeNullable(10.0f)); + gFormaldehydeConcentrationMeasurementInstance[EndpointId(endpoint)]->SetMinMeasuredValue(MakeNullable(0.0f)); + gFormaldehydeConcentrationMeasurementInstance[EndpointId(endpoint)]->SetMaxMeasuredValue(MakeNullable(200.0f)); + gFormaldehydeConcentrationMeasurementInstance[EndpointId(endpoint)]->SetPeakMeasuredValue(MakeNullable(10.0f)); + gFormaldehydeConcentrationMeasurementInstance[EndpointId(endpoint)]->SetPeakMeasuredValueWindow(7200); + gFormaldehydeConcentrationMeasurementInstance[EndpointId(endpoint)]->SetAverageMeasuredValue(MakeNullable(2.0f)); + gFormaldehydeConcentrationMeasurementInstance[EndpointId(endpoint)]->SetAverageMeasuredValueWindow(7200); + gFormaldehydeConcentrationMeasurementInstance[EndpointId(endpoint)]->SetUncertainty(0.0f); + gFormaldehydeConcentrationMeasurementInstance[EndpointId(endpoint)]->SetLevelValue(LevelValueEnum::kMedium); } #endif -#ifdef EMBER_AF_PLUGIN_TOTAL_VOLATILE_ORGANIC_COMPOUNDS_CONCENTRATION_MEASUREMENT_SERVER -static Instance gTotalVolatileOrganicCompoundsConcentrationMeasurementInstance = - CreateNumericMeasurementAndLevelIndicationConcentrationCluster( - EndpointId(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, MeasurementMediumEnum::kAir, - MeasurementUnitEnum::kPpm); - -void emberAfTotalVolatileOrganicCompoundsConcentrationMeasurementClusterInitCallback(EndpointId endpoint) +#ifdef EMBER_AF_PLUGIN_PM1_CONCENTRATION_MEASUREMENT_SERVER +void emberAfPm1ConcentrationMeasurementClusterInitCallback(EndpointId endpoint) { - VerifyOrDie(1 == endpoint); - gTotalVolatileOrganicCompoundsConcentrationMeasurementInstance.Init(); + gPm1ConcentrationMeasurementInstance[EndpointId(endpoint)] = new Instance( + EndpointId(endpoint), Pm1ConcentrationMeasurement::Id, MeasurementMediumEnum::kAir, MeasurementUnitEnum::kUgm3); + gPm1ConcentrationMeasurementInstance[EndpointId(endpoint)]->Init(); + gPm1ConcentrationMeasurementInstance[EndpointId(endpoint)]->SetMeasuredValue(MakeNullable(39.0f)); + gPm1ConcentrationMeasurementInstance[EndpointId(endpoint)]->SetMinMeasuredValue(MakeNullable(1.0f)); + gPm1ConcentrationMeasurementInstance[EndpointId(endpoint)]->SetMaxMeasuredValue(MakeNullable(400.0f)); + gPm1ConcentrationMeasurementInstance[EndpointId(endpoint)]->SetPeakMeasuredValue(MakeNullable(70.0f)); + gPm1ConcentrationMeasurementInstance[EndpointId(endpoint)]->SetPeakMeasuredValueWindow(3600); + gPm1ConcentrationMeasurementInstance[EndpointId(endpoint)]->SetAverageMeasuredValue(MakeNullable(41.0f)); + gPm1ConcentrationMeasurementInstance[EndpointId(endpoint)]->SetAverageMeasuredValueWindow(3600); + gPm1ConcentrationMeasurementInstance[EndpointId(endpoint)]->SetUncertainty(4.0f); + gPm1ConcentrationMeasurementInstance[EndpointId(endpoint)]->SetLevelValue(LevelValueEnum::kLow); } #endif -#ifdef EMBER_AF_PLUGIN_OZONE_CONCENTRATION_MEASUREMENT_SERVER -static Instance gOzoneConcentrationMeasurementInstance = - CreateNumericMeasurementAndLevelIndicationConcentrationCluster( - EndpointId(1), OzoneConcentrationMeasurement::Id, MeasurementMediumEnum::kAir, MeasurementUnitEnum::kPpm); - -void emberAfOzoneConcentrationMeasurementClusterInitCallback(EndpointId endpoint) +#ifdef EMBER_AF_PLUGIN_PM10_CONCENTRATION_MEASUREMENT_SERVER +void emberAfPm10ConcentrationMeasurementClusterInitCallback(EndpointId endpoint) { - VerifyOrDie(1 == endpoint); - gOzoneConcentrationMeasurementInstance.Init(); + gPm10ConcentrationMeasurementInstance[EndpointId(endpoint)] = new Instance( + EndpointId(endpoint), Pm10ConcentrationMeasurement::Id, MeasurementMediumEnum::kAir, MeasurementUnitEnum::kPpt); + gPm10ConcentrationMeasurementInstance[EndpointId(endpoint)]->Init(); + gPm10ConcentrationMeasurementInstance[EndpointId(endpoint)]->SetMeasuredValue(MakeNullable(7.0f)); + gPm10ConcentrationMeasurementInstance[EndpointId(endpoint)]->SetMinMeasuredValue(MakeNullable(2.0f)); + gPm10ConcentrationMeasurementInstance[EndpointId(endpoint)]->SetMaxMeasuredValue(MakeNullable(400.0f)); + gPm10ConcentrationMeasurementInstance[EndpointId(endpoint)]->SetPeakMeasuredValue(MakeNullable(49.0f)); + gPm10ConcentrationMeasurementInstance[EndpointId(endpoint)]->SetPeakMeasuredValueWindow(3600); + gPm10ConcentrationMeasurementInstance[EndpointId(endpoint)]->SetAverageMeasuredValue(MakeNullable(43.0f)); + gPm10ConcentrationMeasurementInstance[EndpointId(endpoint)]->SetAverageMeasuredValueWindow(3600); + gPm10ConcentrationMeasurementInstance[EndpointId(endpoint)]->SetUncertainty(10.0f); + gPm10ConcentrationMeasurementInstance[EndpointId(endpoint)]->SetLevelValue(LevelValueEnum::kLow); } #endif -#ifdef EMBER_AF_PLUGIN_FORMALDEHYDE_CONCENTRATION_MEASUREMENT_SERVER -static Instance gFormaldehydeConcentrationMeasurementInstance = - CreateNumericMeasurementAndLevelIndicationConcentrationCluster( - EndpointId(1), FormaldehydeConcentrationMeasurement::Id, MeasurementMediumEnum::kAir, MeasurementUnitEnum::kPpm); +#ifdef EMBER_AF_PLUGIN_RADON_CONCENTRATION_MEASUREMENT_SERVER +void emberAfRadonConcentrationMeasurementClusterInitCallback(EndpointId endpoint) +{ + gRadonConcentrationMeasurementInstance[EndpointId(endpoint)] = new Instance( + EndpointId(endpoint), RadonConcentrationMeasurement::Id, MeasurementMediumEnum::kAir, MeasurementUnitEnum::kPpm); + gRadonConcentrationMeasurementInstance[EndpointId(endpoint)]->Init(); + gRadonConcentrationMeasurementInstance[EndpointId(endpoint)]->SetMeasuredValue(MakeNullable(10.0f)); + gRadonConcentrationMeasurementInstance[EndpointId(endpoint)]->SetMinMeasuredValue(MakeNullable(5.0f)); + gRadonConcentrationMeasurementInstance[EndpointId(endpoint)]->SetMaxMeasuredValue(MakeNullable(100.0f)); + gRadonConcentrationMeasurementInstance[EndpointId(endpoint)]->SetPeakMeasuredValue(MakeNullable(36.0f)); + gRadonConcentrationMeasurementInstance[EndpointId(endpoint)]->SetPeakMeasuredValueWindow(3600); + gRadonConcentrationMeasurementInstance[EndpointId(endpoint)]->SetAverageMeasuredValue(MakeNullable(20.0f)); + gRadonConcentrationMeasurementInstance[EndpointId(endpoint)]->SetAverageMeasuredValueWindow(3600); + gRadonConcentrationMeasurementInstance[EndpointId(endpoint)]->SetUncertainty(0.0f); + gRadonConcentrationMeasurementInstance[EndpointId(endpoint)]->SetLevelValue(LevelValueEnum::kHigh); +} +#endif -void emberAfFormaldehydeConcentrationMeasurementClusterInitCallback(EndpointId endpoint) +#ifdef EMBER_AF_PLUGIN_TOTAL_VOLATILE_ORGANIC_COMPOUNDS_CONCENTRATION_MEASUREMENT_SERVER +void emberAfTotalVolatileOrganicCompoundsConcentrationMeasurementClusterInitCallback(EndpointId endpoint) { - VerifyOrDie(1 == endpoint); - gFormaldehydeConcentrationMeasurementInstance.Init(); + gTotalVolatileOrganicCompoundsConcentrationMeasurementInstance[EndpointId(endpoint)] = + new Instance(EndpointId(endpoint), + TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + MeasurementMediumEnum::kAir, MeasurementUnitEnum::kPpb); + gTotalVolatileOrganicCompoundsConcentrationMeasurementInstance[EndpointId(endpoint)]->Init(); + gTotalVolatileOrganicCompoundsConcentrationMeasurementInstance[EndpointId(endpoint)]->SetMeasuredValue(MakeNullable(5.0f)); + gTotalVolatileOrganicCompoundsConcentrationMeasurementInstance[EndpointId(endpoint)]->SetMinMeasuredValue(MakeNullable(1.0f)); + gTotalVolatileOrganicCompoundsConcentrationMeasurementInstance[EndpointId(endpoint)]->SetMaxMeasuredValue(MakeNullable(100.0f)); + gTotalVolatileOrganicCompoundsConcentrationMeasurementInstance[EndpointId(endpoint)]->SetPeakMeasuredValue(MakeNullable(8.0f)); + gTotalVolatileOrganicCompoundsConcentrationMeasurementInstance[EndpointId(endpoint)]->SetPeakMeasuredValueWindow(3600); + gTotalVolatileOrganicCompoundsConcentrationMeasurementInstance[EndpointId(endpoint)]->SetAverageMeasuredValue( + MakeNullable(2.0f)); + gTotalVolatileOrganicCompoundsConcentrationMeasurementInstance[EndpointId(endpoint)]->SetAverageMeasuredValueWindow(3600); + gTotalVolatileOrganicCompoundsConcentrationMeasurementInstance[EndpointId(endpoint)]->SetUncertainty(1.0f); + gTotalVolatileOrganicCompoundsConcentrationMeasurementInstance[EndpointId(endpoint)]->SetLevelValue(LevelValueEnum::kLow); } #endif diff --git a/examples/chef/common/chef-concentration-measurement.h b/examples/chef/common/chef-concentration-measurement.h new file mode 100644 index 00000000000000..ea874314814f22 --- /dev/null +++ b/examples/chef/common/chef-concentration-measurement.h @@ -0,0 +1,39 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include +#include +#include +#include +#include +#include + +#if defined(EMBER_AF_PLUGIN_CARBON_MONOXIDE_CONCENTRATION_MEASUREMENT_SERVER) || \ + defined(EMBER_AF_PLUGIN_CARBON_DIOXIDE_CONCENTRATION_MEASUREMENT_SERVER) || \ + defined(EMBER_AF_PLUGIN_NITROGEN_DIOXIDE_CONCENTRATION_MEASUREMENT_SERVER) || \ + defined(EMBER_AF_PLUGIN_OZONE_CONCENTRATION_MEASUREMENT_SERVER) || \ + defined(EMBER_AF_PLUGIN_PM2__5_CONCENTRATION_MEASUREMENT_SERVER) || \ + defined(EMBER_AF_PLUGIN_FORMALDEHYDE_CONCENTRATION_MEASUREMENT_SERVER) || \ + defined(EMBER_AF_PLUGIN_PM1_CONCENTRATION_MEASUREMENT_SERVER) || \ + defined(EMBER_AF_PLUGIN_PM10_CONCENTRATION_MEASUREMENT_SERVER) || \ + defined(EMBER_AF_PLUGIN_TOTAL_VOLATILE_ORGANIC_COMPOUNDS_CONCENTRATION_MEASUREMENT_SERVER) || \ + defined(EMBER_AF_PLUGIN_RADON_CONCENTRATION_MEASUREMENT_SERVER) +EmberAfStatus chefConcentrationMeasurementWriteCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, + const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer); +EmberAfStatus chefConcentrationMeasurementReadCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, + const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer, + uint16_t maxReadLength); +#endif diff --git a/examples/chef/common/stubs.cpp b/examples/chef/common/stubs.cpp index b5878496182a0b..bfd5e370cba136 100644 --- a/examples/chef/common/stubs.cpp +++ b/examples/chef/common/stubs.cpp @@ -3,11 +3,111 @@ #include #include #include +#ifdef EMBER_AF_PLUGIN_AIR_QUALITY_SERVER +#include "chef-air-quality.h" +#endif // EMBER_AF_PLUGIN_AIR_QUALITY_SERVER +#if defined(EMBER_AF_PLUGIN_CARBON_MONOXIDE_CONCENTRATION_MEASUREMENT_SERVER) || \ + defined(EMBER_AF_PLUGIN_CARBON_DIOXIDE_CONCENTRATION_MEASUREMENT_SERVER) || \ + defined(EMBER_AF_PLUGIN_NITROGEN_DIOXIDE_CONCENTRATION_MEASUREMENT_SERVER) || \ + defined(EMBER_AF_PLUGIN_OZONE_CONCENTRATION_MEASUREMENT_SERVER) || \ + defined(EMBER_AF_PLUGIN_PM2__5_CONCENTRATION_MEASUREMENT_SERVER) || \ + defined(EMBER_AF_PLUGIN_FORMALDEHYDE_CONCENTRATION_MEASUREMENT_SERVER) || \ + defined(EMBER_AF_PLUGIN_PM1_CONCENTRATION_MEASUREMENT_SERVER) || \ + defined(EMBER_AF_PLUGIN_PM10_CONCENTRATION_MEASUREMENT_SERVER) || \ + defined(EMBER_AF_PLUGIN_TOTAL_VOLATILE_ORGANIC_COMPOUNDS_CONCENTRATION_MEASUREMENT_SERVER) || \ + defined(EMBER_AF_PLUGIN_RADON_CONCENTRATION_MEASUREMENT_SERVER) +#include "chef-concentration-measurement.h" +#endif using chip::app::DataModel::Nullable; using namespace chip; +EmberAfStatus emberAfExternalAttributeReadCallback(EndpointId endpoint, ClusterId clusterId, + const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer, + uint16_t maxReadLength) +{ + switch (clusterId) + { +#ifdef EMBER_AF_PLUGIN_AIR_QUALITY_SERVER + case chip::app::Clusters::AirQuality::Id: + return chefAirQualityReadCallback(endpoint, clusterId, attributeMetadata, buffer, maxReadLength); +#endif +#if defined(EMBER_AF_PLUGIN_CARBON_MONOXIDE_CONCENTRATION_MEASUREMENT_SERVER) || \ + defined(EMBER_AF_PLUGIN_CARBON_DIOXIDE_CONCENTRATION_MEASUREMENT_SERVER) || \ + defined(EMBER_AF_PLUGIN_NITROGEN_DIOXIDE_CONCENTRATION_MEASUREMENT_SERVER) || \ + defined(EMBER_AF_PLUGIN_OZONE_CONCENTRATION_MEASUREMENT_SERVER) || \ + defined(EMBER_AF_PLUGIN_PM2__5_CONCENTRATION_MEASUREMENT_SERVER) || \ + defined(EMBER_AF_PLUGIN_FORMALDEHYDE_CONCENTRATION_MEASUREMENT_SERVER) || \ + defined(EMBER_AF_PLUGIN_PM1_CONCENTRATION_MEASUREMENT_SERVER) || \ + defined(EMBER_AF_PLUGIN_PM10_CONCENTRATION_MEASUREMENT_SERVER) || \ + defined(EMBER_AF_PLUGIN_TOTAL_VOLATILE_ORGANIC_COMPOUNDS_CONCENTRATION_MEASUREMENT_SERVER) || \ + defined(EMBER_AF_PLUGIN_RADON_CONCENTRATION_MEASUREMENT_SERVER) + case chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::Id: + case chip::app::Clusters::CarbonDioxideConcentrationMeasurement::Id: + case chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::Id: + case chip::app::Clusters::OzoneConcentrationMeasurement::Id: + case chip::app::Clusters::FormaldehydeConcentrationMeasurement::Id: + case chip::app::Clusters::Pm1ConcentrationMeasurement::Id: + case chip::app::Clusters::Pm25ConcentrationMeasurement::Id: + case chip::app::Clusters::Pm10ConcentrationMeasurement::Id: + case chip::app::Clusters::RadonConcentrationMeasurement::Id: + case chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::Id: + return chefConcentrationMeasurementReadCallback(endpoint, clusterId, attributeMetadata, buffer, maxReadLength); +#endif + default: + break; + } + return EMBER_ZCL_STATUS_SUCCESS; +} + +/* + * +Thread 3 "rootnode_airqua" hit Breakpoint 1, emberAfExternalAttributeWriteCallback (endpoint=1, clusterId=91, + attributeMetadata=0x555555791f30 <(anonymous namespace)::generatedAttributes+1904>, buffer=0x7ffff68464ac "\001") + at /home/erwinpan/matter/erwinpan1/master_1124_airqualitysensor/examples/chef/common/stubs.cpp:22 +(gdb) p *attributeMetadata +$1 = {defaultValue = {ptrToDefaultValue = 0x0, defaultValue = 0, ptrToMinMaxValue = 0x0}, attributeId = 0, size = 1, attributeType = +48 '0', mask = 16 '\020'} (gdb) +*/ + +EmberAfStatus emberAfExternalAttributeWriteCallback(EndpointId endpoint, ClusterId clusterId, + const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer) +{ + switch (clusterId) + { +#ifdef EMBER_AF_PLUGIN_AIR_QUALITY_SERVER + case chip::app::Clusters::AirQuality::Id: + return chefAirQualityWriteCallback(endpoint, clusterId, attributeMetadata, buffer); +#endif +#if defined(EMBER_AF_PLUGIN_CARBON_MONOXIDE_CONCENTRATION_MEASUREMENT_SERVER) || \ + defined(EMBER_AF_PLUGIN_CARBON_DIOXIDE_CONCENTRATION_MEASUREMENT_SERVER) || \ + defined(EMBER_AF_PLUGIN_NITROGEN_DIOXIDE_CONCENTRATION_MEASUREMENT_SERVER) || \ + defined(EMBER_AF_PLUGIN_OZONE_CONCENTRATION_MEASUREMENT_SERVER) || \ + defined(EMBER_AF_PLUGIN_PM2__5_CONCENTRATION_MEASUREMENT_SERVER) || \ + defined(EMBER_AF_PLUGIN_FORMALDEHYDE_CONCENTRATION_MEASUREMENT_SERVER) || \ + defined(EMBER_AF_PLUGIN_PM1_CONCENTRATION_MEASUREMENT_SERVER) || \ + defined(EMBER_AF_PLUGIN_PM10_CONCENTRATION_MEASUREMENT_SERVER) || \ + defined(EMBER_AF_PLUGIN_TOTAL_VOLATILE_ORGANIC_COMPOUNDS_CONCENTRATION_MEASUREMENT_SERVER) || \ + defined(EMBER_AF_PLUGIN_RADON_CONCENTRATION_MEASUREMENT_SERVER) + case chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::Id: + case chip::app::Clusters::CarbonDioxideConcentrationMeasurement::Id: + case chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::Id: + case chip::app::Clusters::OzoneConcentrationMeasurement::Id: + case chip::app::Clusters::FormaldehydeConcentrationMeasurement::Id: + case chip::app::Clusters::Pm1ConcentrationMeasurement::Id: + case chip::app::Clusters::Pm25ConcentrationMeasurement::Id: + case chip::app::Clusters::Pm10ConcentrationMeasurement::Id: + case chip::app::Clusters::RadonConcentrationMeasurement::Id: + case chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::Id: + return chefConcentrationMeasurementWriteCallback(endpoint, clusterId, attributeMetadata, buffer); +#endif + default: + break; + } + return EMBER_ZCL_STATUS_SUCCESS; +} + // Include door lock callbacks only when the server is enabled #ifdef EMBER_AF_PLUGIN_DOOR_LOCK_SERVER #include diff --git a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter index 2aa12d5374c50e..23bb5d48d49694 100644 --- a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter +++ b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter @@ -1901,8 +1901,6 @@ endpoint 0 { server cluster TimeFormatLocalization { persist attribute hourFormat default = 0; - persist attribute activeCalendarType default = 0; - callback attribute supportedCalendarTypes; ram attribute featureMap default = 0; ram attribute clusterRevision default = 1; } @@ -1992,7 +1990,6 @@ endpoint 0 { ram attribute clusterRevision default = 0x0001; handle command OpenCommissioningWindow; - handle command OpenBasicCommissioningWindow; handle command RevokeCommissioning; } @@ -2083,9 +2080,9 @@ endpoint 1 { } server cluster TemperatureMeasurement { - persist attribute measuredValue default = 0; - persist attribute minMeasuredValue; - persist attribute maxMeasuredValue default = 0x8000; + persist attribute measuredValue default = 0x800; + persist attribute minMeasuredValue default = 0x800; + persist attribute maxMeasuredValue default = 0x800; persist attribute tolerance default = 0; callback attribute generatedCommandList; callback attribute acceptedCommandList; diff --git a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.zap b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.zap index 4b599c13c3cb5c..7eb4f3081dc3d2 100644 --- a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.zap +++ b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.zap @@ -1026,38 +1026,6 @@ "maxInterval": 65534, "reportableChange": 0 }, - { - "name": "ActiveCalendarType", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "CalendarTypeEnum", - "included": 1, - "storageOption": "NVM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "SupportedCalendarTypes", - "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": "FeatureMap", "code": 65532, @@ -1913,14 +1881,6 @@ "isIncoming": 1, "isEnabled": 1 }, - { - "name": "OpenBasicCommissioningWindow", - "code": 1, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, { "name": "RevokeCommissioning", "code": 2, @@ -2950,7 +2910,7 @@ "storageOption": "NVM", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": "0x800", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -2966,7 +2926,7 @@ "storageOption": "NVM", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "0x800", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -2982,7 +2942,7 @@ "storageOption": "NVM", "singleton": 0, "bounded": 0, - "defaultValue": "0x8000", + "defaultValue": "0x800", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -5828,7 +5788,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "10", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -5844,7 +5804,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "5", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -5876,7 +5836,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "36", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -5908,7 +5868,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "20", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -5940,7 +5900,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -5956,7 +5916,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -5988,7 +5948,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "3", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -6111,4 +6071,4 @@ "networkId": 0 } ] -} \ No newline at end of file +}