Skip to contentSkip to conversation

Adding bonded flag to D-Bus property

PATCH In review Zhengping Jiang 5 participants 11 messages May 4, 2022 3 messages not in the archive Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

v3 cover Adding bonded flag to D-Bus property

Currently BlueZ client can't know easily whether a device is bonded or not. This is causing issues for a number of applications. For example, in the Nearby Share case, the peer device is paired, but not bonded. This series will add the "Bonded" property in org.bluez.Device1 D-Bus interface. Changes are also made in bluetoothctl to show the status of the bonded flag as well as a list of bonded devices.

Changes in v3:
- Move documentation update to a separate patch
- Add description to bonded and paired
- Add an optional argument to the devices command to filter device list
- Remove paired-devices command

Changes in v2:
- Move one variable declaration to the top following C90 standard

Changes in v1:
- Add "Bonded" to D-Bus interface
- Send property changed signal if the bonded flag is changed
- Show the status of the "Bonded" flag in bluetoothctl
- Add option to show list of bonded devices

Zhengping Jiang (3):
device: Add "Bonded" flag to dbus property
doc: add "Bonded" flag to dbus property
client: Add filter to devices and show Bonded in info

 client/main.c      | 72 ++++++++++++++++++++++++++++++----------------
 doc/device-api.txt | 12 +++++++-
 src/device.c       | 38 ++++++++++++++++++++----
 3 files changed, 91 insertions(+), 31 deletions(-)
Signature · 1 line
2.36.0.464.gb9c8b46e94-goog
#1 lore raw

PATCH v3 1/3 device: Add "Bonded" flag to dbus property

Add "Bonded" to dbus device property table. When setting the "Bonded flag, check the status of the Bonded property first. If the Bonded property is changed, send property changed signal.

---

(no changes since v2)

Changes in v2:
- Move one variable declaration to the top following C90 standard

Changes in v1:
- Add "Bonded" to D-Bus interface
- Send property changed signal if the bonded flag is changed

 src/device.c | 38 +++++++++++++++++++++++++++++++++-----
 1 file changed, 33 insertions(+), 5 deletions(-)
src/device.c +33 -5
index a62564b14f49..72804713b25b 100644
@@ -1143,6 +1143,22 @@ static gboolean dev_property_get_paired(const GDBusPropertyTable *property,
 	return TRUE;
 }
 
