refactor(ble): New callback API for pairing complete.

This commit is contained in:
Peter Johanson 2022-09-20 21:36:53 -04:00 committed by Pete Johanson
parent d513dc1766
commit 4f2f9db1d4

View file

@ -528,7 +528,6 @@ static void auth_pairing_complete(struct bt_conn *conn, bool bonded) {
static struct bt_conn_auth_cb zmk_ble_auth_cb_display = {
.pairing_accept = auth_pairing_accept,
.pairing_complete = auth_pairing_complete,
// .passkey_display = auth_passkey_display,
#if IS_ENABLED(CONFIG_ZMK_BLE_PASSKEY_ENTRY)
@ -537,6 +536,10 @@ static struct bt_conn_auth_cb zmk_ble_auth_cb_display = {
.cancel = auth_cancel,
};
static struct bt_conn_auth_info_cb zmk_ble_auth_info_cb_display = {
.pairing_complete = auth_pairing_complete,
};
static void zmk_ble_ready(int err) {
LOG_DBG("ready? %d", err);
if (err) {
@ -589,6 +592,7 @@ static int zmk_ble_init(const struct device *_arg) {
bt_conn_cb_register(&conn_callbacks);
bt_conn_auth_cb_register(&zmk_ble_auth_cb_display);
bt_conn_auth_info_cb_register(&zmk_ble_auth_info_cb_display);
zmk_ble_ready(0);