From c2707bafa4629bb2aeab811a359bac2171c5a533 Mon Sep 17 00:00:00 2001 From: Lazar Kovacic Date: Tue, 28 Dec 2021 23:29:20 +0100 Subject: [PATCH] Fix TV app Linux build --- examples/tv-app/linux/AppImpl.cpp | 18 +++++++++--------- examples/tv-app/linux/AppImpl.h | 6 ++++-- .../ContentLauncherManager.cpp | 2 ++ 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/examples/tv-app/linux/AppImpl.cpp b/examples/tv-app/linux/AppImpl.cpp index 74a3cf8b0e1c6e..dd2d2569ef641e 100644 --- a/examples/tv-app/linux/AppImpl.cpp +++ b/examples/tv-app/linux/AppImpl.cpp @@ -190,7 +190,8 @@ uint32_t AccountLoginImpl::GetSetupPIN(const char * tempAccountId) return mSetupPIN; } -ApplicationLauncherResponse ApplicationLauncherImpl::LaunchApp(Application application, std::string data) +chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Type +ApplicationLauncherImpl::LaunchApp(Application application, std::string data) { std::string appId(application.applicationId.data(), application.applicationId.size()); ChipLogProgress(DeviceLayer, @@ -198,21 +199,20 @@ ApplicationLauncherResponse ApplicationLauncherImpl::LaunchApp(Application appli "application.applicationId=%s data=%s", application.catalogVendorId, appId.c_str(), data.c_str()); - ApplicationLauncherResponse response; - const char * testData = "data"; - response.data = (uint8_t *) testData; - response.status = to_underlying(chip::app::Clusters::ApplicationLauncher::StatusEnum::kSuccess); + chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Type response; + response.data = chip::CharSpan("data", strlen("data")); + response.status = chip::app::Clusters::ApplicationLauncher::StatusEnum::kSuccess; return response; } -LaunchResponse ContentLauncherImpl::LaunchContent(std::list parameterList, bool autoplay, std::string data) +chip::app::Clusters::ContentLauncher::Commands::LaunchResponse::Type +ContentLauncherImpl::LaunchContent(std::list parameterList, bool autoplay, std::string data) { ChipLogProgress(DeviceLayer, "ContentLauncherImpl: LaunchContent autoplay=%d data=\"%s\"", autoplay ? 1 : 0, data.c_str()); - LaunchResponse response; - response.err = CHIP_NO_ERROR; - response.data = "Example app data"; + chip::app::Clusters::ContentLauncher::Commands::LaunchResponse::Type response; + response.data = chip::CharSpan("data", strlen("data")); response.status = chip::app::Clusters::ContentLauncher::StatusEnum::kSuccess; return response; } diff --git a/examples/tv-app/linux/AppImpl.h b/examples/tv-app/linux/AppImpl.h index c188b0b37bcccd..4512c514156409 100644 --- a/examples/tv-app/linux/AppImpl.h +++ b/examples/tv-app/linux/AppImpl.h @@ -98,7 +98,8 @@ class DLL_EXPORT ApplicationLauncherImpl : public ApplicationLauncher public: virtual ~ApplicationLauncherImpl() {} - ApplicationLauncherResponse LaunchApp(Application application, std::string data) override; + chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Type LaunchApp(Application application, + std::string data) override; protected: }; @@ -108,7 +109,8 @@ class DLL_EXPORT ContentLauncherImpl : public ContentLauncher public: virtual ~ContentLauncherImpl() {} - LaunchResponse LaunchContent(std::list parameterList, bool autoplay, std::string data) override; + chip::app::Clusters::ContentLauncher::Commands::LaunchResponse::Type LaunchContent(std::list parameterList, + bool autoplay, std::string data) override; protected: }; diff --git a/examples/tv-app/linux/include/content-launcher/ContentLauncherManager.cpp b/examples/tv-app/linux/include/content-launcher/ContentLauncherManager.cpp index 7dabd7c4d80253..33891a9f9bbfa7 100644 --- a/examples/tv-app/linux/include/content-launcher/ContentLauncherManager.cpp +++ b/examples/tv-app/linux/include/content-launcher/ContentLauncherManager.cpp @@ -17,9 +17,11 @@ */ #include "ContentLauncherManager.h" +#include using namespace std; using namespace chip::app::Clusters::ContentLauncher; +using namespace chip::AppPlatform; Commands::LaunchResponse::Type ContentLauncherManager::HandleLaunchContent(chip::EndpointId endpointId, const std::list & parameterList,