Infineon Logo AIROC BTSDK v4.9 - Documentation
 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups

This module provided various Bluetooth security functionality such as authorisation, authentication and encryption. More...

Macros

#define wiced_bt_connect(remote_bd_addr)   wiced_bt_utils_acl_connect(remote_bd_addr)
 

Functions

wiced_result_t wiced_bt_start_inquiry (wiced_bt_dev_inq_parms_t *p_inqparms, wiced_bt_inquiry_result_cback_t *p_inquiry_result_cback)
 Begin BR/EDR inquiry for peer devices. More...
 
wiced_result_t wiced_bt_cancel_inquiry (void)
 Cancel inquiry. More...
 
void wiced_bt_dev_read_local_addr (wiced_bt_device_address_t bd_addr)
 Read the local device address. More...
 
void wiced_bt_dev_read_local_addr_ext (wiced_bt_dev_local_addr_ext_t *data)
 Read the extended local device address information. More...
 
wiced_result_t wiced_bt_dev_set_advanced_connection_params (wiced_bt_dev_inquiry_scan_result_t *p_inquiry_scan_result)
 Set advanced connection parameters for subsequent BR/EDR connections (remote clock offset, page scan mode, and other information obtained during inquiry) More...
 
wiced_result_t wiced_bt_dev_vendor_specific_command (uint16_t opcode, uint8_t param_len, uint8_t *p_param_buf, wiced_bt_dev_vendor_specific_command_complete_cback_t *p_cback)
 Send a vendor specific HCI command to the controller. More...
 
wiced_result_t wiced_bt_dev_set_discoverability (uint8_t inq_mode, uint16_t duration, uint16_t interval)
 Set discoverability. More...
 
wiced_result_t wiced_bt_dev_set_connectability (uint8_t page_mode, uint16_t window, uint16_t interval)
 Set connectablilty. More...
 
wiced_result_t wiced_bt_dev_register_connection_status_change (wiced_bt_connection_status_change_cback_t *p_wiced_bt_connection_status_change_cback)
 Register callback for connection status change. More...
 
wiced_result_t wiced_bt_dev_set_sniff_mode (wiced_bt_device_address_t remote_bda, uint16_t min_period, uint16_t max_period, uint16_t attempt, uint16_t timeout)
 Set a connection into sniff mode. More...
 
wiced_result_t wiced_bt_dev_cancel_sniff_mode (wiced_bt_device_address_t remote_bda)
 Take a connection out of sniff mode. More...
 
wiced_result_t wiced_bt_dev_set_sniff_subrating (wiced_bt_device_address_t remote_bda, uint16_t max_latency, uint16_t min_remote_timeout, uint16_t min_local_timeout)
 Set sniff subrating parameters for an active connection. More...
 
wiced_result_t wiced_bt_dev_read_rssi (wiced_bt_device_address_t remote_bda, wiced_bt_transport_t transport, wiced_bt_dev_cmpl_cback_t *p_cback)
 Get Receive Signal Strenth Index (RSSI) for the requested link. More...
 
wiced_result_t wiced_bt_dev_write_eir (uint8_t *p_buff, uint16_t len)
 Write EIR data to controller. More...
 
wiced_result_t wiced_bt_dev_switch_role (wiced_bt_device_address_t remote_bd_addr, uint8_t new_role, wiced_bt_dev_cmpl_cback_t *p_cback)
 This function is called to switch the role between Central and Peripheral. More...
 
wiced_bt_dev_status_t wiced_bt_dev_set_afh_channel_classification (const wiced_bt_br_chnl_map_t afh_channel_map)
 This function is called to send HCI_SET_AFH_CHANNELS command to BR/EDR controller. More...
 
wiced_result_t wiced_bt_dev_get_remote_name (wiced_bt_device_address_t bd_addr, wiced_bt_remote_name_cback_t *p_remote_name_result_cback)
 Get Bluetooth Friendly name from remote device. More...
 
wiced_result_t wiced_bt_dev_set_link_policy (wiced_bt_device_address_t remote_bda, wiced_bt_link_policy_settings_t settings)
 This function is called to set the Link Policy for remote device. More...
 
wiced_result_t wiced_bt_coex_enable (uint32_t seci_baud_rate)
 Application can invoke this function to enable the coex functionality. More...
 
void wiced_bt_coex_disable (void)
 Application can invoke this function to disable the coex functionality. More...
 
wiced_result_t wiced_bt_dev_set_afh_channel_assessment (wiced_bool_t enable_or_disable)
 This function is called to set the channel assessment mode on or off. More...
 
wiced_bt_dev_status_t wiced_bt_sco_setPacketTypes (int16_t sco_inx, uint16_t pkt_types)
 This function is called to set the packet types used for a specific SCO connection and for all connections. More...
 
wiced_result_t wiced_bt_dev_setAclPacketTypes (wiced_bt_device_address_t remote_bda, uint16_t pkt_types)
 This function is set the ACL packet types that the device supports for specific connection and all connections if bd address with all zeros. More...
 
wiced_bool_t wiced_bt_utils_acl_connect (wiced_bt_device_address_t remote_bd_addr)
 This function is used to connect with remote device. More...
 

Detailed Description

This module provided various Bluetooth security functionality such as authorisation, authentication and encryption.

Function Documentation

wiced_result_t wiced_bt_cancel_inquiry ( void  )

Cancel inquiry.

Returns

WICED_BT_SUCCESS : if successful
WICED_BT_NO_RESOURCES : if could not allocate a message buffer
WICED_BT_WRONG_MODE : if the device is not up.

void wiced_bt_coex_disable ( void  )

Application can invoke this function to disable the coex functionality.

Returns
void
wiced_result_t wiced_bt_coex_enable ( uint32_t  seci_baud_rate)

Application can invoke this function to enable the coex functionality.

Parameters
[in]seci_baud_rate: SECI baud rate. Ensure to set a valid baud rate which will be used for the SECI communication between Bluetooth and WLAN chip. Maximum supported value is up to 4M
Returns
wiced_result_t
wiced_result_t wiced_bt_dev_cancel_sniff_mode ( wiced_bt_device_address_t  remote_bda)

Take a connection out of sniff mode.

A check is made if the connection is already in sniff mode, and if not, the cancel sniff mode is ignored.

Returns
WICED_BT_PENDING if successfully initiated, otherwise error
wiced_result_t wiced_bt_dev_get_remote_name ( wiced_bt_device_address_t  bd_addr,
wiced_bt_remote_name_cback_t p_remote_name_result_cback 
)

Get Bluetooth Friendly name from remote device.

Parameters
[in]bd_addr: Peer bd address
[in]p_remote_name_result_cback: remote name result callback
Returns
wiced_result_t

WICED_BT_PENDING : if successfully initiated
WICED_BT_BUSY : if already in progress
WICED_BT_ILLEGAL_VALUE : if parameter(s) are out of range
WICED_BT_NO_RESOURCES : if could not allocate resources to start the command
WICED_BT_WRONG_MODE : if the device is not up.

void wiced_bt_dev_read_local_addr ( wiced_bt_device_address_t  bd_addr)

Read the local device address.

Parameters
[out]bd_addr: Local bd address
Returns
void
void wiced_bt_dev_read_local_addr_ext ( wiced_bt_dev_local_addr_ext_t data)

Read the extended local device address information.

Parameters
[out]data: data pointer in which stack will populate the address information.(refer wiced_bt_dev_local_addr_ext_t )
Returns
void
wiced_result_t wiced_bt_dev_read_rssi ( wiced_bt_device_address_t  remote_bda,
wiced_bt_transport_t  transport,
wiced_bt_dev_cmpl_cback_t p_cback 
)

Get Receive Signal Strenth Index (RSSI) for the requested link.

