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 hicklin committed Dec 7, 2023
1 parent 81762b2 commit 2024156
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ void emberAfOperationalStateClusterInitCallback(chip::EndpointId endpointId)

gOperationalStateDelegate = new OperationalStateDelegate;
EndpointId operationalStateEndpoint = 0x01;
gOperationalStateInstance = new OperationalState::Instance(gOperationalStateDelegate, operationalStateEndpoint);
gOperationalStateInstance = new OperationalState::Instance(gOperationalStateDelegate, operationalStateEndpoint);

gOperationalStateInstance->SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kStopped));

Expand Down Expand Up @@ -158,8 +158,7 @@ void emberAfRvcOperationalStateClusterInitCallback(chip::EndpointId endpointId)

gRvcOperationalStateDelegate = new RvcOperationalStateDelegate;
EndpointId operationalStateEndpoint = 0x01;
gRvcOperationalStateInstance =
new RvcOperationalState::Instance(gRvcOperationalStateDelegate, operationalStateEndpoint);
gRvcOperationalStateInstance = new RvcOperationalState::Instance(gRvcOperationalStateDelegate, operationalStateEndpoint);

gRvcOperationalStateInstance->SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kStopped));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,10 @@ void Instance::HandlePauseState(HandlerContext & ctx, const Commands::Pause::Dec
}

// Handle Pause-incompatible states for derived clusters.
if (opState >= DerivedClusterNumberSpaceStart && opState < VendorNumberSpaceStart) {
if (!IsDerivedClusterStatePauseCompatible(opState)) {
if (opState >= DerivedClusterNumberSpaceStart && opState < VendorNumberSpaceStart)
{
if (!IsDerivedClusterStatePauseCompatible(opState))
{
err.Set(to_underlying(ErrorStateEnum::kCommandInvalidInState));
}
}
Expand Down Expand Up @@ -415,8 +417,10 @@ void Instance::HandleResumeState(HandlerContext & ctx, const Commands::Resume::D
}

// Handle Resume-incompatible states for derived clusters.
if (opState >= DerivedClusterNumberSpaceStart && opState < VendorNumberSpaceStart) {
if (!IsDerivedClusterStateResumeCompatible(opState)) {
if (opState >= DerivedClusterNumberSpaceStart && opState < VendorNumberSpaceStart)
{
if (!IsDerivedClusterStateResumeCompatible(opState))
{
err.Set(to_underlying(ErrorStateEnum::kCommandInvalidInState));
}
}
Expand Down Expand Up @@ -444,5 +448,5 @@ bool RvcOperationalState::Instance::IsDerivedClusterStatePauseCompatible(uint8_t
bool RvcOperationalState::Instance::IsDerivedClusterStateResumeCompatible(uint8_t aState)
{
return (aState == to_underlying(RvcOperationalState::OperationalStateEnum::kCharging) ||
aState == to_underlying(RvcOperationalState::OperationalStateEnum::kDocked));
aState == to_underlying(RvcOperationalState::OperationalStateEnum::kDocked));
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace Clusters {
namespace OperationalState {

const uint8_t DerivedClusterNumberSpaceStart = 0x40;
const uint8_t VendorNumberSpaceStart = 0x80;
const uint8_t VendorNumberSpaceStart = 0x80;

class Uncopyable
{
Expand Down Expand Up @@ -315,7 +315,8 @@ class Delegate

namespace RvcOperationalState {

class Instance: public OperationalState::Instance {
class Instance : public OperationalState::Instance
{
public:
/**
* Creates an RVC operational state cluster instance.
Expand All @@ -326,8 +327,9 @@ class Instance: public OperationalState::Instance {
* Note: the caller must ensure that the delegate lives throughout the instance's lifetime.
* @param aEndpointId The endpoint on which this cluster exists. This must match the zap configuration.
*/
Instance(OperationalState::Delegate * aDelegate, EndpointId aEndpointId):
OperationalState::Instance(aDelegate, aEndpointId, Id) {}
Instance(OperationalState::Delegate * aDelegate, EndpointId aEndpointId) :
OperationalState::Instance(aDelegate, aEndpointId, Id)
{}

protected:
/**
Expand All @@ -347,11 +349,12 @@ class Instance: public OperationalState::Instance {
bool IsDerivedClusterStateResumeCompatible(uint8_t aState) override;
};

} // RvcOperationalState
} // namespace RvcOperationalState

namespace OvenCavityOperationalState {

class Instance: public OperationalState::Instance {
class Instance : public OperationalState::Instance
{
public:
/**
* Creates an RVC operational state cluster instance.
Expand All @@ -362,11 +365,12 @@ class Instance: public OperationalState::Instance {
* Note: the caller must ensure that the delegate lives throughout the instance's lifetime.
* @param aEndpointId The endpoint on which this cluster exists. This must match the zap configuration.
*/
Instance(OperationalState::Delegate * aDelegate, EndpointId aEndpointId):
OperationalState::Instance(aDelegate, aEndpointId, Id) {}
Instance(OperationalState::Delegate * aDelegate, EndpointId aEndpointId) :
OperationalState::Instance(aDelegate, aEndpointId, Id)
{}
};

}
} // namespace OvenCavityOperationalState

} // namespace Clusters
} // namespace app
Expand Down

0 comments on commit 2024156

Please sign in to comment.