Bluetooth Host Stack Library
Common LE Advertisement, Scan and Connection defines

General Description

This section contains some of the common defines and structures used for LE advertising, scanning, and link connection management.

Data Structures

struct  wiced_bt_adv_ctx_t
 Advertisement report context for the call to get offset and length of the searched adv type wiced_bt_ble_advert_type_t. More...
 
struct  wiced_bt_ble_advert_elem_t
 Advertisement element. More...
 

Macros

#define BTM_BLE_DEFAULT_ADVERT_CHNL_MAP   (BTM_BLE_ADVERT_CHNL_37 | BTM_BLE_ADVERT_CHNL_38 | BTM_BLE_ADVERT_CHNL_39)
 default advertising channel map
 
#define BTM_BLE_ADVERT_FILTER_DEFAULT   BTM_BLE_ADV_POLICY_ACCEPT_CONN_AND_SCAN
 default advertising filter policy
 
#define BTM_BLE_ADVERT_INTERVAL_MIN   0x0020
 adv parameter Min value
 
#define BTM_BLE_ADVERT_INTERVAL_MAX   0x4000
 adv parameter Max value
 
#define BTM_BLE_SCAN_INTERVAL_MIN   0x0004
 Scan interval minimum value.
 
#define BTM_BLE_SCAN_INTERVAL_MAX   0x4000
 Scan interval miximum value.
 
#define BTM_BLE_SCAN_WINDOW_MIN   0x0004
 Scan window minimum value.
 
#define BTM_BLE_SCAN_WINDOW_MAX   0x4000
 Scan window maximum value.
 
#define BTM_BLE_CONN_INTERVAL_MIN   0x0006
 Connection interval minimum value.
 
#define BTM_BLE_CONN_INTERVAL_MAX   0x0C80
 Connection interval maximum value.
 
#define BTM_BLE_CONN_LATENCY_MAX   500
 Maximum Connection Latency.
 
#define BTM_BLE_CONN_SUP_TOUT_MIN   0x000A
 Minimum Supervision Timeout.
 
#define BTM_BLE_CONN_SUP_TOUT_MAX   0x0C80
 Maximum Supervision Timeout.
 
#define BTM_BLE_CONN_PARAM_UNDEF   0xffff
 use this value when a specific value not to be overwritten
 
#define BTM_BLE_CONN_SUP_TOUT_DEF   700
 Default Supervision Timeout.
 
#define BTM_BLE_SCAN_FAST_INTERVAL   96
 default scan interval 30 ~ 60 ms (use 60) = 96 *0.625
 
#define BTM_BLE_SCAN_FAST_WINDOW   48
 default scan window (in .625ms slots) for background auto connections 30 ms = 48 *0.625
 
#define BTM_BLE_SCAN_SLOW_INTERVAL_1   2048
 default scan interval used in reduced power cycle (background scanning) 1.28 s = 2048 *0.625
 
#define BTM_BLE_SCAN_SLOW_WINDOW_1   18
 default scan window used in reduced power cycle (background scanning) 11.25 ms = 18 *0.625
 
#define BTM_BLE_SCAN_SLOW_INTERVAL_2   4096
 default scan interval used in reduced power cycle (background scanning) 2.56 s = 4096 *0.625
 
#define BTM_BLE_SCAN_SLOW_WINDOW_2   36
 default scan window used in reduced power cycle (background scanning) 22.5 ms = 36 *0.625
 
#define BTM_BLE_POLICY_REJECT_ALL   0x00
 relevant to both
 
#define BTM_BLE_POLICY_ALLOW_SCAN   0x01
 relevant to advertiser
 
#define BTM_BLE_POLICY_ALLOW_CONN   0x02
 relevant to advertiser
 
#define BTM_BLE_POLICY_ALLOW_ALL   0x03
 relevant to both
 
