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

Macros

#define wiced_bt_dev_set_link_policy   BTM_SetLinkPolicy
 
#define wiced_bt_set_device_class   BTM_SetDeviceClass
 

Functions

void wiced_bt_dev_pin_code_reply (wiced_bt_device_address_t bd_addr, wiced_result_t res, uint8_t pin_len, uint8_t *p_pin)
 PIN code reply used in response to BTM_PIN_REQUEST_EVT in wiced_bt_management_cback_t. More...
 
wiced_result_t wiced_bt_dev_sec_bond (wiced_bt_device_address_t bd_addr, wiced_bt_ble_address_type_t bd_addr_type, wiced_bt_transport_t transport, uint8_t pin_len, uint8_t *p_pin)
 Bond with peer device. More...
 
wiced_result_t wiced_bt_dev_sec_bond_cancel (wiced_bt_device_address_t bd_addr)
 Cancels an ongoing bonding process with the peer device. More...
 
wiced_result_t wiced_bt_dev_set_encryption (wiced_bt_device_address_t bd_addr, wiced_bt_transport_t transport, void *p_ref_data)
 Encrypts the specified connection. More...
 
void wiced_bt_dev_confirm_req_reply (wiced_result_t res, wiced_bt_device_address_t bd_addr)
 Confirms the numeric value for pairing to BTM_USER_CONFIRMATION_REQUEST_EVT of wiced_bt_management_cback_t) More...
 
void wiced_bt_dev_pass_key_req_reply (wiced_result_t res, wiced_bt_device_address_t bd_addr, uint32_t passkey)
 Provides the pairing passkey. More...
 
void wiced_bt_dev_send_key_press_notif (wiced_bt_device_address_t bd_addr, wiced_bt_dev_passkey_entry_type_t type)
 Informs a remote device of keypress during pairing. More...
 
wiced_result_t wiced_bt_dev_read_local_oob_data (void)
 Reads the local OOB data from the controller (for sending to the peer device over oob message). More...
 
void wiced_bt_dev_remote_oob_data_reply (wiced_result_t res, wiced_bt_device_address_t bd_addr, wiced_bool_t is_extended_oob_data, BT_OCTET16 c_192, BT_OCTET16 r_192, BT_OCTET16 c_256, BT_OCTET16 r_256)
 Provides the remote OOB extended data for Simple Pairing in response to BTM_REMOTE_OOB_DATA_REQUEST_EVT. More...
 
uint16_t wiced_bt_dev_build_oob_data (uint8_t *p_data, uint16_t max_len, wiced_bool_t is_extended_oob_data, BT_OCTET16 c_192, BT_OCTET16 r_192, BT_OCTET16 c_256, BT_OCTET16 r_256)
 Builds the OOB data block to be used to send OOB extended data over OOB (non-Bluetooth) link. More...
 
void wiced_bt_smp_oob_data_reply (wiced_bt_device_address_t bd_addr, wiced_result_t res, uint8_t len, uint8_t *p_data)
 Provides the OOB data for SMP in response to BTM_SMP_REMOTE_OOB_DATA_REQUEST_EVT. More...
 
wiced_bool_t wiced_bt_smp_create_local_sc_oob_data (wiced_bt_device_address_t bd_addr, wiced_bt_ble_address_type_t bd_addr_type)
 Creates local LE SC (secure connection) OOB data. More...
 
void wiced_bt_smp_sc_oob_reply (uint8_t *p_oob_data)
 Provide the SC OOB data for SMP in response to BTM_SMP_SC_REMOTE_OOB_DATA_REQUEST_EVT. More...
 
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)
 Gets the bonded device list. More...
 
wiced_result_t wiced_bt_dev_delete_bonded_device (wiced_bt_device_address_t bd_addr)
 Removes bonding with the remote device with assigned bd_addr. More...
 
wiced_bool_t wiced_bt_dev_get_security_state (wiced_bt_device_address_t bd_addr, uint8_t *p_sec_flags)
 Gets security flags for the device. More...
 
void wiced_bt_set_pairable_mode (uint8_t allow_pairing, uint8_t connect_only_paired)
 Enables or disables pairing. More...
 
wiced_bool_t wiced_bt_get_identity_address (wiced_bt_device_address_t bd_addr, wiced_bt_device_address_t identity_address)
 Returns the identity address of the given device. More...
 
wiced_result_t wiced_bt_dev_set_link_policy (wiced_bt_device_address_t remote_bda, uint16_t *settings)
 Function wiced_bt_dev_set_link_policy. More...
 
wiced_result_t wiced_bt_set_device_class (wiced_bt_dev_class_t dev_class)
 Function wiced_bt_set_device_class. More...
 
wiced_result_t wiced_bt_dev_set_local_name (char *p_name)
 Function wiced_bt_dev_set_local_name. More...
 

Detailed Description

Function Documentation

