Skip to contentSkip to conversation

doc: Add Bluetooth quality report event

PATCH In review Joseph Hwang 3 participants 14 messages Feb 9, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/9 doc: Add Bluetooth quality report event

Add the Bluetooth quality report event in doc/mgmt-api.txt.

---

Changes in v3:
- Swap AOSP Bluetooth Quality Report Event and Intel Telemetry Event.
- Add 5 new patches (5/9 - 9/9) to enable the quality report feature via MGMT_OP_SET_QUALITY_REPORT instead of through the experimental features.

Changes in v2:
- This is a new patch for adding the event in doc/mgmt-api.txt

 doc/mgmt-api.txt | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
doc/mgmt-api.txt +19 -0
index ebe56afa4..5a32091fa 100644
@@ -4978,3 +4978,22 @@ Advertisement Monitor Device Lost Event
 		2	LE Random
 
 	This event will be sent to all management sockets.
+
+
+Bluetooth Quality Report Event
+==============================
+
+	Event code:		0x0031
+	Controller Index:	<controller_id>
+	Event Parameters:	Quality_Spec (1 Octet)
+				Report_Len (2 Octets)
+				Report (0-65535 Octets)
+
+	This event carries the Bluetooth quality report sent by the
+	controller.
+
+	Possible values for the Quality_Spec parameter:
+		0	AOSP Bluetooth Quality Report Event
+		1	Intel Telemetry Event
+
+	This event will be sent to all management sockets.
Signature · 1 line
2.35.0.263.gb82422642f-goog
#1 lore raw

PATCH v3 2/9 lib: Add structures and constants for quality report event

Add the new struct and constants to lib/mgmt.h.

---

Changes in v3:
- Swap AOSP Bluetooth Quality Report Event and Intel Telemetry Event.

Changes in v2:
- This is a new patch for adding the new struct and constants.

 lib/mgmt.h | 10 ++++++++++
 1 file changed, 10 insertions(+)
lib/mgmt.h +10 -0
index 922a24367..db9a24cd6 100644
@@ -1032,6 +1032,15 @@ struct mgmt_ev_adv_monitor_device_lost {
 	struct mgmt_addr_info addr;
 } __packed;
 
