This section provides functions for LE advertisement and LE scan operations.
Functions | |
wiced_result_t | wiced_bt_start_advertisements (wiced_bt_ble_advert_mode_t advert_mode, wiced_bt_ble_address_type_t directed_advertisement_bdaddr_type, wiced_bt_device_address_ptr_t directed_advertisement_bdaddr_ptr) |
Start advertising. More... | |
wiced_bt_ble_advert_mode_t | wiced_bt_ble_get_current_advert_mode (void) |
Get current advertising mode. More... | |
wiced_result_t | wiced_bt_ble_set_raw_advertisement_data (uint8_t num_elem, wiced_bt_ble_advert_elem_t *p_data) |
Set advertisement raw data to the controller. More... | |
int | wiced_bt_ble_build_raw_advertisement_data (uint8_t *p_adv, int adv_len, wiced_bt_ble_advert_type_t adv_type, uint8_t *p_type_data, uint16_t type_len) |
Write advertisement raw data to application buffer. More... | |
uint8_t * | wiced_bt_ble_check_advertising_data (uint8_t *p_adv, wiced_bt_ble_advert_type_t type, uint8_t *p_length) |
Parse advertising data (returned from scan results callback wiced_bt_ble_scan_result_cback_t). More... | |
uint8_t * | wiced_bt_ble_get_next_adv_entry (uint8_t *p_adv, int *p_offset, wiced_bt_ble_advert_type_t type, uint8_t *p_length) |
When multiple entry for same adv type is available in the adv data this api will help to get next entry of specified advertisement data type when there is a single instance use wiced_bt_ble_check_advertising_data. More... | |
wiced_bool_t | wiced_btm_ble_update_advertisement_filter_policy (wiced_bt_ble_advert_filter_policy_t advertising_policy) |
Update the filter policy of advertiser. More... | |
wiced_result_t | wiced_bt_ble_set_adv_tx_power (int8_t power, wiced_bt_dev_vendor_specific_command_complete_cback_t *p_cb) |
Command to set LE Advertisement tx power. More... | |
wiced_result_t | wiced_bt_ble_read_adv_tx_power (wiced_bt_dev_cmpl_cback_t *p_cback) |
Read LE Advertisement transmit power. More... | |
wiced_bt_dev_status_t | wiced_bt_ble_set_raw_scan_response_data (uint8_t num_elem, wiced_bt_ble_advert_elem_t *p_data) |
Set scan response raw data. More... | |
wiced_bt_dev_status_t | wiced_bt_ble_observe (wiced_bool_t start, uint8_t duration, wiced_bt_ble_scan_result_cback_t *p_scan_result_cback) |
This function makes the device start or stop operating in the observer role. More... | |
wiced_result_t | wiced_bt_ble_scan (wiced_bt_ble_scan_type_t scan_type, wiced_bool_t duplicate_filter_enable, wiced_bt_ble_scan_result_cback_t *p_scan_result_cback) |
Start LE scanning. More... | |
wiced_bt_ble_scan_type_t | wiced_bt_ble_get_current_scan_state (void) |
Get current scan state. More... | |
void | wiced_bt_ble_update_scanner_filter_policy (wiced_bt_ble_scanner_filter_policy_t scanner_policy) |
Update the filter policy of scanning. More... | |
wiced_result_t wiced_bt_start_advertisements | ( | wiced_bt_ble_advert_mode_t | advert_mode, |
wiced_bt_ble_address_type_t | directed_advertisement_bdaddr_type, | ||
wiced_bt_device_address_ptr_t | directed_advertisement_bdaddr_ptr | ||
) |
Start advertising.
Use wiced_bt_ble_set_raw_advertisement_data to configure advertising data prior to starting avertisements. The advertisements are stopped upon successful LE connection establishment.
The advert_mode parameter determines what advertising parameters and durations to use (as specified by the application configuration).
[in] | advert_mode | : advertisement mode |
[in] | directed_advertisement_bdaddr_type | : BLE_ADDR_PUBLIC or BLE_ADDR_RANDOM (if using directed advertisement mode) |
[in] | directed_advertisement_bdaddr_ptr | : Directed advertisement address (NULL if not using directed advertisement) |
wiced_bt_ble_advert_mode_t wiced_bt_ble_get_current_advert_mode | ( | void | ) |
Get current advertising mode.
wiced_result_t wiced_bt_ble_set_raw_advertisement_data | ( | uint8_t | num_elem, |
wiced_bt_ble_advert_elem_t * | p_data | ||
) |
Set advertisement raw data to the controller.
Application can invoke wiced_bt_start_advertisements after setting the adv data. Max length of the advertising data to be set is 31 bytes. API returns an error if the length of data being set exceeds 31 bytes
[in] | num_elem | : number of ADV data element |
[in] | p_data | : advertisement raw data |
int wiced_bt_ble_build_raw_advertisement_data | ( | uint8_t * | p_adv, |
int | adv_len, | ||
wiced_bt_ble_advert_type_t | adv_type, | ||
uint8_t * | p_type_data, | ||
uint16_t | type_len | ||
) |
Write advertisement raw data to application buffer.
[in] | p_adv | : buffer pointer at which the raw data in p_type_data is to be written |
[in] | adv_len | : length of the buffer pointer pointed to by p_adv , should be atleast (2 + type_len ) for a successful write operation |
[in] | adv_type | adveritsement type |
[in] | p_type_data | advertisement data of adv_type |
[in] | type_len | : length of advertisement data at p_type_data of adv_type |
p_adv
buffer written. uint8_t* wiced_bt_ble_check_advertising_data | ( | uint8_t * | p_adv, |
wiced_bt_ble_advert_type_t | type, | ||
uint8_t * | p_length | ||
) |
Parse advertising data (returned from scan results callback wiced_bt_ble_scan_result_cback_t).
Look for specified advertisement data type.
[in] | p_adv | : pointer to advertisement data |
[in] | type | : advertisement data type to look for |
[out] | p_length | : length of advertisement data (if found) |
uint8_t* wiced_bt_ble_get_next_adv_entry | ( | uint8_t * | p_adv, |
int * | p_offset, | ||
wiced_bt_ble_advert_type_t | type, | ||
uint8_t * | p_length | ||
) |
When multiple entry for same adv type is available in the adv data this api will help to get next entry of specified advertisement data type when there is a single instance use wiced_bt_ble_check_advertising_data.
[in] | p_adv | : pointer to advertisement data |
[in] | p_offset | : offset from the start of the adv data recevied, also returns next offset to start searching from |
[in] | type | : advertisement data type to look for |
[out] | p_length | : length of advertisement data (if found) |
wiced_bool_t wiced_btm_ble_update_advertisement_filter_policy | ( | wiced_bt_ble_advert_filter_policy_t | advertising_policy | ) |
Update the filter policy of advertiser.
[in] | advertising_policy | advertising filter policy |
wiced_result_t wiced_bt_ble_set_adv_tx_power | ( | int8_t | power, |
wiced_bt_dev_vendor_specific_command_complete_cback_t * | p_cb | ||
) |
Command to set LE Advertisement tx power.
[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_ble_read_adv_tx_power | ( | wiced_bt_dev_cmpl_cback_t * | p_cback | ) |
Read LE Advertisement transmit power.
[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_BUSY if command is already in progress WICED_BT_ILLEGAL_VALUE if the callback is NULL
wiced_bt_dev_status_t wiced_bt_ble_set_raw_scan_response_data | ( | uint8_t | num_elem, |
wiced_bt_ble_advert_elem_t * | p_data | ||
) |
Set scan response raw data.
[in] | num_elem | : number of scan response data elements |
[in] | p_data | : scan response raw data |
wiced_bt_dev_status_t wiced_bt_ble_observe | ( | wiced_bool_t | start, |
uint8_t | duration, | ||
wiced_bt_ble_scan_result_cback_t * | p_scan_result_cback | ||
) |
This function makes the device start or stop operating in the observer role.
The observer role device receives advertising events from a broadcast device.
[in] | start | : TRUE to start the observer role |
[in] | duration | : the duration for the observer role |
[in] | p_scan_result_cback | : scan result callback |
wiced_result_t wiced_bt_ble_scan | ( | wiced_bt_ble_scan_type_t | scan_type, |
wiced_bool_t | duplicate_filter_enable, | ||
wiced_bt_ble_scan_result_cback_t * | p_scan_result_cback | ||
) |
Start LE scanning.
The scan_type parameter determines what scanning parameters and durations to use (as specified by the application configuration).
Scan results are notified using p_scan_result_cback
[in] | scan_type | : BTM_BLE_SCAN_TYPE_NONE, BTM_BLE_SCAN_TYPE_HIGH_DUTY, BTM_BLE_SCAN_TYPE_LOW_DUTY |
[in] | duplicate_filter_enable | : TRUE or FALSE to enable or disable duplicate filtering |
[in] | p_scan_result_cback | : scan result callback |
wiced_bt_ble_scan_type_t wiced_bt_ble_get_current_scan_state | ( | void | ) |
Get current scan state.
void wiced_bt_ble_update_scanner_filter_policy | ( | wiced_bt_ble_scanner_filter_policy_t | scanner_policy | ) |
Update the filter policy of scanning.
[in] | scanner_policy | scanning filter policy |