From 0be46148b55963d1facf1b47f673fdb9ac758aab Mon Sep 17 00:00:00 2001 From: DJ2LS <75909252+DJ2LS@users.noreply.github.com> Date: Fri, 2 May 2025 13:59:54 +0200 Subject: [PATCH] more p2p adjustments --- freedata_server/data_frame_factory.py | 6 +++--- freedata_server/p2p_connection.py | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/freedata_server/data_frame_factory.py b/freedata_server/data_frame_factory.py index 0012e3d9..74234342 100644 --- a/freedata_server/data_frame_factory.py +++ b/freedata_server/data_frame_factory.py @@ -245,9 +245,9 @@ class DataFrameFactory: if not isinstance(item_length, int): item_length = len(content[key]) - print(frame_length) - print(item_length) - print(content) + #print(frame_length) + #print(item_length) + #print(content) if buffer_position + item_length > frame_length: raise OverflowError("Frame data overflow!") frame[buffer_position: buffer_position + item_length] = content[key] diff --git a/freedata_server/p2p_connection.py b/freedata_server/p2p_connection.py index fda91989..62c5270a 100644 --- a/freedata_server/p2p_connection.py +++ b/freedata_server/p2p_connection.py @@ -43,6 +43,8 @@ class P2PConnection: FRAME_TYPE.P2P_CONNECTION_CONNECT_ACK.value: 'connected_iss', FRAME_TYPE.P2P_CONNECTION_PAYLOAD.value: 'received_data', FRAME_TYPE.P2P_CONNECTION_DISCONNECT.value: 'received_disconnect', + FRAME_TYPE.P2P_CONNECTION_HEARTBEAT.value: 'received_heartbeat', + }, States.PAYLOAD_SENT: { FRAME_TYPE.P2P_CONNECTION_PAYLOAD_ACK.value: 'transmitted_data', @@ -53,6 +55,7 @@ class P2PConnection: States.ARQ_SESSION: { FRAME_TYPE.P2P_CONNECTION_PAYLOAD_ACK.value: 'transmitted_data', FRAME_TYPE.P2P_CONNECTION_DISCONNECT.value: 'received_disconnect', + FRAME_TYPE.P2P_CONNECTION_HEARTBEAT.value: 'received_heartbeat', }, States.DISCONNECTING: {