Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp306865pxx; Thu, 29 Oct 2020 03:11:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjzZwmM3FlI1geQfzL0fC9DU8Z/AnWzRXx0rqbgOWW1k+pIp6KeUJ1U+gPMYjUlzWlEreT X-Received: by 2002:a17:906:6b92:: with SMTP id l18mr3346966ejr.292.1603966292928; Thu, 29 Oct 2020 03:11:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603966292; cv=none; d=google.com; s=arc-20160816; b=inAFZiMib4AfPdQZvK2k2dG+M460Jk62R+rcDUt53KsKUo5HoyvGhFyOx/e8WGreMx JbsLQk69swaesvffNG9CYVoqfs4j37F7F2sZFJjamjFactMCJCAMHaspCEic+1cWv/i5 1yLFlOIbydxK+IbUC7UmDmF/Z3zE8+NOECPVnmz7gZdOmm7Gtxf6cbdfw6sz4Dq2+5Dx HEYTo1l2fSjTLVt/JkXhFUwSibSBAy1m66TKpsjeKbXDHGNsS34rP4rVR1tAkyEi3Su5 tTXbknfPAkU+xo0TDPgc4ovpcHJBB1Wo0XbMl1XBTBB1/agU0mLSMrqHIhZZoFgbLNpk nUWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:sender:dkim-signature; bh=YO/jkQ1Xvo2Pu21jszB9gfiRu/kN1DHdIpxIq7BUWuc=; b=Xsc/K+btF0U8RzQiffAo57d85tNcYNcAOUR2df/I0fwxxodxoRm3ldD8On3AncA9Kg sVS0ZDoKWjK+luMMoEkVsVAgJ7DO1wryp4dKtbY1atZ8eZqG3g0dhDvYaThNQUZcw/I6 tpxpZOe/g4ZOlPywNYBovHyqLDKCcUhxI0699whLtCc+eyeAdwuE8DQQVd8HkhiATtPG dG/gwfrwaz1GPdOoBbAbQJ7QhdJHQ9G/RJApjulp+ujdYtb5M7mRDIP5iONKK4ywyZ5D 0gKP+do+/eL3zU+OqzD6mpF8mS+coZR5cSq3FWYvtwmNu2JnoWlR5SCyYes4NNuHtPTq uyeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=k9eXKy6+; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s12si1505679ejx.94.2020.10.29.03.11.09; Thu, 29 Oct 2020 03:11:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=k9eXKy6+; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727008AbgJ2KKE (ORCPT + 99 others); Thu, 29 Oct 2020 06:10:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726999AbgJ2KKC (ORCPT ); Thu, 29 Oct 2020 06:10:02 -0400 Received: from mail-pl1-x64a.google.com (mail-pl1-x64a.google.com [IPv6:2607:f8b0:4864:20::64a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F40D3C0613CF for ; Thu, 29 Oct 2020 03:10:01 -0700 (PDT) Received: by mail-pl1-x64a.google.com with SMTP id w16so1657585ply.15 for ; Thu, 29 Oct 2020 03:10:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=YO/jkQ1Xvo2Pu21jszB9gfiRu/kN1DHdIpxIq7BUWuc=; b=k9eXKy6+qxU1yQDJFKC3LWpgI+hJlBrVKphtQqCMF4frZlJFKDhWwMqqoSJ1+jkTBM 7BVNZ9JXLCjDK/1+18dLTpGcicgaSDnD+njg5Z7fqmjJuwgkGPXzUo9MUg1hTaMBfG+i 02EByLnTrhEvUNUKILh+K/yOjpbLvLicuUNB9iq7eLm5rptyOM2Sj2DdWdw5po+o2E5k UpYf3Gvz1V13QEn7/9ZVjltrREb+6c0lYS/bF4/OJngAxbQVh07gnVhs+Z947/jkk8OM bNDUbNxqrhfXtdFDynujgzXvn9VKrh5EYaJsO73zbZmF3HMxeNorVwahiYAnRNmEbGhM ANPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=YO/jkQ1Xvo2Pu21jszB9gfiRu/kN1DHdIpxIq7BUWuc=; b=JjHXADAK1MRLxjrN0s1+Ryb5TjQRKpzzXFBa7ljxDtfsUIrgaExFheBkcznqMtWLaF 9j0PUUl3zNWqce01nAhq8q/wvNJVKW2WEWRFlrtZB/AcM0EMPh9iKXlF7yQ8up9Tpb8s v746mee8Ou7dj/WaNtj5MKrsG6X5Occ3oxBWdDYDaLEgsRYwMmlRS2OwAc7+/C72l3Fv wV5JIDX/MCWrcm4OixKgxe3kwRd8rN5ZcwOJzvT9m1YOiTpJeFkQT7kioSOs6qAEphsm PfauVJ68mYQYj/KvHTij+jmDSKUBxj/iO3MN3ANzEQD9QKH/vrrvfQBwjnYEkqaEMGmt K9sg== X-Gm-Message-State: AOAM532thTkHj9AVqi7949KgAex3YVrXekJ/sv/sQY31RJop+deswc+x unEdGjk6c2oGHHZgogT5uXaBFhtK5+jpHDf/P2CcAJ5h1PwrUeqXprUpJEV+sTPKL2UcWDWZqNH y4QrV1lHIJ+j6mI1kbUMrsxtzkg7xm83aZ+JCqmXfiXmFhHblISbBqFwFpZvaKwzsRbkrBPv8Gj Zs+meucov7SeQ= Sender: "howardchung via sendgmr" X-Received: from howardchung-p920.tpe.corp.google.com ([2401:fa00:1:10:f693:9fff:fef4:4e45]) (user=howardchung job=sendgmr) by 2002:a17:90b:f85:: with SMTP id ft5mr1128pjb.1.1603966201148; Thu, 29 Oct 2020 03:10:01 -0700 (PDT) Date: Thu, 29 Oct 2020 18:09:45 +0800 In-Reply-To: <20201029180756.BlueZ.1.I3e9cc07cf60d04d69c8045c442b6cf9f0c3292e7@changeid> Message-Id: <20201029180756.BlueZ.3.I949a055ddf471aba93424ebaa7eb65c2d7f58682@changeid> Mime-Version: 1.0 References: <20201029180756.BlueZ.1.I3e9cc07cf60d04d69c8045c442b6cf9f0c3292e7@changeid> X-Mailer: git-send-email 2.29.1.341.ge80a0c044ae-goog Subject: [BlueZ PATCH 3/3] monitor: Decode Remove ADV Monitor From: Howard Chung To: linux-bluetooth@vger.kernel.org Cc: alainm@chromium.org, luiz.dentz@gmail.com, mcchou@chromium.org, mmandlik@chromium.org, Howard Chung Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Add support for Remove Advertisement Monitor MGMT command and event. @ MGMT Command: Remove Advertisement Monitor (0x0053) plen 2 Handle: 1 @ MGMT Event: Advertisement Monitor Added (0x002c) plen 2 Handle: 1 @ MGMT Event: Command Complete (0x0001) plen 5 Remove Advertisement Monitor (0x0053) plen 2 Status: Success (0x00) Handle: 1 Reviewed-by: Miao-chen Chou --- monitor/packet.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/monitor/packet.c b/monitor/packet.c index b3a6ed24d5fc..dcbed9f0f287 100644 --- a/monitor/packet.c +++ b/monitor/packet.c @@ -13232,6 +13232,22 @@ static void mgmt_add_adv_monitor_patterns_rsp(const void *data, uint16_t size) print_field("Handle: %d", handle); } +static void mgmt_remove_adv_monitor_patterns_cmd(const void *data, + uint16_t size) +{ + uint16_t handle = get_le16(data); + + print_field("Handle: %d", handle); +} + +static void mgmt_remove_adv_monitor_patterns_rsp(const void *data, + uint16_t size) +{ + uint16_t handle = get_le16(data); + + print_field("Handle: %d", handle); +} + struct mgmt_data { uint16_t opcode; const char *str; @@ -13469,6 +13485,9 @@ static const struct mgmt_data mgmt_command_table[] = { { 0x0052, "Add Advertisement Monitor", mgmt_add_adv_monitor_patterns_cmd, 1, false, mgmt_add_adv_monitor_patterns_rsp, 2, true}, + { 0x0053, "Remove Advertisement Monitor", + mgmt_remove_adv_monitor_patterns_cmd, 2, true, + mgmt_remove_adv_monitor_patterns_rsp, 2, true}, { } }; @@ -13880,6 +13899,13 @@ static void mgmt_adv_monitor_added_evt(const void *data, uint16_t size) print_field("Handle: %d", handle); } +static void mgmt_adv_monitor_removed_evt(const void *data, uint16_t size) +{ + uint16_t handle = get_le16(data); + + print_field("Handle: %d", handle); +} + static void mgmt_controller_suspend_evt(const void *data, uint16_t size) { uint8_t state = get_u8(data); @@ -14011,6 +14037,8 @@ static const struct mgmt_data mgmt_event_table[] = { mgmt_device_flags_changed_evt, 15, true }, { 0x002b, "Advertisement Monitor Added", mgmt_adv_monitor_added_evt, 2, true }, + { 0x002c, "Advertisement Monitor Added", + mgmt_adv_monitor_removed_evt, 2, true }, { 0x002d, "Controller Suspended", mgmt_controller_suspend_evt, 1, true }, { 0x002e, "Controller Resumed", -- 2.29.1.341.ge80a0c044ae-goog