Infineon Logo AIROC BTSDK v4.9 - Documentation
 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
BR/EDR (Bluetooth Basic Rate / Enhanced Data Rate)

This section talks about the various API's required to integrate BR/EDR functionality to an application. More...

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)
 Function wiced_bt_start_inquiry. More...
 
wiced_result_t wiced_bt_cancel_inquiry (void)
 Function wiced_bt_cancel_inquiry. More...
 
wiced_result_t wiced_bt_set_inquiry_mode (uint8_t inq_mode)
 Function wiced_bt_set_inquiry_mode. More...
 
void wiced_bt_dev_read_local_addr (wiced_bt_device_address_t bd_addr)
 Function wiced_bt_dev_read_local_addr. More...
 
wiced_result_t wiced_bt_dev_set_local_name (char *p_name)
 Function wiced_bt_dev_set_local_name. More...
 
wiced_result_t wiced_bt_dev_set_advanced_connection_params (wiced_bt_dev_inquiry_scan_result_t *p_inquiry_scan_result)
 Function wiced_bt_dev_set_advanced_connection_params. 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)
 Function wiced_bt_dev_vendor_specific_command. More...
 
wiced_result_t wiced_bt_dev_set_discoverability (uint8_t inq_mode, uint16_t duration, uint16_t interval)
 Function wiced_bt_dev_set_discoverability. More...
 
wiced_result_t wiced_bt_dev_set_connectability (uint8_t page_mode, uint16_t window, uint16_t interval)
 Function wiced_bt_dev_set_connectability. More...
 
wiced_result_t wiced_bt_dev_set_inquiry_scan_type (uint16_t scan_type)
 Function wiced_bt_dev_set_inquiry_scan_type. More...
 
wiced_result_t wiced_bt_dev_set_page_scan_type (uint16_t scan_type)
 Function wiced_bt_dev_set_page_scan_type. More...
 
wiced_result_t wiced_bt_dev_write_page_timeout (uint16_t timeout)
 Function wiced_bt_dev_write_page_timeout. More...
 
wiced_result_t wiced_bt_dev_set_packet_types (wiced_bt_device_address_t remote_bda, uint16_t pkt_types)
 Function wiced_bt_dev_set_packet_types. More...
 
void wiced_bt_set_pairable_mode (uint8_t allow_pairing, uint8_t connect_only_paired)
 Function wiced_bt_set_pairable_mode. 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)
 Function wiced_bt_dev_register_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)
 Function wiced_bt_dev_set_sniff_mode. More...
 
wiced_result_t wiced_bt_dev_cancel_sniff_mode (wiced_bt_device_address_t remote_bda)
 Function wiced_bt_dev_cancel_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)
 Function wiced_bt_dev_set_sniff_subrating. More...
 
wiced_result_t wiced_bt_get_link_mode (wiced_bt_device_address_t remote_bda, UINT8 *p_mode)
 Function wiced_bt_get_link_mode. 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)
 Function wiced_bt_dev_read_rssi. More...
 
wiced_result_t wiced_bt_dev_write_eir (uint8_t *p_buff, uint16_t len)
 Function wiced_bt_dev_write_eir. 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)
 Gets the Bluetooth Friendly name from the remote device. More...
 

Detailed Description

This section talks about the various API's required to integrate BR/EDR functionality to an application.

Please refer to the bluetooth specification for details regarding BR/EDR functionality.

Function Documentation

wiced_result_t wiced_bt_cancel_inquiry ( void  )

Function wiced_bt_cancel_inquiry.

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.
wiced_result_t wiced_bt_dev_cancel_sniff_mode ( wiced_bt_device_address_t  remote_bda)

Function wiced_bt_dev_cancel_sniff_mode.

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 
)

Gets the Bluetooth Friendly name from the remote device.

Parameters
[in]bd_addrPeer BD address
[in]p_remote_name_result_cbackremote name result callback
Returns
  • 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)

Function wiced_bt_dev_read_local_addr.

Read the local device address

Parameters
[out]bd_addr: Local bd address
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 
)

Function wiced_bt_dev_read_rssi.

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)

Function wiced_bt_dev_register_connection_status_change.

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)

Function wiced_bt_dev_set_advanced_connection_params.

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_inquiry_result_cback_t)
Returns
wiced_result_t
             WICED_BT_SUCCESS : on success;
             WICED_BT_FAILED  : if an error occurred
wiced_result_t wiced_bt_dev_set_connectability ( uint8_t  page_mode,
uint16_t  window,
uint16_t  interval 
)

Function wiced_bt_dev_set_connectability.

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 
)

Function wiced_bt_dev_set_discoverability.

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_inquiry_scan_type ( uint16_t  scan_type)

Function wiced_bt_dev_set_inquiry_scan_type.

Set the inquiry scan type to standard or interlaced.