#define BTM_BLE_LIMITED_DISCOVERABLE_FLAG   (0x01 << 0)
 Limited Discoverable.
 
#define BTM_BLE_GENERAL_DISCOVERABLE_FLAG   (0x01 << 1)
 General Discoverable.
 
#define BTM_BLE_BREDR_NOT_SUPPORTED   (0x01 << 2)
 BR/EDR Not Supported.
 
#define BTM_BLE_SIMULTANEOUS_DUAL_MODE_TO_SAME_DEVICE_CONTROLLER_SUPPORTED   (0x01 << 3)
 Simultaneous LE and BR/EDR to Same Device Capable (Controller). More...
 
#define BTM_BLE_SIMULTANEOUS_DUAL_MODE_TO_SAME_DEVICE_HOST_SUPPORTED   (0x01 << 4)
 Simultaneous LE and BR/EDR to Same Device Capable (Host). More...
 
#define BTM_BLE_NON_LIMITED_DISCOVERABLE_FLAG   (0x00)
 Non Discoverable.
 
#define BTM_BLE_ADVERT_FLAG_MASK
 LE adverisement mask. More...
 
#define BTM_BLE_LIMITED_DISCOVERABLE_MASK   (BTM_BLE_LIMITED_DISCOVERABLE_FLAG)
 LE Limited discovery mask.
 

Typedefs

typedef uint8_t wiced_bt_ble_advert_filter_policy_t
 Advertising filter policy (see wiced_bt_ble_advert_filter_policy_e)
 
typedef uint8_t wiced_bt_ble_advert_type_t
 LE advertisement data type (see wiced_bt_ble_advert_type_e)
 
typedef uint8_t wiced_ble_ext_adv_handle_t
 Handle value of the advertisement set.
 
typedef uint8_t wiced_ble_ext_adv_sid_t
 SID value.
 
typedef uint8_t wiced_ble_ext_adv_phy_t
 LE Phy type for extended advertisement.
 
typedef uint8_t wiced_ble_isoc_phy_t
 ISOC LE PHY (see wiced_ble_isoc_phy_e)
 
typedef uint8_t wiced_ble_isoc_framing_t
 ISOC Framing types (see wiced_ble_isoc_framing_e)
 
typedef uint8_t wiced_ble_isoc_encryption_t
 ISOC Encryption (see wiced_ble_isoc_encryption_e)
 

Enumerations

enum  wiced_bt_ble_advert_filter_policy_e {
  BTM_BLE_ADV_POLICY_ACCEPT_CONN_AND_SCAN = 0x00,
  BTM_BLE_ADV_POLICY_ACCEPT_CONN_FILTER_SCAN = 0x01,
  BTM_BLE_ADV_POLICY_FILTER_CONN_ACCEPT_SCAN = 0x02,
  BTM_BLE_ADV_POLICY_FILTER_CONN_FILTER_SCAN = 0x03,
  BTM_BLE_ADV_POLICY_MAX
}
 Advertising filter policy. More...
 
