Skip to main content

L2capEvent

Enum L2capEvent 

Source
pub enum L2capEvent<'a> {
    Connected {
        conn_handle: ConnHandle,
        status: i32,
        chan: L2capChan,
    },
    Disconnected {
        conn_handle: ConnHandle,
        chan: L2capChan,
    },
    Accept {
        conn_handle: ConnHandle,
        peer_sdu_size: u16,
        chan: L2capChan,
    },
    Received {
        conn_handle: ConnHandle,
        chan: L2capChan,
        data: Mbuf<'a>,
    },
    TxUnstalled {
        conn_handle: ConnHandle,
        status: i32,
        chan: L2capChan,
    },
    Reconfigured {
        conn_handle: ConnHandle,
        status: i32,
        chan: L2capChan,
        by_peer: bool,
    },
}
Expand description

An L2CAP CoC event, delivered on the host task to the single l2cap_subscribe hook. The hook returns an ATT-style status (0 = ok); it is only consulted for Accept, where non-zero rejects the peer.

Variants§

§

Connected

A channel opened by l2cap_connect finished connecting; check status (0 = success) before using chan.

Fields

§conn_handle: ConnHandle
§status: i32
§

Disconnected

A channel disconnected. chan must not be used after this event.

Fields

§conn_handle: ConnHandle
§

Accept

An incoming connection to one of our l2cap_create_server PSMs. The handler must provide the first receive buffer by calling l2cap_recv_ready on chan, and may reject the peer by returning non-zero from the hook.

Fields

§conn_handle: ConnHandle
§peer_sdu_size: u16
§

Received

An SDU was received. data is valid only for the duration of the call. After handling it, replenish the peer’s credits with l2cap_recv_ready.

Fields

§conn_handle: ConnHandle
§data: Mbuf<'a>
§

TxUnstalled

A previously Stalled send can continue (credits replenished). status is non-zero only on an allocation error mid-SDU.

Fields

§conn_handle: ConnHandle
§status: i32
§

Reconfigured

A channel MTU reconfiguration completed. by_peer is false for a local reconfigure completing (RECONFIG_COMPLETED) and true when the peer reconfigured us (PEER_RECONFIGURED).

Fields

§conn_handle: ConnHandle
§status: i32
§by_peer: bool

Auto Trait Implementations§

§

impl<'a> !Send for L2capEvent<'a>

§

impl<'a> !Sync for L2capEvent<'a>

§

impl<'a> !UnwindSafe for L2capEvent<'a>

§

impl<'a> Freeze for L2capEvent<'a>

§

impl<'a> RefUnwindSafe for L2capEvent<'a>

§

impl<'a> Unpin for L2capEvent<'a>

§

impl<'a> UnsafeUnpin for L2capEvent<'a>

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Error = !

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
§

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

§

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

The type returned in the event of a conversion error.
§

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

Performs the conversion.