Пример #1
0
        private int write(byte[] sendArray)
        {
            int ret = WinUSBController.bulkTransfer(mDeviceHandle,
                                                    mEndPointOut,
                                                    sendArray,
                                                    sendArray.Length,
                                                    500);

            if (ret < 0)
            {
                Console.WriteLine(String.Format("WinUSBController.write() : Failed bulkTransfer({0})", ret));
            }
            return(ret);
        }
Пример #2
0
        private int endTransactionRead(byte[] recvArray)
        {
            int ret = WinUSBController.bulkTransfer(mDeviceHandle,
                                                    mEndPointIn,
                                                    recvArray,
                                                    recvArray.Length,
                                                    500);

            if (ret < 0)
            {
                Console.WriteLine(String.Format("WinUSBController.endTransactionRead() : Failed bulkTransfer({0})", ret));
            }

            int ret2 = WinUSBController.releaseInterface(mDeviceHandle, 0);

            if (ret2 < 0)
            {
                Console.WriteLine(String.Format("WinUSBController.endTransactionRead() : Failed releaseInterface({0})", ret2));
            }
            return(ret);
        }