From 4d5646cf80785c251d7e09d64c272562f1e5ea62 Mon Sep 17 00:00:00 2001 From: cheoljun99 Date: Thu, 23 Apr 2026 11:30:05 +0900 Subject: [PATCH] =?UTF-8?q?edit=20:=20=ED=86=B5=EC=8B=A0=20=ED=94=84?= =?UTF-8?q?=EB=A1=9C=ED=86=A0=EC=BD=9C=20=EC=B6=94=EA=B0=80=20=EB=B0=8F=20?= =?UTF-8?q?=ED=97=A4=EB=8D=94=20=EB=82=98=EB=88=84=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/protocol/comm_header.h | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/include/protocol/comm_header.h b/include/protocol/comm_header.h index 9f7e591..0b0f15f 100644 --- a/include/protocol/comm_header.h +++ b/include/protocol/comm_header.h @@ -7,11 +7,19 @@ enum class CommType : uint8_t { NORMAL_DATA = 0x01, RELIABLE_DATA = 0x02, - ACK = 0x03 + ACK = 0x03, + BIG_DATA = 0x04 }; #pragma pack(push, 1) struct CommHeader { - CommType type; // 통신 유형 (일반 데이터, 신뢰성 있는 데이터, ACK) + CommType type; // 통신 유형 (일반 데이터) + DeviceId src_device_id; // 신뢰성 통신을 위한 출발지 디바이스 ID + DeviceId dst_device_id; // 신뢰성 통신을 위한 목적지 디바이스 ID + uint16_t total_length; // 헤더 + 데이터의 총 길이 (최대 65535) + uint16_t data_length; // 데이터의 길이 (최대 65535) +}; +struct ReliableCommHeader { + CommType type; // 통신 유형 (신뢰성 있는 데이터,ACK) DeviceId src_device_id; // 신뢰성 통신을 위한 출발지 디바이스 ID DeviceId dst_device_id; // 신뢰성 통신을 위한 목적지 디바이스 ID uint32_t reliable_unique_key; // 신뢰성 있는 통신을 위한 디바이스 고유키 @@ -19,6 +27,17 @@ struct CommHeader { uint16_t total_length; // 헤더 + 데이터의 총 길이 (최대 65535) uint16_t data_length; // 데이터의 길이 (최대 65535) }; +struct BigCommHeader { + CommType type; // 1B - CommType::BIG_DATA + DeviceId src_device_id; // 2B + DeviceId dst_device_id; // 2B + uint32_t message_id; // 4B - 큰 메시지의 고유 ID + uint16_t chunk_index; // 2B - 이 조각이 몇 번째 (0-based) + uint16_t total_chunks; // 2B - 전체 조각 수 + uint32_t total_data_length; // 4B - 원본 데이터 전체 크기 + uint16_t chunk_data_length; // 2B - 이 조각의 payload 크기 + uint16_t total_length; // 2B - 헤더+이 조각 payload 크기 +}; #pragma pack(pop) #endif // COMM_HEADER_H \ No newline at end of file