X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Ftestclient%2Fmain.cpp;h=57f61974c725d9e7e54e461fbe5e83b146e03b57;hb=34fe491f051387fa870da9459ce53892f7bb03ab;hp=39b7ff47df5ca8e761aa3235adc7feffc9db02e9;hpb=466925f5c43536e5fd96632615810da783b78096;p=deb_libcec.git diff --git a/src/testclient/main.cpp b/src/testclient/main.cpp index 39b7ff4..57f6197 100644 --- a/src/testclient/main.cpp +++ b/src/testclient/main.cpp @@ -249,6 +249,7 @@ void ShowHelpCommandLine(const char* strExec) " -s --single-command Execute a single command and exit. Does not power" << endl << " on devices on startup and power them off on exit." << endl << " -o --osd-name {osd name} Use a custom osd name." << endl << + " -m --monitor Start a monitor-only client." << endl << " [COM PORT] The com port to connect to. If no COM" << endl << " port is given, the client tries to connect to the" << endl << " first device that is detected." << endl << @@ -773,14 +774,19 @@ bool ProcessCommandR(ICECAdapter *parser, const string &command, string & UNUSED { if (command == "r") { + bool bReactivate = parser->IsLibCECActiveSource(); + PrintToStdOut("closing the connection"); parser->Close(); PrintToStdOut("opening a new connection"); parser->Open(g_strPort.c_str()); - PrintToStdOut("setting active source"); - parser->SetActiveSource(); + if (bReactivate) + { + PrintToStdOut("setting active source"); + parser->SetActiveSource(); + } return true; } @@ -1072,6 +1078,13 @@ bool ProcessCommandLineArguments(int argc, char *argv[]) } ++iArgPtr; } + else if (!strcmp(argv[iArgPtr], "-m") || + !strcmp(argv[iArgPtr], "--monitor")) + { + cout << "starting a monitor-only client. use 'mon 0' to switch to normal mode" << endl; + g_config.bMonitorOnly = 1; + ++iArgPtr; + } else { g_strPort = argv[iArgPtr++]; @@ -1086,7 +1099,7 @@ int main (int argc, char *argv[]) { g_config.Clear(); snprintf(g_config.strDeviceName, 13, "CECTester"); - g_config.clientVersion = CEC_CLIENT_VERSION_1_6_2; + g_config.clientVersion = CEC_CLIENT_VERSION_1_6_3; g_config.bActivateSource = 0; g_callbacks.CBCecLogMessage = &CecLogMessage; g_callbacks.CBCecKeyPress = &CecKeyPress;