From 040e2a141123a3b3c64033675e48a0db1518c4f1 Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Thu, 26 Apr 2012 13:43:13 +0200 Subject: [PATCH] cec-client: group up the output of the 'scan' command, and add the currently active source to the output --- src/testclient/main.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/testclient/main.cpp b/src/testclient/main.cpp index 723b917..011044e 100644 --- a/src/testclient/main.cpp +++ b/src/testclient/main.cpp @@ -813,14 +813,15 @@ bool ProcessCommandSCAN(ICECAdapter *parser, const string &command, string & UNU { if (command == "scan") { - PrintToStdOut("CEC bus information"); - PrintToStdOut("==================="); + CStdString strLog; + PrintToStdOut("requesting CEC bus information ..."); + + strLog.append("CEC bus information\n===================\n"); cec_logical_addresses addresses = parser->GetActiveDevices(); for (uint8_t iPtr = 0; iPtr < 16; iPtr++) { if (addresses[iPtr]) { - CStdString strLog; uint64_t iVendorId = parser->GetDeviceVendorId((cec_logical_address)iPtr); bool bActive = parser->IsActiveSource((cec_logical_address)iPtr); uint16_t iPhysicalAddress = parser->GetDevicePhysicalAddress((cec_logical_address)iPtr); @@ -842,10 +843,14 @@ bool ProcessCommandSCAN(ICECAdapter *parser, const string &command, string & UNU strLog.AppendFormat("power status: %s\n", parser->ToString(power)); if ((uint8_t)lang.device == iPtr) strLog.AppendFormat("language: %s\n", lang.language); - strLog.append("\n"); - PrintToStdOut(strLog); + strLog.append("\n\n"); } } + + cec_logical_address activeSource = parser->GetActiveSource(); + strLog.AppendFormat("currently active source: %s (%X)", parser->ToString(activeSource), (int)activeSource); + + PrintToStdOut(strLog); return true; } -- 2.34.1