Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Chef] Fix basicvideoplayer device type #32091

Merged
merged 16 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/chef/chef.py
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,7 @@ def main() -> int:
'import("${chip_root}/config/standalone/args.gni")',
'chip_shell_cmd_server = false',
'chip_build_libshell = true',
'chip_enable_openthread = false',
'chip_config_network_layer_ble = false',
'chip_device_project_config_include = "<CHIPProjectAppConfig.h>"',
'chip_project_config_include = "<CHIPProjectAppConfig.h>"',
Expand Down
226 changes: 0 additions & 226 deletions examples/chef/common/chef-channel-manager.cpp

This file was deleted.

55 changes: 0 additions & 55 deletions examples/chef/common/chef-channel-manager.h

This file was deleted.

83 changes: 83 additions & 0 deletions examples/chef/common/clusters/audio-output/AudioOutputManager.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/*
*
* Copyright (c) 2021 Project CHIP Authors
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include <app/util/config.h>
#ifdef MATTER_DM_PLUGIN_AUDIO_OUTPUT_SERVER
#include "AudioOutputManager.h"

using namespace std;
using namespace chip::app;
using namespace chip::app::Clusters::AudioOutput;
using chip::app::AttributeValueEncoder;

AudioOutputManager::AudioOutputManager()
{
struct OutputData outputData1(1, chip::app::Clusters::AudioOutput::OutputTypeEnum::kHdmi, "HDMI 1");
mOutputs.push_back(outputData1);
struct OutputData outputData2(2, chip::app::Clusters::AudioOutput::OutputTypeEnum::kHdmi, "HDMI 2");
mOutputs.push_back(outputData2);
struct OutputData outputData3(3, chip::app::Clusters::AudioOutput::OutputTypeEnum::kHdmi, "HDMI 3");
mOutputs.push_back(outputData3);

mCurrentOutput = 1;
}

uint8_t AudioOutputManager::HandleGetCurrentOutput()
{
return mCurrentOutput;
}

CHIP_ERROR AudioOutputManager::HandleGetOutputList(AttributeValueEncoder & aEncoder)
{
return aEncoder.EncodeList([this](const auto & encoder) -> CHIP_ERROR {
for (auto const & outputData : mOutputs)
{
ReturnErrorOnFailure(encoder.Encode(outputData.GetEncodable()));
}
return CHIP_NO_ERROR;
});
}

bool AudioOutputManager::HandleRenameOutput(const uint8_t & index, const chip::CharSpan & newName)
{
for (auto & outputData : mOutputs)
{
if (outputData.index == index)
{
outputData.Rename(newName);
return true;
}
}

return false;
}

bool AudioOutputManager::HandleSelectOutput(const uint8_t & index)
andy31415 marked this conversation as resolved.
Show resolved Hide resolved
{
for (auto & outputData : mOutputs)
{
if (outputData.index == index)
{
mCurrentOutput = index;
return true;
}
}

return false;
}
#endif // MATTER_DM_PLUGIN_AUDIO_OUTPUT_SERVER
Loading
Loading