Skip to content

Commit af72ff6

Browse files
committed
add argparse 'window' option
1 parent 8e78274 commit af72ff6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

hdlcontroller.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ def __send_nack(self, seq_no):
293293
ap.add_argument('-t', '--timeout', type=int, default='0', help='serial read timeout value (default: 0)')
294294
ap.add_argument('-m', '--message', default='test', help='test message to send (default: test)')
295295
ap.add_argument('-i', '--interval', type=float, default='1.0', help='sending interval between two data frames (default: 1.0)')
296+
ap.add_argument('-w', '--window', type=int, default='3', help='sending window')
296297
args = vars(ap.parse_args())
297298

298299
# Serial port configuration
@@ -319,7 +320,7 @@ def receive_callback(data):
319320
print('< {0}'.format(data))
320321

321322
try:
322-
hdlc_c = HDLController(read_uart, ser.write)
323+
hdlc_c = HDLController(read_uart, ser.write, window=args['window'])
323324
hdlc_c.set_send_callback(send_callback)
324325
hdlc_c.set_receive_callback(receive_callback)
325326
hdlc_c.start()

0 commit comments

Comments
 (0)