Function can_utils::byte_count_to_can_fd_dlc [] [src]

pub fn byte_count_to_can_fd_dlc(byte_count: u8) -> u8

Converts a byte count into a CAN-FD DLC.

NOTE: Not all byte counts can be represented as DLCs, which by implication means that not all byte counts are valid CAN-FD frame sizes. This function accounts for the truncation and padding that may be incurred as a result of that.

If n != byte_count_to_can_fd_dlc(can_fd_dlc_to_byte_count(n)) truncation or padding will occur.