mirror of https://github.com/DJ2LS/FreeDATA.git
fixes to p2pcon
parent
330d5604f9
commit
363520cac5
|
|
@ -71,7 +71,7 @@ class TxCommand:
|
|||
"""
|
||||
return type(self).__name__
|
||||
|
||||
def emit_event(self, event_queue):
|
||||
def emit_event(self):
|
||||
"""Emits an event to the event queue.
|
||||
|
||||
This method is a placeholder for emitting events related to the
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ class P2PConnectionCommand(TxCommand):
|
|||
self.destination = f"{self.destination}-0"
|
||||
|
||||
|
||||
def connect(self, event_queue: Queue, modem):
|
||||
def connect(self):
|
||||
"""Placeholder for the connect method.
|
||||
|
||||
This method is currently not implemented and serves as a placeholder
|
||||
|
|
@ -57,9 +57,7 @@ class P2PConnectionCommand(TxCommand):
|
|||
P2PConnection or bool: The P2PConnection object if successful, False otherwise.
|
||||
"""
|
||||
try:
|
||||
self.emit_event()
|
||||
session = P2PConnection(self.ctx, self.origin, self.destination)
|
||||
print(session)
|
||||
if session.session_id:
|
||||
self.ctx.state_manager.register_p2p_connection_session(session)
|
||||
session.connect()
|
||||
|
|
|
|||
|
|
@ -85,17 +85,8 @@ class FrameHandler():
|
|||
#Need to make sure this does not affect any other features in FreeDATA.
|
||||
#This will allow the client to respond to any call sent in the "MYCALL" command
|
||||
|
||||
#print("check......")
|
||||
#self.details["frame"]["mycallsign_crc"] = helpers.get_crc_24(self.details["frame"]["mycallsign"])
|
||||
#print("Jaaaa?")
|
||||
|
||||
print(self.details)
|
||||
|
||||
self.details["frame"]["destination_crc"] = helpers.get_crc_24(self.details["frame"]["destination"])
|
||||
|
||||
print(helpers.get_crc_24(self.details["frame"]["destination"]))
|
||||
|
||||
print("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
|
||||
if self.ctx.socket_interface_manager and self.ctx.socket_interface_manager.socket_interface_callsigns:
|
||||
print("checking callsings....")
|
||||
print(self.ctx.socket_interface_manager.socket_interface_callsigns)
|
||||
|
|
|
|||
|
|
@ -41,7 +41,6 @@ class P2PConnectionFrameHandler(frame_handler.FrameHandler):
|
|||
# if self.ctx.state_manager.check_if_running_arq_session():
|
||||
# self.logger.warning("DISCARDING SESSION OPEN because of ongoing ARQ session ", frame=frame)
|
||||
# return
|
||||
print(frame)
|
||||
session = P2PConnection(self.ctx,
|
||||
frame['origin'],
|
||||
frame['destination'],
|
||||
|
|
|
|||
|
|
@ -48,6 +48,11 @@ class P2PConnection:
|
|||
FRAME_TYPE.P2P_CONNECTION_PAYLOAD_ACK.value: 'transmitted_data',
|
||||
FRAME_TYPE.P2P_CONNECTION_DISCONNECT.value: 'received_disconnect',
|
||||
|
||||
},
|
||||
States.ARQ_SESSION: {
|
||||
FRAME_TYPE.P2P_CONNECTION_PAYLOAD_ACK.value: 'transmitted_data',
|
||||
FRAME_TYPE.P2P_CONNECTION_DISCONNECT.value: 'received_disconnect',
|
||||
|
||||
},
|
||||
States.DISCONNECTING: {
|
||||
FRAME_TYPE.P2P_CONNECTION_DISCONNECT.value: 'received_disconnect',
|
||||
|
|
@ -236,8 +241,6 @@ class P2PConnection:
|
|||
if self.ctx.socket_interface_manager and hasattr(self.ctx.socket_interface_manager.command_server, "command_handler"):
|
||||
self.ctx.socket_interface_manager.command_server.command_handler.socket_respond_connected(self.origin, self.destination, self.bandwidth)
|
||||
|
||||
|
||||
#If these 2 lines are not here, the receiving station does not reply back with an ACK to a P2P_CONNECTION_CONNECT packet. Is this intentional? Leaving here for testing for now.
|
||||
session_open_frame = self.frame_factory.build_p2p_connection_connect_ack(self.destination, self.origin, self.session_id)
|
||||
self.launch_twr_irs(session_open_frame, self.ENTIRE_CONNECTION_TIMEOUT, mode=FREEDV_MODE.signalling)
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ class SocketCommandHandler:
|
|||
}
|
||||
|
||||
cmd = P2PConnectionCommand(self.ctx, params)
|
||||
self.session = cmd.run(self.ctx.event_manager.queues, self.ctx.rf_modem)
|
||||
self.session = cmd.run()
|
||||
self.send_response(f"OK")
|
||||
self.send_response(f"REGISTERED {data[0]}")
|
||||
self.send_response(f"UNENCRYPTED LINK")
|
||||
|
|
|
|||
Loading…
Reference in New Issue