Skip to content

Commit 1d697d1

Browse files
restyled-commitserwinpan1
authored andcommitted
Restyled by clang-format
1 parent f26ca9e commit 1d697d1

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

examples/chef/common/clusters/media-input/MediaInputManager.cpp

+8-6
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
* limitations under the License.
1616
*/
1717

18-
#include <app/util/config.h>
1918
#include <app-common/zap-generated/attributes/Accessors.h>
19+
#include <app/util/config.h>
2020
#include <map>
2121

2222
#ifdef MATTER_DM_PLUGIN_MEDIA_INPUT_SERVER
@@ -27,7 +27,7 @@ using namespace chip;
2727
using namespace chip::app::Clusters::MediaInput;
2828
using Protocols::InteractionModel::Status;
2929

30-
MediaInputManager::MediaInputManager(chip::EndpointId endpoint):mEndpoint(endpoint)
30+
MediaInputManager::MediaInputManager(chip::EndpointId endpoint) : mEndpoint(endpoint)
3131
{
3232
struct InputData inputData1(1, chip::app::Clusters::MediaInput::InputTypeEnum::kHdmi, "HDMI 1",
3333
"High-Definition Multimedia Interface");
@@ -42,7 +42,8 @@ MediaInputManager::MediaInputManager(chip::EndpointId endpoint):mEndpoint(endpoi
4242
// Sync the attributes from attribute storage
4343
Status status = Attributes::CurrentInput::Get(endpoint, &mCurrentInput);
4444

45-
if (Status::Success != status) {
45+
if (Status::Success != status)
46+
{
4647
ChipLogError(Zcl, "Unable to save CurrentInput attribute, err:0x%x", to_underlying(status));
4748
mCurrentInput = 1;
4849
}
@@ -66,7 +67,8 @@ uint8_t MediaInputManager::HandleGetCurrentInput()
6667

6768
bool MediaInputManager::HandleSelectInput(const uint8_t index)
6869
{
69-
if (mCurrentInput == index) {
70+
if (mCurrentInput == index)
71+
{
7072
ChipLogProgress(Zcl, "CurrentInput is same as new value: %u", index);
7173
return true;
7274
}
@@ -77,7 +79,8 @@ bool MediaInputManager::HandleSelectInput(const uint8_t index)
7779
mCurrentInput = index;
7880
// Sync the CurrentInput to attribute storage while reporting changes
7981
Status status = chip::app::Clusters::MediaInput::Attributes::CurrentInput::Set(mEndpoint, index);
80-
if (Status::Success != status) {
82+
if (Status::Success != status)
83+
{
8184
ChipLogError(Zcl, "CurrentInput is not stored successfully, err:0x%x", to_underlying(status));
8285
}
8386
return true;
@@ -128,6 +131,5 @@ void emberAfMediaInputClusterInitCallback(EndpointId endpoint)
128131
gMediaInputManagerInstance[endpoint] = std::make_unique<MediaInputManager>(endpoint);
129132

130133
chip::app::Clusters::MediaInput::SetDefaultDelegate(endpoint, gMediaInputManagerInstance[endpoint].get());
131-
132134
}
133135
#endif // MATTER_DM_PLUGIN_MEDIA_INPUT_SERVER

examples/chef/common/clusters/media-playback/MediaPlaybackManager.cpp

+6-5
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@
1515
* limitations under the License.
1616
*/
1717

18+
#include <app-common/zap-generated/attributes/Accessors.h>
1819
#include <app/util/config.h>
1920
#include <map>
2021
#include <string>
21-
#include <app-common/zap-generated/attributes/Accessors.h>
22-
#include <app/util/config.h>
2322
#ifdef MATTER_DM_PLUGIN_MEDIA_PLAYBACK_SERVER
2423
#include "MediaPlaybackManager.h"
2524

@@ -103,11 +102,12 @@ CHIP_ERROR MediaPlaybackManager::HandleGetAvailableTextTracks(AttributeValueEnco
103102

104103
CHIP_ERROR MediaPlaybackManager::HandleSetCurrentState(chip::app::Clusters::MediaPlayback::PlaybackStateEnum currentState)
105104
{
106-
mCurrentState = currentState;
105+
mCurrentState = currentState;
107106

108107
Status status = Attributes::CurrentState::Set(mEndpoint, currentState);
109108

110-
if (Status::Success != status) {
109+
if (Status::Success != status)
110+
{
111111
ChipLogError(Zcl, "Unable to save CurrentState attribute, 0x%x", to_underlying(status));
112112
}
113113

@@ -120,7 +120,8 @@ CHIP_ERROR MediaPlaybackManager::HandleSetPlaybackSpeed(float playbackSpeed)
120120

121121
Status status = Attributes::PlaybackSpeed::Set(mEndpoint, playbackSpeed);
122122

123-
if (Status::Success != status) {
123+
if (Status::Success != status)
124+
{
124125
ChipLogError(Zcl, "Unable to set PlaybackSpeed attribute, 0x%x", to_underlying(status));
125126
}
126127

examples/chef/common/clusters/media-playback/MediaPlaybackManager.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class MediaPlaybackManager : public chip::app::Clusters::MediaPlayback::Delegate
3030
using Feature = chip::app::Clusters::MediaPlayback::Feature;
3131

3232
public:
33-
MediaPlaybackManager(chip::EndpointId endpoint): mEndpoint(endpoint) { };
33+
MediaPlaybackManager(chip::EndpointId endpoint) : mEndpoint(endpoint){};
3434

3535
chip::app::Clusters::MediaPlayback::PlaybackStateEnum HandleGetCurrentState() override;
3636
uint64_t HandleGetStartTime() override;

0 commit comments

Comments
 (0)