Skip to content

Commit

Permalink
better formatting of the scan command in CecSharpClient
Browse files Browse the repository at this point in the history
  • Loading branch information
opdenkamp committed Mar 18, 2015
1 parent 64c81c5 commit db098de
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/CecSharpTester/CecSharpClient.cs
Expand Up @@ -291,8 +291,9 @@ public void MainLoop()
}
else if (splitCommand[0] == "scan")
{
Console.WriteLine("CEC bus information");
Console.WriteLine("===================");
StringBuilder output = new StringBuilder();
output.AppendLine("CEC bus information");
output.AppendLine("===================");
CecLogicalAddresses addresses = Lib.GetActiveDevices();
for (int iPtr = 0; iPtr < addresses.Addresses.Length; iPtr++)
{
Expand All @@ -303,13 +304,12 @@ public void MainLoop()
CecVendorId iVendorId = Lib.GetDeviceVendorId(address);
bool bActive = Lib.IsActiveDevice(address);
ushort iPhysicalAddress = Lib.GetDevicePhysicalAddress(address);
string strAddr = string.Format("{0,4:X}", iPhysicalAddress);
string strAddr = Lib.PhysicalAddressToString(iPhysicalAddress);
CecVersion iCecVersion = Lib.GetDeviceCecVersion(address);
CecPowerStatus power = Lib.GetDevicePowerStatus(address);
string osdName = Lib.GetDeviceOSDName(address);
string lang = Lib.GetDeviceMenuLanguage(address);

StringBuilder output = new StringBuilder();
output.AppendLine("device #" + iPtr + ": " + Lib.ToString(address));
output.AppendLine("address: " + strAddr);
output.AppendLine("active source: " + (bActive ? "yes" : "no"));
Expand All @@ -319,9 +319,9 @@ public void MainLoop()
output.AppendLine("power status: " + Lib.ToString(power));
if (!string.IsNullOrEmpty(lang))
output.AppendLine("language: " + lang);

Console.WriteLine(output.ToString());
output.AppendLine("");
}
Console.WriteLine(output.ToString());
}
else if (splitCommand[0] == "h" || splitCommand[0] == "help")
ShowConsoleHelp();
Expand Down

0 comments on commit db098de

Please sign in to comment.