From 1e80efaa1b4520949dc7b4b81a0683d457f19725 Mon Sep 17 00:00:00 2001 From: Joakim Andersson Date: Wed, 5 Feb 2020 14:08:09 +0100 Subject: [PATCH] Bluetooth: samples: peripheral_dis: Sample requires BT_SETTINGS The DIS service requires BT_SETTINGS otherwise it will not have a settings handler. Instead DIS will only use Kconfig to set it's values. Fixes: #22478 Signed-off-by: Joakim Andersson --- samples/bluetooth/peripheral_dis/prj.conf | 1 + samples/bluetooth/peripheral_dis/src/main.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/samples/bluetooth/peripheral_dis/prj.conf b/samples/bluetooth/peripheral_dis/prj.conf index e9c319ada68..3b88987ce0e 100644 --- a/samples/bluetooth/peripheral_dis/prj.conf +++ b/samples/bluetooth/peripheral_dis/prj.conf @@ -17,6 +17,7 @@ CONFIG_BT_GATT_DIS_SW_REV_STR="Zephyr Software" CONFIG_BT_DEVICE_NAME="DIS peripheral" # Below is setup to let DIS information be read from settings +CONFIG_BT_SETTINGS=y CONFIG_SETTINGS_RUNTIME=y CONFIG_SETTINGS=y CONFIG_SETTINGS_NONE=y diff --git a/samples/bluetooth/peripheral_dis/src/main.c b/samples/bluetooth/peripheral_dis/src/main.c index b99fa8d23df..ecfb4207534 100644 --- a/samples/bluetooth/peripheral_dis/src/main.c +++ b/samples/bluetooth/peripheral_dis/src/main.c @@ -88,6 +88,10 @@ void main(void) return; } + if (IS_ENABLED(CONFIG_BT_SETTINGS)) { + settings_load(); + } + settings_runtime_load(); printk("Bluetooth initialized\n");