Skip to contentSkip to conversation

Expose extended adv feature support via bluez API

PATCH Superseded Daniel Winkler 1 participant 4 messages Sep 1, 2020

Subsystems (2)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v2 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

Changes in v2:
- Expose empty SupportedFeatures if no support available
- Doc: Expect empty SupportedFeatures if no support available

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

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

PATCH v2 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 always exists, and is only populated when extended advertising is available.

---

Changes in v2:
- Expose empty SupportedFeatures if no support available

 lib/mgmt.h        |  2 ++
 src/advertising.c | 43 +++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 43 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 +41 -2

60 lines not on this page · raw message

Signature · 1 line
2.28.0.402.g5ffc5be6b7-goog
#2 lore raw

PATCH v2 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

---

Changes in v2: None

 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.402.g5ffc5be6b7-goog
#3 lore raw

PATCH v2 3/3 advertising: Add adv SupportedFeatures to doc

In reply to Daniel Winkler

---

Changes in v2:
- Doc: Expect empty SupportedFeatures if no support available

 doc/advertising-api.txt | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
doc/advertising-api.txt +18 -0
index b0565eab2..90a8a47f6 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
+			array will be empty.
+
+			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.402.g5ffc5be6b7-goog