mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
adjusted response part for commands
This commit is contained in:
parent
d2b3f3a36e
commit
6562a44175
2 changed files with 11 additions and 1 deletions
|
@ -58,6 +58,8 @@ class P2PConnection:
|
||||||
|
|
||||||
self.destination = destination
|
self.destination = destination
|
||||||
self.origin = origin
|
self.origin = origin
|
||||||
|
self.bandwidth = 0
|
||||||
|
|
||||||
self.states = state_manager
|
self.states = state_manager
|
||||||
self.modem = modem
|
self.modem = modem
|
||||||
|
|
||||||
|
@ -181,17 +183,22 @@ class P2PConnection:
|
||||||
self.log("CONNECTED ISS...........................")
|
self.log("CONNECTED ISS...........................")
|
||||||
self.set_state(States.CONNECTED)
|
self.set_state(States.CONNECTED)
|
||||||
self.is_ISS = True
|
self.is_ISS = True
|
||||||
|
self.socket_command_handler.socket_respond_connected(self.origin, self.destination, self.bandwidth)
|
||||||
self.process_data_queue()
|
self.process_data_queue()
|
||||||
|
|
||||||
def connected_irs(self, frame):
|
def connected_irs(self, frame):
|
||||||
self.log("CONNECTED IRS...........................")
|
self.log("CONNECTED IRS...........................")
|
||||||
self.set_state(States.CONNECTED)
|
self.set_state(States.CONNECTED)
|
||||||
self.is_ISS = False
|
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)
|
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)
|
self.launch_twr_irs(session_open_frame, self.ENTIRE_CONNECTION_TIMEOUT, mode=FREEDV_MODE.signalling)
|
||||||
|
|
||||||
def session_failed(self):
|
def session_failed(self):
|
||||||
self.log("FAILED...........................")
|
|
||||||
self.set_state(States.FAILED)
|
self.set_state(States.FAILED)
|
||||||
self.socket_command_handler.socket_respond_disconnected()
|
self.socket_command_handler.socket_respond_disconnected()
|
||||||
|
|
||||||
|
|
|
@ -66,3 +66,6 @@ class SocketCommandHandler:
|
||||||
def socket_respond_disconnected(self):
|
def socket_respond_disconnected(self):
|
||||||
self.send_response("DISCONNECTED")
|
self.send_response("DISCONNECTED")
|
||||||
|
|
||||||
|
def socket_respond_connected(self, mycall, dxcall, bandwidth):
|
||||||
|
message = f"CONNECTED {mycall} {dxcall} {bandwidth}"
|
||||||
|
self.send_response(message)
|
||||||
|
|
Loading…
Reference in a new issue