nRF51 SDK - S120 SoftDevice
|
Functions | |
uint32_t | sd_ble_l2cap_cid_register (uint16_t cid) |
Register a CID with L2CAP. More... | |
uint32_t | sd_ble_l2cap_cid_unregister (uint16_t cid) |
Unregister a CID with L2CAP. More... | |
uint32_t | sd_ble_l2cap_tx (uint16_t conn_handle, ble_l2cap_header_t const *p_header, uint8_t const *p_data) |
Transmit an L2CAP packet. More... | |
uint32_t sd_ble_l2cap_cid_register | ( | uint16_t | cid | ) |
Register a CID with L2CAP.
This registers a higher protocol layer with the L2CAP multiplexer, and is requried prior to all operations on the CID.
[in] | cid | L2CAP CID. |
NRF_SUCCESS | Successfully registered a CID with the L2CAP layer. |
NRF_ERROR_INVALID_PARAM | Invalid parameter(s) supplied, CID must be above BLE_L2CAP_CID_DYN_BASE. |
BLE_ERROR_L2CAP_CID_IN_USE | L2CAP CID already in use. |
NRF_ERROR_NO_MEM | Not enough memory to complete operation. |
uint32_t sd_ble_l2cap_cid_unregister | ( | uint16_t | cid | ) |
Unregister a CID with L2CAP.
This unregisters a previously registerd higher protocol layer with the L2CAP multiplexer.
[in] | cid | L2CAP CID. |
NRF_SUCCESS | Successfully unregistered the CID. |
NRF_ERROR_INVALID_PARAM | Invalid parameter(s) supplied. |
NRF_ERROR_NOT_FOUND | CID not previously registered. |
uint32_t sd_ble_l2cap_tx | ( | uint16_t | conn_handle, |
ble_l2cap_header_t const * | p_header, | ||
uint8_t const * | p_data | ||
) |
Transmit an L2CAP packet.
[in] | conn_handle | Connection Handle. |
[in] | p_header | Pointer to a packet header containing length and CID. |
[in] | p_data | Pointer to the data to be transmitted. |
NRF_SUCCESS | Successfully queued an L2CAP packet for transmission. |
NRF_ERROR_INVALID_ADDR | Invalid pointer supplied. |
NRF_ERROR_INVALID_PARAM | Invalid parameter(s) supplied, CIDs must be registered beforehand with sd_ble_l2cap_cid_register. |
NRF_ERROR_NOT_FOUND | CID not found. |
NRF_ERROR_NO_MEM | Not enough memory to complete operation. |
BLE_ERROR_NO_TX_BUFFERS | Not enough application buffers available. |
NRF_ERROR_DATA_SIZE | Invalid data size(s) supplied, see BLE_L2CAP_MTU_DEF. |