Skip to content

Commit 1976e39

Browse files
sample: bluetooth: mesh: start using BT_APP_PASSKEY
BT_FIXED_PASSKEY is deprecated, thus we start using BT_APP_PASSKEY Signed-off-by: alperen sener <[email protected]>
1 parent 190ff63 commit 1976e39

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

samples/bluetooth/mesh/common/smp_bt_auth.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,18 @@ static void pairing_confirm(struct bt_conn *conn)
4747
printk("Pairing confirmed: %s\n", addr);
4848
}
4949

50+
static uint32_t app_passkey(struct bt_conn *conn)
51+
{
52+
return bt_mesh_le_pair_resp_passkey_get();
53+
}
54+
5055
static struct bt_conn_auth_cb auth_cb = {
5156
/* Enable passkey_display callback to enable the display capability. */
5257
.passkey_display = passkey_display,
5358
/* These 2 callbacks are required for passkey_display callback. */
5459
.cancel = cancel,
5560
.pairing_confirm = pairing_confirm,
61+
.app_passkey = app_passkey,
5662
};
5763

5864
static void pairing_complete(struct bt_conn *conn, bool bonded)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CONFIG_MCUMGR_TRANSPORT_BT_PERM_RW_AUTHEN=y
22
CONFIG_BT_SMP=y
3-
CONFIG_BT_FIXED_PASSKEY=y
3+
CONFIG_BT_APP_PASSKEY=y
44
CONFIG_BT_MESH_LE_PAIR_RESP=y
55
CONFIG_BT_SMP_SC_ONLY=y
66
CONFIG_BT_SMP_ALLOW_UNAUTH_OVERWRITE=n

0 commit comments

Comments
 (0)