diff --git a/examples/chef/common/clusters/media-input/MediaInputManager.cpp b/examples/chef/common/clusters/media-input/MediaInputManager.cpp index 05929125875b21..2b3abc7d3cbf40 100644 --- a/examples/chef/common/clusters/media-input/MediaInputManager.cpp +++ b/examples/chef/common/clusters/media-input/MediaInputManager.cpp @@ -15,8 +15,8 @@ * limitations under the License. */ -#include #include +#include #include #ifdef MATTER_DM_PLUGIN_MEDIA_INPUT_SERVER @@ -27,7 +27,7 @@ using namespace chip; using namespace chip::app::Clusters::MediaInput; using Protocols::InteractionModel::Status; -MediaInputManager::MediaInputManager(chip::EndpointId endpoint):mEndpoint(endpoint) +MediaInputManager::MediaInputManager(chip::EndpointId endpoint) : mEndpoint(endpoint) { struct InputData inputData1(1, chip::app::Clusters::MediaInput::InputTypeEnum::kHdmi, "HDMI 1", "High-Definition Multimedia Interface"); @@ -42,7 +42,8 @@ MediaInputManager::MediaInputManager(chip::EndpointId endpoint):mEndpoint(endpoi // Sync the attributes from attribute storage Status status = Attributes::CurrentInput::Get(endpoint, &mCurrentInput); - if (Status::Success != status) { + if (Status::Success != status) + { ChipLogError(Zcl, "Unable to save CurrentInput attribute, err:0x%x", to_underlying(status)); mCurrentInput = 1; } @@ -66,7 +67,8 @@ uint8_t MediaInputManager::HandleGetCurrentInput() bool MediaInputManager::HandleSelectInput(const uint8_t index) { - if (mCurrentInput == index) { + if (mCurrentInput == index) + { ChipLogProgress(Zcl, "CurrentInput is same as new value: %u", index); return true; } @@ -77,7 +79,8 @@ bool MediaInputManager::HandleSelectInput(const uint8_t index) mCurrentInput = index; // Sync the CurrentInput to attribute storage while reporting changes Status status = chip::app::Clusters::MediaInput::Attributes::CurrentInput::Set(mEndpoint, index); - if (Status::Success != status) { + if (Status::Success != status) + { ChipLogError(Zcl, "CurrentInput is not stored successfully, err:0x%x", to_underlying(status)); } return true; @@ -128,6 +131,5 @@ void emberAfMediaInputClusterInitCallback(EndpointId endpoint) gMediaInputManagerInstance[endpoint] = std::make_unique(endpoint); chip::app::Clusters::MediaInput::SetDefaultDelegate(endpoint, gMediaInputManagerInstance[endpoint].get()); - } #endif // MATTER_DM_PLUGIN_MEDIA_INPUT_SERVER diff --git a/examples/chef/common/clusters/media-playback/MediaPlaybackManager.cpp b/examples/chef/common/clusters/media-playback/MediaPlaybackManager.cpp index 4628b6f4fbf1c2..4a6dc687a7ef1e 100644 --- a/examples/chef/common/clusters/media-playback/MediaPlaybackManager.cpp +++ b/examples/chef/common/clusters/media-playback/MediaPlaybackManager.cpp @@ -15,11 +15,10 @@ * limitations under the License. */ +#include #include #include #include -#include -#include #ifdef MATTER_DM_PLUGIN_MEDIA_PLAYBACK_SERVER #include "MediaPlaybackManager.h" @@ -103,11 +102,12 @@ CHIP_ERROR MediaPlaybackManager::HandleGetAvailableTextTracks(AttributeValueEnco CHIP_ERROR MediaPlaybackManager::HandleSetCurrentState(chip::app::Clusters::MediaPlayback::PlaybackStateEnum currentState) { - mCurrentState = currentState; + mCurrentState = currentState; Status status = Attributes::CurrentState::Set(mEndpoint, currentState); - if (Status::Success != status) { + if (Status::Success != status) + { ChipLogError(Zcl, "Unable to save CurrentState attribute, 0x%x", to_underlying(status)); } @@ -120,7 +120,8 @@ CHIP_ERROR MediaPlaybackManager::HandleSetPlaybackSpeed(float playbackSpeed) Status status = Attributes::PlaybackSpeed::Set(mEndpoint, playbackSpeed); - if (Status::Success != status) { + if (Status::Success != status) + { ChipLogError(Zcl, "Unable to set PlaybackSpeed attribute, 0x%x", to_underlying(status)); } diff --git a/examples/chef/common/clusters/media-playback/MediaPlaybackManager.h b/examples/chef/common/clusters/media-playback/MediaPlaybackManager.h index 1e6c3998ae29db..33ba87c6b6e4a7 100644 --- a/examples/chef/common/clusters/media-playback/MediaPlaybackManager.h +++ b/examples/chef/common/clusters/media-playback/MediaPlaybackManager.h @@ -30,7 +30,7 @@ class MediaPlaybackManager : public chip::app::Clusters::MediaPlayback::Delegate using Feature = chip::app::Clusters::MediaPlayback::Feature; public: - MediaPlaybackManager(chip::EndpointId endpoint): mEndpoint(endpoint) { }; + MediaPlaybackManager(chip::EndpointId endpoint) : mEndpoint(endpoint){}; chip::app::Clusters::MediaPlayback::PlaybackStateEnum HandleGetCurrentState() override; uint64_t HandleGetStartTime() override;