2020-12-23 16:48:54 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
"""
|
|
|
|
Created on Wed Dec 23 11:13:57 2020
|
|
|
|
|
2021-01-06 12:17:17 +00:00
|
|
|
@author: DJ2LS
|
2020-12-23 16:48:54 +00:00
|
|
|
"""
|
2021-01-21 20:00:21 +00:00
|
|
|
# ADDITION MESSUREMENT:
|
|
|
|
#AUDIO TIME: 7.451462268829346 #12 # 1 FRAME + PREAMBLE
|
|
|
|
#MODULATION TIME: 0.002051115036010742 #12 # 1 FRAME + PREAMBLE
|
2020-12-23 16:48:54 +00:00
|
|
|
|
2021-01-21 20:00:21 +00:00
|
|
|
#MODULATION TIME: 0.004580974578857422 #12 # 2 FRAME + PREAMBLE
|
|
|
|
#AUDIO TIME: 14.750595331192017 #12 # 2 FRAME + PREAMBLE
|
2021-01-05 14:03:41 +00:00
|
|
|
|
2021-02-08 15:33:11 +00:00
|
|
|
|
|
|
|
MYCALLSIGN = b''
|
|
|
|
MYCALLSIGN_CRC8 = b''
|
|
|
|
|
|
|
|
DXCALLSIGN = b''
|
|
|
|
DXCALLSIGN_CRC8 = b''
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-12-23 16:48:54 +00:00
|
|
|
# FreeDV Defaults
|
2021-02-05 13:40:32 +00:00
|
|
|
FREEDV_RECEIVE = True
|
2021-01-06 12:17:17 +00:00
|
|
|
|
2021-02-08 15:33:11 +00:00
|
|
|
FREEDV_DATA_MODE = 10
|
2021-02-04 14:25:15 +00:00
|
|
|
FREEDV_SIGNALLING_MODE = 14
|
2021-01-06 12:17:17 +00:00
|
|
|
|
2021-01-20 21:51:14 +00:00
|
|
|
FREEDV_DATA_BYTES_PER_FRAME = 0
|
|
|
|
FREEDV_DATA_PAYLOAD_PER_FRAME = 0
|
|
|
|
FREEDV_SIGNALLING_BYTES_PER_FRAME = 0
|
|
|
|
FREEDV_SIGNALLING_PAYLOAD_PER_FRAME = 0
|
2020-12-23 16:48:54 +00:00
|
|
|
|
|
|
|
# Server Defaults
|
|
|
|
HOST = "localhost"
|
|
|
|
PORT = 3000
|
|
|
|
|
|
|
|
|
|
|
|
#AUdio Defaults
|
|
|
|
AUDIO_INPUT_DEVICE = 1
|
|
|
|
AUDIO_OUTPUT_DEVICE = 1
|
2021-02-04 16:51:01 +00:00
|
|
|
#TX_SAMPLE_STATE = None
|
|
|
|
#RX_SAMPLE_STATE = None
|
2021-01-07 08:28:26 +00:00
|
|
|
|
2021-02-04 16:51:01 +00:00
|
|
|
#AUDIO_SAMPLE_RATE_RX = 44100
|
|
|
|
#AUDIO_SAMPLE_RATE_TX = 44100
|
2021-01-07 08:28:26 +00:00
|
|
|
MODEM_SAMPLE_RATE = 8000 #8000
|
2021-01-06 12:17:17 +00:00
|
|
|
AUDIO_FRAMES_PER_BUFFER = 2048
|
2020-12-23 16:48:54 +00:00
|
|
|
AUDIO_CHANNELS = 1
|
2020-12-25 21:55:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
#TNC DEFAULTS
|
2021-01-06 12:17:17 +00:00
|
|
|
# ARQ
|
2020-12-26 10:02:14 +00:00
|
|
|
TX_N_MAX_RETRIES = 3
|
2021-01-20 21:51:14 +00:00
|
|
|
TX_N_RETRIES = 0
|
2021-01-20 22:42:45 +00:00
|
|
|
|
|
|
|
|
2020-12-26 10:02:14 +00:00
|
|
|
|
2021-01-20 21:51:14 +00:00
|
|
|
ARQ_TX_N_FRAMES_PER_BURST = 0
|
|
|
|
ARQ_TX_N_BURSTS = 0
|
|
|
|
|
2020-12-28 14:20:51 +00:00
|
|
|
ARQ_PAYLOAD_PER_FRAME = 0
|
|
|
|
ARQ_ACK_WAITING_FOR_ID = 0
|
2020-12-29 20:21:28 +00:00
|
|
|
ARQ_RX_BURST_BUFFER = []
|
|
|
|
ARQ_RX_FRAME_BUFFER = []
|
2020-12-30 17:16:32 +00:00
|
|
|
ARQ_RX_FRAME_N_BURSTS = 0
|
2021-02-04 16:51:01 +00:00
|
|
|
|
2021-02-05 13:40:32 +00:00
|
|
|
## TX
|
|
|
|
ARQ_TX_N_CURRENT_ARQ_FRAME = 0
|
|
|
|
ARQ_TX_N_TOTAL_ARQ_FRAMES = 0
|
|
|
|
##
|
|
|
|
|
|
|
|
## RX
|
2021-02-04 16:51:01 +00:00
|
|
|
ARQ_N_ARQ_FRAMES_PER_DATA_FRAME = 0 #total number of arq frames per data frame
|
2021-02-05 13:40:32 +00:00
|
|
|
ARQ_RX_N_CURRENT_ARQ_FRAME = 0
|
|
|
|
##
|
|
|
|
|
|
|
|
ARQ_N_RX_ARQ_FRAMES = 0 # total number of received frames
|
|
|
|
|
2021-01-21 20:00:21 +00:00
|
|
|
ARQ_N_RX_FRAMES_PER_BURSTS = 0 # NUMBER OF FRAMES WE ARE WAITING FOR --> GOT DATA FROM RECEIVED FRAME
|
2021-02-04 14:25:15 +00:00
|
|
|
ARQ_ACK_PAYLOAD_PER_FRAME = 0 # PAYLOAD per ACK frame
|
2021-01-06 12:17:17 +00:00
|
|
|
|
2021-02-09 13:27:36 +00:00
|
|
|
ARQ_ACK_RECEIVED = False # set to 1 if ACK received
|
|
|
|
ARQ_RX_ACK_TIMEOUT = False # set to 1 if timeut reached
|
2021-02-10 18:43:59 +00:00
|
|
|
ARQ_RX_ACK_TIMEOUT_SECONDS = 5.0 #timeout for waiting for ACK frames
|
2021-02-10 14:05:03 +00:00
|
|
|
|
|
|
|
|
|
|
|
ARQ_FRAME_ACK_RECEIVED = False # set to 1 if FRAME ACK received
|
|
|
|
ARQ_RX_FRAME_TIMEOUT = False
|
2021-02-10 18:43:59 +00:00
|
|
|
ARQ_RX_FRAME_TIMEOUT_SECONDS = 5.0
|
2021-02-10 14:05:03 +00:00
|
|
|
|
2021-02-09 13:27:36 +00:00
|
|
|
|
|
|
|
ARQ_RX_RPT_TIMEOUT = False
|
2021-02-10 18:43:59 +00:00
|
|
|
ARQ_RX_RPT_TIMEOUT_SECONDS = 5.0
|
2021-02-08 18:00:12 +00:00
|
|
|
ARQ_RPT_RECEIVED = False #indicate if RPT frame has been received
|
2021-02-09 13:27:36 +00:00
|
|
|
ARQ_RPT_FRAMES = [] #buffer for frames which are requested to repeat
|
2021-02-08 18:00:12 +00:00
|
|
|
|
2020-12-29 20:21:28 +00:00
|
|
|
FRAME_CRC = b''
|
2021-02-04 14:25:15 +00:00
|
|
|
FRAME_BOF = b'\xAA\xAA' #here we define 2 bytes for the BOF
|
|
|
|
FRAME_EOF = b'\xFF\xFF' #here we define 2 bytes for the EOF
|
|
|
|
ARQ_FRAME_BOF_RECEIVED = False # status, if we received a BOF of a data frame
|
|
|
|
ARQ_FRAME_EOF_RECEIVED = False # status, if we received a EOF of a data frame
|
2020-12-28 14:20:51 +00:00
|
|
|
|
2021-02-04 14:25:15 +00:00
|
|
|
ARQ_N_SENT_FRAMES = 0 #counter for already sent frames
|
2021-01-02 08:41:58 +00:00
|
|
|
|
|
|
|
|
2021-01-20 13:31:28 +00:00
|
|
|
# ARQ STATES:
|
|
|
|
# IDLE
|
|
|
|
# RECEIVING_DATA
|
|
|
|
# SENDING_DATA
|
2021-02-09 13:27:36 +00:00
|
|
|
# RECEIVING_SIGNALLING
|
2021-01-20 13:31:28 +00:00
|
|
|
# SENDING_ACK
|
2021-01-20 22:42:45 +00:00
|
|
|
# ACK_RECEIVED
|
2021-01-20 13:31:28 +00:00
|
|
|
#
|
|
|
|
#
|
|
|
|
#
|
2021-01-20 21:51:14 +00:00
|
|
|
ARQ_STATE = 'RECEIVING_DATA'
|
2020-12-30 17:16:32 +00:00
|
|
|
|
2020-12-26 10:02:14 +00:00
|
|
|
# ------- TX BUFFER
|
|
|
|
TX_BUFFER_SIZE = 0
|
2021-01-20 21:51:14 +00:00
|
|
|
TX_BUFFER = []
|
2020-12-30 17:16:32 +00:00
|
|
|
# ------- RX BUFFER
|
|
|
|
RX_BUFFER = []
|
2021-01-20 21:51:14 +00:00
|
|
|
RX_BUFFER_SIZE = 0
|
2020-12-26 10:02:14 +00:00
|
|
|
|