added 'is' command to cec-client, to mark libCEC as inactive source
[deb_libcec.git] / src / testclient / main.cpp
index 945935afc86d9946feb9ff36f1ebc039fc3efbf3..c6082921bf1844c22b70f86f114f211bd3cf7c67 100644 (file)
@@ -48,7 +48,7 @@ using namespace CEC;
 using namespace std;
 using namespace PLATFORM;
 
-#define CEC_CONFIG_VERSION CEC_CLIENT_VERSION_2_0_3;
+#define CEC_CONFIG_VERSION CEC_CLIENT_VERSION_CURRENT;
 
 #include "../../include/cecloader.h"
 
@@ -285,6 +285,7 @@ void ShowHelpConsole(void)
   "[p] {device} {port}       change the HDMI port number of the CEC adapter." << endl <<
   "[pa] {physical address}   change the physical address of the CEC adapter." << endl <<
   "[as]                      make the CEC adapter the active source." << endl <<
+  "[is]                      mark the CEC adapter as inactive source." << endl <<
   "[osd] {addr} {string}     set OSD message on the specified device." << endl <<
   "[ver] {addr}              get the CEC version of the specified device." << endl <<
   "[ven] {addr}              get the vendor ID of the specified device." << endl <<
@@ -381,6 +382,10 @@ bool ProcessCommandTX(ICECAdapter *parser, const string &command, string &argume
     cec_command bytes;
     bytes.Clear();
 
+    CStdString strArguments(arguments);
+    strArguments.Replace(':', ' ');
+    arguments = strArguments;
+
     while (GetWord(arguments, strvalue) && HexStrToInt(strvalue, ivalue))
       bytes.PushBack(ivalue);
 
@@ -555,6 +560,13 @@ bool ProcessCommandAS(ICECAdapter *parser, const string &command, string & UNUSE
   return false;
 }
 
+bool ProcessCommandIS(ICECAdapter *parser, const string &command, string & UNUSED(arguments))
+{
+  if (command == "is")
+    return parser->SetInactiveView();
+
+  return false;
+}
 
 bool ProcessCommandPING(ICECAdapter *parser, const string &command, string & UNUSED(arguments))
 {
@@ -916,6 +928,7 @@ bool ProcessConsoleCommand(ICECAdapter *parser, string &input)
       ProcessCommandP(parser, command, input) ||
       ProcessCommandPA(parser, command, input) ||
       ProcessCommandAS(parser, command, input) ||
+      ProcessCommandIS(parser, command, input) ||
       ProcessCommandOSD(parser, command, input) ||
       ProcessCommandPING(parser, command, input) ||
       ProcessCommandVOLUP(parser, command, input) ||