Infineon Logo AIROC BTSDK v4.8 - Documentation
 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Multi Advertising

Multi advertisements allow the device to advertise as if it is multiple LE broadcast devices. More...

Macros

#define BD_FEATURES_LEN   8
 Features length.
 

Typedefs

typedef uint8_t wiced_bt_features_t [BD_FEATURES_LEN]
 Features supported data structure.
 

Functions

wiced_bt_dev_status_t wiced_start_multi_advertisements (uint8_t advertising_enable, uint8_t adv_instance)
 Enable or disable advertisements of a specific instance. More...
 
wiced_bt_dev_status_t wiced_set_multi_advertisement_params (uint8_t adv_instance, wiced_bt_ble_multi_adv_params_t *p_param)
 Sets the advertising parameters of a specific advertising instance. More...
 
wiced_bt_dev_status_t wiced_set_multi_advertisement_data (uint8_t *p_data, uint8_t data_len, uint8_t adv_instance)
 Refer to wiced_bt_ble_set_raw_advertisement_data. More...
 
wiced_bt_dev_status_t wiced_set_multi_advertisement_scan_response_data (uint8_t *p_data, uint8_t data_len, uint8_t adv_instance)
 Refer to wiced_bt_ble_set_raw_scan_response_data. More...
 
wiced_bt_dev_status_t wiced_set_multi_advertisements_random_address (wiced_bt_device_address_t randomAddr, uint8_t adv_instance)
 Sets the local BD_ADDR that will be used strictly for the given advertising instance. More...
 
wiced_bool_t wiced_bt_notify_multi_advertisement_packet_transmissions (uint8_t adv_instance, void(*clientCallback)(uint32_t), uint32_t advanceNoticeInMicroSeconds)
 Refer to wiced_bt_notifyAdvPacketTransmissions. More...
 
wiced_result_t wiced_bt_dev_add_device_to_address_resolution_db (wiced_bt_device_link_keys_t *p_link_keys)
 Adds link key information to internal address resolution db. More...
 
wiced_result_t wiced_bt_dev_remove_device_from_address_resolution_db (wiced_bt_device_link_keys_t *p_link_keys)
 Removes the link key information from internal address resolution db. More...
 
wiced_bt_dev_status_t wiced_bt_ble_config_privacy (wiced_bool_t privacy_mode)
 Function wiced_bt_ble_config_privacy. More...
 
wiced_result_t wiced_bt_dev_get_ble_keys (wiced_bt_device_address_t bd_addr, wiced_bt_dev_le_key_type_t *p_key_mask)
 Gets the LE key mask from stored key information of nv ram. More...
 
uint8_t * wiced_btm_get_private_bda (void)
 Acquire current LE Resolvable Private Address. More...
 
wiced_result_t wiced_bt_ble_read_le_features (wiced_bt_device_address_t bda, wiced_bt_features_t features)
 Function wiced_bt_ble_read_le_features. More...
 

Detailed Description

Multi advertisements allow the device to advertise as if it is multiple LE broadcast devices.

The device makes available 16 advertising instances. Instance 0 is controlled by the default ADV functionality using wiced_bt_ble_start_advertisements and should not be controlled using the *_multi_advertisements APIs. Each instance has associated ADV parameters, raw data, scan response data, transmit power, local address, as well as the ability to register for events immediately before and after packet TX.

Function Documentation

wiced_bt_dev_status_t wiced_bt_ble_config_privacy ( wiced_bool_t  privacy_mode)

Function wiced_bt_ble_config_privacy.

This function sets the local privacy mode

Parameters
[in]privacy_modeTRUE to enable privacy on local device, FALSE to disable privacy on local device
Returns
wiced_bt_dev_status_t
wiced_result_t wiced_bt_ble_read_le_features ( wiced_bt_device_address_t  bda,
wiced_bt_features_t  features 
)

Function wiced_bt_ble_read_le_features.

This API returns the features supported by the bda

Parameters
[in]bdaDevice address pointer, pass NULL for local device
[out]featuresPointer to store the supported features
Returns
wiced_result_t WICED_BT_SUCCESS contents of features are valid WICED_BT_ERROR otherwise.
wiced_result_t wiced_bt_dev_add_device_to_address_resolution_db ( wiced_bt_device_link_keys_t p_link_keys)

Adds link key information to internal address resolution db.

Parameters
[in]p_link_keyslink keys information stored in application side
Returns
wiced_result_t
wiced_result_t wiced_bt_dev_get_ble_keys ( wiced_bt_device_address_t  bd_addr,
wiced_bt_dev_le_key_type_t p_key_mask 
)

Gets the LE key mask from stored key information of nv ram.

Parameters
[in]bd_addrremote bd address
[out]p_key_maskle key mask stored
Returns
wiced_result_t
wiced_result_t wiced_bt_dev_remove_device_from_address_resolution_db ( wiced_bt_device_link_keys_t p_link_keys)

Removes the link key information from internal address resolution db.

