Generic Security API

group ble_common_sec_api_functions

Bluetooth generic security API.

Functions

void wiced_bt_dev_configure_secure_connections_only_mode(void)

Configure device to allow connections only with secure connections supported devices.

note

API must be called only once after BTM_ENABLED_EVT event received, before starting bluetooth activity

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)

WICED_BT_PENDING : if successfully initiated, WICED_BT_SUCCESS : if already paired to the device, else error code

Parameters
  • bd_addr[in] : Peer device bd address to pair with.

  • bd_addr_type[in] : BLE_ADDR_PUBLIC or BLE_ADDR_RANDOM (applies to LE devices only)

  • transport[in] : BT_TRANSPORT_BR_EDR or BT_TRANSPORT_LE

  • pin_len[in] : Length of input parameter p_pin (0 if not used).

  • p_pin[in] : Pointer to Pin Code to use (NULL if not used).

Returns

wiced_result_t wiced_bt_dev_sec_bond_cancel(wiced_bt_device_address_t bd_addr)

Cancel an ongoing bonding process with peer device.

WICED_BT_PENDING : if cancel initiated, WICED_BT_SUCCESS : if cancel has completed already, else error code.

Parameters

bd_addr[in] : Peer device bd address to pair with.

Returns

wiced_result_t wiced_bt_dev_set_encryption(wiced_bt_device_address_t bd_addr, wiced_bt_transport_t transport, void *p_ref_data)

Encrypt the specified connection.

Status is notified using BTM_ENCRYPTION_STATUS_EVT of wiced_bt_management_cback_t.

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

Parameters
  • bd_addr[in] : Address of peer device

  • transport[in] : BT_TRANSPORT_BR_EDR or BT_TRANSPORT_LE

  • p_ref_data[in] : Encryption type wiced_bt_ble_sec_action_type_t

Returns

void wiced_bt_dev_confirm_req_reply(wiced_result_t res, wiced_bt_device_address_t bd_addr)

Confirm the numeric value for pairing (in response to BTM_USER_CONFIRMATION_REQUEST_EVT of wiced_bt_management_cback_t)

Parameters
  • res[in] : result of the operation WICED_BT_SUCCESS if success

  • bd_addr[in] : Address of the peer device

Returns

void

void wiced_bt_dev_send_key_press_notif(wiced_bt_device_address_t bd_addr, wiced_bt_dev_passkey_entry_type_t type)

Inform remote device of keypress during pairing.

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

Parameters
  • bd_addr[in] : Address of the peer device

  • type[in] : notification type

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)

get bonded device list

Parameters
  • p_paired_device_list[out] : array for getting bd address of bonded devices

  • p_num_devices[in] : list size of p_pared_device_list total number of bonded devices stored

Returns

wiced_result_t

wiced_result_t wiced_bt_dev_delete_bonded_device(wiced_bt_device_address_t bd_addr)

remove bonding with remote device with assigned bd_addr Note: This API cannot be used while being connected to the remote bd_addr

Parameters

bd_addr[in] : bd_addr of remote device to be removed from bonding list

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)

Get security flags for the device.

Parameters
Returns

TRUE if successful