Skip to content
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

Bluetooth: Update audio Object Transfer Client, move alongside Object Transfer Service #42086

Merged
merged 30 commits into from
Mar 7, 2022

Conversation

asbjornsabo
Copy link
Collaborator

@asbjornsabo asbjornsabo commented Jan 24, 2022

An Object Transfer Client (OTC) has been developed and maintained along with the le-audio profiles and services, as the le-audio Media Control Client depends upon OTC to be full-featured.

The purpose of this PR is to make this OTC implementation "official" and available.
The PR moves the OTC implementation from the le-audio code to alongside the corresponding Object Transfer Service.
The OTC code is cleaned up a bit, and is also updated to use the existing OTS definitions and L2CAP library to avoid duplication.

UPDATE: Additional commits to unify client and server more, including merging the two header files.

The OTC is used by the media control client, and is covered by BabbleSim tests for that module.

The initial implementation the OTC was done by Leif Aschehoug [email protected]
The code has later been updated and maintained by Emil Gydesen [email protected] and Asbjørn Sæbø [email protected]

Note:
Commits 2 and 3 deal with removing remains of the old OTS implementation that also existed in the le-audio code (and which the starting point for, and was replaced by, the current OTS code).
Commit 4 is the move from the le-audio code to alongside the OTS, in the "bluetooth/services/ots" folder
Fixes #41592

@asbjornsabo asbjornsabo added area: Tests Issues related to a particular existing or missing test area: Bluetooth Audio labels Jan 24, 2022
@github-actions github-actions bot added area: API Changes to public APIs area: Bluetooth area: Bluetooth Host Bluetooth Host (excluding BR/EDR) labels Jan 24, 2022
@asbjornsabo
Copy link
Collaborator Author

@ekohandel I was not able to add you as a reviewer to the PR. But since you are one of the users of OTS, I would like you to review this PR anyway.

@ekohandel
Copy link
Contributor

@ekohandel I was not able to add you as a reviewer to the PR. But since you are one of the users of OTS, I would like you to review this PR anyway.

@asbjornsabo, I am unable to comment on the Kconfig.otc file as it was only renamed but it looks like this file hasn't been generalized yet as it has references to bluetooth audio. Also I think it make sense for BT_AUDIO to depend on or select BT_OTC instead of other way around?

Copy link
Contributor

@ekohandel ekohandel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asbjornsabo, it will probably take me a few days to get through this, I work on this as a side project and not part of my day job so I don't have as much time as I would like to put towards it. I will continue to submit my comments in an incremental fashion. Thanks for including me in this review.

subsys/bluetooth/services/ots/otc.c Outdated Show resolved Hide resolved
include/bluetooth/services/otc.h Outdated Show resolved Hide resolved
include/bluetooth/services/otc.h Outdated Show resolved Hide resolved
include/bluetooth/services/otc.h Outdated Show resolved Hide resolved
include/bluetooth/services/otc.h Outdated Show resolved Hide resolved
include/bluetooth/services/otc.h Outdated Show resolved Hide resolved
include/bluetooth/services/otc.h Outdated Show resolved Hide resolved
include/bluetooth/services/otc.h Outdated Show resolved Hide resolved
include/bluetooth/services/otc.h Outdated Show resolved Hide resolved
include/bluetooth/services/otc.h Outdated Show resolved Hide resolved
include/bluetooth/services/otc.h Outdated Show resolved Hide resolved
subsys/bluetooth/services/ots/ots_l2cap.c Outdated Show resolved Hide resolved
subsys/bluetooth/services/ots/ots_l2cap.c Outdated Show resolved Hide resolved
subsys/bluetooth/services/ots/ots_l2cap.c Outdated Show resolved Hide resolved
subsys/bluetooth/services/ots/ots_l2cap.c Outdated Show resolved Hide resolved
subsys/bluetooth/services/ots/CMakeLists.txt Outdated Show resolved Hide resolved
@asbjornsabo asbjornsabo force-pushed the otc branch 7 times, most recently from 7fd3349 to 803ab9b Compare January 28, 2022 14:08
Move the directory listing size defines to the OTS directory listing
internal header file.

