Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1999932pxp; Mon, 21 Mar 2022 09:13:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxUG4dWw7WqLYsDgNKWmk3PyYHfQajamIuhkG0qlwdEZiPM2wyChMA/W+UdWeA+lELCDYzp X-Received: by 2002:a05:6a00:b92:b0:4fa:82e9:786c with SMTP id g18-20020a056a000b9200b004fa82e9786cmr11843736pfj.31.1647879194308; Mon, 21 Mar 2022 09:13:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647879194; cv=none; d=google.com; s=arc-20160816; b=OmFAKSyzUHc2g2+s6+/s/u+kwZtvvWLiw7BcJtWzosHZm5JdgqUstj3tBKFoG8whfq UCeWYz52yuj2ncG6U9chVlGOrzxt5/arS2rx9WgqSHIYPgG58ueB4pmTA2F5Q8Y11fLb qIOMUbW0XJWDtxX53LpP6xiQVW7LGBqa0tEfEIAxreN1eNkd9+/yJ5obrebwtwKaFAgl etNV3dHzxbmsp+QgV8jOtXjEr3IV/qboNGREezv7WuvZZjX89TMS+wA72ynhrJRa5zq8 kfh6csz9K3Szi/nD5vO4jJiX6g1MfR5osj090g/ft3ug0hXcbrK0Vt/I1HS+NuJTUsih 8Phw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=joxNZI1dCvGnyBW1ejSG5uFon3GqqO43qfCDamk2sAQ=; b=IZFILqlNgl1ws6X8SC11RmogtBREAHAe30gGHI7QW9Y4phZtvmrzukwXfBXG26H/0Y PJcrR5V3hjZrXBVPpSRVUnCm4kOjMJ9ot0oVZuzC5f3yIjAwBCF5+LZRR0dSUNWna3cd f0rwe5UagNM5T5991hHCsUgWtz6zwco8XExBUEgCqP5/4nu+kCfmW1XgJgMVAXpYO9Ly TEdimjlJZb+s1aQqJZWwrJgtzEFjdN7Z4ow09XdORba84FP89MSgGYeg8tBnqPCGb3kr Xel/DsAWtLkVZDI46hAFi9NE0DSbopxzRG2LKk4ll7qAioA9QqDZkvQiqh6cUPRZ5J93 iXCw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f3-20020a170902e98300b00153b2d16525si10434515plb.301.2022.03.21.09.12.39; Mon, 21 Mar 2022 09:13:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344379AbiCUEdQ (ORCPT + 99 others); Mon, 21 Mar 2022 00:33:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344426AbiCUEdL (ORCPT ); Mon, 21 Mar 2022 00:33:11 -0400 Received: from mx1.molgen.mpg.de (mx3.molgen.mpg.de [141.14.17.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E32F31DEB for ; Sun, 20 Mar 2022 21:31:36 -0700 (PDT) Received: from [192.168.0.3] (ip5f5aef4e.dynamic.kabel-deutschland.de [95.90.239.78]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: pmenzel) by mx.molgen.mpg.de (Postfix) with ESMTPSA id 87CB261E6478B; Mon, 21 Mar 2022 05:31:33 +0100 (CET) Message-ID: Date: Mon, 21 Mar 2022 05:31:33 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [BlueZ PATCH 5/9] monitor: Display AdvMonitor DeviceFound/Lost events Content-Language: en-US To: Manish Mandlik Cc: marcel@holtmann.org, luiz.dentz@gmail.com, chromeos-bluetooth-upstreaming@chromium.org, linux-bluetooth@vger.kernel.org, Miao-chen Chou References: <20220320183445.BlueZ.1.I21d5ed25e9a0a2427bddbd6d4ec04d80d735fc53@changeid> <20220320183445.BlueZ.5.I53ad1b66c8f8a65e5950354cd20417d812ad9c72@changeid> From: Paul Menzel In-Reply-To: <20220320183445.BlueZ.5.I53ad1b66c8f8a65e5950354cd20417d812ad9c72@changeid> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Dear Manish, Thank you for the patch. Am 21.03.22 um 02:36 schrieb Manish Mandlik: > Display information about MGMT_EV_ADV_MONITOR_DEVICE_FOUND and > MGMT_EV_ADV_MONITOR_DEVICE_LOST events in the btmon output. If you should reroll this patch, could you please add example messages to the commit message? Kind regards, Paul > Reviewed-by: Miao-chen Chou > --- > > monitor/packet.c | 29 +++++++++++++++++++++++++++++ > 1 file changed, 29 insertions(+) > > diff --git a/monitor/packet.c b/monitor/packet.c > index b7431b57d..6f615f7ba 100644 > --- a/monitor/packet.c > +++ b/monitor/packet.c > @@ -14103,6 +14103,31 @@ static void mgmt_device_found_evt(const void *data, uint16_t size) > print_eir(data + 14, size - 14, false); > } > > +static void mgmt_adv_monitor_device_found_evt(const void *data, uint16_t size) > +{ > + uint16_t handle = get_le16(data); > + uint8_t address_type = get_u8(data + 8); > + int8_t rssi = get_s8(data + 9); > + uint32_t flags = get_le32(data + 10); > + uint16_t data_len = get_le16(data + 14); > + > + print_field("Handle: %u", handle); > + mgmt_print_address(data + 2, address_type); > + print_rssi(rssi); > + mgmt_print_device_flags(flags); > + print_field("Data length: %u", data_len); > + print_eir(data + 16, size - 16, false); > +} > + > +static void mgmt_adv_monitor_device_lost_evt(const void *data, uint16_t size) > +{ > + uint16_t handle = get_le16(data); > + uint8_t address_type = get_u8(data + 8); > + > + print_field("Handle: %u", handle); > + mgmt_print_address(data + 2, address_type); > +} > + > static void mgmt_discovering_evt(const void *data, uint16_t size) > { > uint8_t type = get_u8(data); > @@ -14414,6 +14439,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 }, > { } > }; >