Samples: Bluetooth: HF: Fix link key missing issue
The bonding info is not loaded after the Bluetooth initialization again. Call settings_load after the Bluetooth initialized. Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
This commit is contained in:
parent
276dc8c138
commit
c803b1e1f4
1 changed files with 5 additions and 0 deletions
|
@ -17,6 +17,7 @@
|
||||||
#include <zephyr/bluetooth/bluetooth.h>
|
#include <zephyr/bluetooth/bluetooth.h>
|
||||||
#include <zephyr/bluetooth/conn.h>
|
#include <zephyr/bluetooth/conn.h>
|
||||||
#include <zephyr/bluetooth/classic/hfp_hf.h>
|
#include <zephyr/bluetooth/classic/hfp_hf.h>
|
||||||
|
#include <zephyr/settings/settings.h>
|
||||||
|
|
||||||
static void connected(struct bt_conn *conn)
|
static void connected(struct bt_conn *conn)
|
||||||
{
|
{
|
||||||
|
@ -88,6 +89,10 @@ static void bt_ready(int err)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (IS_ENABLED(CONFIG_SETTINGS)) {
|
||||||
|
settings_load();
|
||||||
|
}
|
||||||
|
|
||||||
printk("Bluetooth initialized\n");
|
printk("Bluetooth initialized\n");
|
||||||
|
|
||||||
err = bt_br_set_connectable(true);
|
err = bt_br_set_connectable(true);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue