Skip to content
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

Make header size functions public #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/dlt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1631,7 +1631,7 @@ pub(crate) fn calculate_standard_header_length(header_type: u8) -> u16 {

// TODO use header struct not u8
/// Use header type to determine the length of the all headers together
pub(crate) fn calculate_all_headers_length(header_type: u8) -> u16 {
pub fn calculate_all_headers_length(header_type: u8) -> u16 {
let mut length = calculate_standard_header_length(header_type);
if (header_type & WITH_EXTENDED_HEADER_FLAG) != 0 {
length += EXTENDED_HEADER_LENGTH;
Expand Down
2 changes: 1 addition & 1 deletion src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ fn nom_to_dlt_parse_error(ne: nom::Err<DltParseError>, desc: &str) -> DltParseEr

/// The standard header is part of every DLT message
/// all big endian format [PRS_Dlt_00091]
pub(crate) fn dlt_standard_header(input: &[u8]) -> IResult<&[u8], StandardHeader, DltParseError> {
pub fn dlt_standard_header(input: &[u8]) -> IResult<&[u8], StandardHeader, DltParseError> {
let (input, header_type_byte) = be_u8(input)?;
let has_ecu_id = (header_type_byte & WITH_ECU_ID_FLAG) != 0;
let has_session_id = (header_type_byte & WITH_SESSION_ID_FLAG) != 0;
Expand Down