+static gboolean dev_property_get_bonded(const GDBusPropertyTable *property,
+					DBusMessageIter *iter, void *data)
+{
+	struct btd_device *dev = data;
+	dbus_bool_t val;
+
+	if (dev->bredr_state.bonded || dev->le_state.bonded)
+		val = TRUE;
+	else
+		val = FALSE;
+
+	dbus_message_iter_append_basic(iter, DBUS_TYPE_BOOLEAN, &val);
+
+	return TRUE;
+}
+
 static gboolean dev_property_get_legacy(const GDBusPropertyTable *property,
 					DBusMessageIter *iter, void *data)
 {
@@ -4033,6 +4049,7 @@ static const GDBusPropertyTable device_properties[] = {
 	{ "Icon", "s", dev_property_get_icon, NULL,
 					dev_property_exists_icon },
 	{ "Paired", "b", dev_property_get_paired },
+	{ "Bonded", "b", dev_property_get_bonded },
 	{ "Trusted", "b", dev_property_get_trusted, dev_property_set_trusted },
 	{ "Blocked", "b", dev_property_get_blocked, dev_property_set_blocked },
 	{ "LegacyPairing", "b", dev_property_get_legacy },
@@ -7065,14 +7082,25 @@ void device_set_bonded(struct btd_device *device, uint8_t bdaddr_type)
 	if (!device)
 		return;
 
-	DBG("");
+	struct bearer_state *state = get_state(device, bdaddr_type);
 
-	if (bdaddr_type == BDADDR_BREDR)
-		device->bredr_state.bonded = true;
-	else
-		device->le_state.bonded = true;
+	if (state->bonded)
+		return;
+
+	DBG("setting bonded for device to true");
+
+	state->bonded = true;
 
 	btd_device_set_temporary(device, false);
+
+	/* If the other bearer state was already true we don't need to
+	 * send any property signals.
+	 */
+	if (device->bredr_state.bonded == device->le_state.bonded)
+		return;
+
+	g_dbus_emit_property_changed(dbus_conn, device->path,
+						DEVICE_INTERFACE, "Bonded");
 }
 
 void device_set_legacy(struct btd_device *device, bool legacy)
Signature · 1 line
2.36.0.464.gb9c8b46e94-goog
#2 lore raw

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=638455

---Test result---

Test Summary:

CheckPatch                    PASS      4.37 seconds
GitLint                       PASS      2.85 seconds
Prep - Setup ELL              PASS      43.69 seconds
Build - Prep                  PASS      0.69 seconds
Build - Configure             PASS      8.79 seconds
Build - Make                  FAIL      1282.94 seconds
Make Check                    FAIL      5.14 seconds
Make Check w/Valgrind         FAIL      308.39 seconds
Make Distcheck                PASS      235.79 seconds
Build w/ext ELL - Configure   PASS      8.96 seconds
Build w/ext ELL - Make        FAIL      1253.26 seconds
Incremental Build with patchesFAIL      1279.49 seconds

Details
##############################
Test: Build - Make - FAIL
Desc: Build the BlueZ source tree
Output:
tools/mgmt-tester.c: In function ‘main’:
tools/mgmt-tester.c:12364:5: note: variable tracking size limit exceeded with ‘-fvar-tracking-assignments’, retrying without 12364 | int main(int argc, char *argv[])

      |     ^~~~
unit/test-avdtp.c: In function ‘main’:
unit/test-avdtp.c:766:5: note: variable tracking size limit exceeded with ‘-fvar-tracking-assignments’, retrying without
  766 | int main(int argc, char *argv[])
      |     ^~~~
unit/test-avrcp.c: In function ‘main’:
unit/test-avrcp.c:989:5: note: variable tracking size limit exceeded with ‘-fvar-tracking-assignments’, retrying without
  989 | int main(int argc, char *argv[])
      |     ^~~~
src/device.c: In function ‘device_set_bonded’:
src/device.c:6141:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
 6141 |  struct bearer_state *state = get_state(device, bdaddr_type);
      |  ^~~~~~

cc1: all warnings being treated as errors
make[1]: *** [Makefile:10248: src/bluetoothd-device.o] Error 1
make: *** [Makefile:4310: all] Error 2

##############################
Test: Make Check - FAIL
Desc: Run 'make check'
Output:
src/device.c: In function ‘device_set_bonded’:
src/device.c:6141:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]

 6141 |  struct bearer_state *state = get_state(device, bdaddr_type);
      |  ^~~~~~

cc1: all warnings being treated as errors
make[1]: *** [Makefile:10248: src/bluetoothd-device.o] Error 1
make: *** [Makefile:11283: check] Error 2

##############################
Test: Make Check w/Valgrind - FAIL
Desc: Run 'make check' with Valgrind
Output:
tools/mgmt-tester.c: In function ‘main’:
tools/mgmt-tester.c:12364:5: note: variable tracking size limit exceeded with ‘-fvar-tracking-assignments’, retrying without 12364 | int main(int argc, char *argv[])

      |     ^~~~
src/device.c: In function ‘device_set_bonded’:
src/device.c:6141:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
 6141 |  struct bearer_state *state = get_state(device, bdaddr_type);
      |  ^~~~~~

cc1: all warnings being treated as errors
make[1]: *** [Makefile:10248: src/bluetoothd-device.o] Error 1
make: *** [Makefile:4310: all] Error 2

##############################
Test: Build w/ext ELL - Make - FAIL
Desc: Build BlueZ source with '--enable-external-ell' configuration
Output:
tools/mgmt-tester.c: In function ‘main’:
tools/mgmt-tester.c:12364:5: note: variable tracking size limit exceeded with ‘-fvar-tracking-assignments’, retrying without 12364 | int main(int argc, char *argv[])

      |     ^~~~
unit/test-avdtp.c: In function ‘main’:
unit/test-avdtp.c:766:5: note: variable tracking size limit exceeded with ‘-fvar-tracking-assignments’, retrying without
  766 | int main(int argc, char *argv[])
      |     ^~~~
unit/test-avrcp.c: In function ‘main’:
unit/test-avrcp.c:989:5: note: variable tracking size limit exceeded with ‘-fvar-tracking-assignments’, retrying without
  989 | int main(int argc, char *argv[])
      |     ^~~~
src/device.c: In function ‘device_set_bonded’:
src/device.c:6141:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
 6141 |  struct bearer_state *state = get_state(device, bdaddr_type);
      |  ^~~~~~

