如何使用libusb设置RTS/DTR? [英] How to set RTS/DTR using libusb?

查看:268
本文介绍了如何使用libusb设置RTS/DTR?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在libusb-0.1和libusb-1.0中都看不到任何setter RTS/DTR函数.我应该使用usb_control_msg()发送smth special吗? USB设备是CDC设备(不是FTDI)

I can't see any setter RTS/DTR functions in both libusb-0.1 and libusb-1.0. Should i send smth special using usb_control_msg() ? usb device is CDC-device (not FTDI)

推荐答案

libusb本身不能做到这一点-您应该为CDC设备发送控制状态",或者为FTDI设备发送特定于FTDI的命令.

libusb can't do that itself - you should send 'control state' for CDC-device or FTDI-specific commands for FTDI-device.

对于CDC: http://cscott.net/usb_dev/data/devclass/usbcdc11.pdf

`6.2.14 SetControlLineState 该请求生成RS-232/V.24样式的控制信号. ...

`6.2.14 SetControlLineState This request generates RS-232/V.24 style control signals. ...

D1半双工调制解调器的运营商控制.该信号对应于 V.24信号 105和RS-232信号RTS. 0-停用载波 1-激活运营商 在全双工模式下,设备会忽略该位的值

D1 Carrier control for half duplex modems. This signal corresponds to V.24 signal 105 and RS-232 signal RTS. 0 - Deactivate carrier 1 - Activate carrier The device ignores the value of this bit when operating in full duplex mode

D0指示DCE是否存在DTE.该信号对应于V.24 信号108/2和RS-232信号DTR. 0-不存在 1-现在`

D0 Indicates to DCE if DTE is present or not. This signal corresponds to V.24 signal 108/2 and RS-232 signal DTR. 0 - Not Present 1 - Present`

PS.感谢libusb-devel邮件列表中的Xiaofan.

PS. Thanks to Xiaofan from libusb-devel mailing list.

这篇关于如何使用libusb设置RTS/DTR?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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