diff mbox series

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

Message ID 20220209092414.751642-7-josephsih@chromium.org (mailing list archive)
State Superseded
Headers show
Series [BlueZ,v3,1/9] doc: Add Bluetooth quality report event | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/checkpatch success Checkpatch PASS
tedd_an/gitlint success Gitlint PASS

Commit Message

Joseph Hwang Feb. 9, 2022, 9:24 a.m. UTC
This patch prints the set quality command properly.

Signed-off-by: Joseph Hwang <josephsih@chromium.org>
---

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

 monitor/packet.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Marcel Holtmann Feb. 9, 2022, 9:09 p.m. UTC | #1
Hi Joseph,

> This patch prints the set quality command properly.
> 
> Signed-off-by: Joseph Hwang <josephsih@chromium.org>
> ---
> 
> Changes in v3:
> - This is a new patch that prints the set quality command.
> 
> monitor/packet.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
> 
> diff --git a/monitor/packet.c b/monitor/packet.c
> index 397000644..4dce2f681 100644
> --- a/monitor/packet.c
> +++ b/monitor/packet.c
> @@ -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;

please use get_u8(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 },
> 	{ }
> };

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
diff mbox series

Patch

diff --git a/monitor/packet.c b/monitor/packet.c
index 397000644..4dce2f681 100644
--- a/monitor/packet.c
+++ b/monitor/packet.c
@@ -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 },
 	{ }
 };