@@ -829,7 +829,7 @@ CHIP_ERROR ThermostatAttrAccess::Write(const ConcreteDataAttributePath & aPath,
829
829
VerifyOrDie (aPath.mClusterId == Thermostat::Id);
830
830
831
831
EndpointId endpoint = aPath.mEndpointId ;
832
- const Access::SubjectDescriptor subjectDescriptor = aDecoder.GetSubjectDescriptor ();
832
+ auto & subjectDescriptor = aDecoder.GetSubjectDescriptor ();
833
833
ScopedNodeId scopedNodeId = ScopedNodeId ();
834
834
835
835
// Get the node id if the authentication mode is CASE.
@@ -1306,7 +1306,7 @@ bool emberAfThermostatClusterSetActivePresetRequestCallback(
1306
1306
return true ;
1307
1307
}
1308
1308
1309
- bool validAtomicAttributes (const chip::app::Clusters::Thermostat:: Commands::AtomicRequest::DecodableType & commandData)
1309
+ bool validAtomicAttributes (Commands::AtomicRequest::DecodableType & commandData)
1310
1310
{
1311
1311
auto attributeIdsIter = commandData.attributeRequests .begin ();
1312
1312
bool requestedPresets, requestedSchedules;
@@ -1337,9 +1337,9 @@ bool validAtomicAttributes(const chip::app::Clusters::Thermostat::Commands::Atom
1337
1337
return true ;
1338
1338
}
1339
1339
1340
- bool handleAtomicBegin (chip::app:: CommandHandler * commandObj, const ScopedNodeId & sourceNodeId,
1341
- const chip::app:: ConcreteCommandPath & commandPath,
1342
- const chip::app::Clusters::Thermostat:: Commands::AtomicRequest::DecodableType & commandData)
1340
+ bool handleAtomicBegin (CommandHandler * commandObj, const ScopedNodeId & sourceNodeId,
1341
+ const ConcreteCommandPath & commandPath,
1342
+ const Commands::AtomicRequest::DecodableType & commandData)
1343
1343
{
1344
1344
EndpointId endpoint = commandPath.mEndpointId ;
1345
1345
@@ -1360,16 +1360,15 @@ bool handleAtomicBegin(chip::app::CommandHandler * commandObj, const ScopedNodeI
1360
1360
bool inAtomicWrite = gThermostatAttrAccess .InAtomicWrite (endpoint);
1361
1361
if (inAtomicWrite)
1362
1362
{
1363
- chip::app::Clusters::Thermostat:: Commands::AtomicResponse::Type response;
1363
+ Commands::AtomicResponse::Type response;
1364
1364
Globals::Structs::AtomicAttributeStatusStruct::Type attributeStatus[] = {
1365
- { .attributeID = Presets::Id, .statusCode = static_cast < uint8_t > (imcode::Busy) },
1366
- { .attributeID = Schedules::Id, .statusCode = static_cast < uint8_t > (imcode::Busy) }
1365
+ { .attributeID = Presets::Id, .statusCode = to_underlying (imcode::Busy) },
1366
+ { .attributeID = Schedules::Id, .statusCode = to_underlying (imcode::Busy) }
1367
1367
};
1368
1368
1369
- response.statusCode = static_cast < uint8_t > (imcode::Failure);
1369
+ response.statusCode = to_underlying (imcode::Failure);
1370
1370
response.attributeStatus = attributeStatus;
1371
1371
commandObj->AddResponse (commandPath, response);
1372
- // commandObj->AddStatus(commandPath, imcode::Busy);
1373
1372
return true ;
1374
1373
}
1375
1374
@@ -1379,23 +1378,23 @@ bool handleAtomicBegin(chip::app::CommandHandler * commandObj, const ScopedNodeI
1379
1378
ScheduleTimer (endpoint, timeout);
1380
1379
gThermostatAttrAccess .SetAtomicWrite (endpoint, true );
1381
1380
gThermostatAttrAccess .SetAtomicWriteScopedNodeId (endpoint, GetSourceScopedNodeId (commandObj));
1382
- chip::app::Clusters::Thermostat:: Commands::AtomicResponse::Type response;
1381
+ Commands::AtomicResponse::Type response;
1383
1382
Globals::Structs::AtomicAttributeStatusStruct::Type attributeStatus[] = {
1384
- { .attributeID = Presets::Id, .statusCode = static_cast < uint8_t > (imcode::Success) },
1385
- { .attributeID = Schedules::Id, .statusCode = static_cast < uint8_t > (imcode::Success) }
1383
+ { .attributeID = Presets::Id, .statusCode = to_underlying (imcode::Success) },
1384
+ { .attributeID = Schedules::Id, .statusCode = to_underlying (imcode::Success) }
1386
1385
};
1387
1386
1388
- response.statusCode = static_cast < uint8_t > (imcode::Failure);
1387
+ response.statusCode = to_underlying (imcode::Failure);
1389
1388
response.attributeStatus = attributeStatus;
1390
1389
response.timeout .Emplace (timeout);
1391
1390
commandObj->AddResponse (commandPath, response);
1392
1391
1393
1392
return true ;
1394
1393
}
1395
1394
1396
- bool handleAtomicCommit (chip::app:: CommandHandler * commandObj, const ScopedNodeId & sourceNodeId,
1397
- const chip::app:: ConcreteCommandPath & commandPath,
1398
- const chip::app::Clusters::Thermostat:: Commands::AtomicRequest::DecodableType & commandData)
1395
+ bool handleAtomicCommit (CommandHandler * commandObj, const ScopedNodeId & sourceNodeId,
1396
+ const ConcreteCommandPath & commandPath,
1397
+ const Commands::AtomicRequest::DecodableType & commandData)
1399
1398
{
1400
1399
if (!validAtomicAttributes (commandData))
1401
1400
{
@@ -1548,7 +1547,7 @@ bool handleAtomicCommit(chip::app::CommandHandler * commandObj, const ScopedNode
1548
1547
return SendResponseAndCleanUp (delegate, endpoint, commandObj, commandPath, imcode::ConstraintError);
1549
1548
}
1550
1549
1551
- // If the preset type for the preset scenario does not support name and a name is specified, return CONSTRAINT_ERROR.
1550
+ // If the preset type for the preset scenario does not support names and a name is specified, return CONSTRAINT_ERROR.
1552
1551
if (!PresetTypeSupportsNames (delegate, presetScenario) && pendingPreset.GetName ().HasValue ())
1553
1552
{
1554
1553
return SendResponseAndCleanUp (delegate, endpoint, commandObj, commandPath, imcode::ConstraintError);
@@ -1599,9 +1598,9 @@ bool handleAtomicCommit(chip::app::CommandHandler * commandObj, const ScopedNode
1599
1598
return SendResponseAndCleanUp (delegate, endpoint, commandObj, commandPath, imcode::Success);
1600
1599
}
1601
1600
1602
- bool handleAtomicRollback (chip::app:: CommandHandler * commandObj, const ScopedNodeId & sourceNodeId,
1603
- const chip::app:: ConcreteCommandPath & commandPath,
1604
- const chip::app::Clusters::Thermostat:: Commands::AtomicRequest::DecodableType & commandData)
1601
+ bool handleAtomicRollback (CommandHandler * commandObj, const ScopedNodeId & sourceNodeId,
1602
+ const ConcreteCommandPath & commandPath,
1603
+ const Commands::AtomicRequest::DecodableType & commandData)
1605
1604
{
1606
1605
if (!validAtomicAttributes (commandData))
1607
1606
{
@@ -1637,7 +1636,6 @@ bool emberAfThermostatClusterAtomicRequestCallback(
1637
1636
const chip::app::Clusters::Thermostat::Commands::AtomicRequest::DecodableType & commandData)
1638
1637
{
1639
1638
auto & requestType = commandData.requestType ;
1640
- // auto & timeout = commandData.timeout;
1641
1639
1642
1640
ScopedNodeId sourceNodeId = GetSourceScopedNodeId (commandObj);
1643
1641
0 commit comments