pub struct BxCanPnpClient<C: Clock, M, I: Instance + FilterOwner> {
    pub client: PnpClient<C, M, CanTransmitter<C, SingleQueueDriver<C, SingleFrameQueue<C::Instant>, BxCanDriver<C, I>>>, CanReceiver<C, SingleQueueDriver<C, SingleFrameQueue<C::Instant>, BxCanDriver<C, I>>>>,
    /* private fields */
}
Expand description

A plug-and-play node ID assignment client that uses a bxCAN peripheral

Fields§

§client: PnpClient<C, M, CanTransmitter<C, SingleQueueDriver<C, SingleFrameQueue<C::Instant>, BxCanDriver<C, I>>>, CanReceiver<C, SingleQueueDriver<C, SingleFrameQueue<C::Instant>, BxCanDriver<C, I>>>>

The node ID allocation client

Implementations§

source§

impl<C, M, I> BxCanPnpClient<C, M, I>where C: Clock, M: AllocationMessage<CanTransport>, I: Instance + FilterOwner,

source

pub fn new( clock: C, can: Can<I>, unique_id: [u8; 16] ) -> Result<Self, Error<OverrunError>>

Creates a node ID allocation client

source

pub fn publish_request(&mut self)

Publishes an ID allocation request, sending it onto the CAN bus

This function returns an error if no transmit mailbox was available for the frame.

source

pub fn handle_incoming_frames(&mut self, clock: &mut C) -> Option<CanNodeId>

Handles and parses incoming CAN frames, and returns a node ID if one was received

source

pub fn free(self) -> (C, Can<I>)

Breaks up this client into its clock and CAN driver

Auto Trait Implementations§

§

impl<C, M, I> RefUnwindSafe for BxCanPnpClient<C, M, I>where C: RefUnwindSafe, I: RefUnwindSafe, M: RefUnwindSafe, <<C as Clock>::Instant as Instant>::Duration: RefUnwindSafe, <C as Clock>::Instant: RefUnwindSafe,

§

impl<C, M, I> Send for BxCanPnpClient<C, M, I>where C: Send, I: Send, M: Send, <<C as Clock>::Instant as Instant>::Duration: Send, <C as Clock>::Instant: Send,

§

impl<C, M, I> Sync for BxCanPnpClient<C, M, I>where C: Sync, I: Sync, M: Sync, <<C as Clock>::Instant as Instant>::Duration: Sync, <C as Clock>::Instant: Sync,

§

impl<C, M, I> Unpin for BxCanPnpClient<C, M, I>where C: Unpin, I: Unpin, M: Unpin, <<C as Clock>::Instant as Instant>::Duration: Unpin, <C as Clock>::Instant: Unpin,

§

impl<C, M, I> UnwindSafe for BxCanPnpClient<C, M, I>where C: UnwindSafe, I: UnwindSafe, M: UnwindSafe, <<C as Clock>::Instant as Instant>::Duration: UnwindSafe, <C as Clock>::Instant: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.