pub struct IsoTpAsyncNode<'a, Tx, Rx, F, C>{ /* private fields */ }Expand description
Async ISO-TP endpoint backed by async transmit/receive halves and a clock.
Implementations§
Source§impl<'a, Tx, Rx, F, C> IsoTpAsyncNode<'a, Tx, Rx, F, C>where
Tx: AsyncTxFrameIo<Frame = F>,
Rx: AsyncRxFrameIo<Frame = F, Error = Tx::Error>,
F: Frame,
C: Clock,
impl<'a, Tx, Rx, F, C> IsoTpAsyncNode<'a, Tx, Rx, F, C>where
Tx: AsyncTxFrameIo<Frame = F>,
Rx: AsyncRxFrameIo<Frame = F, Error = Tx::Error>,
F: Frame,
C: Clock,
Sourcepub fn builder(
tx: Tx,
rx: Rx,
cfg: IsoTpConfig,
clock: C,
) -> IsoTpAsyncNodeBuilder<Tx, Rx, C>
pub fn builder( tx: Tx, rx: Rx, cfg: IsoTpConfig, clock: C, ) -> IsoTpAsyncNodeBuilder<Tx, Rx, C>
Start building an IsoTpAsyncNode (requires RX storage before build()).
Sourcepub fn with_clock(
tx: Tx,
rx: Rx,
cfg: IsoTpConfig,
clock: C,
rx_buffer: &'a mut [u8],
) -> Result<Self, IsoTpError<()>>
pub fn with_clock( tx: Tx, rx: Rx, cfg: IsoTpConfig, clock: C, rx_buffer: &'a mut [u8], ) -> Result<Self, IsoTpError<()>>
Construct using a provided clock and caller-provided RX buffer.
Sourcepub fn with_clock_and_storage(
tx: Tx,
rx: Rx,
cfg: IsoTpConfig,
clock: C,
rx_storage: RxStorage<'a>,
) -> Result<Self, IsoTpError<()>>
pub fn with_clock_and_storage( tx: Tx, rx: Rx, cfg: IsoTpConfig, clock: C, rx_storage: RxStorage<'a>, ) -> Result<Self, IsoTpError<()>>
Construct using a provided clock and explicit RX storage.
Sourcepub fn rx_flow_control(&self) -> RxFlowControl
pub fn rx_flow_control(&self) -> RxFlowControl
Get the current receive-side FlowControl parameters (BS/STmin).
Sourcepub fn set_rx_flow_control(&mut self, fc: RxFlowControl)
pub fn set_rx_flow_control(&mut self, fc: RxFlowControl)
Update receive-side FlowControl parameters (BS/STmin).
Sourcepub async fn send<R: AsyncRuntime>(
&mut self,
rt: &R,
payload: &[u8],
timeout: Duration,
) -> Result<(), IsoTpError<Tx::Error>>
pub async fn send<R: AsyncRuntime>( &mut self, rt: &R, payload: &[u8], timeout: Duration, ) -> Result<(), IsoTpError<Tx::Error>>
Blocking-by-await send until completion or timeout.
This method performs the full ISO-TP handshake and segmentation as needed, using the provided runtime for sleeps/timeouts.
Sourcepub async fn recv<R: AsyncRuntime>(
&mut self,
rt: &R,
timeout: Duration,
deliver: &mut dyn FnMut(&[u8]),
) -> Result<(), IsoTpError<Tx::Error>>
pub async fn recv<R: AsyncRuntime>( &mut self, rt: &R, timeout: Duration, deliver: &mut dyn FnMut(&[u8]), ) -> Result<(), IsoTpError<Tx::Error>>
Blocking-by-await receive until a full payload arrives or timeout.
The provided deliver callback is invoked only when a full payload has been reassembled.
The slice passed to deliver is valid until the next receive operation mutates the internal
reassembly buffer.
Source§impl<'a, Tx, Rx, F> IsoTpAsyncNode<'a, Tx, Rx, F, StdClock>
impl<'a, Tx, Rx, F> IsoTpAsyncNode<'a, Tx, Rx, F, StdClock>
Sourcepub fn with_std_clock(
tx: Tx,
rx: Rx,
cfg: IsoTpConfig,
rx_buffer: &'a mut [u8],
) -> Result<Self, IsoTpError<()>>
pub fn with_std_clock( tx: Tx, rx: Rx, cfg: IsoTpConfig, rx_buffer: &'a mut [u8], ) -> Result<Self, IsoTpError<()>>
Convenience constructor using StdClock.