This sections provides Bluetooth utilities functions related to trace, local bda, tx power etc.
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... | |
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... | |
wiced_bool_t | wiced_bt_dev_bdaddr_is_local (wiced_bt_device_address_t bd_addr) |
Verify if the given bd_addr matches with the local bd_addr. More... | |
wiced_bool_t | wiced_bt_dev_bdaddr_is_same (wiced_bt_device_address_t bd_addr_1, wiced_bt_device_address_t bd_addr_2) |
Compare two BD address. More... | |
wiced_bool_t | wiced_bt_dev_is_address_resolution_enabled (void) |
Is controller address resolution enabled. More... | |
wiced_bool_t | wiced_bt_dev_is_privacy_supported (void) |
Is device privacy supported. More... | |
void | wiced_bt_dev_set_no_smp_on_br (wiced_bool_t mode) |
This function turns OFF/ON SMP over BR/EDR (i.e. 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_set_transmit_power_range (wiced_bt_device_address_t bd_addr, int8_t max_tx_power, int8_t min_tx_power, wiced_bt_dev_vendor_specific_command_complete_cback_t *p_cb) |
Command to set the range of transmit power on the link This command will set minimum and maximum values for transmit power 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_dev_register_hci_trace | ( | wiced_bt_hci_trace_cback_t * | p_cback | ) |
Register to get the hci traces.
[in] | p_cback | : Callback for hci traces |
void wiced_bt_dev_update_hci_trace_mode | ( | wiced_bool_t | enable | ) |
Update the hci trace mode.
[in] | enable | : TRUE to enable HCI traces, FALSE to disable |
void wiced_bt_dev_update_debug_trace_mode | ( | wiced_bool_t | enable | ) |
Update the debug trace mode.
[in] | enable | : TRUE to enable debug traces, FALSE to disable |
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(Bluetooth 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.
[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. |
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
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
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.
[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 |
void wiced_bt_set_pairable_mode | ( | uint8_t | allow_pairing, |
uint8_t | connect_only_paired | ||
) |
Enable or disable pairing.
[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 |
wiced_result_t wiced_bt_dev_register_vse_callback | ( | wiced_bt_dev_vse_callback_t | cb | ) |
Application can register Vendor-Specific HCI event callback.
[in] | cb | : callback function to register |
wiced_result_t wiced_bt_dev_deregister_vse_callback | ( | wiced_bt_dev_vse_callback_t | cb | ) |
Application can deregister Vendor-Specific HCI event callback.
[in] | cb | : callback function to deregister |
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
[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) |
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
wiced_bool_t wiced_bt_dev_bdaddr_is_local | ( | wiced_bt_device_address_t | bd_addr | ) |
Verify if the given bd_addr matches with the local bd_addr.
[in] | bd_addr | : remote bd address |
wiced_bool_t wiced_bt_dev_bdaddr_is_same | ( | wiced_bt_device_address_t | bd_addr_1, |
wiced_bt_device_address_t | bd_addr_2 | ||
) |
Compare two BD address.
[in] | bd_addr_1 | : bd address |
[in] | bd_addr_2 | : bd address to be compared with bd_addr_1 |
Returns TRUE if both bd_addr are same, FALSE if different
wiced_bool_t wiced_bt_dev_is_address_resolution_enabled | ( | void | ) |
Is controller address resolution enabled.
Returns TRUE if enabled
wiced_bool_t wiced_bt_dev_is_privacy_supported | ( | void | ) |
Is device privacy supported.
Returns TRUE if supported
void wiced_bt_dev_set_no_smp_on_br | ( | wiced_bool_t | mode | ) |
This function turns OFF/ON SMP over BR/EDR (i.e.
link keys crosspairing SC BR/EDR->SC LE) for the remote device. If mode is set to TRUE then the crosspairing will not happen.
[in] | mode | : Set to TRUE to disable support for smp on br. |
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.
[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) |
wiced_result_t wiced_bt_set_transmit_power_range | ( | wiced_bt_device_address_t | bd_addr, |
int8_t | max_tx_power, | ||
int8_t | min_tx_power, | ||
wiced_bt_dev_vendor_specific_command_complete_cback_t * | p_cb | ||
) |
Command to set the range of transmit power on the link This command will set minimum and maximum values for transmit power on a per connection basis.
[in] | bd_addr | : peer address of device |
[in] | max_tx_power | : maximum power value in db |
[in] | min_tx_power | : minimum power value in db |
[in] | p_cb | : Result callback (wiced_bt_set_transmit_power_range_result_t will be passed to the callback) |
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.
[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) |
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