From 5a75277ff17b54a8d5461641513838582ae13ef6 Mon Sep 17 00:00:00 2001 From: TSC21 Date: Thu, 15 Jul 2021 15:25:52 +0200 Subject: [PATCH] protocol_splitter: update header length and payload length position To match the change on the microRTPS message header, which adds the sys ID as the 5th byte of the header --- src/drivers/protocol_splitter/protocol_splitter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/drivers/protocol_splitter/protocol_splitter.cpp b/src/drivers/protocol_splitter/protocol_splitter.cpp index 1464606228..92a2244e38 100644 --- a/src/drivers/protocol_splitter/protocol_splitter.cpp +++ b/src/drivers/protocol_splitter/protocol_splitter.cpp @@ -672,7 +672,7 @@ public: virtual ssize_t write(struct file *filp, const char *buffer, size_t buflen); protected: - static const uint8_t HEADER_SIZE = 9; + static const uint8_t HEADER_SIZE = 10; }; RtpsDev::RtpsDev(ReadBuffer *read_buffer) @@ -741,7 +741,7 @@ ssize_t RtpsDev::write(struct file *filp, const char *buffer, size_t buflen) return 0; } - payload_len = ((uint16_t)buffer[5] << 8) | buffer[6]; + payload_len = ((uint16_t)buffer[6] << 8) | buffer[7]; _packet_len = payload_len + HEADER_SIZE; _parser_state = ParserState::GotLength; lock(Write);