简体   繁体   中英

Why Does `libusb_bulk_transfer' Return 0?

I am using libusb-1.0. Sometimes when I call:

    int rc = libusb_bulk_transfer(handle_,
                                  EP_IN_ADDR,
                                  (unsigned char *)buf_,
                                  64,
                                  &read_,
                                  0);

it returns rc = 0 (no error) and read_ = 0 (zero number of bytes received). But I have specified infinite timeout (last argument), so isn't `libusb_bulk_transfer' supposed to block until I have some data?

Sometimes, it returns rc = 0 (no error) and read_ == 0 (zero number of bytes received).

A bulk endpoint can send you packets with zero bytes of data, called zero packets. This is not an error condition.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM