This section provides functions for LE advertisement and LE scan operations.
|
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...
|
|
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...
|
|
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...
|
|
◆ wiced_bt_start_advertisements()
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.
- Note
- 1. Steps for undirected ADVs viz., BTM_BLE_ADVERT_UNDIRECTED_HIGH, BTM_BLE_ADVERT_UNDIRECTED_LOW, and non connectable advs viz., BTM_BLE_ADVERT_NONCONN_HIGH, BTM_BLE_ADVERT_NONCONN_LOW a) Set ADV data b) Set Scan Response data if adv type is scannable
-
2. if adv type is set to Directed then the stack resets any advertisement data which was set for an earlier advertisement. To attempt an UNDIRECTED_ADV after a DIRECTED_ADV, refer to instructions in note 1.
The advert_mode parameter determines what advertising parameters and durations to use (as specified by the application configuration).
- Parameters
-
[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) |
- Returns
- status
◆ wiced_bt_ble_get_current_advert_mode()
◆ wiced_bt_ble_set_raw_advertisement_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
- Parameters
-
[in] | num_elem | : number of ADV data element |
[in] | p_data | : advertisement raw data |
- Returns
- wiced_result_t
◆ wiced_btm_ble_update_advertisement_filter_policy()
Update the filter policy of advertiser.
- Parameters
-
[in] | advertising_policy | advertising filter policy |
- Returns
- TRUE if successful
◆ wiced_bt_ble_set_adv_tx_power()
Command to set LE Advertisement tx power.
- Parameters
-
- Returns
- wiced_result_t WICED_BT_PENDING if callback is not NULL. WICED_BT_SUCCESS if callback is NULL
◆ wiced_bt_ble_read_adv_tx_power()
Read LE Advertisement transmit power.
- Note
- : This API can be used to get Tx power for Legacy advertisements. It will return an error if the application is using Extended Advertisements. See Bluetool Core spec 5.2, Vol 4, Part E, section 3.1.1 Legacy and extended advertising
- Parameters
-
- Returns
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_ble_set_raw_scan_response_data()
Set scan response raw data.
- Parameters
-
[in] | num_elem | : number of scan response data elements |
[in] | p_data | : scan response raw data |
- Returns
- status of the operation
◆ wiced_bt_ble_observe()
◆ wiced_bt_ble_scan()
◆ wiced_bt_ble_get_current_scan_state()
Get current scan state.
- Returns
- wiced_bt_ble_scan_type_t
BTM_BLE_SCAN_TYPE_NONE Not scanning
BTM_BLE_SCAN_TYPE_HIGH_DUTY High duty cycle scan
BTM_BLE_SCAN_TYPE_LOW_DUTY Low duty cycle scan
◆ wiced_bt_ble_update_scanner_filter_policy()
Update the filter policy of scanning.
- Parameters
-
[in] | scanner_policy | scanning filter policy |
- Returns
- void
◆ wiced_bt_ble_check_advertising_data()
Parse advertising data (returned from scan results callback wiced_bt_ble_scan_result_cback_t).
- Note
- This function cannot be used for scan results received from wiced_ble_ext_scan_result_cback_t Look for specified advertisement data type.
- Parameters
-
[in] | p_adv | : pointer to advertisement data |
[in] | type | : advertisement data type to look for |
[out] | p_length | : length of advertisement data (if found) |
- Returns
- pointer to start of requested advertisement data (if found). NULL if requested data type not found.