Functions

uint16_t ble_l2cap_lecb_conn_create (uint8_t conn_idx, const ble_l2cap_lecb_conn_req_t *p_conn_req)
 Create the LE credit based connection. More...
 
uint16_t ble_l2cap_lecb_conn_cfm (uint8_t conn_idx, const ble_l2cap_lecb_cfm_conn_t *p_cfm_conn)
 Confirm the LE credit based connection after receiving the connection request packet from the peer device. More...
 
uint16_t ble_l2cap_lecb_disconnect (uint8_t conn_idx, uint16_t local_cid)
 Disconnect the LE credit based connection. More...
 
uint16_t ble_l2cap_lecb_credits_add (uint8_t conn_idx, const ble_l2cap_lecb_add_credits_t *p_add_credits)
 Send a LE Flow Control Credit packet when the device is capable of receiving additional LE-frames (for example after the device has processed the sdu). More...
 
uint16_t ble_l2cap_lecb_sdu_send (uint8_t conn_idx, const ble_l2cap_lecb_sdu_t *p_sdu)
 Send an SDU packet to the peer device. More...
 
uint16_t ble_l2cap_lecb_psm_register (uint16_t le_psm)
 Register PSM. More...
 
uint16_t ble_l2cap_enh_lecb_conn_create (uint8_t conn_idx, const ble_l2cap_enh_lecb_conn_req_t *p_enh_conn_req)
 Create the LE enhanced credit based connection. More...
 
uint16_t ble_l2cap_enh_lecb_conn_cfm (uint8_t conn_idx, const ble_l2cap_enh_lecb_cfm_conn_t *p_enh_cfm_conn)
 Confirm the LE enhanced credit based connection after receiving the connection request packet from the peer device. More...
 
uint16_t ble_l2cap_enh_lecb_reconfig (uint8_t conn_idx, const ble_l2cap_enh_lecb_reconfig_t *p_enh_reconfig)
 Reconfig the mtu and mps for the indicated channels. More...
 

Detailed Description

Function Documentation

◆ ble_l2cap_enh_lecb_conn_cfm()

uint16_t ble_l2cap_enh_lecb_conn_cfm ( uint8_t  conn_idx,
const ble_l2cap_enh_lecb_cfm_conn_t p_enh_cfm_conn 
)

Confirm the LE enhanced credit based connection after receiving the connection request packet from the peer device.

Note
This function should be invoked in the event BLE_L2CAP_EVT_ENH_CONN_REQ. And after the COC created, the event BLE_L2CAP_EVT_ENH_CONN_IND should be triggered.
Parameters
[in]conn_idxACL connection index. The first ACL connection index is 0 and the index will be increased one by one.
[in]p_enh_cfm_connPointer to the LE enhanced credit based connection confirm structure.
Return values
SDK_SUCCESSThe LE credit based connection confirmation is successfully set to the BLE stack.
SDK_ERR_POINTER_NULLInvalid pointer supplied.
SDK_ERR_INVALID_CONN_IDXInvalid connection index supplied.
SDK_ERR_INVALID_PARAMInvalid parameter supplied.
SDK_ERR_NO_RESOURCESNot enough resources.

◆ ble_l2cap_enh_lecb_conn_create()

uint16_t ble_l2cap_enh_lecb_conn_create ( uint8_t  conn_idx,
const ble_l2cap_enh_lecb_conn_req_t p_enh_conn_req 
)

Create the LE enhanced credit based connection.

Note
After the COC created, the l2cap event BLE_L2CAP_EVT_ENH_CONN_REQ will be triggered.
Parameters
[in]conn_idxACL connection index. The first ACL connection index is 0, and the index will be increased one by one.
[in]p_enh_conn_reqPointer to the LE enhanced Credit Based Connection Request structure.
Return values
SDK_SUCCESSThe LE Credit Based connection request is successfully set to the BLE stack.
SDK_ERR_POINTER_NULLInvalid pointer supplied.
SDK_ERR_INVALID_CONN_IDXInvalid connection index supplied.
SDK_ERR_INVALID_PARAMInvalid parameter supplied.
SDK_ERR_NO_RESOURCESNot enough resources.

◆ ble_l2cap_enh_lecb_reconfig()

uint16_t ble_l2cap_enh_lecb_reconfig ( uint8_t  conn_idx,
const ble_l2cap_enh_lecb_reconfig_t p_enh_reconfig 
)

Reconfig the mtu and mps for the indicated channels.

