Skip to content

Return valid empty frame for FlexRay WUS/CAS symbols - #30

Open
RayanMRABET wants to merge 2 commits into
Technica-Engineering:masterfrom
RayanMRABET:tecmp_next-flexray-symbol
Open

Return valid empty frame for FlexRay WUS/CAS symbols#30
RayanMRABET wants to merge 2 commits into
Technica-Engineering:masterfrom
RayanMRABET:tecmp_next-flexray-symbol

Conversation

@RayanMRABET

Copy link
Copy Markdown

tecmp_next returned ENODATA whenever header->length == 0, treating it as
Ethernet padding. This is wrong for FlexRay wake-up (WUS) and collision-avoidance
(CAS) symbols, which legitimately carry no payload and therefore have a zero
Length field.

This change makes tecmp_next return a valid frame with an empty payload when
data_type == TECMP_DATA_FLEXRAY and the TECMP_FR_WUS/TECMP_FR_CAS data-flags
are set, so consumer code no longer has to special-case ENODATA. It also exposes
TECMP_FR_WUS and TECMP_FR_CAS in tecmp.h.

@RayanMRABET

Copy link
Copy Markdown
Author

Hi @kayoub5 could you please review?

Comment thread src/tecmp.c
@@ -84,6 +84,18 @@ int tecmp_next(

// Possible Ethernet padding
if (!header->length) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of all the flexray specific logic, change this check to test on timestamp being non zero in addition to the length

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants