Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
bt_conn_auth_cb Struct Reference

#include <conn.h>

Data Fields

enum bt_security_err(* pairing_accept )(struct bt_conn *conn, const struct bt_conn_pairing_feat *const feat)
 Query to proceed incoming pairing or not. More...
 
void(* passkey_display )(struct bt_conn *conn, unsigned int passkey)
 Display a passkey to the user. More...
 
void(* passkey_entry )(struct bt_conn *conn)
 Request the user to enter a passkey. More...
 
void(* passkey_confirm )(struct bt_conn *conn, unsigned int passkey)
 Request the user to confirm a passkey. More...
 
void(* oob_data_request )(struct bt_conn *conn, struct bt_conn_oob_info *info)
 Request the user to provide Out of Band (OOB) data. More...
 
void(* cancel )(struct bt_conn *conn)
 Cancel the ongoing user request. More...
 
void(* pairing_confirm )(struct bt_conn *conn)
 Request confirmation for an incoming pairing. More...
 
void(* pincode_entry )(struct bt_conn *conn, bool highsec)
 Request the user to enter a passkey. More...
 
void(* pairing_complete )(struct bt_conn *conn, bool bonded)
 notify that pairing procedure was complete. More...
 
void(* pairing_failed )(struct bt_conn *conn, enum bt_security_err reason)
 notify that pairing process has failed. More...
 
void(* bond_deleted )(uint8_t id, const bt_addr_le_t *peer)
 Notify that bond has been deleted. More...
 

Detailed Description

Authenticated pairing callback structure

Field Documentation

◆ bond_deleted

void(* bt_conn_auth_cb::bond_deleted) (uint8_t id, const bt_addr_le_t *peer)

Notify that bond has been deleted.

This callback notifies the application that the bond information for the remote peer has been deleted

Parameters
idWhich local identity had the bond.
peerRemote address.

◆ cancel

void(* bt_conn_auth_cb::cancel) (struct bt_conn *conn)

Cancel the ongoing user request.

This callback will be called to notify the application that it should cancel any previous user request (passkey display, entry or confirmation).

This may be set to NULL, but must always be provided whenever the passkey_display, passkey_entry passkey_confirm or pairing_confirm callback has been provided.

Parameters
connConnection where pairing is currently active.

◆ oob_data_request

void(* bt_conn_auth_cb::oob_data_request) (struct bt_conn *conn, struct bt_conn_oob_info *info)

Request the user to provide Out of Band (OOB) data.

When called the user is expected to provide OOB data. The required data are indicated by the information structure.

For LE Secure Connections OOB pairing, the user should provide local OOB data, remote OOB data or both depending on their availability. Their value should be given to the stack using the bt_le_oob_set_sc_data() API.

This callback must be set to non-NULL in order to support OOB pairing.

Parameters
connConnection where pairing is currently active.
infoOOB pairing information.

◆ pairing_accept

enum bt_security_err(* bt_conn_auth_cb::pairing_accept) (struct bt_conn *conn, const struct bt_conn_pairing_feat *const feat)

Query to proceed incoming pairing or not.

On any incoming pairing req/rsp this callback will be called for the application to decide whether to allow for the pairing to continue.

The pairing info received from the peer is passed to assist making the decision.

As this callback is synchronous the application should return a response value immediately. Otherwise it may affect the timing during pairing. Hence, this information should not be conveyed to the user to take action.

The remaining callbacks are not affected by this, but do notice that other callbacks can be called during the pairing. Eg. if pairing_confirm is registered both will be called for Just-Works pairings.

This callback may be unregistered in which case pairing continues as if the Kconfig flag was not set.

This callback is not called for BR/EDR Secure Simple Pairing (SSP).

Parameters
connConnection where pairing is initiated.
featPairing req/resp info.

◆ pairing_complete

void(* bt_conn_auth_cb::pairing_complete) (struct bt_conn *conn, bool bonded)

notify that pairing procedure was complete.

This callback notifies the application that the pairing procedure has been completed.

