Skip to content

Commit 40b185f

Browse files
committed
Address some further useful comments from Boris Zbarsky
1 parent 956c311 commit 40b185f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/app/clusters/device-energy-management-server/device-energy-management-server.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,7 @@ void Instance::HandleRequestConstraintBasedForecast(HandlerContext & ctx,
753753
}
754754

755755
uint32_t currentUtcTime = 0;
756-
status = GetCurrentTimeEpochS(currentUtcTime);
756+
status = GetMatterEpochTimeFromUnixTime(currentUtcTime);
757757
if (status != Status::Success)
758758
{
759759
ChipLogError(Zcl, "DEM: Failed to get UTC time");
@@ -815,7 +815,7 @@ void Instance::HandleRequestConstraintBasedForecast(HandlerContext & ctx,
815815

816816
if (constraint.loadControl.Value() < -100 || constraint.loadControl.Value() > 100)
817817
{
818-
ChipLogError(Zcl, "DEM: RequestConstraintBasedForecast bad loadControl %d", constraint.loadControl.HasValue());
818+
ChipLogError(Zcl, "DEM: RequestConstraintBasedForecast bad loadControl %d", constraint.loadControl.Value());
819819
ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::ConstraintError);
820820
return;
821821
}
@@ -849,7 +849,7 @@ void Instance::HandleRequestConstraintBasedForecast(HandlerContext & ctx,
849849
return;
850850
}
851851

852-
prevConstraint = iterator.GetValue();
852+
prevConstraint = constraint;
853853
}
854854
}
855855

@@ -892,7 +892,7 @@ void Instance::HandleCancelRequest(HandlerContext & ctx, const Commands::CancelR
892892
ctx.mCommandHandler.AddStatus(ctx.mRequestPath, status);
893893
}
894894

895-
Status Instance::GetCurrentTimeEpochS(uint32_t & currentUtcTime) const
895+
Status Instance::GetMatterEpochTimeFromUnixTime(uint32_t & currentUtcTime) const
896896
{
897897
currentUtcTime = 0;
898898
System::Clock::Milliseconds64 cTMs;

src/app/clusters/device-energy-management-server/device-energy-management-server.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ class Instance : public AttributeAccessInterface, public CommandHandlerInterface
203203
bool HasFeature(Feature aFeature) const;
204204

205205
private:
206-
Protocols::InteractionModel::Status GetCurrentTimeEpochS(uint32_t & currentUtcTime) const;
206+
Protocols::InteractionModel::Status GetMatterEpochTimeFromUnixTime(uint32_t & currentUtcTime) const;
207207

208208
private:
209209
Delegate & mDelegate;

0 commit comments

Comments
 (0)