public USBXpress.ReturnCodes SI_CheckRXQueue(UInt32 cyHandle, ref UInt32 lpdwNumBytesInQueue, ref USBXpress.RXQueueStatus lpdwQueueStatus) { if (tipo == TypeOS.i64) { return(USBXpress64.SI_CheckRXQueue(cyHandle, ref lpdwNumBytesInQueue, ref lpdwQueueStatus)); } else { return(USBXpress32.SI_CheckRXQueue(cyHandle, ref lpdwNumBytesInQueue, ref lpdwQueueStatus)); } }
public USBXpress.ReturnCodes SI_SetTimeouts(int dwReadTimeout, int dwWriteTimeout) { if (tipo == TypeOS.i64) { return(USBXpress64.SI_SetTimeouts(dwReadTimeout, dwWriteTimeout)); } else { return(USBXpress32.SI_SetTimeouts(dwReadTimeout, dwWriteTimeout)); } }
public USBXpress.ReturnCodes SI_GetTimeouts(ref int lpdwReadTimeout, ref int lpdwWriteTimeout) { if (tipo == TypeOS.i64) { return(USBXpress64.SI_GetTimeouts(ref lpdwReadTimeout, ref lpdwWriteTimeout)); } else { return(USBXpress32.SI_GetTimeouts(ref lpdwReadTimeout, ref lpdwWriteTimeout)); } }
public USBXpress.ReturnCodes SI_Close(UInt32 cyHandle) { if (tipo == TypeOS.i64) { return(USBXpress64.SI_Close(cyHandle)); } else { return(USBXpress32.SI_Close(cyHandle)); } }
public USBXpress.ReturnCodes SI_GetProductString(int dwDeviceNum, [MarshalAs(UnmanagedType.LPArray)] byte[] lpvDeviceString, USBXpress.ProductString dwFlags) { if (tipo == TypeOS.i64) { return(USBXpress64.SI_GetProductString(dwDeviceNum, lpvDeviceString, dwFlags)); } else { return(USBXpress32.SI_GetProductString(dwDeviceNum, lpvDeviceString, dwFlags)); } }
public USBXpress.ReturnCodes SI_GetNumDevices(ref int lpwdNumDevices) { if (tipo == TypeOS.i64) { return(USBXpress64.SI_GetNumDevices(ref lpwdNumDevices)); } else { return(USBXpress32.SI_GetNumDevices(ref lpwdNumDevices)); } }
public USBXpress.ReturnCodes SI_Write(UInt32 cyHandle, [MarshalAs(UnmanagedType.LPArray)] byte[] lpBuffer, int dwBytesToWrite, ref int lpdwBytesWritten, int lpOverlapped) { if (tipo == TypeOS.i64) { return(USBXpress64.SI_Write(cyHandle, lpBuffer, dwBytesToWrite, ref lpdwBytesWritten, lpOverlapped)); } else { return(USBXpress32.SI_Write(cyHandle, lpBuffer, dwBytesToWrite, ref lpdwBytesWritten, lpOverlapped)); } }
public USBXpress.ReturnCodes SI_Open(UInt32 dwDevice, ref UInt32 cyHandle) { lock (Singleton.GetInstance()) { if (tipo == TypeOS.i64) { return(USBXpress64.SI_Open(dwDevice, ref cyHandle)); } else { return(USBXpress32.SI_Open(dwDevice, ref cyHandle)); } } }
public USBXpress() { int numDevices = 0; if (tipo != TypeOS.i64) { try { USBXpress32.SI_GetNumDevices(ref numDevices); tipo = TypeOS.x86; } catch (Exception) { try { USBXpress64.SI_GetNumDevices(ref numDevices); tipo = TypeOS.i64; } catch (Exception) { tipo = TypeOS.None; MessageBox.Show("Error opening DLL API for USB. Check Instalation."); } } } else { try { USBXpress64.SI_GetNumDevices(ref numDevices); tipo = TypeOS.i64; } catch (Exception) { try { USBXpress32.SI_GetNumDevices(ref numDevices); tipo = TypeOS.x86; } catch (Exception) { tipo = TypeOS.None; MessageBox.Show("Error opening DLL API for USB. Check Instalation."); } } } }