linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BlueZ PATCH] adv_monitor: parse AD type as hex value
@ 2020-10-07  3:01 Howard Chung
  2020-10-07  3:33 ` [BlueZ] " bluez.test.bot
  0 siblings, 1 reply; 2+ messages in thread
From: Howard Chung @ 2020-10-07  3:01 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: apusaka, luiz.von.dentz, alainm, mcchou, mmandlik, Howard Chung

Currently bluetoothctl parse pattern as a decimal string, but the
Bluetooth SIG website uses hex value instead.
(https://www.bluetooth.com/specifications/assigned-numbers/generic-access-
profile/)

Reviewed-by: Manish Mandlik <mmandlik@chromium.org>
---

 client/adv_monitor.c | 4 ++--
 client/main.c        | 4 ++++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/client/adv_monitor.c b/client/adv_monitor.c
index 90ab0be093d2..74f19d2d93e4 100644
--- a/client/adv_monitor.c
+++ b/client/adv_monitor.c
@@ -435,7 +435,7 @@ static struct pattern *parse_pattern(char *parameter_list[])
 	}
 
 	pat->start_pos = atoi(parameter_list[0]);
-	pat->ad_data_type = atoi(parameter_list[1]);
+	pat->ad_data_type = strtol(parameter_list[1], NULL, 16);
 	pat->content_len = str2bytearray(parameter_list[2], pat->content);
 	if (pat->content_len == 0) {
 		free_pattern(pat);
@@ -542,7 +542,7 @@ static void print_adv_monitor(struct adv_monitor *adv_monitor)
 			bt_shell_printf("\tpattern %d:\n", idx);
 			bt_shell_printf("\t\tstart position: %hhu\n",
 							pattern->start_pos);
-			bt_shell_printf("\t\tAD data type: %hhu\n",
+			bt_shell_printf("\t\tAD data type: 0x%02x\n",
 							pattern->ad_data_type);
 			print_bytearray("\t\tcontent: ", pattern->content,
 							pattern->content_len);
diff --git a/client/main.c b/client/main.c
index 60f1eb86e26a..16cb0234c48e 100644
--- a/client/main.c
+++ b/client/main.c
@@ -2724,6 +2724,8 @@ static void print_add_or_pattern_with_rssi_usage(void)
 						RSSI_DEFAULT_HIGH_TIMEOUT);
 	bt_shell_printf("pattern format:\n"
 			"\t<start_position> <ad_data_type> <content_of_pattern>\n");
+	bt_shell_printf("Note: both ad_data_type and content_of_pattern are "
+			"hex string\n");
 	bt_shell_printf("e.g.\n"
 			"\tadd-or-pattern-rssi -10, ,10 1 2 01ab55\n");
 	bt_shell_printf("or\n"
@@ -2734,6 +2736,8 @@ static void print_add_or_pattern_usage(void)
 {
 	bt_shell_printf("pattern format:\n"
 			"\t<start_position> <ad_data_type> <content_of_pattern>\n");
+	bt_shell_printf("Note: both ad_data_type and content_of_pattern are "
+			"hex string\n");
 	bt_shell_printf("e.g.\n"
 			"\tadd-or-pattern 1 2 01ab55 3 4 23cd66\n");
 }
-- 
2.28.0.806.g8561365e88-goog


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: [BlueZ] adv_monitor: parse AD type as hex value
  2020-10-07  3:01 [BlueZ PATCH] adv_monitor: parse AD type as hex value Howard Chung
@ 2020-10-07  3:33 ` bluez.test.bot
  0 siblings, 0 replies; 2+ messages in thread
From: bluez.test.bot @ 2020-10-07  3:33 UTC (permalink / raw)
  To: linux-bluetooth, howardchung

[-- Attachment #1: Type: text/plain, Size: 557 bytes --]

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

---Test result---

##############################
Test: CheckPatch - PASS

##############################
Test: CheckGitLint - PASS

##############################
Test: CheckBuild - PASS

##############################
Test: MakeCheck - PASS



---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-10-07  3:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-07  3:01 [BlueZ PATCH] adv_monitor: parse AD type as hex value Howard Chung
2020-10-07  3:33 ` [BlueZ] " bluez.test.bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).