X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2FCecSharpTester%2FCecSharpClient.cs;h=006c83ae24e15a72e0063aff54690dfd4867ede2;hb=7b62b76ed9aa25bfad944140edfde33903a417bb;hp=8f6c576c1bb4c0f2ab151d4408f9a2d9c0e3fae3;hpb=4d760b54bdb48f04c4d5cfb265bea960493d0a6b;p=deb_libcec.git diff --git a/src/CecSharpTester/CecSharpClient.cs b/src/CecSharpTester/CecSharpClient.cs index 8f6c576..006c83a 100644 --- a/src/CecSharpTester/CecSharpClient.cs +++ b/src/CecSharpTester/CecSharpClient.cs @@ -33,6 +33,7 @@ using System; using System.Collections.Generic; using System.Text; +using CecSharp; namespace CecSharpClient { @@ -40,13 +41,16 @@ namespace CecSharpClient { public CecSharpClient() { - CecDeviceTypeList types = new CecDeviceTypeList(); - types.Types[0] = CecDeviceType.RecordingDevice; + Config = new LibCECConfiguration(); + Config.DeviceTypes.Types[0] = CecDeviceType.RecordingDevice; + Config.DeviceName = "CEC Tester"; + Config.ClientVersion = CecClientVersion.Version1_5_0; + Config.SetCallbacks(this); + LogLevel = (int)CecLogLevel.All; - Lib = new LibCecSharp("CEC Tester", types); - LogLevel = (int) CecLogLevel.All; + Lib = new LibCecSharp(Config); - Console.WriteLine("CEC Parser created - libcec version " + Lib.GetLibVersionMajor() + "." + Lib.GetLibVersionMinor()); + Console.WriteLine("CEC Parser created - libcec version " + Lib.ToString(Config.ServerVersion)); } public override int ReceiveCommand(CecCommand command) @@ -194,11 +198,6 @@ namespace CecSharpClient public void MainLoop() { - Lib.EnableCallbacks(this); - - Lib.PowerOnDevices(CecLogicalAddress.Tv); - Lib.SetActiveSource(CecDeviceType.PlaybackDevice); - bool bContinue = true; string command; while (bContinue) @@ -256,7 +255,7 @@ namespace CecSharpClient else if (splitCommand[0] == "pa") { if (splitCommand.Length > 1) - Lib.SetPhysicalAddress(short.Parse(splitCommand[1], System.Globalization.NumberStyles.HexNumber)); + Lib.SetPhysicalAddress(ushort.Parse(splitCommand[1], System.Globalization.NumberStyles.HexNumber)); } else if (splitCommand[0] == "osd") { @@ -384,7 +383,8 @@ namespace CecSharpClient } } - private int LogLevel; - private LibCecSharp Lib; + private int LogLevel; + private LibCecSharp Lib; + private LibCECConfiguration Config; } }