improved open data channel

This commit is contained in:
DJ2LS 2021-03-18 15:29:51 +01:00 committed by GitHub
parent 7b59bcdf81
commit b7f3bf7eff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

View file

@ -501,8 +501,8 @@ async def arq_open_data_channel():
connection_frame[12:13] = bytes([static.ARQ_DATA_CHANNEL_MODE])
while not static.ARQ_READY_FOR_DATA:
for attempt in range(0,3):
logging.info("DATA [" + str(static.MYCALLSIGN, 'utf-8') + "]>> <<[" + str(static.DXCALLSIGN, 'utf-8') + "] A:[" + str(attempt + 1) + "/" + str(3) + "]")
for attempt in range(0,static.ARQ_OPEN_DATA_CHANNEL_RETRIES):
logging.info("DATA [" + str(static.MYCALLSIGN, 'utf-8') + "]>> <<[" + str(static.DXCALLSIGN, 'utf-8') + "] A:[" + str(attempt + 1) + "/" + str(static.ARQ_OPEN_DATA_CHANNEL_RETRIES) + "]")
modem.transmit_signalling(connection_frame)
while static.CHANNEL_STATE == 'SENDING_SIGNALLING':
time.sleep(0.01)
@ -513,7 +513,11 @@ async def arq_open_data_channel():
if static.ARQ_READY_FOR_DATA:
break
if static.ARQ_READY_FOR_DATA:
break
break
if not static.ARQ_READY_FOR_DATA and attempt + 1 == static.ARQ_OPEN_DATA_CHANNEL_RETRIES:
logging.info("DATA [" + str(static.MYCALLSIGN, 'utf-8') + "]>>X<<[" + str(static.DXCALLSIGN, 'utf-8') + "]")
sys.exit()
def arq_received_data_channel_opener(data_in):

View file

@ -79,7 +79,7 @@ AUDIO_RMS = 0
# ---------------------------------
# ARQ DEFAULTS
TX_N_MAX_RETRIES = 2
TX_N_MAX_RETRIES = 3
TX_N_RETRIES = 0
ARQ_TX_N_FRAMES_PER_BURST = 0
@ -150,6 +150,7 @@ CHANNEL_STATE = 'RECEIVING_SIGNALLING'
TNC_STATE = 'IDLE'
# MODE FOR SENDING AN RECEIVING DATA DURING ARQ SESSION
ARQ_OPEN_DATA_CHANNEL_RETRIES = 3
ARQ_READY_FOR_DATA = False
ARQ_DATA_CHANNEL_MODE = 0
ARQ_DATA_CHANNEL_LAST_RECEIVED = 0