Skip to content

Commit

Permalink
Using overload of MatterReportingAttributeChangeCallback so as to avo…
Browse files Browse the repository at this point in the history
…id using ConcreteAttributePath
  • Loading branch information
mhazley committed Aug 30, 2023
1 parent 63a6f72 commit a5f609c
Showing 1 changed file with 13 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,8 @@ class Instance
* @param value The value to check.
* @param minValue The minimum value.
* @param maxValue The maximum value.
* @return true if the value is within the min and max constraints, or if any of the values are Null.
* @return true if the value is within the min and max constraints. If either of the pair of values being compared is null,
* that's considered to be within the constraint.
*/
static bool CheckConstraintMinMax(DataModel::Nullable<float> value, DataModel::Nullable<float> minValue,
DataModel::Nullable<float> maxValue)
Expand Down Expand Up @@ -387,8 +388,9 @@ class Instance

if (oldValue != this->mMeasuredValue)
{
ConcreteAttributePath path = ConcreteAttributePath(mEndpointId, mClusterId, Attributes::MeasuredValue::Id);
MatterReportingAttributeChangeCallback(path);
// ConcreteAttributePath path = ConcreteAttributePath(mEndpointId, mClusterId, Attributes::MeasuredValue::Id);
// MatterReportingAttributeChangeCallback(path);
MatterReportingAttributeChangeCallback(mEndpointId, mClusterId, Attributes::MeasuredValue::Id);
}

return CHIP_NO_ERROR;
Expand All @@ -412,8 +414,7 @@ class Instance

if (oldValue != this->mMinMeasuredValue)
{
ConcreteAttributePath path = ConcreteAttributePath(mEndpointId, mClusterId, Attributes::MinMeasuredValue::Id);
MatterReportingAttributeChangeCallback(path);
MatterReportingAttributeChangeCallback(mEndpointId, mClusterId, Attributes::MinMeasuredValue::Id);
}

return CHIP_NO_ERROR;
Expand All @@ -437,8 +438,7 @@ class Instance

if (oldValue != this->mMaxMeasuredValue)
{
ConcreteAttributePath path = ConcreteAttributePath(mEndpointId, mClusterId, Attributes::MaxMeasuredValue::Id);
MatterReportingAttributeChangeCallback(path);
MatterReportingAttributeChangeCallback(mEndpointId, mClusterId, Attributes::MaxMeasuredValue::Id);
}

return CHIP_NO_ERROR;
Expand All @@ -452,8 +452,7 @@ class Instance

if (oldValue != this->mUncertainty)
{
ConcreteAttributePath path = ConcreteAttributePath(mEndpointId, mClusterId, Attributes::Uncertainty::Id);
MatterReportingAttributeChangeCallback(path);
MatterReportingAttributeChangeCallback(mEndpointId, mClusterId, Attributes::Uncertainty::Id);
}

return CHIP_NO_ERROR;
Expand All @@ -472,8 +471,7 @@ class Instance

if (oldValue != this->mPeakMeasuredValue)
{
ConcreteAttributePath path = ConcreteAttributePath(mEndpointId, mClusterId, Attributes::PeakMeasuredValue::Id);
MatterReportingAttributeChangeCallback(path);
MatterReportingAttributeChangeCallback(mEndpointId, mClusterId, Attributes::PeakMeasuredValue::Id);
}

return CHIP_NO_ERROR;
Expand All @@ -492,8 +490,7 @@ class Instance

if (oldValue != this->mPeakMeasuredValueWindow)
{
ConcreteAttributePath path = ConcreteAttributePath(mEndpointId, mClusterId, Attributes::PeakMeasuredValueWindow::Id);
MatterReportingAttributeChangeCallback(path);
MatterReportingAttributeChangeCallback(mEndpointId, mClusterId, Attributes::PeakMeasuredValueWindow::Id);
}

return CHIP_NO_ERROR;
Expand All @@ -512,8 +509,7 @@ class Instance

if (oldValue != this->mAverageMeasuredValue)
{
ConcreteAttributePath path = ConcreteAttributePath(mEndpointId, mClusterId, Attributes::AverageMeasuredValue::Id);
MatterReportingAttributeChangeCallback(path);
MatterReportingAttributeChangeCallback(mEndpointId, mClusterId, Attributes::AverageMeasuredValue::Id);
}

return CHIP_NO_ERROR;
Expand All @@ -532,8 +528,7 @@ class Instance

if (oldValue != this->mAverageMeasuredValueWindow)
{
ConcreteAttributePath path = ConcreteAttributePath(mEndpointId, mClusterId, Attributes::AverageMeasuredValueWindow::Id);
MatterReportingAttributeChangeCallback(path);
MatterReportingAttributeChangeCallback(mEndpointId, mClusterId, Attributes::AverageMeasuredValueWindow::Id);
}

return CHIP_NO_ERROR;
Expand Down Expand Up @@ -563,8 +558,7 @@ class Instance

if (oldValue != this->mLevel)
{
ConcreteAttributePath path = ConcreteAttributePath(mEndpointId, mClusterId, Attributes::LevelValue::Id);
MatterReportingAttributeChangeCallback(path);
MatterReportingAttributeChangeCallback(mEndpointId, mClusterId, Attributes::LevelValue::Id);
}

return CHIP_NO_ERROR;
Expand Down

0 comments on commit a5f609c

Please sign in to comment.