cc1: all warnings being treated as errors
make[1]: *** [Makefile:10248: src/bluetoothd-device.o] Error 1
make: *** [Makefile:4310: all] Error 2

##############################
Test: Incremental Build with patches - FAIL
Desc: Incremental build per patch in the series
Output:
tools/mgmt-tester.c: In function ‘main’:
tools/mgmt-tester.c:12364:5: note: variable tracking size limit exceeded with ‘-fvar-tracking-assignments’, retrying without 12364 | int main(int argc, char *argv[])

      |     ^~~~
unit/test-avdtp.c: In function ‘main’:
unit/test-avdtp.c:766:5: note: variable tracking size limit exceeded with ‘-fvar-tracking-assignments’, retrying without
  766 | int main(int argc, char *argv[])
      |     ^~~~
unit/test-avrcp.c: In function ‘main’:
unit/test-avrcp.c:989:5: note: variable tracking size limit exceeded with ‘-fvar-tracking-assignments’, retrying without
  989 | int main(int argc, char *argv[])
      |     ^~~~
src/device.c: In function ‘device_set_bonded’:
src/device.c:6141:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
 6141 |  struct bearer_state *state = get_state(device, bdaddr_type);
      |  ^~~~~~

cc1: all warnings being treated as errors
make[1]: *** [Makefile:10248: src/bluetoothd-device.o] Error 1
make: *** [Makefile:4310: all] Error 2

---
Regards,
Linux Bluetooth

#3 lore raw

PATCH v3 2/3 doc: add "Bonded" flag to dbus property

In reply to Zhengping Jiang

Bonded flag is used to indicate the link key or ltk of the remote device has been stored.

---

Changes in v3:
- Move documentation update to a separate patch
- Add description to bonded and paired

 doc/device-api.txt | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
doc/device-api.txt +11 -1
index 1e8590b27d58..c7e217c07526 100644
@@ -246,7 +246,17 @@ Properties	string Address [readonly]
 
 		boolean Paired [readonly]
 
-			Indicates if the remote device is paired.
+			Indicates if the remote device is paired. Pairing is
+			the process where devices exchange the information to
+			establish an encrypted connection.
+
+		boolean Bonded [readonly]
+
+			Indicates if the remote device is bonded. Bonded means
+			the link key or the ltk from the pairing process has
+			been stored.
+			A PropertiesChanged signal indicate changes to this
+			status.
 
 		boolean Connected [readonly]
 
Signature · 1 line
2.36.0.464.gb9c8b46e94-goog
#4 lore raw

Re: [Bluez PATCH v3 2/3] doc: add "Bonded" flag to dbus property

Quoted 28 lines · Zhengping Jiang

Bonded flag is used to indicate the link key or ltk of the remote device has been stored.

---

Changes in v3:
- Move documentation update to a separate patch
- Add description to bonded and paired

 doc/device-api.txt | 12 +++++++++++-

 1 file changed, 11 insertions(+), 1 deletion(-)
doc/device-api.txt +0 -0
index 1e8590b27d58..c7e217c07526 100644
@@ -246,7 +246,17 @@ Properties string Address [readonly]


                boolean Paired [readonly]

-                       Indicates if the remote device is paired. +                       Indicates if the remote device is paired. Pairing is +                       the process where devices exchange the information to +                       establish an encrypted connection.

doc/device-api.txt Properties string Address [readonly] · line 257

Quoted 6 lines
doc/device-api.txt +6 -0
+
+               boolean Bonded [readonly]
+
+                       Indicates if the remote device is bonded. Bonded means
+                       the link key or the ltk from the pairing process has
+                       been stored.

"long-term key (LTK)"

Is Paired effectively the same as Bonded for Classic devices? If so, would be great to mention.

Quoted 5 lines

+                       A PropertiesChanged signal indicate changes to this +                       status.

                boolean Connected [readonly]

A message that is not in the archive (sent off-list or not yet received): CAB4PzUq0FKEE2JbwO6nss3s42M6rbNSt6BGGoGVhuzzR2+1mNw@mail.gmail.com

A message that is not in the archive (sent off-list or not yet received): CAB4PzUoPyD2KyN4mRbUKGw5BbbyysaZdi7+0hmWrGDJdmk7Www@mail.gmail.com

#7 lore raw

Re: [Bluez PATCH v3 2/3] doc: add "Bonded" flag to dbus property

Hi Zhengping,

Quoted 12 lines · Zhengping Jiang

Hi Bastien,

To avoid confusion, I would propose to update the description to "key information".

