PebbleOS
Loading...
Searching...
No Matches
Functions
Pairing confirmation

Ask the user to confirm a pairing request. More...

Functions

void pbl_bt_pairing_confirm (const struct pbl_bt_pairing_confirm_ctx *ctx, bool is_confirmed)
 Answer a pairing request.
 
void pbl_bt_cb_pairing_confirm_handle_request (const struct pbl_bt_pairing_confirm_ctx *ctx, const char *device_name, const char *confirmation_token)
 Called when a device requests pairing and the user must confirm it.
 
void pbl_bt_cb_pairing_confirm_handle_completed (const struct pbl_bt_pairing_confirm_ctx *ctx, bool success)
 Called when a pairing process finished.
 

Detailed Description

Ask the user to confirm a pairing request.

void pbl_bt_cb_pairing_confirm_handle_request(const struct pbl_bt_pairing_confirm_ctx *ctx,
const char *device_name,
const char *confirmation_token) {
// Show the token, then on the user's answer:
pbl_bt_pairing_confirm(ctx, user_accepted);
}
void pbl_bt_pairing_confirm(const struct pbl_bt_pairing_confirm_ctx *ctx, bool is_confirmed)
Answer a pairing request.
void pbl_bt_cb_pairing_confirm_handle_request(const struct pbl_bt_pairing_confirm_ctx *ctx, const char *device_name, const char *confirmation_token)
Called when a device requests pairing and the user must confirm it.

Function Documentation

◆ pbl_bt_cb_pairing_confirm_handle_completed()

void pbl_bt_cb_pairing_confirm_handle_completed ( const struct pbl_bt_pairing_confirm_ctx *  ctx,
bool  success 
)
extern

Called when a pairing process finished.

Parameters
ctxThe pairing process, see pbl_bt_cb_pairing_confirm_handle_request().
successtrue if the pairing succeeded.

◆ pbl_bt_cb_pairing_confirm_handle_request()

void pbl_bt_cb_pairing_confirm_handle_request ( const struct pbl_bt_pairing_confirm_ctx *  ctx,
const char *  device_name,
const char *  confirmation_token 
)
extern

Called when a device requests pairing and the user must confirm it.

Parameters
ctxIdentifies the pairing process. Compare it to tell processes apart, but never dereference it: it may be released at any time, for example when the pairing times out. The NimBLE backend uses the connection handle.
device_nameName of the device, or NULL if not available.
confirmation_tokenNumeric comparison value to display, or NULL if not available.
Note
device_name and confirmation_token are only valid during the call.

◆ pbl_bt_pairing_confirm()

void pbl_bt_pairing_confirm ( const struct pbl_bt_pairing_confirm_ctx *  ctx,
bool  is_confirmed 
)

Answer a pairing request.

Parameters
ctxThe pairing process, as passed to pbl_bt_cb_pairing_confirm_handle_request().
is_confirmedtrue if the user confirmed the pairing.