cec: set initiator and destination first in cec_command::push_back(). fixes 'tx'...
[deb_libcec.git] / src / testclient / main.cpp
index c67f0cc90ef020f0a0ef2d5b563c5c006c3c544c..33ee463cb4c8b31a11a70a23f135229cb98f18dc 100644 (file)
  *     http://www.pulse-eight.net/
  */
 
-#include "../../include/CECExports.h"
-#include "../lib/platform/threads.h"
-#include "../lib/util/StdString.h"
+#include <cec.h>
+
 #include <cstdio>
 #include <fcntl.h>
 #include <iostream>
 #include <string>
 #include <sstream>
+#include "../lib/platform/threads.h"
+#include "../lib/util/StdString.h"
 
 using namespace CEC;
 using namespace std;
 
-#define CEC_TEST_CLIENT_VERSION 6
+#define CEC_TEST_CLIENT_VERSION 7
 
+#include <cecloader.h>
 
 inline bool HexStrToInt(const std::string& data, uint8_t& value)
 {
@@ -190,9 +192,13 @@ void show_console_help(void)
 int main (int argc, char *argv[])
 {
   ICECAdapter *parser = LoadLibCec("CECTester");
-  if (!parser && parser->GetMinVersion() > CEC_TEST_CLIENT_VERSION)
+  if (!parser || parser->GetMinVersion() > CEC_TEST_CLIENT_VERSION)
   {
-    cout << "Unable to create parser. Is libcec.dll present?" << endl;
+#ifdef __WINDOWS__
+    cout << "Cannot load libcec.dll" << endl;
+#else
+    cout << "Cannot load libcec.so" << endl;
+#endif
     return 1;
   }
   CStdString strLog;
@@ -280,7 +286,7 @@ int main (int argc, char *argv[])
           bytes.clear();
 
           while (GetWord(input, strvalue) && HexStrToInt(strvalue, ivalue))
-          bytes.push_back(ivalue);
+            bytes.push_back(ivalue);
 
           parser->Transmit(bytes);
         }