* [PATCH BlueZ v2 1/6] org.bluez.Device: Add Connectable property
2026-10-02 5:46 [PATCH BlueZ v2 0/6] Add Connectable property to org.bluez.Device Kevin Dewald
@ 2026-10-02 5:46 ` Kevin Dewald
2026-10-02 12:16 ` Add Connectable property to org.bluez.Device bluez.test.bot
2026-10-02 5:46 ` [PATCH BlueZ v2 2/6] org.bluez.Bearer: Add Connectable property Kevin Dewald
` (5 subsequent siblings)
6 siblings, 1 reply; 10+ messages in thread
From: Kevin Dewald @ 2026-10-02 5:46 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Luiz Augusto von Dentz, Kevin Dewald
This adds Connectable property which indicates whether the remote
device accepts connections, as reported by its last advertising report
or inquiry result.
bluetoothd already tracks this per bearer from the Device Found event,
but it is not exposed over D-Bus, so applications cannot tell
connectable advertisers such as peripherals from non-connectable ones
such as beacons without attempting a connection.
---
doc/org.bluez.Device.rst | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/doc/org.bluez.Device.rst b/doc/org.bluez.Device.rst
index 3e6a30a..3df75f0 100644
--- a/doc/org.bluez.Device.rst
+++ b/doc/org.bluez.Device.rst
@@ -395,6 +395,17 @@ int16 TxPower [readonly, optional]
Advertised transmitted power level (inquiry or advertising).
+boolean Connectable [readonly, optional]
+````````````````````````````````````````
+
+Indicates whether the remote device accepts connections, based on the most
+recent advertising report or inquiry result. For LE this is false when the
+last advertising report was non-connectable, e.g. ADV_NONCONN_IND or
+ADV_SCAN_IND.
+
+BR/EDR devices are always considered connectable. LE devices only have this
+property once they have been discovered or connected.
+
dict ManufacturerData [readonly, optional]
``````````````````````````````````````````
--
2.54.0 (Apple Git-157)
^ permalink raw reply related [flat|nested] 10+ messages in thread* [PATCH BlueZ v2 2/6] org.bluez.Bearer: Add Connectable property
2026-10-02 5:46 [PATCH BlueZ v2 0/6] Add Connectable property to org.bluez.Device Kevin Dewald
2026-10-02 5:46 ` [PATCH BlueZ v2 1/6] org.bluez.Device: Add Connectable property Kevin Dewald
@ 2026-10-02 5:46 ` Kevin Dewald
2026-10-02 5:46 ` [PATCH BlueZ v2 3/6] device: " Kevin Dewald
` (4 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: Kevin Dewald @ 2026-10-02 5:46 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Luiz Augusto von Dentz, Kevin Dewald
This adds Connectable property to org.bluez.Bearer.LE1 and
org.bluez.Bearer.BREDR1, so it is possible to tell which bearer of a
dual-mode device accepts connections, since Device1.Connectable is
always true for them as BREDR is always considered connectable.
---
doc/org.bluez.Bearer.BREDR.rst | 6 ++++++
doc/org.bluez.Bearer.LE.rst | 12 ++++++++++++
2 files changed, 18 insertions(+)
diff --git a/doc/org.bluez.Bearer.BREDR.rst b/doc/org.bluez.Bearer.BREDR.rst
index 7794907..a1477a2 100644
--- a/doc/org.bluez.Bearer.BREDR.rst
+++ b/doc/org.bluez.Bearer.BREDR.rst
@@ -141,3 +141,9 @@ boolean Connected [readonly, experimental]
Indicates if the remote device is currently connected to BREDR bearer.
A PropertiesChanged signal indicate changes to this status.
+
+boolean Connectable [readonly, experimental]
+````````````````````````````````````````````
+
+Indicates if the remote device accepts connections on BREDR bearer. BREDR
+devices are always considered connectable.
diff --git a/doc/org.bluez.Bearer.LE.rst b/doc/org.bluez.Bearer.LE.rst
index a465775..ec92a5c 100644
--- a/doc/org.bluez.Bearer.LE.rst
+++ b/doc/org.bluez.Bearer.LE.rst
@@ -141,3 +141,15 @@ boolean Connected [readonly, experimental]
Indicates if the remote device is currently connected to LE bearer.
A PropertiesChanged signal indicate changes to this status.
+
+boolean Connectable [readonly, optional, experimental]
+``````````````````````````````````````````````````````
+
+Indicates if the remote device accepts connections on LE bearer, based on the
+most recent advertising report. It is false when the last advertising report
+was non-connectable, e.g. ADV_NONCONN_IND or ADV_SCAN_IND.
+
+The property is only present once the device has been discovered or connected
+over LE bearer.
+
+A PropertiesChanged signal indicate changes to this status.
--
2.54.0 (Apple Git-157)
^ permalink raw reply related [flat|nested] 10+ messages in thread* [PATCH BlueZ v2 3/6] device: Add Connectable property
2026-10-02 5:46 [PATCH BlueZ v2 0/6] Add Connectable property to org.bluez.Device Kevin Dewald
2026-10-02 5:46 ` [PATCH BlueZ v2 1/6] org.bluez.Device: Add Connectable property Kevin Dewald
2026-10-02 5:46 ` [PATCH BlueZ v2 2/6] org.bluez.Bearer: Add Connectable property Kevin Dewald
@ 2026-10-02 5:46 ` Kevin Dewald
2026-10-02 5:46 ` [PATCH BlueZ v2 4/6] bearer: " Kevin Dewald
` (3 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: Kevin Dewald @ 2026-10-02 5:46 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Luiz Augusto von Dentz, Kevin Dewald
This implements Connectable property using device_is_connectable, which
reports whether the last advertising report on the device's bearer was
connectable, and emits PropertiesChanged from device_update_last_seen
when the value changes or first becomes known.
---
src/device.c | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/src/device.c b/src/device.c
index a8bd29b..dedab65 100644
--- a/src/device.c
+++ b/src/device.c
@@ -327,6 +327,14 @@ static struct bearer_state *get_state(struct btd_device *dev,
return &dev->le_state;
}
+static bool device_connectable_known(struct btd_device *dev)
+{
+ if (dev->bredr)
+ return true;
+
+ return get_state(dev, dev->bdaddr_type)->last_seen != 0;
+}
+
bool btd_device_is_initiator(struct btd_device *dev)
{
if (dev->le_state.connected)
@@ -1281,6 +1289,25 @@ static gboolean dev_property_exists_tx_power(const GDBusPropertyTable *property,
return TRUE;
}
+static gboolean
+dev_property_get_connectable(const GDBusPropertyTable *property,
+ DBusMessageIter *iter, void *data)
+{
+ struct btd_device *dev = data;
+ dbus_bool_t val = device_is_connectable(dev);
+
+ dbus_message_iter_append_basic(iter, DBUS_TYPE_BOOLEAN, &val);
+
+ return TRUE;
+}
+
+static gboolean
+dev_property_exists_connectable(const GDBusPropertyTable *property,
+ void *data)
+{
+ return device_connectable_known(data);
+}
+
static gboolean
dev_property_get_svc_resolved(const GDBusPropertyTable *property,
DBusMessageIter *iter, void *data)
@@ -3756,6 +3783,8 @@ static const GDBusPropertyTable device_properties[] = {
NULL, dev_property_service_data_exist },
{ "TxPower", "n", dev_property_get_tx_power, NULL,
dev_property_exists_tx_power },
+ { "Connectable", "b", dev_property_get_connectable, NULL,
+ dev_property_exists_connectable },
{ "ServicesResolved", "b", dev_property_get_svc_resolved, NULL, NULL },
{ "AdvertisingFlags", "ay", dev_property_get_flags, NULL,
dev_property_flags_exist },
@@ -5341,12 +5370,19 @@ void device_update_last_seen(struct btd_device *device, uint8_t bdaddr_type,
bool connectable)
{
struct bearer_state *state;
+ bool known = device_connectable_known(device);
+ bool was_connectable = device_is_connectable(device);
state = get_state(device, bdaddr_type);
state->last_seen = time(NULL);
state->connectable = connectable;
+ if (known != device_connectable_known(device) ||
+ was_connectable != device_is_connectable(device))
+ g_dbus_emit_property_changed(dbus_conn, device->path,
+ DEVICE_INTERFACE, "Connectable");
+
if (!device_is_temporary(device))
return;
--
2.54.0 (Apple Git-157)
^ permalink raw reply related [flat|nested] 10+ messages in thread* [PATCH BlueZ v2 4/6] bearer: Add Connectable property
2026-10-02 5:46 [PATCH BlueZ v2 0/6] Add Connectable property to org.bluez.Device Kevin Dewald
` (2 preceding siblings ...)
2026-10-02 5:46 ` [PATCH BlueZ v2 3/6] device: " Kevin Dewald
@ 2026-10-02 5:46 ` Kevin Dewald
2026-10-02 5:46 ` [PATCH BlueZ v2 5/6] client: Print Connectable in info Kevin Dewald
` (2 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: Kevin Dewald @ 2026-10-02 5:46 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Luiz Augusto von Dentz, Kevin Dewald
This implements Connectable property for both bearers. For LE it
reflects whether the last advertising report was connectable, and
PropertiesChanged is emitted from device_update_last_seen when it
changes or first becomes known. BREDR always reports it as true.
---
src/bearer.c | 38 ++++++++++++++++++++++++++++++++++++++
src/bearer.h | 1 +
src/device.c | 18 ++++++++++++++++++
src/device.h | 2 ++
4 files changed, 59 insertions(+)
diff --git a/src/bearer.c b/src/bearer.c
index ac3a220..f3b7a23 100644
--- a/src/bearer.c
+++ b/src/bearer.c
@@ -249,6 +249,31 @@ static gboolean bearer_get_connected(const GDBusPropertyTable *property,
return TRUE;
}
+static gboolean bearer_get_connectable(const GDBusPropertyTable *property,
+ DBusMessageIter *iter, void *data)
+{
+ struct btd_bearer *bearer = data;
+ dbus_bool_t connectable;
+
+ connectable = btd_device_bdaddr_type_connectable(bearer->device,
+ bearer->type);
+
+ dbus_message_iter_append_basic(iter, DBUS_TYPE_BOOLEAN, &connectable);
+
+ return TRUE;
+}
+
+static gboolean bearer_connectable_exists(const GDBusPropertyTable *property,
+ void *data)
+{
+ struct btd_bearer *bearer = data;
+
+ if (bearer->type == BDADDR_BREDR)
+ return TRUE;
+
+ return btd_device_bdaddr_type_seen(bearer->device, bearer->type);
+}
+
static const GDBusSignalTable bearer_signals[] = {
{ GDBUS_SIGNAL("Disconnected",
GDBUS_ARGS({ "name", "s" }, { "message", "s" })) },
@@ -264,6 +289,9 @@ static const GDBusPropertyTable bearer_properties[] = {
G_DBUS_PROPERTY_FLAG_EXPERIMENTAL },
{ "Connected", "b", bearer_get_connected, NULL, NULL,
G_DBUS_PROPERTY_FLAG_EXPERIMENTAL },
+ { "Connectable", "b", bearer_get_connectable, NULL,
+ bearer_connectable_exists,
+ G_DBUS_PROPERTY_FLAG_EXPERIMENTAL },
{}
};
@@ -354,6 +382,16 @@ void btd_bearer_bonded(struct btd_bearer *bearer)
"Bonded");
}
+void btd_bearer_connectable(struct btd_bearer *bearer)
+{
+ if (!bearer || !bearer->path)
+ return;
+
+ g_dbus_emit_property_changed(btd_get_dbus_connection(), bearer->path,
+ bearer_interface(bearer->type),
+ "Connectable");
+}
+
void btd_bearer_connected(struct btd_bearer *bearer, int err)
{
DBusMessage *reply;
diff --git a/src/bearer.h b/src/bearer.h
index a201003..238d0a1 100644
--- a/src/bearer.h
+++ b/src/bearer.h
@@ -18,5 +18,6 @@ void btd_bearer_destroy(struct btd_bearer *bearer);
void btd_bearer_paired(struct btd_bearer *bearer);
void btd_bearer_bonded(struct btd_bearer *bearer);
+void btd_bearer_connectable(struct btd_bearer *bearer);
void btd_bearer_connected(struct btd_bearer *bearer, int err);
void btd_bearer_disconnected(struct btd_bearer *bearer, uint8_t reason);
diff --git a/src/device.c b/src/device.c
index dedab65..77744d0 100644
--- a/src/device.c
+++ b/src/device.c
@@ -3829,6 +3829,19 @@ bool btd_device_bdaddr_type_connected(struct btd_device *dev, uint8_t type)
return dev->le_state.connected;
}
+bool btd_device_bdaddr_type_connectable(struct btd_device *dev, uint8_t type)
+{
+ if (type == BDADDR_BREDR)
+ return true;
+
+ return dev->le_state.connectable;
+}
+
+bool btd_device_bdaddr_type_seen(struct btd_device *dev, uint8_t type)
+{
+ return get_state(dev, type)->last_seen != 0;
+}
+
static void clear_temporary_timer(struct btd_device *dev)
{
if (dev->temporary_timer) {
@@ -5372,8 +5385,10 @@ void device_update_last_seen(struct btd_device *device, uint8_t bdaddr_type,
struct bearer_state *state;
bool known = device_connectable_known(device);
bool was_connectable = device_is_connectable(device);
+ bool changed;
state = get_state(device, bdaddr_type);
+ changed = !state->last_seen || state->connectable != connectable;
state->last_seen = time(NULL);
state->connectable = connectable;
@@ -5383,6 +5398,9 @@ void device_update_last_seen(struct btd_device *device, uint8_t bdaddr_type,
g_dbus_emit_property_changed(dbus_conn, device->path,
DEVICE_INTERFACE, "Connectable");
+ if (changed && bdaddr_type != BDADDR_BREDR)
+ btd_bearer_connectable(device->le);
+
if (!device_is_temporary(device))
return;
diff --git a/src/device.h b/src/device.h
index fdc036e..597df74 100644
--- a/src/device.h
+++ b/src/device.h
@@ -127,6 +127,8 @@ void device_set_flags(struct btd_device *device, uint8_t flags);
bool btd_device_is_connected(struct btd_device *dev);
bool btd_device_bearer_is_connected(struct btd_device *dev);
bool btd_device_bdaddr_type_connected(struct btd_device *dev, uint8_t type);
+bool btd_device_bdaddr_type_connectable(struct btd_device *dev, uint8_t type);
+bool btd_device_bdaddr_type_seen(struct btd_device *dev, uint8_t type);
uint8_t btd_device_get_bdaddr_type(struct btd_device *dev);
bool device_is_retrying(struct btd_device *device);
void device_bonding_complete(struct btd_device *device, uint8_t bdaddr_type,
--
2.54.0 (Apple Git-157)
^ permalink raw reply related [flat|nested] 10+ messages in thread* [PATCH BlueZ v2 5/6] client: Print Connectable in info
2026-10-02 5:46 [PATCH BlueZ v2 0/6] Add Connectable property to org.bluez.Device Kevin Dewald
` (3 preceding siblings ...)
2026-10-02 5:46 ` [PATCH BlueZ v2 4/6] bearer: " Kevin Dewald
@ 2026-10-02 5:46 ` Kevin Dewald
2026-10-02 5:46 ` [PATCH BlueZ v2 6/6] client: Print discoverable broadcasters in red Kevin Dewald
2026-10-02 15:00 ` [PATCH BlueZ v2 0/6] Add Connectable property to org.bluez.Device patchwork-bot+bluetooth
6 siblings, 0 replies; 10+ messages in thread
From: Kevin Dewald @ 2026-10-02 5:46 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Luiz Augusto von Dentz, Kevin Dewald
This prints the Connectable property of the device and its bearers with
the likes of info command:
bluetoothctl> info <addr>
...
Connectable: yes
...
LE.Connectable: yes
---
client/main.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/client/main.c b/client/main.c
index 314aead..35cd427 100644
--- a/client/main.c
+++ b/client/main.c
@@ -2026,6 +2026,7 @@ static void cmd_info(int argc, char *argv[])
print_property(proxy, "ServiceData");
print_property(proxy, "RSSI");
print_property(proxy, "TxPower");
+ print_property(proxy, "Connectable");
print_property(proxy, "AdvertisingFlags");
print_property(proxy, "AdvertisingData");
print_property(proxy, "Sets");
@@ -2054,6 +2055,8 @@ static void cmd_info(int argc, char *argv[])
print_property_with_label(bearer, "Bonded", "BREDR.Bonded");
print_property_with_label(bearer, "Connected",
"BREDR.Connected");
+ print_property_with_label(bearer, "Connectable",
+ "BREDR.Connectable");
}
bearer = find_proxies_by_iface(default_ctrl->bearers,
@@ -2063,6 +2066,8 @@ static void cmd_info(int argc, char *argv[])
print_property_with_label(bearer, "Paired", "LE.Paired");
print_property_with_label(bearer, "Bonded", "LE.Bonded");
print_property_with_label(bearer, "Connected", "LE.Connected");
+ print_property_with_label(bearer, "Connectable",
+ "LE.Connectable");
}
return bt_shell_noninteractive_quit(EXIT_SUCCESS);
--
2.54.0 (Apple Git-157)
^ permalink raw reply related [flat|nested] 10+ messages in thread* [PATCH BlueZ v2 6/6] client: Print discoverable broadcasters in red
2026-10-02 5:46 [PATCH BlueZ v2 0/6] Add Connectable property to org.bluez.Device Kevin Dewald
` (4 preceding siblings ...)
2026-10-02 5:46 ` [PATCH BlueZ v2 5/6] client: Print Connectable in info Kevin Dewald
@ 2026-10-02 5:46 ` Kevin Dewald
2026-10-02 15:00 ` [PATCH BlueZ v2 0/6] Add Connectable property to org.bluez.Device patchwork-bot+bluetooth
6 siblings, 0 replies; 10+ messages in thread
From: Kevin Dewald @ 2026-10-02 5:46 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Luiz Augusto von Dentz, Kevin Dewald
This prints devices in red when they set the discoverable flags but are
not connectable, to warn the user they cannot be connected to despite
being discoverable.
---
client/main.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/client/main.c b/client/main.c
index 35cd427..ad2c3cb 100644
--- a/client/main.c
+++ b/client/main.c
@@ -183,6 +183,19 @@ static struct set_discovery_filter_args {
.set = true,
};
+static bool device_is_broadcaster(GDBusProxy *proxy)
+{
+ DBusMessageIter iter;
+ dbus_bool_t connectable;
+
+ if (!g_dbus_proxy_get_property(proxy, "Connectable", &iter))
+ return false;
+
+ dbus_message_iter_get_basic(&iter, &connectable);
+
+ return !connectable;
+}
+
static void print_device(GDBusProxy *proxy, const char *description)
{
DBusMessageIter iter;
@@ -227,6 +240,20 @@ static void print_device(GDBusProxy *proxy, const char *description)
return;
}
+ /* Print discoverable broadcasters in red to warn the user they cannot
+ * be connected to despite being discoverable.
+ */
+ if (device_is_broadcaster(proxy)) {
+ bt_shell_printf("%s%s%s" COLOR_RED "Device %s %s"
+ COLOR_OFF "\n",
+ description ? "[" : "",
+ description ? : "",
+ description ? "] " : "",
+ address, name);
+
+ return;
+ }
+
done:
bt_shell_printf("%s%s%sDevice %s %s\n",
description ? "[" : "",
--
2.54.0 (Apple Git-157)
^ permalink raw reply related [flat|nested] 10+ messages in thread* Re: [PATCH BlueZ v2 0/6] Add Connectable property to org.bluez.Device
2026-10-02 5:46 [PATCH BlueZ v2 0/6] Add Connectable property to org.bluez.Device Kevin Dewald
` (5 preceding siblings ...)
2026-10-02 5:46 ` [PATCH BlueZ v2 6/6] client: Print discoverable broadcasters in red Kevin Dewald
@ 2026-10-02 15:00 ` patchwork-bot+bluetooth
6 siblings, 0 replies; 10+ messages in thread
From: patchwork-bot+bluetooth @ 2026-10-02 15:00 UTC (permalink / raw)
To: Kevin Dewald; +Cc: linux-bluetooth, luiz.dentz
Hello:
This series was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:
On Thu, 1 Oct 2026 22:46:11 -0700 you wrote:
> bluetoothd records whether each advertising report was connectable,
> from the Device Found event's Not Connectable flag, and uses it
> internally, for example to pick the bearer to connect and to drop
> temporary non-connectable devices when discovery stops. Applications
> cannot read it over D-Bus, so they have to guess, e.g. from whether the
> device has a name, which is wrong for named beacons and for unnamed
> peripherals.
>
> [...]
Here is the summary with links:
- [BlueZ,v2,1/6] org.bluez.Device: Add Connectable property
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=75a778e17f49
- [BlueZ,v2,2/6] org.bluez.Bearer: Add Connectable property
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=f890d4b660c6
- [BlueZ,v2,3/6] device: Add Connectable property
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=6afb6e729270
- [BlueZ,v2,4/6] bearer: Add Connectable property
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=ab50d5e88fb6
- [BlueZ,v2,5/6] client: Print Connectable in info
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=82f671c83429
- [BlueZ,v2,6/6] client: Print discoverable broadcasters in red
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=4dc15be8ee3f
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 10+ messages in thread