pub struct L2capChannelWriter<'d> { /* private fields */ }
Expand description
Handle representing an L2CAP channel write endpoint.
Implementations§
Source§impl<'d> L2capChannelWriter<'d>
impl<'d> L2capChannelWriter<'d>
Sourcepub fn disconnect(&mut self)
pub fn disconnect(&mut self)
Disconnect this channel.
Sourcepub async fn send<T: Controller, const TX_MTU: usize>(
&mut self,
stack: &Stack<'_, T>,
buf: &[u8],
) -> Result<(), BleHostError<T::Error>>
pub async fn send<T: Controller, const TX_MTU: usize>( &mut self, stack: &Stack<'_, T>, buf: &[u8], ) -> Result<(), BleHostError<T::Error>>
Send the provided buffer over this l2cap channel.
The buffer will be segmented to the maximum payload size agreed in the opening handshake.
If the channel has been closed or the channel id is not valid, an error is returned. If there are no available credits to send, waits until more credits are available.
Sourcepub fn try_send<T: Controller + Controller, const TX_MTU: usize>(
&mut self,
stack: &Stack<'_, T>,
buf: &[u8],
) -> Result<(), BleHostError<T::Error>>
pub fn try_send<T: Controller + Controller, const TX_MTU: usize>( &mut self, stack: &Stack<'_, T>, buf: &[u8], ) -> Result<(), BleHostError<T::Error>>
Send the provided buffer over this l2cap channel.
The buffer will be segmented to the maximum payload size agreed in the opening handshake.
If the channel has been closed or the channel id is not valid, an error is returned. If there are no available credits to send, returns Error::Busy.
Trait Implementations§
Source§impl Drop for L2capChannelWriter<'_>
impl Drop for L2capChannelWriter<'_>
Auto Trait Implementations§
impl<'d> Freeze for L2capChannelWriter<'d>
impl<'d> !RefUnwindSafe for L2capChannelWriter<'d>
impl<'d> !Send for L2capChannelWriter<'d>
impl<'d> !Sync for L2capChannelWriter<'d>
impl<'d> Unpin for L2capChannelWriter<'d>
impl<'d> !UnwindSafe for L2capChannelWriter<'d>
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