gpt4 book ai didi

linux - libusb 批量传输的最大长度

转载 作者:太空宇宙 更新时间:2023-11-04 10:16:39 26 4
gpt4 key购买 nike

在 Linux 中使用 libusb 时是否有批量传输的最大长度?

例如,您可以传递任何正值作为函数 libusb_fill_bulk_transfer 的长度参数吗?

最佳答案

理论上它是目标系统上 int 的最大正值。长度参数最终用于初始化传输结构的长度成员(参见 libusb.h,下面粘贴了相对和缩写的代码)。

实际上,我想确切的数字取决于设备和/或特定于应用程序。我看到过声称存在较大数据包大小问题的讨论(例如:LibUSB driver issues: timeout)。

libusb_fill_bulk_transfer:

static inline void libusb_fill_bulk_transfer(
struct libusb_transfer *transfer,
libusb_device_handle *dev_handle,
unsigned char endpoint,
unsigned char *buffer,
int length, libusb_transfer_cb_fn callback,
void *user_data,
unsigned int timeout)
{
/* NOTE: Only relevant code is pasted here. For complete code see official libusb.h file included with your distribution. */
transfer->length = length;
}

libusb_transfer:

struct libusb_transfer 
{
/* NOTE: Only relevant code is pasted here. For complete code see official libusb.h file included with your distribution. */

/** Length of the data buffer */
int length;
};

关于linux - libusb 批量传输的最大长度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45838043/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com