Added DTR and RTS support for cp21xx driver

This commit is contained in:
Tim Vahlbrock 2019-10-28 13:20:34 +01:00
parent e20b3cc913
commit 7eaea45068
1 changed files with 16 additions and 0 deletions

View File

@ -362,6 +362,14 @@ public class Cp21xxSerialDriver implements UsbSerialDriver {
@Override
public void setDTR(boolean value) throws IOException {
mConnection.controlTransfer(
UsbConstants.USB_DIR_OUT | UsbConstants.USB_TYPE_VENDOR | 0x01,
0x07,
value ? 0x101 : 0x100,
0,
null,
0,
2000);
}
@Override
@ -376,6 +384,14 @@ public class Cp21xxSerialDriver implements UsbSerialDriver {
@Override
public void setRTS(boolean value) throws IOException {
mConnection.controlTransfer(
0x41,
0x07,
value ? 0x202 : 0x200,
0,
null,
0,
2000);
}
@Override