mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
ARQ WIP - data event on IRS
This commit is contained in:
parent
424f4738c5
commit
e40ff05190
|
@ -179,7 +179,7 @@ class ARQSessionIRS(arq_session.ARQSession):
|
|||
self.log("ACK sent")
|
||||
self.set_state(IRS_State.ENDED)
|
||||
self.event_manager.send_arq_session_finished(
|
||||
False, self.id, self.dxcall, self.total_length, True, self.state.name)
|
||||
False, self.id, self.dxcall, self.total_length, True, self.state.name, data=self.received_data)
|
||||
|
||||
else:
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import base64
|
||||
import json
|
||||
import structlog
|
||||
|
||||
|
@ -53,7 +54,9 @@ class EventManager:
|
|||
}
|
||||
self.broadcast(event)
|
||||
|
||||
def send_arq_session_finished(self, outbound: bool, session_id, dxcall, total_bytes, success: bool, state):
|
||||
def send_arq_session_finished(self, outbound: bool, session_id, dxcall, total_bytes, success: bool, state, data=False):
|
||||
if data:
|
||||
data = base64.b64encode(data).decode("UTF-8")
|
||||
direction = 'outbound' if outbound else 'inbound'
|
||||
event = {
|
||||
f"arq-transfer-{direction}": {
|
||||
|
@ -62,6 +65,7 @@ class EventManager:
|
|||
'total_bytes': total_bytes,
|
||||
'success': success,
|
||||
'state': state,
|
||||
'data': data
|
||||
}
|
||||
}
|
||||
self.broadcast(event)
|
||||
self.broadcast(event)
|
||||
|
|
Loading…
Reference in a new issue