enum  wiced_bt_ble_advert_type_e {
  BTM_BLE_ADVERT_TYPE_FLAG = 0x01,
  BTM_BLE_ADVERT_TYPE_16SRV_PARTIAL = 0x02,
  BTM_BLE_ADVERT_TYPE_16SRV_COMPLETE = 0x03,
  BTM_BLE_ADVERT_TYPE_32SRV_PARTIAL = 0x04,
  BTM_BLE_ADVERT_TYPE_32SRV_COMPLETE = 0x05,
  BTM_BLE_ADVERT_TYPE_128SRV_PARTIAL = 0x06,
  BTM_BLE_ADVERT_TYPE_128SRV_COMPLETE = 0x07,
  BTM_BLE_ADVERT_TYPE_NAME_SHORT = 0x08,
  BTM_BLE_ADVERT_TYPE_NAME_COMPLETE = 0x09,
  BTM_BLE_ADVERT_TYPE_TX_POWER = 0x0A,
  BTM_BLE_ADVERT_TYPE_DEV_CLASS = 0x0D,
  BTM_BLE_ADVERT_TYPE_SIMPLE_PAIRING_HASH_C = 0x0E,
  BTM_BLE_ADVERT_TYPE_SIMPLE_PAIRING_RAND_C = 0x0F,
  BTM_BLE_ADVERT_TYPE_SM_TK = 0x10,
  BTM_BLE_ADVERT_TYPE_SM_OOB_FLAG = 0x11,
  BTM_BLE_ADVERT_TYPE_INTERVAL_RANGE = 0x12,
  BTM_BLE_ADVERT_TYPE_SOLICITATION_SRV_UUID = 0x14,
  BTM_BLE_ADVERT_TYPE_128SOLICITATION_SRV_UUID = 0x15,
  BTM_BLE_ADVERT_TYPE_SERVICE_DATA = 0x16,
  BTM_BLE_ADVERT_TYPE_PUBLIC_TARGET = 0x17,
  BTM_BLE_ADVERT_TYPE_RANDOM_TARGET = 0x18,
  BTM_BLE_ADVERT_TYPE_APPEARANCE = 0x19,
  BTM_BLE_ADVERT_TYPE_ADVERT_INTERVAL = 0x1a,
  BTM_BLE_ADVERT_TYPE_LE_BD_ADDR = 0x1b,
  BTM_BLE_ADVERT_TYPE_LE_ROLE = 0x1c,
  BTM_BLE_ADVERT_TYPE_256SIMPLE_PAIRING_HASH = 0x1d,
  BTM_BLE_ADVERT_TYPE_256SIMPLE_PAIRING_RAND = 0x1e,
  BTM_BLE_ADVERT_TYPE_32SOLICITATION_SRV_UUID = 0x1f,
  BTM_BLE_ADVERT_TYPE_32SERVICE_DATA = 0x20,
  BTM_BLE_ADVERT_TYPE_128SERVICE_DATA = 0x21,
  BTM_BLE_ADVERT_TYPE_CONN_CONFIRM_VAL = 0x22,
  BTM_BLE_ADVERT_TYPE_CONN_RAND_VAL = 0x23,
  BTM_BLE_ADVERT_TYPE_URI = 0x24,
  BTM_BLE_ADVERT_TYPE_INDOOR_POS = 0x25,
  BTM_BLE_ADVERT_TYPE_TRANS_DISCOVER_DATA = 0x26,
  BTM_BLE_ADVERT_TYPE_SUPPORTED_FEATURES = 0x27,
  BTM_BLE_ADVERT_TYPE_UPDATE_CH_MAP_IND = 0x28,
  BTM_BLE_ADVERT_TYPE_PB_ADV = 0x29,
  BTM_BLE_ADVERT_TYPE_MESH_MSG = 0x2A,
  BTM_BLE_ADVERT_TYPE_MESH_BEACON = 0x2B,
  BTM_BLE_ADVERT_TYPE_PSRI = 0x2E,
  BTM_BLE_ADVERT_TYPE_EAD = 0x31,
  BTM_BLE_ADVERT_TYPE_3D_INFO_DATA = 0x3D,
  BTM_BLE_ADVERT_TYPE_MANUFACTURER = 0xFF
}
 Advertisement data types. More...
 
enum  {
  WICED_BLE_EXT_ADV_SID_MIN = 0x00,
  WICED_BLE_EXT_ADV_SID_MAX = 0x0f
}
 The Advertising set identifier(SID) is used to uniquely identify adv sets from advertiser. More...
 
enum  {
  WICED_BLE_EXT_ADV_PHY_1M = 0x1,
  WICED_BLE_EXT_ADV_PHY_2M = 0x2,
  WICED_BLE_EXT_ADV_PHY_LE_CODED = 0x3,
  WICED_BLE_EXT_ADV_NUM_PHYS = 0x3
}
 LE Phy to be used for extended advertisement. More...
 
