Skip to content

Commit 9663f30

Browse files
committed
Fix build after suggestions
1 parent a2f3500 commit 9663f30

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

examples/thermostat/thermostat-common/include/thermostat-delegate-impl.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class ThermostatDelegate : public Delegate
4444
public:
4545
static inline ThermostatDelegate & GetInstance() { return sInstance; }
4646

47-
std::optional<System::Clock::Milliseconds16> GetAtomicWriteTimeout(chip::AttributeId attributeId) override;
47+
std::optional<System::Clock::Milliseconds16> GetMaxAtomicWriteTimeout(chip::AttributeId attributeId) override;
4848

4949
CHIP_ERROR GetPresetTypeAtIndex(size_t index, Structs::PresetTypeStruct::Type & presetType) override;
5050

examples/thermostat/thermostat-common/src/thermostat-delegate-impl.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ CHIP_ERROR ThermostatDelegate::SetActivePresetHandle(const DataModel::Nullable<B
152152
return CHIP_NO_ERROR;
153153
}
154154

155-
std::optional<System::Clock::Milliseconds16> ThermostatDelegate::GetAtomicWriteTimeout(chip::AttributeId attributeId)
155+
std::optional<System::Clock::Milliseconds16> ThermostatDelegate::GetMaxAtomicWriteTimeout(chip::AttributeId attributeId)
156156
{
157157
switch (attributeId)
158158
{

src/app/clusters/thermostat-server/thermostat-server-atomic.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ Status BuildAttributeStatuses(const EndpointId endpoint, const DataModel::Decoda
142142

143143
bool requestedPresets = false, requestedSchedules = false;
144144
attributeStatusCount = 0;
145-
if (!countAttributeRequests(attributeRequests, attributeStatusCount, requestedPresets, requestedSchedules))
145+
if (!CountAttributeRequests(attributeRequests, attributeStatusCount, requestedPresets, requestedSchedules))
146146
{
147147
// We errored reading the list
148148
return Status::InvalidCommand;
@@ -300,7 +300,7 @@ void ThermostatAttrAccess::BeginAtomicWrite(CommandHandler * commandObj, const C
300300

301301
size_t attributeStatusCount = 0;
302302
Platform::ScopedMemoryBuffer<AtomicAttributeStatusStruct::Type> attributeStatuses;
303-
auto status = buildAttributeStatuses(endpoint, commandData.attributeRequests, attributeStatusCount, attributeStatuses, false);
303+
auto status = BuildAttributeStatuses(endpoint, commandData.attributeRequests, attributeStatusCount, attributeStatuses, false);
304304
if (status != Status::Success)
305305
{
306306
commandObj->AddStatus(commandPath, status);
@@ -329,7 +329,7 @@ void ThermostatAttrAccess::BeginAtomicWrite(CommandHandler * commandObj, const C
329329
{
330330
case Presets::Id:
331331
case Schedules::Id:
332-
auto attributeTimeout = delegate->GetAtomicWriteTimeout(attributeId);
332+
auto attributeTimeout = delegate->GetMaxAtomicWriteTimeout(attributeId);
333333

334334
if (attributeTimeout.has_value())
335335
{
@@ -379,7 +379,7 @@ void ThermostatAttrAccess::BeginAtomicWrite(CommandHandler * commandObj, const C
379379
SetAtomicWrite(endpoint, GetSourceScopedNodeId(commandObj), AtomicWriteState::Open);
380380
}
381381

382-
sendAtomicResponse(commandObj, commandPath, status, attributeStatuses, attributeStatusCount, MakeOptional(timeout.count()));
382+
SendAtomicResponse(commandObj, commandPath, status, attributeStatuses, attributeStatusCount, MakeOptional(timeout.count()));
383383
}
384384

385385
void ThermostatAttrAccess::CommitAtomicWrite(CommandHandler * commandObj, const ConcreteCommandPath & commandPath,
@@ -397,7 +397,7 @@ void ThermostatAttrAccess::CommitAtomicWrite(CommandHandler * commandObj, const
397397

398398
size_t attributeStatusCount = 0;
399399
Platform::ScopedMemoryBuffer<AtomicAttributeStatusStruct::Type> attributeStatuses;
400-
auto status = buildAttributeStatuses(endpoint, commandData.attributeRequests, attributeStatusCount, attributeStatuses, true);
400+
auto status = BuildAttributeStatuses(endpoint, commandData.attributeRequests, attributeStatusCount, attributeStatuses, true);
401401
if (status != Status::Success)
402402
{
403403
commandObj->AddStatus(commandPath, status);
@@ -443,7 +443,7 @@ void ThermostatAttrAccess::CommitAtomicWrite(CommandHandler * commandObj, const
443443
}
444444

445445
ResetAtomicWrite(endpoint);
446-
sendAtomicResponse(commandObj, commandPath, status, attributeStatuses, attributeStatusCount);
446+
SendAtomicResponse(commandObj, commandPath, status, attributeStatuses, attributeStatusCount);
447447
}
448448

449449
void ThermostatAttrAccess::RollbackAtomicWrite(CommandHandler * commandObj, const ConcreteCommandPath & commandPath,
@@ -462,7 +462,7 @@ void ThermostatAttrAccess::RollbackAtomicWrite(CommandHandler * commandObj, cons
462462

463463
size_t attributeStatusCount = 0;
464464
Platform::ScopedMemoryBuffer<AtomicAttributeStatusStruct::Type> attributeStatuses;
465-
auto status = buildAttributeStatuses(endpoint, commandData.attributeRequests, attributeStatusCount, attributeStatuses, true);
465+
auto status = BuildAttributeStatuses(endpoint, commandData.attributeRequests, attributeStatusCount, attributeStatuses, true);
466466
if (status != Status::Success)
467467
{
468468
commandObj->AddStatus(commandPath, status);
@@ -493,7 +493,7 @@ void ThermostatAttrAccess::RollbackAtomicWrite(CommandHandler * commandObj, cons
493493
}
494494
}
495495

496-
sendAtomicResponse(commandObj, commandPath, status, attributeStatuses, attributeStatusCount);
496+
SendAtomicResponse(commandObj, commandPath, status, attributeStatuses, attributeStatusCount);
497497
}
498498

499499
void ThermostatAttrAccess::SetAtomicWrite(EndpointId endpoint, ScopedNodeId originatorNodeId, AtomicWriteState state)

0 commit comments

Comments
 (0)