X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Ftestclient%2Fmain.cpp;h=24ddde594eb7b9abd67503c6ee3fd453c65012ed;hb=6be84fc462ace5e3b2bc0a0e68c3449de4310b33;hp=dc68b60913c19c708e1829a1d923280b82310d8d;hpb=8e0a2616941be1adf296e77ada37e337a2dafd5c;p=deb_libcec.git diff --git a/src/testclient/main.cpp b/src/testclient/main.cpp index dc68b60..24ddde5 100644 --- a/src/testclient/main.cpp +++ b/src/testclient/main.cpp @@ -48,7 +48,7 @@ using namespace CEC; using namespace std; using namespace PLATFORM; -#define CEC_CONFIG_VERSION CEC_CLIENT_VERSION_1_99_0; +#define CEC_CONFIG_VERSION CEC_CLIENT_VERSION_2_0_1; #include "../../include/cecloader.h" @@ -537,6 +537,18 @@ bool ProcessCommandAS(ICECAdapter *parser, const string &command, string & UNUSE if (command == "as") { parser->SetActiveSource(); + // wait for the source switch to finish for 15 seconds tops + if (g_bSingleCommand) + { + CTimeout timeout(15000); + bool bActiveSource(false); + while (timeout.TimeLeft() > 0 && !bActiveSource) + { + bActiveSource = parser->IsLibCECActiveSource(); + if (!bActiveSource) + CEvent::Sleep(100); + } + } return true; } @@ -857,7 +869,7 @@ bool ProcessCommandSCAN(ICECAdapter *parser, const string &command, string & UNU cec_power_status power = parser->GetDevicePowerStatus((cec_logical_address)iPtr); cec_osd_name osdName = parser->GetDeviceOSDName((cec_logical_address)iPtr); CStdString strAddr; - strAddr.Format("%04x", iPhysicalAddress); + strAddr.Format("%x.%x.%x.%x", (iPhysicalAddress >> 12) & 0xF, (iPhysicalAddress >> 8) & 0xF, (iPhysicalAddress >> 4) & 0xF, iPhysicalAddress & 0xF); cec_menu_language lang; lang.device = CECDEVICE_UNKNOWN; parser->GetDeviceMenuLanguage((cec_logical_address)iPtr, &lang);