Bluetooth Host Stack Library
LE Legacy Mode Advertising and Scanning

General Description

This section contains the legacy mode advertisement and scanning defines, structures and functions.

Note
Applications should invoke functions in this section if and only if the application wishes to use only legacy mode for advertisement and scanning

API Reference

 Advertisement & Scan
 This section provides functions for LE advertisement and LE scan operations.
 
 MultiAdv
 This section describes Multiple Advertisement API, using this interface application can enable more than one advertisement train.
 

Data Structures

struct  wiced_bt_ble_scan_results_t
 LE inquiry result type. More...
 
struct  wiced_bt_ble_multi_adv_params_t
 LE Multi advertising parameter. More...
 

Macros

#define BTM_BLE_LEGACY_AD_DATA_LEN   31
 Max legacy advertisement data len.
 
#define MULTI_ADV_TX_POWER_MIN_INDEX   0
 Multi adv tx min power index.
 
#define MULTI_ADV_TX_POWER_MAX_INDEX   4
 Multi adv tx max power index.
 

Typedefs

typedef uint8_t wiced_bt_ble_scanner_filter_policy_t
 LE Scanner filter policy (see wiced_bt_ble_scanner_filter_policy_e)
 
typedef uint8_t wiced_bt_dev_ble_evt_type_t
 Scan result event value (see wiced_bt_dev_ble_evt_type_e)
 
typedef int8_t wiced_bt_ble_adv_tx_power_t
 Transmit Power in dBm ( MULTI_ADV_TX_POWER_MIN_INDEX to MULTI_ADV_TX_POWER_MAX_INDEX )
 
typedef uint8_t wiced_bt_ble_multi_advert_type_t
 LE advertisement type (see wiced_bt_ble_multi_advert_type_e)
 
typedef uint8_t wiced_bt_ble_multi_advert_filtering_policy_t
 LE advertisement filtering policy (see wiced_bt_ble_multi_advert_filtering_policy_e)
 
typedef void() wiced_bt_ble_scan_result_cback_t(wiced_bt_ble_scan_results_t *p_scan_result, uint8_t *p_adv_data)
 Callback to receive legacy scan results. More...
 

Enumerations

enum  wiced_bt_ble_scanner_filter_policy_e {
  BTM_BLE_SCAN_POLICY_ACCEPT_ADV_RSP,
  BTM_BLE_SCAN_POLICY_FILTER_ADV_RSP,
  BTM_BLE_SCAN_POLICY_ACCEPT_RPA_DIR_ADV_RSP,
  BTM_BLE_SCAN_POLICY_FILTER_RPA_DIR_ADV_RSP,
  BTM_BLE_SCAN_POLICY_MAX
}
 Scanner filter policy. More...
 
enum  wiced_bt_dev_ble_evt_type_e {
  BTM_BLE_EVT_CONNECTABLE_ADVERTISEMENT = 0x00,
  BTM_BLE_EVT_CONNECTABLE_DIRECTED_ADVERTISEMENT = 0x01,
  BTM_BLE_EVT_SCANNABLE_ADVERTISEMENT = 0x02,
  BTM_BLE_EVT_NON_CONNECTABLE_ADVERTISEMENT = 0x03,
  BTM_BLE_EVT_SCAN_RSP = 0x04
}
 Scan result event type. More...
 
enum  wiced_bt_ble_multi_advert_start_e {
  MULTI_ADVERT_STOP = 0x00,
  MULTI_ADVERT_START = 0x01
}
 Multi-advertisement start/stop. More...
 
enum  wiced_bt_ble_multi_advert_type_e {
  MULTI_ADVERT_CONNECTABLE_UNDIRECT_EVENT = 0x00,
  MULTI_ADVERT_CONNECTABLE_DIRECT_EVENT = 0x01,
  MULTI_ADVERT_DISCOVERABLE_EVENT = 0x02,
  MULTI_ADVERT_NONCONNECTABLE_EVENT = 0x03,
  MULTI_ADVERT_LOW_DUTY_CYCLE_DIRECT_EVENT = 0x04
}
 Multi-advertisement type. More...
 
enum  wiced_bt_ble_multi_advert_filtering_policy_e {
  MULTI_ADVERT_FILTER_POLICY_NOT_USED = 0x00,
  MULTI_ADVERT_FILTER_POLICY_ADV_ALLOW_UNKNOWN_CONNECTION,
  MULTI_ADVERT_FILTER_POLICY_ADV_ALLOW_UNKNOWN_SCANNING,
  MULTI_ADVERT_FILTER_POLICY_USE_FOR_ALL = 0x03
}
 Multi-advertisement Filtering policy. More...
 

Functions

