Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a29413f

Browse files
committedAug 27, 2024·
Fix type in error messages
1 parent a0d8cec commit a29413f

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed
 

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ using Protocols::InteractionModel::Status;
2929

3030
MediaInputManager::MediaInputManager(chip::EndpointId endpoint) : mEndpoint(endpoint)
3131
{
32-
struct InputData inputData1(1, chip::app::Clusters::MediaInput::InputTypeEnum::kHdmi, "HDMI 1",
32+
struct InputData inputData1(1, InputTypeEnum::kHdmi, "HDMI 1",
3333
"High-Definition Multimedia Interface");
3434
mInputs.push_back(inputData1);
35-
struct InputData inputData2(2, chip::app::Clusters::MediaInput::InputTypeEnum::kHdmi, "HDMI 2",
35+
struct InputData inputData2(2, InputTypeEnum::kHdmi, "HDMI 2",
3636
"High-Definition Multimedia Interface");
3737
mInputs.push_back(inputData2);
38-
struct InputData inputData3(3, chip::app::Clusters::MediaInput::InputTypeEnum::kHdmi, "HDMI 3",
38+
struct InputData inputData3(3, InputTypeEnum::kHdmi, "HDMI 3",
3939
"High-Definition Multimedia Interface");
4040
mInputs.push_back(inputData3);
4141
}
@@ -57,7 +57,7 @@ uint8_t MediaInputManager::HandleGetCurrentInput()
5757
Status status = Attributes::CurrentInput::Get(mEndpoint, &currentInput);
5858
if (Status::Success != status)
5959
{
60-
ChipLogError(Zcl, "Unable to save CurrentInput attribute, err:0x%x", to_underlying(status));
60+
ChipLogError(Zcl, "Unable to get CurrentInput attribute, err:0x%x", to_underlying(status));
6161
}
6262
return currentInput;
6363
}
@@ -74,7 +74,7 @@ bool MediaInputManager::HandleSelectInput(const uint8_t index)
7474
if (inputData.index == index)
7575
{
7676
// Sync the CurrentInput to attribute storage while reporting changes
77-
Status status = chip::app::Clusters::MediaInput::Attributes::CurrentInput::Set(mEndpoint, index);
77+
Status status = Attributes::CurrentInput::Set(mEndpoint, index);
7878
if (Status::Success != status)
7979
{
8080
ChipLogError(Zcl, "CurrentInput is not stored successfully, err:0x%x", to_underlying(status));
@@ -127,6 +127,6 @@ void emberAfMediaInputClusterInitCallback(EndpointId endpoint)
127127

128128
gMediaInputManagerInstance[endpoint] = std::make_unique<MediaInputManager>(endpoint);
129129

130-
chip::app::Clusters::MediaInput::SetDefaultDelegate(endpoint, gMediaInputManagerInstance[endpoint].get());
130+
SetDefaultDelegate(endpoint, gMediaInputManagerInstance[endpoint].get());
131131
}
132132
#endif // MATTER_DM_PLUGIN_MEDIA_INPUT_SERVER

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

+7-7
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ PlaybackStateEnum MediaPlaybackManager::HandleGetCurrentState()
4040
Status status = Attributes::CurrentState::Get(mEndpoint, &currentState);
4141
if (Status::Success != status)
4242
{
43-
ChipLogError(Zcl, "Unable to save CurrentStage attribute, err:0x%x", to_underlying(status));
43+
ChipLogError(Zcl, "Unable to get CurrentStage attribute, err:0x%x", to_underlying(status));
4444
}
4545
return currentState;
4646
}
@@ -67,7 +67,7 @@ float MediaPlaybackManager::HandleGetPlaybackSpeed()
6767
Status status = Attributes::PlaybackSpeed::Get(mEndpoint, &playbackSpeed);
6868
if (Status::Success != status)
6969
{
70-
ChipLogError(Zcl, "Unable to save PlaybackSpeed attribute, err:0x%x", to_underlying(status));
70+
ChipLogError(Zcl, "Unable to get PlaybackSpeed attribute, err:0x%x", to_underlying(status));
7171
}
7272
return playbackSpeed;
7373
}
@@ -114,16 +114,16 @@ CHIP_ERROR MediaPlaybackManager::HandleGetAvailableTextTracks(AttributeValueEnco
114114
});
115115
}
116116

117-
CHIP_ERROR MediaPlaybackManager::HandleSetCurrentState(chip::app::Clusters::MediaPlayback::PlaybackStateEnum currentState)
117+
CHIP_ERROR MediaPlaybackManager::HandleSetCurrentState(PlaybackStateEnum currentState)
118118
{
119119
Status status = Attributes::CurrentState::Set(mEndpoint, currentState);
120120

121121
if (Status::Success != status)
122122
{
123-
ChipLogError(Zcl, "Unable to save CurrentState attribute, 0x%x", to_underlying(status));
123+
ChipLogError(Zcl, "Unable to set CurrentState attribute, 0x%x", to_underlying(status));
124124
}
125125

126-
return CHIP_NO_ERROR;
126+
return CHIP_ERROR_IM_GLOBAL_STATUS_VALUE(status);
127127
}
128128

129129
CHIP_ERROR MediaPlaybackManager::HandleSetPlaybackSpeed(float playbackSpeed)
@@ -135,7 +135,7 @@ CHIP_ERROR MediaPlaybackManager::HandleSetPlaybackSpeed(float playbackSpeed)
135135
ChipLogError(Zcl, "Unable to set PlaybackSpeed attribute, 0x%x", to_underlying(status));
136136
}
137137

138-
return CHIP_NO_ERROR;
138+
return CHIP_ERROR_IM_GLOBAL_STATUS_VALUE(status);
139139
}
140140

141141
void MediaPlaybackManager::HandlePlay(CommandResponseHelper<Commands::PlaybackResponse::Type> & helper)
@@ -391,7 +391,7 @@ void emberAfMediaPlaybackClusterInitCallback(EndpointId endpoint)
391391

392392
gMediaPlaybackManagerInstance[endpoint] = std::make_unique<MediaPlaybackManager>(endpoint);
393393

394-
chip::app::Clusters::MediaPlayback::SetDefaultDelegate(endpoint, gMediaPlaybackManagerInstance[endpoint].get());
394+
SetDefaultDelegate(endpoint, gMediaPlaybackManagerInstance[endpoint].get());
395395
}
396396

397397
#endif /// MATTER_DM_PLUGIN_MEDIA_PLAYBACK_SERVER

0 commit comments

Comments
 (0)
Please sign in to comment.