using System; using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; namespace pac_i8050WNet { public class pac8050W { private class ICPDAS { [DllImport("pac_i8050W.dll", EntryPoint = "pac_i8050W_GetFirmwareVersion")] public static extern UInt16 pac_i8050W_GetFirmwareVersion(byte slot); [DllImport("pac_i8050W.dll", EntryPoint = "pac_i8050W_GetLibVersion")] public static extern UInt16 pac_i8050W_GetLibVersion(); [DllImport("pac_i8050W.dll", EntryPoint = "pac_i8050W_UDIO_WriteDO16")] public static extern void pac_i8050W_UDIO_WriteDO16(byte slot, UInt16 config); [DllImport("pac_i8050W.dll", EntryPoint = "pac_i8050W_UDIO_ReadDO16")] public static extern UInt16 pac_i8050W_UDIO_ReadDO16(byte slot); [DllImport("pac_i8050W.dll", EntryPoint = "pac_i8050W_UDIO_DI16")] public static extern UInt16 pac_i8050W_UDIO_DI16(byte slot); [DllImport("pac_i8050W.dll", EntryPoint = "pac_i8050W_UDIO_WriteConfig_16")] public static extern void pac_i8050W_UDIO_WriteConfig_16(byte slot, UInt16 config); [DllImport("pac_i8050W.dll", EntryPoint = "pac_i8050W_UDIO_ReadConfig_16")] public static extern UInt16 pac_i8050W_UDIO_ReadConfig_16(byte slot); } public static UInt16 GetFirmwareVersion(byte slot) { return ICPDAS.pac_i8050W_GetFirmwareVersion(slot); } public static string GetNetVersion() { return System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(); } public static UInt16 GetLibVersion() { return ICPDAS.pac_i8050W_GetLibVersion(); } public static void UDIO_WriteDO16(byte slot, UInt16 config) { ICPDAS.pac_i8050W_UDIO_WriteDO16(slot,config); } public static UInt16 UDIO_ReadDO16(byte slot) { return ICPDAS.pac_i8050W_UDIO_ReadDO16(slot); } public static UInt16 UDIO_DI16(byte slot) { return ICPDAS.pac_i8050W_UDIO_DI16(slot); } public static void UDIO_WriteConfig_16(byte slot, UInt16 config) { ICPDAS.pac_i8050W_UDIO_WriteConfig_16(slot, config); } public static UInt16 UDIO_ReadConfig_16(byte slot) { return ICPDAS.pac_i8050W_UDIO_ReadConfig_16(slot); } } }