From c96e5b8a8a815844d12e787c7fd56b16abf1c44f Mon Sep 17 00:00:00 2001 From: Lazar Kovacic Date: Tue, 28 Dec 2021 22:58:55 +0100 Subject: [PATCH] Restyle fix --- examples/all-clusters-app/linux/BUILD.gn | 2 +- .../linux/include/tv-callbacks.cpp | 4 +- examples/all-clusters-app/linux/main.cpp | 3 +- .../mbed/main/LowPowerManager.cpp | 4 +- .../include/low-power/LowPowerManager.cpp | 4 +- .../account-login/AccountLoginManager.cpp | 3 +- .../account-login/AccountLoginManager.h | 5 +- .../ApplicationBasicManager.cpp | 26 ++++++--- .../ApplicationLauncherManager.cpp | 24 ++++---- .../ApplicationLauncherManager.h | 11 ++-- .../audio-output/AudioOutputManager.cpp | 14 +++-- .../tv-app/android/include/cluster-init.cpp | 4 -- .../TargetNavigatorManager.cpp | 5 +- .../target-navigator/TargetNavigatorManager.h | 3 +- .../tv-app/android/java/ChannelManager.cpp | 31 +++++----- .../android/java/ContentLauncherManager.cpp | 11 ++-- .../android/java/ContentLauncherManager.h | 10 ++-- .../android/java/KeypadInputManager.cpp | 8 +-- .../tv-app/android/java/KeypadInputManager.h | 3 +- .../tv-app/android/java/LowPowerManager.cpp | 3 +- .../tv-app/android/java/MediaInputManager.cpp | 14 ++--- .../tv-app/android/java/MediaInputManager.h | 2 +- .../android/java/MediaPlaybackManager.cpp | 7 +-- .../android/java/MediaPlaybackManager.h | 14 +++-- .../tv-app/android/java/WakeOnLanManager.cpp | 7 ++- .../account-login/AccountLoginManager.cpp | 3 +- .../account-login/AccountLoginManager.h | 5 +- .../ApplicationBasicManager.cpp | 26 ++++++--- .../ApplicationLauncherManager.cpp | 24 ++++---- .../ApplicationLauncherManager.h | 11 ++-- .../audio-output/AudioOutputManager.cpp | 14 +++-- .../linux/include/channel/ChannelManager.cpp | 12 ++-- .../ContentLauncherManager.cpp | 10 ++-- .../content-launcher/ContentLauncherManager.h | 10 ++-- .../include/keypad-input/KeypadInputManager.h | 3 +- .../include/low-power/LowPowerManager.cpp | 4 +- .../include/media-input/MediaInputManager.cpp | 12 ++-- .../media-playback/MediaPlaybackManager.cpp | 6 +- .../media-playback/MediaPlaybackManager.h | 9 ++- .../TargetNavigatorManager.cpp | 5 +- .../target-navigator/TargetNavigatorManager.h | 3 +- .../include/wake-on-lan/WakeOnLanManager.cpp | 5 +- .../include/wake-on-lan/WakeOnLanManager.h | 2 +- .../account-login-delegate.h | 6 +- .../account-login-server.cpp | 26 ++++----- .../application-basic-delegate.h | 14 ++--- .../application-basic-server.cpp | 7 +-- .../application-launcher-delegate.h | 15 +++-- .../application-launcher-server.cpp | 24 ++++---- .../audio-output-delegate.h | 4 +- .../audio-output-server.cpp | 25 ++++----- .../channel-server/channel-delegate.h | 10 ++-- .../channel-server/channel-server.cpp | 28 +++++----- .../content-launch-delegate.h | 6 +- .../content-launch-server.cpp | 13 +++-- .../keypad-input-server.cpp | 12 ++-- .../low-power-server/low-power-server.cpp | 9 ++- .../low-power-server/low-power-server.h | 4 +- .../media-input-server/media-input-delegate.h | 14 ++--- .../media-input-server/media-input-server.cpp | 37 ++++++------ .../media-playback-delegate.h | 36 ++++++------ .../media-playback-server.cpp | 56 +++++++++---------- .../target-navigator-delegate.h | 6 +- .../target-navigator-server.cpp | 13 ++--- .../target-navigator-server.h | 4 +- .../wake-on-lan-server/wake-on-lan-server.cpp | 9 +-- src/app/util/ContentApp.cpp | 5 +- src/app/util/ContentApp.h | 6 +- 68 files changed, 398 insertions(+), 377 deletions(-) diff --git a/examples/all-clusters-app/linux/BUILD.gn b/examples/all-clusters-app/linux/BUILD.gn index 31dda103c83bba..9f2870d976d65b 100644 --- a/examples/all-clusters-app/linux/BUILD.gn +++ b/examples/all-clusters-app/linux/BUILD.gn @@ -20,8 +20,8 @@ executable("chip-all-clusters-app") { "${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/ota-requestor-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp", - "include/tv-callbacks.h", "include/tv-callbacks.cpp", + "include/tv-callbacks.h", "main.cpp", ] diff --git a/examples/all-clusters-app/linux/include/tv-callbacks.cpp b/examples/all-clusters-app/linux/include/tv-callbacks.cpp index 4c434b2ce0e8cb..33a8154e9be6d7 100644 --- a/examples/all-clusters-app/linux/include/tv-callbacks.cpp +++ b/examples/all-clusters-app/linux/include/tv-callbacks.cpp @@ -24,7 +24,7 @@ #include "tv-callbacks.h" -bool LowPowerManager::HandleSleep() +bool LowPowerManager::HandleSleep() { return true; -} \ No newline at end of file +} diff --git a/examples/all-clusters-app/linux/main.cpp b/examples/all-clusters-app/linux/main.cpp index c6d1c8ea667bde..f7a58ab4e5dcfc 100644 --- a/examples/all-clusters-app/linux/main.cpp +++ b/examples/all-clusters-app/linux/main.cpp @@ -16,12 +16,12 @@ * limitations under the License. */ +#include "include/tv-callbacks.h" #include #include #include #include #include -#include "include/tv-callbacks.h" #include "AppMain.h" @@ -29,7 +29,6 @@ using namespace chip; using namespace chip::app; using namespace chip::DeviceLayer; - namespace { static LowPowerManager lowPowerManager; } // namespace diff --git a/examples/all-clusters-app/mbed/main/LowPowerManager.cpp b/examples/all-clusters-app/mbed/main/LowPowerManager.cpp index 8b9c51941876bf..57399c0ba1de5c 100644 --- a/examples/all-clusters-app/mbed/main/LowPowerManager.cpp +++ b/examples/all-clusters-app/mbed/main/LowPowerManager.cpp @@ -18,8 +18,8 @@ #include "LowPowerManager.h" -bool LowPowerManager::HandleSleep() +bool LowPowerManager::HandleSleep() { // TODO: Insert code here return true; -} \ No newline at end of file +} diff --git a/examples/thermostat/linux/include/low-power/LowPowerManager.cpp b/examples/thermostat/linux/include/low-power/LowPowerManager.cpp index 8b9c51941876bf..57399c0ba1de5c 100644 --- a/examples/thermostat/linux/include/low-power/LowPowerManager.cpp +++ b/examples/thermostat/linux/include/low-power/LowPowerManager.cpp @@ -18,8 +18,8 @@ #include "LowPowerManager.h" -bool LowPowerManager::HandleSleep() +bool LowPowerManager::HandleSleep() { // TODO: Insert code here return true; -} \ No newline at end of file +} diff --git a/examples/tv-app/android/include/account-login/AccountLoginManager.cpp b/examples/tv-app/android/include/account-login/AccountLoginManager.cpp index 2afc569c79f19a..f391901e136e32 100644 --- a/examples/tv-app/android/include/account-login/AccountLoginManager.cpp +++ b/examples/tv-app/android/include/account-login/AccountLoginManager.cpp @@ -34,7 +34,6 @@ bool AccountLoginManager::HandleLogin(const chip::CharSpan & tempAccountIdentifi return true; } - bool AccountLoginManager::HandleLogout() { // TODO: Insert your code here to send logout request @@ -47,6 +46,6 @@ Commands::GetSetupPINResponse::Type AccountLoginManager::HandleGetSetupPin(const ChipLogProgress(Zcl, "temporary account id: %s", tempAccountIdentifierString.c_str()); // TODO: Insert your code here to handle get setup pin Commands::GetSetupPINResponse::Type response; - response.setupPIN = chip::CharSpan("tempPin123", strlen("tempPin123")); + response.setupPIN = chip::CharSpan("tempPin123", strlen("tempPin123")); return response; } diff --git a/examples/tv-app/android/include/account-login/AccountLoginManager.h b/examples/tv-app/android/include/account-login/AccountLoginManager.h index afff5bca7e6ac7..68584ae6ec7bd5 100644 --- a/examples/tv-app/android/include/account-login/AccountLoginManager.h +++ b/examples/tv-app/android/include/account-login/AccountLoginManager.h @@ -25,7 +25,8 @@ class AccountLoginManager : public chip::app::Clusters::AccountLogin::Delegate { public: - bool HandleLogin(const chip::CharSpan & tempAccountIdentifierString, const chip::CharSpan & setupPinString) override; + bool HandleLogin(const chip::CharSpan & tempAccountIdentifierString, const chip::CharSpan & setupPinString) override; bool HandleLogout() override; - chip::app::Clusters::AccountLogin::Commands::GetSetupPINResponse::Type HandleGetSetupPin(const chip::CharSpan & tempAccountIdentifierString) override; + chip::app::Clusters::AccountLogin::Commands::GetSetupPINResponse::Type + HandleGetSetupPin(const chip::CharSpan & tempAccountIdentifierString) override; }; diff --git a/examples/tv-app/android/include/application-basic/ApplicationBasicManager.cpp b/examples/tv-app/android/include/application-basic/ApplicationBasicManager.cpp index dc7b2d683d403d..1a979da92efcc7 100644 --- a/examples/tv-app/android/include/application-basic/ApplicationBasicManager.cpp +++ b/examples/tv-app/android/include/application-basic/ApplicationBasicManager.cpp @@ -21,37 +21,45 @@ using namespace std; using namespace chip::app::Clusters::ApplicationBasic; -chip::CharSpan ApplicationBasicManager::HandleGetVendorName() { +chip::CharSpan ApplicationBasicManager::HandleGetVendorName() +{ return chip::CharSpan("exampleVendorName1", strlen("exampleVendorName1")); } -uint16_t ApplicationBasicManager::HandleGetVendorId() { +uint16_t ApplicationBasicManager::HandleGetVendorId() +{ return 1; } -chip::CharSpan ApplicationBasicManager::HandleGetApplicationName() { +chip::CharSpan ApplicationBasicManager::HandleGetApplicationName() +{ return chip::CharSpan("exampleName1", strlen("exampleName1")); } -uint16_t ApplicationBasicManager::HandleGetProductId() { +uint16_t ApplicationBasicManager::HandleGetProductId() +{ return 1; } -chip::app::Clusters::ApplicationBasic::Structs::Application::Type ApplicationBasicManager::HandleGetApplication() { +chip::app::Clusters::ApplicationBasic::Structs::Application::Type ApplicationBasicManager::HandleGetApplication() +{ chip::app::Clusters::ApplicationBasic::Structs::Application::Type application; application.catalogVendorId = 123; - application.applicationId = chip::CharSpan("applicationId", strlen("applicationId")); + application.applicationId = chip::CharSpan("applicationId", strlen("applicationId")); return application; } -ApplicationStatusEnum ApplicationBasicManager::HandleGetStatus() { +ApplicationStatusEnum ApplicationBasicManager::HandleGetStatus() +{ return ApplicationStatusEnum::kStopped; } -chip::CharSpan ApplicationBasicManager::HandleGetApplicationVersion() { +chip::CharSpan ApplicationBasicManager::HandleGetApplicationVersion() +{ return chip::CharSpan("exampleVersion", strlen("exampleVersion")); } -std::list ApplicationBasicManager::HandleGetAllowedVendorList() { +std::list ApplicationBasicManager::HandleGetAllowedVendorList() +{ return { 123, 456 }; } diff --git a/examples/tv-app/android/include/application-launcher/ApplicationLauncherManager.cpp b/examples/tv-app/android/include/application-launcher/ApplicationLauncherManager.cpp index 82104d7ecb753f..f6a8afc0ae8ee7 100644 --- a/examples/tv-app/android/include/application-launcher/ApplicationLauncherManager.cpp +++ b/examples/tv-app/android/include/application-launcher/ApplicationLauncherManager.cpp @@ -21,44 +21,46 @@ using namespace std; using namespace chip::app::Clusters::ApplicationLauncher; -Structs::ApplicationEP::Type ApplicationLauncherManager::HandleGetCurrentApp() +Structs::ApplicationEP::Type ApplicationLauncherManager::HandleGetCurrentApp() { Structs::ApplicationEP::Type currentApp; currentApp.application.catalogVendorId = 123; - currentApp.application.applicationId = chip::CharSpan("applicationId", strlen("applicationId")); - currentApp.endpoint = chip::CharSpan("endpointId", strlen("endpointId")); + currentApp.application.applicationId = chip::CharSpan("applicationId", strlen("applicationId")); + currentApp.endpoint = chip::CharSpan("endpointId", strlen("endpointId")); return currentApp; } -std::list ApplicationLauncherManager::HandleGetCatalogList() +std::list ApplicationLauncherManager::HandleGetCatalogList() { return { 123, 456 }; } -Commands::LauncherResponse::Type ApplicationLauncherManager::HandleLaunchApp(const chip::CharSpan & data, - const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) +Commands::LauncherResponse::Type ApplicationLauncherManager::HandleLaunchApp( + const chip::CharSpan & data, const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) { // TODO: Insert code here Commands::LauncherResponse::Type response; - response.data = chip::CharSpan("data", strlen("data")); + response.data = chip::CharSpan("data", strlen("data")); response.status = StatusEnum::kSuccess; return response; } -Commands::LauncherResponse::Type ApplicationLauncherManager::HandleStopApp(const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) +Commands::LauncherResponse::Type +ApplicationLauncherManager::HandleStopApp(const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) { // TODO: Insert code here Commands::LauncherResponse::Type response; - response.data = chip::CharSpan("data", strlen("data")); + response.data = chip::CharSpan("data", strlen("data")); response.status = StatusEnum::kSuccess; return response; } -Commands::LauncherResponse::Type ApplicationLauncherManager::HandleHideApp(const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) +Commands::LauncherResponse::Type +ApplicationLauncherManager::HandleHideApp(const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) { // TODO: Insert code here Commands::LauncherResponse::Type response; - response.data = chip::CharSpan("data", strlen("data")); + response.data = chip::CharSpan("data", strlen("data")); response.status = StatusEnum::kSuccess; return response; } diff --git a/examples/tv-app/android/include/application-launcher/ApplicationLauncherManager.h b/examples/tv-app/android/include/application-launcher/ApplicationLauncherManager.h index 670a112a350534..c01c3e243d66d1 100644 --- a/examples/tv-app/android/include/application-launcher/ApplicationLauncherManager.h +++ b/examples/tv-app/android/include/application-launcher/ApplicationLauncherManager.h @@ -27,8 +27,11 @@ class ApplicationLauncherManager : public chip::app::Clusters::ApplicationLaunch chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEP::Type HandleGetCurrentApp() override; std::list HandleGetCatalogList() override; - chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Type HandleLaunchApp(const chip::CharSpan & data, - const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) override; - chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Type HandleStopApp(const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) override; - chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Type HandleHideApp(const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) override; + chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Type + HandleLaunchApp(const chip::CharSpan & data, + const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) override; + chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Type + HandleStopApp(const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) override; + chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Type + HandleHideApp(const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) override; }; diff --git a/examples/tv-app/android/include/audio-output/AudioOutputManager.cpp b/examples/tv-app/android/include/audio-output/AudioOutputManager.cpp index 823648079f6b72..e3eccf8afa2232 100644 --- a/examples/tv-app/android/include/audio-output/AudioOutputManager.cpp +++ b/examples/tv-app/android/include/audio-output/AudioOutputManager.cpp @@ -21,11 +21,13 @@ using namespace std; using namespace chip::app::Clusters::AudioOutput; -uint8_t AudioOutputManager::HandleGetCurrentOutput() { +uint8_t AudioOutputManager::HandleGetCurrentOutput() +{ return 0; } -std::list AudioOutputManager::HandleGetOutputList() { +std::list AudioOutputManager::HandleGetOutputList() +{ std::list list; // TODO: Insert code here int maximumVectorSize = 3; @@ -41,12 +43,14 @@ std::list AudioOutputManager::HandleGetOutputList() { return list; } -bool AudioOutputManager::HandleRenameOutput(const uint8_t & index, const chip::CharSpan & name) { +bool AudioOutputManager::HandleRenameOutput(const uint8_t & index, const chip::CharSpan & name) +{ // TODO: Insert code here return true; } -bool AudioOutputManager::HandleSelectOutput(const uint8_t & index) { +bool AudioOutputManager::HandleSelectOutput(const uint8_t & index) +{ // TODO: Insert code here return true; -} \ No newline at end of file +} diff --git a/examples/tv-app/android/include/cluster-init.cpp b/examples/tv-app/android/include/cluster-init.cpp index 34ff225a20336c..87eff6e1928a8a 100644 --- a/examples/tv-app/android/include/cluster-init.cpp +++ b/examples/tv-app/android/include/cluster-init.cpp @@ -38,7 +38,6 @@ static AudioOutputManager audioOutputManager; static TargetNavigatorManager targetNavigatorManager; } // namespace - /** @brief Application Basic Cluster Init * * This function is called when a specific cluster is initialized. It gives the @@ -54,7 +53,6 @@ void emberAfApplicationBasicClusterInitCallback(chip::EndpointId endpoint) chip::app::Clusters::ApplicationBasic::SetDefaultDelegate(endpoint, &applicationBasicManager); } - /** @brief Application Launcher Cluster Init * * This function is called when a specific cluster is initialized. It gives the @@ -70,7 +68,6 @@ void emberAfApplicationLauncherClusterInitCallback(EndpointId endpoint) chip::app::Clusters::ApplicationLauncher::SetDefaultDelegate(endpoint, &applicationLauncherManager); } - /** @brief Audio Output Cluster Init * * This function is called when a specific cluster is initialized. It gives the @@ -86,7 +83,6 @@ void emberAfAudioOutputClusterInitCallback(EndpointId endpoint) chip::app::Clusters::AudioOutput::SetDefaultDelegate(endpoint, &audioOutputManager); } - /** @brief Target Navigator Cluster Init * * This function is called when a specific cluster is initialized. It gives the diff --git a/examples/tv-app/android/include/target-navigator/TargetNavigatorManager.cpp b/examples/tv-app/android/include/target-navigator/TargetNavigatorManager.cpp index 023c4444b078ae..ddfcb0d6fd723b 100644 --- a/examples/tv-app/android/include/target-navigator/TargetNavigatorManager.cpp +++ b/examples/tv-app/android/include/target-navigator/TargetNavigatorManager.cpp @@ -29,7 +29,7 @@ std::list TargetNavigatorManager::HandleGetTargetList for (int i = 0; i < maximumVectorSize; ++i) { Structs::TargetInfo::Type outputInfo; - outputInfo.identifier = static_cast(i+1); + outputInfo.identifier = static_cast(i + 1); outputInfo.name = chip::CharSpan("exampleName", strlen("exampleName")); list.push_back(outputInfo); } @@ -41,7 +41,8 @@ uint8_t TargetNavigatorManager::HandleGetCurrentTarget() return 0; } -Commands::NavigateTargetResponse::Type TargetNavigatorManager::HandleNavigateTarget(const uint64_t & target, const chip::CharSpan & data) +Commands::NavigateTargetResponse::Type TargetNavigatorManager::HandleNavigateTarget(const uint64_t & target, + const chip::CharSpan & data) { // TODO: Insert code here Commands::NavigateTargetResponse::Type response; diff --git a/examples/tv-app/android/include/target-navigator/TargetNavigatorManager.h b/examples/tv-app/android/include/target-navigator/TargetNavigatorManager.h index a1e5436a1ef9a8..7da10ea51448f5 100644 --- a/examples/tv-app/android/include/target-navigator/TargetNavigatorManager.h +++ b/examples/tv-app/android/include/target-navigator/TargetNavigatorManager.h @@ -24,5 +24,6 @@ class TargetNavigatorManager : public chip::app::Clusters::TargetNavigator::Dele public: std::list HandleGetTargetList() override; uint8_t HandleGetCurrentTarget() override; - chip::app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::Type HandleNavigateTarget(const uint64_t & target, const chip::CharSpan & data) override; + chip::app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::Type + HandleNavigateTarget(const uint64_t & target, const chip::CharSpan & data) override; }; diff --git a/examples/tv-app/android/java/ChannelManager.cpp b/examples/tv-app/android/java/ChannelManager.cpp index 7c4efde5e0668e..cd0b2f79fd4a0c 100644 --- a/examples/tv-app/android/java/ChannelManager.cpp +++ b/examples/tv-app/android/java/ChannelManager.cpp @@ -28,7 +28,7 @@ namespace { static ChannelManager channelManager; } // namespace -std::list ChannelManager::HandleGetChannelList() +std::list ChannelManager::HandleGetChannelList() { std::list list; CHIP_ERROR err = CHIP_NO_ERROR; @@ -93,7 +93,7 @@ std::list ChannelManag return list; } -chip::app::Clusters::Channel::Structs::LineupInfo::Type ChannelManager::HandleGetLineup() +chip::app::Clusters::Channel::Structs::LineupInfo::Type ChannelManager::HandleGetLineup() { chip::app::Clusters::Channel::Structs::LineupInfo::Type lineupInfo; CHIP_ERROR err = CHIP_NO_ERROR; @@ -135,7 +135,6 @@ chip::app::Clusters::Channel::Structs::LineupInfo::Type ChannelManager::HandleGe jfieldID lineupInfoTypeFild = env->GetFieldID(channelLineupClazz, "lineupInfoTypeEnum", "I"); jint jlineupInfoType = (env->GetIntField(channelLineupObject, lineupInfoTypeFild)); lineupInfo.lineupInfoType = static_cast(jlineupInfoType); - } exit: @@ -147,7 +146,7 @@ chip::app::Clusters::Channel::Structs::LineupInfo::Type ChannelManager::HandleGe return lineupInfo; } -chip::app::Clusters::Channel::Structs::ChannelInfo::Type ChannelManager::HandleGetCurrentChannel() +chip::app::Clusters::Channel::Structs::ChannelInfo::Type ChannelManager::HandleGetCurrentChannel() { chip::app::Clusters::Channel::Structs::ChannelInfo::Type channelInfo; CHIP_ERROR err = CHIP_NO_ERROR; @@ -203,14 +202,14 @@ chip::app::Clusters::Channel::Structs::ChannelInfo::Type ChannelManager::HandleG return channelInfo; } -Commands::ChangeChannelResponse::Type ChannelManager::HandleChangeChannel(const chip::CharSpan & match) -{ +Commands::ChangeChannelResponse::Type ChannelManager::HandleChangeChannel(const chip::CharSpan & match) +{ std::string name(match.data(), match.size()); JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); Commands::ChangeChannelResponse::Type response; - response.channelMatch.majorNumber = 0; - response.channelMatch.minorNumber = 0; + response.channelMatch.majorNumber = 0; + response.channelMatch.minorNumber = 0; ChipLogProgress(Zcl, "Received ChannelManager::HandleChangeChannel name %s", name.c_str()); VerifyOrExit(mChannelManagerObject != nullptr, ChipLogError(Zcl, "mChannelManagerObject null")); @@ -254,12 +253,12 @@ Commands::ChangeChannelResponse::Type ChannelManager::HandleChangeChannel(const response.channelMatch.callSign = affiliateCallSign.charSpan(); } - jfieldID majorNumField = env->GetFieldID(channelClass, "majorNumber", "I"); - jint jmajorNum = env->GetIntField(channelObject, majorNumField); + jfieldID majorNumField = env->GetFieldID(channelClass, "majorNumber", "I"); + jint jmajorNum = env->GetIntField(channelObject, majorNumField); response.channelMatch.majorNumber = static_cast(jmajorNum); - jfieldID minorNumField = env->GetFieldID(channelClass, "minorNumber", "I"); - jint jminorNum = env->GetIntField(channelObject, minorNumField); + jfieldID minorNumField = env->GetFieldID(channelClass, "minorNumber", "I"); + jint jminorNum = env->GetIntField(channelObject, minorNumField); response.channelMatch.majorNumber = static_cast(jminorNum); } @@ -268,7 +267,7 @@ Commands::ChangeChannelResponse::Type ChannelManager::HandleChangeChannel(const return response; } -bool ChannelManager::HandleChangeChannelByNumber(const uint16_t & majorNumber, const uint16_t & minorNumber) +bool ChannelManager::HandleChangeChannelByNumber(const uint16_t & majorNumber, const uint16_t & minorNumber) { jboolean ret = JNI_FALSE; JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -295,7 +294,7 @@ bool ChannelManager::HandleChangeChannelByNumber(const uint16_t & majorNumber, c return static_cast(ret); } -bool ChannelManager::HandleSkipChannel(const uint16_t & count) +bool ChannelManager::HandleSkipChannel(const uint16_t & count) { jboolean ret = JNI_FALSE; JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -374,10 +373,8 @@ void ChannelManager::InitializeWithObjects(jobject managerObject) } } - ChannelManager ChannelManager::sInstance; - /** @brief Channel Cluster Init * * This function is called when a specific cluster is initialized. It gives the @@ -391,4 +388,4 @@ void emberAfChannelClusterInitCallback(EndpointId endpoint) { ChipLogProgress(Zcl, "TV Android App: Channel::SetDefaultDelegate"); chip::app::Clusters::Channel::SetDefaultDelegate(endpoint, &channelManager); -} \ No newline at end of file +} diff --git a/examples/tv-app/android/java/ContentLauncherManager.cpp b/examples/tv-app/android/java/ContentLauncherManager.cpp index 870834164587f1..4298fe24c1d364 100644 --- a/examples/tv-app/android/java/ContentLauncherManager.cpp +++ b/examples/tv-app/android/java/ContentLauncherManager.cpp @@ -40,8 +40,9 @@ void emberAfContentLauncherClusterInitCallback(EndpointId endpoint) chip::app::Clusters::ContentLauncher::SetDelegate(endpoint, &contentLauncherManager); } -Commands::LaunchResponse::Type ContentLauncherManager::HandleLaunchContent(chip::EndpointId endpointId, const std::list & parameterList, - bool autoplay, const chip::CharSpan & data) +Commands::LaunchResponse::Type ContentLauncherManager::HandleLaunchContent(chip::EndpointId endpointId, + const std::list & parameterList, + bool autoplay, const chip::CharSpan & data) { Commands::LaunchResponse::Type response; CHIP_ERROR err = CHIP_NO_ERROR; @@ -93,8 +94,9 @@ Commands::LaunchResponse::Type ContentLauncherManager::HandleLaunchContent(chip: return response; } -Commands::LaunchResponse::Type ContentLauncherManager::HandleLaunchUrl(const chip::CharSpan & contentUrl, const chip::CharSpan & displayString, - const std::list & brandingInformation) +Commands::LaunchResponse::Type ContentLauncherManager::HandleLaunchUrl(const chip::CharSpan & contentUrl, + const chip::CharSpan & displayString, + const std::list & brandingInformation) { Commands::LaunchResponse::Type response; CHIP_ERROR err = CHIP_NO_ERROR; @@ -267,4 +269,3 @@ void ContentLauncherManager::InitializeWithObjects(jobject managerObject) env->ExceptionClear(); } } - diff --git a/examples/tv-app/android/java/ContentLauncherManager.h b/examples/tv-app/android/java/ContentLauncherManager.h index c9987a22ea0436..8ef2bc0fa8287d 100644 --- a/examples/tv-app/android/java/ContentLauncherManager.h +++ b/examples/tv-app/android/java/ContentLauncherManager.h @@ -31,10 +31,12 @@ class ContentLauncherManager : public chip::app::Clusters::ContentLauncher::Dele public: void InitializeWithObjects(jobject managerObject); - chip::app::Clusters::ContentLauncher::Commands::LaunchResponse::Type HandleLaunchContent(chip::EndpointId endpointId, const std::list & parameterList, bool autoplay, - const chip::CharSpan & data) override; - chip::app::Clusters::ContentLauncher::Commands::LaunchResponse::Type HandleLaunchUrl(const chip::CharSpan & contentUrl, const chip::CharSpan & displayString, - const std::list & brandingInformation) override; + chip::app::Clusters::ContentLauncher::Commands::LaunchResponse::Type + HandleLaunchContent(chip::EndpointId endpointId, const std::list & parameterList, bool autoplay, + const chip::CharSpan & data) override; + chip::app::Clusters::ContentLauncher::Commands::LaunchResponse::Type + HandleLaunchUrl(const chip::CharSpan & contentUrl, const chip::CharSpan & displayString, + const std::list & brandingInformation) override; std::list HandleGetAcceptHeaderList() override; uint32_t HandleGetSupportedStreamingProtocols() override; diff --git a/examples/tv-app/android/java/KeypadInputManager.cpp b/examples/tv-app/android/java/KeypadInputManager.cpp index 3ed0f9e4296705..40dc3a31132ad2 100644 --- a/examples/tv-app/android/java/KeypadInputManager.cpp +++ b/examples/tv-app/android/java/KeypadInputManager.cpp @@ -51,13 +51,14 @@ Commands::SendKeyResponse::Type KeypadInputManager::HandleSendKey(const CecKeyCo if (err != CHIP_NO_ERROR) { response.status = chip::app::Clusters::KeypadInput::StatusEnum::kSuccess; - } else { + } + else + { response.status = static_cast(ret); } return response; } - void KeypadInputManager::InitializeWithObjects(jobject managerObject) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -77,9 +78,8 @@ void KeypadInputManager::InitializeWithObjects(jobject managerObject) } } - void emberAfKeypadInputClusterInitCallback(EndpointId endpoint) { ChipLogProgress(Zcl, "TV Android App: KeypadInput::SetDefaultDelegate"); chip::app::Clusters::KeypadInput::SetDefaultDelegate(endpoint, &keypadInputManager); -} \ No newline at end of file +} diff --git a/examples/tv-app/android/java/KeypadInputManager.h b/examples/tv-app/android/java/KeypadInputManager.h index 90eaa69232cab4..cb90df01c04e28 100644 --- a/examples/tv-app/android/java/KeypadInputManager.h +++ b/examples/tv-app/android/java/KeypadInputManager.h @@ -25,7 +25,8 @@ class KeypadInputManager : public chip::app::Clusters::KeypadInput::Delegate { public: void InitializeWithObjects(jobject managerObject); - chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::Type HandleSendKey(const chip::app::Clusters::KeypadInput::CecKeyCode & keyCode) override; + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::Type + HandleSendKey(const chip::app::Clusters::KeypadInput::CecKeyCode & keyCode) override; private: friend KeypadInputManager & KeypadInputMgr(); diff --git a/examples/tv-app/android/java/LowPowerManager.cpp b/examples/tv-app/android/java/LowPowerManager.cpp index 1b44a6f4d3769d..741c0e6437d82e 100644 --- a/examples/tv-app/android/java/LowPowerManager.cpp +++ b/examples/tv-app/android/java/LowPowerManager.cpp @@ -75,9 +75,8 @@ bool LowPowerManager::HandleSleep() return static_cast(ret); } - void emberAfLowPowerClusterInitCallback(EndpointId endpoint) { ChipLogProgress(Zcl, "TV Android App: LowPower::SetDefaultDelegate"); chip::app::Clusters::LowPower::SetDefaultDelegate(endpoint, &lowPowerManager); -} \ No newline at end of file +} diff --git a/examples/tv-app/android/java/MediaInputManager.cpp b/examples/tv-app/android/java/MediaInputManager.cpp index 4f1950738cdbe0..6ee85c2e259074 100644 --- a/examples/tv-app/android/java/MediaInputManager.cpp +++ b/examples/tv-app/android/java/MediaInputManager.cpp @@ -46,8 +46,7 @@ void emberAfMediaInputClusterInitCallback(EndpointId endpoint) chip::app::Clusters::MediaInput::SetDefaultDelegate(endpoint, &mediaInputManager); } - -std::list MediaInputManager::HandleGetInputList() +std::list MediaInputManager::HandleGetInputList() { std::list list; CHIP_ERROR err = CHIP_NO_ERROR; @@ -106,7 +105,6 @@ std::list MediaInput } } - exit: if (err != CHIP_NO_ERROR) { @@ -116,7 +114,7 @@ std::list MediaInput return list; } -uint8_t MediaInputManager::HandleGetCurrentInput() +uint8_t MediaInputManager::HandleGetCurrentInput() { CHIP_ERROR err = CHIP_NO_ERROR; jint index = -1; @@ -147,7 +145,7 @@ uint8_t MediaInputManager::HandleGetCurrentInput() return uint8_t(index); } -bool MediaInputManager::HandleSelectInput(const uint8_t index) +bool MediaInputManager::HandleSelectInput(const uint8_t index) { jboolean ret = JNI_FALSE; JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -171,7 +169,7 @@ bool MediaInputManager::HandleSelectInput(const uint8_t index) return static_cast(ret); } -bool MediaInputManager::HandleShowInputStatus() +bool MediaInputManager::HandleShowInputStatus() { jboolean ret = JNI_FALSE; JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -195,7 +193,7 @@ bool MediaInputManager::HandleShowInputStatus() return static_cast(ret); } -bool MediaInputManager::HandleHideInputStatus() +bool MediaInputManager::HandleHideInputStatus() { jboolean ret = JNI_FALSE; JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -219,7 +217,7 @@ bool MediaInputManager::HandleHideInputStatus() return static_cast(ret); } -bool MediaInputManager::HandleRenameInput(const uint8_t index, const chip::CharSpan & name) +bool MediaInputManager::HandleRenameInput(const uint8_t index, const chip::CharSpan & name) { jboolean ret = JNI_FALSE; JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); diff --git a/examples/tv-app/android/java/MediaInputManager.h b/examples/tv-app/android/java/MediaInputManager.h index b8535ea2c9bd43..8651e3321cecc6 100644 --- a/examples/tv-app/android/java/MediaInputManager.h +++ b/examples/tv-app/android/java/MediaInputManager.h @@ -25,7 +25,7 @@ class MediaInputManager : public chip::app::Clusters::MediaInput::Delegate { public: void InitializeWithObjects(jobject managerObject); - std::list HandleGetInputList() override; + std::list HandleGetInputList() override; uint8_t HandleGetCurrentInput() override; bool HandleSelectInput(const uint8_t index) override; bool HandleShowInputStatus() override; diff --git a/examples/tv-app/android/java/MediaPlaybackManager.cpp b/examples/tv-app/android/java/MediaPlaybackManager.cpp index c7d771661c4817..70aa77a1bf28c3 100644 --- a/examples/tv-app/android/java/MediaPlaybackManager.cpp +++ b/examples/tv-app/android/java/MediaPlaybackManager.cpp @@ -27,7 +27,6 @@ using namespace chip::app::Clusters::MediaPlayback; MediaPlaybackManager MediaPlaybackManager::sInstance; - namespace { static MediaPlaybackManager mediaPlaybackManager; } // namespace @@ -66,7 +65,7 @@ Structs::PlaybackPosition::Type MediaPlaybackManager::HandleGetSampledPosition() { Structs::PlaybackPosition::Type sampledPosition; sampledPosition.updatedAt = 0; - sampledPosition.position = 0; + sampledPosition.position = 0; return sampledPosition; } @@ -85,7 +84,6 @@ uint64_t MediaPlaybackManager::HandleGetSeekRangeEnd() return 0; } - Commands::PlaybackResponse::Type MediaPlaybackManager::HandlePlay() { return MediaPlaybackMgr().HandleMediaRequest(MEDIA_PLAYBACK_REQUEST_PLAY, 0); @@ -141,7 +139,8 @@ Commands::PlaybackResponse::Type MediaPlaybackManager::HandleStartOverRequest() return MediaPlaybackMgr().HandleMediaRequest(MEDIA_PLAYBACK_REQUEST_START_OVER, 0); } -Commands::PlaybackResponse::Type MediaPlaybackManager::HandleMediaRequest(MediaPlaybackRequest mediaPlaybackRequest, uint64_t deltaPositionMilliseconds) +Commands::PlaybackResponse::Type MediaPlaybackManager::HandleMediaRequest(MediaPlaybackRequest mediaPlaybackRequest, + uint64_t deltaPositionMilliseconds) { Commands::PlaybackResponse::Type response; diff --git a/examples/tv-app/android/java/MediaPlaybackManager.h b/examples/tv-app/android/java/MediaPlaybackManager.h index f88fdd6c835114..12aaeab077bfa0 100644 --- a/examples/tv-app/android/java/MediaPlaybackManager.h +++ b/examples/tv-app/android/java/MediaPlaybackManager.h @@ -54,12 +54,16 @@ class MediaPlaybackManager : public chip::app::Clusters::MediaPlayback::Delegate chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type HandleFastForward() override; chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type HandlePrevious() override; chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type HandleRewind() override; - chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type HandleSkipBackward(const uint64_t & deltaPositionMilliseconds) override; - chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type HandleSkipForward(const uint64_t & deltaPositionMilliseconds) override; - chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type HandleSeekRequest(const uint64_t & positionMilliseconds) override; + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type + HandleSkipBackward(const uint64_t & deltaPositionMilliseconds) override; + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type + HandleSkipForward(const uint64_t & deltaPositionMilliseconds) override; + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type + HandleSeekRequest(const uint64_t & positionMilliseconds) override; chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type HandleNext() override; chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type HandleStartOverRequest() override; - chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type HandleMediaRequest(MediaPlaybackRequest mediaPlaybackRequest, uint64_t deltaPositionMilliseconds); + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type + HandleMediaRequest(MediaPlaybackRequest mediaPlaybackRequest, uint64_t deltaPositionMilliseconds); private: friend MediaPlaybackManager & MediaPlaybackMgr(); @@ -74,5 +78,3 @@ inline MediaPlaybackManager & MediaPlaybackMgr() { return MediaPlaybackManager::sInstance; } - - diff --git a/examples/tv-app/android/java/WakeOnLanManager.cpp b/examples/tv-app/android/java/WakeOnLanManager.cpp index 4f46026535bd92..8c9c7f26bbace1 100644 --- a/examples/tv-app/android/java/WakeOnLanManager.cpp +++ b/examples/tv-app/android/java/WakeOnLanManager.cpp @@ -46,7 +46,8 @@ void emberAfWakeOnLanClusterInitCallback(chip::EndpointId endpoint) chip::app::Clusters::WakeOnLan::SetDefaultDelegate(endpoint, &wakeOnLanManager); } -chip::CharSpan WakeOnLanManager::HandleGetMacAddress() { +chip::CharSpan WakeOnLanManager::HandleGetMacAddress() +{ CHIP_ERROR err = CHIP_NO_ERROR; JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -60,7 +61,8 @@ chip::CharSpan WakeOnLanManager::HandleGetMacAddress() { { env->ExceptionClear(); jobject javaMac = env->CallObjectMethod(mWakeOnLanManagerObject, mGetMacMethod, static_cast(1)); - if (env->ExceptionCheck()) { + if (env->ExceptionCheck()) + { ChipLogError(DeviceLayer, "Java exception in WakeOnLanManager::getMac"); env->ExceptionDescribe(); env->ExceptionClear(); @@ -68,7 +70,6 @@ chip::CharSpan WakeOnLanManager::HandleGetMacAddress() { } macValue = chip::JniUtfString(env, static_cast(javaMac)).charSpan(); - } exit: diff --git a/examples/tv-app/linux/include/account-login/AccountLoginManager.cpp b/examples/tv-app/linux/include/account-login/AccountLoginManager.cpp index 2afc569c79f19a..f391901e136e32 100644 --- a/examples/tv-app/linux/include/account-login/AccountLoginManager.cpp +++ b/examples/tv-app/linux/include/account-login/AccountLoginManager.cpp @@ -34,7 +34,6 @@ bool AccountLoginManager::HandleLogin(const chip::CharSpan & tempAccountIdentifi return true; } - bool AccountLoginManager::HandleLogout() { // TODO: Insert your code here to send logout request @@ -47,6 +46,6 @@ Commands::GetSetupPINResponse::Type AccountLoginManager::HandleGetSetupPin(const ChipLogProgress(Zcl, "temporary account id: %s", tempAccountIdentifierString.c_str()); // TODO: Insert your code here to handle get setup pin Commands::GetSetupPINResponse::Type response; - response.setupPIN = chip::CharSpan("tempPin123", strlen("tempPin123")); + response.setupPIN = chip::CharSpan("tempPin123", strlen("tempPin123")); return response; } diff --git a/examples/tv-app/linux/include/account-login/AccountLoginManager.h b/examples/tv-app/linux/include/account-login/AccountLoginManager.h index afff5bca7e6ac7..68584ae6ec7bd5 100644 --- a/examples/tv-app/linux/include/account-login/AccountLoginManager.h +++ b/examples/tv-app/linux/include/account-login/AccountLoginManager.h @@ -25,7 +25,8 @@ class AccountLoginManager : public chip::app::Clusters::AccountLogin::Delegate { public: - bool HandleLogin(const chip::CharSpan & tempAccountIdentifierString, const chip::CharSpan & setupPinString) override; + bool HandleLogin(const chip::CharSpan & tempAccountIdentifierString, const chip::CharSpan & setupPinString) override; bool HandleLogout() override; - chip::app::Clusters::AccountLogin::Commands::GetSetupPINResponse::Type HandleGetSetupPin(const chip::CharSpan & tempAccountIdentifierString) override; + chip::app::Clusters::AccountLogin::Commands::GetSetupPINResponse::Type + HandleGetSetupPin(const chip::CharSpan & tempAccountIdentifierString) override; }; diff --git a/examples/tv-app/linux/include/application-basic/ApplicationBasicManager.cpp b/examples/tv-app/linux/include/application-basic/ApplicationBasicManager.cpp index dc7b2d683d403d..1a979da92efcc7 100644 --- a/examples/tv-app/linux/include/application-basic/ApplicationBasicManager.cpp +++ b/examples/tv-app/linux/include/application-basic/ApplicationBasicManager.cpp @@ -21,37 +21,45 @@ using namespace std; using namespace chip::app::Clusters::ApplicationBasic; -chip::CharSpan ApplicationBasicManager::HandleGetVendorName() { +chip::CharSpan ApplicationBasicManager::HandleGetVendorName() +{ return chip::CharSpan("exampleVendorName1", strlen("exampleVendorName1")); } -uint16_t ApplicationBasicManager::HandleGetVendorId() { +uint16_t ApplicationBasicManager::HandleGetVendorId() +{ return 1; } -chip::CharSpan ApplicationBasicManager::HandleGetApplicationName() { +chip::CharSpan ApplicationBasicManager::HandleGetApplicationName() +{ return chip::CharSpan("exampleName1", strlen("exampleName1")); } -uint16_t ApplicationBasicManager::HandleGetProductId() { +uint16_t ApplicationBasicManager::HandleGetProductId() +{ return 1; } -chip::app::Clusters::ApplicationBasic::Structs::Application::Type ApplicationBasicManager::HandleGetApplication() { +chip::app::Clusters::ApplicationBasic::Structs::Application::Type ApplicationBasicManager::HandleGetApplication() +{ chip::app::Clusters::ApplicationBasic::Structs::Application::Type application; application.catalogVendorId = 123; - application.applicationId = chip::CharSpan("applicationId", strlen("applicationId")); + application.applicationId = chip::CharSpan("applicationId", strlen("applicationId")); return application; } -ApplicationStatusEnum ApplicationBasicManager::HandleGetStatus() { +ApplicationStatusEnum ApplicationBasicManager::HandleGetStatus() +{ return ApplicationStatusEnum::kStopped; } -chip::CharSpan ApplicationBasicManager::HandleGetApplicationVersion() { +chip::CharSpan ApplicationBasicManager::HandleGetApplicationVersion() +{ return chip::CharSpan("exampleVersion", strlen("exampleVersion")); } -std::list ApplicationBasicManager::HandleGetAllowedVendorList() { +std::list ApplicationBasicManager::HandleGetAllowedVendorList() +{ return { 123, 456 }; } diff --git a/examples/tv-app/linux/include/application-launcher/ApplicationLauncherManager.cpp b/examples/tv-app/linux/include/application-launcher/ApplicationLauncherManager.cpp index 82104d7ecb753f..f6a8afc0ae8ee7 100644 --- a/examples/tv-app/linux/include/application-launcher/ApplicationLauncherManager.cpp +++ b/examples/tv-app/linux/include/application-launcher/ApplicationLauncherManager.cpp @@ -21,44 +21,46 @@ using namespace std; using namespace chip::app::Clusters::ApplicationLauncher; -Structs::ApplicationEP::Type ApplicationLauncherManager::HandleGetCurrentApp() +Structs::ApplicationEP::Type ApplicationLauncherManager::HandleGetCurrentApp() { Structs::ApplicationEP::Type currentApp; currentApp.application.catalogVendorId = 123; - currentApp.application.applicationId = chip::CharSpan("applicationId", strlen("applicationId")); - currentApp.endpoint = chip::CharSpan("endpointId", strlen("endpointId")); + currentApp.application.applicationId = chip::CharSpan("applicationId", strlen("applicationId")); + currentApp.endpoint = chip::CharSpan("endpointId", strlen("endpointId")); return currentApp; } -std::list ApplicationLauncherManager::HandleGetCatalogList() +std::list ApplicationLauncherManager::HandleGetCatalogList() { return { 123, 456 }; } -Commands::LauncherResponse::Type ApplicationLauncherManager::HandleLaunchApp(const chip::CharSpan & data, - const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) +Commands::LauncherResponse::Type ApplicationLauncherManager::HandleLaunchApp( + const chip::CharSpan & data, const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) { // TODO: Insert code here Commands::LauncherResponse::Type response; - response.data = chip::CharSpan("data", strlen("data")); + response.data = chip::CharSpan("data", strlen("data")); response.status = StatusEnum::kSuccess; return response; } -Commands::LauncherResponse::Type ApplicationLauncherManager::HandleStopApp(const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) +Commands::LauncherResponse::Type +ApplicationLauncherManager::HandleStopApp(const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) { // TODO: Insert code here Commands::LauncherResponse::Type response; - response.data = chip::CharSpan("data", strlen("data")); + response.data = chip::CharSpan("data", strlen("data")); response.status = StatusEnum::kSuccess; return response; } -Commands::LauncherResponse::Type ApplicationLauncherManager::HandleHideApp(const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) +Commands::LauncherResponse::Type +ApplicationLauncherManager::HandleHideApp(const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) { // TODO: Insert code here Commands::LauncherResponse::Type response; - response.data = chip::CharSpan("data", strlen("data")); + response.data = chip::CharSpan("data", strlen("data")); response.status = StatusEnum::kSuccess; return response; } diff --git a/examples/tv-app/linux/include/application-launcher/ApplicationLauncherManager.h b/examples/tv-app/linux/include/application-launcher/ApplicationLauncherManager.h index e134a465317d58..ece3bd36d69523 100644 --- a/examples/tv-app/linux/include/application-launcher/ApplicationLauncherManager.h +++ b/examples/tv-app/linux/include/application-launcher/ApplicationLauncherManager.h @@ -27,8 +27,11 @@ class ApplicationLauncherManager : public chip::app::Clusters::ApplicationLaunch chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEP::Type HandleGetCurrentApp() override; std::list HandleGetCatalogList() override; - chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Type HandleLaunchApp(const chip::CharSpan & data, - const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) override; - chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Type HandleStopApp(const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) override; - chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Type HandleHideApp(const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) override; + chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Type + HandleLaunchApp(const chip::CharSpan & data, + const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) override; + chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Type + HandleStopApp(const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) override; + chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Type + HandleHideApp(const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) override; }; diff --git a/examples/tv-app/linux/include/audio-output/AudioOutputManager.cpp b/examples/tv-app/linux/include/audio-output/AudioOutputManager.cpp index 823648079f6b72..e3eccf8afa2232 100644 --- a/examples/tv-app/linux/include/audio-output/AudioOutputManager.cpp +++ b/examples/tv-app/linux/include/audio-output/AudioOutputManager.cpp @@ -21,11 +21,13 @@ using namespace std; using namespace chip::app::Clusters::AudioOutput; -uint8_t AudioOutputManager::HandleGetCurrentOutput() { +uint8_t AudioOutputManager::HandleGetCurrentOutput() +{ return 0; } -std::list AudioOutputManager::HandleGetOutputList() { +std::list AudioOutputManager::HandleGetOutputList() +{ std::list list; // TODO: Insert code here int maximumVectorSize = 3; @@ -41,12 +43,14 @@ std::list AudioOutputManager::HandleGetOutputList() { return list; } -bool AudioOutputManager::HandleRenameOutput(const uint8_t & index, const chip::CharSpan & name) { +bool AudioOutputManager::HandleRenameOutput(const uint8_t & index, const chip::CharSpan & name) +{ // TODO: Insert code here return true; } -bool AudioOutputManager::HandleSelectOutput(const uint8_t & index) { +bool AudioOutputManager::HandleSelectOutput(const uint8_t & index) +{ // TODO: Insert code here return true; -} \ No newline at end of file +} diff --git a/examples/tv-app/linux/include/channel/ChannelManager.cpp b/examples/tv-app/linux/include/channel/ChannelManager.cpp index 7482cadcb10698..066476c57c759e 100644 --- a/examples/tv-app/linux/include/channel/ChannelManager.cpp +++ b/examples/tv-app/linux/include/channel/ChannelManager.cpp @@ -20,7 +20,7 @@ using namespace chip; using namespace chip::app::Clusters::Channel; -std::list ChannelManager::HandleGetChannelList() +std::list ChannelManager::HandleGetChannelList() { std::list list; // TODO: Insert code here @@ -39,7 +39,7 @@ std::list ChannelManag return list; } -chip::app::Clusters::Channel::Structs::LineupInfo::Type ChannelManager::HandleGetLineup() +chip::app::Clusters::Channel::Structs::LineupInfo::Type ChannelManager::HandleGetLineup() { chip::app::Clusters::Channel::Structs::LineupInfo::Type lineup; lineup.operatorName = chip::CharSpan("operatorName", strlen("operatorName")); @@ -49,7 +49,7 @@ chip::app::Clusters::Channel::Structs::LineupInfo::Type ChannelManager::HandleGe return lineup; } -chip::app::Clusters::Channel::Structs::ChannelInfo::Type ChannelManager::HandleGetCurrentChannel() +chip::app::Clusters::Channel::Structs::ChannelInfo::Type ChannelManager::HandleGetCurrentChannel() { chip::app::Clusters::Channel::Structs::ChannelInfo::Type currentChannel; currentChannel.affiliateCallSign = chip::CharSpan("exampleASign", strlen("exampleASign")); @@ -60,7 +60,7 @@ chip::app::Clusters::Channel::Structs::ChannelInfo::Type ChannelManager::HandleG return currentChannel; } -Commands::ChangeChannelResponse::Type ChannelManager::HandleChangeChannel(const chip::CharSpan & match) +Commands::ChangeChannelResponse::Type ChannelManager::HandleChangeChannel(const chip::CharSpan & match) { Commands::ChangeChannelResponse::Type response; response.channelMatch.majorNumber = 1; @@ -72,12 +72,12 @@ Commands::ChangeChannelResponse::Type ChannelManager::HandleChangeChannel(const return response; } -bool ChannelManager::HandleChangeChannelByNumber(const uint16_t & majorNumber, const uint16_t & minorNumber) +bool ChannelManager::HandleChangeChannelByNumber(const uint16_t & majorNumber, const uint16_t & minorNumber) { // TODO: Insert code here return true; } -bool ChannelManager::HandleSkipChannel(const uint16_t & count) +bool ChannelManager::HandleSkipChannel(const uint16_t & count) { // TODO: Insert code here return true; diff --git a/examples/tv-app/linux/include/content-launcher/ContentLauncherManager.cpp b/examples/tv-app/linux/include/content-launcher/ContentLauncherManager.cpp index 8d536cdc03df40..7dabd7c4d80253 100644 --- a/examples/tv-app/linux/include/content-launcher/ContentLauncherManager.cpp +++ b/examples/tv-app/linux/include/content-launcher/ContentLauncherManager.cpp @@ -21,8 +21,9 @@ using namespace std; using namespace chip::app::Clusters::ContentLauncher; -Commands::LaunchResponse::Type ContentLauncherManager::HandleLaunchContent(chip::EndpointId endpointId, const std::list & parameterList, - bool autoplay, const chip::CharSpan & data) +Commands::LaunchResponse::Type ContentLauncherManager::HandleLaunchContent(chip::EndpointId endpointId, + const std::list & parameterList, + bool autoplay, const chip::CharSpan & data) { ChipLogProgress(Zcl, "ContentLauncherManager::HandleLaunchContent"); string dataString(data.data(), data.size()); @@ -42,8 +43,9 @@ Commands::LaunchResponse::Type ContentLauncherManager::HandleLaunchContent(chip: return response; } -Commands::LaunchResponse::Type ContentLauncherManager::HandleLaunchUrl(const chip::CharSpan & contentUrl, const chip::CharSpan & displayString, - const std::list & brandingInformation) +Commands::LaunchResponse::Type ContentLauncherManager::HandleLaunchUrl(const chip::CharSpan & contentUrl, + const chip::CharSpan & displayString, + const std::list & brandingInformation) { ChipLogProgress(Zcl, "ContentLauncherManager::HandleLaunchUrl"); diff --git a/examples/tv-app/linux/include/content-launcher/ContentLauncherManager.h b/examples/tv-app/linux/include/content-launcher/ContentLauncherManager.h index 2126f35b717ae5..132afeb37a9812 100644 --- a/examples/tv-app/linux/include/content-launcher/ContentLauncherManager.h +++ b/examples/tv-app/linux/include/content-launcher/ContentLauncherManager.h @@ -23,10 +23,12 @@ class ContentLauncherManager : public chip::app::Clusters::ContentLauncher::Delegate { public: - chip::app::Clusters::ContentLauncher::Commands::LaunchResponse::Type HandleLaunchContent(chip::EndpointId endpointId, const std::list & parameterList, bool autoplay, - const chip::CharSpan & data) override; - chip::app::Clusters::ContentLauncher::Commands::LaunchResponse::Type HandleLaunchUrl(const chip::CharSpan & contentUrl, const chip::CharSpan & displayString, - const std::list & brandingInformation) override; + chip::app::Clusters::ContentLauncher::Commands::LaunchResponse::Type + HandleLaunchContent(chip::EndpointId endpointId, const std::list & parameterList, bool autoplay, + const chip::CharSpan & data) override; + chip::app::Clusters::ContentLauncher::Commands::LaunchResponse::Type + HandleLaunchUrl(const chip::CharSpan & contentUrl, const chip::CharSpan & displayString, + const std::list & brandingInformation) override; std::list HandleGetAcceptHeaderList() override; uint32_t HandleGetSupportedStreamingProtocols() override; }; diff --git a/examples/tv-app/linux/include/keypad-input/KeypadInputManager.h b/examples/tv-app/linux/include/keypad-input/KeypadInputManager.h index 86399e3304b3fd..93d3f66e8a003a 100644 --- a/examples/tv-app/linux/include/keypad-input/KeypadInputManager.h +++ b/examples/tv-app/linux/include/keypad-input/KeypadInputManager.h @@ -23,5 +23,6 @@ class KeypadInputManager : public chip::app::Clusters::KeypadInput::Delegate { public: - chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::Type HandleSendKey(const chip::app::Clusters::KeypadInput::CecKeyCode & keyCode) override; + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::Type + HandleSendKey(const chip::app::Clusters::KeypadInput::CecKeyCode & keyCode) override; }; diff --git a/examples/tv-app/linux/include/low-power/LowPowerManager.cpp b/examples/tv-app/linux/include/low-power/LowPowerManager.cpp index 8b9c51941876bf..57399c0ba1de5c 100644 --- a/examples/tv-app/linux/include/low-power/LowPowerManager.cpp +++ b/examples/tv-app/linux/include/low-power/LowPowerManager.cpp @@ -18,8 +18,8 @@ #include "LowPowerManager.h" -bool LowPowerManager::HandleSleep() +bool LowPowerManager::HandleSleep() { // TODO: Insert code here return true; -} \ No newline at end of file +} diff --git a/examples/tv-app/linux/include/media-input/MediaInputManager.cpp b/examples/tv-app/linux/include/media-input/MediaInputManager.cpp index d85e04544158f9..4b654d0b838d87 100644 --- a/examples/tv-app/linux/include/media-input/MediaInputManager.cpp +++ b/examples/tv-app/linux/include/media-input/MediaInputManager.cpp @@ -20,7 +20,7 @@ using namespace chip; using namespace chip::app::Clusters::MediaInput; -std::list MediaInputManager::HandleGetInputList() +std::list MediaInputManager::HandleGetInputList() { std::list list; // TODO: Insert code here @@ -38,30 +38,30 @@ std::list MediaInput return list; } -uint8_t MediaInputManager::HandleGetCurrentInput() +uint8_t MediaInputManager::HandleGetCurrentInput() { return 0; } -bool MediaInputManager::HandleSelectInput(const uint8_t index) +bool MediaInputManager::HandleSelectInput(const uint8_t index) { // TODO: Insert code here return true; } -bool MediaInputManager::HandleShowInputStatus() +bool MediaInputManager::HandleShowInputStatus() { // TODO: Insert code here return true; } -bool MediaInputManager::HandleHideInputStatus() +bool MediaInputManager::HandleHideInputStatus() { // TODO: Insert code here return true; } -bool MediaInputManager::HandleRenameInput(const uint8_t index, const chip::CharSpan & name) +bool MediaInputManager::HandleRenameInput(const uint8_t index, const chip::CharSpan & name) { // TODO: Insert code here return true; diff --git a/examples/tv-app/linux/include/media-playback/MediaPlaybackManager.cpp b/examples/tv-app/linux/include/media-playback/MediaPlaybackManager.cpp index af25af57fe0368..81e6872e14d83a 100644 --- a/examples/tv-app/linux/include/media-playback/MediaPlaybackManager.cpp +++ b/examples/tv-app/linux/include/media-playback/MediaPlaybackManager.cpp @@ -20,7 +20,6 @@ using namespace std; using namespace chip::app::Clusters::MediaPlayback; - PlaybackStateEnum MediaPlaybackManager::HandleGetCurrentState() { return PlaybackStateEnum::kPlaying; @@ -40,7 +39,7 @@ Structs::PlaybackPosition::Type MediaPlaybackManager::HandleGetSampledPosition() { Structs::PlaybackPosition::Type sampledPosition; sampledPosition.updatedAt = 0; - sampledPosition.position = 0; + sampledPosition.position = 0; return sampledPosition; } @@ -59,7 +58,6 @@ uint64_t MediaPlaybackManager::HandleGetSeekRangeEnd() return 0; } - Commands::PlaybackResponse::Type MediaPlaybackManager::HandlePlay() { // TODO: Insert code here @@ -146,4 +144,4 @@ Commands::PlaybackResponse::Type MediaPlaybackManager::HandleStartOverRequest() Commands::PlaybackResponse::Type response; response.status = StatusEnum::kSuccess; return response; -} \ No newline at end of file +} diff --git a/examples/tv-app/linux/include/media-playback/MediaPlaybackManager.h b/examples/tv-app/linux/include/media-playback/MediaPlaybackManager.h index a43a8a2509f60e..9bf4c6607cf2f9 100644 --- a/examples/tv-app/linux/include/media-playback/MediaPlaybackManager.h +++ b/examples/tv-app/linux/include/media-playback/MediaPlaybackManager.h @@ -37,9 +37,12 @@ class MediaPlaybackManager : public chip::app::Clusters::MediaPlayback::Delegate chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type HandleFastForward() override; chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type HandlePrevious() override; chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type HandleRewind() override; - chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type HandleSkipBackward(const uint64_t & deltaPositionMilliseconds) override; - chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type HandleSkipForward(const uint64_t & deltaPositionMilliseconds) override; - chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type HandleSeekRequest(const uint64_t & positionMilliseconds) override; + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type + HandleSkipBackward(const uint64_t & deltaPositionMilliseconds) override; + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type + HandleSkipForward(const uint64_t & deltaPositionMilliseconds) override; + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type + HandleSeekRequest(const uint64_t & positionMilliseconds) override; chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type HandleNext() override; chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type HandleStartOverRequest() override; }; diff --git a/examples/tv-app/linux/include/target-navigator/TargetNavigatorManager.cpp b/examples/tv-app/linux/include/target-navigator/TargetNavigatorManager.cpp index 023c4444b078ae..ddfcb0d6fd723b 100644 --- a/examples/tv-app/linux/include/target-navigator/TargetNavigatorManager.cpp +++ b/examples/tv-app/linux/include/target-navigator/TargetNavigatorManager.cpp @@ -29,7 +29,7 @@ std::list TargetNavigatorManager::HandleGetTargetList for (int i = 0; i < maximumVectorSize; ++i) { Structs::TargetInfo::Type outputInfo; - outputInfo.identifier = static_cast(i+1); + outputInfo.identifier = static_cast(i + 1); outputInfo.name = chip::CharSpan("exampleName", strlen("exampleName")); list.push_back(outputInfo); } @@ -41,7 +41,8 @@ uint8_t TargetNavigatorManager::HandleGetCurrentTarget() return 0; } -Commands::NavigateTargetResponse::Type TargetNavigatorManager::HandleNavigateTarget(const uint64_t & target, const chip::CharSpan & data) +Commands::NavigateTargetResponse::Type TargetNavigatorManager::HandleNavigateTarget(const uint64_t & target, + const chip::CharSpan & data) { // TODO: Insert code here Commands::NavigateTargetResponse::Type response; diff --git a/examples/tv-app/linux/include/target-navigator/TargetNavigatorManager.h b/examples/tv-app/linux/include/target-navigator/TargetNavigatorManager.h index a1e5436a1ef9a8..7da10ea51448f5 100644 --- a/examples/tv-app/linux/include/target-navigator/TargetNavigatorManager.h +++ b/examples/tv-app/linux/include/target-navigator/TargetNavigatorManager.h @@ -24,5 +24,6 @@ class TargetNavigatorManager : public chip::app::Clusters::TargetNavigator::Dele public: std::list HandleGetTargetList() override; uint8_t HandleGetCurrentTarget() override; - chip::app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::Type HandleNavigateTarget(const uint64_t & target, const chip::CharSpan & data) override; + chip::app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::Type + HandleNavigateTarget(const uint64_t & target, const chip::CharSpan & data) override; }; diff --git a/examples/tv-app/linux/include/wake-on-lan/WakeOnLanManager.cpp b/examples/tv-app/linux/include/wake-on-lan/WakeOnLanManager.cpp index 0abf07477d5442..291c2951c221f8 100644 --- a/examples/tv-app/linux/include/wake-on-lan/WakeOnLanManager.cpp +++ b/examples/tv-app/linux/include/wake-on-lan/WakeOnLanManager.cpp @@ -21,6 +21,7 @@ using namespace chip; using namespace chip::app::Clusters::WakeOnLan; -chip::CharSpan WakeOnLanManager::HandleGetMacAddress() { +chip::CharSpan WakeOnLanManager::HandleGetMacAddress() +{ return chip::CharSpan("00:00:00:00:00", strlen("00:00:00:00:00")); -} \ No newline at end of file +} diff --git a/examples/tv-app/linux/include/wake-on-lan/WakeOnLanManager.h b/examples/tv-app/linux/include/wake-on-lan/WakeOnLanManager.h index fd788122e9b76a..ba4a6964a5bfc8 100644 --- a/examples/tv-app/linux/include/wake-on-lan/WakeOnLanManager.h +++ b/examples/tv-app/linux/include/wake-on-lan/WakeOnLanManager.h @@ -23,5 +23,5 @@ class WakeOnLanManager : public chip::app::Clusters::WakeOnLan::Delegate { public: - chip::CharSpan HandleGetMacAddress() override; + chip::CharSpan HandleGetMacAddress() override; }; diff --git a/src/app/clusters/account-login-server/account-login-delegate.h b/src/app/clusters/account-login-server/account-login-delegate.h index da32d3b3fed37a..3880b7aa7f6456 100644 --- a/src/app/clusters/account-login-server/account-login-delegate.h +++ b/src/app/clusters/account-login-server/account-login-delegate.h @@ -33,9 +33,9 @@ namespace AccountLogin { class Delegate { public: - virtual bool HandleLogin(const chip::CharSpan & tempAccountIdentifierString, const chip::CharSpan & setupPinString) = 0; - virtual bool HandleLogout() = 0; - virtual Commands::GetSetupPINResponse::Type HandleGetSetupPin(const chip::CharSpan & tempAccountIdentifierString) = 0; + virtual bool HandleLogin(const chip::CharSpan & tempAccountIdentifierString, const chip::CharSpan & setupPinString) = 0; + virtual bool HandleLogout() = 0; + virtual Commands::GetSetupPINResponse::Type HandleGetSetupPin(const chip::CharSpan & tempAccountIdentifierString) = 0; virtual ~Delegate() = default; }; diff --git a/src/app/clusters/account-login-server/account-login-server.cpp b/src/app/clusters/account-login-server/account-login-server.cpp index 21349b6a8f00ff..a095944282f97c 100644 --- a/src/app/clusters/account-login-server/account-login-server.cpp +++ b/src/app/clusters/account-login-server/account-login-server.cpp @@ -21,8 +21,8 @@ ******************************************************************************* ******************************************************************************/ -#include #include +#include #include #include @@ -88,8 +88,8 @@ bool emberAfAccountLoginClusterGetSetupPINRequestCallback(app::CommandHandler * const app::ConcreteCommandPath & commandPath, const Commands::GetSetupPINRequest::DecodableType & commandData) { - CHIP_ERROR err = CHIP_NO_ERROR; - EndpointId endpoint = commandPath.mEndpointId; + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; auto & tempAccountIdentifier = commandData.tempAccountIdentifier; Delegate * delegate = GetDelegate(endpoint); @@ -97,7 +97,7 @@ bool emberAfAccountLoginClusterGetSetupPINRequestCallback(app::CommandHandler * { Commands::GetSetupPINResponse::Type response = delegate->HandleGetSetupPin(tempAccountIdentifier); - err = command->AddResponseData(commandPath, response); + err = command->AddResponseData(commandPath, response); SuccessOrExit(err); } @@ -115,37 +115,35 @@ bool emberAfAccountLoginClusterGetSetupPINRequestCallback(app::CommandHandler * bool emberAfAccountLoginClusterLoginRequestCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, const Commands::LoginRequest::DecodableType & commandData) { - CHIP_ERROR err = CHIP_NO_ERROR; - EndpointId endpoint = commandPath.mEndpointId; + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; auto & tempAccountIdentifier = commandData.tempAccountIdentifier; - auto & setupPin = commandData.setupPIN; + auto & setupPin = commandData.setupPIN; Delegate * delegate = GetDelegate(endpoint); VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); - exit: +exit: if (err != CHIP_NO_ERROR) { ChipLogError(Zcl, "emberAfAccountLoginClusterLoginRequestCallback error: %s", err.AsString()); emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); } - bool isLoggedIn = delegate->HandleLogin(tempAccountIdentifier, setupPin); + bool isLoggedIn = delegate->HandleLogin(tempAccountIdentifier, setupPin); EmberAfStatus status = isLoggedIn ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_NOT_AUTHORIZED; emberAfSendImmediateDefaultResponse(status); return true; } - -bool emberAfAccountLoginClusterLogoutRequestCallback(app::CommandHandler * commandObj, - const app::ConcreteCommandPath & commandPath, +bool emberAfAccountLoginClusterLogoutRequestCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, const Commands::LogoutRequest::DecodableType & commandData) { - CHIP_ERROR err = CHIP_NO_ERROR; + CHIP_ERROR err = CHIP_NO_ERROR; EndpointId endpoint = commandPath.mEndpointId; Delegate * delegate = GetDelegate(endpoint); VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); - exit: +exit: if (err != CHIP_NO_ERROR) { ChipLogError(Zcl, "emberAfAccountLoginClusterLogoutRequestCallback error: %s", err.AsString()); diff --git a/src/app/clusters/application-basic-server/application-basic-delegate.h b/src/app/clusters/application-basic-server/application-basic-delegate.h index f57d0907923e4f..cc53f85c999dd0 100644 --- a/src/app/clusters/application-basic-server/application-basic-delegate.h +++ b/src/app/clusters/application-basic-server/application-basic-delegate.h @@ -34,14 +34,14 @@ namespace ApplicationBasic { class Delegate { public: - virtual chip::CharSpan HandleGetVendorName() = 0; - virtual uint16_t HandleGetVendorId() = 0; - virtual chip::CharSpan HandleGetApplicationName() = 0; - virtual uint16_t HandleGetProductId() = 0; + virtual chip::CharSpan HandleGetVendorName() = 0; + virtual uint16_t HandleGetVendorId() = 0; + virtual chip::CharSpan HandleGetApplicationName() = 0; + virtual uint16_t HandleGetProductId() = 0; virtual chip::app::Clusters::ApplicationBasic::Structs::Application::Type HandleGetApplication() = 0; - virtual ApplicationStatusEnum HandleGetStatus() = 0; - virtual chip::CharSpan HandleGetApplicationVersion() = 0; - virtual std::list HandleGetAllowedVendorList() = 0; + virtual ApplicationStatusEnum HandleGetStatus() = 0; + virtual chip::CharSpan HandleGetApplicationVersion() = 0; + virtual std::list HandleGetAllowedVendorList() = 0; virtual ~Delegate() = default; }; diff --git a/src/app/clusters/application-basic-server/application-basic-server.cpp b/src/app/clusters/application-basic-server/application-basic-server.cpp index 263ef610aeda42..6615c28b61d4f9 100644 --- a/src/app/clusters/application-basic-server/application-basic-server.cpp +++ b/src/app/clusters/application-basic-server/application-basic-server.cpp @@ -22,8 +22,8 @@ ******************************************************************************* ******************************************************************************/ -#include #include +#include #include #include @@ -153,7 +153,6 @@ CHIP_ERROR ApplicationBasicAttrAccess::Read(const app::ConcreteReadAttributePath return CHIP_NO_ERROR; } - CHIP_ERROR ApplicationBasicAttrAccess::ReadVendorNameAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate) { chip::CharSpan vendorName = delegate->HandleGetVendorName(); @@ -213,7 +212,7 @@ CHIP_ERROR ApplicationBasicAttrAccess::ReadAllowedVendorListAttribute(app::Attri // ----------------------------------------------------------------------------- // Plugin initialization -void MatterApplicationBasicPluginServerInitCallback() +void MatterApplicationBasicPluginServerInitCallback() { registerAttributeAccessOverride(&gApplicationBasicAttrAccess); -} \ No newline at end of file +} diff --git a/src/app/clusters/application-launcher-server/application-launcher-delegate.h b/src/app/clusters/application-launcher-server/application-launcher-delegate.h index 151c80eeeae335..7d6ff13c06a2f9 100644 --- a/src/app/clusters/application-launcher-server/application-launcher-delegate.h +++ b/src/app/clusters/application-launcher-server/application-launcher-delegate.h @@ -35,12 +35,15 @@ class Delegate { public: virtual chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEP::Type HandleGetCurrentApp() = 0; - virtual std::list HandleGetCatalogList() = 0; - - virtual Commands::LauncherResponse::Type HandleLaunchApp(const chip::CharSpan & data, - const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) = 0; - virtual Commands::LauncherResponse::Type HandleStopApp(const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) = 0; - virtual Commands::LauncherResponse::Type HandleHideApp(const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) = 0; + virtual std::list HandleGetCatalogList() = 0; + + virtual Commands::LauncherResponse::Type + HandleLaunchApp(const chip::CharSpan & data, + const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) = 0; + virtual Commands::LauncherResponse::Type + HandleStopApp(const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) = 0; + virtual Commands::LauncherResponse::Type + HandleHideApp(const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) = 0; virtual ~Delegate() = default; }; diff --git a/src/app/clusters/application-launcher-server/application-launcher-server.cpp b/src/app/clusters/application-launcher-server/application-launcher-server.cpp index 28f9e886ce3fb6..50b2b2506baf52 100644 --- a/src/app/clusters/application-launcher-server/application-launcher-server.cpp +++ b/src/app/clusters/application-launcher-server/application-launcher-server.cpp @@ -22,8 +22,8 @@ ******************************************************************************* ******************************************************************************/ -#include #include +#include #include #include @@ -153,22 +153,21 @@ CHIP_ERROR ApplicationLauncherAttrAccess::ReadCurrentAppAttribute(app::Attribute // ----------------------------------------------------------------------------- // Matter Framework Callbacks Implementation - bool emberAfApplicationLauncherClusterLaunchAppRequestCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, const Commands::LaunchAppRequest::DecodableType & commandData) { - CHIP_ERROR err = CHIP_NO_ERROR; + CHIP_ERROR err = CHIP_NO_ERROR; EndpointId endpoint = commandPath.mEndpointId; - auto & data = commandData.data; - auto & application = commandData.application; + auto & data = commandData.data; + auto & application = commandData.application; Delegate * delegate = GetDelegate(endpoint); VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); { Commands::LauncherResponse::Type response = delegate->HandleLaunchApp(data, application); - err = command->AddResponseData(commandPath, response); + err = command->AddResponseData(commandPath, response); SuccessOrExit(err); } @@ -189,16 +188,16 @@ bool emberAfApplicationLauncherClusterStopAppRequestCallback(app::CommandHandler const app::ConcreteCommandPath & commandPath, const Commands::StopAppRequest::DecodableType & commandData) { - CHIP_ERROR err = CHIP_NO_ERROR; + CHIP_ERROR err = CHIP_NO_ERROR; EndpointId endpoint = commandPath.mEndpointId; - auto & application = commandData.application; + auto & application = commandData.application; Delegate * delegate = GetDelegate(endpoint); VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); { Commands::LauncherResponse::Type response = delegate->HandleStopApp(application); - err = command->AddResponseData(commandPath, response); + err = command->AddResponseData(commandPath, response); SuccessOrExit(err); } @@ -219,16 +218,16 @@ bool emberAfApplicationLauncherClusterHideAppRequestCallback(app::CommandHandler const app::ConcreteCommandPath & commandPath, const Commands::HideAppRequest::DecodableType & commandData) { - CHIP_ERROR err = CHIP_NO_ERROR; + CHIP_ERROR err = CHIP_NO_ERROR; EndpointId endpoint = commandPath.mEndpointId; - auto & application = commandData.application; + auto & application = commandData.application; Delegate * delegate = GetDelegate(endpoint); VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); { Commands::LauncherResponse::Type response = delegate->HandleHideApp(application); - err = command->AddResponseData(commandPath, response); + err = command->AddResponseData(commandPath, response); SuccessOrExit(err); } @@ -242,7 +241,6 @@ bool emberAfApplicationLauncherClusterHideAppRequestCallback(app::CommandHandler return true; } - // ----------------------------------------------------------------------------- // Plugin initialization diff --git a/src/app/clusters/audio-output-server/audio-output-delegate.h b/src/app/clusters/audio-output-server/audio-output-delegate.h index b70e57f62c3d14..daa1f0f084a6d2 100644 --- a/src/app/clusters/audio-output-server/audio-output-delegate.h +++ b/src/app/clusters/audio-output-server/audio-output-delegate.h @@ -34,11 +34,11 @@ namespace AudioOutput { class Delegate { public: - virtual uint8_t HandleGetCurrentOutput() = 0; + virtual uint8_t HandleGetCurrentOutput() = 0; virtual std::list HandleGetOutputList() = 0; virtual bool HandleRenameOutput(const uint8_t & index, const chip::CharSpan & name) = 0; - virtual bool HandleSelectOutput(const uint8_t & index) = 0; + virtual bool HandleSelectOutput(const uint8_t & index) = 0; virtual ~Delegate() = default; }; diff --git a/src/app/clusters/audio-output-server/audio-output-server.cpp b/src/app/clusters/audio-output-server/audio-output-server.cpp index 45b7b3ddd91408..fb8ff0b401919d 100644 --- a/src/app/clusters/audio-output-server/audio-output-server.cpp +++ b/src/app/clusters/audio-output-server/audio-output-server.cpp @@ -22,8 +22,8 @@ ******************************************************************************* ******************************************************************************/ -#include #include +#include #include #include @@ -90,8 +90,7 @@ namespace { class AudioOutputAttrAccess : public app::AttributeAccessInterface { public: - AudioOutputAttrAccess() : - app::AttributeAccessInterface(Optional::Missing(), chip::app::Clusters::AudioOutput::Id) + AudioOutputAttrAccess() : app::AttributeAccessInterface(Optional::Missing(), chip::app::Clusters::AudioOutput::Id) {} CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override; @@ -156,22 +155,22 @@ bool emberAfAudioOutputClusterRenameOutputRequestCallback(app::CommandHandler * const app::ConcreteCommandPath & commandPath, const Commands::RenameOutputRequest::DecodableType & commandData) { - CHIP_ERROR err = CHIP_NO_ERROR; + CHIP_ERROR err = CHIP_NO_ERROR; EndpointId endpoint = commandPath.mEndpointId; - auto & index = commandData.index; - auto & name = commandData.name; + auto & index = commandData.index; + auto & name = commandData.name; Delegate * delegate = GetDelegate(endpoint); VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); - exit: +exit: if (err != CHIP_NO_ERROR) { ChipLogError(Zcl, "emberAfAudioOutputClusterRenameOutputRequestCallback error: %s", err.AsString()); emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); } - bool success = delegate->HandleRenameOutput(index, name); + bool success = delegate->HandleRenameOutput(index, name); EmberAfStatus status = success ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE; emberAfSendImmediateDefaultResponse(status); return true; @@ -181,27 +180,27 @@ bool emberAfAudioOutputClusterSelectOutputRequestCallback(app::CommandHandler * const app::ConcreteCommandPath & commandPath, const Commands::SelectOutputRequest::DecodableType & commandData) { - CHIP_ERROR err = CHIP_NO_ERROR; + CHIP_ERROR err = CHIP_NO_ERROR; EndpointId endpoint = commandPath.mEndpointId; - auto & index = commandData.index; + auto & index = commandData.index; Delegate * delegate = GetDelegate(endpoint); VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); - exit: +exit: if (err != CHIP_NO_ERROR) { ChipLogError(Zcl, "emberAfAudioOutputClusterSelectOutputRequestCallback error: %s", err.AsString()); emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); } - bool success = delegate->HandleSelectOutput(index); + bool success = delegate->HandleSelectOutput(index); EmberAfStatus status = success ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE; emberAfSendImmediateDefaultResponse(status); return true; } -void MatterAudioOutputPluginServerInitCallback() +void MatterAudioOutputPluginServerInitCallback() { registerAttributeAccessOverride(&gAudioOutputAttrAccess); } diff --git a/src/app/clusters/channel-server/channel-delegate.h b/src/app/clusters/channel-server/channel-delegate.h index 448087090043ae..0195c1004389b7 100644 --- a/src/app/clusters/channel-server/channel-delegate.h +++ b/src/app/clusters/channel-server/channel-delegate.h @@ -35,12 +35,12 @@ class Delegate { public: virtual std::list HandleGetChannelList() = 0; - virtual chip::app::Clusters::Channel::Structs::LineupInfo::Type HandleGetLineup() = 0; - virtual chip::app::Clusters::Channel::Structs::ChannelInfo::Type HandleGetCurrentChannel() = 0; + virtual chip::app::Clusters::Channel::Structs::LineupInfo::Type HandleGetLineup() = 0; + virtual chip::app::Clusters::Channel::Structs::ChannelInfo::Type HandleGetCurrentChannel() = 0; - virtual Commands::ChangeChannelResponse::Type HandleChangeChannel(const chip::CharSpan & match) = 0; + virtual Commands::ChangeChannelResponse::Type HandleChangeChannel(const chip::CharSpan & match) = 0; virtual bool HandleChangeChannelByNumber(const uint16_t & majorNumber, const uint16_t & minorNumber) = 0; - virtual bool HandleSkipChannel(const uint16_t & count) = 0; + virtual bool HandleSkipChannel(const uint16_t & count) = 0; virtual ~Delegate() = default; }; @@ -48,4 +48,4 @@ class Delegate } // namespace Channel } // namespace Clusters } // namespace app -} // namespace chip \ No newline at end of file +} // namespace chip diff --git a/src/app/clusters/channel-server/channel-server.cpp b/src/app/clusters/channel-server/channel-server.cpp index 3a32e1175e592b..c5f08c427a750d 100644 --- a/src/app/clusters/channel-server/channel-server.cpp +++ b/src/app/clusters/channel-server/channel-server.cpp @@ -38,8 +38,8 @@ ******************************************************************************* ******************************************************************************/ -#include #include +#include #include #include @@ -106,9 +106,7 @@ namespace { class ChannelAttrAccess : public app::AttributeAccessInterface { public: - ChannelAttrAccess() : - app::AttributeAccessInterface(Optional::Missing(), chip::app::Clusters::Channel::Id) - {} + ChannelAttrAccess() : app::AttributeAccessInterface(Optional::Missing(), chip::app::Clusters::Channel::Id) {} CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override; @@ -181,16 +179,16 @@ CHIP_ERROR ChannelAttrAccess::ReadCurrentChannelAttribute(app::AttributeValueEnc bool emberAfChannelClusterChangeChannelRequestCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, const Commands::ChangeChannelRequest::DecodableType & commandData) { - CHIP_ERROR err = CHIP_NO_ERROR; + CHIP_ERROR err = CHIP_NO_ERROR; EndpointId endpoint = commandPath.mEndpointId; - auto & match = commandData.match; + auto & match = commandData.match; Delegate * delegate = GetDelegate(endpoint); VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); { Commands::ChangeChannelResponse::Type response = delegate->HandleChangeChannel(match); - err = command->AddResponseData(commandPath, response); + err = command->AddResponseData(commandPath, response); SuccessOrExit(err); } @@ -207,7 +205,7 @@ bool emberAfChannelClusterChangeChannelByNumberRequestCallback( app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, const Commands::ChangeChannelByNumberRequest::DecodableType & commandData) { - CHIP_ERROR err = CHIP_NO_ERROR; + CHIP_ERROR err = CHIP_NO_ERROR; EndpointId endpoint = commandPath.mEndpointId; auto & majorNumber = commandData.majorNumber; @@ -216,14 +214,14 @@ bool emberAfChannelClusterChangeChannelByNumberRequestCallback( Delegate * delegate = GetDelegate(endpoint); VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); - exit: +exit: if (err != CHIP_NO_ERROR) { ChipLogError(Zcl, "emberAfChannelClusterChangeChannelByNumberRequestCallback error: %s", err.AsString()); emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); } - bool success = delegate->HandleChangeChannelByNumber(majorNumber, minorNumber); + bool success = delegate->HandleChangeChannelByNumber(majorNumber, minorNumber); EmberAfStatus status = success ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE; emberAfSendImmediateDefaultResponse(status); return true; @@ -232,27 +230,27 @@ bool emberAfChannelClusterChangeChannelByNumberRequestCallback( bool emberAfChannelClusterSkipChannelRequestCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, const Commands::SkipChannelRequest::DecodableType & commandData) { - CHIP_ERROR err = CHIP_NO_ERROR; + CHIP_ERROR err = CHIP_NO_ERROR; EndpointId endpoint = commandPath.mEndpointId; - auto & count = commandData.count; + auto & count = commandData.count; Delegate * delegate = GetDelegate(endpoint); VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); - exit: +exit: if (err != CHIP_NO_ERROR) { ChipLogError(Zcl, "emberAfChannelClusterSkipChannelRequestCallback error: %s", err.AsString()); emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); } - bool success = delegate->HandleSkipChannel(count); + bool success = delegate->HandleSkipChannel(count); EmberAfStatus status = success ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE; emberAfSendImmediateDefaultResponse(status); return true; } -void MatterChannelPluginServerInitCallback() +void MatterChannelPluginServerInitCallback() { registerAttributeAccessOverride(&gChannelAttrAccess); } diff --git a/src/app/clusters/content-launch-server/content-launch-delegate.h b/src/app/clusters/content-launch-server/content-launch-delegate.h index 5fb512052c6cee..0ac1da2bf96a0a 100644 --- a/src/app/clusters/content-launch-server/content-launch-delegate.h +++ b/src/app/clusters/content-launch-server/content-launch-delegate.h @@ -36,12 +36,10 @@ class Delegate { public: virtual Commands::LaunchResponse::Type HandleLaunchContent(chip::EndpointId endpointId, - const std::list & parameterList, - bool autoplay, + const std::list & parameterList, bool autoplay, const chip::CharSpan & data) = 0; - virtual Commands::LaunchResponse::Type HandleLaunchUrl(const chip::CharSpan & contentUrl, - const chip::CharSpan & displayString, + virtual Commands::LaunchResponse::Type HandleLaunchUrl(const chip::CharSpan & contentUrl, const chip::CharSpan & displayString, const std::list & brandingInformation) = 0; virtual std::list HandleGetAcceptHeaderList() = 0; diff --git a/src/app/clusters/content-launch-server/content-launch-server.cpp b/src/app/clusters/content-launch-server/content-launch-server.cpp index 49d6355f2fcc0f..286e141bd324b1 100644 --- a/src/app/clusters/content-launch-server/content-launch-server.cpp +++ b/src/app/clusters/content-launch-server/content-launch-server.cpp @@ -38,8 +38,8 @@ ******************************************************************************* ******************************************************************************/ -#include #include +#include #include #include @@ -160,7 +160,8 @@ CHIP_ERROR ContentLauncherAttrAccess::ReadAcceptHeaderAttribute(app::AttributeVa }); } -CHIP_ERROR ContentLauncherAttrAccess::ReadSupportedStreamingProtocolsAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate) +CHIP_ERROR ContentLauncherAttrAccess::ReadSupportedStreamingProtocolsAttribute(app::AttributeValueEncoder & aEncoder, + Delegate * delegate) { uint32_t streamingProtocols = delegate->HandleGetSupportedStreamingProtocols(); return aEncoder.Encode(streamingProtocols); @@ -175,7 +176,7 @@ bool emberAfContentLauncherClusterLaunchContentRequestCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::ContentLauncher::Commands::LaunchContentRequest::DecodableType & commandData) { - CHIP_ERROR err = CHIP_NO_ERROR; + CHIP_ERROR err = CHIP_NO_ERROR; EndpointId endpoint = commandPath.mEndpointId; auto & autoplay = commandData.autoPlay; @@ -189,7 +190,7 @@ bool emberAfContentLauncherClusterLaunchContentRequestCallback( { Commands::LaunchResponse::Type response = delegate->HandleLaunchContent(endpoint, parameterList, autoplay, data); - err = commandObj->AddResponseData(commandPath, response); + err = commandObj->AddResponseData(commandPath, response); SuccessOrExit(err); } @@ -208,7 +209,7 @@ bool emberAfContentLauncherClusterLaunchURLRequestCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::ContentLauncher::Commands::LaunchURLRequest::DecodableType & commandData) { - CHIP_ERROR err = CHIP_NO_ERROR; + CHIP_ERROR err = CHIP_NO_ERROR; EndpointId endpoint = commandPath.mEndpointId; auto & contentUrl = commandData.contentURL; @@ -222,7 +223,7 @@ bool emberAfContentLauncherClusterLaunchURLRequestCallback( { Commands::LaunchResponse::Type response = delegate->HandleLaunchUrl(contentUrl, displayString, brandingInformationList); - err = commandObj->AddResponseData(commandPath, response); + err = commandObj->AddResponseData(commandPath, response); SuccessOrExit(err); } diff --git a/src/app/clusters/keypad-input-server/keypad-input-server.cpp b/src/app/clusters/keypad-input-server/keypad-input-server.cpp index 76daa179d644d8..bd97df20f97fc1 100644 --- a/src/app/clusters/keypad-input-server/keypad-input-server.cpp +++ b/src/app/clusters/keypad-input-server/keypad-input-server.cpp @@ -21,8 +21,8 @@ ******************************************************************************* ******************************************************************************/ -#include #include +#include #include #include @@ -80,23 +80,21 @@ void SetDefaultDelegate(EndpointId endpoint, Delegate * delegate) } // namespace app } // namespace chip - // ----------------------------------------------------------------------------- // Matter Framework Callbacks Implementation -bool emberAfKeypadInputClusterSendKeyRequestCallback(app::CommandHandler * command, - const app::ConcreteCommandPath & commandPath, +bool emberAfKeypadInputClusterSendKeyRequestCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, const Commands::SendKeyRequest::DecodableType & commandData) { - CHIP_ERROR err = CHIP_NO_ERROR; + CHIP_ERROR err = CHIP_NO_ERROR; EndpointId endpoint = commandPath.mEndpointId; - auto & keyCode = commandData.keyCode; + auto & keyCode = commandData.keyCode; Delegate * delegate = GetDelegate(endpoint); VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); { Commands::SendKeyResponse::Type response = delegate->HandleSendKey(keyCode); - err = command->AddResponseData(commandPath, response); + err = command->AddResponseData(commandPath, response); SuccessOrExit(err); } diff --git a/src/app/clusters/low-power-server/low-power-server.cpp b/src/app/clusters/low-power-server/low-power-server.cpp index fe765a294db7b4..9f43fb3a3604b3 100644 --- a/src/app/clusters/low-power-server/low-power-server.cpp +++ b/src/app/clusters/low-power-server/low-power-server.cpp @@ -22,9 +22,8 @@ ******************************************************************************* ******************************************************************************/ - -#include #include +#include #include #include @@ -84,20 +83,20 @@ void SetDefaultDelegate(EndpointId endpoint, Delegate * delegate) bool emberAfLowPowerClusterSleepCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, const Commands::Sleep::DecodableType & commandData) { - CHIP_ERROR err = CHIP_NO_ERROR; + CHIP_ERROR err = CHIP_NO_ERROR; EndpointId endpoint = commandPath.mEndpointId; Delegate * delegate = GetDelegate(endpoint); VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); - exit: +exit: if (err != CHIP_NO_ERROR) { ChipLogError(Zcl, "emberAfLowPowerClusterSleepCallback error: %s", err.AsString()); emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); } - bool success = delegate->HandleSleep(); + bool success = delegate->HandleSleep(); EmberAfStatus status = success ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE; emberAfSendImmediateDefaultResponse(status); return true; diff --git a/src/app/clusters/low-power-server/low-power-server.h b/src/app/clusters/low-power-server/low-power-server.h index 7bc63835b63314..27ca2bc8ae8ab7 100644 --- a/src/app/clusters/low-power-server/low-power-server.h +++ b/src/app/clusters/low-power-server/low-power-server.h @@ -16,8 +16,8 @@ */ /**************************************************************************** * @file - * @brief Routines for the Keypad Input plugin, the - *server implementation of the Keypad Input cluster. + * @brief Routines for the Low Power plugin, the + *server implementation of the Low Power cluster. ******************************************************************************* ******************************************************************************/ diff --git a/src/app/clusters/media-input-server/media-input-delegate.h b/src/app/clusters/media-input-server/media-input-delegate.h index eca971fa6c4a37..b596a9c5e58b2f 100644 --- a/src/app/clusters/media-input-server/media-input-delegate.h +++ b/src/app/clusters/media-input-server/media-input-delegate.h @@ -34,12 +34,12 @@ namespace MediaInput { class Delegate { public: - virtual std::list HandleGetInputList() = 0; - virtual uint8_t HandleGetCurrentInput() = 0; - virtual bool HandleSelectInput(const uint8_t index) = 0; - virtual bool HandleShowInputStatus() = 0; - virtual bool HandleHideInputStatus() = 0; - virtual bool HandleRenameInput(const uint8_t index, const chip::CharSpan & name) = 0; + virtual std::list HandleGetInputList() = 0; + virtual uint8_t HandleGetCurrentInput() = 0; + virtual bool HandleSelectInput(const uint8_t index) = 0; + virtual bool HandleShowInputStatus() = 0; + virtual bool HandleHideInputStatus() = 0; + virtual bool HandleRenameInput(const uint8_t index, const chip::CharSpan & name) = 0; virtual ~Delegate() = default; }; @@ -47,4 +47,4 @@ class Delegate } // namespace MediaInput } // namespace Clusters } // namespace app -} // namespace chip \ No newline at end of file +} // namespace chip diff --git a/src/app/clusters/media-input-server/media-input-server.cpp b/src/app/clusters/media-input-server/media-input-server.cpp index d5ba9039fdca2e..896a759ba0a758 100644 --- a/src/app/clusters/media-input-server/media-input-server.cpp +++ b/src/app/clusters/media-input-server/media-input-server.cpp @@ -90,9 +90,7 @@ namespace { class MediaInputAttrAccess : public app::AttributeAccessInterface { public: - MediaInputAttrAccess() : - app::AttributeAccessInterface(Optional::Missing(), chip::app::Clusters::MediaInput::Id) - {} + MediaInputAttrAccess() : app::AttributeAccessInterface(Optional::Missing(), chip::app::Clusters::MediaInput::Id) {} CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override; @@ -149,15 +147,13 @@ CHIP_ERROR MediaInputAttrAccess::ReadCurrentInputAttribute(app::AttributeValueEn } // anonymous namespace - // ----------------------------------------------------------------------------- // Matter Framework Callbacks Implementation - bool emberAfMediaInputClusterSelectInputRequestCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, const Commands::SelectInputRequest::DecodableType & commandData) { - CHIP_ERROR err = CHIP_NO_ERROR; + CHIP_ERROR err = CHIP_NO_ERROR; EndpointId endpoint = commandPath.mEndpointId; auto & input = commandData.index; @@ -165,14 +161,14 @@ bool emberAfMediaInputClusterSelectInputRequestCallback(app::CommandHandler * co Delegate * delegate = GetDelegate(endpoint); VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); - exit: +exit: if (err != CHIP_NO_ERROR) { ChipLogError(Zcl, "emberAfMediaInputClusterSelectInputRequestCallback error: %s", err.AsString()); emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); } - bool success = delegate->HandleSelectInput(input); + bool success = delegate->HandleSelectInput(input); EmberAfStatus status = success ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE; emberAfSendImmediateDefaultResponse(status); return true; @@ -182,44 +178,43 @@ bool emberAfMediaInputClusterShowInputStatusRequestCallback(app::CommandHandler const app::ConcreteCommandPath & commandPath, const Commands::ShowInputStatusRequest::DecodableType & commandData) { - CHIP_ERROR err = CHIP_NO_ERROR; + CHIP_ERROR err = CHIP_NO_ERROR; EndpointId endpoint = commandPath.mEndpointId; Delegate * delegate = GetDelegate(endpoint); VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); - exit: +exit: if (err != CHIP_NO_ERROR) { ChipLogError(Zcl, "emberAfMediaInputClusterShowInputStatusRequestCallback error: %s", err.AsString()); emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); } - bool success = delegate->HandleShowInputStatus(); + bool success = delegate->HandleShowInputStatus(); EmberAfStatus status = success ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE; emberAfSendImmediateDefaultResponse(status); return true; } - bool emberAfMediaInputClusterHideInputStatusRequestCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, const Commands::HideInputStatusRequest::DecodableType & commandData) { - CHIP_ERROR err = CHIP_NO_ERROR; + CHIP_ERROR err = CHIP_NO_ERROR; EndpointId endpoint = commandPath.mEndpointId; Delegate * delegate = GetDelegate(endpoint); VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); - exit: +exit: if (err != CHIP_NO_ERROR) { ChipLogError(Zcl, "emberAfMediaInputClusterHideInputStatusRequestCallback error: %s", err.AsString()); emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); } - bool success = delegate->HandleHideInputStatus(); + bool success = delegate->HandleHideInputStatus(); EmberAfStatus status = success ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE; emberAfSendImmediateDefaultResponse(status); return true; @@ -228,28 +223,28 @@ bool emberAfMediaInputClusterHideInputStatusRequestCallback(app::CommandHandler bool emberAfMediaInputClusterRenameInputRequestCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, const Commands::RenameInputRequest::DecodableType & commandData) { - CHIP_ERROR err = CHIP_NO_ERROR; + CHIP_ERROR err = CHIP_NO_ERROR; EndpointId endpoint = commandPath.mEndpointId; - auto & index = commandData.index; - auto & name = commandData.name; + auto & index = commandData.index; + auto & name = commandData.name; Delegate * delegate = GetDelegate(endpoint); VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); - exit: +exit: if (err != CHIP_NO_ERROR) { ChipLogError(Zcl, "emberAfMediaInputClusterRenameInputRequestCallback error: %s", err.AsString()); emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); } - bool success = delegate->HandleRenameInput(index, name); + bool success = delegate->HandleRenameInput(index, name); EmberAfStatus status = success ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE; emberAfSendImmediateDefaultResponse(status); return true; } -void MatterMediaInputPluginServerInitCallback() +void MatterMediaInputPluginServerInitCallback() { registerAttributeAccessOverride(&gMediaInputAttrAccess); } diff --git a/src/app/clusters/media-playback-server/media-playback-delegate.h b/src/app/clusters/media-playback-server/media-playback-delegate.h index 522d83b5e0978f..ed7b43d1b3b98f 100644 --- a/src/app/clusters/media-playback-server/media-playback-delegate.h +++ b/src/app/clusters/media-playback-server/media-playback-delegate.h @@ -34,25 +34,25 @@ namespace MediaPlayback { class Delegate { public: - virtual PlaybackStateEnum HandleGetCurrentState() = 0; - virtual uint64_t HandleGetStartTime() = 0; - virtual uint64_t HandleGetDuration() = 0; + virtual PlaybackStateEnum HandleGetCurrentState() = 0; + virtual uint64_t HandleGetStartTime() = 0; + virtual uint64_t HandleGetDuration() = 0; virtual Structs::PlaybackPosition::Type HandleGetSampledPosition() = 0; - virtual float HandleGetPlaybackSpeed() = 0; - virtual uint64_t HandleGetSeekRangeStart() = 0; - virtual uint64_t HandleGetSeekRangeEnd() = 0; - - virtual Commands::PlaybackResponse::Type HandlePlay() = 0; - virtual Commands::PlaybackResponse::Type HandlePause() = 0; - virtual Commands::PlaybackResponse::Type HandleStop() = 0; - virtual Commands::PlaybackResponse::Type HandleFastForward() = 0; - virtual Commands::PlaybackResponse::Type HandlePrevious() = 0; - virtual Commands::PlaybackResponse::Type HandleRewind() = 0; + virtual float HandleGetPlaybackSpeed() = 0; + virtual uint64_t HandleGetSeekRangeStart() = 0; + virtual uint64_t HandleGetSeekRangeEnd() = 0; + + virtual Commands::PlaybackResponse::Type HandlePlay() = 0; + virtual Commands::PlaybackResponse::Type HandlePause() = 0; + virtual Commands::PlaybackResponse::Type HandleStop() = 0; + virtual Commands::PlaybackResponse::Type HandleFastForward() = 0; + virtual Commands::PlaybackResponse::Type HandlePrevious() = 0; + virtual Commands::PlaybackResponse::Type HandleRewind() = 0; virtual Commands::PlaybackResponse::Type HandleSkipBackward(const uint64_t & deltaPositionMilliseconds) = 0; - virtual Commands::PlaybackResponse::Type HandleSkipForward(const uint64_t & deltaPositionMilliseconds) = 0; - virtual Commands::PlaybackResponse::Type HandleSeekRequest(const uint64_t & positionMilliseconds) = 0; - virtual Commands::PlaybackResponse::Type HandleNext() = 0; - virtual Commands::PlaybackResponse::Type HandleStartOverRequest() = 0; + virtual Commands::PlaybackResponse::Type HandleSkipForward(const uint64_t & deltaPositionMilliseconds) = 0; + virtual Commands::PlaybackResponse::Type HandleSeekRequest(const uint64_t & positionMilliseconds) = 0; + virtual Commands::PlaybackResponse::Type HandleNext() = 0; + virtual Commands::PlaybackResponse::Type HandleStartOverRequest() = 0; virtual ~Delegate() = default; }; @@ -60,4 +60,4 @@ class Delegate } // namespace MediaPlayback } // namespace Clusters } // namespace app -} // namespace chip \ No newline at end of file +} // namespace chip diff --git a/src/app/clusters/media-playback-server/media-playback-server.cpp b/src/app/clusters/media-playback-server/media-playback-server.cpp index 8b26e523cf7be0..38746abdf612b5 100644 --- a/src/app/clusters/media-playback-server/media-playback-server.cpp +++ b/src/app/clusters/media-playback-server/media-playback-server.cpp @@ -22,8 +22,8 @@ ******************************************************************************* ******************************************************************************/ -#include #include +#include #include #include @@ -194,15 +194,13 @@ CHIP_ERROR MediaPlaybackAttrAccess::ReadSeekRangeEndAttribute(app::AttributeValu } // anonymous namespace - - // ----------------------------------------------------------------------------- // Matter Framework Callbacks Implementation bool emberAfMediaPlaybackClusterPlayRequestCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, const Commands::PlayRequest::DecodableType & commandData) { - CHIP_ERROR err = CHIP_NO_ERROR; + CHIP_ERROR err = CHIP_NO_ERROR; EndpointId endpoint = commandPath.mEndpointId; Delegate * delegate = GetDelegate(endpoint); @@ -210,7 +208,7 @@ bool emberAfMediaPlaybackClusterPlayRequestCallback(app::CommandHandler * comman { Commands::PlaybackResponse::Type response = delegate->HandlePlay(); - err = command->AddResponseData(commandPath, response); + err = command->AddResponseData(commandPath, response); SuccessOrExit(err); } @@ -224,11 +222,10 @@ bool emberAfMediaPlaybackClusterPlayRequestCallback(app::CommandHandler * comman return true; } - bool emberAfMediaPlaybackClusterPauseRequestCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, const Commands::PauseRequest::DecodableType & commandData) { - CHIP_ERROR err = CHIP_NO_ERROR; + CHIP_ERROR err = CHIP_NO_ERROR; EndpointId endpoint = commandPath.mEndpointId; Delegate * delegate = GetDelegate(endpoint); @@ -236,7 +233,7 @@ bool emberAfMediaPlaybackClusterPauseRequestCallback(app::CommandHandler * comma { Commands::PlaybackResponse::Type response = delegate->HandlePause(); - err = command->AddResponseData(commandPath, response); + err = command->AddResponseData(commandPath, response); SuccessOrExit(err); } @@ -253,7 +250,7 @@ bool emberAfMediaPlaybackClusterPauseRequestCallback(app::CommandHandler * comma bool emberAfMediaPlaybackClusterStopRequestCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, const Commands::StopRequest::DecodableType & commandData) { - CHIP_ERROR err = CHIP_NO_ERROR; + CHIP_ERROR err = CHIP_NO_ERROR; EndpointId endpoint = commandPath.mEndpointId; Delegate * delegate = GetDelegate(endpoint); @@ -261,7 +258,7 @@ bool emberAfMediaPlaybackClusterStopRequestCallback(app::CommandHandler * comman { Commands::PlaybackResponse::Type response = delegate->HandleStop(); - err = command->AddResponseData(commandPath, response); + err = command->AddResponseData(commandPath, response); SuccessOrExit(err); } @@ -279,7 +276,7 @@ bool emberAfMediaPlaybackClusterFastForwardRequestCallback(app::CommandHandler * const app::ConcreteCommandPath & commandPath, const Commands::FastForwardRequest::DecodableType & commandData) { - CHIP_ERROR err = CHIP_NO_ERROR; + CHIP_ERROR err = CHIP_NO_ERROR; EndpointId endpoint = commandPath.mEndpointId; Delegate * delegate = GetDelegate(endpoint); @@ -287,7 +284,7 @@ bool emberAfMediaPlaybackClusterFastForwardRequestCallback(app::CommandHandler * { Commands::PlaybackResponse::Type response = delegate->HandleFastForward(); - err = command->AddResponseData(commandPath, response); + err = command->AddResponseData(commandPath, response); SuccessOrExit(err); } @@ -304,7 +301,7 @@ bool emberAfMediaPlaybackClusterFastForwardRequestCallback(app::CommandHandler * bool emberAfMediaPlaybackClusterPreviousRequestCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, const Commands::PreviousRequest::DecodableType & commandData) { - CHIP_ERROR err = CHIP_NO_ERROR; + CHIP_ERROR err = CHIP_NO_ERROR; EndpointId endpoint = commandPath.mEndpointId; Delegate * delegate = GetDelegate(endpoint); @@ -312,7 +309,7 @@ bool emberAfMediaPlaybackClusterPreviousRequestCallback(app::CommandHandler * co { Commands::PlaybackResponse::Type response = delegate->HandlePrevious(); - err = command->AddResponseData(commandPath, response); + err = command->AddResponseData(commandPath, response); SuccessOrExit(err); } @@ -329,7 +326,7 @@ bool emberAfMediaPlaybackClusterPreviousRequestCallback(app::CommandHandler * co bool emberAfMediaPlaybackClusterRewindRequestCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, const Commands::RewindRequest::DecodableType & commandData) { - CHIP_ERROR err = CHIP_NO_ERROR; + CHIP_ERROR err = CHIP_NO_ERROR; EndpointId endpoint = commandPath.mEndpointId; Delegate * delegate = GetDelegate(endpoint); @@ -337,7 +334,7 @@ bool emberAfMediaPlaybackClusterRewindRequestCallback(app::CommandHandler * comm { Commands::PlaybackResponse::Type response = delegate->HandleRewind(); - err = command->AddResponseData(commandPath, response); + err = command->AddResponseData(commandPath, response); SuccessOrExit(err); } @@ -351,12 +348,11 @@ bool emberAfMediaPlaybackClusterRewindRequestCallback(app::CommandHandler * comm return true; } - bool emberAfMediaPlaybackClusterSkipBackwardRequestCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, const Commands::SkipBackwardRequest::DecodableType & commandData) { - CHIP_ERROR err = CHIP_NO_ERROR; + CHIP_ERROR err = CHIP_NO_ERROR; EndpointId endpoint = commandPath.mEndpointId; auto & deltaPositionMilliseconds = commandData.deltaPositionMilliseconds; @@ -366,7 +362,7 @@ bool emberAfMediaPlaybackClusterSkipBackwardRequestCallback(app::CommandHandler { Commands::PlaybackResponse::Type response = delegate->HandleSkipBackward(deltaPositionMilliseconds); - err = command->AddResponseData(commandPath, response); + err = command->AddResponseData(commandPath, response); SuccessOrExit(err); } @@ -384,8 +380,8 @@ bool emberAfMediaPlaybackClusterSkipForwardRequestCallback(app::CommandHandler * const app::ConcreteCommandPath & commandPath, const Commands::SkipForwardRequest::DecodableType & commandData) { - CHIP_ERROR err = CHIP_NO_ERROR; - EndpointId endpoint = commandPath.mEndpointId; + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; auto & deltaPositionMilliseconds = commandData.deltaPositionMilliseconds; Delegate * delegate = GetDelegate(endpoint); @@ -393,7 +389,7 @@ bool emberAfMediaPlaybackClusterSkipForwardRequestCallback(app::CommandHandler * { Commands::PlaybackResponse::Type response = delegate->HandleSkipForward(deltaPositionMilliseconds); - err = command->AddResponseData(commandPath, response); + err = command->AddResponseData(commandPath, response); SuccessOrExit(err); } @@ -410,8 +406,8 @@ bool emberAfMediaPlaybackClusterSkipForwardRequestCallback(app::CommandHandler * bool emberAfMediaPlaybackClusterSeekRequestCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, const Commands::SeekRequest::DecodableType & commandData) { - CHIP_ERROR err = CHIP_NO_ERROR; - EndpointId endpoint = commandPath.mEndpointId; + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; auto & positionMilliseconds = commandData.position; Delegate * delegate = GetDelegate(endpoint); @@ -419,7 +415,7 @@ bool emberAfMediaPlaybackClusterSeekRequestCallback(app::CommandHandler * comman { Commands::PlaybackResponse::Type response = delegate->HandleSeekRequest(positionMilliseconds); - err = command->AddResponseData(commandPath, response); + err = command->AddResponseData(commandPath, response); SuccessOrExit(err); } @@ -436,7 +432,7 @@ bool emberAfMediaPlaybackClusterSeekRequestCallback(app::CommandHandler * comman bool emberAfMediaPlaybackClusterNextRequestCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, const Commands::NextRequest::DecodableType & commandData) { - CHIP_ERROR err = CHIP_NO_ERROR; + CHIP_ERROR err = CHIP_NO_ERROR; EndpointId endpoint = commandPath.mEndpointId; Delegate * delegate = GetDelegate(endpoint); @@ -444,7 +440,7 @@ bool emberAfMediaPlaybackClusterNextRequestCallback(app::CommandHandler * comman { Commands::PlaybackResponse::Type response = delegate->HandleNext(); - err = command->AddResponseData(commandPath, response); + err = command->AddResponseData(commandPath, response); SuccessOrExit(err); } @@ -462,7 +458,7 @@ bool emberAfMediaPlaybackClusterStartOverRequestCallback(app::CommandHandler * c const app::ConcreteCommandPath & commandPath, const Commands::StartOverRequest::DecodableType & commandData) { - CHIP_ERROR err = CHIP_NO_ERROR; + CHIP_ERROR err = CHIP_NO_ERROR; EndpointId endpoint = commandPath.mEndpointId; Delegate * delegate = GetDelegate(endpoint); @@ -470,7 +466,7 @@ bool emberAfMediaPlaybackClusterStartOverRequestCallback(app::CommandHandler * c { Commands::PlaybackResponse::Type response = delegate->HandleStartOverRequest(); - err = command->AddResponseData(commandPath, response); + err = command->AddResponseData(commandPath, response); SuccessOrExit(err); } @@ -484,7 +480,7 @@ bool emberAfMediaPlaybackClusterStartOverRequestCallback(app::CommandHandler * c return true; } -void MatterMediaPlaybackPluginServerInitCallback() +void MatterMediaPlaybackPluginServerInitCallback() { registerAttributeAccessOverride(&gMediaPlaybackAttrAccess); } diff --git a/src/app/clusters/target-navigator-server/target-navigator-delegate.h b/src/app/clusters/target-navigator-server/target-navigator-delegate.h index 5d0a77105ef5c5..5c2de2a23d7287 100644 --- a/src/app/clusters/target-navigator-server/target-navigator-delegate.h +++ b/src/app/clusters/target-navigator-server/target-navigator-delegate.h @@ -34,8 +34,8 @@ namespace TargetNavigator { class Delegate { public: - virtual std::list HandleGetTargetList() = 0; - virtual uint8_t HandleGetCurrentTarget() = 0; + virtual std::list HandleGetTargetList() = 0; + virtual uint8_t HandleGetCurrentTarget() = 0; virtual Commands::NavigateTargetResponse::Type HandleNavigateTarget(const uint64_t & target, const chip::CharSpan & data) = 0; virtual ~Delegate() = default; @@ -44,4 +44,4 @@ class Delegate } // namespace TargetNavigator } // namespace Clusters } // namespace app -} // namespace chip \ No newline at end of file +} // namespace chip diff --git a/src/app/clusters/target-navigator-server/target-navigator-server.cpp b/src/app/clusters/target-navigator-server/target-navigator-server.cpp index 25570796448d7d..13eb7552d1721d 100644 --- a/src/app/clusters/target-navigator-server/target-navigator-server.cpp +++ b/src/app/clusters/target-navigator-server/target-navigator-server.cpp @@ -22,8 +22,8 @@ ******************************************************************************* ******************************************************************************/ -#include #include +#include #include #include @@ -83,7 +83,6 @@ void SetDefaultDelegate(EndpointId endpoint, Delegate * delegate) } // namespace app } // namespace chip - // ----------------------------------------------------------------------------- // Attribute Accessor Implementation @@ -158,17 +157,17 @@ bool emberAfTargetNavigatorClusterNavigateTargetRequestCallback(app::CommandHand const app::ConcreteCommandPath & commandPath, const Commands::NavigateTargetRequest::DecodableType & commandData) { - CHIP_ERROR err = CHIP_NO_ERROR; + CHIP_ERROR err = CHIP_NO_ERROR; EndpointId endpoint = commandPath.mEndpointId; - auto & target = commandData.target; - auto & data = commandData.data; + auto & target = commandData.target; + auto & data = commandData.data; Delegate * delegate = GetDelegate(endpoint); VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); { Commands::NavigateTargetResponse::Type response = delegate->HandleNavigateTarget(target, data); - err = command->AddResponseData(commandPath, response); + err = command->AddResponseData(commandPath, response); SuccessOrExit(err); } @@ -182,7 +181,7 @@ bool emberAfTargetNavigatorClusterNavigateTargetRequestCallback(app::CommandHand return true; } -void MatterTargetNavigatorPluginServerInitCallback() +void MatterTargetNavigatorPluginServerInitCallback() { registerAttributeAccessOverride(&gTargetNavigatorAttrAccess); } diff --git a/src/app/clusters/target-navigator-server/target-navigator-server.h b/src/app/clusters/target-navigator-server/target-navigator-server.h index 1b1c75ff2c6052..584b2152c19364 100644 --- a/src/app/clusters/target-navigator-server/target-navigator-server.h +++ b/src/app/clusters/target-navigator-server/target-navigator-server.h @@ -16,8 +16,8 @@ */ /**************************************************************************** * @file - * @brief Routines for the Media Playback plugin, the - *server implementation of the Media Playback cluster. + * @brief Routines for the Target Navigator plugin, the + *server implementation of the Target Navigator cluster. ******************************************************************************* ******************************************************************************/ diff --git a/src/app/clusters/wake-on-lan-server/wake-on-lan-server.cpp b/src/app/clusters/wake-on-lan-server/wake-on-lan-server.cpp index 795d4d493082a6..9b6e5d20e9634a 100644 --- a/src/app/clusters/wake-on-lan-server/wake-on-lan-server.cpp +++ b/src/app/clusters/wake-on-lan-server/wake-on-lan-server.cpp @@ -22,9 +22,8 @@ ******************************************************************************* ******************************************************************************/ - -#include #include +#include #include #include @@ -92,9 +91,7 @@ namespace { class WakeOnLanAttrAccess : public app::AttributeAccessInterface { public: - WakeOnLanAttrAccess() : - app::AttributeAccessInterface(Optional::Missing(), chip::app::Clusters::WakeOnLan::Id) - {} + WakeOnLanAttrAccess() : app::AttributeAccessInterface(Optional::Missing(), chip::app::Clusters::WakeOnLan::Id) {} CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override; @@ -135,7 +132,7 @@ CHIP_ERROR WakeOnLanAttrAccess::ReadMacAddressAttribute(app::AttributeValueEncod } // anonymous namespace -void MatterWakeOnLanPluginServerInitCallback() +void MatterWakeOnLanPluginServerInitCallback() { registerAttributeAccessOverride(&gWakeOnLanAttrAccess); } diff --git a/src/app/util/ContentApp.cpp b/src/app/util/ContentApp.cpp index 85437d13e7f2aa..ec02ed1e7d14ad 100644 --- a/src/app/util/ContentApp.cpp +++ b/src/app/util/ContentApp.cpp @@ -237,12 +237,13 @@ CHIP_ERROR TargetNavigator::GetTargetInfoList(chip::app::AttributeValueEncoder & }); } -app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::Type TargetNavigator::NavigateTarget(uint8_t target, std::string data) +app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::Type TargetNavigator::NavigateTarget(uint8_t target, + std::string data) { ChipLogProgress(DeviceLayer, "TargetNavigator: NavigateTarget target=%d data=\"%s\"", target, data.c_str()); app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::Type response; - response.data = chip::CharSpan("data response", strlen("data response")); + response.data = chip::CharSpan("data response", strlen("data response")); if (target >= mTargets.size()) { diff --git a/src/app/util/ContentApp.h b/src/app/util/ContentApp.h index 4ab62e0d334f5c..1c9a9ab1a46815 100644 --- a/src/app/util/ContentApp.h +++ b/src/app/util/ContentApp.h @@ -91,7 +91,8 @@ class DLL_EXPORT ApplicationLauncher : public ContentAppCluster public: virtual ~ApplicationLauncher() = default; - virtual app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Type LaunchApp(Application application, std::string data) = 0; + virtual app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Type LaunchApp(Application application, + std::string data) = 0; EmberAfStatus HandleReadAttribute(chip::AttributeId attributeId, uint8_t * buffer, uint16_t maxReadLength) override; EmberAfStatus HandleWriteAttribute(chip::AttributeId attributeId, uint8_t * buffer) override; @@ -102,7 +103,8 @@ class DLL_EXPORT ContentLauncher : public ContentAppCluster public: virtual ~ContentLauncher() = default; - virtual app::Clusters::ContentLauncher::Commands::LaunchResponse::Type LaunchContent(std::list parameterList, bool autoplay, std::string data) = 0; + virtual app::Clusters::ContentLauncher::Commands::LaunchResponse::Type LaunchContent(std::list parameterList, + bool autoplay, std::string data) = 0; EmberAfStatus HandleReadAttribute(chip::AttributeId attributeId, uint8_t * buffer, uint16_t maxReadLength) override; EmberAfStatus HandleWriteAttribute(chip::AttributeId attributeId, uint8_t * buffer) override;