问题
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