buffer size as startup argment for tnc. Not yet changeable via GUI

This commit is contained in:
dj2ls 2022-09-05 10:47:03 +02:00
parent 830b62583b
commit 42560fda6f
4 changed files with 13 additions and 3 deletions

View file

@ -702,10 +702,12 @@ class DATA:
# check if RX_BUFFER isn't full
pass
else:
# if full, free space by getting an item
# if full, free space by getting an item
self.log.info(
"[TNC] ARQ | RX | RX_BUFFER FULL - dropping old data",
buffer_size=RX_BUFFER.qsize(),
maxsize=static.RX_BUFFER_SIZE
)
RX_BUFFER.get()

View file

@ -224,7 +224,13 @@ if __name__ == "__main__":
help="Set the tx audio level at an early stage",
type=int,
)
PARSER.add_argument(
"--rx-buffer-size",
dest="rx_buffer_size",
default=20,
help="Set the maximum size of rx buffer.",
type=int,
)
ARGS = PARSER.parse_args()
# additional step for being sure our callsign is correctly
@ -260,6 +266,7 @@ if __name__ == "__main__":
static.TUNING_RANGE_FMAX = ARGS.tuning_range_fmax
static.TX_AUDIO_LEVEL = ARGS.tx_audio_level
static.RESPOND_TO_CQ = ARGS.enable_respond_to_cq
static.RX_BUFFER_SIZE = ARGS.rx_buffer_size
# we need to wait until we got all parameters from argparse first before we can load the other modules
import sock

View file

@ -2,6 +2,7 @@
Hold queues used by more than one module to eliminate cyclic imports.
"""
import queue
import static
DATA_QUEUE_TRANSMIT = queue.Queue()
DATA_QUEUE_RECEIVED = queue.Queue()
@ -11,4 +12,4 @@ MODEM_RECEIVED_QUEUE = queue.Queue()
MODEM_TRANSMIT_QUEUE = queue.Queue()
# Initialize FIFO queue to finally store received data
RX_BUFFER = queue.Queue(maxsize=20)
RX_BUFFER = queue.Queue(maxsize=static.RX_BUFFER_SIZE)

View file

@ -112,7 +112,7 @@ BEACON_PAUSE: bool = False
RX_MSG_BUFFER: list = []
RX_BURST_BUFFER: list = []
RX_FRAME_BUFFER: bytes = b""
# RX_BUFFER_SIZE: int = 0
RX_BUFFER_SIZE: int = 20
# ------- HEARD STATIONS BUFFER
HEARD_STATIONS: list = []