diff --git a/test/test_chat_text.py b/test/test_chat_text.py index aacdf2a4..c5db2c8d 100644 --- a/test/test_chat_text.py +++ b/test/test_chat_text.py @@ -175,7 +175,7 @@ def test_chat_text( STATIONS[0], STATIONS[1], messages[message_no], - freedv_mode == "datac3", # low bandwidth mode + freedv_mode == "datac3", # == low bandwidth mode tmp_path, ), daemon=True, @@ -189,7 +189,7 @@ def test_chat_text( STATIONS[1], STATIONS[0], messages[message_no], - freedv_mode == "datac3", # low bandwidth mode + freedv_mode == "datac3", # == low bandwidth mode tmp_path, ), daemon=True, diff --git a/test/util_chat_text_1.py b/test/util_chat_text_1.py index 329b7bcd..cb0c175d 100644 --- a/test/util_chat_text_1.py +++ b/test/util_chat_text_1.py @@ -100,7 +100,30 @@ def t_highsnr_arq_short_station1( # log.info("S1 TX: ", frames=t_frames) for item in t_frames: frametype = int.from_bytes(item[:1], "big") # type: ignore - log.info("S1 TX: ", TX=frametype) + log.info("S1 TX: ", mode=static.FRAME_TYPE(frametype).name) + + if ( + static.LOW_BANDWIDTH_MODE + and frametype == static.FRAME_TYPE.ARQ_DC_OPEN_W.value + ): + mesg = ( + "enqueue_frame_for_tx: Low BW global " + "but DC Open narrow frame NOT chosen." + ) + # Low bandwidth data type, wide bandwidth frame type + log.error(mesg) + assert False, mesg + if ( + not static.LOW_BANDWIDTH_MODE + and frametype == static.FRAME_TYPE.ARQ_DC_OPEN_N.value + ): + mesg = ( + "enqueue_frame_for_tx: High BW global " + "but DC Open wide frame NOT chosen." + ) + # High bandwidth data type, low bandwidth frame type + log.error(mesg) + assert False, mesg # Apologies for the Python "magic." "orig_func" is a pointer to the # original function captured before this one was put in place. diff --git a/test/util_chat_text_2.py b/test/util_chat_text_2.py index 2b9285e8..92a000d9 100644 --- a/test/util_chat_text_2.py +++ b/test/util_chat_text_2.py @@ -146,7 +146,7 @@ def t_highsnr_arq_short_station2( timeout = time.time() + 20 while '"arq":"session","status":"close"' not in str(sock.SOCKET_QUEUE.queue): if time.time() > timeout: - log.error("station2", TIMEOUT=True) + log.warning("station2", TIMEOUT=True) break time.sleep(0.5) log.info("station2", arq_state=pformat(static.ARQ_STATE)) @@ -158,4 +158,4 @@ def t_highsnr_arq_short_station2( assert '"arq":"transmission","status":"received"' in str(sock.SOCKET_QUEUE.queue) assert '"arq":"session","status":"close"' in str(sock.SOCKET_QUEUE.queue) - log.error("station2: Exiting!") + log.warning("station2: Exiting!") diff --git a/tnc/data_handler.py b/tnc/data_handler.py index 37996437..c6a8dd04 100644 --- a/tnc/data_handler.py +++ b/tnc/data_handler.py @@ -1561,7 +1561,7 @@ class DATA: # Update data_channel timestamp self.data_channel_last_received = int(time.time()) - if static.LOW_BANDWIDTH_MODE and mode == 255: + if static.LOW_BANDWIDTH_MODE: frametype = bytes([227]) self.log.debug("[TNC] Requesting low bandwidth mode")