diff --git a/regovardump.h b/regovardump.h index 84eda69..79585e7 100644 --- a/regovardump.h +++ b/regovardump.h @@ -142,8 +142,8 @@ class RegoReader : public Component, public CanCallbackInterface { // 0x09FDBFE0 - More data available // 0x09FDFFE0 - No more data available - memcpy(buf_ptr, data, data.size()); - buf_ptr += message.data_length_code; + memcpy(buf_ptr, data.data(), data.size()); + buf_ptr += data.size; if ((buf_ptr - buf) % 0x500 == 0) ESP_LOGD(TAG, "read %d", buf_ptr - buf); @@ -151,7 +151,7 @@ class RegoReader : public Component, public CanCallbackInterface { if (buf_ptr - buf >= 0x4e20 + leftover) { // Read all data state = 3; } - if (message.identifier == 0x09FDFFE0) { //No more data + if (can_id == 0x09FDFFE0) { //No more data state = 4; ESP_LOGD(TAG, "Got end of data flag"); }