enum  wiced_ble_isoc_phy_e {
  WICED_BLE_ISOC_LE_1M_PHY = 1,
  WICED_BLE_ISOC_LE_2M_PHY = 2,
  WICED_BLE_ISOC_LE_CODED = 4
}
 ISOC LE PHY. More...
 
enum  wiced_ble_isoc_framing_e {
  WICED_BLE_ISOC_UNFRAMED = 0,
  WICED_BLE_ISOC_FRAMED = 1
}
 ISOC Framing types. More...
 
enum  wiced_ble_isoc_encryption_e {
  WICED_BLE_ISOC_UNENCRYPTED = 0,
  WICED_BLE_ISOC_ENCRYPTED = 1
}
 Broadcast ISOC Encryption. More...
 

Functions

uint8_t * wiced_ble_adv_data_search (wiced_bt_adv_ctx_t *p_ctx, wiced_bt_ble_advert_type_t type, uint16_t *p_length)
 Parse advertising data (returned from scan results callback wiced_bt_ble_scan_result_cback_t or wiced_ble_ext_scan_result_cback_t ). More...
 
uint16_t wiced_ble_adv_data_build (wiced_bt_adv_ctx_t *p_ctxt, wiced_bt_ble_advert_elem_t *p_elem)
 Build an advertisement or scan data packet. More...
 

Macro Definition Documentation

◆ BTM_BLE_SIMULTANEOUS_DUAL_MODE_TO_SAME_DEVICE_CONTROLLER_SUPPORTED

#define BTM_BLE_SIMULTANEOUS_DUAL_MODE_TO_SAME_DEVICE_CONTROLLER_SUPPORTED   (0x01 << 3)

Simultaneous LE and BR/EDR to Same Device Capable (Controller).

◆ BTM_BLE_SIMULTANEOUS_DUAL_MODE_TO_SAME_DEVICE_HOST_SUPPORTED

#define BTM_BLE_SIMULTANEOUS_DUAL_MODE_TO_SAME_DEVICE_HOST_SUPPORTED   (0x01 << 4)

Simultaneous LE and BR/EDR to Same Device Capable (Host).

◆ BTM_BLE_ADVERT_FLAG_MASK

#define BTM_BLE_ADVERT_FLAG_MASK
Value:
BTM_BLE_GENERAL_DISCOVERABLE_FLAG)
#define BTM_BLE_LIMITED_DISCOVERABLE_FLAG
Limited Discoverable.
Definition: wiced_bt_adv_scan_common.h:105
#define BTM_BLE_BREDR_NOT_SUPPORTED
BR/EDR Not Supported.
Definition: wiced_bt_adv_scan_common.h:107

LE adverisement mask.

Enumeration Type Documentation

◆ wiced_bt_ble_advert_filter_policy_e

Advertising filter policy.

Enumerator
BTM_BLE_ADV_POLICY_ACCEPT_CONN_AND_SCAN 

Process scan and connection requests from all devices (i.e., the Filter Accept List is not in use) (default)

Process connection requests from all devices and only scan requests from devices that are in the Filter Accept List.

BTM_BLE_ADV_POLICY_ACCEPT_CONN_FILTER_SCAN 

Process scan requests from all devices and only connection requests from devices that are in the Filter Accept List.

BTM_BLE_ADV_POLICY_FILTER_CONN_ACCEPT_SCAN 

Process scan and connection requests only from devices in the Filter Accept List.

BTM_BLE_ADV_POLICY_FILTER_CONN_FILTER_SCAN 

Max Adv filter value.

◆ wiced_bt_ble_advert_type_e

Advertisement data types.

Enumerator
BTM_BLE_ADVERT_TYPE_FLAG 

Advertisement flags.

BTM_BLE_ADVERT_TYPE_16SRV_PARTIAL 

