sample: Bluetooth: Add BT_SETTINGS for connected ISO samples

Add BT_SETTINGS support for the samples as well as
enabling security.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
Emil Gydesen 2022-07-07 16:32:47 +02:00 committed by Carles Cufí
parent 95c00f4d7a
commit d595b64252
4 changed files with 30 additions and 0 deletions

View file

@ -1,3 +1,11 @@
CONFIG_BT=y
CONFIG_BT_DEBUG_LOG=y
CONFIG_BT_ISO_CENTRAL=y
CONFIG_BT_SMP=y
CONFIG_BT_KEYS_OVERWRITE_OLDEST=y
CONFIG_BT_SETTINGS=y
CONFIG_FLASH=y
CONFIG_FLASH_MAP=y
CONFIG_NVS=y
CONFIG_SETTINGS=y

View file

@ -16,6 +16,7 @@
#include <zephyr/bluetooth/uuid.h>
#include <zephyr/bluetooth/gatt.h>
#include <zephyr/bluetooth/iso.h>
#include <zephyr/settings/settings.h>
#include <zephyr/sys/byteorder.h>
static void start_scan(void);
@ -230,10 +231,18 @@ void main(void)
return;
}
if (IS_ENABLED(CONFIG_SETTINGS)) {
settings_load();
}
printk("Bluetooth initialized\n");
iso_chan.ops = &iso_ops;
iso_chan.qos = &iso_qos;
#if defined(CONFIG_BT_SMP)
iso_chan.required_sec_level = BT_SECURITY_L2,
#endif /* CONFIG_BT_SMP */
channels[0] = &iso_chan;
param.cis_channels = channels;

View file

@ -2,3 +2,11 @@ CONFIG_BT=y
CONFIG_BT_DEBUG_LOG=y
CONFIG_BT_DEVICE_NAME="Zephyr ISO server"
CONFIG_BT_ISO_PERIPHERAL=y
CONFIG_BT_SMP=y
CONFIG_BT_KEYS_OVERWRITE_OLDEST=y
CONFIG_BT_SETTINGS=y
CONFIG_FLASH=y
CONFIG_FLASH_MAP=y
CONFIG_NVS=y
CONFIG_SETTINGS=y

View file

@ -16,6 +16,7 @@
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/conn.h>
#include <zephyr/bluetooth/iso.h>
#include <zephyr/settings/settings.h>
static const struct bt_data ad[] = {
BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)),
@ -157,6 +158,10 @@ void main(void)
return;
}
if (IS_ENABLED(CONFIG_SETTINGS)) {
settings_load();
}
printk("Bluetooth initialized\n");
err = bt_iso_server_register(&iso_server);