@@ -57,27 +57,35 @@ public Serial() throws SerialException {
5757 PreferencesData .getInteger ("serial.debug_rate" ),
5858 PreferencesData .get ("serial.parity" ).charAt (0 ),
5959 PreferencesData .getInteger ("serial.databits" ),
60- new Float (PreferencesData .get ("serial.stopbits" )).floatValue ());
60+ new Float (PreferencesData .get ("serial.stopbits" )).floatValue (),
61+ !BaseNoGui .getBoardPreferences ().has ("serial.disableRTS" ),
62+ !BaseNoGui .getBoardPreferences ().has ("serial.disableDTR" ));
6163 }
6264
6365 public Serial (int irate ) throws SerialException {
6466 this (PreferencesData .get ("serial.port" ), irate ,
6567 PreferencesData .get ("serial.parity" ).charAt (0 ),
6668 PreferencesData .getInteger ("serial.databits" ),
67- new Float (PreferencesData .get ("serial.stopbits" )).floatValue ());
69+ new Float (PreferencesData .get ("serial.stopbits" )).floatValue (),
70+ !BaseNoGui .getBoardPreferences ().has ("serial.disableRTS" ),
71+ !BaseNoGui .getBoardPreferences ().has ("serial.disableDTR" ));
6872 }
6973
7074 public Serial (String iname , int irate ) throws SerialException {
7175 this (iname , irate , PreferencesData .get ("serial.parity" ).charAt (0 ),
7276 PreferencesData .getInteger ("serial.databits" ),
73- new Float (PreferencesData .get ("serial.stopbits" )).floatValue ());
77+ new Float (PreferencesData .get ("serial.stopbits" )).floatValue (),
78+ !BaseNoGui .getBoardPreferences ().has ("serial.disableRTS" ),
79+ !BaseNoGui .getBoardPreferences ().has ("serial.disableDTR" ));
7480 }
7581
7682 public Serial (String iname ) throws SerialException {
7783 this (iname , PreferencesData .getInteger ("serial.debug_rate" ),
7884 PreferencesData .get ("serial.parity" ).charAt (0 ),
7985 PreferencesData .getInteger ("serial.databits" ),
80- new Float (PreferencesData .get ("serial.stopbits" )).floatValue ());
86+ new Float (PreferencesData .get ("serial.stopbits" )).floatValue (),
87+ !BaseNoGui .getBoardPreferences ().has ("serial.disableRTS" ),
88+ !BaseNoGui .getBoardPreferences ().has ("serial.disableDTR" ));
8189 }
8290
8391 public static boolean touchPort (String iname , int irate ) throws SerialException {
@@ -100,7 +108,7 @@ public static boolean touchPort(String iname, int irate) throws SerialException
100108 }
101109 }
102110
103- public Serial (String iname , int irate , char iparity , int idatabits , float istopbits ) throws SerialException {
111+ public Serial (String iname , int irate , char iparity , int idatabits , float istopbits , boolean setRTS , boolean setDTR ) throws SerialException {
104112 //if (port != null) port.close();
105113 //this.parent = parent;
106114 //parent.attach(this);
@@ -120,7 +128,7 @@ public Serial(String iname, int irate, char iparity, int idatabits, float istopb
120128 try {
121129 port = new SerialPort (iname );
122130 port .openPort ();
123- port .setParams (rate , databits , stopbits , parity , true , true );
131+ port .setParams (rate , databits , stopbits , parity , setRTS , setDTR );
124132 port .addEventListener (this );
125133 } catch (Exception e ) {
126134 throw new SerialException (I18n .format (_ ("Error opening serial port ''{0}''." ), iname ), e );
0 commit comments