WIP ARQ - more fixes

This commit is contained in:
DJ2LS 2023-12-15 14:56:35 +01:00
parent c4dbe0caef
commit 22e98a816f
3 changed files with 3 additions and 17 deletions

View file

@ -65,8 +65,8 @@ class ARQSessionIRS(arq_session.ARQSession):
def final_crc_check(self):
return self.total_crc == helpers.get_crc_32(bytes(self.received_data)).hex()
def transmit_and_wait(self, frame, timeout):
self.transmit_frame(frame)
def transmit_and_wait(self, frame, timeout, mode):
self.transmit_frame(frame, mode)
self.log(f"Waiting {timeout} seconds...")
if not self.event_frame_received.wait(timeout):
# use case: data burst got lost, we want to send a NACK with updated speed level

View file

@ -613,7 +613,7 @@ class Demodulator():
# snr = np.clip(
# snr, -127, 127
# ) # limit to max value of -128/128 as a possible fix of #188
return snr
return int(snr)
except Exception as err:
self.log.error(f"[MDM] calculate_snr: Exception: {err}")
return 0

View file

@ -628,20 +628,6 @@ class RF:
self.transmit(tx['mode'], tx['repeat'], tx['repeat_delay'], [tx['frame']])
# self.modem_transmit_queue.task_done()
def get_frequency_offset(self, freedv: ctypes.c_void_p) -> float:
"""
Ask codec2 for the calculated (audio) frequency offset of the received signal.
:param freedv: codec2 instance to query
:type freedv: ctypes.c_void_p
:return: Offset of audio frequency in Hz
:rtype: float
"""
modemStats = codec2.MODEMSTATS()
codec2.api.freedv_get_modem_extended_stats(freedv, ctypes.byref(modemStats))
offset = round(modemStats.foff) * (-1)
return offset
def init_rig_control(self):
# Check how we want to control the radio
if self.radiocontrol == "rigctld":