Note
After the reconfig complete, the event BLE_L2CAP_EVT_ENH_RECONFIG_CPLT should be triggered.
Parameters
[in]conn_idxACL connection index. The first ACL connection index is 0 and the index will be increased one by one.
[in]p_enh_reconfigPointer to the LE enhanced credit based connection reconfig structure.
Return values
SDK_SUCCESSThe LE credit based connection confirmation is successfully set to the BLE stack.
SDK_ERR_POINTER_NULLInvalid pointer supplied.
SDK_ERR_INVALID_CONN_IDXInvalid connection index supplied.
SDK_ERR_INVALID_PARAMInvalid parameter supplied.
SDK_ERR_NO_RESOURCESNot enough resources.

◆ ble_l2cap_lecb_conn_cfm()

uint16_t ble_l2cap_lecb_conn_cfm ( uint8_t  conn_idx,
const ble_l2cap_lecb_cfm_conn_t p_cfm_conn 
)

Confirm the LE credit based connection after receiving the connection request packet from the peer device.

Parameters
[in]conn_idxACL connection index. The first ACL connection index is 0 and the index will be increased one by one.
[in]p_cfm_connPointer to the LE Credit Based Connection Confirm structure.
Return values
SDK_SUCCESSThe LE Credit Based connection confirmation is successfully set to the BLE stack.
SDK_ERR_POINTER_NULLInvalid pointer supplied.
SDK_ERR_INVALID_CONN_IDXInvalid connection index supplied.
SDK_ERR_INVALID_PARAMInvalid parameter supplied.
SDK_ERR_NO_RESOURCESNot enough resources.

◆ ble_l2cap_lecb_conn_create()

uint16_t ble_l2cap_lecb_conn_create ( uint8_t  conn_idx,
const ble_l2cap_lecb_conn_req_t p_conn_req 
)

Create the LE credit based connection.

Note
After the COC created, the l2cap event BLE_L2CAP_EVT_CONN_REQ will be triggered.
Parameters
[in]conn_idxACL connection index. The first ACL connection index is 0, and the index will be increased one by one.
[in]p_conn_reqPointer to the LE Credit Based Connection Request structure.
Return values
SDK_SUCCESSThe LE Credit Based connection request is successfully set to the BLE stack.
SDK_ERR_POINTER_NULLInvalid pointer supplied.
SDK_ERR_INVALID_CONN_IDXInvalid connection index supplied.
SDK_ERR_NO_RESOURCESNot enough resources.

◆ ble_l2cap_lecb_credits_add()

uint16_t ble_l2cap_lecb_credits_add ( uint8_t  conn_idx,
const ble_l2cap_lecb_add_credits_t p_add_credits 
)

Send a LE Flow Control Credit packet when the device is capable of receiving additional LE-frames (for example after the device has processed the sdu).

Parameters
[in]conn_idxACL connection index, the first ACL connection index is 0, and increased one by one.
[in]p_add_creditsPointer to the LE Flow Control Credit structure.
Return values
SDK_SUCCESSLE Flow Control Credit packet is successfully set to the BLE stack.
SDK_ERR_POINTER_NULLInvalid pointer supplied.
SDK_ERR_INVALID_CONN_IDXInvalid connection index supplied.
SDK_ERR_NO_RESOURCESNot enough resources.

◆ ble_l2cap_lecb_disconnect()

uint16_t ble_l2cap_lecb_disconnect ( uint8_t  conn_idx,
uint16_t  local_cid 
)

Disconnect the LE credit based connection.

Parameters
[in]conn_idxACL connection index. The first ACL connection index is 0 and the index will be increased one by one.
[in]local_cidThe local source channel ID.
Return values
SDK_SUCCESSLE Credit Based disconnection request is successfully set to the BLE stack.
SDK_ERR_INVALID_CONN_IDXInvalid connection index supplied.
SDK_ERR_NO_RESOURCESNot enough resources.

◆ ble_l2cap_lecb_psm_register()

uint16_t ble_l2cap_lecb_psm_register ( uint16_t  le_psm)

Register PSM.

Parameters
[in]le_psmThe le_psm number.
Return values
SDK_SUCCESSThe callback is successfully registered to the BLE stack.
SDK_ERR_INVALID_PARAMInvalid parameter supplied.
SDK_ERR_INVALID_PSM_EXCEEDED_MAX_PSM_NUMThe maximum PSM number limit is exceeded.

◆ ble_l2cap_lecb_sdu_send()

uint16_t ble_l2cap_lecb_sdu_send ( uint8_t  conn_idx,
const ble_l2cap_lecb_sdu_t p_sdu 
)

Send an SDU packet to the peer device.

Parameters
[in]conn_idxACL connection index. The first ACL connection index is 0 and the index will be increased one by one.
[in]p_sduPointer to the sdu packet structure.
Return values
SDK_SUCCESSThe sdu packet is successfully set to the BLE stack.
SDK_ERR_POINTER_NULLInvalid pointer supplied.
SDK_ERR_INVALID_CONN_IDXInvalid connection index supplied.
SDK_ERR_NO_RESOURCESNot enough resources.