diff --git a/samples/bluetooth/central_and_peripheral_hr/src/main.c b/samples/bluetooth/central_and_peripheral_hr/src/main.c index 15621a10600..ea1ebd9d2f0 100644 --- a/samples/bluetooth/central_and_peripheral_hr/src/main.c +++ b/samples/bluetooth/central_and_peripheral_hr/src/main.c @@ -197,12 +197,11 @@ static void pairing_failed(struct bt_conn *conn, enum bt_security_err reason) bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); - printk("Pairing failed conn: %s, reason %d\n", addr, reason); + printk("Pairing failed conn: %s, reason %d %s\n", addr, reason, + bt_security_err_to_str(reason)); } -static const struct bt_conn_auth_cb auth_callbacks = { - .cancel = auth_cancel -}; +static const struct bt_conn_auth_cb auth_callbacks = {.cancel = auth_cancel}; static struct bt_conn_auth_info_cb conn_auth_info_callbacks = { .pairing_complete = pairing_complete, @@ -294,8 +293,8 @@ static void security_changed(struct bt_conn *conn, bt_security_t level, if (!err) { printk("Security changed: %s level %u\n", addr, level); } else { - printk("Security failed: %s level %u err %d\n", addr, level, - err); + printk("Security failed: %s level %u err %d %s\n", addr, level, err, + bt_security_err_to_str(err)); } if (conn == central_conn) { diff --git a/samples/bluetooth/central_bas/src/main.c b/samples/bluetooth/central_bas/src/main.c index a481b1e1f04..84a12d9537a 100644 --- a/samples/bluetooth/central_bas/src/main.c +++ b/samples/bluetooth/central_bas/src/main.c @@ -230,8 +230,8 @@ static void security_changed(struct bt_conn *conn, bt_security_t level, if (!err) { printk("Security changed: %s level %u\n", addr, level); } else { - printk("Security failed: %s level %u err %d\n", addr, level, - err); + printk("Security failed: %s level %u err %d %s\n", addr, level, err, + bt_security_err_to_str(err)); } gatt_discover(conn); @@ -348,10 +348,10 @@ static void pairing_failed(struct bt_conn *conn, enum bt_security_err reason) bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); - printk("Pairing failed conn: %s, reason %d\n", addr, reason); + printk("Pairing failed conn: %s, reason %d %s\n", addr, reason, + bt_security_err_to_str(reason)); } - static struct bt_conn_auth_cb conn_auth_callbacks = { .cancel = auth_cancel, }; diff --git a/samples/bluetooth/central_hids/src/main.c b/samples/bluetooth/central_hids/src/main.c index 221e8ddbaaa..9d1610bb51d 100644 --- a/samples/bluetooth/central_hids/src/main.c +++ b/samples/bluetooth/central_hids/src/main.c @@ -252,8 +252,8 @@ static void security_changed(struct bt_conn *conn, bt_security_t level, if (!err) { printk("Security changed: %s level %u\n", addr, level); } else { - printk("Security failed: %s level %u err %d\n", addr, level, - err); + printk("Security failed: %s level %u err %d %s\n", addr, level, err, + bt_security_err_to_str(err)); } gatt_discover(conn); @@ -621,7 +621,8 @@ static void pairing_failed(struct bt_conn *conn, enum bt_security_err reason) bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); - printk("Pairing failed conn: %s, reason %d\n", addr, reason); + printk("Pairing failed conn: %s, reason %d %s\n", addr, reason, + bt_security_err_to_str(reason)); } static struct bt_conn_auth_cb conn_auth_callbacks = { diff --git a/samples/bluetooth/central_nfc_pairing/src/main.c b/samples/bluetooth/central_nfc_pairing/src/main.c index 6da49bf415c..1546c5d605b 100644 --- a/samples/bluetooth/central_nfc_pairing/src/main.c +++ b/samples/bluetooth/central_nfc_pairing/src/main.c @@ -202,8 +202,8 @@ static void security_changed(struct bt_conn *conn, bt_security_t level, if (!err) { printk("Security changed: %s level %u\n", addr, level); } else { - printk("Security failed: %s level %u err %d\n", addr, level, - err); + printk("Security failed: %s level %u err %d %s\n", addr, level, err, + bt_security_err_to_str(err)); } } @@ -325,7 +325,8 @@ static void pairing_failed(struct bt_conn *conn, enum bt_security_err reason) bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); - printk("Pairing failed conn: %s, reason %d\n", addr, reason); + printk("Pairing failed conn: %s, reason %d %s\n", addr, reason, + bt_security_err_to_str(reason)); k_poll_signal_raise(&pair_signal, 0); bt_le_oob_set_sc_flag(false); diff --git a/samples/bluetooth/central_smp_client/src/main.c b/samples/bluetooth/central_smp_client/src/main.c index 5f8ef801931..6f09e6be791 100644 --- a/samples/bluetooth/central_smp_client/src/main.c +++ b/samples/bluetooth/central_smp_client/src/main.c @@ -213,8 +213,8 @@ static void security_changed(struct bt_conn *conn, bt_security_t level, if (!err) { printk("Security changed: %s level %u\n", addr, level); } else { - printk("Security failed: %s level %u err %d\n", addr, level, - err); + printk("Security failed: %s level %u err %d %s\n", addr, level, err, + bt_security_err_to_str(err)); } } diff --git a/samples/bluetooth/central_uart/src/main.c b/samples/bluetooth/central_uart/src/main.c index 46a839cc055..3307d6c5e99 100644 --- a/samples/bluetooth/central_uart/src/main.c +++ b/samples/bluetooth/central_uart/src/main.c @@ -427,8 +427,8 @@ static void security_changed(struct bt_conn *conn, bt_security_t level, if (!err) { LOG_INF("Security changed: %s level %u", addr, level); } else { - LOG_WRN("Security failed: %s level %u err %d", addr, - level, err); + LOG_WRN("Security failed: %s level %u err %d %s", addr, level, err, + bt_security_err_to_str(err)); } gatt_discover(conn); @@ -539,7 +539,8 @@ static void pairing_failed(struct bt_conn *conn, enum bt_security_err reason) bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); - LOG_WRN("Pairing failed conn: %s, reason %d", addr, reason); + LOG_WRN("Pairing failed conn: %s, reason %d %s", addr, reason, + bt_security_err_to_str(reason)); } static struct bt_conn_auth_cb conn_auth_callbacks = { diff --git a/samples/bluetooth/fast_pair/input_device/src/main.c b/samples/bluetooth/fast_pair/input_device/src/main.c index 1739baf689d..fdb47ece5dd 100644 --- a/samples/bluetooth/fast_pair/input_device/src/main.c +++ b/samples/bluetooth/fast_pair/input_device/src/main.c @@ -237,7 +237,8 @@ static void security_changed(struct bt_conn *conn, bt_security_t level, enum bt_ if (!err) { LOG_INF("Security changed: %s level %u", addr, level); } else { - LOG_WRN("Security failed: %s level %u err %d", addr, level, err); + LOG_WRN("Security failed: %s level %u err %d %s", addr, level, err, + bt_security_err_to_str(err)); } } diff --git a/samples/bluetooth/fast_pair/locator_tag/src/fp_adv.c b/samples/bluetooth/fast_pair/locator_tag/src/fp_adv.c index 427f7dcb0da..7aeaed7a3b3 100644 --- a/samples/bluetooth/fast_pair/locator_tag/src/fp_adv.c +++ b/samples/bluetooth/fast_pair/locator_tag/src/fp_adv.c @@ -392,7 +392,8 @@ static void security_changed(struct bt_conn *conn, bt_security_t level, enum bt_ if (!err) { LOG_INF("Security changed: %s level %u", addr, level); } else { - LOG_WRN("Security failed: %s level %u err %d", addr, level, err); + LOG_WRN("Security failed: %s level %u err %d %s", addr, level, err, + bt_security_err_to_str(err)); } } diff --git a/samples/bluetooth/llpm/src/main.c b/samples/bluetooth/llpm/src/main.c index cb15cd093a0..0257b56917e 100644 --- a/samples/bluetooth/llpm/src/main.c +++ b/samples/bluetooth/llpm/src/main.c @@ -392,10 +392,9 @@ static void test_run(void) } } -void security_changed(struct bt_conn *conn, bt_security_t level, - enum bt_security_err err) +void security_changed(struct bt_conn *conn, bt_security_t level, enum bt_security_err err) { - printk("Security changed: level %i, err: %i\n", level, err); + printk("Security changed: level %i, err: %i %s\n", level, err, bt_security_err_to_str(err)); if (err != 0) { printk("Failed to encrypt link\n"); diff --git a/samples/bluetooth/peripheral_ams_client/src/main.c b/samples/bluetooth/peripheral_ams_client/src/main.c index 3ee5b6b0816..e3e2fa25af8 100644 --- a/samples/bluetooth/peripheral_ams_client/src/main.c +++ b/samples/bluetooth/peripheral_ams_client/src/main.c @@ -306,8 +306,8 @@ static void security_changed(struct bt_conn *conn, bt_security_t level, } } } else { - printk("Security failed: %s level %u err %d\n", addr, level, - err); + printk("Security failed: %s level %u err %d %s\n", addr, level, err, + bt_security_err_to_str(err)); } } @@ -343,7 +343,8 @@ static void pairing_failed(struct bt_conn *conn, enum bt_security_err reason) bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); - printk("Pairing failed conn: %s, reason %d\n", addr, reason); + printk("Pairing failed conn: %s, reason %d %s\n", addr, reason, + bt_security_err_to_str(reason)); bt_conn_disconnect(conn, BT_HCI_ERR_REMOTE_USER_TERM_CONN); } diff --git a/samples/bluetooth/peripheral_ancs_client/src/main.c b/samples/bluetooth/peripheral_ancs_client/src/main.c index 95e86ca7515..1a69eb9cc78 100644 --- a/samples/bluetooth/peripheral_ancs_client/src/main.c +++ b/samples/bluetooth/peripheral_ancs_client/src/main.c @@ -364,8 +364,8 @@ static void security_changed(struct bt_conn *conn, bt_security_t level, discover_gattp(conn); } } else { - printk("Security failed: %s level %u err %d\n", addr, level, - err); + printk("Security failed: %s level %u err %d %s\n", addr, level, err, + bt_security_err_to_str(err)); } } @@ -401,7 +401,8 @@ static void pairing_failed(struct bt_conn *conn, enum bt_security_err reason) bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); - printk("Pairing failed conn: %s, reason %d\n", addr, reason); + printk("Pairing failed conn: %s, reason %d %s\n", addr, reason, + bt_security_err_to_str(reason)); bt_conn_disconnect(conn, BT_HCI_ERR_REMOTE_USER_TERM_CONN); } diff --git a/samples/bluetooth/peripheral_bms/src/main.c b/samples/bluetooth/peripheral_bms/src/main.c index 6fef3abd5a7..4b00ccec07e 100644 --- a/samples/bluetooth/peripheral_bms/src/main.c +++ b/samples/bluetooth/peripheral_bms/src/main.c @@ -77,8 +77,8 @@ static void security_changed(struct bt_conn *conn, bt_security_t level, if (!err) { printk("Security changed: %s level %u\n", addr, level); } else { - printk("Security failed: %s level %u err %d\n", addr, level, - err); + printk("Security failed: %s level %u err %d %s\n", addr, level, err, + bt_security_err_to_str(err)); } } @@ -122,7 +122,8 @@ static void pairing_failed(struct bt_conn *conn, enum bt_security_err reason) bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); - printk("Pairing failed conn: %s, reason %d\n", addr, reason); + printk("Pairing failed conn: %s, reason %d %s\n", addr, reason, + bt_security_err_to_str(reason)); } static struct bt_conn_auth_cb conn_auth_callbacks = { diff --git a/samples/bluetooth/peripheral_cgms/src/main.c b/samples/bluetooth/peripheral_cgms/src/main.c index 1ba6d8e70fa..30dda4c2295 100644 --- a/samples/bluetooth/peripheral_cgms/src/main.c +++ b/samples/bluetooth/peripheral_cgms/src/main.c @@ -64,8 +64,8 @@ static void security_changed(struct bt_conn *conn, bt_security_t level, enum bt_ if (!err) { printk("Security changed: %s level %u\n", addr, level); } else { - printk("Security failed: %s level %u err %d\n", addr, level, - err); + printk("Security failed: %s level %u err %d %s\n", addr, level, err, + bt_security_err_to_str(err)); } } diff --git a/samples/bluetooth/peripheral_cts_client/src/main.c b/samples/bluetooth/peripheral_cts_client/src/main.c index 0b53dbd4732..dfb9eb6de3a 100644 --- a/samples/bluetooth/peripheral_cts_client/src/main.c +++ b/samples/bluetooth/peripheral_cts_client/src/main.c @@ -206,8 +206,8 @@ static void security_changed(struct bt_conn *conn, bt_security_t level, enable_notifications(); } else { - printk("Security failed: %s level %u err %d\n", addr, level, - err); + printk("Security failed: %s level %u err %d %s\n", addr, level, err, + bt_security_err_to_str(err)); } } @@ -243,7 +243,8 @@ static void pairing_failed(struct bt_conn *conn, enum bt_security_err reason) bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); - printk("Pairing failed conn: %s, reason %d\n", addr, reason); + printk("Pairing failed conn: %s, reason %d %s\n", addr, reason, + bt_security_err_to_str(reason)); bt_conn_disconnect(conn, BT_HCI_ERR_REMOTE_USER_TERM_CONN); } diff --git a/samples/bluetooth/peripheral_gatt_dm/src/main.c b/samples/bluetooth/peripheral_gatt_dm/src/main.c index 27c1e6579dd..73e9196c929 100644 --- a/samples/bluetooth/peripheral_gatt_dm/src/main.c +++ b/samples/bluetooth/peripheral_gatt_dm/src/main.c @@ -109,8 +109,8 @@ static void security_changed(struct bt_conn *conn, bt_security_t level, enum bt_ if (!err) { printk("Security changed: %s level %u\n", addr, level); } else { - printk("Security failed: %s level %u err %d\n", addr, level, - err); + printk("Security failed: %s level %u err %d %s\n", addr, level, err, + bt_security_err_to_str(err)); } } @@ -157,7 +157,8 @@ static void pairing_failed(struct bt_conn *conn, enum bt_security_err reason) bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); - printk("Pairing failed conn: %s, reason %d\n", addr, reason); + printk("Pairing failed conn: %s, reason %d %s\n", addr, reason, + bt_security_err_to_str(reason)); if (pairing_confirmation_conn) { bt_conn_unref(pairing_confirmation_conn); diff --git a/samples/bluetooth/peripheral_hids_keyboard/src/main.c b/samples/bluetooth/peripheral_hids_keyboard/src/main.c index 5690e4a1e75..274748549a0 100644 --- a/samples/bluetooth/peripheral_hids_keyboard/src/main.c +++ b/samples/bluetooth/peripheral_hids_keyboard/src/main.c @@ -333,12 +333,11 @@ static void security_changed(struct bt_conn *conn, bt_security_t level, if (!err) { printk("Security changed: %s level %u\n", addr, level); } else { - printk("Security failed: %s level %u err %d\n", addr, level, - err); + printk("Security failed: %s level %u err %d %s\n", addr, level, err, + bt_security_err_to_str(err)); } } - BT_CONN_CB_DEFINE(conn_callbacks) = { .connected = connected, .disconnected = disconnected, @@ -611,10 +610,10 @@ static void pairing_failed(struct bt_conn *conn, enum bt_security_err reason) bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); - printk("Pairing failed conn: %s, reason %d\n", addr, reason); + printk("Pairing failed conn: %s, reason %d %s\n", addr, reason, + bt_security_err_to_str(reason)); } - static struct bt_conn_auth_cb conn_auth_callbacks = { .passkey_display = auth_passkey_display, .passkey_confirm = auth_passkey_confirm, diff --git a/samples/bluetooth/peripheral_hids_mouse/src/main.c b/samples/bluetooth/peripheral_hids_mouse/src/main.c index 245ad4c3220..2a5c4620d2b 100644 --- a/samples/bluetooth/peripheral_hids_mouse/src/main.c +++ b/samples/bluetooth/peripheral_hids_mouse/src/main.c @@ -346,13 +346,12 @@ static void security_changed(struct bt_conn *conn, bt_security_t level, if (!err) { printk("Security changed: %s level %u\n", addr, level); } else { - printk("Security failed: %s level %u err %d\n", addr, level, - err); + printk("Security failed: %s level %u err %d %s\n", addr, level, err, + bt_security_err_to_str(err)); } } #endif - BT_CONN_CB_DEFINE(conn_callbacks) = { .connected = connected, .disconnected = disconnected, @@ -644,10 +643,10 @@ static void pairing_failed(struct bt_conn *conn, enum bt_security_err reason) bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); - printk("Pairing failed conn: %s, reason %d\n", addr, reason); + printk("Pairing failed conn: %s, reason %d %s\n", addr, reason, + bt_security_err_to_str(reason)); } - static struct bt_conn_auth_cb conn_auth_callbacks = { .passkey_display = auth_passkey_display, .passkey_confirm = auth_passkey_confirm, diff --git a/samples/bluetooth/peripheral_lbs/src/main.c b/samples/bluetooth/peripheral_lbs/src/main.c index c7facd1f4df..954eedaa682 100644 --- a/samples/bluetooth/peripheral_lbs/src/main.c +++ b/samples/bluetooth/peripheral_lbs/src/main.c @@ -79,8 +79,8 @@ static void security_changed(struct bt_conn *conn, bt_security_t level, if (!err) { printk("Security changed: %s level %u\n", addr, level); } else { - printk("Security failed: %s level %u err %d\n", addr, level, - err); + printk("Security failed: %s level %u err %d %s\n", addr, level, err, + bt_security_err_to_str(err)); } } #endif @@ -127,7 +127,8 @@ static void pairing_failed(struct bt_conn *conn, enum bt_security_err reason) bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); - printk("Pairing failed conn: %s, reason %d\n", addr, reason); + printk("Pairing failed conn: %s, reason %d %s\n", addr, reason, + bt_security_err_to_str(reason)); } static struct bt_conn_auth_cb conn_auth_callbacks = { diff --git a/samples/bluetooth/peripheral_mds/src/main.c b/samples/bluetooth/peripheral_mds/src/main.c index cbf4ec1499e..a486a71d252 100644 --- a/samples/bluetooth/peripheral_mds/src/main.c +++ b/samples/bluetooth/peripheral_mds/src/main.c @@ -54,8 +54,8 @@ static void security_changed(struct bt_conn *conn, bt_security_t level, if (!err) { printk("Security changed: %s level %u\n", addr, level); } else { - printk("Security failed: %s level %u err %d\n", addr, level, - err); + printk("Security failed: %s level %u err %d %s\n", addr, level, err, + bt_security_err_to_str(err)); } if (level >= BT_SECURITY_L2) { @@ -112,7 +112,8 @@ static void pairing_failed(struct bt_conn *conn, enum bt_security_err reason) bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); - printk("Pairing failed conn: %s, reason %d\n", addr, reason); + printk("Pairing failed conn: %s, reason %d %s\n", addr, reason, + bt_security_err_to_str(reason)); if (pairing_confirmation_conn) { pairing_confirmation_conn = NULL; diff --git a/samples/bluetooth/peripheral_nfc_pairing/src/main.c b/samples/bluetooth/peripheral_nfc_pairing/src/main.c index e188c7b74da..3a997009c9e 100644 --- a/samples/bluetooth/peripheral_nfc_pairing/src/main.c +++ b/samples/bluetooth/peripheral_nfc_pairing/src/main.c @@ -333,7 +333,8 @@ static void pairing_failed(struct bt_conn *conn, enum bt_security_err reason) bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); - printk("Pairing failed conn: %s, reason %d\n", addr, reason); + printk("Pairing failed conn: %s, reason %d %s\n", addr, reason, + bt_security_err_to_str(reason)); k_poll_signal_raise(&pair_signal, 0); bt_le_oob_set_sc_flag(false); @@ -414,8 +415,8 @@ static void security_changed(struct bt_conn *conn, bt_security_t level, enum bt_ if (!err) { printk("Security changed: %s level %u\n", addr, level); } else { - printk("Security failed: %s level %u err %d\n", addr, level, - err); + printk("Security failed: %s level %u err %d %s\n", addr, level, err, + bt_security_err_to_str(err)); } } diff --git a/samples/bluetooth/peripheral_power_profiling/src/main.c b/samples/bluetooth/peripheral_power_profiling/src/main.c index 71d69358f80..0b991304b2a 100644 --- a/samples/bluetooth/peripheral_power_profiling/src/main.c +++ b/samples/bluetooth/peripheral_power_profiling/src/main.c @@ -184,8 +184,8 @@ static void security_changed(struct bt_conn *conn, bt_security_t level, enum bt_ if (!err) { printk("Security changed: %s level %u\n", addr, level); } else { - printk("Security failed: %s level %u err %d\n", addr, level, - err); + printk("Security failed: %s level %u err %d %s\n", addr, level, err, + bt_security_err_to_str(err)); } } @@ -332,7 +332,8 @@ static void pairing_failed(struct bt_conn *conn, enum bt_security_err reason) bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); - printk("Pairing failed conn: %s, reason %d\n", addr, reason); + printk("Pairing failed conn: %s, reason %d %s\n", addr, reason, + bt_security_err_to_str(reason)); /* Generate new pairing keys if pairing procedure failed. */ k_work_submit(&key_generate_work); diff --git a/samples/bluetooth/peripheral_rscs/src/main.c b/samples/bluetooth/peripheral_rscs/src/main.c index 99de1edb0fa..ca4bd26f5bb 100644 --- a/samples/bluetooth/peripheral_rscs/src/main.c +++ b/samples/bluetooth/peripheral_rscs/src/main.c @@ -152,8 +152,8 @@ static void security_changed(struct bt_conn *conn, bt_security_t level, enum bt_ if (!err) { printk("Security changed: %s level %u\n", addr, level); } else { - printk("Security failed: %s level %u err %d\n", addr, level, - err); + printk("Security failed: %s level %u err %d %s\n", addr, level, err, + bt_security_err_to_str(err)); } } #endif @@ -200,7 +200,8 @@ static void pairing_failed(struct bt_conn *conn, enum bt_security_err reason) bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); - printk("Pairing failed conn: %s, reason %d\n", addr, reason); + printk("Pairing failed conn: %s, reason %d %s\n", addr, reason, + bt_security_err_to_str(reason)); } static struct bt_conn_auth_cb conn_auth_callbacks = { diff --git a/samples/bluetooth/peripheral_status/src/main.c b/samples/bluetooth/peripheral_status/src/main.c index fc5d08dcf02..3e8fc2c703b 100644 --- a/samples/bluetooth/peripheral_status/src/main.c +++ b/samples/bluetooth/peripheral_status/src/main.c @@ -82,8 +82,8 @@ static void security_changed(struct bt_conn *conn, bt_security_t level, if (!err) { printk("Security changed: %s level %u\n", addr, level); } else { - printk("Security failed: %s level %u err %d\n", addr, level, - err); + printk("Security failed: %s level %u err %d %s\n", addr, level, err, + bt_security_err_to_str(err)); } } #endif @@ -130,7 +130,8 @@ static void pairing_failed(struct bt_conn *conn, enum bt_security_err reason) bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); - printk("Pairing failed conn: %s, reason %d\n", addr, reason); + printk("Pairing failed conn: %s, reason %d %s\n", addr, reason, + bt_security_err_to_str(reason)); } static struct bt_conn_auth_cb conn_auth_callbacks = { diff --git a/samples/bluetooth/peripheral_uart/src/main.c b/samples/bluetooth/peripheral_uart/src/main.c index 58f4b13d557..7d47ceb9688 100644 --- a/samples/bluetooth/peripheral_uart/src/main.c +++ b/samples/bluetooth/peripheral_uart/src/main.c @@ -381,8 +381,8 @@ static void security_changed(struct bt_conn *conn, bt_security_t level, if (!err) { LOG_INF("Security changed: %s level %u", addr, level); } else { - LOG_WRN("Security failed: %s level %u err %d", addr, - level, err); + LOG_WRN("Security failed: %s level %u err %d %s", addr, level, err, + bt_security_err_to_str(err)); } } #endif @@ -444,10 +444,10 @@ static void pairing_failed(struct bt_conn *conn, enum bt_security_err reason) bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); - LOG_INF("Pairing failed conn: %s, reason %d", addr, reason); + LOG_INF("Pairing failed conn: %s, reason %d %s", addr, reason, + bt_security_err_to_str(reason)); } - static struct bt_conn_auth_cb conn_auth_callbacks = { .passkey_display = auth_passkey_display, .passkey_confirm = auth_passkey_confirm, diff --git a/samples/bluetooth/shell_bt_nus/src/main.c b/samples/bluetooth/shell_bt_nus/src/main.c index 6f5120cbd8d..da16f93e1a8 100644 --- a/samples/bluetooth/shell_bt_nus/src/main.c +++ b/samples/bluetooth/shell_bt_nus/src/main.c @@ -76,8 +76,8 @@ static void __attribute__((unused)) security_changed(struct bt_conn *conn, if (!err) { LOG_INF("Security changed: %s level %u", addr, level); } else { - LOG_INF("Security failed: %s level %u err %d", addr, level, - err); + LOG_INF("Security failed: %s level %u err %d %s", addr, level, err, + bt_security_err_to_str(err)); } } @@ -105,7 +105,8 @@ static void pairing_complete(struct bt_conn *conn, bool bonded) static void pairing_failed(struct bt_conn *conn, enum bt_security_err reason) { - LOG_INF("Pairing failed conn: %s, reason %d", log_addr(conn), reason); + LOG_INF("Pairing failed conn: %s, reason %d %s", log_addr(conn), reason, + bt_security_err_to_str(reason)); } static struct bt_conn_auth_cb conn_auth_callbacks = { diff --git a/samples/bluetooth/throughput/src/main.c b/samples/bluetooth/throughput/src/main.c index 2abaa1a0d1d..59f73458330 100644 --- a/samples/bluetooth/throughput/src/main.c +++ b/samples/bluetooth/throughput/src/main.c @@ -213,10 +213,10 @@ static void connected(struct bt_conn *conn, uint8_t hci_err) } } -void security_changed(struct bt_conn *conn, bt_security_t level, - enum bt_security_err security_err) +void security_changed(struct bt_conn *conn, bt_security_t level, enum bt_security_err security_err) { - printk("Security changed: level %i, err: %i\n", level, security_err); + printk("Security changed: level %i, err: %i %s\n", level, security_err, + bt_security_err_to_str(security_err)); if (security_err != 0) { printk("Failed to encrypt link\n");