Parameters
[in]scan_type: BTM_SCAN_TYPE_STANDARD or BTM_SCAN_TYPE_INTERLACED
Returns
             WICED_BT_SUCCESS:        If successful
             WICED_BT_UNSUPPORTED:  If not a 1.2 device
             WICED_BT_WRONG_MODE:     If the device is not up
wiced_result_t wiced_bt_dev_set_local_name ( char *  p_name)

Function wiced_bt_dev_set_local_name.

Set the device local name

Parameters
[out]p_name: Local device name
Returns
wiced_result_t
             WICED_BT_PENDING        command initiated successfully
             WICED_BT_DEV_RESET      device not in the right state to execute the command
             WICED_BT_NO_RESOURCES   no resources to issue command
wiced_result_t wiced_bt_dev_set_packet_types ( wiced_bt_device_address_t  remote_bda,
uint16_t  pkt_types 
)

Function wiced_bt_dev_set_packet_types.

Set the packet types used for a specific ACL connection

Parameters
[in]remote_bda: remote device BD Address
[in]pkt_types: baseband packet types. see HCI_PKT_TYPES_MASK_* definitions in wiced_bt_hci_defs.h
Returns
             WICED_BT_PENDING:        Command starts OK
             WICED_BT_NO_RESOURCES:  If out of resources (i.e. memory buffer) to send the command.
             WICED_BT_UNKNOWN_ADDR: Unknown remote BD address
wiced_result_t wiced_bt_dev_set_page_scan_type ( uint16_t  scan_type)

Function wiced_bt_dev_set_page_scan_type.

Set the page scan type to standard or interlaced.

Parameters
[in]scan_type: BTM_SCAN_TYPE_STANDARD or BTM_SCAN_TYPE_INTERLACED
Returns
             WICED_BT_SUCCESS:        If successful
             WICED_BT_UNSUPPORTED:  If not a 1.2 device
             WICED_BT_WRONG_MODE:     If the device is not up
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 
)

Function wiced_bt_dev_set_sniff_mode.

Set a connection into sniff mode.

Parameters
[in]remote_bda: Link for which to put into sniff mode
[in]min_period: Minimum sniff period
[in]max_period: Maximum sniff period
[in]attempt: Number of attempts for switching to sniff mode
[in]timeout: Timeout for attempting to switch to sniff mode
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 
)

Function wiced_bt_dev_set_sniff_subrating.

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]min_local_timeout: minimum local timeout
Returns
             WICED_BT_SUCCESS        : on success;
             WICED_BT_ILLEGAL_ACTION : if an error occurred
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 
)

Function wiced_bt_dev_vendor_specific_command.

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 
)

Function wiced_bt_dev_write_eir.

Write EIR data to controller.

Parameters
[in]p_buff: EIR data
[in]len: Length of EIR data
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_result_t wiced_bt_dev_write_page_timeout ( uint16_t  timeout)

Function wiced_bt_dev_write_page_timeout.

Send HCI Write Page Timeout command

Parameters
[in]timeout: Page Timeout value in Number of Baseband slots (1 baseband slot = 0.625 ms)
Returns
             WICED_BT_SUCCESS:        If successful
             WICED_BT_NO_RESOURCES:  If out of resources (i.e. memory buffer) to send the command.
wiced_result_t wiced_bt_get_link_mode ( wiced_bt_device_address_t  remote_bda,
UINT8 *  p_mode 
)

Function wiced_bt_get_link_mode.

This returns the current mode for a specific connection.

Parameters
[in]remote_bda: device address of desired connection
[out]p_mode- address where the current mode is copied into. WICED_POWER_STATE_ACTIVE WICED_POWER_STATE_SNIFF WICED_POWER_STATE_SMART_SNIFF (valid only if return code is WICED_SUCCESS)
Returns
WICED_SUCCESS if successful, WICED_ERROR if bd addr is not active or bad
wiced_result_t wiced_bt_set_inquiry_mode ( uint8_t  inq_mode)

Function wiced_bt_set_inquiry_mode.

Set the Inquiry mode.

Parameters
[in]inq_mode: inquiry mode(Ex: BTM_INQ_RESULT_EXTENDED)
Returns
wiced_result_t
             WICED_BT_SUCCESS            if successful
             WICED_BT_ILLEGAL_VALUE      if invalid mode is given
             WICED_BT_UNSUPPORTED        if given mode is not supported
void wiced_bt_set_pairable_mode ( uint8_t  allow_pairing,
uint8_t  connect_only_paired 
)

Function wiced_bt_set_pairable_mode.

Enable or disable pairing

Parameters
[in]allow_pairing: (TRUE or FALSE) whether or not the device allows pairing.
[in]connect_only_paired: (TRUE or FALSE) whether or not to only allow paired devices to connect.
Returns
void
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 
)

Function wiced_bt_start_inquiry.

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.