mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
pep8 improvements and some cleanup, also potential fix of buffer position
This commit is contained in:
parent
a0a6bae6b4
commit
8fc1cc6243
|
@ -26,7 +26,7 @@ import structlog
|
|||
import stats
|
||||
import ujson as json
|
||||
from codec2 import FREEDV_MODE, FREEDV_MODE_USED_SLOTS
|
||||
from exceptions import NoCallsign
|
||||
# from exceptions import NoCallsign
|
||||
from queues import DATA_QUEUE_RECEIVED, DATA_QUEUE_TRANSMIT, RX_BUFFER
|
||||
from static import FRAME_TYPE as FR_TYPE
|
||||
|
||||
|
@ -346,18 +346,14 @@ class DATA:
|
|||
# [0] bytes
|
||||
# [1] freedv instance
|
||||
# [2] bytes_per_frame
|
||||
self.process_data(
|
||||
bytes_out=data[0], freedv=data[1], bytes_per_frame=data[2]
|
||||
)
|
||||
self.process_data(bytes_out=data[0])
|
||||
|
||||
def process_data(self, bytes_out, freedv, bytes_per_frame: int) -> None:
|
||||
def process_data(self, bytes_out) -> None:
|
||||
"""
|
||||
Process incoming data and decide what to do with the frame.
|
||||
|
||||
Args:
|
||||
bytes_out:
|
||||
freedv:
|
||||
bytes_per_frame:
|
||||
|
||||
Returns:
|
||||
|
||||
|
@ -414,9 +410,7 @@ class DATA:
|
|||
snr = static.SNR
|
||||
self.log.debug("[TNC] RX SNR", snr=snr)
|
||||
# send payload data to arq checker without CRC16
|
||||
self.arq_data_received(
|
||||
bytes(bytes_out[:-2]), bytes_per_frame, snr, freedv
|
||||
)
|
||||
self.arq_data_received(bytes(bytes_out[:-2]), snr)
|
||||
|
||||
# if we received the last frame of a burst or the last remaining rpt frame, do a modem unsync
|
||||
# if static.RX_BURST_BUFFER.count(None) <= 1 or (frame+1) == n_frames_per_burst:
|
||||
|
@ -463,7 +457,11 @@ class DATA:
|
|||
print(frame_to_tx[0])
|
||||
print(frame_to_tx)
|
||||
frame_type = FR_TYPE(int.from_bytes(frame_to_tx[0][:1], byteorder="big")).name
|
||||
self.log.debug("[TNC] enqueue_frame_for_tx", c2_mode=FREEDV_MODE(c2_mode).name, data=frame_to_tx, type=frame_type)
|
||||
self.log.debug("[TNC] enqueue_frame_for_tx",
|
||||
c2_mode=FREEDV_MODE(c2_mode).name,
|
||||
data=frame_to_tx,
|
||||
type=frame_type
|
||||
)
|
||||
|
||||
# Set the TRANSMITTING flag before adding an object to the transmit queue
|
||||
# TODO: This is not that nice, we could improve this somehow
|
||||
|
@ -511,7 +509,7 @@ class DATA:
|
|||
# finally push data to our network queue
|
||||
sock.SOCKET_QUEUE.put(json_data_out)
|
||||
|
||||
def send_ident_frame(self, transmit) -> None:
|
||||
def send_ident_frame(self, transmit) -> bytearray:
|
||||
"""Build and send IDENT frame """
|
||||
ident_frame = bytearray(self.length_sig1_frame)
|
||||
ident_frame[:1] = bytes([FR_TYPE.IDENT.value])
|
||||
|
@ -541,7 +539,6 @@ class DATA:
|
|||
# Transmit frame
|
||||
self.enqueue_frame_for_tx([ack_frame], c2_mode=FREEDV_MODE.sig1.value)
|
||||
|
||||
|
||||
def send_data_ack_frame(self, snr) -> None:
|
||||
"""Build and send ACK frame for received DATA frame"""
|
||||
|
||||
|
@ -559,13 +556,19 @@ class DATA:
|
|||
self.burst_last_received = time.time() + channel_busy_timeout + 8
|
||||
# Transmit frame
|
||||
# TODO: Do we have to send , self.send_ident_frame(False) ?
|
||||
# self.enqueue_frame_for_tx([ack_frame, self.send_ident_frame(False)], c2_mode=FREEDV_MODE.sig1.value, copies=3, repeat_delay=0)
|
||||
self.enqueue_frame_for_tx([ack_frame], c2_mode=FREEDV_MODE.sig1.value, copies=3, repeat_delay=0)
|
||||
# self.enqueue_frame_for_tx([ack_frame, self.send_ident_frame(False)],
|
||||
# c2_mode=FREEDV_MODE.sig1.value,
|
||||
# copies=3,
|
||||
# repeat_delay=0)
|
||||
|
||||
self.enqueue_frame_for_tx([ack_frame], c2_mode=FREEDV_MODE.sig1.value, copies=3, repeat_delay=0)
|
||||
|
||||
def send_retransmit_request_frame(self) -> None:
|
||||
# check where a None is in our burst buffer and do frame+1, because lists start at 0
|
||||
# FIXME: Check to see if there's a `frame - 1` in the receive portion. Remove both if there is.
|
||||
|
||||
self.burst_rpt_counter += 1
|
||||
|
||||
print(static.RX_BURST_BUFFER)
|
||||
missing_frames = [
|
||||
frame + 1
|
||||
|
@ -582,7 +585,7 @@ class DATA:
|
|||
# Transmit frame
|
||||
self.enqueue_frame_for_tx([rpt_frame], c2_mode=FREEDV_MODE.sig1.value, copies=1, repeat_delay=0)
|
||||
|
||||
def send_burst_nack_frame(self, snr: bytes) -> None:
|
||||
def send_burst_nack_frame(self, snr: float) -> None:
|
||||
"""Build and send NACK frame for received DATA frame"""
|
||||
|
||||
nack_frame = bytearray(self.length_sig1_frame)
|
||||
|
@ -592,11 +595,13 @@ class DATA:
|
|||
nack_frame[3:4] = bytes([int(self.speed_level)])
|
||||
nack_frame[4:8] = len(static.RX_FRAME_BUFFER).to_bytes(4, byteorder="big")
|
||||
|
||||
|
||||
|
||||
# TRANSMIT NACK FRAME FOR BURST
|
||||
# TODO: Do we have to send ident frame?
|
||||
# self.enqueue_frame_for_tx([ack_frame, self.send_ident_frame(False)], c2_mode=FREEDV_MODE.sig1.value, copies=3, repeat_delay=0)
|
||||
# self.enqueue_frame_for_tx([ack_frame, self.send_ident_frame(False)],
|
||||
# c2_mode=FREEDV_MODE.sig1.value,
|
||||
# copies=3,
|
||||
# repeat_delay=0
|
||||
# )
|
||||
|
||||
# wait while timeout not reached and our busy state is busy
|
||||
channel_busy_timeout = time.time() + 5
|
||||
|
@ -607,7 +612,7 @@ class DATA:
|
|||
# reset burst timeout in case we had to wait too long
|
||||
self.burst_last_received = time.time()
|
||||
|
||||
def send_burst_nack_frame_watchdog(self, snr: bytes, tx_n_frames_per_burst) -> None:
|
||||
def send_burst_nack_frame_watchdog(self, snr: float, tx_n_frames_per_burst) -> None:
|
||||
"""Build and send NACK frame for watchdog timeout"""
|
||||
|
||||
# increment nack counter for transmission stats
|
||||
|
@ -643,7 +648,12 @@ class DATA:
|
|||
disconnection_frame[1:2] = self.session_id
|
||||
disconnection_frame[2:5] = static.DXCALLSIGN_CRC
|
||||
# TODO: Needed? disconnection_frame[7:13] = helpers.callsign_to_bytes(self.mycallsign)
|
||||
# self.enqueue_frame_for_tx([disconnection_frame, self.send_ident_frame(False)], c2_mode=FREEDV_MODE.sig0.value, copies=5, repeat_delay=0)
|
||||
# self.enqueue_frame_for_tx([disconnection_frame,
|
||||
# self.send_ident_frame(False)],
|
||||
# c2_mode=FREEDV_MODE.sig0.value,
|
||||
# copies=5,
|
||||
# repeat_delay=0
|
||||
# )
|
||||
# TODO: We need to add the ident frame feature with a seperate PR after publishing latest protocol
|
||||
# TODO: We need to wait some time between last arq related signalling frame and ident frame
|
||||
# TODO: Maybe about 500ms - 1500ms to avoid confusion and too much PTT toggles
|
||||
|
@ -656,15 +666,12 @@ class DATA:
|
|||
self.enqueue_frame_for_tx([disconnection_frame], c2_mode=FREEDV_MODE.sig0.value, copies=3, repeat_delay=0)
|
||||
|
||||
def arq_data_received(
|
||||
self, data_in: bytes, bytes_per_frame: int, snr: float, freedv
|
||||
self, data_in: bytes, snr: float
|
||||
) -> None:
|
||||
"""
|
||||
Args:
|
||||
data_in:bytes:
|
||||
bytes_per_frame:int:
|
||||
snr:float:
|
||||
freedv:
|
||||
|
||||
Returns:
|
||||
"""
|
||||
# We've arrived here from process_data which already checked that the frame
|
||||
|
@ -673,7 +680,10 @@ class DATA:
|
|||
|
||||
# only process data if we are in ARQ and BUSY state else return to quit
|
||||
if not static.ARQ_STATE and static.TNC_STATE not in ["BUSY"]:
|
||||
self.log.warning("[TNC] wrong tnc state - dropping data", arq_state=static.ARQ_STATE, tnc_state=static.TNC_STATE)
|
||||
self.log.warning("[TNC] wrong tnc state - dropping data",
|
||||
arq_state=static.ARQ_STATE,
|
||||
tnc_state=static.TNC_STATE
|
||||
)
|
||||
return
|
||||
|
||||
self.arq_file_transfer = True
|
||||
|
@ -700,7 +710,6 @@ class DATA:
|
|||
# Append data to rx burst buffer
|
||||
static.RX_BURST_BUFFER[self.rx_n_frame_of_burst] = data_in[self.arq_burst_header_size:] # type: ignore
|
||||
|
||||
|
||||
static.DXGRID = b'------'
|
||||
helpers.add_to_heard_stations(
|
||||
static.DXCALLSIGN,
|
||||
|
@ -801,8 +810,7 @@ class DATA:
|
|||
and not self.rx_frame_eof_received
|
||||
and data_in.find(self.data_frame_eof) < 0
|
||||
):
|
||||
|
||||
self.arq_calculate_speed_level(snr)
|
||||
self.arq_calculate_speed_level()
|
||||
|
||||
self.data_channel_last_received = int(time.time()) + 6 + 6
|
||||
self.burst_last_received = int(time.time()) + 6 + 6
|
||||
|
@ -858,12 +866,13 @@ class DATA:
|
|||
# frames=self.rx_n_frames_per_burst,
|
||||
# )
|
||||
|
||||
#else:
|
||||
# self.log.error(
|
||||
# "[TNC] data_handler: Should not reach this point...",
|
||||
# frame=self.rx_n_frame_of_burst + 1,
|
||||
# frames=self.rx_n_frames_per_burst,
|
||||
# )
|
||||
# send repeat without waiting for timeout
|
||||
# --> this should speed up requesting instead of waiting
|
||||
elif self.rx_n_frame_of_burst == self.rx_n_frames_per_burst and self.burst_rpt_counter == 0:
|
||||
frames_left = static.RX_BURST_BUFFER.count(None)
|
||||
self.burst_last_received = time.time() + self.time_list[self.speed_level] * frames_left
|
||||
self.send_retransmit_request_frame()
|
||||
|
||||
else:
|
||||
self.log.warning(
|
||||
"[TNC] data_handler: missing data in burst buffer...",
|
||||
|
@ -939,7 +948,10 @@ class DATA:
|
|||
if static.ENABLE_STATS:
|
||||
self.stats.push(frame_nack_counter=self.frame_nack_counter, status="wrong_crc", duration=duration)
|
||||
|
||||
self.log.info("[TNC] ARQ | RX | Sending NACK", finished=static.ARQ_SECONDS_UNTIL_FINISH, bytesperminute=static.ARQ_BYTES_PER_MINUTE)
|
||||
self.log.info("[TNC] ARQ | RX | Sending NACK",
|
||||
finished=static.ARQ_SECONDS_UNTIL_FINISH,
|
||||
bytesperminute=static.ARQ_BYTES_PER_MINUTE
|
||||
)
|
||||
self.send_burst_nack_frame(snr)
|
||||
|
||||
# Update arq_session timestamp
|
||||
|
@ -982,8 +994,7 @@ class DATA:
|
|||
else:
|
||||
return True
|
||||
|
||||
|
||||
def arq_calculate_speed_level(self, snr):
|
||||
def arq_calculate_speed_level(self):
|
||||
self.frame_received_counter += 1
|
||||
# try increasing speed level only if we had two successful decodes
|
||||
if self.frame_received_counter >= 2:
|
||||
|
@ -995,7 +1006,6 @@ class DATA:
|
|||
if static.SNR >= self.snr_list[new_speed_level]:
|
||||
self.speed_level = new_speed_level
|
||||
|
||||
|
||||
else:
|
||||
self.log.info("[TNC] ARQ | increasing speed level not possible because of SNR limit",
|
||||
given_snr=static.SNR,
|
||||
|
@ -1006,7 +1016,6 @@ class DATA:
|
|||
if not self.check_if_mode_fits_to_busy_slot():
|
||||
self.speed_level = 0
|
||||
|
||||
|
||||
static.ARQ_SPEED_LEVEL = self.speed_level
|
||||
|
||||
# Update modes we are listening to
|
||||
|
@ -1143,15 +1152,12 @@ class DATA:
|
|||
snr=snr,
|
||||
)
|
||||
|
||||
def arq_transmit(self, data_out: bytes, mode: int, n_frames_per_burst: int):
|
||||
def arq_transmit(self, data_out: bytes):
|
||||
"""
|
||||
Transmit ARQ frame
|
||||
|
||||
Args:
|
||||
data_out:bytes:
|
||||
mode:int:
|
||||
n_frames_per_burst:int:
|
||||
|
||||
"""
|
||||
|
||||
# set signalling modes we want to listen to
|
||||
|
@ -1215,8 +1221,7 @@ class DATA:
|
|||
# Initial bufferposition is 0
|
||||
bufferposition = 0
|
||||
bufferposition_end = 0
|
||||
bufferposition_temp = 0
|
||||
|
||||
bufferposition_burst_start = 0
|
||||
|
||||
# Iterate through data_out buffer
|
||||
while not self.data_frame_ack_received and static.ARQ_STATE:
|
||||
|
@ -1244,13 +1249,14 @@ class DATA:
|
|||
self.log.info("[TNC] early buffer info",
|
||||
bufferposition=bufferposition,
|
||||
bufferposition_end=bufferposition_end,
|
||||
bufferposition_temp=bufferposition_temp
|
||||
bufferposition_burst_start=bufferposition_burst_start
|
||||
)
|
||||
|
||||
# check for maximum frames per burst for remaining data
|
||||
n_frames_per_burst = 1
|
||||
if self.max_n_frames_per_burst > 1:
|
||||
while (payload_per_frame * n_frames_per_burst) % len(data_out[bufferposition_temp:]) == (payload_per_frame * n_frames_per_burst):
|
||||
while (payload_per_frame * n_frames_per_burst) % len(data_out[bufferposition_burst_start:]) == (
|
||||
payload_per_frame * n_frames_per_burst):
|
||||
threading.Event().wait(0.01)
|
||||
print((payload_per_frame * n_frames_per_burst) % len(data_out))
|
||||
n_frames_per_burst += 1
|
||||
|
@ -1264,6 +1270,10 @@ class DATA:
|
|||
self.rpt_request_buffer = []
|
||||
# Append data frames with n_frames_per_burst to tempbuffer
|
||||
for n_frame in range(0, n_frames_per_burst):
|
||||
|
||||
if n_frame == 0:
|
||||
bufferposition = bufferposition_burst_start
|
||||
|
||||
arqheader = bytearray()
|
||||
arqheader[:1] = bytes([FR_TYPE.BURST_01.value + n_frame])
|
||||
# ####arqheader[:1] = bytes([FR_TYPE.BURST_01.value])
|
||||
|
@ -1271,9 +1281,11 @@ class DATA:
|
|||
arqheader[2:3] = self.session_id
|
||||
|
||||
# only check for buffer position if at least one NACK received
|
||||
self.log.info("[TNC] ----- data buffer position:", iss_buffer_pos=bufferposition, irs_bufferposition=self.irs_buffer_position)
|
||||
self.log.info("[TNC] ----- data buffer position:", iss_buffer_pos=bufferposition,
|
||||
irs_bufferposition=self.irs_buffer_position)
|
||||
if self.frame_nack_counter > 0 and self.irs_buffer_position != bufferposition:
|
||||
self.log.error("[TNC] ----- data buffer offset:", iss_buffer_pos=bufferposition, irs_bufferposition=self.irs_buffer_position)
|
||||
self.log.error("[TNC] ----- data buffer offset:", iss_buffer_pos=bufferposition,
|
||||
irs_bufferposition=self.irs_buffer_position)
|
||||
# only adjust buffer position for experimental versions
|
||||
if 'exp' in static.VERSION:
|
||||
self.log.warning("[TNC] ----- data adjustment disabled!")
|
||||
|
@ -1326,14 +1338,16 @@ class DATA:
|
|||
self.burst_ack = False # reset ack state
|
||||
self.tx_n_retry_of_burst = 0 # reset retries
|
||||
self.log.debug(
|
||||
"[TNC] arq_transmit: Received BURST ACK. Sending next chunk."
|
||||
, irs_snr=self.burst_ack_snr)
|
||||
"[TNC] arq_transmit: Received BURST ACK. Sending next chunk.",
|
||||
irs_snr=self.burst_ack_snr)
|
||||
# update temp bufferposition for n frames per burst early calculation
|
||||
bufferposition_temp = bufferposition_end
|
||||
bufferposition_burst_start = bufferposition_end # pylint: disable=unused-variable
|
||||
break # break retry loop
|
||||
|
||||
if self.burst_nack:
|
||||
self.burst_nack = False # reset nack state
|
||||
# fall back to starting bufferposition
|
||||
bufferposition = bufferposition_burst_start
|
||||
|
||||
if self.data_frame_ack_received:
|
||||
self.log.debug(
|
||||
|
@ -1362,6 +1376,7 @@ class DATA:
|
|||
|
||||
# update buffer position
|
||||
bufferposition = bufferposition_end
|
||||
bufferposition_burst_start = bufferposition_end
|
||||
|
||||
# update stats
|
||||
self.calculate_transfer_rate_tx(
|
||||
|
@ -1613,7 +1628,6 @@ class DATA:
|
|||
|
||||
self.log.info("[TNC] ARQ REPEAT RECEIVED")
|
||||
|
||||
|
||||
# self.rpt_request_received = True
|
||||
# Update data_channel timestamp
|
||||
self.data_channel_last_received = int(time.time())
|
||||
|
@ -1626,7 +1640,6 @@ class DATA:
|
|||
|
||||
tempbuffer_rptframes = []
|
||||
for i in range(0, len(missing_area)):
|
||||
|
||||
print(missing_area[i])
|
||||
missing_frames_buffer_position = missing_area[i] - 1
|
||||
tempbuffer_rptframes.append(self.rpt_request_buffer[missing_frames_buffer_position])
|
||||
|
@ -1823,7 +1836,7 @@ class DATA:
|
|||
)
|
||||
return True
|
||||
|
||||
def received_session_opener(self, data_in: bytes) -> None:
|
||||
def received_session_opener(self, data_in: bytes) -> bool:
|
||||
"""
|
||||
Received a session open request packet.
|
||||
|
||||
|
@ -2095,7 +2108,7 @@ class DATA:
|
|||
threading.Event().wait(0.01)
|
||||
|
||||
if static.ARQ_STATE:
|
||||
self.arq_transmit(data_out, mode, n_frames_per_burst)
|
||||
self.arq_transmit(data_out)
|
||||
return True
|
||||
|
||||
return False
|
||||
|
@ -2327,7 +2340,6 @@ class DATA:
|
|||
# initially set speed_level 0 in case of bad SNR and no matching mode
|
||||
self.speed_level = 0
|
||||
|
||||
|
||||
# TODO: MOVE THIS TO arq_calculate_speed_level()
|
||||
# calculate speed level in correlation to latest known SNR
|
||||
for i in range(len(self.mode_list)):
|
||||
|
@ -2904,7 +2916,7 @@ class DATA:
|
|||
# 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))
|
||||
helpers.wait(randrange(0, int(self.duration_sig1_frame * 4), int(self.duration_sig1_frame)))
|
||||
self.send_data_to_socket_queue(
|
||||
freedata="tnc-message",
|
||||
qrv="transmitting",
|
||||
|
@ -3024,7 +3036,8 @@ class DATA:
|
|||
static.ARQ_BYTES_PER_MINUTE = int(
|
||||
receivedbytes / (transmissiontime / 60)
|
||||
)
|
||||
static.ARQ_SECONDS_UNTIL_FINISH = int(((static.TOTAL_BYTES - receivedbytes) / (static.ARQ_BYTES_PER_MINUTE * static.ARQ_COMPRESSION_FACTOR)) * 60) -20 # offset because of frame ack/nack
|
||||
static.ARQ_SECONDS_UNTIL_FINISH = int(((static.TOTAL_BYTES - receivedbytes) / (
|
||||
static.ARQ_BYTES_PER_MINUTE * static.ARQ_COMPRESSION_FACTOR)) * 60) - 20 # offset because of frame ack/nack
|
||||
|
||||
speed_chart = {"snr": static.SNR, "bpm": static.ARQ_BYTES_PER_MINUTE, "timestamp": int(time.time())}
|
||||
# check if data already in list
|
||||
|
@ -3084,10 +3097,11 @@ class DATA:
|
|||
if sentbytes > 0:
|
||||
static.ARQ_BITS_PER_SECOND = int((sentbytes * 8) / transmissiontime)
|
||||
static.ARQ_BYTES_PER_MINUTE = int(sentbytes / (transmissiontime / 60))
|
||||
static.ARQ_SECONDS_UNTIL_FINISH = int(((tx_buffer_length - sentbytes) / (static.ARQ_BYTES_PER_MINUTE* static.ARQ_COMPRESSION_FACTOR)) * 60 )
|
||||
static.ARQ_SECONDS_UNTIL_FINISH = int(((tx_buffer_length - sentbytes) / (
|
||||
static.ARQ_BYTES_PER_MINUTE * static.ARQ_COMPRESSION_FACTOR)) * 60)
|
||||
|
||||
|
||||
speed_chart = {"snr": self.burst_ack_snr, "bpm": static.ARQ_BYTES_PER_MINUTE, "timestamp": int(time.time())}
|
||||
speed_chart = {"snr": self.burst_ack_snr, "bpm": static.ARQ_BYTES_PER_MINUTE,
|
||||
"timestamp": int(time.time())}
|
||||
# check if data already in list
|
||||
if speed_chart not in static.SPEED_LIST:
|
||||
static.SPEED_LIST.append(speed_chart)
|
||||
|
@ -3296,12 +3310,12 @@ class DATA:
|
|||
modem_error_state=modem_error_state
|
||||
)
|
||||
|
||||
print(f"frames_per_burst {self.rx_n_frame_of_burst} / {self.rx_n_frames_per_burst}, Repeats: {self.burst_rpt_counter} Nones: {static.RX_BURST_BUFFER.count(None)}")
|
||||
print(
|
||||
f"frames_per_burst {self.rx_n_frame_of_burst} / {self.rx_n_frames_per_burst}, Repeats: {self.burst_rpt_counter} Nones: {static.RX_BURST_BUFFER.count(None)}")
|
||||
|
||||
if self.rx_n_frames_per_burst > 1 and self.burst_rpt_counter < 3 and static.RX_BURST_BUFFER.count(None) > 0:
|
||||
# reset self.burst_last_received
|
||||
self.burst_last_received = time.time() + self.time_list[self.speed_level] * frames_left
|
||||
self.burst_rpt_counter += 1
|
||||
self.send_retransmit_request_frame()
|
||||
|
||||
else:
|
||||
|
@ -3327,7 +3341,6 @@ class DATA:
|
|||
# Update modes we are listening to
|
||||
self.set_listening_modes(True, True, self.mode_list[self.speed_level])
|
||||
|
||||
|
||||
# TODO: Does SNR make sense for NACK if we dont have an actual SNR information?
|
||||
self.send_burst_nack_frame_watchdog(0, tx_n_frames_per_burst)
|
||||
|
||||
|
@ -3454,7 +3467,7 @@ class DATA:
|
|||
frame_to_tx=[fec_frame], c2_mode=codec2.FREEDV_MODE[mode].value
|
||||
)
|
||||
|
||||
def send_fec_is_writing(self, mycallsign) -> None:
|
||||
def send_fec_is_writing(self, mycallsign) -> bool:
|
||||
"""Send an empty test frame"""
|
||||
|
||||
fec_frame = bytearray(14)
|
||||
|
@ -3522,6 +3535,8 @@ class DATA:
|
|||
else:
|
||||
message = b''
|
||||
filename = b''
|
||||
data = b''
|
||||
checksum_delivered = b''
|
||||
|
||||
# save file to folder
|
||||
if filename not in [b'', b'undefined']:
|
||||
|
|
|
@ -12,7 +12,7 @@ import subprocess
|
|||
from enum import Enum
|
||||
CHANNEL_BUSY_SLOT = [False] * 5
|
||||
|
||||
VERSION = "0.9.0-alpha-exp.4"
|
||||
VERSION = "0.9.0-alpha-exp.5"
|
||||
|
||||
ENABLE_EXPLORER = False
|
||||
ENABLE_STATS = False
|
||||
|
@ -88,8 +88,6 @@ AUDIO_ENABLE_TCI: bool = False
|
|||
TCI_IP: str = '127.0.0.1'
|
||||
TCI_PORT: int = '9000'
|
||||
|
||||
|
||||
|
||||
AUDIO_DBFS: int = 0
|
||||
FFT: list = [0]
|
||||
ENABLE_FFT: bool = True
|
||||
|
@ -143,6 +141,7 @@ TUNING_RANGE_FMIN: float = -50.0
|
|||
TUNING_RANGE_FMAX: float = 50.0
|
||||
IS_CODEC2_TRAFFIC: bool = False # true if we have codec2 signalling mode traffic on channel
|
||||
|
||||
|
||||
class FRAME_TYPE(Enum):
|
||||
"""Lookup for frame types"""
|
||||
|
||||
|
|
Loading…
Reference in a new issue