L2CAP Application command request encoders and command response decoders.
More...
|
uint32_t | ble_l2cap_cid_register_req_enc (uint16_t cid, uint8_t *const p_buf, uint32_t *const p_buf_len) |
| Register a CID with L2CAP. More...
|
|
uint32_t | ble_l2cap_cid_register_rsp_dec (uint8_t const *const p_buf, uint32_t packet_len, uint32_t *const p_result_code) |
| Decodes response to sd_ble_l2cap_cid_register command. More...
|
|
uint32_t | ble_l2cap_cid_unregister_req_enc (uint16_t cid, uint8_t *const p_buf, uint32_t *const p_buf_len) |
| Unregister a CID with L2CAP. More...
|
|
uint32_t | ble_l2cap_cid_unregister_rsp_dec (uint8_t const *const p_buf, uint32_t packet_len, uint32_t *const p_result_code) |
| Decodes response to sd_ble_l2cap_cid_unregister command. More...
|
|
uint32_t | ble_l2cap_tx_req_enc (uint16_t conn_handle, ble_l2cap_header_t const *const p_l2cap_header, uint8_t const *const p_data, uint8_t *const p_buf, uint32_t *const p_buf_len) |
| Transmit an L2CAP packet. More...
|
|
uint32_t | ble_l2cap_tx_rsp_dec (uint8_t const *const p_buf, uint32_t packet_len, uint32_t *const p_result_code) |
| Decodes response to sd_ble_l2cap_tx command. More...
|
|
L2CAP Application command request encoders and command response decoders.
uint32_t ble_l2cap_cid_register_req_enc |
( |
uint16_t |
cid, |
|
|
uint8_t *const |
p_buf, |
|
|
uint32_t *const |
p_buf_len |
|
) |
| |
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.
- Parameters
-
[in] | cid | L2CAP CID. |
[in] | p_buf | Pointer to beginning of command response packet. |
[in,out] | p_buf_len | in: Size of p_buf buffer. out: Length of encoded command packet. |
- Return values
-
NRF_SUCCESS | Encoding success. |
NRF_ERROR_NULL | Encoding failure. NULL pointer supplied. |
NRF_ERROR_INVALID_LENGTH | Encoding failure. Incorrect buffer length. |
uint32_t ble_l2cap_cid_register_rsp_dec |
( |
uint8_t const *const |
p_buf, |
|
|
uint32_t |
packet_len, |
|
|
uint32_t *const |
p_result_code |
|
) |
| |
Decodes response to sd_ble_l2cap_cid_register command.
- See Also
- 0x73 - sd_ble_gap_adv_start for packet format, ble_l2cap_cid_register_req_enc for command request encoder.
- Parameters
-
[in] | p_buf | Pointer to beginning of command response packet. |
[in] | packet_len | Length (in bytes) of response packet. |
[out] | p_result_code | Command result code. |
- Return values
-
NRF_SUCCESS | Decoding success. |
NRF_ERROR_NULL | Decoding failure. NULL pointer supplied. |
NRF_ERROR_INVALID_LENGTH | Decoding failure. Incorrect buffer length. |
NRF_ERROR_INVALID_DATA | Decoding failure. Decoded operation code does not match expected operation code. |
uint32_t ble_l2cap_cid_unregister_req_enc |
( |
uint16_t |
cid, |
|
|
uint8_t *const |
p_buf, |
|
|
uint32_t *const |
p_buf_len |
|
) |
| |
Unregister a CID with L2CAP.
This unregisters a previously registered higher protocol layer with the L2CAP multiplexer.
- Parameters
-
[in] | cid | L2CAP CID. |
[in] | p_buf | Pointer to beginning of command response packet. |
[in,out] | p_buf_len | in: Size of p_buf buffer. out: Length of encoded command packet. |
- Return values
-
NRF_SUCCESS | Encoding success. |
NRF_ERROR_NULL | Encoding failure. NULL pointer supplied. |
NRF_ERROR_INVALID_LENGTH | Encoding failure. Incorrect buffer length. |
uint32_t ble_l2cap_cid_unregister_rsp_dec |
( |
uint8_t const *const |
p_buf, |
|
|
uint32_t |
packet_len, |
|
|
uint32_t *const |
p_result_code |
|
) |
| |
Decodes response to sd_ble_l2cap_cid_unregister command.
- See Also
- 0x73 - sd_ble_gap_adv_start for packet format, ble_l2cap_cid_unregister_req_enc for command request encoder.
- Parameters
-
[in] | p_buf | Pointer to beginning of command response packet. |
[in] | packet_len | Length (in bytes) of response packet. |
[out] | p_result_code | Command result code. |
- Return values
-
NRF_SUCCESS | Decoding success. |
NRF_ERROR_NULL | Decoding failure. NULL pointer supplied. |
NRF_ERROR_INVALID_LENGTH | Decoding failure. Incorrect buffer length. |
NRF_ERROR_INVALID_DATA | Decoding failure. Decoded operation code does not match expected operation code. |
uint32_t ble_l2cap_tx_req_enc |
( |
uint16_t |
conn_handle, |
|
|
ble_l2cap_header_t const *const |
p_l2cap_header, |
|
|
uint8_t const *const |
p_data, |
|
|
uint8_t *const |
p_buf, |
|
|
uint32_t *const |
p_buf_len |
|
) |
| |
uint32_t ble_l2cap_tx_rsp_dec |
( |
uint8_t const *const |
p_buf, |
|
|
uint32_t |
packet_len, |
|
|
uint32_t *const |
p_result_code |
|
) |
| |
Decodes response to sd_ble_l2cap_tx command.
- See Also
- 0x73 - sd_ble_gap_adv_start for packet format, ble_l2cap_tx_req_enc for command request encoder.
- Parameters
-
[in] | p_buf | Pointer to beginning of command response packet. |
[in] | packet_len | Length (in bytes) of response packet. |
[out] | p_result_code | Command result code. |
- Return values
-
NRF_SUCCESS | Decoding success. |
NRF_ERROR_NULL | Decoding failure. NULL pointer supplied. |
NRF_ERROR_INVALID_LENGTH | Decoding failure. Incorrect buffer length. |
NRF_ERROR_INVALID_DATA | Decoding failure. Decoded operation code does not match expected operation code. |