Skip to content

RFC struct btd_service in core

Mikel Astiz linux-bluetooth 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v0 RFC Latest11 patches 9 repliesIn review

Patches in v0 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11core: Add btd_service to represent device servicesMakefile.am src/service.c src/service.h+256 -03 replies
2/11device: Use btd_service to represent profilessrc/device.c+53 -232 replies
3/11device: Replace connected_profiles with btd_servicesrc/device.c+57 -253 replies
4/11device: Find services instead of profilessrc/device.c+8 -90 replies
5/11device: Replace pending profile list with servicessrc/device.c+27 -191 reply
6/11profile: Use btd_service for probing profilesprofiles/audio/control.c profiles/audio/control.h profiles/audio/manager.c +17 more+123 -910 replies
7/11audio: Hold a reference to btd_serviceprofiles/audio/control.c profiles/audio/control.h profiles/audio/manager.c +4 more+49 -170 replies
8/11network: Hold a reference to btd_serviceprofiles/network/connection.c profiles/network/connection.h profiles/network/manager.c+37 -530 replies
9/11input: Hold a reference to btd_serviceprofiles/input/device.c profiles/input/device.h profiles/input/manager.c+48 -750 replies
10/11service: Add callbacks to track state changessrc/service.c src/service.h+56 -00 replies
11/11profile: Use btd_service for connect/disconnectMakefile.plugins profiles/audio/control.c profiles/audio/manager.c +15 more+128 -2900 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v0 yet.

Read the v0 thread

Cover letter [RFC v0 00/11] struct btd_service in core

From: Mikel Astiz <[email protected]>

This RFC proposes a somewhat intrusive change in the core with the adoption of struct btd_service, with the following main goals:

1. Support for multiple instances of the same UUID.
2. Better support for connection-handling plugins/components (e.g. automotive).
3. Exposure of remote services in D-Bus (not implemented here).
4. Improve code readability and reduce profile-implementation code size.

There's a lot of changes and many points open for discussion, so before working further (splitting, testing) I'd like to have some upstream feedback.

As a suggestion for a first review, I'd say the most relevant patches are 01/11, 06/11 and 11/11.

Cheers,
Mikel

Mikel Astiz (11):
core: Add btd_service to represent device services
device: Use btd_service to represent profiles
device: Replace connected_profiles with btd_service
device: Find services instead of profiles
device: Replace pending profile list with services
profile: Use btd_service for probing profiles
audio: Hold a reference to btd_service
network: Hold a reference to btd_service
input: Hold a reference to btd_service
service: Add callbacks to track state changes
profile: Use btd_service for connect/disconnect

 Makefile.am                          |   1 +
 Makefile.plugins                     |   4 +-
 profiles/audio/control.c             |  52 ++++++--
 profiles/audio/control.h             |   7 +-
 profiles/audio/manager.c             |  80 ++++-------
 profiles/audio/manager.h             |   7 -
 profiles/audio/sink.c                |  24 ++--
 profiles/audio/sink.h                |   4 +-
 profiles/audio/source.c              |  25 ++--
 profiles/audio/source.h              |   5 +-
 profiles/cyclingspeed/cyclingspeed.c |   9 +-
 profiles/deviceinfo/deviceinfo.c     |  11 +-
 profiles/gatt/gas.c                  |  10 +-
 profiles/health/hdp_manager.c        |  10 +-
 profiles/heartrate/heartrate.c       |  10 +-
 profiles/input/device.c              |  95 +++++++------
 profiles/input/device.h              |  13 +-
 profiles/input/hog.c                 |   8 +-
 profiles/input/manager.c             |  51 +------
 profiles/input/manager.h             |  25 ----
 profiles/network/connection.c        |  77 +++++------
 profiles/network/connection.h        |   8 +-
 profiles/network/manager.c           | 123 ++---------------
 profiles/network/manager.h           |  25 ----
 profiles/proximity/manager.c         |  28 ++--
 profiles/proximity/reporter.c        |   8 +-
 profiles/proximity/reporter.h        |   5 +-
 profiles/sap/manager.c               |   1 +
 profiles/scanparam/scan.c            |   9 +-
 profiles/thermometer/thermometer.c   |  11 +-
 src/device.c                         | 230 +++++++++++++++++++++-----------
 src/device.h                         |   5 -
 src/profile.c                        |  40 +++---
 src/profile.h                        |  14 +-
 src/service.c                        | 250 +++++++++++++++++++++++++++++++++++
 src/service.h                        |  61 +++++++++
 36 files changed, 793 insertions(+), 553 deletions(-)
 delete mode 100644 profiles/input/manager.h
 delete mode 100644 profiles/network/manager.h
 create mode 100644 src/service.c
 create mode 100644 src/service.h
Signature · 1 line
1.8.1.4