TAILIEUCHUNG - USB Complete fourth- P40

USB Complete fourth- P40:This book focuses on Windows programming for PCs, but other computers and operating systems also have USB support, including Linux and Apple Computer’s Macintosh. Some real-time kernels also support USB. | Chapter 14 Details The WinUsb_WritePipe function accepts a pointer to a WinUSB handle an endpoint address a buffer with data to send and the number of bytes to write. On success the function returns True with the number of bytes written in bytesWritten. If the function uses overlapped I O the Overlapped parameter contains a pointer to an OVERLAPPED structure. To send data via an interrupt transfer change to . To cause the driver to terminate transfers that are exact multiples of wMaxPack-etSize with ZLPs call WinUsb_SetPipePolicy with SHORT_PACKET_TERMINATE True. This option can be useful if the device firmware needs a way to identify the end of a transfer of unknown length. Reading Data via Bulk and Interrupt Transfers The WinUsb_ReadPipe function can read data via bulk or interrupt transfers. vb Definitions DllImport etLastError True _ Friend Shared Function WinUsb_ReadPipe _ ByVal InterfaceHandle As IntPtr _ ByVal PipelD As Byte _ ByVal Buffer As Byte _ ByVal BufferLength As UInt32 _ ByRef LengthTransferred As UInt32 _ ByVal Overlapped As IntPtr _ As Boolean End Function Use Dim buffer 63 As Byte Dim bytesRead As UInt32 Dim bytesToRead As UInt32 64 Dim success As Boolean 366 Using WinUSB for Vendor-Defined Functions success WinUsb_ReadPipe _ _ _ buffer _ bytesToRead _ bytesRead _ vc Definitions DllImport SetLastError true internal static extern Boolean WinUsb_ReadPipe IntPtr InterfaceHandle Byte PipeID Byte Buffer UInt32 BufferLength ref UInt32 LengthTransferred IntPtr Overlapped Use Byte buffer new Byte 64 UInt32 bytesRead 0 UInt32 bytesToRead 64 Boolean success false success WinUsb_ReadPipe buffer bytesToRead ref bytesRead Details The WinUsb_ReadPipe function accepts a pointer to a WinUSB handle an endpoint address the buffer that will store the received data and the maximum .

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.