using System; using System.Reflection; using System.Runtime.InteropServices; using System.Text; namespace PACNET { /// Backplane API public partial class Sys { //2.1. PAC_API void pac_EnableRetrigger(BYTE iValues) /// /// This function reboots the device. /// /// [in] Decide turning on or not. [DllImport("PACSDK.dll", EntryPoint = "pac_EnableRetrigger")] public static extern void EnableRetrigger(byte iValues); //2.2. PAC_API void pac_GetBackplaneID(LPSTR backplaneID) /// /// This function retrieves the backplane ID. /// /// [out] the pointer to a buffer to receive the backplane version. [DllImport("PACSDK.dll", EntryPoint = "pac_GetBackplaneID")] public static extern void GetBackplaneID(byte[] backplaneID); /// /// This function retrieves the backplane ID. /// /// Return the backplane ID. public static string GetBackplaneID() { byte[] result = new byte[32]; GetBackplaneID(result); string str = StrConvert.WideString(result); return str; } //2.3. PAC_API int pac_GetBatteryLevel(int nBattery) /// /// This function retrieves the backplane battery status. /// /// [in] Specifies the index of battery. /// 1: means first battery, 2: means second battery /// 1: means high voltage, 2: means low voltage [DllImport("PACSDK.dll", EntryPoint = "pac_GetBatteryLevel")] public static extern int GetBatteryLevel(int nBattery); //2.4. PAC_API int pac_GetDIPSwitch() /// /// This function retrieves the dip switch. /// /// Return Values of the DIP switch. [DllImport("PACSDK.dll", EntryPoint = "pac_GetDIPSwitch")] public static extern int GetDIPSwitch(); //2.5. PAC_API int pac_GetSlotCount() /// /// This function retrieves the number of slot. /// /// Return the number of slots available. [DllImport("PACSDK.dll", EntryPoint = "pac_GetSlotCount")] public static extern int GetSlotCount(); //2.6. PAC_API void pac_RegistryHotPlug(DWORD hWnd, DWORD msgID) (Beta testing) /// /// This function retrieves the number of slot. /// /// [in] User specifies the handle ID. /// [DllImport("PACSDK.dll", EntryPoint = "pac_RegistryHotPlug")] public static extern void RegistryHotPlug(uint hWnd, uint msgID); //2.7. PAC_API void pac_UnregistryHotPlug(DWORD hWnd) (Beta testing) /// /// This function deletes the registry key after turning off the hot plug. /// /// [in] User specifies the handle ID. [DllImport("PACSDK.dll", EntryPoint = "pac_UnregistryHotPlug")] public static extern void UnregistryHotPlug(uint hWnd); } }