Phạm Lam
Phạm Lam

Reputation: 388

how is different between controlTransfer and bulkTransfer?

I'm making an Android application getting data from a USB device (mode USB host). I read the document at https://developer.android.com/index.html and also some posts in stackoverflow and I found that they use sometimes bulkTransfer(), sometimes controlTransfer() but I can't find out the difference between two method and when do we use each one? Could anyone please give me some suggestion?

Upvotes: 1

Views: 1953

Answers (1)

Abbas Abbas
Abbas Abbas

Reputation: 45

Control Transfer is mainly used for sending commands or receiving a device descriptor. It is normally used when setting up a device. The typical packet length is 8 bytes for low speed devices and 8, 16, 32 or 64 bytes for high speed devices. Data which is transferred via this method is formatted into three packets: Packet 1 – Setup: The packet which contains the address and endpoint number Packet 2 – Data: The data being sent Packet 3 – Status: Where the device acknowledges whether the setup packet has been received and read correctly without errors.

Bulk Transfer is used for sending large packets of data to your target device. Printers and Scanners generally follow this transfer protocol. Bulk transfer has built in error correction to ensure that data is transferred and received without error. The process is considered complete when the amount of data obtained is equal to the amount of data requested. This transfer method is not ideal for time sensitive applications since there is no latency guarantee.

Upvotes: 3

Related Questions