File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -71,14 +71,19 @@ export class SerialPortCtrl {
7171 this . _outputChannel . appendLine ( "[Warning] Auto checking serial port open is disabled" ) ;
7272 return resolve ( ) ;
7373 }
74-
74+
7575 this . _currentSerialPort . write ( "TestingOpen" + "\r\n" , ( err ) => {
7676 // TODO: Fix this on the serial port lib: https://github.com/EmergingTechnologyAdvisors/node-serialport/issues/795
7777 if ( err && ! ( err . message . indexOf ( "Writing to COM port (GetOverlappedResult): Unknown error code 121" ) >= 0 ) ) {
7878 this . _outputChannel . appendLine ( `[Error] Failed to open the serial port - ${ this . _currentPort } ` ) ;
7979 reject ( err ) ;
8080 } else {
8181 this . _outputChannel . appendLine ( `[Info] Opened the serial port - ${ this . _currentPort } ` ) ;
82+ this . _currentSerialPort . set ( [ 'dtr=true' ] , ( err ) => {
83+ if ( err ) {
84+ reject ( err ) ;
85+ }
86+ } ) ;
8287 resolve ( ) ;
8388 }
8489 } ) ;
@@ -164,7 +169,13 @@ export class SerialPortCtrl {
164169 if ( err ) {
165170 reject ( err ) ;
166171 } else {
167- resolve ( ) ;
172+ this . _currentSerialPort . set ( [ 'dtr=true' ] , ( err ) => {
173+ if ( err ) {
174+ reject ( err ) ;
175+ } else {
176+ resolve ( ) ;
177+ }
178+ } ) ;
168179 }
169180 } ) ;
170181 } ) ;
You can’t perform that action at this time.
0 commit comments