-
Notifications
You must be signed in to change notification settings - Fork 7.8k
samples: Bluetooth: Broadcast multiple legacy and extended advertising #94304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
samples: Bluetooth: Broadcast multiple legacy and extended advertising #94304
Conversation
49255ab
to
771caba
Compare
Enable similar Controller Kconfig features between nRF52 and nRF5340 BabbleSIM LE Audio testing. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Tune the aux offset calculation overhead assertion to use EVENT_OVERHEAD_START_US; this is the correct maximum overhead causing ISR latency for start of a radio event that occurs thereafter. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Workaround by using `-start_offset` to ensure that the ACL established does not overlap the sink being established. Relates to commit 490da9e ("tests: bsim: Bluetooth: Workaround overlapping ACL in BAP broadcast sink"). Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Update broadcaster_multiple sample to start multiple advertising sets of type legacy and extended advertising. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
771caba
to
7afe802
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll leave the same comment here as I usually do when you modify the samples for testing purposes: IMO samples should not be used for this purpose, and should be kept as simple as possible. I don't think the changes to the sample here will help users, and it seems to only be done to help test some features, which should done in a separate test application, instead of (ab)using samples for test purposes
/* Use Coded PHY */ | ||
if ((index % 4) == 3) { | ||
adv_param.options = BT_LE_ADV_OPT_EXT_ADV; | ||
adv_param.options |= BT_LE_ADV_OPT_CODED; | ||
ad = ad_long; | ||
ad_size = ARRAY_SIZE(ad_long); | ||
/* Use 1M auxiliary PDU */ | ||
} else if ((index % 4) == 2) { | ||
adv_param.options = BT_LE_ADV_OPT_EXT_ADV; | ||
adv_param.options |= BT_LE_ADV_OPT_NO_2M; | ||
ad = ad_long; | ||
ad_size = ARRAY_SIZE(ad_long); | ||
/* Use 2M auxiliary PDU */ | ||
} else if ((index % 4) == 1) { | ||
adv_param.options = BT_LE_ADV_OPT_EXT_ADV; | ||
ad = ad_long; | ||
ad_size = ARRAY_SIZE(ad_long); | ||
/* Use 1M legacy PDU */ | ||
} else { | ||
adv_param.options = BT_LE_ADV_OPT_NONE; | ||
ad = ad_short; | ||
ad_size = ARRAY_SIZE(ad_short); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider moving this into a select
function to simplify the loop.
Also consider storing this in an array like
struct {
uint32_t options;
const struct bt_data *ad;
size_t ad_size
} adv_params[4];
So you can do things like (index % sizeof(adv_params) == 2U)
. Alternatively you can also make it a circular linked list and just get the next entry for each iteration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using an array is a better implementation, will update the PR.
printk("Failed to create advertising set %d (err %d)\n", | ||
index, err); | ||
/* Failed creating Coded PHY advertising set? */ | ||
if (adv_param.options & BT_LE_ADV_OPT_CODED) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (adv_param.options & BT_LE_ADV_OPT_CODED) { | |
if ((adv_param.options & BT_LE_ADV_OPT_CODED) != 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the changes to this file also be applied to the other bt_ll_sw_split
files in hci_ipc
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The two added where the Kconfig defaults already... but made sense to have it here to be similar to one used for hci_uart
, the overlay-all-bt_ll_sw_split.conf
or the one used in audio bsim tests. Will review other files and make similar changes as required.
There are no samples today demonstrating advertising both legacy and extended advertising (LL CI testing has coverage already); Certain phones do not fully/correctly support extended advertising and it has been a need to have advertising both legacy and extended in certain usecases to have a general inter-operability with phones not supporting versus ones that support. |
# Enable Coded PHY support in Zephyr Controller, if testing 4 advertising sets | ||
# CONFIG_BT_CTLR_PHY_CODED=y |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jhedberg Currently, the Controller specific is commented for this sample, do you agree that this be moved to a overlay and sample document/readme updated according to indicate the same, right?
Update broadcaster_multiple sample to start multiple advertising sets of type legacy and extended advertising.
How they appear on-air (BabbleSim import), for 4 advertising sets:
