Skip to content

Commit

Permalink
feat(terminal): Add flow control mode (#2361)
Browse files Browse the repository at this point in the history
Add flow control option into command line arguments.
--flow-ctl <mode>    Enable flow control {XONOFF | RTSCTS}.
  • Loading branch information
AndreiLeman authored Jan 18, 2022
1 parent 127d481 commit 311527e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/terminal/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ program
.option('--parity <parity>', 'Parity default: none', 'none')
.option('--stopbits <bits>', 'Stop bits default: 1', makeNumber, 1)
.option('--no-echo', "Don't print characters as you type them.")
.option('--flow-ctl <mode>', "Enable flow control {XONOFF | RTSCTS}.")
.parse(process.argv)

const args = program.opts()
Expand Down Expand Up @@ -58,6 +59,9 @@ const createPort = path => {
dataBits: args.databits,
parity: args.parity,
stopBits: args.stopbits,
rtscts: args.flowCtl === 'CTSRTS',
xon: args.flowCtl === 'XONOFF',
xoff: args.flowCtl === 'XONOFF'
}

const port = new SerialPort(path, openOptions)
Expand Down

0 comments on commit 311527e

Please sign in to comment.