AIROC™ BTSDK v4.7 - Documentation | ||||
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... | |
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.
wiced_result_t wiced_bt_cancel_inquiry | ( | void | ) |
Function wiced_bt_cancel_inquiry.
Cancel inquiry
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.
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.
[in] | bd_addr | Peer BD address |
[in] | p_remote_name_result_cback | remote name result callback |
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
[out] | bd_addr | : Local bd address |
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.
[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) |
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
[in] | p_wiced_bt_connection_status_change_cback | - Callback for connection status change |
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.
[in] | p_inquiry_scan_result | : Inquiry scan result (from wiced_bt_inquiry_result_cback_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
[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) |
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
[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) |
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.
[in] | scan_type | : BTM_SCAN_TYPE_STANDARD or BTM_SCAN_TYPE_INTERLACED |
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
[out] | p_name | : Local device name |
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
[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 |
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.
[in] | scan_type | : BTM_SCAN_TYPE_STANDARD or BTM_SCAN_TYPE_INTERLACED |
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.
[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 |
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
[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 |
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.
[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 |
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.
[in] | p_buff | : EIR data |
[in] | len | : Length of EIR data |
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
[in] | timeout | : Page Timeout value in Number of Baseband slots (1 baseband slot = 0.625 ms) |
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.
[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) |
wiced_result_t wiced_bt_set_inquiry_mode | ( | uint8_t | inq_mode | ) |
Function wiced_bt_set_inquiry_mode.
Set the Inquiry mode.
[in] | inq_mode | : inquiry mode(Ex: BTM_INQ_RESULT_EXTENDED) |
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
[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. |
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.
[in] | p_inqparms | : inquiry parameters |
[in] | p_inquiry_result_cback | : inquiry results callback |
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.