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:
parent
95c00f4d7a
commit
d595b64252
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue