+ " -h --help Shows this help text" << endl <<
+ " -l --list-devices List all devices on this system" << endl <<
+ " -t --type {p|r|t|a} The device type to use. More than one is possible." << endl <<
+ " -f --log-file {file} Writes all libCEC log message to a file" << endl <<
+ " -sf --short-log-file {file} Writes all libCEC log message without timestamps" << endl <<
+ " and log levels to a file." << endl <<
+ " -d --log-level {level} Sets the log level. See cectypes.h for values." << 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 <<
+ endl <<
+ "Type 'h' or 'help' and press enter after starting the client to display all " << endl <<
+ "available commands" << endl;
+}
+
+ICECAdapter *create_parser(cec_device_type_list typeList)
+{
+ ICECAdapter *parser = LibCecInit("CECTester", typeList);
+ if (!parser || parser->GetMinLibVersion() > CEC_TEST_CLIENT_VERSION)
+ {
+ #ifdef __WINDOWS__
+ cout << "Cannot load libcec.dll" << endl;
+ #else
+ cout << "Cannot load libcec.so" << endl;
+ #endif
+ return NULL;
+ }
+
+ CStdString strLog;
+ strLog.Format("CEC Parser created - libcec version %d.%d", parser->GetLibVersionMajor(), parser->GetLibVersionMinor());
+ cout << strLog.c_str() << endl;
+
+ return parser;
+}
+
+void show_console_help(void)
+{
+ cout << endl <<
+ "================================================================================" << endl <<
+ "Available commands:" << endl <<
+ endl <<
+ "tx {bytes} transfer bytes over the CEC line." << endl <<
+ "txn {bytes} transfer bytes but don't wait for transmission ACK." << endl <<
+ "[tx 40 00 FF 11 22 33] sends bytes 0x40 0x00 0xFF 0x11 0x22 0x33" << endl <<
+ endl <<
+ "on {address} power on the device with the given logical address." << endl <<
+ "[on 5] power on a connected audio system" << endl <<
+ endl <<
+ "standby {address} put the device with the given address in standby mode." << endl <<
+ "[standby 0] powers off the TV" << endl <<
+ endl <<
+ "la {logical_address} change the logical address of the CEC adapter." << endl <<
+ "[la 4] logical address 4" << endl <<
+ endl <<
+ "pa {physical_address} change the physical address of the CEC adapter." << endl <<
+ "[pa 10 00] physical address 1.0.0.0" << endl <<
+ endl <<
+ "osd {addr} {string} set OSD message on the specified device." << endl <<
+ "[osd 0 Test Message] displays 'Test Message' on the TV" << endl <<
+ endl <<
+ "ver {addr} get the CEC version of the specified device." << endl <<
+ "[ver 0] get the CEC version of the TV" << endl <<
+ endl <<
+ "ven {addr} get the vendor ID of the specified device." << endl <<
+ "[ven 0] get the vendor ID of the TV" << endl <<
+ endl <<
+ "lang {addr} get the menu language of the specified device." << endl <<
+ "[lang 0] get the menu language of the TV" << endl <<
+ endl <<
+ "pow {addr} get the power status of the specified device." << endl <<
+ "[pow 0] get the power status of the TV" << endl <<
+ endl <<
+ "poll {addr} poll the specified device." << endl <<
+ "[poll 0] sends a poll message to the TV" << endl <<
+ endl <<
+ "[mon] {1|0} enable or disable CEC bus monitoring." << endl <<
+ "[log] {1 - 31} change the log level. see cectypes.h for values." << endl <<
+ "[ping] send a ping command to the CEC adapter." << endl <<
+ "[bl] to let the adapter enter the bootloader, to upgrade" << endl <<
+ " the flash rom." << endl <<
+ "[r] reconnect to the CEC adapter." << endl <<
+ "[h] or [help] show this help." << endl <<
+ "[q] or [quit] to quit the CEC test client and switch off all" << endl <<
+ " connected CEC devices." << endl <<
+ "================================================================================" << endl;