Parameters
[in]p_link_keyslink keys information stored in application side
Returns
wiced_result_t
wiced_bool_t wiced_bt_notify_multi_advertisement_packet_transmissions ( uint8_t  adv_instance,
void(*)(uint32_t)  clientCallback,
uint32_t  advanceNoticeInMicroSeconds 
)

Refer to wiced_bt_notifyAdvPacketTransmissions.

These two functions are functionally equivalent other than the fact that this API can specify a specific multi ADV instance for which to trigger the callback.

Parameters
[in]adv_instance1 to MULTI_ADV_MAX_NUM_INSTANCES
[in]clientCallbackradio evt callback
[in]advanceNoticeInMicroSecondsnum microseconds to preempt ADV tx
Returns
  • WICED_TRUE success
  • WICED_FALSE adv_instance out of bounds
uint8_t* wiced_btm_get_private_bda ( void  )

Acquire current LE Resolvable Private Address.

Parameters
[in]None
Returns
uint8_t * - current rpa's pointer
wiced_bt_dev_status_t wiced_set_multi_advertisement_data ( uint8_t *  p_data,
uint8_t  data_len,
uint8_t  adv_instance 
)

Refer to wiced_bt_ble_set_raw_advertisement_data.

These two functions are functionally equivalent other than the fact that this API can specify a multi ADV instance for which to set the advertisement data.

Parameters
[in]p_dataraw adv data
[in]data_lennum bytes of p_data (max 31)
[in]adv_instance1 to MULTI_ADV_MAX_NUM_INSTANCES
Returns
  • BTM_ILLEGAL_VALUE data_len too long or p_data null
  • BTM_CMD_STARTED success
  • BTM_SUCCESS success
  • BTM_NO_RESOURCES transport buffer allocation failed
wiced_bt_dev_status_t wiced_set_multi_advertisement_params ( uint8_t  adv_instance,
wiced_bt_ble_multi_adv_params_t p_param 
)

Sets the advertising parameters of a specific advertising instance.

The parameters are populated into a struct wiced_bt_ble_multi_adv_params_t. The parameters must be set according to the constraints placed by the BT spec, otherwise the parameters will be rejected with error code BTM_ILLEGAL_VALUE.

{
{
.adv_tx_power = MULTI_ADV_TX_POWER_MAX,
.peer_addr_type = BLE_ADDR_PUBLIC, //valid only for directed type
.peer_bd_addr = NULL, //valid only for directed type
.own_addr_type = BLE_ADDR_RANDOM
};
uint8_t local_bda[BD_ADDR_LEN] = { 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF };
memcpy(params.own_bd_addr, local_bda, BD_ADDR_LEN);
wiced_set_multi_advertisement_params(adv_instance, &params);
}
Parameters
[in]adv_instance1 to MULTI_ADV_MAX_NUM_INSTANCES
[in]p_paramwiced_bt_ble_multi_adv_params_t
Returns
  • BTM_ILLEGAL_VALUE element of p_param is out of bounds
  • BTM_CMD_STARTED
  • BTM_SUCCESS
  • BTM_NO_RESOURCES
wiced_bt_dev_status_t wiced_set_multi_advertisement_scan_response_data ( uint8_t *  p_data,
uint8_t  data_len,
uint8_t  adv_instance 
)

Refer to wiced_bt_ble_set_raw_scan_response_data.

These two functions are functionally identical other than the fact that this API can specify a multi ADV instance for which to set the scan response data.

Parameters
[in]p_dataraw scan response data
[in]data_lennum bytes of p_data (max 31)
[in]adv_instance1 to MULTI_ADV_MAX_NUM_INSTANCES
Returns
  • BTM_ILLEGAL_VALUE data_len too long or p_data null
  • BTM_CMD_STARTED success
  • BTM_SUCCESS success
  • BTM_NO_RESOURCES transport buffer allocation failed
wiced_bt_dev_status_t wiced_set_multi_advertisements_random_address ( wiced_bt_device_address_t  randomAddr,
uint8_t  adv_instance 
)

Sets the local BD_ADDR that will be used strictly for the given advertising instance.

Parameters
[in]randomAddrlocal address used for specific ADV instance
[in]adv_instance1 to MULTI_ADV_MAX_NUM_INSTANCES
Returns
  • BTM_ILLEGAL_VALUE adv_instance out of bounds
  • BTM_CMD_STARTED success
  • BTM_SUCCESS success
  • BTM_NO_RESOURCES transport buffer allocation failed
wiced_bt_dev_status_t wiced_start_multi_advertisements ( uint8_t  advertising_enable,
uint8_t  adv_instance 
)

Enable or disable advertisements of a specific instance.

Prior to calling this function, the instance should be instantiated and populated using the APIs below. At a minimum, wiced_set_multi_advertisement_params and wiced_set_multi_advertisement_data should be used prior.

Parameters
[in]advertising_enableMULTI_ADVERT_START or MULTI_ADVERT_STOP
[in]adv_instance1 to MULTI_ADV_MAX_NUM_INSTANCES
Returns
  • BTM_CMD_STARTED
  • BTM_SUCCESS
  • BTM_NO_RESOURCES