AIROC™ BTSDK v4.8 - Documentation | ||||
API Functions module for L2CAP. More...
Functions | |
wiced_bool_t | wiced_bt_l2cap_get_current_config (uint16_t lcid, wiced_bt_l2cap_cfg_information_t **pp_our_cfg, wiced_bt_l2cap_ch_cfg_bits_t *p_our_cfg_bits, wiced_bt_l2cap_cfg_information_t **pp_peer_cfg, wiced_bt_l2cap_ch_cfg_bits_t *p_peer_cfg_bits) |
This function returns configurations of the L2CAP channel over a BR/EDR link. More... | |
uint16_t | wiced_bt_l2cap_register (uint16_t psm, wiced_bt_l2cap_appl_information_t *p_cb_information, void *context) |
Other layers call this function to register for L2CAP services over a BR/EDR link. More... | |
void | wiced_bt_l2cap_deregister (uint16_t psm) |
Other layers call this function to deregister for L2CAP services. More... | |
uint16_t | wiced_bt_l2cap_allocate_psm (void) |
Other layers call this function to find an unused PSM for L2CAP services. More... | |
uint16_t | wiced_bt_l2cap_connect_req (uint16_t psm, wiced_bt_device_address_t p_bd_addr, wiced_bt_l2cap_ertm_information_t *p_ertm_information) |
Higher layers call this function to create an L2CAP connection over a BR/EDR link. More... | |
void | wiced_bt_l2cap_ertm_enable (void) |
Enables ERTM over a BR/EDR link. More... | |
uint16_t | wiced_bt_l2cap_ertm_connect_req (uint16_t psm, wiced_bt_device_address_t p_bd_addr, wiced_bt_l2cap_ertm_information_t *p_ertm_information) |
Higher layers call this function to create an L2CAP connection that needs to use Enhanced Retransmission Mode. More... | |
wiced_bool_t | wiced_bt_l2cap_disconnect_req (uint16_t cid) |
Higher layers call this function to disconnect a channel. More... | |
wiced_bool_t | wiced_bt_l2cap_disconnect_rsp (uint16_t cid) |
Higher layers call this function to acknowledge the disconnection of a channel. More... | |
uint8_t | wiced_bt_l2cap_data_write (uint16_t cid, uint8_t *p_buf, uint16_t buf_len, uint16_t flags) |
Higher layers call this function to write data with extended parameters. More... | |
wiced_bool_t | wiced_bt_l2cap_set_idle_timeout (uint16_t cid, uint16_t timeout, wiced_bool_t is_global) |
Higher layers call this function to set the idle timeout for a BR/EDR connection, or for all future connections. More... | |
wiced_bool_t | wiced_bt_l2cap_set_idle_timeout_by_bd_addr (wiced_bt_device_address_t bd_addr, uint16_t timeout, tBT_TRANSPORT transport) |
Higher layers call this function to set the idle timeout for a connection. More... | |
uint8_t | wiced_bt_l2cap_set_desire_role (uint8_t new_role) |
This function sets the desired role for L2CAP on a BR/EDR link. More... | |
uint16_t | wiced_bt_l2cap_flush_channel (uint16_t lcid, uint16_t num_to_flush) |
Function Name: wiced_bt_l2cap_flush_channel. More... | |
wiced_bool_t | wiced_bt_l2cap_set_acl_priority (wiced_bt_device_address_t bd_addr, uint8_t priority) |
Sets the priority for an ACL channel. More... | |
wiced_bool_t | wiced_bt_l2cap_set_acl_priority_ext (wiced_bt_device_address_t bd_addr, uint8_t priority, uint8_t direction) |
Sets the priority for an ACL channel with extended parameters. More... | |
wiced_bool_t | wiced_bt_l2cap_flow_control (uint16_t cid, wiced_bool_t data_enabled) |
Higher layers call this function to flow control a BR/EDR channel. More... | |
wiced_bool_t | wiced_bt_l2cap_set_tx_priority (uint16_t cid, wiced_bt_l2cap_chnl_priority_t priority) |
Sets the transmission priority for a BR/EDR channel. More... | |
wiced_bool_t | wiced_bt_l2cap_set_flush_timeout (wiced_bt_device_address_t bd_addr, uint16_t flush_timeout) |
This function sets an automatic flush timeout in Baseband for ACL-U packets on a BR/EDR link. More... | |
wiced_bool_t | wiced_bt_l2cap_get_peer_features (wiced_bt_device_address_t bd_addr, uint32_t *p_ext_feat, uint8_t *p_chnl_mask) |
Gets the peer features and fixed channel map over a BR/EDR link. More... | |
uint8_t | wiced_bt_l2cap_get_chnl_fcr_mode (uint16_t lcid) |
Gets the channel FCR mode of a BR/EDR link. More... | |
wiced_bool_t | wiced_bt_l2cap_cancel_ble_connect_req (wiced_bt_device_address_t rem_bda) |
Cancels a pending connection attempt to a LE device. More... | |
wiced_bool_t | wiced_bt_l2cap_update_ble_conn_params (wiced_bt_device_address_t rem_bdRa, uint16_t min_int, uint16_t max_int, uint16_t latency, uint16_t timeout) |
Updates LE connection parameters. More... | |
wiced_bool_t | wiced_bt_l2cap_enable_update_ble_conn_params (wiced_bt_device_address_t rem_bda, wiced_bool_t enable) |
Enable or disable update based on the request from the peer. More... | |
uint8_t | wiced_bt_l2cap_get_ble_conn_role (wiced_bt_device_address_t bd_addr) |
This function returns the connection role. More... | |
uint16_t | wiced_bt_l2cap_get_disconnect_reason (wiced_bt_device_address_t remote_bda, tBT_TRANSPORT transport) |
This function returns the disconnect reason code. More... | |
uint16_t | wiced_bt_l2cap_le_register (uint16_t le_psm, wiced_bt_l2cap_le_appl_information_t *p_cb_information, void *context) |
Other layers call this function to register L2CAP services for LE_PSM. More... | |
wiced_bool_t | wiced_bt_l2cap_le_deregister (uint16_t le_psm) |
Other layers call this function to deregister L2CAP services for LE_PSM. More... | |
uint16_t | wiced_bt_l2cap_le_connect_req (uint16_t le_psm, wiced_bt_device_address_t p_bd_addr, wiced_bt_ble_address_type_t bd_addr_type, wiced_bt_ble_conn_mode_t conn_mode, uint16_t rx_mtu, uint8_t rx_sdu_pool_id, uint8_t req_security, uint8_t req_encr_key_size) |
Higher layers call this function to create an L2CAP connection for LE_PSM. More... | |
wiced_bool_t | wiced_bt_l2cap_le_connect_rsp (wiced_bt_device_address_t p_bd_addr, uint8_t id, uint16_t lcid, uint16_t result, uint16_t rx_mtu, uint8_t rx_sdu_pool_id) |
Function Name: wiced_bt_l2cap_le_connect_rsp. More... | |
wiced_bool_t | wiced_bt_l2cap_le_disconnect_req (uint16_t lcid) |
Higher layers call this function to disconnect an LE COC channel. More... | |
wiced_bool_t | wiced_bt_l2cap_le_disconnect_rsp (uint16_t lcid) |
Higher layers call this function to acknowledge the disconnection of a LE COC channel. More... | |
uint8_t | wiced_bt_l2cap_le_data_write (uint16_t cid, uint8_t *p_data, uint16_t buf_len, uint16_t flags) |
Sends data over the LE connection-oriented channel. More... | |
wiced_bool_t | wiced_bt_l2cap_le_set_user_congestion (uint16_t lcid, wiced_bool_t is_congested) |
Higher layers call this function to tell if the connection is congested or not. More... | |
uint16_t | wiced_bt_l2cap_le_get_peer_mtu (uint16_t lcid) |
Higher layers call this function to get peer MTU. More... | |
uint16_t | wiced_bt_l2cap_le_determ_secur_rsp (wiced_bt_device_address_t bd_addr, uint8_t req_secur, uint8_t req_encr_key_size) |
Higher layers call this function to check if the current device security settings are sufficient to continue with call establishment. More... | |
API Functions module for L2CAP.
uint16_t wiced_bt_l2cap_allocate_psm | ( | void | ) |
Other layers call this function to find an unused PSM for L2CAP services.
wiced_bool_t wiced_bt_l2cap_cancel_ble_connect_req | ( | wiced_bt_device_address_t | rem_bda | ) |
Cancels a pending connection attempt to a LE device.
[in] | rem_bda | BD Address of remote |
uint16_t wiced_bt_l2cap_connect_req | ( | uint16_t | psm, |
wiced_bt_device_address_t | p_bd_addr, | ||
wiced_bt_l2cap_ertm_information_t * | p_ertm_information | ||
) |
Higher layers call this function to create an L2CAP connection over a BR/EDR link.
Note that the connection is not established at this time, but connection establishment gets started. The callback function is invoked when connection establishes or fails.
[in] | psm | : PSM value |
[in] | p_bd_addr | : BD Address |
[in] | p_ertm_information | : ERTM info |
uint8_t wiced_bt_l2cap_data_write | ( | uint16_t | cid, |
uint8_t * | p_buf, | ||
uint16_t | buf_len, | ||
uint16_t | flags | ||
) |
Higher layers call this function to write data with extended parameters.
[in] | cid | CID value |
[in] | p_data | Input buffer |
[in] | flags | L2CAP_FLUSHABLE_CH_BASED L2CAP_FLUSHABLE_PACKET L2CAP_NON_FLUSHABLE_PACKET |
void wiced_bt_l2cap_deregister | ( | uint16_t | psm | ) |
Other layers call this function to deregister for L2CAP services.
[in] | psm | PSM value |
wiced_bool_t wiced_bt_l2cap_disconnect_req | ( | uint16_t | cid | ) |
Higher layers call this function to disconnect a channel.
[in] | cid | CID value |
wiced_bool_t wiced_bt_l2cap_disconnect_rsp | ( | uint16_t | cid | ) |
Higher layers call this function to acknowledge the disconnection of a channel.
[in] | cid | CID value |
wiced_bool_t wiced_bt_l2cap_enable_update_ble_conn_params | ( | wiced_bt_device_address_t | rem_bda, |
wiced_bool_t | enable | ||
) |
Enable or disable update based on the request from the peer.
[in] | rem_bda | Remote Bd Address |
[in] | enable | TRUE for Enable, FALSE for Disable |
uint16_t wiced_bt_l2cap_ertm_connect_req | ( | uint16_t | psm, |
wiced_bt_device_address_t | p_bd_addr, | ||
wiced_bt_l2cap_ertm_information_t * | p_ertm_information | ||
) |
Higher layers call this function to create an L2CAP connection that needs to use Enhanced Retransmission Mode.
Note that the connection is not established at this time, but connection establishment gets started. The callback function is invoked when connection establishes or fails.
[in] | psm | PSM value |
[in] | p_bd_addr | BD Address |
[in] | p_ertm_info | ERTM info |
void wiced_bt_l2cap_ertm_enable | ( | void | ) |
Enables ERTM over a BR/EDR link.
Calling this function causes the linker to include ERTM-related functions.
[in] | void |
wiced_bool_t wiced_bt_l2cap_flow_control | ( | uint16_t | cid, |
wiced_bool_t | data_enabled | ||
) |
Higher layers call this function to flow control a BR/EDR channel.
data_enabled - TRUE data flows, FALSE data is stopped.
[in] | cid | CID value |
[in] | data_enabled | data enabled |
uint16_t wiced_bt_l2cap_flush_channel | ( | uint16_t | lcid, |
uint16_t | num_to_flush | ||
) |
Function Name: wiced_bt_l2cap_flush_channel.
This function flushes none, some or all buffers queued up for transmission for a particular CID. If called with L2CAP_FLUSH_CHANNELS_GET (0), it simply returns the number of buffers queued for that CID L2CAP_FLUSH_CHANNELS_ALL (0xffff) flushes all buffers. All other values specify the maximum buffers to flush.
[in] | lcid | LCID value |
[in] | num_to_flush | Number of items for flushing |
uint8_t wiced_bt_l2cap_get_ble_conn_role | ( | wiced_bt_device_address_t | bd_addr | ) |
This function returns the connection role.
[in] | bd_addr | BD Address |
uint8_t wiced_bt_l2cap_get_chnl_fcr_mode | ( | uint16_t | lcid | ) |
Gets the channel FCR mode of a BR/EDR link.
[in] | lcid | Local CID |
wiced_bool_t wiced_bt_l2cap_get_current_config | ( | uint16_t | lcid, |
wiced_bt_l2cap_cfg_information_t ** | pp_our_cfg, | ||
wiced_bt_l2cap_ch_cfg_bits_t * | p_our_cfg_bits, | ||
wiced_bt_l2cap_cfg_information_t ** | pp_peer_cfg, | ||
wiced_bt_l2cap_ch_cfg_bits_t * | p_peer_cfg_bits | ||
) |
This function returns configurations of the L2CAP channel over a BR/EDR link.
[in] | lcid | Local CID |
[in] | pp_our_cfg | pointer of our saved configuration options |
[in] | p_our_cfg_bits | valid config in bitmap |
[in] | pp_peer_cfg | pointer of peer's saved configuration options |
[in] | p_peer_cfg_bits | : valid config in bitmap |
uint16_t wiced_bt_l2cap_get_disconnect_reason | ( | wiced_bt_device_address_t | remote_bda, |
tBT_TRANSPORT | transport | ||
) |
This function returns the disconnect reason code.
[in] | remote_bda | Remote BD Address |
[in] | transport | Transport (BR-EDR or LE) |
wiced_bool_t wiced_bt_l2cap_get_peer_features | ( | wiced_bt_device_address_t | bd_addr, |
uint32_t * | p_ext_feat, | ||
uint8_t * | p_chnl_mask | ||
) |
Gets the peer features and fixed channel map over a BR/EDR link.
[in] | bd_addr | Peer Bd Address |
[in] | p_ext_feat | features |
[in] | p_chnl_mask | mask storage area |
uint16_t wiced_bt_l2cap_le_connect_req | ( | uint16_t | le_psm, |
wiced_bt_device_address_t | p_bd_addr, | ||
wiced_bt_ble_address_type_t | bd_addr_type, | ||
wiced_bt_ble_conn_mode_t | conn_mode, | ||
uint16_t | rx_mtu, | ||
uint8_t | rx_sdu_pool_id, | ||
uint8_t | req_security, | ||
uint8_t | req_encr_key_size | ||
) |
Higher layers call this function to create an L2CAP connection for LE_PSM.
Note that the connection is not established at this time, but connection establishment gets started. The callback function is invoked when the connection establishes or fails.
[in] | le_psm | : LE PSM value |
[in] | p_bd_addr | : Peer BD Address |
[in] | bd_addr_type | : BLE_ADDR_PUBLIC or BLE_ADDR_RANDOM |
[in] | conn_mode | : BLE_CONN_MODE_HIGH_DUTY or BLE_CONN_MODE_LOW_DUTY |
[in] | rx_mtu | : Rx MTU value (must be <= ACL_POOL_SIZE) |
[in] | rx_sdu_pool_id | : Rx SDU pool ID (typically L2CAP_DEFAULT_BLE_CB_POOL_ID) |
[in] | req_security | : Security required |
[in] | req_encr_key_size | : key size |
wiced_bool_t wiced_bt_l2cap_le_connect_rsp | ( | wiced_bt_device_address_t | p_bd_addr, |
uint8_t | id, | ||
uint16_t | lcid, | ||
uint16_t | result, | ||
uint16_t | rx_mtu, | ||
uint8_t | rx_sdu_pool_id | ||
) |
Function Name: wiced_bt_l2cap_le_connect_rsp.
Higher layers call this function to accept an incoming LE L2CAP connection, for which they received an connect indication callback.
[in] | p_bd_addr | : Peer BD Address |
[in] | id | : Identifier that the remote sent |
[in] | lcid | : LCID value |
[in] | result | : L2CAP connection result code |
[in] | rx_mtu | : Rx MTU value |
[in] | rx_sdu_pool_id | : Rx SDU pool ID (typically L2CAP_DEFAULT_BLE_CB_POOL_ID) |
uint8_t wiced_bt_l2cap_le_data_write | ( | uint16_t | cid, |
uint8_t * | p_data, | ||
uint16_t | buf_len, | ||
uint16_t | flags | ||
) |
Sends data over the LE connection-oriented channel.
[in] | cid | Channel ID |
[in] | p_data | Input buffer |
[in] | buf_len | p_data buffer size |
wiced_bool_t wiced_bt_l2cap_le_deregister | ( | uint16_t | le_psm | ) |
Other layers call this function to deregister L2CAP services for LE_PSM.
[in] | le_psm | LE PSM value |
uint16_t wiced_bt_l2cap_le_determ_secur_rsp | ( | wiced_bt_device_address_t | bd_addr, |
uint8_t | req_secur, | ||
uint8_t | req_encr_key_size | ||
) |
Higher layers call this function to check if the current device security settings are sufficient to continue with call establishment.
It is called by the call acceptor on reception of n LE Credit Based Connection Request.
[in] | bd_addr | BD Address |
[in] | req_secur | Security required flags (see wiced_bt_ble_sec_flags_e) |
[in] | req_encr_key_size | Key size |
wiced_bool_t wiced_bt_l2cap_le_disconnect_req | ( | uint16_t | lcid | ) |
Higher layers call this function to disconnect an LE COC channel.
[in] | lcid | LCID value |
wiced_bool_t wiced_bt_l2cap_le_disconnect_rsp | ( | uint16_t | lcid | ) |
Higher layers call this function to acknowledge the disconnection of a LE COC channel.
[in] | lcid | LCID value |
uint16_t wiced_bt_l2cap_le_get_peer_mtu | ( | uint16_t | lcid | ) |
Higher layers call this function to get peer MTU.
[in] | lcid | LCID value |
uint16_t wiced_bt_l2cap_le_register | ( | uint16_t | le_psm, |
wiced_bt_l2cap_le_appl_information_t * | p_cb_information, | ||
void * | context | ||
) |
Other layers call this function to register L2CAP services for LE_PSM.
[in] | le_psm | LE PSM value |
[in] | p_cb_info | L2CAP cb info |
[in] | context | Caller context to return in callbacks |
wiced_bool_t wiced_bt_l2cap_le_set_user_congestion | ( | uint16_t | lcid, |
wiced_bool_t | is_congested | ||
) |
Higher layers call this function to tell if the connection is congested or not.
[in] | lcid | LCID value |
[in] | is_congested | TRUE, if congested |
uint16_t wiced_bt_l2cap_register | ( | uint16_t | psm, |
wiced_bt_l2cap_appl_information_t * | p_cb_information, | ||
void * | context | ||
) |
Other layers call this function to register for L2CAP services over a BR/EDR link.
[in] | psm | PSM value |
[in] | p_cb_info | L2CAP cb info |
[in] | context | Caller context to return in callbacks |
wiced_bool_t wiced_bt_l2cap_set_acl_priority | ( | wiced_bt_device_address_t | bd_addr, |
uint8_t | priority | ||
) |
Sets the priority for an ACL channel.
[in] | bd_addr | BD Address |
[in] | priority | [L2CAP_PRIORITY_NORMAL | L2CAP_PRIORITY_HIGH] |
wiced_bool_t wiced_bt_l2cap_set_acl_priority_ext | ( | wiced_bt_device_address_t | bd_addr, |
uint8_t | priority, | ||
uint8_t | direction | ||
) |
Sets the priority for an ACL channel with extended parameters.
[in] | bd_addr | BD Address |
[in] | priority | [L2CAP_PRIORITY_NORMAL | L2CAP_PRIORITY_HIGH] |
[in] | direction | [L2CAP_DIRECTION_DATA_SOURCE | L2CAP_DIRECTION_DATA_SINK] |
uint8_t wiced_bt_l2cap_set_desire_role | ( | uint8_t | new_role | ) |
This function sets the desired role for L2CAP on a BR/EDR link.
If the new role is L2CAP_ROLE_ALLOW_SWITCH, allows switching to HciCreateConnection. If the new role is L2CAP_ROLE_DISALLOW_SWITCH, does not allow switching to HciCreateConnection.
If the new role is a valid role (HCI_ROLE_CENTRAL or HCI_ROLE_PERIPHERAL), the desired role is set to a new value. Otherwise, not changed.
[in] | new_role | New role value |
wiced_bool_t wiced_bt_l2cap_set_flush_timeout | ( | wiced_bt_device_address_t | bd_addr, |
uint16_t | flush_timeout | ||
) |
This function sets an automatic flush timeout in Baseband for ACL-U packets on a BR/EDR link.
[in] | bd_addr | The remote BD address of ACL link. If it is BT_DB_ANY then the flush time out will be applied to all ACL link. |
[in] | flush_timeout | flush time out in ms 0x0000 : No automatic flush L2CAP_NO_RETRANSMISSION : No retransmission 0x0002 - 0xFFFE : flush time out, if (flush_timeout*8)+3/5) <= HCI_MAX_AUTO_FLUSH_TOUT (in 625us slot). Otherwise, return FALSE. L2CAP_NO_AUTOMATIC_FLUSH : No automatic flush |
wiced_bool_t wiced_bt_l2cap_set_idle_timeout | ( | uint16_t | cid, |
uint16_t | timeout, | ||
wiced_bool_t | is_global | ||
) |
Higher layers call this function to set the idle timeout for a BR/EDR connection, or for all future connections.
The "idle timeout" is the amount of time that a connection can remain up with no L2CAP channels on it. A timeout of zero means that the connection will be torn down immediately after the last channel is removed. A timeout of 0xFFFF means no timeout. Values are in seconds.
[in] | cid | CID value |
[in] | timeout | Timeout value |
[in] | is_global | TRUE, if global |
wiced_bool_t wiced_bt_l2cap_set_idle_timeout_by_bd_addr | ( | wiced_bt_device_address_t | bd_addr, |
uint16_t | timeout, | ||
tBT_TRANSPORT | transport | ||
) |
Higher layers call this function to set the idle timeout for a connection.
The "idle timeout" is the amount of time that a connection can remain up with no L2CAP channels on it. A timeout of zero means that the connection is torn down immediately after the last channel is removed. A timeout of 0xFFFF means no timeout. Values are in seconds. bd_addr is the remote BD address. If bd_addr = BT_BD_ANY, the idle timeouts for all active l2cap links is changed.
[in] | bd_addr | BD Address |
[in] | timeout | Timeout value |
wiced_bool_t wiced_bt_l2cap_set_tx_priority | ( | uint16_t | cid, |
wiced_bt_l2cap_chnl_priority_t | priority | ||
) |
Sets the transmission priority for a BR/EDR channel.
(FCR Mode)
[in] | cid | CID |
[in] | priority | [L2CAP_PRIORITY_NORMAL | L2CAP_PRIORITY_HIGH] |
wiced_bool_t wiced_bt_l2cap_update_ble_conn_params | ( | wiced_bt_device_address_t | rem_bdRa, |
uint16_t | min_int, | ||
uint16_t | max_int, | ||
uint16_t | latency, | ||
uint16_t | timeout | ||
) |
Updates LE connection parameters.
[in] | rem_bdRa | Remote BD Address |
[in] | min_int | Min interval ( In frames ) |
[in] | max_int | Max interval ( In frames ) |
[in] | latency | Latency value ( LL connection events ) |
[in] | timeout | Timeout value ( Timeout multiplier * 10 ms ) |