Indicates if the remote device is bonded. Bonded means the key information created from the pairing process has been stored.

Thanks,
Zhengping

Ive changed it a little bit:

https://gist.github.com/Vudentz/ca59d846b4ff840e2ee4c01f6965def6

Quoted 60 lines · Zhengping Jiang
Quoted 59 lines

Hi Bastien,

Thanks for the comment. They are not the same for Classic. "Bonded" means the key information is persistent for both LE and classic. For classic the stored information is "Link key" for LE it will be "LTK". But I think if a device has both classic and LE, the two types of keys can be converted.

Thanks,
Zhengping

Quoted 48 lines · Bastien Nocera
Quoted 24 lines · Zhengping Jiang

Bonded flag is used to indicate the link key or ltk of the remote device has been stored.

---

Changes in v3:
- Move documentation update to a separate patch
- Add description to bonded and paired

 doc/device-api.txt | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
doc/device-api.txt +0 -0
index 1e8590b27d58..c7e217c07526 100644
@@ -246,7 +246,17 @@ Properties string Address [readonly]
 
                boolean Paired [readonly]
 

doc/device-api.txt Properties string Address [readonly] · line 257

Quoted 10 lines
doc/device-api.txt +9 -1
-                       Indicates if the remote device is paired.
+                       Indicates if the remote device is paired. Pairing is
+                       the process where devices exchange the information to
+                       establish an encrypted connection.
+
+               boolean Bonded [readonly]
+
+                       Indicates if the remote device is bonded. Bonded means
+                       the link key or the ltk from the pairing process has
+                       been stored.

"long-term key (LTK)"

Is Paired effectively the same as Bonded for Classic devices? If so, would be great to mention.

Quoted 5 lines
doc/device-api.txt +2 -0
+                       A PropertiesChanged signal indicate changes to this
+                       status.
 
                boolean Connected [readonly]
 
Signature · 1 line
Luiz Augusto von Dentz
#8 lore raw

Re: [Bluez PATCH v3 2/3] doc: add "Bonded" flag to dbus property

In reply to Bastien Nocera

Hi Bastien,

Quoted 39 lines · Bastien Nocera
Quoted 24 lines · Zhengping Jiang

Bonded flag is used to indicate the link key or ltk of the remote device has been stored.

---

Changes in v3:
- Move documentation update to a separate patch
- Add description to bonded and paired

 doc/device-api.txt | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
doc/device-api.txt +0 -0
index 1e8590b27d58..c7e217c07526 100644
@@ -246,7 +246,17 @@ Properties string Address [readonly]
 
                boolean Paired [readonly]
 

doc/device-api.txt Properties string Address [readonly] · line 257

Quoted 10 lines
doc/device-api.txt +9 -1
-                       Indicates if the remote device is paired.
+                       Indicates if the remote device is paired. Pairing is
+                       the process where devices exchange the information to
+                       establish an encrypted connection.
+
+               boolean Bonded [readonly]
+
+                       Indicates if the remote device is bonded. Bonded means
+                       the link key or the ltk from the pairing process has
+                       been stored.

"long-term key (LTK)"

Quoted 2 lines

Is Paired effectively the same as Bonded for Classic devices? If so, would be great to mention.

There are some rare occasion where the link-keys cannot be persisted/stored (e.g. debug keys), but in the other hand Bonded would always means Paired, perhaps this is useful if you want to persist some device information at upper layers otherwise I can't think of any other use of Bonded over Paired.

Quoted 6 lines
Quoted 5 lines
doc/device-api.txt +2 -0
+                       A PropertiesChanged signal indicate changes to this
+                       status.
 
                boolean Connected [readonly]
 
Signature · 1 line
Luiz Augusto von Dentz
#9 lore raw

PATCH v3 3/3 client: Add filter to devices and show Bonded in info

In reply to Zhengping Jiang

Use the property name as optional filters to the command "devices" and show the "Bonded" property for the command "info".

---

Changes in v3:
- Add an optional argument to the devices command to filter device list
- Remove paired-devices command

Changes in v1:
- Show the status of the "Bonded" flag in bluetoothctl
- Add option to show list of bonded devices

 client/main.c | 72 +++++++++++++++++++++++++++++++++------------------
 1 file changed, 47 insertions(+), 25 deletions(-)
client/main.c +47 -25
index 29a2f882e5c8..58678224f93f 100644
@@ -95,6 +95,14 @@ static const char *ad_arguments[] = {
 	NULL
 };
 
