Infineon Logo AIROC BTSDK v4.2 - Documentation
 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages

API's used for BR/EDR L2CAP. More...

Functions

uint16_t wiced_bt_l2cap_connect_req (uint16_t psm, wiced_bt_device_address_t p_bd_addr)
 Higher layers call this function to create an L2CAP connection. More...
 
void wiced_bt_l2cap_ertm_enable (void)
 Enable ERTM. 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_register_ertm_drb (uint16_t lcid, tDRB *p_drb, uint16_t drb_max_payload_len, wiced_bt_l2cap_drb_release_cb *p_unreg_cb)
 Higher layers call this function to register a DRM for an ERTM connection. More...
 
uint8_t wiced_bt_l2cap_set_desire_role (uint8_t new_role)
 This function sets the desire role for L2CAP. More...
 
uint16_t wiced_bt_l2cap_flush_channel (uint16_t lcid, uint16_t num_to_flush)
 This function flushes none, some or all buffers queued up for xmission for a particular CID. 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 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 channel. More...
 
wiced_bool_t wiced_bt_l2cap_set_flush_timeout (wiced_bt_device_address_t bd_addr, uint16_t flush_timeout)
 This function set the automatic flush time out in Baseband for ACL-U packets. 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)
 Get a peers features and fixed channel map. More...
 
uint8_t wiced_bt_l2cap_get_chnl_fcr_mode (uint16_t lcid)
 Get the channel FCR mode. More...
 

Detailed Description

API's used for BR/EDR L2CAP.

Function Documentation

uint16_t wiced_bt_l2cap_connect_req ( uint16_t  psm,
wiced_bt_device_address_t  p_bd_addr 
)

Higher layers call this function to create an L2CAP connection.

Note that the connection is not established at this time, but connection establishment gets started. The callback function will be invoked when connection establishes or fails.

Parameters
[in]psm: PSM value
[in]p_bd_addr: BD Address
Returns
the CID of the connection, or 0 if it failed to start
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 will be invoked when connection establishes or fails.

Parameters
[in]psm: PSM value
[in]p_bd_addr: BD Address
[in]p_ertm_information: ERTM info
Returns
the CID of the connection, or 0 if it failed to start
void wiced_bt_l2cap_ertm_enable ( void  )

Enable ERTM.

Calling this function will cause the linker to include ERTM related functions.

Returns
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 channel.

data_enabled - TRUE data flows, FALSE data is stopped

Parameters
[in]cid: CID value
[in]data_enabled: data enabled
Returns
TRUE if valid channel, else FALSE
uint16_t wiced_bt_l2cap_flush_channel ( uint16_t  lcid,
uint16_t  num_to_flush 
)

This function flushes none, some or all buffers queued up for xmission 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 specifies the maximum buffers to flush.

Parameters
[in]lcid: Local CID value
[in]num_to_flush: Number of items for flushing, Refer L2CAP flush channels
Returns
Number of buffers left queued for that CID
uint8_t wiced_bt_l2cap_get_chnl_fcr_mode ( uint16_t  lcid)

Get the channel FCR mode.

Parameters
[in]lcidLocal CID
Returns
Channel mode Refer L2CAP_FCR_MODE
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 
)

Get a peers features and fixed channel map.

Parameters
[in]bd_addr: Peer Bd Address
[in]p_ext_feat: features
[in]p_chnl_mask: mask storage area
Returns
: TRUE if peer is connected
wiced_bool_t wiced_bt_l2cap_register_ertm_drb ( uint16_t  lcid,
tDRB p_drb,
uint16_t  drb_max_payload_len,
wiced_bt_l2cap_drb_release_cb p_unreg_cb 
)

Higher layers call this function to register a DRM for an ERTM connection.

Parameters
[in]lcid: Local CID value
[in]p_drb: Address of the DRB
[in]drb_max_payload_len: DRB Size. It should greater than or equal to to MTU.
[in]p_unreg_cb: wiced_bt_l2cap_drb_release_cb.
Returns
TRUE if disconnect sent, else FALSE
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.

Parameters
[in]bd_addr: BD Address
[in]priority: Refer L2CAP ACL Priority Value
Returns
TRUE if a valid channel, else FALSE
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.

Parameters
[in]bd_addr: BD Address
[in]priority: Refer L2CAP ACL Priority Value
[in]direction: Refer L2CAP ACL Priority Direction
Returns
TRUE if a valid channel, else FALSE
uint8_t wiced_bt_l2cap_set_desire_role ( uint8_t  new_role)

This function sets the desire role for L2CAP.

If the new role is L2CAP_ROLE_ALLOW_SWITCH, allow switch on HciCreateConnection. If the new role is L2CAP_ROLE_DISALLOW_SWITCH, do not allow switch on HciCreateConnection.

If the new role is a valid role (HCI_ROLE_CENTRAL or HCI_ROLE_PERIPHERAL), the desire role is set to the new value. Otherwise, it is not changed.

Parameters
[in]new_role: New role value. Refer L2CAP role
Returns
the new (current) role. Refer L2CAP role
wiced_bool_t wiced_bt_l2cap_set_flush_timeout ( wiced_bt_device_address_t  bd_addr,
uint16_t  flush_timeout 
)

This function set the automatic flush time out in Baseband for ACL-U packets.

Parameters
[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
Returns
TRUE if command succeeded, FALSE if failed
Note
This flush timeout applies to all logical channels active on the ACL link.
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 channel.

(FCR Mode)

Parameters
[in]cid: CID value
[in]priority: refer wiced_bt_l2cap_chnl_priority_t
Returns
TRUE if a valid channel, else FALSE