如何在非零端点(libusb)上发送 USB 控制事务? [英] How to send USB control transaction on nonzero endpoint (libusb)?

查看:38
本文介绍了如何在非零端点(libusb)上发送 USB 控制事务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写代码以了解 Freescale Kinetis 微控制器上的 USB 外设.我已经设法在 Linux 主机上进行了枚举,并且可以发送 &使用 EP0 上的供应商自定义代码接收数据包,并与 libusb 测试程序交互.

I'm writing code to learn about the USB peripheral on a Freescale Kinetis microcontroller. I've managed to get through enumeration on a Linux host, and I can send & receive packets using vendor-custom codes on EP0, interacting with a libusb test program.

看起来我可以在微控制器上配置额外的控制端点(非零端点号),但我没有看到让 libusb 向这些端点发送/接收控制传输的方法.(libusb_control_transfer 不需要端点号,但 libusb_bulk_transferlibusb_interrupt_transfer 需要.)

It looks like I can configure additional control endpoints (non-zero endpoint numbers) on the microcontroller, but I don't see a way to make libusb send / receive control transfers to those endpoints. (libusb_control_transfer doesn't require an endpoint number, though libusb_bulk_transfer and libusb_interrupt_transfer do.)

非零控制端点是否如此罕见或不必要以至于不值得打扰它们?有没有办法让 libusb 对非零端点执行控制事务?

Are non-zero control endpoints so uncommon or unnecessary that it's not worth bothering with them? Is there some way to get libusb to execute control transactions to non-zero endpoints?

推荐答案

有没有办法让 libusb 对非零端点执行控制事务?

Is there some way to get libusb to execute control transactions to non-zero endpoints?

您可以尝试修改异步I/O API的libusb_transfer结构中的endpoint字段.

You can try to modify the endpoint field in the libusb_transfer structure of the asynchronous I/O API.

但如果您的微控制器实际上可以支持非零控制端点,我会感到惊讶 - 不是很多.

But it would surprise me if your microcontroller could actually support non-zero control endpoint(s) - not that many do.

在实践中,您更愿意使用中断或批量端点.两者都具有更少的开销 - 通过批量传输实现更高的吞吐量(例如,请参见 USB 2.0 SPEC 表 5-2 与表 5-9).

In practise you would rather use either interrupt or bulk endpoints. Both have less overhead - allowing higher throughput with bulk transfers (see for example USB 2.0 SPEC Table 5-2 vs. Table 5-9).

这篇关于如何在非零端点(libusb)上发送 USB 控制事务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