From 6378e5a22e462e406eb1d44eb924d227a16af01e Mon Sep 17 00:00:00 2001 From: Syndamia Date: Thu, 3 Jul 2025 15:37:58 +0300 Subject: feat: Track consecutive frame index --- src/frame.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/frame.cpp') diff --git a/src/frame.cpp b/src/frame.cpp index bfa9daf..fe96308 100644 --- a/src/frame.cpp +++ b/src/frame.cpp @@ -49,8 +49,10 @@ void Frame::parse_frame_str(const unsigned char* iso_tp_frame) { break; // Consecutive frame - case CF: this->data_size = 7; // Message objects track total amount of data + case CF: this->index = this->size; + this->data_size = 7; // Message objects track total amount of data // from multipart messages + this->size = data_size; break; // Flow control frame @@ -72,6 +74,7 @@ void Frame::free() { void Frame::copyFrom(const Frame& other) { this->type = other.type; + this->index = other.index; this->size = other.size; this->data_size = other.data_size; @@ -81,7 +84,7 @@ void Frame::copyFrom(const Frame& other) { /* Public */ -Frame::Frame(const char* iso_tp_frame) { +Frame::Frame(const char* iso_tp_frame) : index(0) { this->parse_frame_str((const unsigned char*)iso_tp_frame); } @@ -105,6 +108,10 @@ FrameType Frame::get_type() const { return this->type; } +unsigned char Frame::get_index() const { + return this->index; +} + unsigned int Frame::get_size() const { return this->size; } -- cgit v1.3.1-26-gb76a