Skip to contentSkip to conversation

Expose extended adv feature support via bluez API

PATCH Superseded Daniel Winkler 2 participants 6 messages Aug 26, 2020 – Aug 31, 2020

Subsystems (2)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

cover Expose extended adv feature support via bluez API

Hi Maintainers,

This change adds a SupportedFeatures member to the LEAdvertisingManager interface, which allows us to expose support for hardware offloading and setting TX power on advertisements.

Best,
Daniel

Daniel Winkler (3):
PRE_UPSTREAM: advertising: Add SupportedFeatures to
LEAdvertisingManager1
PRE_UPSTREAM: advertising: Add adv SupportedFeatures to bluetoothctl
PRE_UPSTREAM: advertising: Add adv SupportedFeatures to doc

 client/main.c           |  1 +
 doc/advertising-api.txt | 18 +++++++++++++
 lib/mgmt.h              |  2 ++
 src/advertising.c       | 56 +++++++++++++++++++++++++++++++++++++++--
 4 files changed, 75 insertions(+), 2 deletions(-)
Signature · 1 line
2.28.0.297.g1956fa8f8d-goog
#1 lore raw

PATCH 1/3 advertising: Add SupportedFeatures to LEAdvertisingManager1

The new SupportedFeatures member tells advertising clients whether the platform has hardware support for advertising or capability to set tx power of advertisements.

Additionally, fix small typo in "secondary_exists" function name.

Change is tested on hatch and kukui chromebooks by using dbus-send to verify that SupportedFeatures are populated when extended advertising is available only.

---

 lib/mgmt.h        |  2 ++
 src/advertising.c | 56 +++++++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 56 insertions(+), 2 deletions(-)
lib/mgmt.h +2 -0
index a800bcab4..38182e576 100644
@@ -516,6 +516,8 @@ struct mgmt_rp_add_advertising {
 #define MGMT_ADV_FLAG_SEC_1M		(1 << 7)
 #define MGMT_ADV_FLAG_SEC_2M		(1 << 8)
 #define MGMT_ADV_FLAG_SEC_CODED		(1 << 9)
+#define MGMT_ADV_FLAG_CAN_SET_TX_POWER	(1 << 10)
+#define MGMT_ADV_FLAG_HW_OFFLOAD	(1 << 11)
 
 #define MGMT_OP_REMOVE_ADVERTISING	0x003F
 struct mgmt_cp_remove_advertising {
src/advertising.c +54 -2

73 lines not on this page · raw message

Signature · 1 line
2.28.0.297.g1956fa8f8d-goog
#2 lore raw

PATCH 2/3 advertising: Add adv SupportedFeatures to bluetoothctl

In reply to Daniel Winkler

This change adds SupportedFeatures to be shown in "show" option of bluetoothctl. It was tested with and without kernel support for features to verify that they are shown or not shown correctly.

Change was tested by verifying SupportedFeatures were populated correctly in bluetoothctl on hatch and kukui chromebooks

---

 client/main.c | 1 +
 1 file changed, 1 insertion(+)
client/main.c +1 -0
index da877b546..6368cd516 100644
@@ -933,6 +933,7 @@ static void cmd_show(int argc, char *argv[])
 		print_property(adapter->ad_proxy, "SupportedInstances");
 		print_property(adapter->ad_proxy, "SupportedIncludes");
 		print_property(adapter->ad_proxy, "SupportedSecondaryChannels");
+		print_property(adapter->ad_proxy, "SupportedFeatures");
 	}
 
 	return bt_shell_noninteractive_quit(EXIT_SUCCESS);
Signature · 1 line
2.28.0.297.g1956fa8f8d-goog
#3 lore raw

PATCH 3/3 advertising: Add adv SupportedFeatures to doc

In reply to Daniel Winkler

---

 doc/advertising-api.txt | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
doc/advertising-api.txt +18 -0
index b0565eab2..0c07f349e 100644
@@ -209,3 +209,21 @@ Properties	byte ActiveInstances
 			Possible values: "1M"
 					 "2M"
 					 "Coded"
+
+		array{string} SupportedFeatures [readonly, optional]
+
+			List of supported platform features. If no features
+			are available on the platform, the SupportedFeatures
+			endpoint will not be populated.
+
+			Possible values: "CanSetTxPower"
+
+						Indicates whether platform can
+						specify tx power on each
+						advertising instance.
+
+					 "HardwareOffload"
+
+						Indicates whether multiple
+						advertising will be offloaded
+						to the controller.
Signature · 1 line
2.28.0.297.g1956fa8f8d-goog
maintainer
#4 lore raw

Re: [Bluez PATCH v1 3/3] advertising: Add adv SupportedFeatures to doc

Hi Daniel,

Quoted 11 lines

---

doc/advertising-api.txt | 18 ++++++++++++++++++

1 file changed, 18 insertions(+)
doc/advertising-api.txt +0 -0
index b0565eab2..0c07f349e 100644

doc/advertising-api.txt Properties byte ActiveInstances · line 217

Quoted 9 lines
doc/advertising-api.txt +6 -0
@@ -209,3 +209,21 @@ Properties	byte ActiveInstances
 			Possible values: "1M"
 					 "2M"
 					 "Coded"
+
+		array{string} SupportedFeatures [readonly, optional]
+
+			List of supported platform features. If no features
+			are available on the platform, the SupportedFeatures
+			endpoint will not be populated.

why not just an empty SupportedFeatures? So you can tell that at least the daemon has support for it, but the hardware does not.

Regards

Marcel

#5 lore raw
In reply to Daniel Winkler

Hi Maintainers, I accidentally sent a patchset with PRE-UPSTREAM commit tags on the commit headings. I have sent another version without, so please ignore the former. Thanks for your understanding.

Best regards,
Daniel

Quoted 26 lines · Daniel Winkler

Hi Maintainers,

This change adds a SupportedFeatures member to the LEAdvertisingManager interface, which allows us to expose support for hardware offloading and setting TX power on advertisements.

Best,
Daniel

Daniel Winkler (3):
PRE_UPSTREAM: advertising: Add SupportedFeatures to
LEAdvertisingManager1
PRE_UPSTREAM: advertising: Add adv SupportedFeatures to bluetoothctl
PRE_UPSTREAM: advertising: Add adv SupportedFeatures to doc

 client/main.c           |  1 +
 doc/advertising-api.txt | 18 +++++++++++++
 lib/mgmt.h              |  2 ++
 src/advertising.c       | 56 +++++++++++++++++++++++++++++++++++++++--
 4 files changed, 75 insertions(+), 2 deletions(-)

--
2.28.0.297.g1956fa8f8d-goog