diff --git a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp index 085de856968dbc..b8e4807fdb8c4f 100644 --- a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp +++ b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp @@ -753,7 +753,7 @@ void Instance::HandleRequestConstraintBasedForecast(HandlerContext & ctx, } uint32_t currentUtcTime = 0; - status = GetCurrentTimeEpochS(currentUtcTime); + status = GetMatterEpochTimeFromUnixTime(currentUtcTime); if (status != Status::Success) { ChipLogError(Zcl, "DEM: Failed to get UTC time"); @@ -815,7 +815,7 @@ void Instance::HandleRequestConstraintBasedForecast(HandlerContext & ctx, if (constraint.loadControl.Value() < -100 || constraint.loadControl.Value() > 100) { - ChipLogError(Zcl, "DEM: RequestConstraintBasedForecast bad loadControl %d", constraint.loadControl.HasValue()); + ChipLogError(Zcl, "DEM: RequestConstraintBasedForecast bad loadControl %d", constraint.loadControl.Value()); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::ConstraintError); return; } @@ -849,7 +849,7 @@ void Instance::HandleRequestConstraintBasedForecast(HandlerContext & ctx, return; } - prevConstraint = iterator.GetValue(); + prevConstraint = constraint; } } @@ -892,7 +892,7 @@ void Instance::HandleCancelRequest(HandlerContext & ctx, const Commands::CancelR ctx.mCommandHandler.AddStatus(ctx.mRequestPath, status); } -Status Instance::GetCurrentTimeEpochS(uint32_t & currentUtcTime) const +Status Instance::GetMatterEpochTimeFromUnixTime(uint32_t & currentUtcTime) const { currentUtcTime = 0; System::Clock::Milliseconds64 cTMs; diff --git a/src/app/clusters/device-energy-management-server/device-energy-management-server.h b/src/app/clusters/device-energy-management-server/device-energy-management-server.h index c7fd4734ae63a9..b0d27b0b99edd7 100644 --- a/src/app/clusters/device-energy-management-server/device-energy-management-server.h +++ b/src/app/clusters/device-energy-management-server/device-energy-management-server.h @@ -203,7 +203,7 @@ class Instance : public AttributeAccessInterface, public CommandHandlerInterface bool HasFeature(Feature aFeature) const; private: - Protocols::InteractionModel::Status GetCurrentTimeEpochS(uint32_t & currentUtcTime) const; + Protocols::InteractionModel::Status GetMatterEpochTimeFromUnixTime(uint32_t & currentUtcTime) const; private: Delegate & mDelegate;