# HG changeset patch # User sl # Date 1408650897 -7200 # Node ID 083f4935aae40f3374694e874f7a500259bb3a65 # Parent babab407f2bb92752436d8dfc503cfd6bd63ae76 Adding support to open different MiniDisplay type. diff -r babab407f2bb -r 083f4935aae4 Server/Display.cs --- a/Server/Display.cs Wed Aug 20 18:02:30 2014 +0200 +++ b/Server/Display.cs Thu Aug 21 21:54:57 2014 +0200 @@ -18,11 +18,11 @@ } // - public bool Open() + public bool Open(TMiniDisplayType aType) { if (iDevice == IntPtr.Zero) { - iDevice = MiniDisplayOpen(); + iDevice = MiniDisplayOpen(aType); } return iDevice != IntPtr.Zero; } @@ -160,16 +160,24 @@ //Our display device handle IntPtr iDevice; + public enum TMiniDisplayType + { + EMiniDisplayAutoDetect, /*Not yet implemented*/ + EMiniDisplayFutabaGP1212A01, + EMiniDisplayFutabaGP1212A02 + }; + + public enum TMiniDisplayRequest { EMiniDisplayRequestNone, EMiniDisplayRequestDeviceId, EMiniDisplayRequestFirmwareRevision, EMiniDisplayRequestPowerSupplyStatus - } + }; [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr MiniDisplayOpen(); + public static extern IntPtr MiniDisplayOpen(TMiniDisplayType aType); [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] public static extern void MiniDisplayClose(IntPtr aDevice); diff -r babab407f2bb -r 083f4935aae4 Server/MainForm.cs --- a/Server/MainForm.cs Wed Aug 20 18:02:30 2014 +0200 +++ b/Server/MainForm.cs Thu Aug 21 21:54:57 2014 +0200 @@ -66,7 +66,7 @@ if (Properties.Settings.Default.DisplayConnectOnStartup) { - iDisplay.Open(); + iDisplay.Open(Display.TMiniDisplayType.EMiniDisplayAutoDetect); UpdateStatus(); } } @@ -272,7 +272,7 @@ private void buttonOpen_Click(object sender, EventArgs e) { - if (iDisplay.Open()) + if (iDisplay.Open(Display.TMiniDisplayType.EMiniDisplayAutoDetect)) { UpdateStatus(); iDisplay.RequestPowerSupplyStatus();