Skip to content

Commit 311527e

Browse files
authored
feat(terminal): Add flow control mode (#2361)
Add flow control option into command line arguments. --flow-ctl <mode> Enable flow control {XONOFF | RTSCTS}.
1 parent 127d481 commit 311527e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/terminal/lib/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ program
2020
.option('--parity <parity>', 'Parity default: none', 'none')
2121
.option('--stopbits <bits>', 'Stop bits default: 1', makeNumber, 1)
2222
.option('--no-echo', "Don't print characters as you type them.")
23+
.option('--flow-ctl <mode>', "Enable flow control {XONOFF | RTSCTS}.")
2324
.parse(process.argv)
2425

2526
const args = program.opts()
@@ -58,6 +59,9 @@ const createPort = path => {
5859
dataBits: args.databits,
5960
parity: args.parity,
6061
stopBits: args.stopbits,
62+
rtscts: args.flowCtl === 'CTSRTS',
63+
xon: args.flowCtl === 'XONOFF',
64+
xoff: args.flowCtl === 'XONOFF'
6165
}
6266

6367
const port = new SerialPort(path, openOptions)

0 commit comments

Comments
 (0)