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

Utilities Functions. More...

Functions

void wiced_bt_dev_register_hci_trace (wiced_bt_hci_trace_cback_t *p_cback)
 Register to get the hci traces. More...
 
void wiced_bt_dev_update_hci_trace_mode (wiced_bool_t enable)
 Update the hci trace mode. More...
 
void wiced_bt_dev_update_debug_trace_mode (wiced_bool_t enable)
 Update the debug trace mode. More...
 
wiced_result_t wiced_bt_set_local_bdaddr (wiced_bt_device_address_t bd_addr, 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, wiced_bt_dev_role_t *p_role, wiced_bt_transport_t transport)
 This function is called to get the role of the local device for the ACL connection with the specified remote device. More...
 
wiced_result_t wiced_bt_set_tx_power (wiced_bt_device_address_t bd_addr, int8_t power, wiced_bt_dev_vendor_specific_command_complete_cback_t *p_cb)
 Command to set the tx power on link This command will adjust the transmit power attenuation on a per connection basis. 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)
 Read the transmit power for the requested link. More...
 
void wiced_bt_set_pairable_mode (uint8_t allow_pairing, uint8_t connect_only_paired)
 Enable or disable pairing. More...
 
wiced_result_t wiced_bt_dev_register_vse_callback (wiced_bt_dev_vse_callback_t cb)
 Application can register Vendor-Specific HCI event callback. More...
 
wiced_result_t wiced_bt_dev_deregister_vse_callback (wiced_bt_dev_vse_callback_t cb)
 Application can deregister Vendor-Specific HCI event callback. More...
 
wiced_bt_dev_status_t wiced_bt_dev_link_quality_stats (wiced_bt_device_address_t bda, wiced_bt_transport_t transport, uint8_t action, wiced_bt_dev_cmpl_cback_t *p_cback)
 This API is called to get the statistics for an ACL link. More...
 

Detailed Description

Utilities Functions.

Function Documentation

wiced_result_t wiced_bt_dev_deregister_vse_callback ( wiced_bt_dev_vse_callback_t  cb)

Application can deregister Vendor-Specific HCI event callback.

Parameters
[in]cb: callback function to deregister
Returns
WICED_SUCCESS WICED_ERROR if the input callback function was not registered yet
wiced_result_t wiced_bt_dev_get_role ( wiced_bt_device_address_t  remote_bd_addr,
wiced_bt_dev_role_t *  p_role,
wiced_bt_transport_t  transport 
)

This function is called to get the role of the local device for the ACL connection with the specified remote device.

Parameters
[in]remote_bd_addr: BD address of remote device
[in]transport: BT_TRANSPORT_BR_EDR or BT_TRANSPORT_LE
[out]p_role: Role of the local device
Returns
WICED_BT_UNKNOWN_ADDR if no active link with bd addr specified
wiced_bt_dev_status_t wiced_bt_dev_link_quality_stats ( wiced_bt_device_address_t  bda,
wiced_bt_transport_t  transport,
uint8_t  action,
wiced_bt_dev_cmpl_cback_t p_cback 
)

This API is called to get the statistics for an ACL link.

Limitation This API works when there is only one ACL connection

Parameters
[in]bda: bluetooth device address of desired link quality statistics
[in]transport: Tranport type LE/BR-EDR
[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 statistics, then clear it
[in]p_cback: Result callback (wiced_bt_dev_cmpl_cback_t will be passed to the 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 a pointer of type wiced_bt_lq_stats_result_t
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 
)

Read the transmit power for the requested link.

Parameters
[in]remote_bda: BD address of connection to read tx power
[in]transport: Transport type
[in]p_cback: Result callback (wiced_bt_tx_power_result_t will be passed to the callback)
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

void wiced_bt_dev_register_hci_trace ( wiced_bt_hci_trace_cback_t p_cback)

Register to get the hci traces.

Parameters
[in]p_cback: Callback for hci traces
Returns
void
wiced_result_t wiced_bt_dev_register_vse_callback ( wiced_bt_dev_vse_callback_t  cb)

Application can register Vendor-Specific HCI event callback.

Parameters
[in]cb: callback function to register
Returns
WICED_SUCCESS WICED_ERROR if out of usage
void wiced_bt_dev_update_debug_trace_mode ( wiced_bool_t  enable)

Update the debug trace mode.

Parameters
[in]enable: TRUE to enable debug traces, FALSE to disable
Returns
void
void wiced_bt_dev_update_hci_trace_mode ( wiced_bool_t  enable)

Update the hci trace mode.

Parameters
[in]enable: TRUE to enable HCI traces, FALSE to disable
Returns
void
wiced_result_t wiced_bt_set_local_bdaddr ( wiced_bt_device_address_t  bd_addr,
wiced_bt_ble_address_type_t  addr_type 
)

Set Local Bluetooth Device Address.

The application has to set a valid address (Static/Random) by calling this function.
If this function is not called, the default address is typically a controller assigned address(BT device part number), which is same for perticular device type.For example, all CYW43012 devcies will typically have the same default address.

The application can set a static random address by setting the addr_type to BLE_ADDR_RANDOM. For static random addresses the top two bits of the bd_addr are required to be set, the stack will override these bits if not set. The remaining 46 bits will be taken from the value provided for bd_addr,
which cannot be all 0's.

Parameters
[in]bd_addr: device address to use
[in]addr_type: device address type , should be BLE_ADDR_RANDOM or BLE_ADDR_PUBLIC
BLE_ADDR_RANDOM should be only for single LE mode, not for BR-EDR or Dual Mode.
Returns
wiced_result_t

WICED_BT_ILLEGAL_VALUE : if invalid device address specified
WICED_BT_NO_RESOURCES : if couldn't allocate memory to issue command
WICED_BT_SUCCESS : if local bdaddr is set successfully

Note
BD_Address must be in Big Endian format

Example:

    Data         | AB | CD | EF | 01 | 23 | 45 | 
    Address      | 0  | 1  | 2  | 3  | 4  | 5  | 

For above example it will set AB:CD:EF:01:23:45 bd address

void wiced_bt_set_pairable_mode ( uint8_t  allow_pairing,
uint8_t  connect_only_paired 
)

Enable or disable pairing.

Parameters
[in]allow_pairing: (TRUE or FALSE) whether or not the device allows pairing.
[in]connect_only_paired: (TRUE or FALSE) whether or not to only allow paired devices to connect. Applicable only for BR/EDR
Returns
void
wiced_result_t wiced_bt_set_tx_power ( wiced_bt_device_address_t  bd_addr,
int8_t  power,
wiced_bt_dev_vendor_specific_command_complete_cback_t p_cb 
)

Command to set the tx power on link This command will adjust the transmit power attenuation on a per connection basis.

Parameters
[in]bd_addr: peer address To set Adv Tx power keep bd_addr NULL
[in]power: power value in db
[in]p_cb: Result callback (wiced_bt_set_adv_tx_power_result_t will be passed to the callback)
Returns
wiced_result_t