Note: see Bluetooth Core Spec definition of the Read RSSI command, for BR/EDR transports, the RSSI value returned through the callback will be the difference between the measured RSSI and the limits of a range selected by the controller, where positive or negative values indicate a measurement above or below the range, and a zero value indicates the RSSI is within the range. But for LE transports, the value returned will be the absolute RSSI. If absolute RSSI is required for a BR/EDR connection, use the wiced_bt_read_raw_rssi() API from the btsdk-common middleware library.

Parameters
[in]remote_bda: BD address of connection to read rssi
[in]transport: Transport type
[in]p_cback: Result callback (wiced_bt_dev_rssi_result_t will be passed to the callback)
Returns

WICED_BT_PENDING : if command issued to controller.
WICED_BT_NO_RESOURCES : if couldn't allocate memory to issue command
WICED_BT_UNKNOWN_ADDR : if no active link with bd addr specified
WICED_BT_BUSY : if command is already in progress

wiced_result_t wiced_bt_dev_register_connection_status_change ( wiced_bt_connection_status_change_cback_t p_wiced_bt_connection_status_change_cback)

Register callback for connection status change.

Parameters
[in]p_wiced_bt_connection_status_change_cback- Callback for connection status change
Returns
wiced_result_t

WICED_BT_SUCCESS : on success;
WICED_BT_FAILED : if an error occurred

wiced_result_t wiced_bt_dev_set_advanced_connection_params ( wiced_bt_dev_inquiry_scan_result_t p_inquiry_scan_result)

Set advanced connection parameters for subsequent BR/EDR connections (remote clock offset, page scan mode, and other information obtained during inquiry)

If not called, then default connection parameters will be used.

Parameters
[in]p_inquiry_scan_result: Inquiry scan result (from wiced_bt_dev_inquiry_scan_result_t)
Returns
wiced_result_t

WICED_BT_SUCCESS : on success;
WICED_BT_FAILED : if an error occurred

wiced_result_t wiced_bt_dev_set_afh_channel_assessment ( wiced_bool_t  enable_or_disable)

This function is called to set the channel assessment mode on or off.

Parameters
[in]enable_or_disable: Enable or disable AFH channel assessment
Returns
wiced_result_t
wiced_bt_dev_status_t wiced_bt_dev_set_afh_channel_classification ( const wiced_bt_br_chnl_map_t  afh_channel_map)

This function is called to send HCI_SET_AFH_CHANNELS command to BR/EDR controller.

Channel n is bad = 0. Channel n is unknown = 1. The most significant bit is reserved and shall be set to 0. At least 20 channels shall be marked as unknown.

Parameters
afh_channel_map: AFH Host Channel Classification array
Returns
WICED_BT_UNSUPPORTED : if feature does not supported
WICED_BT_WRONG_MODE : if device is in wrong mode
WICED_BT_NO_RESOURCES : if device does not have buffers to process the request
wiced_result_t wiced_bt_dev_set_connectability ( uint8_t  page_mode,
uint16_t  window,
uint16_t  interval 
)

Set connectablilty.

Note
The duration (window parameter) must be less than or equal to the interval.
Parameters
[in]page_mode: Connectability mode (see wiced_bt_connectability_mode_e )
[in]window: Duration (in 0.625 msec intervals). BTM_DEFAULT_CONN_WINDOW, or range: 0x0012 ~ 0x1000 (11.25 ~ 2560 msecs)
[in]interval: Interval (in 0.625 msec intervals). BTM_DEFAULT_CONN_INTERVAL, or range: 0x0012 ~ 0x1000 (11.25 ~ 2560 msecs)
Returns

WICED_BT_SUCCESS : If successful
WICED_BT_ILLEGAL_VALUE : If a bad parameter is detected
WICED_BT_NO_RESOURCES : If could not allocate a message buffer
WICED_BT_WRONG_MODE : If the device is not up

wiced_result_t wiced_bt_dev_set_discoverability ( uint8_t  inq_mode,
uint16_t  duration,
uint16_t  interval 
)

Set discoverability.

