Struct canadensis_can::CanTransmitter
source · pub struct CanTransmitter<C, D> { /* private fields */ }
Expand description
Splits outgoing transfers into frames
Implementations§
source§impl<C, D> CanTransmitter<C, D>where
C: Clock,
D: TransmitDriver<C>,
impl<C, D> CanTransmitter<C, D>where C: Clock, D: TransmitDriver<C>,
sourcepub fn set_mtu(&mut self, mtu: Mtu)
pub fn set_mtu(&mut self, mtu: Mtu)
Sets the MTU
This will take effect on the next call to push().
sourcepub fn transfer_count(&self) -> u64
pub fn transfer_count(&self) -> u64
Returns the number of transfers successfully transmitted
Success means that the frames were placed into the frame queue successfully. CAN bus errors are ignored.
sourcepub fn error_count(&self) -> u64
pub fn error_count(&self) -> u64
Returns the number of transfers that could not be transmitted
A failure to allocate memory is considered an error. CAN bus errors are ignored.
Trait Implementations§
source§impl<C, D> Transmitter<C> for CanTransmitter<C, D>where
C: Clock,
D: TransmitDriver<C>,
impl<C, D> Transmitter<C> for CanTransmitter<C, D>where C: Clock, D: TransmitDriver<C>,
source§fn push<A>(
&mut self,
transfer: Transfer<A, C::Instant, CanTransport>,
clock: &mut C,
driver: &mut D
) -> Result<(), Self::Error>where
A: AsRef<[u8]>,
fn push<A>( &mut self, transfer: Transfer<A, C::Instant, CanTransport>, clock: &mut C, driver: &mut D ) -> Result<(), Self::Error>where A: AsRef<[u8]>,
Breaks a transfer into frames
The frames can be retrieved and sent using the peek() and pop() functions.
This function returns an error if the queue does not have enough space to hold all the required frames.
§type Transport = CanTransport
type Transport = CanTransport
The transport that this transmitter works with