Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
L2CAP APIs

This group includes all L2CAP layer APIs.

Functions

at_ble_status_t at_ble_lecb_add_credit (at_ble_handle_t conn_handle, uint16_t le_psm, uint16_t credit)
 Inform peer device that local device can receive more packets, this is a blocking API. More...
 
at_ble_status_t at_ble_lecb_cfm (at_ble_handle_t conn_handle, uint16_t le_psm, at_ble_lecb_status status)
 Server confirms if a credit based connection is completed successfully. More...
 
at_ble_status_t at_ble_lecb_connect (at_ble_handle_t conn_handle, uint16_t le_psm, uint16_t cid, uint16_t intial_credit)
 Initiate a credit based connection. More...
 
at_ble_status_t at_ble_lecb_create (at_ble_handle_t conn_handle, at_ble_lecb_sec_level_t sec_level, uint16_t le_psm, uint16_t cid, uint16_t initial_credit)
 Initialize a credit based channel to receive a credit based connection request, this API is blocking. More...
 
at_ble_status_t at_ble_lecb_destroy (at_ble_handle_t conn_handle, uint16_t le_psm)
 Close an initialized credit based channel, this API is blocking. More...
 
at_ble_status_t at_ble_lecb_disconnect (at_ble_handle_t conn_handle, uint16_t le_psm)
 Terminate a credit based connection. More...
 
at_ble_status_t at_ble_lecb_send (at_ble_handle_t conn_handle, uint16_t cid, uint16_t len, uint8_t *data)
 Send data. More...
 

at_ble_status_t at_ble_lecb_add_credit ( at_ble_handle_t  conn_handle,
uint16_t  le_psm,
uint16_t  credit 
)

Inform peer device that local device can receive more packets, this is a blocking API.

When a local device increments its credit it notifies the peer device that it's able to receive more packets (for example after it has finished processing one or more packets) , the peer device receives an AT_BLE_LECB_ADD_CREDIT_IND event.

Parameters
[in]conn_handlehandle of the connection
[in]le_psmLE Protocol/Service Multiplexer
[in]creditRX credit
Returns
Upon successful completion the function shall return AT_BLE_SUCCESS, Otherwise the function shall return at_ble_status_t

Referenced by l2cap_data_recv().

at_ble_status_t at_ble_lecb_cfm ( at_ble_handle_t  conn_handle,
uint16_t  le_psm,
at_ble_lecb_status  status 
)

Server confirms if a credit based connection is completed successfully.

Server accepts or rejects an incoming credit based connection request , this API should be used when a connection request is received AT_BLE_LECB_CONN_REQ

Parameters
[in]conn_handlehandle of the connection
[in]le_psmLE Protocol/Service Multiplexer
[in]statusstatus of operation refer to at_ble_lecb_status
Returns
Upon successful completion the function shall return AT_BLE_SUCCESS, Otherwise the function shall return at_ble_status_t

Referenced by l2cap_conn_req().

at_ble_status_t at_ble_lecb_connect ( at_ble_handle_t  conn_handle,
uint16_t  le_psm,
uint16_t  cid,
uint16_t  intial_credit 
)

Initiate a credit based connection.

Client initiates a credit based connection procedure to a server on a specific channel, in response AT_BLE_LECB_CONNECTED should be received indicating successful or failed connection

Parameters
[in]conn_handlehandle of the connection
[in]le_psmLE Protocol/Service Multiplexer
[in]cidchannel id
[in]intial_creditinitial credit allocated for the LE credit based connection
Returns
Upon successful completion the function shall return AT_BLE_SUCCESS, Otherwise the function shall return at_ble_status_t
at_ble_status_t at_ble_lecb_create ( at_ble_handle_t  conn_handle,
at_ble_lecb_sec_level_t  sec_level,
uint16_t  le_psm,
uint16_t  cid,
uint16_t  initial_credit 
)

Initialize a credit based channel to receive a credit based connection request, this API is blocking.

Server opens a channel to receive credit based connection requests

Parameters
[in]conn_handlehandle of the connection
[in]sec_levelsecurity level refer to at_ble_lecb_sec_level_t
[in]le_psmLE protocol/service multiplexer, valid dynamic range falls between 0x80 - 0xFF or a fixed SIG assigned psm may be used between 0x00-0x7F
[in]cidchannel id should be in the range of dynamically allocated channels 0x40 - 0x7F
[in]initial_creditinitial credit allocated for the LE credit based connection
Returns
Upon successful completion the function shall return AT_BLE_SUCCESS, Otherwise the function shall return at_ble_status_t

Referenced by ble_l2cap_connected().

at_ble_status_t at_ble_lecb_destroy ( at_ble_handle_t  conn_handle,
uint16_t  le_psm 
)

Close an initialized credit based channel, this API is blocking.

Server destroys an already initialized credit based channel

Parameters
[in]conn_handlehandle of the connection
[in]le_psmLE protocol/service multiplexer
Returns
Upon successful completion the function shall return AT_BLE_SUCCESS, Otherwise the function shall return at_ble_status_t

Referenced by ble_l2cap_disconnected(), and l2cap_disconnect().

at_ble_status_t at_ble_lecb_disconnect ( at_ble_handle_t  conn_handle,
uint16_t  le_psm 
)

Terminate a credit based connection.

Server or client disconnects a credit based link, in response event AT_BLE_LECB_DISCONNECTED should be received

Parameters
[in]conn_handlehandle of the connection
[in]le_psmLE Protocol/Service Multiplexer
Returns
Upon successful completion the function shall return AT_BLE_SUCCESS, Otherwise the function shall return at_ble_status_t
at_ble_status_t at_ble_lecb_send ( at_ble_handle_t  conn_handle,
uint16_t  cid,
uint16_t  len,
uint8_t *  data 
)

Send data.

Sends a data packet to peer with length less than AT_BLE_LECB_MAX_PKT_SIZE, in response AT_BLE_LECB_SEND_RESP should be received indicating a free available buffer to send. On the other side the receiving device gets an AT_BLE_LECB_DATA_RECIEVED event.

Parameters
[in]conn_handlehandle of the connection
[in]cidchannel id
[in]lendata length
[in]datadata pointer
Returns
Upon successful completion the function shall return AT_BLE_SUCCESS, Otherwise the function shall return at_ble_status_t

Referenced by at_app_send_lecb().