How to set RTS/DTR using libusb?

坚强是说给别人听的谎言 提交于 2019-12-24 09:39:53

问题


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)


回答1:


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

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

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

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 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. Thanks to Xiaofan from libusb-devel mailing list.



来源:https://stackoverflow.com/questions/17774209/how-to-set-rts-dtr-using-libusb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!