-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Bluetooth: BAP: Add a set of suggested intervals to use with BAP #81093
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,6 +32,7 @@ | |
| #include <zephyr/bluetooth/addr.h> | ||
| #include <zephyr/bluetooth/bluetooth.h> | ||
| #include <zephyr/bluetooth/conn.h> | ||
| #include <zephyr/bluetooth/gap.h> | ||
| #include <zephyr/bluetooth/iso.h> | ||
| #include <zephyr/net_buf.h> | ||
| #include <zephyr/sys/slist.h> | ||
|
|
@@ -51,6 +52,100 @@ extern "C" { | |
| /** An invalid Broadcast ID */ | ||
| #define BT_BAP_INVALID_BROADCAST_ID 0xFFFFFFFFU | ||
|
|
||
| /** | ||
|
||
| * @brief Recommended connectable advertising parameters | ||
| * | ||
| * If connection has not been established after 30 seconds, the device should switch to | ||
| * @ref BT_BAP_ADV_PARAM_CONN_REDUCED | ||
| * | ||
| * Defined by Table 8.1 in BAP 1.0.2 | ||
| */ | ||
| #define BT_BAP_ADV_PARAM_CONN_QUICK \ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In this file we now use
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The BT Core spec uses "FAST" and "SLOW" when defining the values The BAP spec does not defines values for advertising, but the BAP macros for advertising in this PR uses SLOW and FAST. The Core spec does not defined slow/fast values for connection parameters, and only has Not sure if it makes sense to define SLOW and FAST for connection parameters, since those are not defined by Zephyr or Core Spec either. The BAP spec uses the following terminology I'm OK to modify it to always be
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I do not have a strong opinion on this. But I believe it may make sense to align terminology with existing macros
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typically, I always open up a Spec PDF and search for terms like "quick" or "reduced", in this case the BAP spec. Hence, I will keep the If the other new defined with
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @rugeGerritsen Please re-review :) |
||
| BT_LE_ADV_PARAM(BT_LE_ADV_OPT_CONN | BT_LE_ADV_OPT_EXT_ADV, BT_GAP_MS_TO_ADV_INTERVAL(20), \ | ||
| BT_GAP_MS_TO_ADV_INTERVAL(30), NULL) | ||
|
|
||
| /** | ||
| * @brief Reduced connectable advertising parameters | ||
| * | ||
| * Defined by Table 8.1 in BAP 1.0.2 | ||
| */ | ||
| #define BT_BAP_ADV_PARAM_CONN_REDUCED \ | ||
| BT_LE_ADV_PARAM(BT_LE_ADV_OPT_CONN | BT_LE_ADV_OPT_EXT_ADV, \ | ||
| BT_GAP_MS_TO_ADV_INTERVAL(150), BT_GAP_MS_TO_ADV_INTERVAL(150), NULL) | ||
|
|
||
| /** | ||
| * @brief Recommended connection parameters for initial connection request for 7.5 ms SDU interval | ||
| * | ||
| * Once service discovery has completed and a stream is setup, it is recommended to switch to | ||
| * @ref BT_BAP_CONN_PARAM_RELAXED | ||
| * | ||
| * Defined by Table 8.3 in BAP 1.0.2 | ||
| */ | ||
| #define BT_BAP_CONN_PARAM_SHORT_7_5 \ | ||
| BT_LE_CONN_PARAM(BT_GAP_US_TO_CONN_INTERVAL(7500), BT_GAP_MS_TO_CONN_INTERVAL(30), 0, \ | ||
| BT_GAP_MS_TO_CONN_TIMEOUT(4000)) | ||
|
|
||
| /** | ||
| * @brief Recommended connection parameters for initial connection request for 10 ms SDU interval | ||
| * | ||
| * Once service discovery has completed and a stream is setup, it is recommended to switch to | ||
| * @ref BT_BAP_CONN_PARAM_RELAXED | ||
| * | ||
| * Defined by Table 8.3 in BAP 1.0.2 | ||
| */ | ||
| #define BT_BAP_CONN_PARAM_SHORT_10 \ | ||
| BT_LE_CONN_PARAM(BT_GAP_MS_TO_CONN_INTERVAL(10), BT_GAP_MS_TO_CONN_INTERVAL(30), 0, \ | ||
| BT_GAP_MS_TO_CONN_TIMEOUT(4000)) | ||
|
|
||
| /** | ||
| * @brief Recommended connection parameters for coexistence of ACL and ISO | ||
| * | ||
| * Defined by Table 8.3 in BAP 1.0.2 | ||
| */ | ||
| #define BT_BAP_CONN_PARAM_RELAXED \ | ||
| BT_LE_CONN_PARAM(BT_GAP_MS_TO_CONN_INTERVAL(50), BT_GAP_MS_TO_CONN_INTERVAL(70), 0, \ | ||
| BT_GAP_MS_TO_CONN_TIMEOUT(4000)) | ||
|
|
||
| /** | ||
| * @brief Fast advertising parameters for broadcast audio | ||
| * | ||
| * This is suitable for both 7.5 ms and 10 ms SDU intervals, but prioritizes lower time to | ||
| * synchronize over coexistence with ISO and power consumption. | ||
| */ | ||
| #define BT_BAP_ADV_PARAM_BROADCAST_FAST \ | ||
| BT_LE_ADV_PARAM(BT_LE_ADV_OPT_EXT_ADV, BT_GAP_MS_TO_ADV_INTERVAL(60), \ | ||
| BT_GAP_MS_TO_ADV_INTERVAL(60), NULL) | ||
|
|
||
| /** | ||
| * @brief Slow advertising parameters for broadcast audio | ||
| * | ||
| * This is suitable for both 7.5 ms and 10 ms SDU intervals, but prioritizes coexistence with ISO | ||
| * and power consumption over lower time to synchronize. | ||
| */ | ||
| #define BT_BAP_ADV_PARAM_BROADCAST_SLOW \ | ||
| BT_LE_ADV_PARAM(BT_LE_ADV_OPT_EXT_ADV, BT_GAP_MS_TO_ADV_INTERVAL(150), \ | ||
| BT_GAP_MS_TO_ADV_INTERVAL(150), NULL) | ||
|
|
||
| /** | ||
| * @brief Fast advertising parameters for broadcast audio | ||
| * | ||
| * This is suitable for both 7.5 ms and 10 ms SDU intervals, but prioritizes lower time to | ||
| * synchronize over coexistence with ISO and power consumption. | ||
| */ | ||
| #define BT_BAP_PER_ADV_PARAM_BROADCAST_FAST \ | ||
| BT_LE_PER_ADV_PARAM(BT_GAP_MS_TO_PER_ADV_INTERVAL(60), BT_GAP_MS_TO_PER_ADV_INTERVAL(60), \ | ||
| BT_LE_PER_ADV_OPT_NONE) | ||
|
|
||
| /** | ||
| * @brief Slow advertising parameters for broadcast audio | ||
| * | ||
| * This is suitable for both 7.5 ms and 10 ms SDU intervals, but prioritizes coexistence with ISO | ||
| * and power consumption over lower time to synchronize. | ||
| */ | ||
| #define BT_BAP_PER_ADV_PARAM_BROADCAST_SLOW \ | ||
| BT_LE_PER_ADV_PARAM(BT_GAP_MS_TO_PER_ADV_INTERVAL(150), \ | ||
| BT_GAP_MS_TO_PER_ADV_INTERVAL(150), BT_LE_PER_ADV_OPT_NONE) | ||
|
|
||
| /** | ||
| * @brief Check if a BAP BASS BIS_Sync bitfield is valid | ||
| * | ||
|
|
||




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 BAP specification suggests to use an advertising interval of 20-30 ms or 150 ms. See https://www.bluetooth.com/specifications/specs/bap-1-0-2/. Is there a reason for not sticking to that?