+#define MGMT_EV_QUALITY_REPORT			0x0031
+#define QUALITY_SPEC_AOSP_BQR			0x0
+#define QUALITY_SPEC_INTEL_TELEMETRY		0x1
+struct mgmt_ev_quality_report {
+	uint8_t quality_spec;
+	uint32_t data_len;
+	uint8_t data[];
+} __packed;
+
 static const char *mgmt_op[] = {
 	"<0x0000>",
 	"Read Version",
@@ -1172,6 +1181,7 @@ static const char *mgmt_ev[] = {
 	"Controller Resume",
 	"Advertisement Monitor Device Found",		/* 0x002f */
 	"Advertisement Monitor Device Lost",
+	"Bluetooth Quality Report",			/* 0x0031 */
 };
 
 static const char *mgmt_status[] = {
Signature · 1 line
2.35.0.263.gb82422642f-goog
maintainer
#2 lore raw

Re: [BlueZ PATCH v3 2/9] lib: Add structures and constants for quality report event

Hi Joseph,

Quoted 19 lines

Add the new struct and constants to lib/mgmt.h.

---

Changes in v3:
- Swap AOSP Bluetooth Quality Report Event and Intel Telemetry Event.

Changes in v2:
- This is a new patch for adding the new struct and constants.

lib/mgmt.h | 10 ++++++++++

1 file changed, 10 insertions(+)
lib/mgmt.h +0 -0
index 922a24367..db9a24cd6 100644

lib/mgmt.h struct mgmt_ev_adv_monitor_device_lost { · line 1036

Quoted 5 lines
lib/mgmt.h +2 -0
@@ -1032,6 +1032,15 @@ struct mgmt_ev_adv_monitor_device_lost {
 	struct mgmt_addr_info addr;
 } __packed;
 
+#define MGMT_EV_QUALITY_REPORT			0x0031
+#define QUALITY_SPEC_AOSP_BQR			0x0

Just AOSP.

lib/mgmt.h struct mgmt_ev_adv_monitor_device_lost { · line 1037

Quoted 1 line
lib/mgmt.h +1 -0
+#define QUALITY_SPEC_INTEL_TELEMETRY		0x1

Just INTEL.

Quoted 10 lines
lib/mgmt.h +6 -0
+struct mgmt_ev_quality_report {
+	uint8_t quality_spec;
+	uint32_t data_len;
+	uint8_t data[];
+} __packed;
+
 static const char *mgmt_op[] = {
 	"<0x0000>",
 	"Read Version",

lib/mgmt.h static const char *mgmt_ev[] = { · line 1187

Quoted 7 lines
lib/mgmt.h +1 -0
@@ -1172,6 +1181,7 @@ static const char *mgmt_ev[] = {
 	"Controller Resume",
 	"Advertisement Monitor Device Found",		/* 0x002f */
 	"Advertisement Monitor Device Lost",
+	"Bluetooth Quality Report",			/* 0x0031 */
 };
 
 static const char *mgmt_status[] = {

as with the mgmt-api.txt changes, just “Quality Report” and combine command and event changes.

Regards

Marcel

#3 lore raw

PATCH v3 3/9 adapter: support AOSP MGMT_EV_QUALITY_REPORT

In reply to Joseph Hwang

This patch supports a new MGMT event of AOSP bluetooth quality report.

---

(no changes since v2)

Changes in v2:
- The new structs and constants are moved to separate patches:
* doc: Add Bluetooth quality report event
* lib: Add structures and constants for quality report
- The btmon decoding patches, about 500 lines of code, are ready and will be submitted immediately after these patches are accepted.
- Use util_debug instead of defining a new debug function.
- Remove the event printing function.
- The plan about the BQR events is to further expose them to other daemons, e.g., an audio daemon to make some smart control, or to an UI daemon to display alerts to users.

 Makefile.am       |  3 +-
 src/adapter.c     | 56 +++++++++++++++++++++++++++++
 src/adapter.h     |  2 ++
 src/shared/aosp.c | 90 +++++++++++++++++++++++++++++++++++++++++++++++
 src/shared/aosp.h | 58 ++++++++++++++++++++++++++++++
 5 files changed, 208 insertions(+), 1 deletion(-)
 create mode 100644 src/shared/aosp.c
 create mode 100644 src/shared/aosp.h
Makefile.am +2 -1
index e391d7ae8..baab40369 100644
@@ -230,7 +230,8 @@ shared_sources = src/shared/io.h src/shared/timeout.h \
 			src/shared/gatt-db.h src/shared/gatt-db.c \
 			src/shared/gap.h src/shared/gap.c \
 			src/shared/log.h src/shared/log.c \
-			src/shared/tty.h
+			src/shared/tty.h \
+			src/shared/aosp.h src/shared/aosp.c
 
 if READLINE
 shared_sources += src/shared/shell.c src/shared/shell.h
src/adapter.c +56 -0

92 lines not on this page · raw message

src/adapter.h +2 -0
index 35deb1d11..c199e358a 100644
@@ -266,6 +266,8 @@ enum kernel_features {
 
 bool btd_has_kernel_features(uint32_t feature);
 
+bool is_quality_report_supported(struct btd_adapter *adapter);
+
 bool btd_adapter_set_allowed_uuids(struct btd_adapter *adapter,
 							struct queue *uuids);
 bool btd_adapter_is_uuid_allowed(struct btd_adapter *adapter,
src/shared/aosp.c new file +90 -0

90 lines not on this page · raw message

src/shared/aosp.h new file +58 -0

58 lines not on this page · raw message

Signature · 1 line
2.35.0.263.gb82422642f-goog
#4 lore raw

PATCH v3 4/9 adapter: support Intel MGMT_EV_QUALITY_REPORT

In reply to Joseph Hwang

This patch supports a new MGMT event of Intel telemetry report.

---

(no changes since v2)

Changes in v2:
- Remove the event printing function. The btmon decoding patches are ready and will be submitted after these are accepted.

 Makefile.am        |   3 +-
 src/adapter.c      |   9 +-
 src/shared/intel.c | 243 +++++++++++++++++++++++++++++++++++++++++++++
 src/shared/intel.h | 155 +++++++++++++++++++++++++++++
 4 files changed, 408 insertions(+), 2 deletions(-)
 create mode 100644 src/shared/intel.c
 create mode 100644 src/shared/intel.h
Makefile.am +2 -1
index baab40369..abbe3897b 100644
@@ -231,7 +231,8 @@ shared_sources = src/shared/io.h src/shared/timeout.h \
 			src/shared/gap.h src/shared/gap.c \
 			src/shared/log.h src/shared/log.c \
 			src/shared/tty.h \
-			src/shared/aosp.h src/shared/aosp.c
+			src/shared/aosp.h src/shared/aosp.c \
+			src/shared/intel.h src/shared/intel.c
 
 if READLINE
 shared_sources += src/shared/shell.c src/shared/shell.h
src/adapter.c +8 -1
index 58f8c0298..9816235ec 100644
@@ -48,6 +48,7 @@
 #include "src/shared/gatt-db.h"
 #include "src/shared/timeout.h"
 #include "src/shared/aosp.h"
+#include "src/shared/intel.h"
 
 #include "btio/btio.h"
 #include "btd.h"
@@ -9329,6 +9330,9 @@ static void quality_report_callback(uint16_t index, uint16_t length,
 	if (ev->quality_spec == QUALITY_SPEC_AOSP_BQR) {
 		if (!process_aosp_quality_report(ev))
 			error("processing aosp quality report");
+	} else if (ev->quality_spec == QUALITY_SPEC_INTEL_TELEMETRY) {
+		if (!process_intel_telemetry_report(ev))
+			error("processing intel telemetry report");
 	} else {
 		error("quality report spec %u not supported.",
 			ev->quality_spec);
@@ -9927,7 +9931,10 @@ static void quality_report_debug(const char *str, void *user_data)
 
 static void quality_set_debug(struct btd_adapter *adapter)
 {
-	aosp_set_debug(quality_report_debug, "quality: ");
+	if (is_manufacturer_intel(adapter->manufacturer))
+		intel_set_debug(quality_report_debug, "quality: ");
+	else
+		aosp_set_debug(quality_report_debug, "quality: ");
 }
 
 static void read_info_complete(uint8_t status, uint16_t length,
src/shared/intel.c new file +243 -0

243 lines not on this page · raw message

src/shared/intel.h new file +155 -0

155 lines not on this page · raw message

Signature · 1 line
2.35.0.263.gb82422642f-goog
#5 lore raw

PATCH v3 5/9 doc: Introduce the Set Quality Report Command

In reply to Joseph Hwang

Add the Set Quality Report Command in doc/mgmt-api.txt.

---

Changes in v3:
- This is a new patch that introduces the Set Quality Report Command.

 doc/mgmt-api.txt | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
doc/mgmt-api.txt +33 -0
index 5a32091fa..4ac84d41b 100644
@@ -332,6 +332,7 @@ Read Controller Information Command
 		15	Static Address
 		16	PHY Configuration
 		17	Wideband Speech
+		18	Quality Report
 
 	This command generates a Command Complete event on success or
 	a Command Status event on failure.
@@ -2924,6 +2925,7 @@ Read Extended Controller Information Command
 		15	Static Address
 		16	PHY Configuration
 		17	Wideband Speech
+		18	Quality Report
 
 	The EIR_Data field contains information about class of device,
 	local name and other values. Not all of them might be present. For
@@ -3858,6 +3860,37 @@ Add Advertisement Patterns Monitor With RSSI Threshold Command
 				Invalid Parameters
 
 
+Set Quality Report Command
+==========================
+
+	Command Code:           0x0057
+	Controller Index:       <controller id>
+	Command Parameters:     Action (1 Octet)
+	Return Parameters:
+
+	This command is used to enable and disable the controller's quality
+	report feature.
+
+	This command requires to use a valid controller index. Otherwise,
+	an "invalid index" status will be returned.
+
+	The parameter "action" can be either 0 to disable the feature or
+	1 to enable the feature. For any values other than 0 and 1, an
+	"invalid parameters" status will be returned.
+
+	If the driver does not indicate that the controller supports the
+	quality report feature, a "not supported" status will be returned.
+
+	The command is sent to the controller to enable/disable the quality
+	report feature. If the controller failed to execute the action, a
+	"failed" status will be returned.
+
+	Possible errors:	Failed
+				Invalid Index
+				Invalid Parameters
+				Not Supported
+
+
 Command Complete Event
 ======================
 
Signature · 1 line
2.35.0.263.gb82422642f-goog
maintainer
#6 lore raw

Re: [BlueZ PATCH v3 5/9] doc: Introduce the Set Quality Report Command

Hi Joseph,

Quoted 33 lines

Add the Set Quality Report Command in doc/mgmt-api.txt.

---

Changes in v3:
- This is a new patch that introduces the Set Quality Report Command.

doc/mgmt-api.txt | 33 +++++++++++++++++++++++++++++++++

1 file changed, 33 insertions(+)
doc/mgmt-api.txt +2 -0
index 5a32091fa..4ac84d41b 100644
@@ -332,6 +332,7 @@ Read Controller Information Command
 		15	Static Address
 		16	PHY Configuration
 		17	Wideband Speech
+		18	Quality Report
 
 	This command generates a Command Complete event on success or
 	a Command Status event on failure.
@@ -2924,6 +2925,7 @@ Read Extended Controller Information Command
 		15	Static Address
 		16	PHY Configuration
 		17	Wideband Speech
+		18	Quality Report
 
 	The EIR_Data field contains information about class of device,
 	local name and other values. Not all of them might be present. For

doc/mgmt-api.txt Add Advertisement Patterns Monitor With RSSI Threshold Command · line 3868

Quoted 9 lines
doc/mgmt-api.txt +6 -0
@@ -3858,6 +3860,37 @@ Add Advertisement Patterns Monitor With RSSI Threshold Command
 				Invalid Parameters
 
 
+Set Quality Report Command
+==========================
+
+	Command Code:           0x0057
+	Controller Index:       <controller id>
+	Command Parameters:     Action (1 Octet)

Quality_Report (1 Octet)

doc/mgmt-api.txt Add Advertisement Patterns Monitor With RSSI Threshold Command · line 3869

Quoted 1 line
doc/mgmt-api.txt +1 -0
+	Return Parameters:

Current_Settings (4 Octets)

Quoted 14 lines
doc/mgmt-api.txt +14 -0
+
+	This command is used to enable and disable the controller's quality
+	report feature.
+
+	This command requires to use a valid controller index. Otherwise,
+	an "invalid index" status will be returned.
+
+	The parameter "action" can be either 0 to disable the feature or
+	1 to enable the feature. For any values other than 0 and 1, an
+	"invalid parameters" status will be returned.
+
+	If the driver does not indicate that the controller supports the
+	quality report feature, a "not supported" status will be returned.
+

doc/mgmt-api.txt Add Advertisement Patterns Monitor With RSSI Threshold Command · line 3893

Quoted 10 lines
doc/mgmt-api.txt +10 -0
+	The command is sent to the controller to enable/disable the quality
+	report feature. If the controller failed to execute the action, a
+	"failed" status will be returned.
+
+	Possible errors:	Failed
+				Invalid Index
+				Invalid Parameters
+				Not Supported
+
+

You might want to have the description a bit more in line with the others like Set Wideband Speech etc.

Regards

Marcel

#7 lore raw

PATCH v3 6/9 lib: Add structure and constant for MGMT_OP_SET_QUALITY_REPORT

In reply to Joseph Hwang

This patch adds the struct and constant for
MGMT_OP_SET_QUALITY_REPORT.

---

Changes in v3:
- This is a new patch that adds the structure and constant for MGMT_OP_SET_QUALITY_REPORT.

 lib/mgmt.h | 6 ++++++
 1 file changed, 6 insertions(+)
lib/mgmt.h +6 -0
index db9a24cd6..2741d5d66 100644
@@ -96,6 +96,7 @@ struct mgmt_rp_read_index_list {
 #define MGMT_SETTING_STATIC_ADDRESS	0x00008000
 #define MGMT_SETTING_PHY_CONFIGURATION	0x00010000
 #define MGMT_SETTING_WIDEBAND_SPEECH	0x00020000
+#define MGMT_SETTING_QUALITY_REPORT	0x00040000
 
 #define MGMT_OP_READ_INFO		0x0004
 struct mgmt_rp_read_info {
@@ -757,6 +758,11 @@ struct mgmt_cp_add_adv_patterns_monitor_rssi {
 	struct mgmt_adv_pattern patterns[0];
 } __packed;
 
+#define MGMT_OP_SET_QUALITY_REPORT		0x0057
+struct mgmt_cp_set_quality_report {
+	uint8_t action;
+} __packed;
+
 #define MGMT_EV_CMD_COMPLETE		0x0001
 struct mgmt_ev_cmd_complete {
 	uint16_t opcode;
Signature · 1 line
2.35.0.263.gb82422642f-goog
#8 lore raw

PATCH v3 7/9 adapter: enable quality report via MGMT_OP_SET_QUALITY_REPORT

In reply to Joseph Hwang

The quality report feature is now enabled through MGMT_OP_SET_QUALITY_REPORT instead of through the experimental features.

---

Changes in v3:
- This is a new patch that enables the quality report feature via MGMT_OP_SET_QUALITY_REPORT.

 src/adapter.c | 32 +++++---------------------------
 1 file changed, 5 insertions(+), 27 deletions(-)
src/adapter.c +5 -27
index 9816235ec..9cb684345 100644
@@ -122,13 +122,6 @@ static const struct mgmt_exp_uuid le_simult_central_peripheral_uuid = {
 	.str = "671b10b5-42c0-4696-9227-eb28d1b049d6"
 };
 
-/* 330859bc-7506-492d-9370-9a6f0614037f */
-static const struct mgmt_exp_uuid quality_report_uuid = {
-	.val = { 0x7f, 0x03, 0x14, 0x06, 0x6f, 0x9a, 0x70, 0x93,
-		0x2d, 0x49, 0x06, 0x75, 0xbc, 0x59, 0x08, 0x33 },
-	.str = "330859bc-7506-492d-9370-9a6f0614037f"
-};
-
 /* 15c0a148-c273-11ea-b3de-0242ac130004 */
 static const struct mgmt_exp_uuid rpa_resolution_uuid = {
 	.val = { 0x04, 0x00, 0x13, 0xac, 0x42, 0x02, 0xde, 0xb3,
@@ -9754,25 +9747,6 @@ static void le_simult_central_peripheral_func(struct btd_adapter *adapter,
 				(void *)le_simult_central_peripheral_uuid.val);
 }
 
-static bool is_exp_feature_uuid_the_same(const void *data,
-							const void *match_data)
-{
-	return memcmp(data, match_data,
-			sizeof(((struct mgmt_exp_uuid *)NULL)->val)) == 0;
-}
-
-bool is_quality_report_supported(struct btd_adapter *adapter)
-{
-	return queue_find(adapter->exps, is_exp_feature_uuid_the_same,
-				(void *)quality_report_uuid.val) != NULL;
-}
-
-static void quality_report_func(struct btd_adapter *adapter, uint8_t action)
-{
-	if (action)
-		queue_push_tail(adapter->exps, (void *)quality_report_uuid.val);
-}
-
 static void set_rpa_resolution_complete(uint8_t status, uint16_t len,
 					const void *param, void *user_data)
 {
@@ -9848,7 +9822,6 @@ static const struct exp_feat {
 	EXP_FEAT(&debug_uuid, exp_debug_func),
 	EXP_FEAT(&le_simult_central_peripheral_uuid,
 		 le_simult_central_peripheral_func),
-	EXP_FEAT(&quality_report_uuid, quality_report_func),
 	EXP_FEAT(&rpa_resolution_uuid, rpa_resolution_func),
 	EXP_FEAT(&codec_offload_uuid, codec_offload_func),
 };
@@ -9922,6 +9895,11 @@ static void read_exp_features(struct btd_adapter *adapter)
 	btd_error(adapter->dev_id, "Failed to read exp features info");
 }
 
+bool is_quality_report_supported(struct btd_adapter *adapter)
+{
+	return !!(adapter->supported_settings & MGMT_SETTING_QUALITY_REPORT);
+}
+
 static void quality_report_debug(const char *str, void *user_data)
 {
 	const char *prefix = user_data;
Signature · 1 line
2.35.0.263.gb82422642f-goog
#9 lore raw

PATCH v3 8/9 tools/btmgmt: fix quality report command

In reply to Joseph Hwang

The set quality report feature becomes a mgmt command and is not included in the experimental features any more.

---

Changes in v3:
- This is a new patch that fixes the quality on/off command in btmgmt.

 tools/btmgmt.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)
tools/btmgmt.c +6 -12
index 42ef9acef..4f215b4af 100644
@@ -1842,7 +1842,7 @@ static void cmd_exp_privacy(int argc, char **argv)
 	}
 }
 
-static void exp_quality_rsp(uint8_t status, uint16_t len, const void *param,
+static void quality_rsp(uint8_t status, uint16_t len, const void *param,
 							void *user_data)
 {
 	if (status != 0)
@@ -1856,12 +1856,7 @@ static void exp_quality_rsp(uint8_t status, uint16_t len, const void *param,
 
 static void cmd_exp_quality(int argc, char **argv)
 {
-	/* 330859bc-7506-492d-9370-9a6f0614037f */
-	static const uint8_t uuid[16] = {
-				0x7f, 0x03, 0x14, 0x06, 0x6f, 0x9a, 0x70, 0x93,
-				0x2d, 0x49, 0x06, 0x75, 0xbc, 0x59, 0x08, 0x33,
-	};
-	struct mgmt_cp_set_exp_feature cp;
+	struct mgmt_cp_set_quality_report cp;
 	uint8_t val;
 
 	if (mgmt_index == MGMT_INDEX_NONE) {
@@ -1878,11 +1873,10 @@ static void cmd_exp_quality(int argc, char **argv)
 	}
 
 	memset(&cp, 0, sizeof(cp));
-	memcpy(cp.uuid, uuid, 16);
 	cp.action = val;
 
-	if (mgmt_send(mgmt, MGMT_OP_SET_EXP_FEATURE, mgmt_index,
-			sizeof(cp), &cp, exp_quality_rsp, NULL, NULL) == 0) {
+	if (mgmt_send(mgmt, MGMT_OP_SET_QUALITY_REPORT, mgmt_index,
+			sizeof(cp), &cp, quality_rsp, NULL, NULL) == 0) {
 		error("Unable to send quality report feature cmd");
 		return bt_shell_noninteractive_quit(EXIT_FAILURE);
 	}
@@ -5636,10 +5630,10 @@ static const struct bt_shell_menu main_menu = {
 		cmd_exp_debug,		"Set debug feature"		},
 	{ "exp-privacy",	"<on/off>",
 		cmd_exp_privacy,	"Set LL privacy feature"	},
-	{ "exp-quality",	"<on/off>", cmd_exp_quality,
-		"Set bluetooth quality report feature"			},
 	{ "exp-offload",		"<on/off>",
 		cmd_exp_offload_codecs,	"Toggle codec support"		},
+	{ "quality",		"<on/off>",
+		cmd_exp_quality, "Set bluetooth quality report feature"	},
 	{ "read-sysconfig",	NULL,
 		cmd_read_sysconfig,	"Read System Configuration"	},
 	{ "set-sysconfig",	"<-v|-h> [options...]",
Signature · 1 line
2.35.0.263.gb82422642f-goog
#10 lore raw

PATCH v3 9/9 monitor: print quality report cmd

In reply to Joseph Hwang

This patch prints the set quality command properly.

---

Changes in v3:
- This is a new patch that prints the set quality command.

 monitor/packet.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
monitor/packet.c +11 -0
index 397000644..4dce2f681 100644
@@ -12011,6 +12011,7 @@ static const struct bitfield_data mgmt_settings_table[] = {
 	{ 15, "Static Address"		},
 	{ 16, "PHY Configuration"	},
 	{ 17, "Wideband Speech"		},
+	{ 18, "Quality Report"		},
 	{ }
 };
 
@@ -13607,6 +13608,13 @@ static void mgmt_remove_adv_monitor_patterns_rsp(const void *data,
 	print_field("Handle: %d", handle);
 }
 
+static void mgmt_set_quality_report_cmd(const void *data, uint16_t size)
+{
+	uint8_t action = *(uint8_t *)data;
+
+	print_field("Set Quality Report %u", action);
+}
+
 struct mgmt_data {
 	uint16_t opcode;
 	const char *str;
@@ -13864,6 +13872,9 @@ static const struct mgmt_data mgmt_command_table[] = {
 				mgmt_add_adv_monitor_patterns_rssi_cmd, 8,
 									false,
 				mgmt_add_adv_monitor_patterns_rsp, 2, true},
+	{ 0x0057, "Set Quality Report",
+				mgmt_set_quality_report_cmd, 1, true,
+				mgmt_null_rsp, 0, true },
 	{ }
 };
 
Signature · 1 line
2.35.0.263.gb82422642f-goog
maintainer
#11 lore raw

Re: [BlueZ PATCH v3 9/9] monitor: print quality report cmd

Hi Joseph,

Quoted 24 lines

This patch prints the set quality command properly.

---

Changes in v3:
- This is a new patch that prints the set quality command.

monitor/packet.c | 11 +++++++++++

1 file changed, 11 insertions(+)
monitor/packet.c +1 -0
index 397000644..4dce2f681 100644
@@ -12011,6 +12011,7 @@ static const struct bitfield_data mgmt_settings_table[] = {
 	{ 15, "Static Address"		},
 	{ 16, "PHY Configuration"	},
 	{ 17, "Wideband Speech"		},
+	{ 18, "Quality Report"		},
 	{ }
 };
 

monitor/packet.c static void mgmt_remove_adv_monitor_patterns_rsp(const void *data, · line 13613

Quoted 6 lines
monitor/packet.c +3 -0
@@ -13607,6 +13608,13 @@ static void mgmt_remove_adv_monitor_patterns_rsp(const void *data,
 	print_field("Handle: %d", handle);
 }
 
+static void mgmt_set_quality_report_cmd(const void *data, uint16_t size)
+{
+	uint8_t action = *(uint8_t *)data;

please use get_u8(data).

Quoted 8 lines
monitor/packet.c +4 -0
+
+	print_field("Set Quality Report %u", action);
+}
+
 struct mgmt_data {
 	uint16_t opcode;
 	const char *str;

monitor/packet.c static const struct mgmt_data mgmt_command_table[] = { · line 13879

Quoted 8 lines
monitor/packet.c +3 -0
@@ -13864,6 +13872,9 @@ static const struct mgmt_data mgmt_command_table[] = {
 				mgmt_add_adv_monitor_patterns_rssi_cmd, 8,
 									false,
 				mgmt_add_adv_monitor_patterns_rsp, 2, true},
+	{ 0x0057, "Set Quality Report",
+				mgmt_set_quality_report_cmd, 1, true,
+				mgmt_null_rsp, 0, true },
 	{ }
 };

We also have a few mgmt commands that miss decodes. If you have bandwidth, feel free to add these as well.

And we should have them also added to btmon --todo.

Regards

Marcel

#12 lore raw
In reply to Joseph Hwang

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=612544

---Test result---

Test Summary:

CheckPatch                    PASS      13.81 seconds
GitLint                       PASS      9.23 seconds
Prep - Setup ELL              PASS      48.47 seconds
Build - Prep                  PASS      0.90 seconds
Build - Configure             PASS      9.31 seconds
Build - Make                  PASS      1511.45 seconds
Make Check                    PASS      11.25 seconds
Make Check w/Valgrind         PASS      447.60 seconds
Make Distcheck                PASS      231.77 seconds
Build w/ext ELL - Configure   PASS      8.17 seconds
Build w/ext ELL - Make        PASS      1430.29 seconds
Incremental Build with patchesPASS      13382.32 seconds

---
Regards,
Linux Bluetooth

maintainer
#13 lore raw
In reply to Joseph Hwang

Hi Joseph,

Quoted 22 lines

Add the Bluetooth quality report event in doc/mgmt-api.txt.

---

Changes in v3:
- Swap AOSP Bluetooth Quality Report Event and Intel Telemetry Event.
- Add 5 new patches (5/9 - 9/9) to enable the quality report feature via MGMT_OP_SET_QUALITY_REPORT instead of through the experimental features.

Changes in v2:
- This is a new patch for adding the event in doc/mgmt-api.txt

doc/mgmt-api.txt | 19 +++++++++++++++++++

1 file changed, 19 insertions(+)
doc/mgmt-api.txt +0 -0
index ebe56afa4..5a32091fa 100644

doc/mgmt-api.txt Advertisement Monitor Device Lost Event · line 4984

Quoted 7 lines
doc/mgmt-api.txt +4 -0
@@ -4978,3 +4978,22 @@ Advertisement Monitor Device Lost Event
 		2	LE Random
 
 	This event will be sent to all management sockets.
+
+
+Bluetooth Quality Report Event
+==============================

so this is on me since I never realized this. You stuck the Bluetooth word in front of the event name since that is also what AOSP calls it. However in mgmt-api.txt we have never added Bluetooth to command or event naming since that is obvious. So lets shorten this and just use “Quality Report Event”.

Quoted 15 lines
doc/mgmt-api.txt +15 -0
+
+	Event code:		0x0031
+	Controller Index:	<controller_id>
+	Event Parameters:	Quality_Spec (1 Octet)
+				Report_Len (2 Octets)
+				Report (0-65535 Octets)
+
+	This event carries the Bluetooth quality report sent by the
+	controller.
+
+	Possible values for the Quality_Spec parameter:
+		0	AOSP Bluetooth Quality Report Event
+		1	Intel Telemetry Event
+
+	This event will be sent to all management sockets.
Quoted 1 line

—

In addition, I prefer to have both command and event changes in a single patch.

Regards

Marcel