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

Macros

#define wiced_bt_dev_switch_role   BTM_SwitchRole
 
#define wiced_bt_dev_set_link_supervision_timeout   BTM_SetLinkSuperTout
 

Functions

void wiced_bt_dev_read_local_addr (wiced_bt_device_address_t bd_addr)
 Reads the local device address. More...
 
wiced_result_t wiced_bt_dev_vendor_specific_command (uint16_t opcode, uint8_t param_len, uint8_t *p_param_buf, wiced_bt_dev_vendor_specific_command_complete_cback_t *p_cback)
 Sends a vendor specific HCI command to the controller. More...
 
wiced_result_t wiced_bt_dev_register_connection_status_change (wiced_bt_connection_status_change_cback_t *p_wiced_bt_connection_status_change_cback)
 Registers a callback for connection status change. More...
 
wiced_result_t wiced_bt_dev_read_rssi (wiced_bt_device_address_t remote_bda, wiced_bt_transport_t transport, wiced_bt_dev_cmpl_cback_t *p_cback)
 Gets the Receive Signal Strength Index (RSSI) for the requested link. More...
 
wiced_result_t wiced_bt_dev_read_tx_power (wiced_bt_device_address_t remote_bda, wiced_bt_transport_t transport, wiced_bt_dev_cmpl_cback_t *p_cback)
 Reads the transmit power for the requested link. More...
 
void wiced_bt_dev_register_hci_trace (wiced_bt_hci_trace_cback_t *p_cback)
 Registers to get the HCI traces. More...
 
void wiced_bt_set_local_bdaddr (wiced_bt_device_address_t bda, wiced_bt_ble_address_type_t addr_type)
 Set Local Bluetooth Device Address. More...
 
wiced_result_t wiced_bt_dev_get_role (wiced_bt_device_address_t remote_bd_addr, UINT8 *p_role, wiced_bt_transport_t transport)
 Gets the role of the local device for the ACL connection with the specified remote device. More...
 
wiced_result_t BTM_SwitchRole (wiced_bt_device_address_t remote_bd_addr, uint8_t new_role, wiced_bt_dev_cmpl_cback_t *p_cb)
 Function wiced_bt_dev_switch_role. More...
 
wiced_result_t BTM_SetLinkSuperTout (wiced_bt_device_address_t remote_bd_addr, uint16_t timeout)
 Function wiced_bt_dev_set_link_supervision_timeout. More...
 
wiced_result_t wiced_bt_set_tx_power (wiced_bt_device_address_t bd_addr, INT8 power)
 Commands to set the TX power on link. More...
 
wiced_result_t wiced_bt_dev_set_tx_power_range (wiced_bt_device_address_t bd_addr, INT8 max_power, INT8 min_power)
 Command to set the TX power range on a link. More...
 
wiced_result_t wiced_bt_dev_link_quality_stats (BD_ADDR bda, wiced_bt_transport_t transport, uint8_t action, wiced_bt_dev_cmpl_cback_t *p_cback)
 Gets the statistics for an ACL link. More...
 
wiced_result_t wiced_bt_coex_enable (uint32_t seci_baud_rate)
 The application can invoke this function to enable the coex functionality. More...
 
void wiced_bt_coex_disable (void)
 The application can invoke this function to disable the coex functionality. More...
 

Detailed Description

Function Documentation

wiced_result_t BTM_SetLinkSuperTout ( wiced_bt_device_address_t  remote_bd_addr,
uint16_t  timeout 
)

Function wiced_bt_dev_set_link_supervision_timeout.

set Link Supervision Timeout

Parameters
[in]remote_bd_addr: BD address of remote device
[in]timeout:
Returns
WICED_BT_PENDING if successfully initiated, otherwise error.
wiced_result_t BTM_SwitchRole ( wiced_bt_device_address_t  remote_bd_addr,
uint8_t  new_role,
wiced_bt_dev_cmpl_cback_t p_cb 
)

Function wiced_bt_dev_switch_role.

This function is called to switch the role between central and peripheral. If role is already set it will do nothing. If the command was initiated, the callback function is called upon completion.

Parameters
[in]remote_bd_addr: BD address of remote device
[in]new_role: New role (BTM_ROLE_CENTRAL or BTM_ROLE_PERIPHERAL)
[in]p_cback: Result callback (wiced_bt_dev_switch_role_result_t will be passed to the callback)
Returns
wiced_result_t WICED_BT_SUCCESS if already in specified role. WICED_BT_CMD_STARTED if command issued to controller. WICED_BT_NO_RESOURCES if couldn't allocate memory to issue command WICED_BT_UNKNOWN_ADDR if no active link with bd addr specified WICED_BT_MODE_UNSUPPORTED if local device doesn't support role switching
void wiced_bt_coex_disable ( void  )

The application can invoke this function to disable the coex functionality.

Returns
void
wiced_result_t wiced_bt_coex_enable ( uint32_t  seci_baud_rate)

The application can invoke this function to enable the coex functionality.

Parameters
[in]seci_baud_rate- SECI baud rate. Ensure to set a valid baud rate which will be used for the SECI communication between Bluetooth and WLAN chip. The maximum supported value is up to 4M.
Returns
wiced_result_t
wiced_result_t wiced_bt_dev_get_role ( wiced_bt_device_address_t  remote_bd_addr,
UINT8 *  p_role,
wiced_bt_transport_t  transport 
)

Gets the role of the local device for the ACL connection with the specified remote device.

Parameters
[in]remote_bd_addrBD address of remote device
[in]transportBT_TRANSPORT_BR_EDR or BT_TRANSPORT_LE
[out]p_roleRole of the local device
Returns
  • WICED_BT_UNKNOWN_ADDR if no active link with BD_ADDR specified
