Skip to content

Commit a5e4efe

Browse files
henrlarugeGerritsen
authored andcommitted
samples: Bluetooth: update peripheral_with_multiple_identities
Add Kconfig option to disable automatic connection update. This is done to avoid having warnings printed when used together with the sample scanning_while_connecting. The advertising interval is also updated to make the scanning_while_connecting sample run faster when used together with the peripheral_with_multiple_identities sample. Signed-off-by: Henrik Lander <[email protected]>
1 parent ca40209 commit a5e4efe

File tree

2 files changed

+6
-2
lines changed
  • samples/bluetooth/peripheral_with_multiple_identities

2 files changed

+6
-2
lines changed

samples/bluetooth/peripheral_with_multiple_identities/prj.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ CONFIG_BT_DEVICE_NAME="Nordic Peripheral ID"
99
CONFIG_BT=y
1010
CONFIG_BT_PERIPHERAL=y
1111
CONFIG_BT_EXT_ADV=y
12+
CONFIG_BT_GAP_AUTO_UPDATE_CONN_PARAMS=n
1213

1314
CONFIG_BT_EXT_ADV_MAX_ADV_SET=20
1415
CONFIG_BT_MAX_CONN=20

samples/bluetooth/peripheral_with_multiple_identities/src/main.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ struct advertiser_info {
2222
uint8_t id; /* ID associated with the advertiser */
2323
};
2424

25+
#define MIN_ADV_INTERVAL (800)
26+
#define MAX_ADV_INTERVAL (800)
27+
2528
static struct advertiser_info advertisers[CONFIG_BT_EXT_ADV_MAX_ADV_SET];
2629

2730
static void start_connectable_advertiser(struct k_work *work);
@@ -124,8 +127,8 @@ static int setup_advertiser(uint8_t id_adv)
124127
/* Initialize the parameters for each connecable advertiser. */
125128
struct bt_le_adv_param adv_param =
126129
BT_LE_ADV_PARAM_INIT(BT_LE_ADV_OPT_CONNECTABLE,
127-
BT_GAP_ADV_SLOW_INT_MIN,
128-
BT_GAP_ADV_SLOW_INT_MAX,
130+
MIN_ADV_INTERVAL,
131+
MAX_ADV_INTERVAL,
129132
NULL);
130133

131134
printk("Using current id: %u\n", id_adv);

0 commit comments

Comments
 (0)