示例#1
0
 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));
     }
 }
示例#2
0
 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));
     }
 }
示例#3
0
 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));
     }
 }
示例#4
0
 public USBXpress.ReturnCodes SI_Close(UInt32 cyHandle)
 {
     if (tipo == TypeOS.i64)
     {
         return(USBXpress64.SI_Close(cyHandle));
     }
     else
     {
         return(USBXpress32.SI_Close(cyHandle));
     }
 }
示例#5
0
 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));
     }
 }
示例#6
0
 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));
     }
 }
示例#7
0
 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));
     }
 }
示例#8
0
 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));
         }
     }
 }
示例#9
0
        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.");
                    }
                }
            }
        }