mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
testing multiple frames per burst
This commit is contained in:
parent
d132357d9c
commit
fde0c1432c
|
@ -24,7 +24,7 @@ add_test(NAME 001_highsnr_stdio
|
|||
COMMAND sh -c "export LD_LIBRARY_PATH=${CODEC2_BUILD_DIR}/src;
|
||||
PATH=$PATH:${CODEC2_BUILD_DIR}/src;
|
||||
cd ${CMAKE_CURRENT_SOURCE_DIR}/test/001_highsnr_stdio_audio;
|
||||
python3 test_tx.py --mode 14 --delay 500 --frames 2 --bursts 1 |
|
||||
freedv_data_raw_rx datac0 - - | hexdump -C")
|
||||
python3 test_tx.py --mode 14 --delay 500 --frames 3 --bursts 1 |
|
||||
freedv_data_raw_rx datac0 - - --framesperburst 3 | hexdump -C")
|
||||
set_tests_properties(001_highsnr_stdio PROPERTIES PASS_REGULAR_EXPRESSION "HELLO WORLD")
|
||||
|
||||
|
|
|
@ -42,15 +42,6 @@ MODEM_SAMPLE_RATE = 8000
|
|||
mode = args.FREEDV_MODE
|
||||
data_out = b'HELLO WORLD!'
|
||||
|
||||
|
||||
|
||||
print(N_BURSTS, file=sys.stderr)
|
||||
print(N_FRAMES_PER_BURST, file=sys.stderr)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#-------------------------------------------- LOAD FREEDV
|
||||
|
||||
libname = "libcodec2.so"
|
||||
|
@ -102,7 +93,7 @@ crc = crc.value.to_bytes(2, byteorder='big') # convert crc to 2 byte hex string
|
|||
buffer += crc # append crc16 to buffer
|
||||
|
||||
|
||||
print("BURSTS: " + str(N_BURSTS) + " FRAMES: " + str(N_FRAMES_PER_BURST) , file=sys.stderr)
|
||||
print("BURSTS: " + str(N_BURSTS) + " FRAMES_PER_BURST: " + str(N_FRAMES_PER_BURST) , file=sys.stderr)
|
||||
|
||||
for i in range(0,N_BURSTS):
|
||||
|
||||
|
@ -117,13 +108,14 @@ for i in range(0,N_BURSTS):
|
|||
c_lib.freedv_rawdatatx(freedv,mod_out,data) # modulate DATA and save it into mod_out pointer
|
||||
|
||||
txbuffer += bytes(mod_out)
|
||||
|
||||
print("frame",n, file=sys.stderr)
|
||||
|
||||
c_lib.freedv_rawdatapostambletx(freedv, mod_out_postamble)
|
||||
txbuffer += bytes(mod_out_postamble)
|
||||
|
||||
inter_burst_delay_ms = 200
|
||||
samples_delay = int(MODEM_SAMPLE_RATE*inter_burst_delay_ms/1000)
|
||||
samples_delay = int(MODEM_SAMPLE_RATE*DELAY_BETWEEN_BURSTS)
|
||||
mod_out_silence = ctypes.c_short * samples_delay
|
||||
print("samples_delay", samples_delay, "DELAY_BETWEEN_BURSTS", DELAY_BETWEEN_BURSTS, file=sys.stderr)
|
||||
mod_out_silence = mod_out_silence()
|
||||
txbuffer += bytes(mod_out_silence)
|
||||
|
||||
|
@ -134,7 +126,6 @@ for i in range(0,N_BURSTS):
|
|||
else:
|
||||
sys.stdout.buffer.write(txbuffer) # print data to terminal for piping the output to other programs
|
||||
sys.stdout.flush()
|
||||
txbuffer = bytearray()
|
||||
|
||||
if DATA_OUTPUT == "audio":
|
||||
stream_tx.close()
|
||||
|
|
Loading…
Reference in a new issue