# HG changeset patch
# User Stephane Lenclud
# Date 1468940481 -7200
# Node ID ca469451f8e68407c27139fc57d8a4c5171c7b38
# Parent 33be8cb90c57cb94614742c8a7b19502eb51b37e
Published v09.3.0.
Fixing CEC log level control.
diff -r 33be8cb90c57 -r ca469451f8e6 Server/CecClient.cs
--- a/Server/CecClient.cs Tue Jul 19 15:43:04 2016 +0200
+++ b/Server/CecClient.cs Tue Jul 19 17:01:21 2016 +0200
@@ -142,7 +142,7 @@
public override int ReceiveCommand(CecCommand command)
{
- Console.WriteLine(string.Format("CEC command Src:{0} Dst:{1} Ack: {2} Eom: {3} OpcodeSet: {4} Opcode: {5} Timeout: {6}",
+ Console.WriteLine(string.Format("CEC command '{5}' from {0} to {1} - Ack: {2} Eom: {3} OpcodeSet: {4} Timeout: {6}",
iLib.ToString(command.Initiator),
iLib.ToString(command.Destination),
command.Ack.ToString(),
@@ -302,8 +302,9 @@
///
public void Scan()
{
- Console.WriteLine("CEC bus information");
- Console.WriteLine("===================");
+ string scanRes = "";
+ scanRes += "CEC bus information\n";
+ scanRes += "===================\n";
CecLogicalAddresses addresses = Lib.GetActiveDevices();
for (int iPtr = 0; iPtr < addresses.Addresses.Length; iPtr++)
{
@@ -320,17 +321,19 @@
string osdName = Lib.GetDeviceOSDName(address);
string lang = Lib.GetDeviceMenuLanguage(address);
- Console.WriteLine("device #" + iPtr + ": " + Lib.ToString(address));
- Console.WriteLine("address: " + strAddr);
- Console.WriteLine("active source: " + (bActive ? "yes" : "no"));
- Console.WriteLine("vendor: " + Lib.ToString(iVendorId));
- Console.WriteLine("osd string: " + osdName);
- Console.WriteLine("CEC version: " + Lib.ToString(iCecVersion));
- Console.WriteLine("power status: " + Lib.ToString(power));
+ scanRes += "device #" + iPtr + ": " + Lib.ToString(address) + "\n";
+ scanRes += "address: " + strAddr + "\n";
+ scanRes += "active source: " + (bActive ? "yes" : "no") + "\n";
+ scanRes += "vendor: " + Lib.ToString(iVendorId) + "\n";
+ scanRes += "osd string: " + osdName + "\n";
+ scanRes += "CEC version: " + Lib.ToString(iCecVersion) + "\n";
+ scanRes += "power status: " + Lib.ToString(power) + "\n";
if (!string.IsNullOrEmpty(lang))
- Console.WriteLine("language: " + lang);
- Console.WriteLine("");
+ scanRes += "language: " + lang + "\n";
+ scanRes += "===================" + "\n";
}
+
+ Console.Write(scanRes);
}
public void ListAdapters()
diff -r 33be8cb90c57 -r ca469451f8e6 Server/MainForm.cs
--- a/Server/MainForm.cs Tue Jul 19 15:43:04 2016 +0200
+++ b/Server/MainForm.cs Tue Jul 19 17:01:21 2016 +0200
@@ -2577,27 +2577,35 @@
Properties.Settings.Default.CecMonitorOff,
Properties.Settings.Default.CecReconnectToPowerTv);
- //Setup log level
- iCecManager.Client.LogLevel = 0;
+ SetupCecLogLevel();
+ }
+ }
- if (checkBoxCecLogError.Checked)
- iCecManager.Client.LogLevel &= (int)CecLogLevel.Error;
+ ///
+ ///
+ ///
+ private void SetupCecLogLevel()
+ {
+ //Setup log level
+ iCecManager.Client.LogLevel = 0;
- if (checkBoxCecLogWarning.Checked)
- iCecManager.Client.LogLevel &= (int)CecLogLevel.Warning;
+ if (checkBoxCecLogError.Checked)
+ iCecManager.Client.LogLevel |= (int)CecLogLevel.Error;
- if (checkBoxCecLogNotice.Checked)
- iCecManager.Client.LogLevel &= (int)CecLogLevel.Notice;
+ if (checkBoxCecLogWarning.Checked)
+ iCecManager.Client.LogLevel |= (int)CecLogLevel.Warning;
- if (checkBoxCecLogTraffic.Checked)
- iCecManager.Client.LogLevel &= (int)CecLogLevel.Traffic;
+ if (checkBoxCecLogNotice.Checked)
+ iCecManager.Client.LogLevel |= (int)CecLogLevel.Notice;
- if (checkBoxCecLogDebug.Checked)
- iCecManager.Client.LogLevel &= (int)CecLogLevel.Debug;
+ if (checkBoxCecLogTraffic.Checked)
+ iCecManager.Client.LogLevel |= (int)CecLogLevel.Traffic;
- iCecManager.Client.FilterOutPollLogs = checkBoxCecLogNoPoll.Checked;
+ if (checkBoxCecLogDebug.Checked)
+ iCecManager.Client.LogLevel |= (int)CecLogLevel.Debug;
- }
+ iCecManager.Client.FilterOutPollLogs = checkBoxCecLogNoPoll.Checked;
+
}
private void ButtonStartIdleClient_Click(object sender, EventArgs e)
@@ -2612,7 +2620,7 @@
private void checkBoxCecLogs_CheckedChanged(object sender, EventArgs e)
{
- ResetCec();
+ SetupCecLogLevel();
}
}
}
diff -r 33be8cb90c57 -r ca469451f8e6 Server/SharpDisplayManager.csproj
--- a/Server/SharpDisplayManager.csproj Tue Jul 19 15:43:04 2016 +0200
+++ b/Server/SharpDisplayManager.csproj Tue Jul 19 17:01:21 2016 +0200
@@ -34,7 +34,7 @@
index.htm
false
0
- 0.9.2.0
+ 0.9.3.0
false
true
true