Summary Files Commits Branches @commit @diff @stats
path: root / src / frame.cpp
diff options
context:
space:
mode:
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;
}