mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
WIP ARQ - more fixes
This commit is contained in:
parent
c4dbe0caef
commit
22e98a816f
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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":
|
||||
|
|
Loading…
Reference in a new issue