+static const char * const device_arguments[] = {
+	"Paired",
+	"Bonded",
+	"Trusted",
+	"Connected",
+	NULL
+};
+
 static void proxy_leak(gpointer data)
 {
 	printf("Leaking proxy %p\n", data);
@@ -929,6 +937,28 @@ static gboolean check_default_ctrl(void)
 	return TRUE;
 }
 
+static gboolean parse_argument_devices(int argc, char *argv[],
+				       const char * const *arg_table,
+				       const char **option)
+{
+	const char * const *opt;
+
+	if (argc < 2) {
+		*option = NULL;
+		return TRUE;
+	}
+
+	for (opt = arg_table; opt && *opt; opt++) {
+		if (strcmp(argv[1], *opt) == 0) {
+			*option = *opt;
+			return TRUE;
+		}
+	}
+
+	bt_shell_printf("Invalid argument %s\n", argv[1]);
+	return FALSE;
+}
+
 static gboolean parse_argument(int argc, char *argv[], const char **arg_table,
 					const char *msg, dbus_bool_t *value,
 					const char **option)
@@ -1068,22 +1098,11 @@ static void cmd_select(int argc, char *argv[])
 static void cmd_devices(int argc, char *argv[])
 {
 	GList *ll;
+	const char *property;
 
-	if (check_default_ctrl() == FALSE)
-		return bt_shell_noninteractive_quit(EXIT_SUCCESS);
-
-	for (ll = g_list_first(default_ctrl->devices);
-			ll; ll = g_list_next(ll)) {
-		GDBusProxy *proxy = ll->data;
-		print_device(proxy, NULL);
-	}
-
-	return bt_shell_noninteractive_quit(EXIT_SUCCESS);
-}
-
-static void cmd_paired_devices(int argc, char *argv[])
-{
-	GList *ll;
+	if (!parse_argument_devices(argc, argv, device_arguments,
+					&property))
+		return bt_shell_noninteractive_quit(EXIT_FAILURE);
 
 	if (check_default_ctrl() == FALSE)
 		return bt_shell_noninteractive_quit(EXIT_SUCCESS);
@@ -1092,15 +1111,17 @@ static void cmd_paired_devices(int argc, char *argv[])
 			ll; ll = g_list_next(ll)) {
 		GDBusProxy *proxy = ll->data;
 		DBusMessageIter iter;
-		dbus_bool_t paired;
+		dbus_bool_t status;
 
-		if (g_dbus_proxy_get_property(proxy, "Paired", &iter) == FALSE)
-			continue;
-
-		dbus_message_iter_get_basic(&iter, &paired);
-		if (!paired)
-			continue;
+		if (property) {
+			if (g_dbus_proxy_get_property(proxy,
+					property, &iter) == FALSE)
+				continue;
 
+			dbus_message_iter_get_basic(&iter, &status);
+			if (!status)
+				continue;
+		}
 		print_device(proxy, NULL);
 	}
 
@@ -1787,6 +1808,7 @@ static void cmd_info(int argc, char *argv[])
 	print_property(proxy, "Appearance");
 	print_property(proxy, "Icon");
 	print_property(proxy, "Paired");
+	print_property(proxy, "Bonded");
 	print_property(proxy, "Trusted");
 	print_property(proxy, "Blocked");
 	print_property(proxy, "Connected");
@@ -3170,9 +3192,9 @@ static const struct bt_shell_menu main_menu = {
 							ctrl_generator },
 	{ "select",       "<ctrl>",   cmd_select, "Select default controller",
 							ctrl_generator },
