adjusted response part for commands

This commit is contained in:
DJ2LS 2024-03-16 16:11:38 +01:00
parent d2b3f3a36e
commit 6562a44175
2 changed files with 11 additions and 1 deletions

View file

@ -58,6 +58,8 @@ class P2PConnection:
self.destination = destination
self.origin = origin
self.bandwidth = 0
self.states = state_manager
self.modem = modem
@ -181,17 +183,22 @@ class P2PConnection:
self.log("CONNECTED ISS...........................")
self.set_state(States.CONNECTED)
self.is_ISS = True
self.socket_command_handler.socket_respond_connected(self.origin, self.destination, self.bandwidth)
self.process_data_queue()
def connected_irs(self, frame):
self.log("CONNECTED IRS...........................")
self.set_state(States.CONNECTED)
self.is_ISS = False
self.orign = frame["origin"]
self.destination = frame["destination"]
self.socket_command_handler.socket_respond_connected(self.origin, self.destination, self.bandwidth)
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)
def session_failed(self):
self.log("FAILED...........................")
self.set_state(States.FAILED)
self.socket_command_handler.socket_respond_disconnected()

View file

@ -66,3 +66,6 @@ class SocketCommandHandler:
def socket_respond_disconnected(self):
self.send_response("DISCONNECTED")
def socket_respond_connected(self, mycall, dxcall, bandwidth):
message = f"CONNECTED {mycall} {dxcall} {bandwidth}"
self.send_response(message)