Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH BlueZ v2 0/3] Add Role property to org.bluez.Bearer.LE1
@ 2026-10-08 17:29 Kevin Dewald
  2026-10-08 17:29 ` [PATCH BlueZ v2 1/3] org.bluez.Bearer: Add Role property Kevin Dewald
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Kevin Dewald @ 2026-10-08 17:29 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Luiz Augusto von Dentz, Kevin Dewald

Applications acting as a peripheral, or in both roles, cannot tell
whether a connected device is a central that connected to the adapter
or a peripheral the adapter connected to. When several applications
share the adapter, a device object can appear because of any of them,
so the order of events does not answer it either.

bluetoothd already tracks this per bearer from the Device Connected
event. This series exposes it as a Role property on
org.bluez.Bearer.LE1, "central" or "peripheral", present only while
the device is connected over LE, and prints it as LE.Role in
bluetoothctl info. The documentation states that it is the link layer
role and says nothing about GATT client and server roles.

Like the rest of the bearer interfaces, the property is experimental,
so applications only see it when bluetoothd runs with -E, which few
systems do. Is there a plan to promote the bearer interfaces, or some
of their properties, to stable? I would be glad to help with whatever
that needs.

Tested with two btvirt controllers, where the advertising side reports
the other as "central" and the connecting side reports it as
"peripheral", and with a real adapter connecting to an nRF52840. The
property goes away when the connection does.

Changes in v2:
- Move the property from org.bluez.Device1 to org.bluez.Bearer.LE1, so
  it is clearly per connection (Luiz)
- State in the documentation that it says nothing about GATT roles
  (Luiz)

Kevin Dewald (3):
  org.bluez.Bearer: Add Role property
  bearer: Add Role property
  client: Print LE.Role in info

 client/main.c               |  1 +
 doc/org.bluez.Bearer.LE.rst | 24 +++++++++++++++++++++
 src/bearer.c                | 42 +++++++++++++++++++++++++++++++++++++
 src/device.c                |  5 +++++
 src/device.h                |  1 +
 5 files changed, 73 insertions(+)

-- 
2.54.0 (Apple Git-157)


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-10-09 13:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-08 17:29 [PATCH BlueZ v2 0/3] Add Role property to org.bluez.Bearer.LE1 Kevin Dewald
2026-10-08 17:29 ` [PATCH BlueZ v2 1/3] org.bluez.Bearer: Add Role property Kevin Dewald
2026-10-08 22:35   ` Add Role property to org.bluez.Bearer.LE1 bluez.test.bot
2026-10-08 17:29 ` [PATCH BlueZ v2 2/3] bearer: Add Role property Kevin Dewald
2026-10-08 17:30 ` [PATCH BlueZ v2 3/3] client: Print LE.Role in info Kevin Dewald
2026-10-08 19:10 ` [PATCH BlueZ v2 0/3] Add Role property to org.bluez.Bearer.LE1 Luiz Augusto von Dentz
2026-10-09  3:45   ` Kevin Dewald
2026-10-09 13:42     ` Luiz Augusto von Dentz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox