Skip to content

Commit 8f6d179

Browse files
committed
DTR message at opening
Added an option to send a DTR message when opening the port
1 parent d0a92ac commit 8f6d179

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/android/org/stereolux/cordova/serial/Serial.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@ public void run() {
147147
int stopBits = opts.has("stopBits") ? opts.getInt("stopBits") : UsbSerialPort.STOPBITS_1;
148148
int parity = opts.has("parity") ? opts.getInt("parity") : UsbSerialPort.PARITY_NONE;
149149
port.setParameters(baudRate, dataBits, stopBits, parity);
150+
if (opts.has("dtr") && opts.getBoolean("dtr")) {
151+
port.setDTR(true);
152+
}
150153
}
151154
catch (IOException e) {
152155
// deal with error

0 commit comments

Comments
 (0)