X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Ftestclient%2Fmain.cpp;h=4b13f3a78311d6af929064213b347f14774c5fb8;hb=e2800c154cf5ce325adf02f7473ce4686962f383;hp=162c1f17c4017fe61bfc64752ed9829a2f65c94d;hpb=38ed5789ff087c524d4c263aff4b947ce34096b0;p=deb_libcec.git diff --git a/src/testclient/main.cpp b/src/testclient/main.cpp index 162c1f1..4b13f3a 100644 --- a/src/testclient/main.cpp +++ b/src/testclient/main.cpp @@ -58,6 +58,7 @@ cec_logical_address g_iBaseDevice((cec_logical_address)CEC_DEFAULT_BASE_DEVICE) cec_device_type_list g_typeList; bool g_bSingleCommand(false); bool g_bExit(false); +bool g_bHardExit(false); CMutex g_outputMutex; ICECCallbacks g_callbacks; @@ -539,6 +540,7 @@ bool ProcessCommandBL(ICECAdapter *parser, const string &command, string & UNUSE { PrintToStdOut("entered bootloader mode. exiting cec-client"); g_bExit = true; + g_bHardExit = true; } return true; } @@ -1078,7 +1080,7 @@ int main (int argc, char *argv[]) if (!parser->Open(g_strPort.c_str())) { CStdString strLog; - strLog.Format("unable to open the device on port %s"); + strLog.Format("unable to open the device on port %s", g_strPort.c_str()); PrintToStdOut(strLog); UnloadLibCec(parser); return 1; @@ -1094,13 +1096,13 @@ int main (int argc, char *argv[]) PrintToStdOut("waiting for input"); } - while (!g_bExit) + while (!g_bExit && !g_bHardExit) { string input; getline(cin, input); cin.clear(); - if (ProcessConsoleCommand(parser, input) && !g_bSingleCommand && !g_bExit) + if (ProcessConsoleCommand(parser, input) && !g_bSingleCommand && !g_bExit && !g_bHardExit) { if (!input.empty()) PrintToStdOut("waiting for input"); @@ -1108,11 +1110,11 @@ int main (int argc, char *argv[]) else g_bExit = true; - if (!g_bExit) + if (!g_bExit && !g_bHardExit) CCondition::Sleep(50); } - if (!g_bSingleCommand) + if (!g_bSingleCommand && !g_bHardExit) parser->StandbyDevices(CECDEVICE_BROADCAST); parser->Close();