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 Feb 13, 2024
1 parent d39c234 commit 61c1c1f
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ bool AudioOutputManager::HandleRenameOutput(const uint8_t & index, const chip::C
{
if (output.index == index)
{
const size_t len = std::min(mNameLenMax, name.size());
const size_t len = std::min(mNameLenMax, name.size());
memcpy(mOutputName[index], name.data(), len);
output.name = mOutputName[index];
return true;
Expand All @@ -78,7 +78,7 @@ bool AudioOutputManager::HandleSelectOutput(const uint8_t & index)
{
if (output.index == index)
{
mCurrentOutput = index;
mCurrentOutput = index;
return true;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ class AudioOutputManager : public chip::app::Clusters::AudioOutput::Delegate
CHIP_ERROR HandleGetOutputList(chip::app::AttributeValueEncoder & aEncoder) override;
bool HandleRenameOutput(const uint8_t & index, const chip::CharSpan & name) override;
bool HandleSelectOutput(const uint8_t & index) override;
CHIP_ERROR GetOutputName(uint8_t index, chip::CharSpan & name) {
if (index < mOutputs.size()) {
CHIP_ERROR GetOutputName(uint8_t index, chip::CharSpan & name)
{
if (index < mOutputs.size())
{
name = chip::CharSpan::fromCharString(mOutputName[index]);
return CHIP_NO_ERROR;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/chef/common/clusters/channel/ChannelManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ void ChannelManager::HandleChangeChannel(CommandResponseHelper<ChangeChannelResp

bool ChannelManager::HandleChangeChannelByNumber(const uint16_t & majorNumber, const uint16_t & minorNumber)
{
uint16_t index = 0;
uint16_t index = 0;
for (auto const & channel : mChannels)
{
// verify if major & minor matches one of the channel from the list
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ bool MediaInputManager::HandleSelectInput(const uint8_t index)
{
if (input.index == index)
{
mCurrentInput = index;
mCurrentInput = index;
return true;
}
}
Expand Down Expand Up @@ -94,7 +94,7 @@ bool MediaInputManager::HandleRenameInput(const uint8_t index, const chip::CharS
{
if (input.index == index)
{
const size_t len = std::min(mNameLenMax, name.size());
const size_t len = std::min(mNameLenMax, name.size());
memcpy(mInputName[index], name.data(), len);
input.name = mInputName[index];
return true;
Expand Down
6 changes: 4 additions & 2 deletions examples/chef/common/clusters/media-input/MediaInputManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ class MediaInputManager : public chip::app::Clusters::MediaInput::Delegate
bool HandleShowInputStatus() override;
bool HandleHideInputStatus() override;
bool HandleRenameInput(const uint8_t index, const chip::CharSpan & name) override;
CHIP_ERROR GetInputName(uint8_t index, chip::CharSpan & name) {
if (index < mInputs.size()) {
CHIP_ERROR GetInputName(uint8_t index, chip::CharSpan & name)
{
if (index < mInputs.size())
{
name = chip::CharSpan::fromCharString(mInputName[index]);
return CHIP_NO_ERROR;
}
Expand Down

0 comments on commit 61c1c1f

Please sign in to comment.