-
Notifications
You must be signed in to change notification settings - Fork 3
Add support for FlexRay symbols #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
edb3f4f
5db715f
c9ee033
47b7d7f
4b65a47
c2d7893
f390472
552790a
240b1e5
27e2fde
a6f15f0
fe15921
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,6 +36,7 @@ struct flexray_frame | |
| uint8_t cc; | ||
|
|
||
| uint8_t data[254]; | ||
| uint8_t symbol_length; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In PCAP FlexRay symbol is defined as array of bytes, not just one value |
||
|
|
||
| flexray_frame() { | ||
| type = FR_TYPE_FRAME; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| /* | ||
| Copyright (c) 2020-2021 Technica Engineering GmbH | ||
| Copyright (c) 2020-2025 Technica Engineering GmbH | ||
| GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) | ||
| */ | ||
| #include <iostream> | ||
|
|
@@ -163,17 +163,27 @@ namespace pcapng_exporter { | |
| const uint8_t FR_HDR_SIZE = 7; | ||
| uint8_t fr[FR_HDR_SIZE + 254] = { 0 }; | ||
| fr[0] = (frame.channel << 6) | frame.type; | ||
| fr[1] = frame.err_flags; | ||
| uint64_t frh = | ||
| ((uint64_t)frame.fr_flags << 35) | | ||
| ((uint64_t)frame.fid << 24) | | ||
| ((uint64_t)frame.len << 17) | | ||
| ((uint64_t)frame.hcrc << 6) | | ||
| ((uint64_t)frame.cc << 0); | ||
| ((uint64_t*)(fr + 2))[0] = hton64(frh << 24); | ||
| size_t data_len = (size_t)frame.len * 2; | ||
| memcpy(fr + 7, frame.data, data_len); | ||
| std::vector<uint8_t> data(fr, fr + FR_HDR_SIZE + data_len); | ||
| uint8_t frame_length; | ||
| if (frame.type == FR_TYPE_FRAME) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @aamereller, could you please fix the indentation inside the if / else blocks ? |
||
| { | ||
| fr[1] = frame.err_flags; | ||
| uint64_t frh = | ||
| ((uint64_t)frame.fr_flags << 35) | | ||
| ((uint64_t)frame.fid << 24) | | ||
| ((uint64_t)frame.len << 17) | | ||
| ((uint64_t)frame.hcrc << 6) | | ||
| ((uint64_t)frame.cc << 0); | ||
| ((uint64_t*)(fr + 2))[0] = hton64(frh << 24); | ||
| size_t data_len = (size_t)frame.len * 2; | ||
| memcpy(fr + 7, frame.data, data_len); | ||
| frame_length = FR_HDR_SIZE + data_len; | ||
| } | ||
| else | ||
| { | ||
| fr[1] = frame.symbol_length; | ||
| frame_length = 2; | ||
| } | ||
| std::vector<uint8_t> data(fr, fr + frame_length); | ||
| this->write_frame(header, LINKTYPE_FLEXRAY, data); | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.