From 82210287cff86778addfffd7de4df951d945df66 Mon Sep 17 00:00:00 2001 From: chrisdecenzo <61757564+chrisdecenzo@users.noreply.github.com> Date: Tue, 28 Mar 2023 12:40:05 -0700 Subject: [PATCH] Fix command line support in linux tv-casting-app (#24215) * Fix command line support in linux tv-casting-app * Address comments --------- Co-authored-by: Christopher DeCenzo --- examples/tv-casting-app/linux/main.cpp | 6 +++++- .../tv-casting-common/src/CastingServer.cpp | 16 ++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/examples/tv-casting-app/linux/main.cpp b/examples/tv-casting-app/linux/main.cpp index 75584254a6002f..485cf7917e6a29 100644 --- a/examples/tv-casting-app/linux/main.cpp +++ b/examples/tv-casting-app/linux/main.cpp @@ -141,7 +141,11 @@ int main(int argc, char * argv[]) VerifyOrDie(CHIP_NO_ERROR == initParams.InitializeStaticResourcesBeforeServerInit()); VerifyOrDie(CHIP_NO_ERROR == chip::Server::GetInstance().Init(initParams)); - if (ConnectToCachedVideoPlayer() == CHIP_NO_ERROR) + if (argc > 1) + { + ChipLogProgress(AppServer, "Command line parameters detected. Skipping auto-start."); + } + else if (ConnectToCachedVideoPlayer() == CHIP_NO_ERROR) { ChipLogProgress(AppServer, "Skipping commissioner discovery / User directed commissioning flow."); } diff --git a/examples/tv-casting-app/tv-casting-common/src/CastingServer.cpp b/examples/tv-casting-app/tv-casting-common/src/CastingServer.cpp index 80654c818bece7..1dd4612b03f1db 100644 --- a/examples/tv-casting-app/tv-casting-common/src/CastingServer.cpp +++ b/examples/tv-casting-app/tv-casting-common/src/CastingServer.cpp @@ -211,6 +211,12 @@ CastingServer::GetDiscoveredCommissioner(int index, chip::Optional