mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
WIP ARQ
This commit is contained in:
parent
83e7c11305
commit
c592c9c178
4 changed files with 10 additions and 3 deletions
|
@ -182,6 +182,7 @@ class ARQSessionISS(arq_session.ARQSession):
|
|||
return None, None
|
||||
|
||||
payload_size = self.get_data_payload_size()
|
||||
print(f"PAYLOAD SIZE: {payload_size}")
|
||||
burst = []
|
||||
for _ in range(0, self.frames_per_burst):
|
||||
offset = self.confirmed_bytes
|
||||
|
|
|
@ -25,7 +25,7 @@ class FREEDV_MODE(Enum):
|
|||
Enumeration for codec2 modes and names
|
||||
"""
|
||||
signalling = 19
|
||||
signalling_ack = 19
|
||||
signalling_ack = 20
|
||||
datac0 = 14
|
||||
datac1 = 10
|
||||
datac3 = 12
|
||||
|
|
|
@ -207,7 +207,10 @@ class DataFrameFactory:
|
|||
if isinstance(frame_template["frame_length"], int):
|
||||
frame_length = frame_template["frame_length"]
|
||||
else:
|
||||
frame_length -= 0#2
|
||||
frame_length -= 2
|
||||
|
||||
print(frame_length)
|
||||
|
||||
frame = bytearray(frame_length)
|
||||
if frametype in [FR_TYPE.ARQ_BURST_ACK]:
|
||||
buffer_position = 0
|
||||
|
@ -300,6 +303,8 @@ class DataFrameFactory:
|
|||
def get_available_data_payload_for_mode(self, type: FR_TYPE, mode:codec2.FREEDV_MODE):
|
||||
whole_frame_length = self.get_bytes_per_frame(mode)
|
||||
available = whole_frame_length - 2 # 2Bytes CRC16
|
||||
print("------------------------------")
|
||||
print(available)
|
||||
available -= 1 # Frame Type
|
||||
for field, length in self.template_list[type.value].items():
|
||||
if field != 'frame_length' and isinstance(length, int):
|
||||
|
|
|
@ -83,7 +83,8 @@ class Modulator:
|
|||
crc = crc.value.to_bytes(2, byteorder="big")
|
||||
# Append CRC to data buffer
|
||||
buffer += crc
|
||||
|
||||
print(bytes_per_frame)
|
||||
print(len(buffer))
|
||||
assert (bytes_per_frame == len(buffer))
|
||||
data = (ctypes.c_ubyte * bytes_per_frame).from_buffer_copy(buffer)
|
||||
# modulate DATA and save it into mod_out pointer
|
||||
|
|
Loading…
Reference in a new issue