How to linux and USB bulk data transmission equipment

1. Bulk OUT transfer (host to host usb device)
Host host sends a packet to device out flag, followed by the data packet transmission
apparatus correctly receives the data, in response to an ACK. If the device is not ready to receive breakpoint data, it will abandon the data sent by the host, in response to a NAK, to show "not ready."
Counter register OUTnBC: First, only a number of received transmission equipment just how many bytes of data; second is carried out at a number of indications may transfer data out.
Status Register OUTnCS: indicates that the endpoint is currently busy.

2. Bulk transfer IN (usb device to a host device)
host the host sends a packet to request flag IN IN transfer.
When the device is ready, then transfer data to the host host. (Write byte counter, ready to show off the device). If the device is not ready, the response NAK packet to show not ready.

Guess you like

Origin blog.51cto.com/wangyw/2461016