Parameters
connConnection object.
bondedBond information has been distributed during the pairing procedure.

◆ pairing_confirm

void(* bt_conn_auth_cb::pairing_confirm) (struct bt_conn *conn)

Request confirmation for an incoming pairing.

This callback will be called to confirm an incoming pairing request where none of the other user callbacks is applicable.

If the user decides to accept the pairing the bt_conn_auth_pairing_confirm() API should be called. If the user decides to reject the pairing the bt_conn_auth_cancel() API should be called.

This callback may be set to NULL, which means that the local device lacks the ability to confirm a pairing request. If set to non-NULL the cancel callback must also be provided, since this is the only way the application can find out that it should stop requesting the user to confirm a pairing request.

Parameters
connConnection where pairing is currently active.

◆ pairing_failed

void(* bt_conn_auth_cb::pairing_failed) (struct bt_conn *conn, enum bt_security_err reason)

notify that pairing process has failed.

Parameters
connConnection object.
reasonPairing failed reason

◆ passkey_confirm

void(* bt_conn_auth_cb::passkey_confirm) (struct bt_conn *conn, unsigned int passkey)

Request the user to confirm a passkey.

When called the user is expected to confirm that the given passkey is also shown on the peer device.. The passkey will be in the range of 0 - 999999, and should be zero-padded to always be six digits (e.g. 37 would be shown as 000037).

Once the user has confirmed the passkey to match, the bt_conn_auth_passkey_confirm() API should be called. If the user concluded that the passkey doesn't match the bt_conn_auth_cancel() API should be called.

This callback may be set to NULL, which means that the local device lacks the ability to confirm a passkey. If set to non-NULL the cancel callback must also be provided, since this is the only way the application can find out that it should stop requesting the user to confirm a passkey.

Parameters
connConnection where pairing is currently active.
passkeyPasskey to be confirmed.

◆ passkey_display

void(* bt_conn_auth_cb::passkey_display) (struct bt_conn *conn, unsigned int passkey)

Display a passkey to the user.

When called the application is expected to display the given passkey to the user, with the expectation that the passkey will then be entered on the peer device. The passkey will be in the range of 0 - 999999, and is expected to be padded with zeroes so that six digits are always shown. E.g. the value 37 should be shown as 000037.

This callback may be set to NULL, which means that the local device lacks the ability do display a passkey. If set to non-NULL the cancel callback must also be provided, since this is the only way the application can find out that it should stop displaying the passkey.

Parameters
connConnection where pairing is currently active.
passkeyPasskey to show to the user.

◆ passkey_entry

void(* bt_conn_auth_cb::passkey_entry) (struct bt_conn *conn)

Request the user to enter a passkey.

When called the user is expected to enter a passkey. The passkey must be in the range of 0 - 999999, and should be expected to be zero-padded, as that's how the peer device will typically be showing it (e.g. 37 would be shown as 000037).

Once the user has entered the passkey its value should be given to the stack using the bt_conn_auth_passkey_entry() API.

This callback may be set to NULL, which means that the local device lacks the ability to enter a passkey. If set to non-NULL the cancel callback must also be provided, since this is the only way the application can find out that it should stop requesting the user to enter a passkey.

Parameters
connConnection where pairing is currently active.

◆ pincode_entry

void(* bt_conn_auth_cb::pincode_entry) (struct bt_conn *conn, bool highsec)

Request the user to enter a passkey.

This callback will be called for a BR/EDR (Bluetooth Classic) connection where pairing is being performed. Once called the user is expected to enter a PIN code with a length between 1 and 16 digits. If the highsec parameter is set to true the PIN code must be 16 digits long.

Once entered, the PIN code should be given to the stack using the bt_conn_auth_pincode_entry() API.

This callback may be set to NULL, however in that case pairing over BR/EDR will not be possible. If provided, the cancel callback must be provided as well.

Parameters
connConnection where pairing is currently active.
highsectrue if 16 digit PIN is required.

The documentation for this struct was generated from the following file: