From 58b6feada6a574ef1a6ad36072f97370ac86befd Mon Sep 17 00:00:00 2001 From: chrisdecenzo Date: Wed, 28 Dec 2022 15:50:04 -0800 Subject: [PATCH] Fix command line support in linux tv-casting-app --- examples/tv-casting-app/linux/main.cpp | 6 +++++- .../tv-casting-app/tv-casting-common/src/CastingServer.cpp | 3 +++ .../tv-casting-common/src/TargetVideoPlayerInfo.cpp | 5 ++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/examples/tv-casting-app/linux/main.cpp b/examples/tv-casting-app/linux/main.cpp index d6d674ebb2a954..87a3f5551f0615 100644 --- a/examples/tv-casting-app/linux/main.cpp +++ b/examples/tv-casting-app/linux/main.cpp @@ -139,7 +139,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 1fa2965abcbff6..ec9dbb63d496bb 100644 --- a/examples/tv-casting-app/tv-casting-common/src/CastingServer.cpp +++ b/examples/tv-casting-app/tv-casting-common/src/CastingServer.cpp @@ -168,6 +168,7 @@ CastingServer::GetDiscoveredCommissioner(int index, chip::Optional