Skip to main content

BufferedCan

Trait BufferedCan 

Source
pub trait BufferedCan: Sync {
    // Required methods
    fn read(&self, buf: &mut [u8]) -> impl Future<Output = usize>;
    fn write(&self, buf: &[u8]) -> impl Future<Output = ()>;
    fn check_dropped_frames(&self) -> usize;
    fn reset_protocol(&self);
}
Expand description

Platform-agnostic buffered CAN bridge.

The CAN bridge pumps encoded frames between the SSH channel and the target CAN peripheral. Every platform provides a concrete type implementing this trait (ESP32: ssh_stamp_esp32::BufferedCan).

Required Methods§

Source

fn read(&self, buf: &mut [u8]) -> impl Future<Output = usize>

Source

fn write(&self, buf: &[u8]) -> impl Future<Output = ()>

Source

fn check_dropped_frames(&self) -> usize

Source

fn reset_protocol(&self)

Start-of-session hook: revert bus→host framing to slcan (ASCII), reset any half-parsed protocol state left by a previous session and discard bus traffic buffered while no session was attached.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§