List of supported services - 16 bit UUIDs (partial)

BTM_BLE_ADVERT_TYPE_16SRV_COMPLETE 

List of supported services - 16 bit UUIDs (complete)

BTM_BLE_ADVERT_TYPE_32SRV_PARTIAL 

List of supported services - 32 bit UUIDs (partial)

BTM_BLE_ADVERT_TYPE_32SRV_COMPLETE 

List of supported services - 32 bit UUIDs (complete)

BTM_BLE_ADVERT_TYPE_128SRV_PARTIAL 

List of supported services - 128 bit UUIDs (partial)

BTM_BLE_ADVERT_TYPE_128SRV_COMPLETE 

List of supported services - 128 bit UUIDs (complete)

BTM_BLE_ADVERT_TYPE_NAME_SHORT 

Short name.

BTM_BLE_ADVERT_TYPE_NAME_COMPLETE 

Complete name.

BTM_BLE_ADVERT_TYPE_TX_POWER 

TX Power level.

BTM_BLE_ADVERT_TYPE_DEV_CLASS 

Device Class.

BTM_BLE_ADVERT_TYPE_SIMPLE_PAIRING_HASH_C 

Simple Pairing Hash C.

BTM_BLE_ADVERT_TYPE_SIMPLE_PAIRING_RAND_C 

Simple Pairing Randomizer R.

BTM_BLE_ADVERT_TYPE_SM_TK 

Security manager TK value.

BTM_BLE_ADVERT_TYPE_SM_OOB_FLAG 

Security manager Out-of-Band data.

BTM_BLE_ADVERT_TYPE_INTERVAL_RANGE 

Peripheral connection interval range.

BTM_BLE_ADVERT_TYPE_SOLICITATION_SRV_UUID 

List of solicitated services - 16 bit UUIDs.

BTM_BLE_ADVERT_TYPE_128SOLICITATION_SRV_UUID 

List of solicitated services - 128 bit UUIDs.

BTM_BLE_ADVERT_TYPE_SERVICE_DATA 

Service data - 16 bit UUID.

BTM_BLE_ADVERT_TYPE_PUBLIC_TARGET 

Public target address.

BTM_BLE_ADVERT_TYPE_RANDOM_TARGET 

Random target address.

BTM_BLE_ADVERT_TYPE_APPEARANCE 

Appearance.

BTM_BLE_ADVERT_TYPE_ADVERT_INTERVAL 

Advertising interval.

BTM_BLE_ADVERT_TYPE_LE_BD_ADDR 

LE device bluetooth address.

BTM_BLE_ADVERT_TYPE_LE_ROLE 

LE role.

BTM_BLE_ADVERT_TYPE_256SIMPLE_PAIRING_HASH 

Simple Pairing Hash C-256.

BTM_BLE_ADVERT_TYPE_256SIMPLE_PAIRING_RAND 

Simple Pairing Randomizer R-256.

BTM_BLE_ADVERT_TYPE_32SOLICITATION_SRV_UUID 

List of solicitated services - 32 bit UUIDs.

BTM_BLE_ADVERT_TYPE_32SERVICE_DATA 

Service data - 32 bit UUID.

BTM_BLE_ADVERT_TYPE_128SERVICE_DATA 

Service data - 128 bit UUID.

BTM_BLE_ADVERT_TYPE_CONN_CONFIRM_VAL 

LE Secure Connections Confirmation Value.

BTM_BLE_ADVERT_TYPE_CONN_RAND_VAL 

LE Secure Connections Random Value.

BTM_BLE_ADVERT_TYPE_URI 

URI.

BTM_BLE_ADVERT_TYPE_INDOOR_POS 

Indoor Positioning.

BTM_BLE_ADVERT_TYPE_TRANS_DISCOVER_DATA 

Transport Discovery Data.

BTM_BLE_ADVERT_TYPE_SUPPORTED_FEATURES 