Note
The duration must be less than or equal to the interval.
Parameters
[in]inq_mode: Discoverability mode (see wiced_bt_discoverability_mode_e )
[in]duration: Duration (in 0.625 msec intervals). BTM_DEFAULT_DISC_WINDOW, or range: 0x0012 ~ 0x1000 (11.25 ~ 2560 msecs)
[in]interval: Interval (in 0.625 msec intervals). BTM_DEFAULT_DISC_INTERVAL, or range: 0x0012 ~ 0x1000 (11.25 ~ 2560 msecs)
Returns

WICED_BT_SUCCESS : If successful
WICED_BT_BUSY : If a setting of the filter is already in progress
WICED_BT_NO_RESOURCES : If couldn't get a memory pool buffer
WICED_BT_ILLEGAL_VALUE : If a bad parameter was detected
WICED_BT_WRONG_MODE : If the device is not up

wiced_result_t wiced_bt_dev_set_link_policy ( wiced_bt_device_address_t  remote_bda,
wiced_bt_link_policy_settings_t  settings 
)

This function is called to set the Link Policy for remote device.

Parameters
[in]remote_bda: remote device's address
[in]settings: the policy setting value(from wiced_bt_link_policy_settings_values_e)
Returns
wiced_result_t
wiced_result_t wiced_bt_dev_set_sniff_mode ( wiced_bt_device_address_t  remote_bda,
uint16_t  min_period,
uint16_t  max_period,
uint16_t  attempt,
uint16_t  timeout 
)

Set a connection into sniff mode.

Parameters
[in]remote_bda: Link for which to put into sniff mode
[in]min_period: Minimum sniff period (range 0x0006 to 0x0540) (in 0.625 msec)
[in]max_period: Maximum sniff period (range 0x0006 to 0x0540) (in 0.625 msec)
[in]attempt: Number of attempts for switching to sniff mode (range 0x0001 – 0x7FFF) (in 0.625 msec)
[in]timeout: Timeout for attempting to switch to sniff mode (range 0x0000 – 0x7FFF) (in 0.625 msec)
Returns
WICED_BT_PENDING if successfully initiated, otherwise error
wiced_result_t wiced_bt_dev_set_sniff_subrating ( wiced_bt_device_address_t  remote_bda,
uint16_t  max_latency,
uint16_t  min_remote_timeout,
uint16_t  min_local_timeout 
)

Set sniff subrating parameters for an active connection.

Parameters
[in]remote_bda: device address of desired ACL connection
[in]max_latency: maximum latency (in 0.625ms units) (range: 0x0002-0xFFFE)
[in]min_remote_timeout: minimum remote timeout (in 0.625ms units) (range: 0x0000 – 0xFFFE)
[in]min_local_timeout: minimum local timeout (in 0.625ms units) (range: 0x0000 – 0xFFFE)
Returns

WICED_BT_SUCCESS : on success;
WICED_BT_ILLEGAL_ACTION : if an error occurred

wiced_result_t wiced_bt_dev_setAclPacketTypes ( wiced_bt_device_address_t  remote_bda,
uint16_t  pkt_types 
)

This function is set the ACL packet types that the device supports for specific connection and all connections if bd address with all zeros.

Parameters
[in]remote_bdaBD Address for specific conection and for all connections it should be all 0's.
[in]pkt_typesPacket types supported by the device. One or more of the following (bitmask):
BTM_ACL_PKT_TYPES_MASK_DM1
BTM_ACL_PKT_TYPES_MASK_DH1
BTM_ACL_PKT_TYPES_MASK_DM3
BTM_ACL_PKT_TYPES_MASK_DH3
BTM_ACL_PKT_TYPES_MASK_DM5
BTM_ACL_PKT_TYPES_MASK_DH5
BTM_ACL_PKT_TYPES_MASK_NO_2_DH1
BTM_ACL_PKT_TYPES_MASK_NO_3_DH1
BTM_ACL_PKT_TYPES_MASK_NO_2_DH3
BTM_ACL_PKT_TYPES_MASK_NO_3_DH3
BTM_ACL_PKT_TYPES_MASK_NO_2_DH5
Returns
wiced_result_t
wiced_result_t wiced_bt_dev_switch_role ( wiced_bt_device_address_t  remote_bd_addr,
uint8_t  new_role,
wiced_bt_dev_cmpl_cback_t p_cback 
)

