From 5a6b4e319ecd5c6d7ce2ddb4ae38965c8d0ffbae Mon Sep 17 00:00:00 2001 From: DJ2LS <75909252+DJ2LS@users.noreply.github.com> Date: Sun, 12 Feb 2023 18:34:05 +0100 Subject: [PATCH] receive is writing frame --- tnc/data_handler.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tnc/data_handler.py b/tnc/data_handler.py index c3125a0a..70927256 100644 --- a/tnc/data_handler.py +++ b/tnc/data_handler.py @@ -200,6 +200,8 @@ class DATA: FR_TYPE.PING_ACK.value: (self.received_ping_ack, "PING ACK"), FR_TYPE.PING.value: (self.received_ping, "PING"), FR_TYPE.QRV.value: (self.received_qrv, "QRV"), + FR_TYPE.IS_WRITING.value: (self.received_is_writing, "IS_WRITING"), + } self.command_dispatcher = { #"CONNECT": (self.arq_session_handler, "CONNECT"), @@ -370,6 +372,7 @@ class DATA: FR_TYPE.QRV.value, FR_TYPE.PING.value, FR_TYPE.BEACON.value, + FR_TYPE.IS_WRITING.value, ] ): @@ -2799,6 +2802,27 @@ class DATA: static.FREQ_OFFSET, static.HAMLIB_FREQUENCY, ) + def received_is_writing(self, data_in: bytes) -> None: + """ + Called when we receive a IS WRITING frame + Args: + data_in:bytes: + + """ + # here we add the received station to the heard stations buffer + dxcallsign = helpers.bytes_to_callsign(bytes(data_in[1:7])) + + self.send_data_to_socket_queue( + freedata="tnc-message", + fec="is_writing", + dxcallsign=str(dxcallsign, "UTF-8") + ) + + self.log.info( + "[TNC] IS_WRITING RCVD [" + + str(dxcallsign, "UTF-8") + + "] ", + ) # ------------ CALCULATE TRANSFER RATES def calculate_transfer_rate_rx(