Skip to content

Commit

Permalink
Restyled by clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
restyled-commits authored and lpbeliveau-silabs committed Oct 6, 2023
1 parent 08187fd commit a9ffa94
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/app/clusters/scenes-server/scenes-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ CHIP_ERROR ScenesServer::Init()
// The bit of 7 the NameSupport attribute indicates whether or not scene names are supported
//
// According to spec, bit 7 (Scene Names) MUST match feature bit 0 (Scene Names)
uint8_t nameSupport = (featureMap & to_underlying(Feature::kSceneNames)) ? static_cast<uint8_t>(0x80) : static_cast<uint8_t>(0x00);
uint8_t nameSupport =
(featureMap & to_underlying(Feature::kSceneNames)) ? static_cast<uint8_t>(0x80) : static_cast<uint8_t>(0x00);
status = Attributes::NameSupport::Set(endpoint, nameSupport);
if (EMBER_ZCL_STATUS_SUCCESS != status)
{
Expand All @@ -135,7 +136,7 @@ CHIP_ERROR ScenesServer::Init()

// Forcing matter mandatory features on
// Explicit AttributeValuePairs is mandatory for matter so we force it here
featureMap |= to_underlying(Feature::kExplicit);
featureMap |= to_underlying(Feature::kExplicit);
status = Attributes::FeatureMap::Set(endpoint, featureMap);
if (EMBER_ZCL_STATUS_SUCCESS != status)
{
Expand Down Expand Up @@ -210,13 +211,12 @@ void AddSceneParse(CommandHandlerInterface::HandlerContext & ctx, const CommandD
uint8_t EFSCount = 0;

uint32_t featureMap = 0x00;
ReturnOnFailure(
AddResponseOnError(ctx, response, Attributes::FeatureMap::Get(ctx.mRequestPath.mEndpointId, &featureMap)));
ReturnOnFailure(AddResponseOnError(ctx, response, Attributes::FeatureMap::Get(ctx.mRequestPath.mEndpointId, &featureMap)));

SceneData storageData(CharSpan(), transitionTimeMs);
if(featureMap & to_underlying(Feature::kSceneNames))
if (featureMap & to_underlying(Feature::kSceneNames))
{
storageData.SetName(req.sceneName);
storageData.SetName(req.sceneName);
}

// Goes through all EFS in command
Expand Down Expand Up @@ -393,9 +393,10 @@ CHIP_ERROR StoreSceneParse(const FabricIndex & fabricIdx, const EndpointId & end
else
{
uint32_t featureMap = 0x00;
ReturnErrorOnFailure(StatusIB(ToInteractionModelStatus(Attributes::FeatureMap::Get(endpointID, &featureMap))).ToChipError());
ReturnErrorOnFailure(
StatusIB(ToInteractionModelStatus(Attributes::FeatureMap::Get(endpointID, &featureMap))).ToChipError());
// Check if we still support scenes name in case an OTA changed that, if we don't, set name to empty
if(!(featureMap & to_underlying(Feature::kSceneNames)))
if (!(featureMap & to_underlying(Feature::kSceneNames)))
{
scene.mStorageData.SetName(CharSpan());
}
Expand Down

0 comments on commit a9ffa94

Please sign in to comment.