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 erwinpan1 committed Aug 21, 2024
1 parent f26ca9e commit 1d697d1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
14 changes: 8 additions & 6 deletions examples/chef/common/clusters/media-input/MediaInputManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
* limitations under the License.
*/

#include <app/util/config.h>
#include <app-common/zap-generated/attributes/Accessors.h>
#include <app/util/config.h>
#include <map>

#ifdef MATTER_DM_PLUGIN_MEDIA_INPUT_SERVER
Expand All @@ -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");
Expand All @@ -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;
}
Expand All @@ -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;
}
Expand All @@ -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;
Expand Down Expand Up @@ -128,6 +131,5 @@ void emberAfMediaInputClusterInitCallback(EndpointId endpoint)
gMediaInputManagerInstance[endpoint] = std::make_unique<MediaInputManager>(endpoint);

chip::app::Clusters::MediaInput::SetDefaultDelegate(endpoint, gMediaInputManagerInstance[endpoint].get());

}
#endif // MATTER_DM_PLUGIN_MEDIA_INPUT_SERVER
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@
* limitations under the License.
*/

#include <app-common/zap-generated/attributes/Accessors.h>
#include <app/util/config.h>
#include <map>
#include <string>
#include <app-common/zap-generated/attributes/Accessors.h>
#include <app/util/config.h>
#ifdef MATTER_DM_PLUGIN_MEDIA_PLAYBACK_SERVER
#include "MediaPlaybackManager.h"

Expand Down Expand Up @@ -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));
}

Expand All @@ -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));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1d697d1

Please sign in to comment.