Macros | |
| #define | BTM_BLE_ADVERT_MODE |
| #define | BTM_BLE_CONN_MODE |
| #define | BTM_BLE_SCAN_TYPE |
| #define | BTM_EIR_UUID_ENUM |
| #define | BTM_INQ_RES_IGNORE_RSSI 0x7f |
| #define | BTM_LE_KEY_TYPES |
| #define | BTM_LINK_TYPE_ESCO HCI_LINK_TYPE_ESCO |
| #define | BTM_LINK_TYPE_SCO HCI_LINK_TYPE_SCO |
| #define | BTM_OOB_REQ_TYPE |
| #define | BTM_OOB_STATE |
| #define | BTM_PIN_TYPE_VARIABLE HCI_PIN_TYPE_VARIABLE |
| #define | BTM_PM_STATUS_CODES |
| #define | BTM_SEC_LEVEL |
| #define | BTM_SEC_LINK_STATE |
| #define | BTM_SECURITY_KEY_DATA_LEN 132 |
| #define | BTM_SECURITY_LOCAL_KEY_DATA_LEN 65 |
Bluetooth Management (BTM) Application Programming Interface
The BTM consists of several management entities:
| #define BTM_BLE_ADVERT_MODE |
advertisement type (used when calling wiced_bt_start_advertisements)
| #define BTM_BLE_CONN_MODE |
scan mode used in initiating
| #define BTM_BLE_SCAN_TYPE |
Scan duty cycle (used for BTM_BLE_SCAN_STATE_CHANGED_EVT and wiced_bt_dev_create_connection)
| #define BTM_EIR_UUID_ENUM |
BTM service definitions (used for storing EIR data to bit mask
| #define BTM_INQ_RES_IGNORE_RSSI 0x7f |
RSSI value not supplied (ignore it)
| #define BTM_LE_KEY_TYPES |
LE Key type
| #define BTM_LINK_TYPE_ESCO HCI_LINK_TYPE_ESCO |
Link type eSCO
| #define BTM_LINK_TYPE_SCO HCI_LINK_TYPE_SCO |
SCO link type Link type SCO
| #define BTM_OOB_REQ_TYPE |
Type of OOB data required
| #define BTM_OOB_STATE |
OOB Data status
| #define BTM_PIN_TYPE_VARIABLE HCI_PIN_TYPE_VARIABLE |
PIN types
| #define BTM_PM_STATUS_CODES |
Power Management status codes
| #define BTM_SEC_LEVEL |
Security Service Levels [bit mask]. Encryption should not be used without authentication.
| #define BTM_SEC_LINK_STATE |
security flags for current BR/EDR link
| #define BTM_SECURITY_KEY_DATA_LEN 132 |
Size of security keys Security key data length (used by wiced_bt_device_link_keys_t structure)
| #define BTM_SECURITY_LOCAL_KEY_DATA_LEN 65 |
Local security key data length (used by wiced_bt_local_identity_keys_t structure)
| typedef uint8_t wiced_bt_ble_advert_mode_t |
Advertisement type (see wiced_bt_ble_advert_mode_e)
| typedef uint8_t wiced_bt_ble_conn_mode_t |
Conn mode (see wiced_bt_ble_conn_mode_e)
| typedef uint8_t wiced_bt_ble_scan_type_t |
scan type (see wiced_bt_ble_scan_type_e)
| typedef void( wiced_bt_connection_status_change_cback_t)(wiced_bt_device_address_t bd_addr, uint8_t *p_features, wiced_bool_t is_connected, uint16_t handle, wiced_bt_transport_t transport, uint8_t reason) |
Connection status change callback
Callback for Bluetooth Management event notifications. Registered using wiced_bt_register_connection_status_change()
| [in] | bd_addr | : BD Address of remote |
| [in] | p_features | |
| [in] | is_connected | : TRUE if connected |
| [in] | handle | : Connection handle |
| [in] | transport | : BT_TRANSPORT_BR_EDR or BT_TRANSPORT_LE |
| [in] | reason | : status for acl connection change HCI_SUCCESS HCI_ERR_PAGE_TIMEOUT HCI_ERR_MEMORY_FULL HCI_ERR_CONNECTION_TOUT HCI_ERR_PEER_USER HCI_ERR_CONN_CAUSE_LOCAL_HOST HCI_ERR_LMP_RESPONSE_TIMEOUT HCI_ERR_CONN_FAILED_ESTABLISHMENT |
| typedef uint8_t wiced_bt_dev_auth_req_t |
BR/EDR authentication requirement (see wiced_bt_dev_auth_req_e)
| typedef void( wiced_bt_dev_cmpl_cback_t)(void *p_data) |
Synchronous BTM operation is complete.
| p_data | : Operation dependent data |
| typedef uint8_t wiced_bt_dev_io_cap_t |
IO capabilities (see wiced_bt_dev_io_cap_e)
| typedef uint8_t wiced_bt_dev_le_auth_req_t |
BLE authentication requirement (see wiced_bt_dev_le_auth_req_e)
| typedef uint8_t wiced_bt_dev_le_key_type_t |
LE key type (see wiced_bt_dev_le_key_type_e)
OOB data type requested (see wiced_bt_dev_oob_data_req_type_t)
| typedef uint8_t wiced_bt_dev_oob_data_t |
OOB data (see wiced_bt_dev_oob_data_e)
| typedef uint8_t wiced_bt_dev_passkey_entry_type_t |
Bluetooth pairing keypress value (see wiced_bt_dev_passkey_entry_type_e)
| typedef uint8_t wiced_bt_dev_power_mgmt_status_t |
Power management status (see wiced_bt_dev_power_mgmt_status_e)
| typedef wiced_result_t wiced_bt_dev_status_t |
Result/Status for wiced_bt_dev Result/Status for wiced_bt_dev
| typedef void( wiced_bt_dev_vendor_specific_command_complete_cback_t)(wiced_bt_dev_vendor_specific_command_complete_params_t *p_command_complete_params) |
Vendor specific command complete
| p_command_complete_params | : Command complete parameters |
| typedef void( wiced_bt_hci_trace_cback_t)(wiced_bt_hci_trace_type_t type, uint16_t length, uint8_t *p_data) |
HCI trace callback
Callback for HCI traces Registered using wiced_bt_dev_register_hci_trace()
| [in] | type | : Trace type |
| [in] | length | : Length of the trace data |
| [in] | p_data | : Pointer to the data |
| typedef void( wiced_bt_inquiry_result_cback_t)(wiced_bt_dev_inquiry_scan_result_t *p_inquiry_result, uint8_t *p_eir_data) |
Inquiry result callback.
| p_inquiry_result | : Inquiry result data (NULL if inquiry is complete) |
| p_eir_data | : Extended inquiry response data |
| typedef wiced_result_t( wiced_bt_management_cback_t)(wiced_bt_management_evt_t event, wiced_bt_management_evt_data_t *p_event_data) |
Bluetooth Management callback
Callback for Bluetooth Management event notifications. Registered using wiced_bt_stack_init()
| event | : Event ID |
| p_event_data | : Event data |
| typedef uint8_t wiced_bt_management_evt_t |
Bluetooth management events (see wiced_bt_management_evt_e)
| typedef uint8_t wiced_bt_smp_status_t |
SMP Pairing status (see wiced_bt_smp_status_e)
BR/EDR Authentication requirement
Pairing IO Capabilities
LE Authentication requirement
Bluetooth Management events
| Enumerator | |
|---|---|
| BTM_ENABLED_EVT |
Bluetooth controller and host stack enabled. Event data: wiced_bt_dev_enabled_t |
| BTM_DISABLED_EVT |
Bluetooth controller and host stack disabled. Event data: NULL |
| BTM_POWER_MANAGEMENT_STATUS_EVT |
Power management status change. Event data: wiced_bt_power_mgmt_notification_t |
| BTM_PIN_REQUEST_EVT |
PIN request (used only with legacy devices). Event data: wiced_bt_dev_name_and_class_t |
| BTM_USER_CONFIRMATION_REQUEST_EVT |
received USER_CONFIRMATION_REQUEST event (respond using wiced_bt_dev_confirm_req_reply). Event data: wiced_bt_dev_user_cfm_req_t |
| BTM_PASSKEY_NOTIFICATION_EVT |
received USER_PASSKEY_NOTIFY event. Event data: wiced_bt_dev_user_key_notif_t |
| BTM_PASSKEY_REQUEST_EVT |
received USER_PASSKEY_REQUEST event (respond using wiced_bt_dev_pass_key_req_reply). Event data: wiced_bt_dev_user_key_req_t |
| BTM_KEYPRESS_NOTIFICATION_EVT |
received KEYPRESS_NOTIFY event. Event data: wiced_bt_dev_user_keypress_t |
| BTM_PAIRING_IO_CAPABILITIES_BR_EDR_REQUEST_EVT |
Requesting IO capabilities for BR/EDR pairing. Event data: wiced_bt_dev_bredr_io_caps_req_t |
| BTM_PAIRING_IO_CAPABILITIES_BR_EDR_RESPONSE_EVT |
Received IO capabilities response for BR/EDR pairing. Event data: wiced_bt_dev_bredr_io_caps_rsp_t |
| BTM_PAIRING_IO_CAPABILITIES_BLE_REQUEST_EVT |
Requesting IO capabilities for BLE pairing. Event data: wiced_bt_dev_ble_io_caps_req_t |
| BTM_PAIRING_COMPLETE_EVT |
received SIMPLE_PAIRING_COMPLETE event. Event data: wiced_bt_dev_pairing_cplt_t |
| BTM_ENCRYPTION_STATUS_EVT |
Encryption status change. Event data: wiced_bt_dev_encryption_status_t |
| BTM_SECURITY_REQUEST_EVT |
Security request (respond using wiced_bt_ble_security_grant). Event data: wiced_bt_dev_security_request_t |
| BTM_SECURITY_FAILED_EVT |
Security procedure/authentication failed. Event data: wiced_bt_dev_security_failed_t |
| BTM_SECURITY_ABORTED_EVT |
Security procedure aborted locally, or unexpected link drop. Event data: wiced_bt_dev_name_and_class_t |
| BTM_READ_LOCAL_OOB_DATA_COMPLETE_EVT |
Result of reading local OOB data (wiced_bt_dev_read_local_oob_data). Event data: wiced_bt_dev_local_oob_t |
| BTM_REMOTE_OOB_DATA_REQUEST_EVT |
OOB data from remote device (respond using wiced_bt_dev_remote_oob_data_reply). Event data: wiced_bt_dev_remote_oob_t |
| BTM_PAIRED_DEVICE_LINK_KEYS_UPDATE_EVT |
Updated remote device link keys (store device_link_keys to NV memory). Event data: wiced_bt_device_link_keys_t |
| BTM_PAIRED_DEVICE_LINK_KEYS_REQUEST_EVT |
Request for stored remote device link keys (restore device_link_keys from NV memory). If successful, return WICED_BT_SUCCESS. Event data: wiced_bt_device_link_keys_t |
| BTM_LOCAL_IDENTITY_KEYS_UPDATE_EVT |
Update local identity key (stored local_identity_keys NV memory). Event data: wiced_bt_local_identity_keys_t |
| BTM_LOCAL_IDENTITY_KEYS_REQUEST_EVT |
Request local identity key (get local_identity_keys from NV memory). If successful, return WICED_BT_SUCCESS. Event data: wiced_bt_local_identity_keys_t |
| BTM_BLE_SCAN_STATE_CHANGED_EVT |
BLE scan state change. Event data: wiced_bt_ble_scan_type_t |
| BTM_BLE_ADVERT_STATE_CHANGED_EVT |
BLE advertisement state change. Event data: wiced_bt_ble_advert_mode_t |
| BTM_SMP_REMOTE_OOB_DATA_REQUEST_EVT |
SMP remote oob data request. Reply using wiced_bt_smp_oob_data_reply. Event data: wiced_bt_smp_remote_oob_req_t |
| BTM_SMP_SC_REMOTE_OOB_DATA_REQUEST_EVT |
LE secure connection remote oob data request. Reply using wiced_bt_smp_sc_oob_reply. Event data: wiced_bt_smp_sc_remote_oob_req_t |
| BTM_SMP_SC_LOCAL_OOB_DATA_NOTIFICATION_EVT |
LE secure connection local OOB data (wiced_bt_smp_create_local_sc_oob_data). Event data: #wiced_bt_smp_sc_local_oob_t |
| BTM_SCO_CONNECTED_EVT |
SCO connected event. Event data: wiced_bt_sco_connected_t |
| BTM_SCO_DISCONNECTED_EVT |
SCO disconnected event. Event data: wiced_bt_sco_disconnected_t |
| BTM_SCO_CONNECTION_REQUEST_EVT |
SCO connection request event. Event data: wiced_bt_sco_connection_request_t |
| BTM_SCO_CONNECTION_CHANGE_EVT |
SCO connection change event. Event data: wiced_bt_sco_connection_change_t |
| BTM_BLE_CONNECTION_PARAM_UPDATE |
BLE connection parameter update. Event data: wiced_bt_ble_conn_param_update_t |
| BTM_BLE_PHY_UPDATE_EVT |
BLE Physical link update. Event data: wiced_bt_ble_phy_update_t |
| BTM_LPM_STATE_LOW_POWER |
BT device wake has been deasserted |
| enum wiced_bt_sec_flags_e |
| enum wiced_bt_sec_level_e |
SMP Pairing status codes
| wiced_result_t wiced_bt_dev_add_device_to_address_resolution_db | ( | wiced_bt_device_link_keys_t * | p_link_keys | ) |
Function wiced_bt_dev_add_device_to_address_resolution_db
add link key information to internal address resolution db
| [in] | p_link_keys | : link keys information stored in application side |
| wiced_bool_t wiced_bt_dev_allow_host_sleep | ( | void | ) |
Function wiced_bt_dev_allow_host_sleep
Read Host-Wake line to see if it is ok for Host to sleep
| wiced_result_t wiced_bt_dev_delete_bonded_device | ( | wiced_bt_device_address_t | bd_addr | ) |
Function wiced_bt_dev_delete_bonded_device
remove bonding with remote device with assigned bd_addr
| [in] | bd_addr | : bd_addr of remote device to be removed from bonding list |
| 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 | ||
| ) |
Function wiced_bt_dev_get_ble_keys
get le key mask from stored key information of nv ram
| [in] | bd_addr | : remote bd address |
| [out] | p_key_mask | : ble key mask stored |
| wiced_result_t wiced_bt_dev_get_bonded_devices | ( | wiced_bt_dev_bonded_device_info_t * | p_paired_device_list, |
| uint16_t * | p_num_devices | ||
| ) |
Function wiced_bt_dev_get_bonded_devices
get bonded device list
| [out] | p_paired_device_list | : array for getting bd address of bonded devices |
| in/out] | p_num_devices : list size of p_pared_device_list total number of bonded devices stored |
| wiced_bool_t wiced_bt_dev_get_low_power_mode | ( | void | ) |
Function wiced_bt_dev_get_low_power_mode
Get Current low-power mode of device
| wiced_result_t wiced_bt_dev_get_role | ( | wiced_bt_device_address_t | remote_bd_addr, |
| UINT8 * | p_role, | ||
| wiced_bt_transport_t | transport | ||
| ) |
Function wiced_bt_dev_get_role
This function is called to get the role of the local device
for the ACL connection with the specified remote device
| [in] | remote_bd_addr | : BD address of remote device |
| [in] | transport | : BT_TRANSPORT_BR_EDR or BT_TRANSPORT_LE |
| [out] | p_role | : Role of the local device |
| wiced_bool_t wiced_bt_dev_get_security_state | ( | wiced_bt_device_address_t | bd_addr, |
| uint8_t * | p_sec_flags | ||
| ) |
Function wiced_bt_dev_get_security_state
Get security flags for the device
| [in] | bd_addr | : peer address |
| [out] | p_sec_flags | : security flags (see wiced_bt_sec_flags_e) |
| void wiced_bt_dev_register_hci_trace | ( | wiced_bt_hci_trace_cback_t * | p_cback | ) |
Function wiced_bt_dev_register_hci_trace
Register to get the hci traces
| [in] | p_cback | : Callback for hci traces |
| wiced_result_t wiced_bt_dev_remove_device_from_address_resolution_db | ( | wiced_bt_device_link_keys_t * | p_link_keys | ) |
Function wiced_bt_dev_remove_device_from_address_resolution_db
remove link key information from internal address resolution db
| [in] | p_link_keys | : link keys information stored in application side |
| wiced_result_t wiced_bt_dev_set_low_power_mode | ( | wiced_bool_t | enable_low_power | ) |
Function wiced_bt_dev_set_low_power_mode
Enable or Disable low-power mode of device
| [in] | enable_low_power | : 0 to disable, 1 to enable |
| void wiced_bt_set_local_bdaddr | ( | wiced_bt_device_address_t | bd_addr | ) |
Function wiced_bt_set_local_bdaddr
Set Local Bluetooth Device Address
| [in] | bd_addr | : device address to use |
| wiced_result_t wiced_bt_set_tx_power | ( | wiced_bt_device_address_t | bd_addr, |
| int | power | ||
| ) |
Function wiced_bt_set_tx_power This command will adjust the transmit power attenuation on a per connection basis.
| [in] | bd_addr | : Remote device address |
| [in] | power | : input power to be set , range should be between -28 to 4 dbm Min Val is 4dbm and Max val is -28 |