Skip to main content
summaryrefslogtreecommitdiffstats
path: root/native
diff options
context:
space:
mode:
authorDoug Schaefer2016-04-14 16:58:02 -0400
committerGerrit Code Review @ Eclipse.org2016-04-14 19:11:51 -0400
commit47813ac881d7e0c21d0947cd3e59d3d418b828b7 (patch)
tree447adbe9ecf1891c085479748dd11906d3accdab /native
parent55d95e99429e40464db7ee83304158ebc0ef8fa2 (diff)
downloadorg.eclipse.cdt-47813ac881d7e0c21d0947cd3e59d3d418b828b7.tar.gz
org.eclipse.cdt-47813ac881d7e0c21d0947cd3e59d3d418b828b7.tar.xz
org.eclipse.cdt-47813ac881d7e0c21d0947cd3e59d3d418b828b7.zip
Serial - Support COM ports > 9. Set default baud rate to 115200.
Diffstat (limited to 'native')
-rw-r--r--native/org.eclipse.cdt.native.serial/src/org/eclipse/cdt/serial/BaudRate.java2
-rw-r--r--native/org.eclipse.cdt.native.serial/src/org/eclipse/cdt/serial/SerialPort.java6
2 files changed, 6 insertions, 2 deletions
diff --git a/native/org.eclipse.cdt.native.serial/src/org/eclipse/cdt/serial/BaudRate.java b/native/org.eclipse.cdt.native.serial/src/org/eclipse/cdt/serial/BaudRate.java
index 70965fdeed..a2855a12a8 100644
--- a/native/org.eclipse.cdt.native.serial/src/org/eclipse/cdt/serial/BaudRate.java
+++ b/native/org.eclipse.cdt.native.serial/src/org/eclipse/cdt/serial/BaudRate.java
@@ -86,7 +86,7 @@ public enum BaudRate {
}
public static BaudRate getDefault() {
- return B9600;
+ return B115200;
}
}
diff --git a/native/org.eclipse.cdt.native.serial/src/org/eclipse/cdt/serial/SerialPort.java b/native/org.eclipse.cdt.native.serial/src/org/eclipse/cdt/serial/SerialPort.java
index 07bd5c6735..a00afb31a9 100644
--- a/native/org.eclipse.cdt.native.serial/src/org/eclipse/cdt/serial/SerialPort.java
+++ b/native/org.eclipse.cdt.native.serial/src/org/eclipse/cdt/serial/SerialPort.java
@@ -179,7 +179,11 @@ public class SerialPort {
* name for the serial device.
*/
public SerialPort(String portName) {
- this.portName = portName;
+ if (System.getProperty("os.name").startsWith("Windows") && !portName.startsWith("\\\\.\\")) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ this.portName = "\\\\.\\" + portName; //$NON-NLS-1$
+ } else {
+ this.portName = portName;
+ }
}
private native long open0(String portName, int baudRate, int byteSize, int parity, int stopBits) throws IOException;

Back to the top