pub struct MoteComms<const MTU: usize, I, O>where
I: DeserializeOwned,
O: Serialize,{ /* private fields */ }Expand description
Bidirectional SansIO communication link betweek mote and the host.
You probably do not want to directly construct this. Instead, use the type aliases: MoteLink (use on host) HostLink (use on mote) MoteConfigLink HostConfigLink
Implementations§
Source§impl<const MTU: usize, I, O> MoteComms<MTU, I, O>where
I: for<'de> Deserialize<'de>,
O: Serialize,
impl<const MTU: usize, I, O> MoteComms<MTU, I, O>where
I: for<'de> Deserialize<'de>,
O: Serialize,
Sourcepub fn poll_transmit(&mut self) -> Option<Vec<u8>>
pub fn poll_transmit(&mut self) -> Option<Vec<u8>>
Get the next packet to be sent
Sourcepub fn handle_receive(&mut self, packet: &[u8])
pub fn handle_receive(&mut self, packet: &[u8])
Receive a message from raw bytes
Sourcepub fn poll_receive(&mut self) -> Result<Option<I>, Error>where
I: MessageRole,
pub fn poll_receive(&mut self) -> Result<Option<I>, Error>where
I: MessageRole,
Poll for new messages in the recv buffer
Trait Implementations§
Auto Trait Implementations§
impl<const MTU: usize, I, O> Freeze for MoteComms<MTU, I, O>
impl<const MTU: usize, I, O> RefUnwindSafe for MoteComms<MTU, I, O>
impl<const MTU: usize, I, O> Send for MoteComms<MTU, I, O>
impl<const MTU: usize, I, O> Sync for MoteComms<MTU, I, O>
impl<const MTU: usize, I, O> Unpin for MoteComms<MTU, I, O>
impl<const MTU: usize, I, O> UnsafeUnpin for MoteComms<MTU, I, O>
impl<const MTU: usize, I, O> UnwindSafe for MoteComms<MTU, I, O>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more