This function is called to switch the role between Central and Peripheral.

If role is already set it will do nothing. If the command was initiated, the callback function is called upon completion.

Parameters
[in]remote_bd_addr: BD address of remote device
[in]new_role: New role (BTM_ROLE_CENTRAL or BTM_ROLE_PERIPHERAL)
[in]p_cback: Result callback (wiced_bt_dev_switch_role_result_t will be passed to the callback)
Returns
wiced_result_t
wiced_result_t wiced_bt_dev_vendor_specific_command ( uint16_t  opcode,
uint8_t  param_len,
uint8_t *  p_param_buf,
wiced_bt_dev_vendor_specific_command_complete_cback_t p_cback 
)

Send a vendor specific HCI command to the controller.

Parameters
[in]opcode: Opcode of vendor specific command
[in]param_len: Length of parameter buffer
[in]p_param_buf: Parameters
[in]p_cback: Callback for command complete
Returns

WICED_BT_SUCCESS : Command sent. Does not expect command complete event. (command complete callback param is NULL)
WICED_BT_PENDING : Command sent. Waiting for command complete event.
WICED_BT_BUSY : Command not sent. Waiting for command complete event for prior command.

wiced_result_t wiced_bt_dev_write_eir ( uint8_t *  p_buff,
uint16_t  len 
)

Write EIR data to controller.

Parameters
[in]p_buff: EIR data as per the spec (Spec 5.0 Vol 3 Part C, Section 8 )
[in]len: Total Length of EIR data being passed
Returns
WICED_BT_SUCCESS : if successful
WICED_BT_NO_RESOURCES : if couldn't allocate memory to issue command
WICED_BT_UNSUPPORTED : if local device cannot support request
wiced_bt_dev_status_t wiced_bt_sco_setPacketTypes ( int16_t  sco_inx,
uint16_t  pkt_types 
)

This function is called to set the packet types used for a specific SCO connection and for all connections.

Parameters
[in]sco_inxSpecific connection and -1 for all connections.
[in]pkt_typesOne or more of the following
BTM_SCO_PKT_TYPES_MASK_HV1
BTM_SCO_PKT_TYPES_MASK_HV2
BTM_SCO_PKT_TYPES_MASK_HV3
BTM_SCO_PKT_TYPES_MASK_EV3
BTM_SCO_PKT_TYPES_MASK_EV4
BTM_SCO_PKT_TYPES_MASK_EV5
BTM_SCO_PKT_TYPES_MASK_NO_2_EV3
BTM_SCO_PKT_TYPES_MASK_NO_3_EV3
BTM_SCO_PKT_TYPES_MASK_NO_2_EV5
BTM_SCO_PKT_TYPES_MASK_NO_3_EV5
BTM_SCO_LINK_ALL_MASK
- enables all supported types
Returns
wiced_bt_dev_status_t
wiced_result_t wiced_bt_start_inquiry ( wiced_bt_dev_inq_parms_t p_inqparms,
wiced_bt_inquiry_result_cback_t p_inquiry_result_cback 
)

Begin BR/EDR inquiry for peer devices.

Parameters
[in]p_inqparms: inquiry parameters
[in]p_inquiry_result_cback: inquiry results callback
Returns
wiced_result_t

WICED_BT_PENDING : if successfully initiated
WICED_BT_BUSY : if already in progress
WICED_BT_ILLEGAL_VALUE : if parameter(s) are out of range
WICED_BT_NO_RESOURCES : if could not allocate resources to start the command
WICED_BT_WRONG_MODE : if the device is not up

wiced_bool_t wiced_bt_utils_acl_connect ( wiced_bt_device_address_t  remote_bd_addr)

This function is used to connect with remote device.

Parameters
[in]remote_bd_addrremote device's address
Returns
WICED_TRUE: success WICED_FALSE: fail