Skip to content

Commit

Permalink
samples: Bluetooth: update peripheral_with_multiple_identities
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
henrla authored and rugeGerritsen committed Dec 4, 2024
1 parent ca40209 commit a5e4efe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ CONFIG_BT_DEVICE_NAME="Nordic Peripheral ID"
CONFIG_BT=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_EXT_ADV=y
CONFIG_BT_GAP_AUTO_UPDATE_CONN_PARAMS=n

CONFIG_BT_EXT_ADV_MAX_ADV_SET=20
CONFIG_BT_MAX_CONN=20
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ struct advertiser_info {
uint8_t id; /* ID associated with the advertiser */
};

#define MIN_ADV_INTERVAL (800)
#define MAX_ADV_INTERVAL (800)

static struct advertiser_info advertisers[CONFIG_BT_EXT_ADV_MAX_ADV_SET];

static void start_connectable_advertiser(struct k_work *work);
Expand Down Expand Up @@ -124,8 +127,8 @@ static int setup_advertiser(uint8_t id_adv)
/* Initialize the parameters for each connecable advertiser. */
struct bt_le_adv_param adv_param =
BT_LE_ADV_PARAM_INIT(BT_LE_ADV_OPT_CONNECTABLE,
BT_GAP_ADV_SLOW_INT_MIN,
BT_GAP_ADV_SLOW_INT_MAX,
MIN_ADV_INTERVAL,
MAX_ADV_INTERVAL,
NULL);

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

0 comments on commit a5e4efe

Please sign in to comment.