-	{ "devices",      NULL,       cmd_devices, "List available devices" },
-	{ "paired-devices", NULL,     cmd_paired_devices,
-					"List paired devices"},
+	{ "devices",      "[Paired/Bonded/Trusted/Connected]", cmd_devices,
+					"List available devices, with an "
+					"optional property as the filter" },
 	{ "system-alias", "<name>",   cmd_system_alias,
 					"Set controller alias" },
 	{ "reset-alias",  NULL,       cmd_reset_alias,
Signature · 1 line
2.36.0.464.gb9c8b46e94-goog
#10 lore raw
In reply to Zhengping Jiang

Hi Zhengping,

Quoted 28 lines · Zhengping Jiang

Currently BlueZ client can't know easily whether a device is bonded or not. This is causing issues for a number of applications. For example, in the Nearby Share case, the peer device is paired, but not bonded. This series will add the "Bonded" property in org.bluez.Device1 D-Bus interface. Changes are also made in bluetoothctl to show the status of the bonded flag as well as a list of bonded devices.

Changes in v3:
- Move documentation update to a separate patch
- Add description to bonded and paired
- Add an optional argument to the devices command to filter device list
- Remove paired-devices command

Changes in v2:
- Move one variable declaration to the top following C90 standard

Changes in v1:
- Add "Bonded" to D-Bus interface
- Send property changed signal if the bonded flag is changed
- Show the status of the "Bonded" flag in bluetoothctl
- Add option to show list of bonded devices

Zhengping Jiang (3):
device: Add "Bonded" flag to dbus property
doc: add "Bonded" flag to dbus property
client: Add filter to devices and show Bonded in info

Quoted 7 lines
 client/main.c      | 72 ++++++++++++++++++++++++++++++----------------
 doc/device-api.txt | 12 +++++++-
 src/device.c       | 38 ++++++++++++++++++++----
 3 files changed, 91 insertions(+), 31 deletions(-)

--
2.36.0.464.gb9c8b46e94-goog

src/device.c: In function ‘device_set_bonded’:
src/device.c:6141:9: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]

 6141 |         struct bearer_state *state = get_state(device, bdaddr_type);
      |
Signature · 1 line
Luiz Augusto von Dentz

A message that is not in the archive (sent off-list or not yet received): CAB4PzUrFr+ZXMNpToM+c4pfNJoAdVyfV2XoCGKtUGg_3MMCtag@mail.gmail.com

#12 lore raw

Hi Zhengping,

Quoted 4 lines · Zhengping Jiang

Hi Luiz,

Sorry for the error. It should have been fixed in patch 2. I think I updated the wrong version.

Don't worry, I'm fixing it myself.

Quoted 53 lines

Thanks,
Zhengping

Quoted 49 lines · Luiz Augusto von Dentz

Hi Zhengping,

Quoted 28 lines · Zhengping Jiang

Currently BlueZ client can't know easily whether a device is bonded or not. This is causing issues for a number of applications. For example, in the Nearby Share case, the peer device is paired, but not bonded. This series will add the "Bonded" property in org.bluez.Device1 D-Bus interface. Changes are also made in bluetoothctl to show the status of the bonded flag as well as a list of bonded devices.

Changes in v3:
- Move documentation update to a separate patch
- Add description to bonded and paired
- Add an optional argument to the devices command to filter device list
- Remove paired-devices command

Changes in v2:
- Move one variable declaration to the top following C90 standard

Changes in v1:
- Add "Bonded" to D-Bus interface
- Send property changed signal if the bonded flag is changed
- Show the status of the "Bonded" flag in bluetoothctl
- Add option to show list of bonded devices

Zhengping Jiang (3):
device: Add "Bonded" flag to dbus property
doc: add "Bonded" flag to dbus property
client: Add filter to devices and show Bonded in info

Quoted 7 lines
 client/main.c      | 72 ++++++++++++++++++++++++++++++----------------
 doc/device-api.txt | 12 +++++++-
 src/device.c       | 38 ++++++++++++++++++++----
 3 files changed, 91 insertions(+), 31 deletions(-)

--
2.36.0.464.gb9c8b46e94-goog

src/device.c: In function ‘device_set_bonded’:
src/device.c:6141:9: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]

 6141 |         struct bearer_state *state = get_state(device, bdaddr_type);
      |

--
Luiz Augusto von Dentz

Signature · 1 line
Luiz Augusto von Dentz
#13 lore raw
In reply to Zhengping Jiang
This series was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:

Hello:

This series was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:

Quoted 8 lines · On Wed, 4 May 2022 14:09:45 -0700 you wrote:

Currently BlueZ client can't know easily whether a device is bonded or not. This is causing issues for a number of applications. For example, in the Nearby Share case, the peer device is paired, but not bonded. This series will add the "Bonded" property in org.bluez.Device1 D-Bus interface. Changes are also made in bluetoothctl to show the status of the bonded flag as well as a list of bonded devices.

[...]

Here is the summary with links:
- [Bluez,v3,1/3] device: Add "Bonded" flag to dbus property (no matching commit)
- [Bluez,v3,2/3] doc: add "Bonded" flag to dbus property

    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=5c05df7c7607
  - [Bluez,v3,3/3] client: Add filter to devices and show Bonded in info
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=bda2a9e6f902

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html