uint16_t wiced_bt_dev_build_oob_data ( uint8_t *  p_data,
uint16_t  max_len,
wiced_bool_t  is_extended_oob_data,
BT_OCTET16  c_192,
BT_OCTET16  r_192,
BT_OCTET16  c_256,
BT_OCTET16  r_256 
)

Builds the OOB data block to be used to send OOB extended data over OOB (non-Bluetooth) link.

Parameters
[out]p_dataOOB data block location
[in]max_lenOOB data block size
[in]is_extended_oob_dataTRUE if extended OOB data (for Secure Conn)
[in]c_192simple pairing Hash C derived from the P-192
[in]r_192simple pairing Randomizer R associated with the P-192 public key
[in]c_256simple pairing Hash C derived from the P-256 (if is_extended_oob_data=TRUE)
[in]r_256simple pairing Randomizer R associated with P-256 (if is_extended_oob_data=TRUE)
Returns
Number of bytes put into OOB data block.
void wiced_bt_dev_confirm_req_reply ( wiced_result_t  res,
wiced_bt_device_address_t  bd_addr 
)

Confirms the numeric value for pairing to BTM_USER_CONFIRMATION_REQUEST_EVT of wiced_bt_management_cback_t)

Parameters
[in]resresult of the operation WICED_BT_SUCCESS if success
[in]bd_addrAddress of the peer device
Returns
void
wiced_result_t wiced_bt_dev_delete_bonded_device ( wiced_bt_device_address_t  bd_addr)

Removes bonding with the remote device with assigned bd_addr.

Parameters
[in]bd_addrbd_addr of remote device to be removed from bonding list
Returns
wiced_result_t
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 
)

Gets the bonded device list.

Parameters
[out]p_paired_device_listpointer filled with BD_ADDRs of bonded devices
in/out]p_num_devices num devices to list[in], num listed[out]
Returns
wiced_result_t
wiced_bool_t wiced_bt_dev_get_security_state ( wiced_bt_device_address_t  bd_addr,
uint8_t *  p_sec_flags 
)

Gets security flags for the device.

Parameters
[in]bd_addrpeer address
[out]p_sec_flagssecurity flags (see wiced_bt_sec_flags_e)
Returns
TRUE if successful
void wiced_bt_dev_pass_key_req_reply ( wiced_result_t  res,
wiced_bt_device_address_t  bd_addr,
uint32_t  passkey 
)

Provides the pairing passkey.

Used in response to BTM_PASSKEY_REQUEST_EVT of wiced_bt_management_cback_t.

Parameters
[in]resresult of the operation WICED_BT_SUCCESS if success
[in]bd_addrAddress of the peer device
[in]passkeynumeric value in the range of 0 - 999999 (0xF423F).
Returns
void
void wiced_bt_dev_pin_code_reply ( wiced_bt_device_address_t  bd_addr,
wiced_result_t  res,
uint8_t  pin_len,
uint8_t *  p_pin 
)

PIN code reply used in response to BTM_PIN_REQUEST_EVT in wiced_bt_management_cback_t.

Parameters
[in]bd_addrAddress of the device for which PIN was requested
[in]resresult of the operation WICED_BT_SUCCESS if success
[in]pin_lenlength in bytes of the PIN Code
[in]p_pinpointer to array with the PIN Code
Returns
void
wiced_result_t wiced_bt_dev_read_local_oob_data ( void  )

Reads the local OOB data from the controller (for sending to the peer device over oob message).

When operation is completed, local OOB data is provided via BTM_READ_LOCAL_OOB_DATA_COMPLETE_EVT.

Parameters
void
Returns
wiced_result_t
void wiced_bt_dev_remote_oob_data_reply ( wiced_result_t  res,
wiced_bt_device_address_t  bd_addr,
wiced_bool_t  is_extended_oob_data,
BT_OCTET16  c_192,
BT_OCTET16  r_192,
BT_OCTET16  c_256,
BT_OCTET16  r_256 
)

Provides the remote OOB extended data for Simple Pairing in response to BTM_REMOTE_OOB_DATA_REQUEST_EVT.

Parameters
[in]bd_addrAddress of the peer device
[in]is_extended_oob_dataTRUE if extended OOB data (set according to BTM_REMOTE_OOB_DATA_REQUEST_EVT request)
[in]c_192simple pairing Hash C derived from P-192.
[in]r_192simple pairing Randomizer R associated with the P-192.
[in]c_256simple pairing Hash C derived from the P-256 (if is_extended_oob_data=TRUE)
[in]r_256simple pairing Randomizer R associated with the P-256 (if is_extended_oob_data=TRUE)
Returns
void
wiced_result_t wiced_bt_dev_sec_bond ( wiced_bt_device_address_t  bd_addr,
wiced_bt_ble_address_type_t  bd_addr_type,
wiced_bt_transport_t  transport,
uint8_t  pin_len,
uint8_t *  p_pin 
)

Bond with peer device.

If the connection is already up, but not secure, pairing is attempted.

