small ARQ and modem improvements

This commit is contained in:
DJ2LS 2021-09-08 17:25:11 +02:00 committed by GitHub
parent 32762703c9
commit 8ab912fbcd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View file

@ -62,12 +62,13 @@ class RF():
# we check at first for libcodec2 in root - necessary if we want to run it inside a pyinstaller binary
libname = pathlib.Path("libcodec2.so.1.0")
self.c_lib = ctypes.CDLL(libname)
print("running libcodec from INTERNAL library")
except:
# if we cant load libcodec from root, we check for subdirectory
# this is, if we want to run it without beeing build in a dev environment
print("running libcodec from source bild")
libname = pathlib.Path().absolute() / "codec2/build_linux/src/libcodec2.so.1.0"
self.c_lib = ctypes.CDLL(libname)
print("running libcodec from EXTERNAL library")
# --------------------------------------------CREATE PYAUDIO INSTANCE
self.p = pyaudio.PyAudio()
# --------------------------------------------OPEN AUDIO CHANNEL RX
@ -311,9 +312,7 @@ class RF():
mod_out_postamble = ctypes.c_short * n_tx_postamble_modem_samples # *2 #1760 for mode 10,11,12 #4000 for mode 9
mod_out_postamble = mod_out_postamble()
self.streambuffer = bytearray()
self.c_lib.freedv_rawdatapreambletx(freedv, mod_out_preamble)
self.streambuffer += bytes(mod_out_preamble)
@ -356,12 +355,10 @@ class RF():
elif static.ARQ_RPT_RECEIVED:
for n in range(0, len(static.ARQ_RPT_FRAMES)):
missing_frame = int.from_bytes(static.ARQ_RPT_FRAMES[n], "big")
# ---------------------------BUILD ARQ BURST ---------------------------------------------------------------------
frame_type = 10 + missing_frame # static.ARQ_TX_N_FRAMES_PER_BURST
frame_type = bytes([frame_type])
try:

View file

@ -68,7 +68,10 @@ class Rigctld():
freq = int(data[0])/1000
except:
freq = static.HAMLIB_FREQUENCY
print(data)
#print("freq-err: " + str(data))
#for i in range(len(data)):
# print(data[i])
return freq
def get_mode(self):
@ -79,8 +82,8 @@ class Rigctld():
mode = str(data[0], "utf-8")
bandwith = int(data[1])
except:
print(data)
#print("mode-err: " + str(data))
mode = static.HAMLIB_MODE
bandwith = static.HAMLIB_BANDWITH
return [mode, bandwith]