Struct canadensis_bxcan::pnp::BxCanPnpClient
source · 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,
impl<C, M, I> BxCanPnpClient<C, M, I>where C: Clock, M: AllocationMessage<CanTransport>, I: Instance + FilterOwner,
sourcepub fn new(
clock: C,
can: Can<I>,
unique_id: [u8; 16]
) -> Result<Self, Error<OverrunError>>
pub fn new( clock: C, can: Can<I>, unique_id: [u8; 16] ) -> Result<Self, Error<OverrunError>>
Creates a node ID allocation client
sourcepub fn publish_request(&mut self)
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.
sourcepub fn handle_incoming_frames(&mut self, clock: &mut C) -> Option<CanNodeId>
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