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 stingchang committed May 28, 2024
1 parent 939bf7f commit 27ef480
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions examples/chef/common/chef-rvc-operational-state-delegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,26 +232,27 @@ chip::Protocols::InteractionModel::Status chefRvcOperationalStateReadCallback(ch
uint8_t * buffer, uint16_t maxReadLength)
{
chip::Protocols::InteractionModel::Status ret = chip::Protocols::InteractionModel::Status::Success;
chip::AttributeId attributeId = attributeMetadata->attributeId;
switch(attributeId) {
case chip::app::Clusters::RvcOperationalState::Attributes::CurrentPhase::Id: {
chip::AttributeId attributeId = attributeMetadata->attributeId;
switch (attributeId)
{
case chip::app::Clusters::RvcOperationalState::Attributes::CurrentPhase::Id: {

app::DataModel::Nullable<uint8_t> currentPhase = gRvcOperationalStateInstance->GetCurrentPhase();
if(currentPhase.IsNull())
{
ret = chip::Protocols::InteractionModel::Status::UnsupportedAttribute;
break;
}
*buffer = currentPhase.Value();
}
break;
case chip::app::Clusters::RvcOperationalState::Attributes::OperationalState::Id: {
*buffer = gRvcOperationalStateInstance->GetCurrentOperationalState();
app::DataModel::Nullable<uint8_t> currentPhase = gRvcOperationalStateInstance->GetCurrentPhase();
if (currentPhase.IsNull())
{
ret = chip::Protocols::InteractionModel::Status::UnsupportedAttribute;
break;
}
*buffer = currentPhase.Value();
}
break;
case chip::app::Clusters::RvcOperationalState::Attributes::OperationalState::Id: {
*buffer = gRvcOperationalStateInstance->GetCurrentOperationalState();
}
break;
default:
ChipLogError(DeviceLayer, "Unsupported Attribute ID: %d", static_cast<int>(attributeId));
break;
default:
ChipLogError(DeviceLayer, "Unsupported Attribute ID: %d", static_cast<int>(attributeId));
break;
}

return ret;
Expand Down

0 comments on commit 27ef480

Please sign in to comment.