mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
Delete old ping tx code
This commit is contained in:
parent
e398eaa413
commit
5202a93676
|
@ -14,60 +14,6 @@ class PING(DATA):
|
|||
self.event_queue = event_queue
|
||||
self.config = config
|
||||
|
||||
# ---------- PING
|
||||
def transmit_ping(self, mycallsign: str, dxcallsign: str) -> None:
|
||||
"""
|
||||
Function for controlling pings
|
||||
Args:
|
||||
mycallsign
|
||||
dxcallsign
|
||||
|
||||
"""
|
||||
# check if specific callsign is set with different SSID than the Modem is initialized
|
||||
try:
|
||||
mycallsign = helpers.callsign_to_bytes(mycallsign)
|
||||
mycallsign = helpers.bytes_to_callsign(mycallsign)
|
||||
except Exception:
|
||||
mycallsign = self.mycallsign
|
||||
|
||||
if not str(dxcallsign).strip():
|
||||
self.log.warning("[Modem] Missing required callsign", dxcallsign=dxcallsign)
|
||||
return
|
||||
|
||||
# additional step for being sure our callsign is correctly
|
||||
# in case we are not getting a station ssid
|
||||
# then we are forcing a station ssid = 0
|
||||
dxcallsign = helpers.callsign_to_bytes(dxcallsign)
|
||||
dxcallsign = helpers.bytes_to_callsign(dxcallsign)
|
||||
|
||||
self.dxcallsign = dxcallsign
|
||||
self.dxcallsign_crc = helpers.get_crc_24(self.dxcallsign)
|
||||
self.event_queue.put({
|
||||
'freedata': "modem-message",
|
||||
'ping': "transmitting",
|
||||
'dxcallsign': str(dxcallsign, "UTF-8"),
|
||||
})
|
||||
|
||||
self.log.info(
|
||||
"[Modem] PING REQ ["
|
||||
+ str(mycallsign, "UTF-8")
|
||||
+ "] >>> ["
|
||||
+ str(dxcallsign, "UTF-8")
|
||||
+ "]"
|
||||
)
|
||||
|
||||
ping_frame = bytearray(self.length_sig0_frame)
|
||||
ping_frame[:1] = bytes([FR_TYPE.PING.value])
|
||||
ping_frame[1:4] = self.dxcallsign_crc
|
||||
ping_frame[4:7] = helpers.get_crc_24(mycallsign)
|
||||
ping_frame[7:13] = helpers.callsign_to_bytes(mycallsign)
|
||||
|
||||
if self.enable_fsk:
|
||||
self.log.info("[Modem] ENABLE FSK", state=self.enable_fsk)
|
||||
self.enqueue_frame_for_tx([ping_frame], c2_mode=FREEDV_MODE.fsk_ldpc_0.value)
|
||||
else:
|
||||
self.enqueue_frame_for_tx([ping_frame], c2_mode=FREEDV_MODE.sig0.value)
|
||||
|
||||
def received_ping(self, deconstructed_frame: list, snr) -> None:
|
||||
"""
|
||||
Called if we received a ping
|
||||
|
|
|
@ -5,13 +5,11 @@ FRAME DISPATCHER - We are dispatching the received frames to the needed function
|
|||
"""
|
||||
import threading
|
||||
import helpers
|
||||
import structlog
|
||||
from modem_frametypes import FRAME_TYPE as FR_TYPE
|
||||
import event_manager
|
||||
from queues import DATA_QUEUE_RECEIVED, DATA_QUEUE_TRANSMIT, MODEM_TRANSMIT_QUEUE
|
||||
from data_frame_factory import DataFrameFactory
|
||||
|
||||
|
||||
from data_handler_broadcasts import BROADCAST
|
||||
from data_handler_data_broadcasts import DATABROADCAST
|
||||
from data_handler_ping import PING
|
||||
|
@ -241,4 +239,4 @@ class DISPATCHER():
|
|||
if id := self.get_id_from_frame(data):
|
||||
instance = self.initialize_arq_instance()
|
||||
self.states.register_arq_instance_by_id(id, instance)
|
||||
instance['arq_irs'].arq_received_data_channel_opener
|
||||
instance['arq_irs'].arq_received_data_channel_opener
|
||||
|
|
Loading…
Reference in a new issue