CANParser: Update CAN data handling functions to accept raw data and size parameters #1040
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When parsing CAN messages,
CanParser
creates a memory copy for each message solely to satisfy the checksum calculation function's requirement, which expects astd::vector<uint8_t>
as parameter. This approach is inefficient and slows down the parsing process.This PR updates all functions responsible for handling CAN data to accept raw data pointers
uint8_t* data
and size parameterssize_t size
instead of usingstd::vector<uint8_t>
. This adjustment aims to enhance performance and reduce memory overhead by avoiding unnecessary memory allocations and copies associated with vector usage.