LE Supported Features.

BTM_BLE_ADVERT_TYPE_UPDATE_CH_MAP_IND 

Channel Map Update Indication.

BTM_BLE_ADVERT_TYPE_PB_ADV 

PB-ADV.

BTM_BLE_ADVERT_TYPE_MESH_MSG 

Mesh Message.

BTM_BLE_ADVERT_TYPE_MESH_BEACON 

Mesh Beacon.

BTM_BLE_ADVERT_TYPE_PSRI 

Generic Audio Provate Set Random Identifier.

BTM_BLE_ADVERT_TYPE_EAD 

Encrypted Advertising Data.

BTM_BLE_ADVERT_TYPE_3D_INFO_DATA 

3D Information Data

BTM_BLE_ADVERT_TYPE_MANUFACTURER 

Manufacturer data.

◆ anonymous enum

anonymous enum

The Advertising set identifier(SID) is used to uniquely identify adv sets from advertiser.

SID the value to be transmitted in the advertising SID subfield of the ADI field of the Extended ADV PDUs

Enumerator
WICED_BLE_EXT_ADV_SID_MIN 

min SID value

WICED_BLE_EXT_ADV_SID_MAX 

max SID value

◆ anonymous enum

anonymous enum

LE Phy to be used for extended advertisement.

Enumerator
WICED_BLE_EXT_ADV_PHY_1M 

advetiser advertisement PHY is LE 1M

WICED_BLE_EXT_ADV_PHY_2M 

advetiser advertisement PHY is LE 2M

WICED_BLE_EXT_ADV_PHY_LE_CODED 

advetiser advertisement PHY is LE Coded (for long range)

WICED_BLE_EXT_ADV_NUM_PHYS 

3 PHYs are defined

◆ wiced_ble_isoc_phy_e

ISOC LE PHY.

Enumerator
WICED_BLE_ISOC_LE_1M_PHY 

ISOC Phy set to 1M.

WICED_BLE_ISOC_LE_2M_PHY 

ISOC Phy set to 2M.

WICED_BLE_ISOC_LE_CODED 

ISOC Phy set to coded.

◆ wiced_ble_isoc_framing_e

ISOC Framing types.

Enumerator
WICED_BLE_ISOC_UNFRAMED 

Unframed.

WICED_BLE_ISOC_FRAMED 

Framed.

◆ wiced_ble_isoc_encryption_e

Broadcast ISOC Encryption.

Enumerator
WICED_BLE_ISOC_UNENCRYPTED 

ISOC unencrypted.

WICED_BLE_ISOC_ENCRYPTED 

ISOC encrypted.

Function Documentation

◆ wiced_ble_adv_data_search()

uint8_t* wiced_ble_adv_data_search ( wiced_bt_adv_ctx_t p_ctx,
wiced_bt_ble_advert_type_t  type,
uint16_t *  p_length 
)

Parse advertising data (returned from scan results callback wiced_bt_ble_scan_result_cback_t or wiced_ble_ext_scan_result_cback_t ).

Look for specified advertisement data type.

Parameters
[in]p_ctx: context data for the advertisement data, len, offset read and type. p_ctx->read_offset is incremented by this API on invocation of the API
[in]type: advertisement data type to search 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.

◆ wiced_ble_adv_data_build()

uint16_t wiced_ble_adv_data_build ( wiced_bt_adv_ctx_t p_ctxt,
wiced_bt_ble_advert_elem_t p_elem 
)

Build an advertisement or scan data packet.

Note
: This API does not write data to the controller
Parameters
[in]p_ctxt: advertisement context, contains the pointer and length of buffer to be filled The p_ctx->offset variable is updated by this call by the length of adv data written out to p_ctx->p_adv
[in]p_elem: advertisement element of type, length, value
Returns
0 in case p_elem cannot be written to the buffer in p_ctxt, else (p_elem->len + 2)