L2CAP Connectivity command request decoders and command response encoders

nRF5 SDK v12.1.0

L2CAP Connectivity command request decoders and command response encoders. More...

Functions

uint32_t ble_l2cap_cid_register_req_dec (uint8_t const *const p_buf, uint32_t buf_len, uint16_t *p_cid)
Decodes sd_ble_l2cap_cid_register command request. More...
uint32_t ble_l2cap_cid_register_rsp_enc (uint32_t return_code, uint8_t *const p_buf, uint32_t *const p_buf_len)
Encodes sd_ble_l2cap_cid_register command response. More...
uint32_t ble_l2cap_cid_unregister_req_dec (uint8_t const *const p_buf, uint32_t buf_len, uint16_t *p_cid)
Decodes sd_ble_l2cap_cid_unregister command request. More...
uint32_t ble_l2cap_cid_unregister_rsp_enc (uint32_t return_code, uint8_t *const p_buf, uint32_t *const p_buf_len)
Encodes sd_ble_l2cap_cid_unregister command response. More...
uint32_t ble_l2cap_tx_req_dec (uint8_t const *const p_buf, uint32_t const buf_len, uint16_t *p_conn_handle, ble_l2cap_header_t **const pp_l2cap_header, uint8_t const **pp_data)
Decodes sd_ble_l2cap_tx command request. More...
uint32_t ble_l2cap_tx_rsp_enc (uint32_t return_code, uint8_t *const p_buf, uint32_t *const p_buf_len)
Encodes sd_ble_l2cap_tx command response. More...

Detailed Description

L2CAP Connectivity command request decoders and command response encoders.

Function Documentation

uint32_t ble_l2cap_cid_register_req_dec ( uint8_t const *const p_buf ,
uint32_t buf_len ,
uint16_t * p_cid
)

Decodes sd_ble_l2cap_cid_register command request.

See Also
ble_l2cap_cid_register_rsp_enc for response encoding.
Parameters
[in] p_buf Pointer to beginning of command request packet.
[in] buf_len Length (in bytes) of response packet.
[in] p_cid Pointer to L2CAP CID.
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_PARAM Decoding failure. Invalid operation type.
uint32_t ble_l2cap_cid_register_rsp_enc ( uint32_t return_code ,
uint8_t *const p_buf ,
uint32_t *const p_buf_len
)

Encodes sd_ble_l2cap_cid_register command response.

See Also
ble_l2cap_cid_register_req_dec for request decoding.
Parameters
[in] return_code Return code indicating if command was successful or not.
[out] p_buf Pointer to buffer where encoded data command response will be returned.
[in,out] p_buf_len in: size of p_buf buffer. out: Length of encoded command response 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_req_dec ( uint8_t const *const p_buf ,
uint32_t buf_len ,
uint16_t * p_cid
)

Decodes sd_ble_l2cap_cid_unregister command request.

See Also
ble_l2cap_cid_unregister_rsp_enc for response encoding.
Parameters
[in] p_buf Pointer to beginning of command request packet.
[in] buf_len Length (in bytes) of response packet.
[in] p_cid Pointer to L2CAP CID.
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_PARAM Decoding failure. Invalid operation type.
uint32_t ble_l2cap_cid_unregister_rsp_enc ( uint32_t return_code ,
uint8_t *const p_buf ,
uint32_t *const p_buf_len
)

Encodes sd_ble_l2cap_cid_unregister command response.

See Also
ble_l2cap_cid_unregister_req_dec for request decoding.
Parameters
[in] return_code Return code indicating if command was successful or not.
[out] p_buf Pointer to buffer where encoded data command response will be returned.
[in,out] p_buf_len in: size of p_buf buffer. out: Length of encoded command response 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_tx_req_dec ( uint8_t const *const p_buf ,
uint32_t const buf_len ,
uint16_t * p_conn_handle ,
ble_l2cap_header_t **const pp_l2cap_header ,
uint8_t const ** pp_data
)

Decodes sd_ble_l2cap_tx command request.

See Also
ble_l2cap_tx_rsp_enc for response encoding.
Parameters
[in] p_buf Pointer to beginning of command request packet.
[in] buf_len Length (in bytes) of response packet.
[in] p_conn_handle Pointer to connection handle.
[in] pp_l2cap_header Pointer to pointer to L2CAP header.
[in] pp_data Pointer to pointer L2CAP data.
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_PARAM Decoding failure. Invalid operation type.
uint32_t ble_l2cap_tx_rsp_enc ( uint32_t return_code ,
uint8_t *const p_buf ,
uint32_t *const p_buf_len
)

Encodes sd_ble_l2cap_tx command response.

See Also
ble_l2cap_tx_req_dec for request decoding.
Parameters
[in] return_code Return code indicating if command was successful or not.
[out] p_buf Pointer to buffer where encoded data command response will be returned.
[in,out] p_buf_len in: size of p_buf buffer. out: Length of encoded command response packet.
Return values
NRF_SUCCESS Encoding success.
NRF_ERROR_NULL Encoding failure. NULL pointer supplied.
NRF_ERROR_INVALID_LENGTH Encoding failure. Incorrect buffer length.