wiced_result_t wiced_bt_dev_link_quality_stats ( BD_ADDR  bda,
wiced_bt_transport_t  transport,
uint8_t  action,
wiced_bt_dev_cmpl_cback_t p_cback 
)

Gets the statistics for an ACL link.

Parameters
[in]bdaBluetooth device address of desired link quality statistics
[in]transportBT_TRANSPORT_BR_EDR or BT_TRANSPORT_LE
[in]action
  • WICED_CLEAR_LINK_QUALITY_STATS = reset the link quality statistics to 0
  • WICED_READ_LINK_QUALITY_STATS = read link quality statistics
  • WICED_READ_THEN_CLEAR_LINK_QUALITY_STATS = read link quality stats, then clear it
[in]p_cbackResult callback
Returns
  • WICED_BT_SUCCESS: If successful
  • WICED_BT_PENDING: If command succesfully sent down
  • WICED_BT_BUSY If already in progress
  • WICED_BT_NO_RESORCES: If no memory/buffers available to sent down to controller
  • WICED_BT_UNKNOWN_ADDR: If given BD_ADDRESS is invalid
Note
Callback function argument is the pointer of type wiced_bt_lq_stats_result_t.
This API works when there is only one ACL connection.
void wiced_bt_dev_read_local_addr ( wiced_bt_device_address_t  bd_addr)

Reads the local device address.

Parameters
[out]bd_addrPointer to local BD_ADDR filled upon API call
Returns
void
wiced_result_t wiced_bt_dev_read_rssi ( wiced_bt_device_address_t  remote_bda,
wiced_bt_transport_t  transport,
wiced_bt_dev_cmpl_cback_t p_cback 
)

Gets the Receive Signal Strength Index (RSSI) for the requested link.

Parameters
[in]remote_bdaBD_ADDR of connection to read RSSI
[in]transportBT_TRANSPORT_BR_EDR or BT_TRANSPORT_LE
[in]p_cbackCallback to receive wiced_bt_dev_rssi_result_t
Returns
  • WICED_BT_PENDING if command issued to controller.
  • WICED_BT_NO_RESOURCES if couldn't allocate memory to issue command
  • WICED_BT_UNKNOWN_ADDR if no active link with bd addr specified
  • WICED_BT_BUSY if command is already in progress
wiced_result_t wiced_bt_dev_read_tx_power ( wiced_bt_device_address_t  remote_bda,
wiced_bt_transport_t  transport,
wiced_bt_dev_cmpl_cback_t p_cback 
)

Reads the transmit power for the requested link.

Parameters
[in]remote_bdaBD address of connection to read TX power
[in]transportBT_TRANSPORT_BR_EDR or BT_TRANSPORT_LE
[in]p_cbackCallback, which will receive wiced_bt_tx_power_result_t
Returns
  • WICED_BT_PENDING if command issued to controller.
  • WICED_BT_NO_RESOURCES if couldn't allocate memory to issue command
  • WICED_BT_UNKNOWN_ADDR if no active link with bd addr specified
  • WICED_BT_BUSY if command is already in progress.
wiced_result_t wiced_bt_dev_register_connection_status_change ( wiced_bt_connection_status_change_cback_t p_wiced_bt_connection_status_change_cback)

Registers a callback for connection status change.

Parameters
[in]p_wiced_bt_connection_status_change_cback
Returns
wiced_result_t
  • WICED_BT_SUCCESS : on success;
  • WICED_BT_FAILED : if an error occurred
void wiced_bt_dev_register_hci_trace ( wiced_bt_hci_trace_cback_t p_cback)

Registers to get the HCI traces.

Parameters
[in]p_cbackCallback for HCI traces
Returns
void
wiced_result_t wiced_bt_dev_set_tx_power_range ( wiced_bt_device_address_t  bd_addr,
INT8  max_power,
INT8  min_power 
)

Command to set the TX power range on a link.

Parameters
[in]bd_addrpeer address of the link
[in]max_powerMax power value in db (Must be <= 4)
[in]min_powerMin power value in db (Must be >= -24)
Returns
wiced_result_t
wiced_result_t wiced_bt_dev_vendor_specific_command ( uint16_t  opcode,
uint8_t  param_len,
uint8_t *  p_param_buf,
wiced_bt_dev_vendor_specific_command_complete_cback_t p_cback 
)

Sends a vendor specific HCI command to the controller.

Parameters
[in]opcodeOpcode of vendor specific command
[in]param_lenLength of parameter buffer
[in]p_param_bufParameters
[in]p_cbackCallback for command complete
Returns
  • WICED_BT_SUCCESS Command sent. (command complete callback param is NULL)
  • WICED_BT_PENDING Command sent. Waiting for command complete event.
  • WICED_BT_BUSY Command not sent. Waiting for command complete event for prior command.
void wiced_bt_set_local_bdaddr ( wiced_bt_device_address_t  bda,
wiced_bt_ble_address_type_t  addr_type 
)

Set Local Bluetooth Device Address.

If the application passes BLE_ADDR_RANDOM as an address type, the stack will setup a static random address. For the static random address, the top two bits of the bd_addr should be set. The stack will enforce that.

Parameters
[in]bd_addrnew BD_ADDR to set
[in]addr_type
  • BLE_ADDR_RANDOM (only for LE, not BR/EDR or dual mode)
  • BLE_ADDR_PUBLIC
Returns
void
wiced_result_t wiced_bt_set_tx_power ( wiced_bt_device_address_t  bd_addr,
INT8  power 
)

Commands to set the TX power on link.

Parameters
[in]bd_addrpeer address
[in]powerpower value in db
Returns
wiced_result_t