-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
LE Audio: Add support for dynamically setting the CSIP SIRK #67548
Conversation
f89292d
to
1bcbc3d
Compare
1bcbc3d
to
193c8da
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.
Some nitpicks regarding the output for shell commands, which may be fixed in a later PR
193c8da
to
5a8f97c
Compare
@@ -110,6 +112,13 @@ static void csip_lock_changed_cb(struct bt_csip_set_coordinator_csis_inst *inst, | |||
printk("Inst %p %s\n", inst, locked ? "locked" : "released"); | |||
} | |||
|
|||
static void csip_sirk_changed_cb(struct bt_csip_set_coordinator_csis_inst *inst) |
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.
Isn´t this only checking that we receive sirk_changed once? I.e. we are setting the flag on the first notification?
Correct me if I'm wrong - but if I interpret this right, shouldnt we wait until all connections have sent the notify?
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.
Isn´t this only checking that we receive sirk_changed once? I.e. we are setting the flag on the first notification?
Correct me if I'm wrong - but if I interpret this right, shouldnt we wait until all connections have sent the notify?
Arguably yes. It doesn't really change the behavior of the test as they are running the same software: If one works, they should all work. If you prefer I can modify this to expect N
number of notifications.
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 would prefer this yes, even if you certainly are technically correct, I think that this would make the test look more logical and easier to interpret as to what should happen.
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.
@fredrikdanebjer Mind if we do that in a follow up? I'd rather try to get this into the release now, rather than postponing it due to a test update :)
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.
@Thalley that is fair enough
2c196eb
5a8f97c
to
2c196eb
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.
a couple of minor doc issues and an open question.
Rest looks good and nothing blocking 👍
|
||
This command can modify the currently used SIRK. To get the new RSI to advertise on air, | ||
:code:`bt adv-data`` or :code:`bt advertise` must be called again to set the new advertising data. | ||
If :code:`CONFIG_BT_CSIP_SET_MEMBER_NOTIFIABLE`` is enabled, this will also notify connected |
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.
a ` too much.
If :code:`CONFIG_BT_CSIP_SET_MEMBER_NOTIFIABLE`` is enabled, this will also notify connected | |
If :code:`CONFIG_BT_CSIP_SET_MEMBER_NOTIFIABLE` is enabled, this will also notify connected |
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.
@Thalley you have not addressed comments from @pin-zephyr ?
|
||
This command can modify the currently used SIRK. To get the new RSI to advertise on air, | ||
:code:`bt adv-data`` or :code:`bt advertise` must be called again to set the new advertising data. | ||
If :code:`CONFIG_BT_CSIP_SET_MEMBER_NOTIFIABLE`` is enabled, this will also notify connected |
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.
one more ` too much.
static void sirk_changed(struct bt_csip_set_coordinator_csis_inst *inst) | ||
{ | ||
struct bt_csip_set_coordinator_cb *listener; | ||
|
||
SYS_SLIST_FOR_EACH_CONTAINER(&csip_set_coordinator_cbs, listener, _node) { | ||
if (listener->sirk_changed) { | ||
listener->sirk_changed(inst); |
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.
can inst
be NULL
?
and if it can, should we check for that before looping each container ?
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.
It cannot :) And even if it can, then it would provide NULL
to the callback (which isn't documented, but that's because it isn't intentionally possible).
} | ||
|
||
CHECKIF(sirk == NULL) { | ||
LOG_DBG("NULL svc_inst"); |
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.
LOG_DBG("NULL svc_inst"); | |
LOG_DBG("NULL sirk"); |
} | ||
|
||
CHECKIF(sirk == NULL) { | ||
LOG_DBG("NULL svc_inst"); |
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.
LOG_DBG("NULL svc_inst"); | |
LOG_DBG("NULL sirk"); |
* @brief Callback when the SIRK value of a set of a connected device changes. | ||
* | ||
* @param inst The Coordinated Set Identification Service instance that was changed. | ||
* The new SIKR can be accessed via the @p inst.info. |
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 new SIKR can be accessed via the @p inst.info. | |
* The new SIRK can be accessed via the @p inst.info. |
83b2990
9106c64
to
83b2990
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.
LGTM
|
||
This command can modify the currently used SIRK. To get the new RSI to advertise on air, | ||
:code:`bt adv-data`` or :code:`bt advertise` must be called again to set the new advertising data. | ||
If :code:`CONFIG_BT_CSIP_SET_MEMBER_NOTIFIABLE`` is enabled, this will also notify connected |
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.
@Thalley you have not addressed comments from @pin-zephyr ?
printk("Getting new SIRK\n"); | ||
err = bt_csip_set_member_get_sirk(svc_inst, tmp_sirk); | ||
if (err != 0) { | ||
FAIL("Failed to set SIRK: %d\n", err); |
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.
Not going to stress on typos in test code... (not reviewing further...)
FAIL("Failed to set SIRK: %d\n", err); | |
FAIL("Failed to get SIRK: %d\n", err); |
Add support for dynamically change the SIRK in a CSIS. Signed-off-by: Emil Gydesen <[email protected]>
The print_sirk function that simply logs the SIRK has been removed, as the SIRK is now directly accessible to the application via the get_sirk function. Signed-off-by: Emil Gydesen <[email protected]>
The CSIP commands had a typo in the prefix of the shell functions. Signed-off-by: Emil Gydesen <[email protected]>
83b2990
to
6df4c94
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.
LGTM
@Thalley Given that we are past RC1 for 3.6, should this target 3.7? (assuming so I change the milestone, but please correct it if you disagree) |
3.7 is fine :) |
Add support for dynamically setting and notifying the SIRK in CSIP.
Fixes #52516