mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
added failed state to connect white list #289
This commit is contained in:
parent
89369f8208
commit
d3f64ec60d
|
@ -1659,6 +1659,7 @@ class DATA:
|
|||
status="failed",
|
||||
reason="busy",
|
||||
)
|
||||
static.ARQ_SESSION_STATE = "disconnected"
|
||||
return False
|
||||
|
||||
self.arq_open_data_channel(mode, n_frames_per_burst, mycallsign)
|
||||
|
|
33
tnc/sock.py
33
tnc/sock.py
|
@ -325,7 +325,7 @@ def process_tnc_commands(data):
|
|||
dxcallsign = helpers.callsign_to_bytes(dxcallsign)
|
||||
dxcallsign = helpers.bytes_to_callsign(dxcallsign)
|
||||
|
||||
if static.ARQ_SESSION_STATE != "disconnected":
|
||||
if static.ARQ_SESSION_STATE not in ["disconnected", "failed"]:
|
||||
command_response("connect", False)
|
||||
log.warning(
|
||||
"[SCK] Connect command execution error",
|
||||
|
@ -335,35 +335,28 @@ def process_tnc_commands(data):
|
|||
else:
|
||||
|
||||
# finally check again if we are disconnected or failed
|
||||
if static.ARQ_SESSION_STATE == 'disconnected' or static.ARQ_SESSION_STATE == 'failed':
|
||||
|
||||
# try connecting
|
||||
try:
|
||||
static.DXCALLSIGN = dxcallsign
|
||||
static.DXCALLSIGN_CRC = helpers.get_crc_24(static.DXCALLSIGN)
|
||||
# try connecting
|
||||
try:
|
||||
static.DXCALLSIGN = dxcallsign
|
||||
static.DXCALLSIGN_CRC = helpers.get_crc_24(static.DXCALLSIGN)
|
||||
|
||||
DATA_QUEUE_TRANSMIT.put(["CONNECT", dxcallsign, attempts])
|
||||
command_response("connect", True)
|
||||
except Exception as err:
|
||||
command_response("connect", False)
|
||||
log.warning(
|
||||
"[SCK] Connect command execution error",
|
||||
e=err,
|
||||
command=received_json,
|
||||
)
|
||||
# allow beacon transmission again
|
||||
static.BEACON_PAUSE = False
|
||||
|
||||
else:
|
||||
DATA_QUEUE_TRANSMIT.put(["CONNECT", dxcallsign, attempts])
|
||||
command_response("connect", True)
|
||||
except Exception as err:
|
||||
command_response("connect", False)
|
||||
log.warning(
|
||||
"[SCK] Connect command execution error",
|
||||
e="connection still exists",
|
||||
e=err,
|
||||
command=received_json,
|
||||
)
|
||||
# allow beacon transmission again
|
||||
static.BEACON_PAUSE = False
|
||||
|
||||
|
||||
# allow beacon transmission again
|
||||
static.BEACON_PAUSE = False
|
||||
|
||||
# DISCONNECT ----------------------------------------------------------
|
||||
if received_json["type"] == "arq" and received_json["command"] == "disconnect":
|
||||
try:
|
||||
|
|
Loading…
Reference in a new issue