-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
771caba to
7afe802
Compare
56d6b00 to
1209301
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.
Pull request overview
Copilot reviewed 26 out of 26 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| * scanning instances can expire changing the ticks_current value while we are querying for | ||
| * aux_offset value. | ||
| */ | ||
| #define MAX_RETRY_TICKS_CURRENT_CHANGE ((CONFIG_BT_CTLR_ADV_AUX_SET) - 1U + 2U) |
Copilot
AI
Nov 22, 2025
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.
[nitpick] Extra space in the macro definition. There are two spaces between -1U and +, should be one for consistency.
| #define MAX_RETRY_TICKS_CURRENT_CHANGE ((CONFIG_BT_CTLR_ADV_AUX_SET) - 1U + 2U) | |
| #define MAX_RETRY_TICKS_CURRENT_CHANGE ((CONFIG_BT_CTLR_ADV_AUX_SET) - 1U + 2U) |
| @@ -0,0 +1,30 @@ | |||
| # Increased to 4 gives one each of legacy, 2M, 1M and Coded PHY advertising sets | |||
Copilot
AI
Nov 22, 2025
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.
Typo in comment: "gives" should be "give" (subject-verb agreement with "Increased to 4").
| # Increased to 4 gives one each of legacy, 2M, 1M and Coded PHY advertising sets | |
| # Increased to 4 give one each of legacy, 2M, 1M and Coded PHY advertising sets |
f617a43 to
08574e2
Compare
Enable similar Controller Kconfig features between nRF52 and nRF5340 BabbleSIM LE Audio testing. Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
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 <vich@nordicsemi.no>
Fix missing auxiliary chain pdu time reservation. Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
08574e2 to
6182459
Compare
Update broadcaster_multiple sample to start multiple advertising sets of type legacy and extended advertising. Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Move Zephyr Controller Kconfigs to overlay file. Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Move harness and tags to common section for observer and broadcaster_multiple samples. Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Do not use the BT_ prefix for definitions not provided by the Bluetooth subsystem. Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
6182459 to
ae67cdc
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.
Pull request overview
Copilot reviewed 25 out of 25 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
| #define AD_DATA_NAME_SIZE (sizeof(CONFIG_BT_DEVICE_NAME) - 1U + 2U) | ||
| #define AD_DATA_MFG_DATA_SIZE (254U + 2U) |
Copilot
AI
Nov 27, 2025
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.
[nitpick] Inconsistent naming: The macro prefix has been changed from BT_AD_DATA_ to AD_DATA_, but this creates inconsistency with Zephyr Bluetooth naming conventions. Other similar macros in the codebase typically use the BT_ prefix for Bluetooth-related definitions. Consider keeping the BT_ prefix for consistency.
| /* Maximum retries when ticks_current can change, example, when 3 extended advertising sets | ||
| * configured, and 1 advertising set is calculating the aux_offset, 2 other advertising sets and 2 | ||
| * scanning instances can expire changing the ticks_current value while we are querying for |
Copilot
AI
Nov 27, 2025
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 comment phrase "example, when 3 extended advertising sets configured" is missing articles. It should read "for example, when 3 extended advertising sets are configured" for grammatical correctness.
| /* Maximum retries when ticks_current can change, example, when 3 extended advertising sets | |
| * configured, and 1 advertising set is calculating the aux_offset, 2 other advertising sets and 2 | |
| * scanning instances can expire changing the ticks_current value while we are querying for | |
| /* Maximum retries when ticks_current can change; for example, when 3 extended advertising sets are | |
| * configured, and 1 advertising set is calculating the aux_offset, 2 other advertising sets and 2 | |
| * scanning instances can expire, changing the ticks_current value while we are querying for |
| #endif /* !CONFIG_BT_CTLR_PHY_CODED */ | ||
| #else /* !CONFIG_BT_OBSERVER */ | ||
| /* Active connection in peripheral role with legacy scanning on 1M. | ||
| /* Simultaneous 3 extended advertising sets calculating aux offsets. |
Copilot
AI
Nov 27, 2025
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.
Inconsistent punctuation and grammar: The comment on line 36 reads "Simultaneous 3 extended advertising sets calculating aux offsets." This should be "Simultaneous 3 extended advertising sets, calculating aux offsets." (adding comma) or better yet "3 simultaneous extended advertising sets calculating aux offsets." for better readability.
| /* Simultaneous 3 extended advertising sets calculating aux offsets. | |
| /* 3 simultaneous extended advertising sets calculating aux offsets. |
| @@ -0,0 +1,30 @@ | |||
| # Increased to 4 gives one each of legacy, 2M, 1M and Coded PHY advertising sets | |||
Copilot
AI
Nov 27, 2025
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 comment incorrectly states "Increased to 4" when the value is being set for the first time in this new file. This should say "Set to 4" or "Value of 4" to accurately describe the configuration.
| # Increased to 4 gives one each of legacy, 2M, 1M and Coded PHY advertising sets | |
| # Set to 4 to give one each of legacy, 2M, 1M and Coded PHY advertising sets |
| uint32_t ticks_to_start; | ||
| uint32_t ticks_elapsed; | ||
| uint32_t ticks_now; |
Copilot
AI
Nov 27, 2025
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.
Variable declarations should be placed at the beginning of the function block, not after executable statements. The variables ticks_to_start, ticks_elapsed, and ticks_now are declared at line 3339-3341, after the assertion comment on line 3338. These should be moved to the top of the function with the other variable declarations (lines 3200-3215) to follow C89/C90 coding standards typically used in embedded systems.
|
@jhedberg and @alwa-nordic do review when possible. |



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:
