diff options
Diffstat (limited to 'examples/tcp_serial_redirect.py')
-rwxr-xr-x | examples/tcp_serial_redirect.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/examples/tcp_serial_redirect.py b/examples/tcp_serial_redirect.py index 53dc0ad..ae7fe2d 100755 --- a/examples/tcp_serial_redirect.py +++ b/examples/tcp_serial_redirect.py @@ -66,6 +66,13 @@ it waits for the next connect. group = parser.add_argument_group('serial port') group.add_argument( + "--bytesize", + choices=[5, 6, 7, 8], + type=int, + help="set bytesize, one of {5 6 7 8}, default: 8", + default=8) + + group.add_argument( "--parity", choices=['N', 'E', 'O', 'S', 'M'], type=lambda c: c.upper(), @@ -73,6 +80,13 @@ it waits for the next connect. default='N') group.add_argument( + "--stopbits", + choices=[1, 1.5, 2], + type=float, + help="set stopbits, one of {1 1.5 2}, default: 1", + default=1) + + group.add_argument( '--rtscts', action='store_true', help='enable RTS/CTS flow control (default off)', @@ -117,7 +131,9 @@ it waits for the next connect. # connect to serial port ser = serial.serial_for_url(args.SERIALPORT, do_not_open=True) ser.baudrate = args.BAUDRATE + ser.bytesize = args.bytesize ser.parity = args.parity + ser.stopbits = args.stopbits ser.rtscts = args.rtscts ser.xonxoff = args.xonxoff |