Note
PIN parameters are only needed when bonding with legacy devices (pre-2.1 Core Spec)
Parameters
[in]bd_addrPeer device BD address to pair with.
[in]bd_addr_typeBLE_ADDR_PUBLIC or BLE_ADDR_RANDOM
[in]transportBT_TRANSPORT_BR_EDR or BT_TRANSPORT_LE
[in]pin_lenLength of input parameter p_pin (0 if not used)
[in]p_pinPointer to Pin Code to use (NULL if not used)
Returns
  • WICED_BT_PENDING if successfully initiated,
  • WICED_BT_SUCCESS if already paired to the device, else
  • WICED_BT_ERROR
wiced_result_t wiced_bt_dev_sec_bond_cancel ( wiced_bt_device_address_t  bd_addr)

Cancels an ongoing bonding process with the peer device.

Parameters
[in]bd_addrPeer device BD address to pair with
Returns
  • WICED_BT_PENDING if cancel initiated,
  • WICED_BT_SUCCESS if cancel has completed already, else error code.
void wiced_bt_dev_send_key_press_notif ( wiced_bt_device_address_t  bd_addr,
wiced_bt_dev_passkey_entry_type_t  type 
)

Informs a remote device of keypress during pairing.

Used during the passkey entry by a device with KeyboardOnly IO capabilities (typically a HID keyboard device).

Parameters
[in]bd_addrAddress of the peer device
[in]typenotification type
Returns
void
wiced_result_t wiced_bt_dev_set_encryption ( wiced_bt_device_address_t  bd_addr,
wiced_bt_transport_t  transport,
void *  p_ref_data 
)

Encrypts the specified connection.

Status is notified using BTM_ENCRYPTION_STATUS_EVT of wiced_bt_management_cback_t.

Parameters
[in]bd_addrAddress of peer device
[in]transportBT_TRANSPORT_BR_EDR or BT_TRANSPORT_LE
[in]p_ref_dataEncryption type #wiced_bt_ble_sec_action_type_t
Returns
  • WICED_BT_SUCCESS already encrypted
  • WICED_BT_PENDING command will be returned in the callback
  • WICED_BT_WRONG_MODE connection not up.
  • WICED_BT_BUSY security procedures are currently active
wiced_result_t wiced_bt_dev_set_link_policy ( wiced_bt_device_address_t  remote_bda,
uint16_t *  settings 
)

Function wiced_bt_dev_set_link_policy.

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

Parameters
[in]remote_bda: remote device's address
in/out]settings : pointer to the settings value. the policy setting is defined in hcidefs.h if the input setting consists of unsupport feature for local device, it will be cleared
Returns
wiced_result_t
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_bool_t wiced_bt_get_identity_address ( wiced_bt_device_address_t  bd_addr,
wiced_bt_device_address_t  identity_address 
)

Returns the identity address of the given device.

Parameters
[in]bd_addrpeer address
[out]identity_addressidentity address for given bd_addr
Returns
TRUE if successful
wiced_result_t wiced_bt_set_device_class ( wiced_bt_dev_class_t  dev_class)

Function wiced_bt_set_device_class.

This function is called to set the local device class

Parameters
[in]dev_class: local device class
Returns
wiced_result_t
void wiced_bt_set_pairable_mode ( uint8_t  allow_pairing,
uint8_t  connect_only_paired 
)

Enables or disables pairing.

Parameters
[in]allow_pairingWICED_TRUE or WICED_FALSE
[in]connect_only_pairedWICED_TRUE or WICED_FALSE
Returns
void
wiced_bool_t wiced_bt_smp_create_local_sc_oob_data ( wiced_bt_device_address_t  bd_addr,
wiced_bt_ble_address_type_t  bd_addr_type 
)

Creates local LE SC (secure connection) OOB data.

When the operation is completed, local OOB data is provided via BTM_SMP_SC_LOCAL_OOB_DATA_NOTIFICATION_EVT.

Parameters
[in]bd_addrintended remote address for the OOB data
[in]bd_addr_typeBLE_ADDR_PUBLIC or BLE_ADDR_PUBLIC
Returns
TRUE if creation of local SC OOB data set started.
void wiced_bt_smp_oob_data_reply ( wiced_bt_device_address_t  bd_addr,
wiced_result_t  res,
uint8_t  len,
uint8_t *  p_data 
)

Provides the OOB data for SMP in response to BTM_SMP_REMOTE_OOB_DATA_REQUEST_EVT.

Parameters
[in]bd_addrAddress of the peer device
[in]resresult of the operation WICED_BT_SUCCESS if success
[in]lenOOB data length
[in]p_dataOOB data
Returns
void
void wiced_bt_smp_sc_oob_reply ( uint8_t *  p_oob_data)

Provide the SC OOB data for SMP in response to BTM_SMP_SC_REMOTE_OOB_DATA_REQUEST_EVT.

Parameters
[in]p_oob_datapointer to OOB data requested by peer device
Returns
void