Embassy
nrf-softdevice-s132

Crates

git

Versions

default

Flavors

pub unsafe fn sd_ble_l2cap_ch_rx(
conn_handle: u16,
local_cid: u16,
p_sdu_buf: *const ble_data_t
) -> u32
Expand description

@brief Receive an SDU on an L2CAP channel.

@details This may issue additional credits to the peer using an LE Flow Control Credit packet.

@note A call to this function will require the application to keep the memory pointed by @ref ble_data_t::p_data alive until the SDU data buffer is returned in @ref BLE_L2CAP_EVT_CH_RX or @ref BLE_L2CAP_EVT_CH_SDU_BUF_RELEASED event.

@note The SoftDevice can queue up to @ref ble_l2cap_conn_cfg_t::rx_queue_size SDU data buffers for reception per L2CAP channel.

@events @event{@ref BLE_L2CAP_EVT_CH_RX, The SDU is received.} @endevents

@mscs @mmsc{@ref BLE_L2CAP_CH_RX_MSC} @endmscs

@param[in] conn_handle Connection Handle. @param[in] local_cid Local Channel ID of the L2CAP channel. @param[in] p_sdu_buf Pointer to the SDU data buffer.

@retval ::NRF_SUCCESS Buffer accepted. @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. @retval ::NRF_ERROR_INVALID_STATE Invalid State to perform operation (Setup or release is in progress for an L2CAP channel). @retval ::NRF_ERROR_NOT_FOUND CID not found. @retval ::NRF_ERROR_RESOURCES Too many SDU data buffers supplied. Wait for a @ref BLE_L2CAP_EVT_CH_RX event and retry.