wiced_bt_dev_status_t wiced_bt_ble_set_legacy_adv_data (uint16_t data_len, uint8_t *p_data)
 Sends HCI command to write the legacy adv data. More...
 

Typedef Documentation

◆ wiced_bt_ble_scan_result_cback_t

typedef void() wiced_bt_ble_scan_result_cback_t(wiced_bt_ble_scan_results_t *p_scan_result, uint8_t *p_adv_data)

Callback to receive legacy scan results.

Scan result callback (from calling wiced_bt_ble_scan)

Parameters
p_scan_result: scan result data (NULL indicates end of scanning)
p_adv_data: Advertisement data (parse using wiced_bt_ble_check_advertising_data)
Returns
Nothing

Enumeration Type Documentation

◆ wiced_bt_ble_scanner_filter_policy_e

Scanner filter policy.

Enumerator
BTM_BLE_SCAN_POLICY_ACCEPT_ADV_RSP 

accept adv packet from all, directed adv pkt not directed to local device is ignored

BTM_BLE_SCAN_POLICY_FILTER_ADV_RSP 

accept adv packet from device in filter Accept List, directed adv packet not directed to local device is ignored

BTM_BLE_SCAN_POLICY_ACCEPT_RPA_DIR_ADV_RSP 

accept adv packet from all, directed adv pkt not directed to local device is ignored except direct adv with RPA

BTM_BLE_SCAN_POLICY_FILTER_RPA_DIR_ADV_RSP 

accept adv packet from device in filter Accept List, directed adv pkt not directed to me is ignored except direct adv with RPA

BTM_BLE_SCAN_POLICY_MAX 

Max Scan filter policy value.

◆ wiced_bt_dev_ble_evt_type_e

Scan result event type.

Enumerator
BTM_BLE_EVT_CONNECTABLE_ADVERTISEMENT 

Connectable advertisement.

BTM_BLE_EVT_CONNECTABLE_DIRECTED_ADVERTISEMENT 

Connectable Directed advertisement.

BTM_BLE_EVT_SCANNABLE_ADVERTISEMENT 

Scannable advertisement.

BTM_BLE_EVT_NON_CONNECTABLE_ADVERTISEMENT 

Non connectable advertisement.

BTM_BLE_EVT_SCAN_RSP 

Scan response.

◆ wiced_bt_ble_multi_advert_start_e

Multi-advertisement start/stop.

Enumerator
MULTI_ADVERT_STOP 

Stop Multi-adverstisment.

MULTI_ADVERT_START 

Start Multi-adverstisment.

◆ wiced_bt_ble_multi_advert_type_e

Multi-advertisement type.

Enumerator
MULTI_ADVERT_CONNECTABLE_UNDIRECT_EVENT 

Multi adv Connectable undirected event.

MULTI_ADVERT_CONNECTABLE_DIRECT_EVENT 

Multi adv Connectable directed event.

MULTI_ADVERT_DISCOVERABLE_EVENT 

Multi adv Discoverable event.

MULTI_ADVERT_NONCONNECTABLE_EVENT 

Multi adv NonConnectable event.

MULTI_ADVERT_LOW_DUTY_CYCLE_DIRECT_EVENT 

Multi adv Low Cycle directed event.

◆ wiced_bt_ble_multi_advert_filtering_policy_e

Multi-advertisement Filtering policy.

Enumerator
MULTI_ADVERT_FILTER_POLICY_NOT_USED 

Multi adv filter filter Accept List not used.

MULTI_ADVERT_FILTER_POLICY_ADV_ALLOW_UNKNOWN_CONNECTION 

Multi adv filter filter Accept List for scan request.

MULTI_ADVERT_FILTER_POLICY_ADV_ALLOW_UNKNOWN_SCANNING 

Multi adv filter filter Accept List for connection request.

MULTI_ADVERT_FILTER_POLICY_USE_FOR_ALL 

Multi adv filter filter Accept List for all.

Function Documentation

◆ wiced_bt_ble_set_legacy_adv_data()

wiced_bt_dev_status_t wiced_bt_ble_set_legacy_adv_data ( uint16_t  data_len,
uint8_t *  p_data 
)

Sends HCI command to write the legacy adv data.

Note
This API allows sending data formatted with wiced_ble_adv_data_build
Parameters
[in]data_len- length of the adv data to use, max size 31 bytes
[in]p_data- pointer to the adv data to use
Returns
wiced_bt_dev_status_t WICED_BT_SUCCESS : If all extended adv data set successfully
WICED_BT_ILLEGAL_VALUE : If paramer is wrong
WICED_BT_UNSUPPORTED : If command not supported
WICED_BT_NO_RESOURCES : If no memory to issue the command
WICED_BT_PENDING : If command queued to send down