refactor(ble): New callback API for pairing complete.
This commit is contained in:
parent
d513dc1766
commit
4f2f9db1d4
1 changed files with 5 additions and 1 deletions
|
@ -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 = {
|
static struct bt_conn_auth_cb zmk_ble_auth_cb_display = {
|
||||||
.pairing_accept = auth_pairing_accept,
|
.pairing_accept = auth_pairing_accept,
|
||||||
.pairing_complete = auth_pairing_complete,
|
|
||||||
// .passkey_display = auth_passkey_display,
|
// .passkey_display = auth_passkey_display,
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_ZMK_BLE_PASSKEY_ENTRY)
|
#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,
|
.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) {
|
static void zmk_ble_ready(int err) {
|
||||||
LOG_DBG("ready? %d", err);
|
LOG_DBG("ready? %d", err);
|
||||||
if (err) {
|
if (err) {
|
||||||
|
@ -589,6 +592,7 @@ static int zmk_ble_init(const struct device *_arg) {
|
||||||
|
|
||||||
bt_conn_cb_register(&conn_callbacks);
|
bt_conn_cb_register(&conn_callbacks);
|
||||||
bt_conn_auth_cb_register(&zmk_ble_auth_cb_display);
|
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);
|
zmk_ble_ready(0);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue