mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
some more config parameter checks
This commit is contained in:
parent
c30761dbfe
commit
9bfe060e2b
|
@ -39,7 +39,7 @@ def t_setup(
|
|||
tmp_path,
|
||||
):
|
||||
# Disable data_handler testmode - This is required to test a conversation.
|
||||
data_handler.TESTMODE = False
|
||||
data_handler.TESTMODE = True
|
||||
|
||||
# Enable socket testmode for overriding socket class
|
||||
sock.TESTMODE = True
|
||||
|
@ -159,7 +159,7 @@ def t_datac13_1(
|
|||
sock.ThreadedTCPRequestHandler.process_tnc_commands(None,json.dumps(data, indent=None))
|
||||
|
||||
# Assure the test completes.
|
||||
timeout = time.time() + timeout_duration
|
||||
timeout = time.time() + timeout_duration + 5
|
||||
while tx_check not in str(sock.SOCKET_QUEUE.queue):
|
||||
if time.time() > timeout:
|
||||
log.warning(
|
||||
|
@ -265,10 +265,11 @@ def t_datac13_2(
|
|||
log.info("t_datac13_2:", RXCHANNEL=modem.RXCHANNEL)
|
||||
log.info("t_datac13_2:", TXCHANNEL=modem.TXCHANNEL)
|
||||
|
||||
if "cq" in data:
|
||||
t_data = {"type": "arq", "command": "stop_transmission"}
|
||||
sock.ThreadedTCPRequestHandler.process_tnc_commands(None,json.dumps(t_data, indent=None))
|
||||
sock.ThreadedTCPRequestHandler.process_tnc_commands(None,json.dumps(t_data, indent=None))
|
||||
# TODO: Why do we need this when calling CQ?
|
||||
#if "cq" in data:
|
||||
# t_data = {"type": "arq", "command": "stop_transmission"}
|
||||
# sock.ThreadedTCPRequestHandler.process_tnc_commands(None,json.dumps(t_data, indent=None))
|
||||
# sock.ThreadedTCPRequestHandler.process_tnc_commands(None,json.dumps(t_data, indent=None))
|
||||
|
||||
# Assure the test completes.
|
||||
timeout = time.time() + timeout_duration
|
||||
|
|
|
@ -2912,8 +2912,11 @@ class DATA:
|
|||
# duration, plus overhead. Set the wait interval to be random between 0 and
|
||||
# self.duration_sig1_frame * 4 == 4 slots
|
||||
# in self.duration_sig1_frame increments.
|
||||
self.log.info("[TNC] Waiting for QRV slot...")
|
||||
helpers.wait(randrange(0, int(self.duration_sig1_frame * 4), self.duration_sig1_frame * 10 // 10.0))
|
||||
# FIXME: This causes problems when running ctests - we need to figure out why
|
||||
if not TESTMODE:
|
||||
self.log.info("[TNC] Waiting for QRV slot...")
|
||||
helpers.wait(randrange(0, int(self.duration_sig1_frame * 4), self.duration_sig1_frame * 10 // 10.0))
|
||||
|
||||
self.send_data_to_socket_queue(
|
||||
freedata="tnc-message",
|
||||
qrv="transmitting",
|
||||
|
@ -2931,10 +2934,7 @@ class DATA:
|
|||
self.log.info("[TNC] ENABLE FSK", state=TNC.enable_fsk)
|
||||
self.enqueue_frame_for_tx([qrv_frame], c2_mode=FREEDV_MODE.fsk_ldpc_0.value)
|
||||
else:
|
||||
if TESTMODE:
|
||||
self.enqueue_frame_for_tx([qrv_frame], c2_mode=FREEDV_MODE.sig0.value, copies=2, repeat_delay=0)
|
||||
else:
|
||||
self.enqueue_frame_for_tx([qrv_frame], c2_mode=FREEDV_MODE.sig0.value, copies=1, repeat_delay=0)
|
||||
self.enqueue_frame_for_tx([qrv_frame], c2_mode=FREEDV_MODE.sig0.value, copies=1, repeat_delay=0)
|
||||
|
||||
def received_qrv(self, data_in: bytes) -> None:
|
||||
"""
|
||||
|
|
Loading…
Reference in a new issue