From 438dcf9e800b7e4726832221be1ad173333e631d Mon Sep 17 00:00:00 2001 From: Jared Baumann Date: Wed, 15 Feb 2023 18:50:06 -0700 Subject: [PATCH] Fixed bluetooth SC samples Fixed bluetooth SC samples to build in modern zephyr. Signed-off-by: Jared Baumann --- samples/bluetooth/peripheral_sc_only/src/main.c | 5 +++++ samples/bluetooth/sc_extensive_test/src/main.c | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/samples/bluetooth/peripheral_sc_only/src/main.c b/samples/bluetooth/peripheral_sc_only/src/main.c index 1a39cee..29e17c0 100644 --- a/samples/bluetooth/peripheral_sc_only/src/main.c +++ b/samples/bluetooth/peripheral_sc_only/src/main.c @@ -119,6 +119,9 @@ static struct bt_conn_auth_cb auth_cb_display = { .passkey_display = auth_passkey_display, .passkey_entry = NULL, .cancel = auth_cancel, +}; + +static struct bt_conn_auth_info_cb auth_info_cb = { .pairing_complete = pairing_complete, .pairing_failed = pairing_failed, }; @@ -137,7 +140,9 @@ void main(void) bt_conn_auth_cb_register(&auth_cb_display); + bt_conn_auth_info_cb_register(&auth_info_cb); bt_conn_cb_register(&conn_callbacks); + err = bt_le_adv_start(BT_LE_ADV_CONN_NAME, ad, ARRAY_SIZE(ad), NULL, 0); if (err) { diff --git a/samples/bluetooth/sc_extensive_test/src/main.c b/samples/bluetooth/sc_extensive_test/src/main.c index ac4859f..f786cd4 100644 --- a/samples/bluetooth/sc_extensive_test/src/main.c +++ b/samples/bluetooth/sc_extensive_test/src/main.c @@ -150,6 +150,10 @@ static struct bt_conn_auth_cb auth_cb_display = { .passkey_entry = NULL, .cancel = auth_cancel, .passkey_confirm = NULL, + +}; + +static struct bt_conn_auth_info_cb auth_info_cb = { .pairing_complete = pairing_complete, .pairing_failed = pairing_failed, }; @@ -168,6 +172,7 @@ void main(void) bt_conn_auth_cb_register(&auth_cb_display); + bt_conn_auth_info_cb_register(&auth_info_cb); bt_conn_cb_register(&conn_callbacks); err = bt_le_adv_start(BT_LE_ADV_CONN_NAME, ad, ARRAY_SIZE(ad), NULL, 0); @@ -276,4 +281,4 @@ SHELL_STATIC_SUBCMD_SET_CREATE(ble_smp_9116_sub, SHELL_SUBCMD_SET_END ); // static int ble_list_connected(const struct shell *shell, int argc, char **argv) -SHELL_CMD_REGISTER(testapp, &ble_smp_9116_sub, "RS9116 SMP test commands", NULL); \ No newline at end of file +SHELL_CMD_REGISTER(testapp, &ble_smp_9116_sub, "RS9116 SMP test commands", NULL);