arq disconnect improvement

this should fix and closes #173
This commit is contained in:
dj2ls 2022-04-30 13:03:24 +02:00
parent ea133f054d
commit ffff256623

View file

@ -1127,6 +1127,8 @@ class DATA():
def received_session_close(self): def received_session_close(self):
""" """ """ """
# TODO: we need to check for dx stations crc as well so we are only accept frames from a station we are connected to
if static.ARQ_SESSION:
static.ARQ_SESSION_STATE = 'disconnected' static.ARQ_SESSION_STATE = 'disconnected'
helpers.add_to_heard_stations(static.DXCALLSIGN,static.DXGRID, 'DATA-CHANNEL', static.SNR, static.FREQ_OFFSET, static.HAMLIB_FREQUENCY) helpers.add_to_heard_stations(static.DXCALLSIGN,static.DXGRID, 'DATA-CHANNEL', static.SNR, static.FREQ_OFFSET, static.HAMLIB_FREQUENCY)
structlog.get_logger("structlog").info("SESSION [" + str(self.mycallsign, 'utf-8') + "]<<X>>[" + str(static.DXCALLSIGN, 'utf-8') + "]", state=static.ARQ_SESSION_STATE) structlog.get_logger("structlog").info("SESSION [" + str(self.mycallsign, 'utf-8') + "]<<X>>[" + str(static.DXCALLSIGN, 'utf-8') + "]", state=static.ARQ_SESSION_STATE)
@ -1172,6 +1174,9 @@ class DATA():
Returns: Returns:
""" """
# TODO: we need to check for dx stations crc as well so we are only accept frames from a station we are connected to
if static.ARQ_SESSION:
structlog.get_logger("structlog").debug("received session heartbeat") structlog.get_logger("structlog").debug("received session heartbeat")
helpers.add_to_heard_stations(static.DXCALLSIGN, static.DXGRID, 'SESSION-HB', static.SNR, static.FREQ_OFFSET, static.HAMLIB_FREQUENCY) helpers.add_to_heard_stations(static.DXCALLSIGN, static.DXGRID, 'SESSION-HB', static.SNR, static.FREQ_OFFSET, static.HAMLIB_FREQUENCY)
@ -1181,7 +1186,7 @@ class DATA():
static.ARQ_SESSION_STATE = 'connected' static.ARQ_SESSION_STATE = 'connected'
static.TNC_STATE = 'BUSY' static.TNC_STATE = 'BUSY'
self.data_channel_last_received = int(time.time()) self.data_channel_last_received = int(time.time())
if static.ARQ_SESSION and not self.IS_ARQ_SESSION_MASTER and not self.arq_file_transfer: if not self.IS_ARQ_SESSION_MASTER and not self.arq_file_transfer:
self.transmit_session_heartbeat() self.transmit_session_heartbeat()
# ############################################################################################################ # ############################################################################################################