From 024b0ca7aa866c1309778ac88fa22308a41db52b Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Thu, 15 Feb 2024 22:59:23 +0000 Subject: [PATCH] Restyled by clang-format --- .../src/energy-preference-delegate.cpp | 12 ++++++++---- .../energy-preference-server.cpp | 4 ++-- .../energy-preference-server.h | 10 ++++------ 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/src/energy-preference-delegate.cpp b/examples/all-clusters-app/all-clusters-common/src/energy-preference-delegate.cpp index fd7d65c0f85905..0626f2a895b3fa 100644 --- a/examples/all-clusters-app/all-clusters-common/src/energy-preference-delegate.cpp +++ b/examples/all-clusters-app/all-clusters-common/src/energy-preference-delegate.cpp @@ -29,9 +29,11 @@ struct EPrefDelegate : public Delegate EPrefDelegate(); virtual ~EPrefDelegate(); - CHIP_ERROR GetEnergyBalanceAtIndex(chip::EndpointId aEndpoint, size_t aIndex, chip::Percent & aOutStep, chip::MutableCharSpan & aOutLabel) override; + CHIP_ERROR GetEnergyBalanceAtIndex(chip::EndpointId aEndpoint, size_t aIndex, chip::Percent & aOutStep, + chip::MutableCharSpan & aOutLabel) override; CHIP_ERROR GetEnergyPriorityAtIndex(chip::EndpointId aEndpoint, size_t aIndex, EnergyPriorityEnum & priority) override; - CHIP_ERROR GetLowPowerModeSensitivityAtIndex(chip::EndpointId aEndpoint, size_t aIndex, chip::Percent & aOutStep, chip::MutableCharSpan & aOutLabel) override; + CHIP_ERROR GetLowPowerModeSensitivityAtIndex(chip::EndpointId aEndpoint, size_t aIndex, chip::Percent & aOutStep, + chip::MutableCharSpan & aOutLabel) override; size_t GetNumEnergyBalances(chip::EndpointId aEndpoint) override; size_t GetNumLowPowerModeSensitivities(chip::EndpointId aEndpoint) override; @@ -60,7 +62,8 @@ size_t EPrefDelegate::GetNumLowPowerModeSensitivities(chip::EndpointId aEndpoint } CHIP_ERROR -EPrefDelegate::GetEnergyBalanceAtIndex(chip::EndpointId aEndpoint, size_t aIndex, chip::Percent & aOutStep, chip::MutableCharSpan & aOutLabel) +EPrefDelegate::GetEnergyBalanceAtIndex(chip::EndpointId aEndpoint, size_t aIndex, chip::Percent & aOutStep, + chip::MutableCharSpan & aOutLabel) { if (aIndex < GetNumEnergyBalances(aEndpoint)) { @@ -86,7 +89,8 @@ EPrefDelegate::GetEnergyPriorityAtIndex(chip::EndpointId aEndpoint, size_t aInde } CHIP_ERROR -EPrefDelegate::GetLowPowerModeSensitivityAtIndex(chip::EndpointId aEndpoint, size_t aIndex, chip::Percent & aOutStep, chip::MutableCharSpan & aOutLabel) +EPrefDelegate::GetLowPowerModeSensitivityAtIndex(chip::EndpointId aEndpoint, size_t aIndex, chip::Percent & aOutStep, + chip::MutableCharSpan & aOutLabel) { if (aIndex < GetNumLowPowerModeSensitivities(aEndpoint)) { diff --git a/src/app/clusters/energy-preference-server/energy-preference-server.cpp b/src/app/clusters/energy-preference-server/energy-preference-server.cpp index 049df38ac1b5ef..536489111d53c3 100644 --- a/src/app/clusters/energy-preference-server/energy-preference-server.cpp +++ b/src/app/clusters/energy-preference-server/energy-preference-server.cpp @@ -76,7 +76,7 @@ CHIP_ERROR EnergyPrefAttrAccess::Read(const ConcreteReadAttributePath & aPath, A CHIP_ERROR err = CHIP_NO_ERROR; while ((err = gsDelegate->GetEnergyBalanceAtIndex(endpoint, index, step, label)) == CHIP_NO_ERROR) { - BalanceStruct::Type balance = {step, Optional(label)}; + BalanceStruct::Type balance = { step, Optional(label) }; ReturnErrorOnFailure(encoder.Encode(balance)); index++; } @@ -129,7 +129,7 @@ CHIP_ERROR EnergyPrefAttrAccess::Read(const ConcreteReadAttributePath & aPath, A CHIP_ERROR err = CHIP_NO_ERROR; while ((err = gsDelegate->GetLowPowerModeSensitivityAtIndex(endpoint, index, step, label)) == CHIP_NO_ERROR) { - BalanceStruct::Type balance = {step, Optional(label)}; + BalanceStruct::Type balance = { step, Optional(label) }; ReturnErrorOnFailure(encoder.Encode(balance)); index++; } diff --git a/src/app/clusters/energy-preference-server/energy-preference-server.h b/src/app/clusters/energy-preference-server/energy-preference-server.h index f1efed55d9a0f1..78f0ea7fdbd21e 100644 --- a/src/app/clusters/energy-preference-server/energy-preference-server.h +++ b/src/app/clusters/energy-preference-server/energy-preference-server.h @@ -52,9 +52,8 @@ struct Delegate * * @return CHIP_ERROR_NOT_FOUND if the index is out of range. */ - virtual CHIP_ERROR - GetEnergyBalanceAtIndex(chip::EndpointId aEndpoint, size_t aIndex, - chip::Percent & aOutStep, chip::MutableCharSpan & aOutLabel) = 0; + virtual CHIP_ERROR GetEnergyBalanceAtIndex(chip::EndpointId aEndpoint, size_t aIndex, chip::Percent & aOutStep, + chip::MutableCharSpan & aOutLabel) = 0; /** * Get an Energy Priority. @@ -84,9 +83,8 @@ struct Delegate * * @return CHIP_ERROR_NOT_FOUND if the index is out of range. */ - virtual CHIP_ERROR - GetLowPowerModeSensitivityAtIndex(chip::EndpointId aEndpoint, size_t aIndex, - chip::Percent & aOutStep, chip::MutableCharSpan & aOutLabel) = 0; + virtual CHIP_ERROR GetLowPowerModeSensitivityAtIndex(chip::EndpointId aEndpoint, size_t aIndex, chip::Percent & aOutStep, + chip::MutableCharSpan & aOutLabel) = 0; /** * Get the number of energy balances this endpoint has.