@@ -37,11 +37,10 @@ using namespace chip::app;
37
37
using namespace chip ::app::Clusters;
38
38
using namespace chip ::app::Clusters::SoilMeasurement;
39
39
using namespace chip ::app::Clusters::SoilMeasurement::Attributes;
40
- using namespace chip ::app::Clusters::SoilMeasurement::Structs;
41
40
42
41
MeasurementData gMeasurements [MATTER_DM_SOIL_MEASUREMENT_CLUSTER_SERVER_ENDPOINT_COUNT + CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT];
43
42
44
- MeasurementAccuracyRangeStruct::Type soilMoistureMeasurementLimitsAccuracyRange[] = {
43
+ Globals::Structs:: MeasurementAccuracyRangeStruct::Type soilMoistureMeasurementLimitsAccuracyRange[] = {
45
44
{ .rangeMin = 0 , .rangeMax = 100 , .percentMax = MakeOptional (static_cast <chip::Percent100ths>(10 )) }
46
45
};
47
46
@@ -52,12 +51,14 @@ CHIP_ERROR SoilMeasurementAttrAccess::Init()
52
51
// Initialize the soil moisture measurement limits to default values
53
52
for (auto & measurement : gMeasurements )
54
53
{
55
- measurement.soilMoistureMeasurementLimits = { .measurementType = MeasurementTypeEnum::kSoilMoisture ,
56
- .measured = true ,
57
- .minMeasuredValue = 0 ,
58
- .maxMeasuredValue = 100 ,
59
- .accuracyRanges = DataModel::List<const MeasurementAccuracyRangeStruct::Type>(
60
- soilMoistureMeasurementLimitsAccuracyRange) };
54
+ measurement.soilMoistureMeasurementLimits = {
55
+ .measurementType = Globals::MeasurementTypeEnum::kSoilMoisture ,
56
+ .measured = true ,
57
+ .minMeasuredValue = 0 ,
58
+ .maxMeasuredValue = 100 ,
59
+ .accuracyRanges = DataModel::List<const Globals::Structs::MeasurementAccuracyRangeStruct::Type>(
60
+ soilMoistureMeasurementLimitsAccuracyRange)
61
+ };
61
62
}
62
63
63
64
return CHIP_NO_ERROR;
@@ -107,7 +108,8 @@ MeasurementData * SoilMeasurementDataForEndpoint(EndpointId endpointId)
107
108
// This function is intended for the application to set the soil measurement accuracy limits to the proper values during init.
108
109
// Given the limits are fixed, it is not intended to be changes at runtime, hence why this function does not report the change.
109
110
// The application should call this function only once during init.
110
- CHIP_ERROR SetSoilMeasurementAccuracy (EndpointId endpointId, const MeasurementAccuracyStruct::Type & measurementLimits)
111
+ CHIP_ERROR SetSoilMeasurementAccuracy (EndpointId endpointId,
112
+ const Globals::Structs::MeasurementAccuracyStruct::Type & measurementLimits)
111
113
{
112
114
MeasurementData * data = SoilMeasurementDataForEndpoint (endpointId);
113
115
VerifyOrReturnError (data != nullptr , CHIP_ERROR_INVALID_ARGUMENT);
0 commit comments