pub struct Reassembler<const N: usize> { /* private fields */ }Expand description
Stateful ISO-TP reassembler.
Operates on raw PCI bytes - the caller strips the addressing prefix byte
(N_TA for extended, N_AE for mixed) before calling feed. Flow control
frames returned contain raw PCI bytes only - the caller prepends the
address prefix byte before putting them on the wire.
Buffer size N must be large enough to hold the complete reassembled
message. For classic CAN ISO-TP the maximum is 4095 bytes.
Implementations§
Source§impl<const N: usize> Reassembler<N>
impl<const N: usize> Reassembler<N>
pub fn new(config: ReassemblerConfig) -> Self
Sourcepub fn message(&self, len: usize) -> Option<&[u8]>
pub fn message(&self, len: usize) -> Option<&[u8]>
Returns the reassembled message bytes after a Complete result.
Returns None if reassembly is still in progress.
Sourcepub fn feed(&mut self, pci_bytes: &[u8]) -> Result<ReassembleResult, IsoTpError>
pub fn feed(&mut self, pci_bytes: &[u8]) -> Result<ReassembleResult, IsoTpError>
Feeds raw PCI bytes into the reassembler.
The caller must strip the addressing prefix byte before calling this
function - byte 0 of pci_bytes must be the PCI byte.
Auto Trait Implementations§
impl<const N: usize> Freeze for Reassembler<N>
impl<const N: usize> RefUnwindSafe for Reassembler<N>
impl<const N: usize> Send for Reassembler<N>
impl<const N: usize> Sync for Reassembler<N>
impl<const N: usize> Unpin for Reassembler<N>
impl<const N: usize> UnsafeUnpin for Reassembler<N>
impl<const N: usize> UnwindSafe for Reassembler<N>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more