This removes an implicit dependency upon users of
ots_dir_list_internal.h to also include ots_internal.h.

Signed-off-by: Asbjørn Sæbø <[email protected]>
Update the Object Transfer Client to use OTS defines and types instead
of the ones left over from the previous "le-audio local" object
transfer service:
DIR_LIST, object ID size, OACP and OLCP

Remove the no longer used defines and types from the OTC header file.
Exception: The OLCP sort order defines have not been removed, but
moved to the olcp internal header file, for expected later use.

Signed-off-by: Asbjørn Sæbø <[email protected]>
Minor updates to documentation in OTC header file.

Signed-off-by: Asbjørn Sæbø <[email protected]>
Rename functions to follow common pattern (module, action, noun).

Signed-off-by: Asbjørn Sæbø <[email protected]>
Mark the OTC implementation as experimental

Signed-off-by: Asbjørn Sæbø <[email protected]>
Merge Kconfig file for OTS server and client.
Rename the client config from _OTC to _OTS_CLIENT

Signed-off-by: Asbjørn Sæbø <[email protected]>
Rename OTS client files from "otc" to "ots_client".

Signed-off-by: Asbjørn Sæbø <[email protected]>
Move defines from public API to implementation (only used there).

Signed-off-by: Asbjørn Sæbø <[email protected]>
Small clean-ups to client code: Making variables const, adding a value
to a debug print.

Signed-off-by: Asbjørn Sæbø <[email protected]>
Use Kconfig value for object name size also for client.

Signed-off-by: Asbjørn Sæbø <[email protected]>
Move the metadata request bitfields to the common header files.
This is part of merging the ots_client and ots header files.

Signed-off-by: Asbjørn Sæbø <[email protected]>
Merge the metadata types for client and server.
This is part of merging the ots_client and ots header files.

Signed-off-by: Asbjørn Sæbø <[email protected]>
- Move content of client header file to common header file.
- Rename content from "otc" to "ots_client".
- Remove empty client header file.
- Update users.

Signed-off-by: Asbjørn Sæbø <[email protected]>
Rename client callbacks to be more consistent with common code style.

Signed-off-by: Asbjørn Sæbø <[email protected]>
Rename two defines for internal consistency in file.

Signed-off-by: Asbjørn Sæbø <[email protected]>
Remove #include of conn_internal.h - cast conn pointers to void for
logging instead.

Signed-off-by: Asbjørn Sæbø <[email protected]>
Move the instance as the first parameter of the client function calls
and callbacks, for consistency with the server implementation.

Signed-off-by: Asbjørn Sæbø <[email protected]>
Use a value for "Unknown object ID" that is outside of the range of
valid object IDs.

Signed-off-by: Asbjørn Sæbø <[email protected]>
Rename the data and metadata callbacks to _read(), for consistency
with the corresponding function calls.

Signed-off-by: Asbjørn Sæbø <[email protected]>
@asbjornsabo
Copy link
Collaborator Author

Rebase with no changes again.
The previous rebase was intended to get in the fix for the failing mesh test, but for some reason that did not happen, so the test was still failing.

@asbjornsabo asbjornsabo requested review from kapi-no and Thalley March 1, 2022 14:10
@carlescufi carlescufi merged commit 68144f5 into zephyrproject-rtos:main Mar 7, 2022
@asbjornsabo asbjornsabo deleted the otc branch March 8, 2022 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: API Changes to public APIs area: Bluetooth Audio area: Bluetooth Host Bluetooth Host (excluding BR/EDR) area: Bluetooth area: Build System area: Tests Issues related to a particular existing or missing test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Object Transfer Service Client made "official"
9 participants