diff mbox series

[BlueZ,v4,1/2] monitor: Add ADV Monitor events to btmon parser

Message ID 20220908145555.161258-1-brian.gix@intel.com
State Superseded
Headers show
Series [BlueZ,v4,1/2] monitor: Add ADV Monitor events to btmon parser | expand

Commit Message

Brian Gix Sept. 8, 2022, 2:55 p.m. UTC
Add missing ADV Monitor MGMT events
---
 monitor/packet.c | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

Comments

bluez.test.bot@gmail.com Sept. 8, 2022, 4:14 p.m. UTC | #1
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=675287

---Test result---

Test Summary:
CheckPatch                    PASS      3.03 seconds
GitLint                       PASS      1.96 seconds
Prep - Setup ELL              PASS      27.49 seconds
Build - Prep                  PASS      0.85 seconds
Build - Configure             PASS      8.75 seconds
Build - Make                  PASS      995.15 seconds
Make Check                    PASS      11.86 seconds
Make Check w/Valgrind         PASS      295.52 seconds
Make Distcheck                PASS      245.99 seconds
Build w/ext ELL - Configure   PASS      8.84 seconds
Build w/ext ELL - Make        PASS      86.53 seconds
Incremental Build w/ patches  PASS      204.14 seconds
Scan Build                    PASS      571.23 seconds



---
Regards,
Linux Bluetooth
patchwork-bot+bluetooth@kernel.org Sept. 8, 2022, 9:40 p.m. UTC | #2
Hello:

This series was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Thu,  8 Sep 2022 07:55:54 -0700 you wrote:
> Add missing ADV Monitor MGMT events
> ---
>  monitor/packet.c | 35 +++++++++++++++++++++++++++++++++++
>  1 file changed, 35 insertions(+)

Here is the summary with links:
  - [BlueZ,v4,1/2] monitor: Add ADV Monitor events to btmon parser
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=0940cba00348
  - [BlueZ,v4,2/2] monitor: Add mesh MGMT cmds/events to btmon parser
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=9d8fd3c28bbf

You are awesome, thank you!
diff mbox series

Patch

diff --git a/monitor/packet.c b/monitor/packet.c
index 46587e087..4f2172bdf 100644
--- a/monitor/packet.c
+++ b/monitor/packet.c
@@ -14914,6 +14914,37 @@  static void mgmt_controller_resume_evt(const void *data, uint16_t size)
 	mgmt_print_address(data, addr_type);
 }
 
+static void mgmt_adv_monitor_device_found_evt(const void *data, uint16_t size)
+{
+	uint16_t handle = get_le16(data);
+	const uint8_t *addr = data + 2;
+	uint8_t addr_type = get_u8(data + 8);
+	int8_t rssi = get_s8(data + 9);
+	uint32_t flags = get_le32(data + 10);
+	uint16_t ad_data_len = get_le16(data + 14);
+	const uint8_t *ad_data = data + 16;
+
+	print_field("Handle: %d", handle);
+	print_bdaddr(addr);
+	print_field("Addr Type: %d", addr_type);
+	print_field("RSSI: %d", rssi);
+	mgmt_print_device_flags(flags);
+	print_field("AD Data Len: %d", ad_data_len);
+	size -= 16;
+	print_hex_field("AD Data", ad_data, size);
+}
+
+static void mgmt_adv_monitor_device_lost_evt(const void *data, uint16_t size)
+{
+	uint16_t handle = get_le16(data);
+	const uint8_t *addr = data + 2;
+	uint8_t addr_type = get_u8(data + 8);
+
+	print_field("Handle: %d", handle);
+	print_bdaddr(addr);
+	print_field("Addr Type: %d", addr_type);
+}
+
 static const struct mgmt_data mgmt_event_table[] = {
 	{ 0x0001, "Command Complete",
 			mgmt_command_complete_evt, 3, false },
@@ -15003,6 +15034,10 @@  static const struct mgmt_data mgmt_event_table[] = {
 			mgmt_controller_suspend_evt, 1, true },
 	{ 0x002e, "Controller Resumed",
 			mgmt_controller_resume_evt, 8, true },
+	{ 0x002f, "ADV Monitor Device Found",
+			mgmt_adv_monitor_device_found_evt, 16, false },
+	{ 0x0030, "ADV Monitor Device Lost",
+			mgmt_adv_monitor_device_lost_evt, 9, true },
 	{ }
 };