Summary Files Commits Branches @commit @diff @stats
path: root / src / frame.cpp
diff options
context:
space:
mode:
Commit6378e5a22e462e406eb1d44eb924d227a16af01e (patch)
Author
 Syndamia <kamen@syndamia.com>
2025-07-03 15:37:58 +0300
Committer
 Syndamia <kamen@syndamia.com>
2025-07-03 15:37:58 +0300
Filesd8b590d6e4e6ae33034ed07872c517e674bc5356 /src/frame.cpp
iso-tp-parser-carista-6378e5a22e462e406eb1d44eb924d227a16af01e.tar
iso-tp-parser-carista-6378e5a22e462e406eb1d44eb924d227a16af01e.tar.gz
iso-tp-parser-carista-6378e5a22e462e406eb1d44eb924d227a16af01e.zip
Parenta1b252f1552492ac2b928276ef9d1ac95ea567af (diff)
feat: Track consecutive frame index
1 files changed, 9 insertions, 2 deletions
-rw-r--r--src/frame.cpp11
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;
}