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

Functions

wiced_result_t wiced_bt_ble_set_channel_classification (const wiced_bt_ble_chnl_map_t ble_channel_map)
 Sends an HCI command to the controller to set the host preferences for LE AFH channel map. More...
 
wiced_bt_dev_status_t wiced_bt_ble_set_phy (wiced_bt_ble_phy_preferences_t *phy_preferences)
 Sends an HCI command to the controller to set the host preferences for the LE PHY used on a specific pre-established LE connection. More...
 
wiced_result_t wiced_bt_ble_get_connection_parameters (wiced_bt_device_address_t bda, wiced_bt_ble_conn_params_t *p_conn_parameters)
 Reads the current connection parameters being used for an active LE connection. More...
 
wiced_bt_dev_status_t wiced_bt_ble_set_privacy_mode (wiced_bt_device_address_t remote_bda, wiced_bt_ble_privacy_mode_t privacy_mode)
 Sends an HCI command to the controller to tell it whether to use device privacy or network privacy for a specific pre-existing LE connection. More...
 

Detailed Description

Function Documentation

wiced_result_t wiced_bt_ble_get_connection_parameters ( wiced_bt_device_address_t  bda,
wiced_bt_ble_conn_params_t p_conn_parameters 
)

Reads the current connection parameters being used for an active LE connection.

To receive an asynchronous event every time the connections params change (instead of polling manually using this API), handle the event BTM_BLE_CONNECTION_PARAM_UPDATE in the wiced_bt_management_cback_t, which is registered in wiced_bt_stack_init.

Example use of this API to poll params:

{
//addr grabbed from connection_up handler
uint8_t peer_bda[] = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66 };
wiced_bt_ble_get_connection_parameters(peer_bda, &conn_params);
WICED_BT_TRACE("Role: %s ", (conn_params.role) ? ("Central") : ("Peripheral"));
WICED_BT_TRACE("Interval: 0x%04x ", conn_params.conn_interval);
WICED_BT_TRACE("Latency: 0x%04x ", conn_params.conn_latency);
WICED_BT_TRACE("Timeout: 0x%04x\r\n", conn_params.supervision_timeout);
}
Parameters
[in]bdapeer address to change parameters for
[out]p_conn_parameterswiced_bt_ble_conn_params_t
Returns
  • WICED_BT_ILLEGAL_VALUE if p_conn_parameters is NULL.
  • WICED_BT_UNKNOWN_ADDR if device address is bad.
  • WICED_BT_SUCCESS otherwise.
Note
For information on setting these parameters, refer to wiced_bt_l2cap_update_ble_conn_params.
wiced_result_t wiced_bt_ble_set_channel_classification ( const wiced_bt_ble_chnl_map_t  ble_channel_map)

Sends an HCI command to the controller to set the host preferences for LE AFH channel map.

The controller will block any channels indicated by the map, but may also block additional channels based on its channel assessment. In other words, this API can be used to force a channel to be blocked, but cannot force a channel to remain open if the controller deems it a bad channel–for this reason, channels not marked bad are called 'unknown'. Only channels 0-36 can be indicated, other channels are for ADV. At least 1 channel must be left (open). Example channel map to disable channel 24, rest unknown:

uint8_t channel_map[] = { 0xFF, 0xF7, 0xFF, 0xFF, 0xF8 };
Parameters
[in]ble_channel_mapbitmap of the channels 0-36
Returns
  • WICED_SUCCESS command successfully sent to controller
  • WICED_BT_NO_RESOURCES transport buffer allocation failed
Note
The host preferences remain set in the controller until overwritten by sending this command a second time (but do not send sooner than 1 second after first), or by HCI reset.
wiced_bt_dev_status_t wiced_bt_ble_set_phy ( wiced_bt_ble_phy_preferences_t phy_preferences)

Sends an HCI command to the controller to set the host preferences for the LE PHY used on a specific pre-established LE connection.

The response to this event is triggered asynchronously via the event BTM_BLE_PHY_UPDATE_EVT, sent to the BT stack management handler wiced_bt_management_cback_t registered in wiced_bt_stack_init. The handler will receive a flags to indicate the current PHY(s) in use (wiced_bt_ble_phy_update_t).

PHY preferences must be set with knowledge of the underlying hardware. Not all PHYs are supported by all 20x19 devices. For example, 207819 only supports LE2M, but not LELR. Setting preferences for a PHY that does not exist in the hardware will have no effect, but still result in PHY update event in the management handler.

PHY preferences for LELR in wiced_bt_ble_phy_preferences_t.phy_opts can be set even if the LELR PHY is not preferred. This is because the controller can override the host's PHY preferences set by this API in favor of LELR (if the hardware supports LELR).

Example of setting LE2M:

{
{
}
uint8_t peer_bda[] = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66 };
memcpy(phy_preferences.remote_bd_addr, peer_bda, BD_ADDR_LEN);
wiced_bt_ble_set_phy(&phy_preferences);
}
Parameters
[in]phy_preferenceswiced_bt_ble_phy_preferences_t
Returns
  • WICED_SUCCESS command successfully sent to controller
  • BTM_NO_RESOURCES transport buffer allocation failed
  • BTM_ILLEGAL_VALUE bad param (NULL pointer to phy_preferences)
  • BTM_UNKNOWN_ADDR could not find peer using given address
Note
For more information, refer to the BT spec Verion 5.0, Vol. 2, Part E, 7.8.49 ("LE Set PHY Command").
wiced_bt_dev_status_t wiced_bt_ble_set_privacy_mode ( wiced_bt_device_address_t  remote_bda,
wiced_bt_ble_privacy_mode_t  privacy_mode 
)

Sends an HCI command to the controller to tell it whether to use device privacy or network privacy for a specific pre-existing LE connection.

These privacy modes were introduced in Bluetooth 5.0. AIROC devices will default to device privacy mode for all links.

These privacy modes are used for peer devices that use an RPA. The modes specify what type of address the peer is allowed to use. In device privacy mode, the peer device is allowed to advertise with its identity address. In network privacy, the identity address of the peer device will not be accepted.

Parameters
[in]remote_bdapeer address to set privacy mode for
[in]privacy_modewiced_bt_ble_privacy_mode_t
  • BTM_BLE_PRIVACY_MODE_DEVICE
  • BTM_BLE_PRIVACY_MODE_NETWORK
Returns
  • WICED_BT_ILLEGAL_VALUE invalid privacy type
  • WICED_BT_UNSUPPORTED privacy mode not supported by LE controller
  • WICED_BT_UNKNOWN_ADDR peer bd_addr cannot be found
  • WICED_BT_ILLEGAL_ACTION peer not added to resolving list or IRK is invalid
  • WICED_BT_ERROR error while processing
  • WICED_BT_SUCCESS command started
Note
For more information, refer to BT Spec version 5.0, Vol. 6, Part B, 4.7.