@@ -849,9 +849,9 @@ CHIP_ERROR ThermostatAttrAccess::Write(const ConcreteDataAttributePath & aPath,
849
849
{
850
850
VerifyOrDie (aPath.mClusterId == Thermostat::Id);
851
851
852
- EndpointId endpoint = aPath.mEndpointId ;
853
- const Access::SubjectDescriptor subjectDescriptor = aDecoder.GetSubjectDescriptor ();
854
- ScopedNodeId scopedNodeId = ScopedNodeId ();
852
+ EndpointId endpoint = aPath.mEndpointId ;
853
+ auto & subjectDescriptor = aDecoder.GetSubjectDescriptor ();
854
+ ScopedNodeId scopedNodeId = ScopedNodeId ();
855
855
856
856
// Get the node id if the authentication mode is CASE.
857
857
if (subjectDescriptor.authMode == Access::AuthMode::kCase )
@@ -1322,7 +1322,7 @@ bool emberAfThermostatClusterSetActivePresetRequestCallback(
1322
1322
return true ;
1323
1323
}
1324
1324
1325
- bool validAtomicAttributes (const chip::app::Clusters::Thermostat:: Commands::AtomicRequest::DecodableType & commandData)
1325
+ bool validAtomicAttributes (const Commands::AtomicRequest::DecodableType & commandData)
1326
1326
{
1327
1327
auto attributeIdsIter = commandData.attributeRequests .begin ();
1328
1328
bool requestedPresets = false , requestedSchedules = false ;
@@ -1359,7 +1359,7 @@ bool validAtomicAttributes(const chip::app::Clusters::Thermostat::Commands::Atom
1359
1359
}
1360
1360
1361
1361
bool handleAtomicBegin (chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath,
1362
- const chip::app::Clusters::Thermostat:: Commands::AtomicRequest::DecodableType & commandData)
1362
+ const Commands::AtomicRequest::DecodableType & commandData)
1363
1363
{
1364
1364
EndpointId endpoint = commandPath.mEndpointId ;
1365
1365
@@ -1386,14 +1386,13 @@ bool handleAtomicBegin(chip::app::CommandHandler * commandObj, const chip::app::
1386
1386
1387
1387
if (gThermostatAttrAccess .InAtomicWrite (endpoint))
1388
1388
{
1389
- // Some other client has an open atomic write, return busy
1390
- chip::app::Clusters::Thermostat::Commands::AtomicResponse::Type response;
1389
+ Commands::AtomicResponse::Type response;
1391
1390
Globals::Structs::AtomicAttributeStatusStruct::Type attributeStatus[] = {
1392
- { .attributeID = Presets::Id, .statusCode = static_cast < uint8_t > (imcode::Busy) },
1393
- { .attributeID = Schedules::Id, .statusCode = static_cast < uint8_t > (imcode::Busy) }
1391
+ { .attributeID = Presets::Id, .statusCode = to_underlying (imcode::Busy) },
1392
+ { .attributeID = Schedules::Id, .statusCode = to_underlying (imcode::Busy) }
1394
1393
};
1395
1394
1396
- response.statusCode = static_cast < uint8_t > (imcode::Failure);
1395
+ response.statusCode = to_underlying (imcode::Failure);
1397
1396
response.attributeStatus = attributeStatus;
1398
1397
commandObj->AddResponse (commandPath, response);
1399
1398
return true ;
@@ -1407,13 +1406,13 @@ bool handleAtomicBegin(chip::app::CommandHandler * commandObj, const chip::app::
1407
1406
ScheduleTimer (endpoint, static_cast <System::Clock::Milliseconds16>(timeout));
1408
1407
gThermostatAttrAccess .SetAtomicWrite (endpoint, true );
1409
1408
gThermostatAttrAccess .SetAtomicWriteScopedNodeId (endpoint, GetSourceScopedNodeId (commandObj));
1410
- chip::app::Clusters::Thermostat:: Commands::AtomicResponse::Type response;
1409
+ Commands::AtomicResponse::Type response;
1411
1410
Globals::Structs::AtomicAttributeStatusStruct::Type attributeStatus[] = {
1412
- { .attributeID = Presets::Id, .statusCode = static_cast < uint8_t > (imcode::Success) },
1413
- { .attributeID = Schedules::Id, .statusCode = static_cast < uint8_t > (imcode::Success) }
1411
+ { .attributeID = Presets::Id, .statusCode = to_underlying (imcode::Success) },
1412
+ { .attributeID = Schedules::Id, .statusCode = to_underlying (imcode::Success) }
1414
1413
};
1415
1414
1416
- response.statusCode = static_cast < uint8_t > (imcode::Success);
1415
+ response.statusCode = to_underlying (imcode::Success);
1417
1416
response.attributeStatus = attributeStatus;
1418
1417
response.timeout .Emplace (timeout);
1419
1418
commandObj->AddResponse (commandPath, response);
@@ -1422,7 +1421,7 @@ bool handleAtomicBegin(chip::app::CommandHandler * commandObj, const chip::app::
1422
1421
}
1423
1422
1424
1423
bool handleAtomicCommit (chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath,
1425
- const chip::app::Clusters::Thermostat:: Commands::AtomicRequest::DecodableType & commandData)
1424
+ const Commands::AtomicRequest::DecodableType & commandData)
1426
1425
{
1427
1426
if (!validAtomicAttributes (commandData))
1428
1427
{
@@ -1569,7 +1568,7 @@ bool handleAtomicCommit(chip::app::CommandHandler * commandObj, const chip::app:
1569
1568
return SendResponseAndCleanUp (delegate, endpoint, commandObj, commandPath, imcode::ConstraintError);
1570
1569
}
1571
1570
1572
- // If the preset type for the preset scenario does not support name and a name is specified, return CONSTRAINT_ERROR.
1571
+ // If the preset type for the preset scenario does not support names and a name is specified, return CONSTRAINT_ERROR.
1573
1572
if (!PresetTypeSupportsNames (delegate, presetScenario) && pendingPreset.GetName ().HasValue ())
1574
1573
{
1575
1574
return SendResponseAndCleanUp (delegate, endpoint, commandObj, commandPath, imcode::ConstraintError);
@@ -1621,7 +1620,7 @@ bool handleAtomicCommit(chip::app::CommandHandler * commandObj, const chip::app:
1621
1620
}
1622
1621
1623
1622
bool handleAtomicRollback (chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath,
1624
- const chip::app::Clusters::Thermostat:: Commands::AtomicRequest::DecodableType & commandData)
1623
+ const Commands::AtomicRequest::DecodableType & commandData)
1625
1624
{
1626
1625
if (!validAtomicAttributes (commandData))
1627
1626
{
0 commit comments