Skip to content

Commit 44127d0

Browse files
committed
add argparse 'queue-size' option
1 parent b20e53b commit 44127d0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

hdlcontroller.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ def __send_nack(self, seq_no):
300300
ap.add_argument('-i', '--interval', type=float, default='1.0', help='sending interval between two data frames (default: 1.0)')
301301
ap.add_argument('-q', '--quiet', action="store_true", help='do not send anything, just display what is received (default: false)')
302302
ap.add_argument('-w', '--window', type=int, default='3', help='sending window (default: 3)')
303+
ap.add_argument('-Q', '--queue-size', type=int, default='0', help='queue size for data frames received (default: 0)')
303304
ap.add_argument('-T', '--sending-timeout', type=float, default='2.0', help='HDLC sending timeout value (default: 2.0)')
304305
ap.set_defaults(quiet=False)
305306
args = vars(ap.parse_args())
@@ -328,7 +329,13 @@ def receive_callback(data):
328329
print('< {0}'.format(data))
329330

330331
try:
331-
hdlc_c = HDLController(read_uart, ser.write, window=args['window'], sending_timeout=args['sending_timeout'])
332+
hdlc_c = HDLController(
333+
read_uart,
334+
ser.write,
335+
window = args['window'],
336+
sending_timeout = args['sending_timeout'],
337+
frames_queue_size = args['queue_size'],
338+
)
332339
hdlc_c.set_send_callback(send_callback)
333340
hdlc_c.set_receive_callback(receive_callback)
334341
hdlc_c.start()

0 commit comments

Comments
 (0)