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.
Disconnected
A channel disconnected. chan must not be used after this event.
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.
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.
TxUnstalled
A previously Stalled send can continue (credits replenished).
status is non-zero only on an allocation error mid-SDU.
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).