From patchwork Tue Jan 7 09:18:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szymon Czapracki X-Patchwork-Id: 197527 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F802C33C99 for ; Tue, 7 Jan 2020 09:18:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E6B932087F for ; Tue, 7 Jan 2020 09:18:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=codecoup-pl.20150623.gappssmtp.com header.i=@codecoup-pl.20150623.gappssmtp.com header.b="Mpcu6pRK" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726565AbgAGJSy (ORCPT ); Tue, 7 Jan 2020 04:18:54 -0500 Received: from mail-lj1-f180.google.com ([209.85.208.180]:34535 "EHLO mail-lj1-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726327AbgAGJSy (ORCPT ); Tue, 7 Jan 2020 04:18:54 -0500 Received: by mail-lj1-f180.google.com with SMTP id z22so49132648ljg.1 for ; Tue, 07 Jan 2020 01:18:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codecoup-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=NJ8gJOpxEezQrvadgBBrrKKCFxDiz5rjGEXUUPG/iRw=; b=Mpcu6pRKmMDxg91Agehs1KNRdjmu9W7nT+Oscwn8hqBrMVw1+/9tXOzO9P3RDqQn6E dnjnywds2xRSD+BI/n+Aqttdp7QY+rbkP3RlFdRPoXGpi75BbQAWc6WlAgUQ1vhu37uA d3XrPwmG57eJmddozFsNF5HaevqL11AywD3DYJcoO+40Plhrqp3YBDFCyQQ2OcTs11Eb TBNkqSkmy19i2R1Vn5L5Pd1cvhlRuXCz2Oxlrr/KwTaK2gIYyx719vHQJcqaL+S5typo qtgLgQ9kWJyyNMdm47bnlJBFBmWqAH4P+yNa1wTPvRySMHkLn/5dnUh8uimPLupQfk7X BmLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=NJ8gJOpxEezQrvadgBBrrKKCFxDiz5rjGEXUUPG/iRw=; b=Kqm+DMZPXClzPftz8qBYV+mk4nYh/ML4j6cWk5me0m9BJt2GvOSyB3rX/H46HmCMhx M6UPr7000T2+vcXwVr0THBTXydtymyUwiVa4C/1UrW7vixfBSrC1EMSyenxaDHwk1b2v ilRJYi52fCmYK6uKZoaJbFHHvZ3FmiBA3HcREP8u7NrZzPQVghagnuIVKRXeFSsU9Cz8 2ygfKAe68R/06aEixVT5dT7PnQmQ+yp/VvhV2QuJnZqtTbF/wugvTkS1Yy4h7WvJpnBC i+o+TN/C0jB3HZgiQdfcqeZRgPmfFS61R2yBl2sIE4DTtP/GoWtSVMGeWdWLI+0cEhf0 08kA== X-Gm-Message-State: APjAAAVy/WUUaqeGPTFpNcsD6gPDd/7UOJzOPBWNfseHnYLKpfpsc51Z 98tnr8doEzN+pvPYc7uJVNwg85KWEIY= X-Google-Smtp-Source: APXvYqwZoXvpjqMcFMcGtUjf9raxeLv7gOsxd1aeeN6Bi9D7V+esHkhRpsMN6oN1oAugV3kGktnPIQ== X-Received: by 2002:a2e:a48a:: with SMTP id h10mr63427003lji.254.1578388731333; Tue, 07 Jan 2020 01:18:51 -0800 (PST) Received: from tp480.int.codecoup.pl ([95.143.243.62]) by smtp.gmail.com with ESMTPSA id d24sm30345292lfb.94.2020.01.07.01.18.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jan 2020 01:18:50 -0800 (PST) From: Szymon Czapracki To: linux-bluetooth@vger.kernel.org Cc: Szymon Czapracki Subject: [PATCH 1/8] monitor: Update periodic sync commands. Date: Tue, 7 Jan 2020 10:18:26 +0100 Message-Id: <20200107091833.14921-1-szymon.czapracki@codecoup.pl> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Change fields in periodic_adv_(create/term)_sync_cmd, according to their description with 5.1 specification. < HCI Command: LE Periodic Advertising Create Sync (0x08|0x0044) plen 14 Options: 0x0001 Use Periodic Advertiser List Reporting initially enabled SID: 0x00 Adv address type: Public (0x00) Adv address: 00:00:00:00:00:00 (OUI 00-00-00) Skip: 0x0000 Sync timeout: 0 msec (0x0000) Sync CTE type: 0x0000 > HCI Event: Command Status (0x0f) plen 4 LE Periodic Advertising Create Sync (0x08|0x0044) ncmd 1 Status: Unknown HCI Command (0x01) Change-Id: Ic729dd3a6cb9bc02b7af6f78b9cf99909f6be154 --- monitor/bt.h | 6 +-- monitor/packet.c | 96 ++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 83 insertions(+), 19 deletions(-) diff --git a/monitor/bt.h b/monitor/bt.h index 8edc895e8..ecf3782c9 100644 --- a/monitor/bt.h +++ b/monitor/bt.h @@ -2371,13 +2371,13 @@ struct bt_hci_le_ext_create_conn { #define BT_HCI_CMD_LE_PERIODIC_ADV_CREATE_SYNC 0x2044 struct bt_hci_cmd_le_periodic_adv_create_sync { - uint8_t filter_policy; + uint8_t options; uint8_t sid; uint8_t addr_type; uint8_t addr[6]; uint16_t skip; uint16_t sync_timeout; - uint8_t unused; + uint8_t sync_cte_type; } __attribute__ ((packed)); #define BT_HCI_CMD_LE_PERIODIC_ADV_CREATE_SYNC_CANCEL 0x2045 @@ -3108,7 +3108,7 @@ struct bt_hci_le_per_adv_report { uint16_t handle; uint8_t tx_power; int8_t rssi; - uint8_t unused; + uint8_t cte_type; uint8_t data_status; uint8_t data_len; uint8_t data[0]; diff --git a/monitor/packet.c b/monitor/packet.c index ab8bbdee5..64f75cf8e 100644 --- a/monitor/packet.c +++ b/monitor/packet.c @@ -7321,24 +7321,70 @@ static void le_ext_create_conn_cmd(const void *data, uint8_t size) print_ext_conn_phys(cmd->data, cmd->phys); } -static void le_periodic_adv_create_sync_cmd(const void *data, uint8_t size) +static const struct bitfield_data create_sync_cte_type[] = { + { 0, "Do not sync to packets with AoA CTE" }, + { 1, "Do not sync to packets with AoD CTE 1us" }, + { 2, "Do not sync to packets with AoD CTE 2us" }, + { 3, "Do not sync to packets with type 3 AoD" }, + { 4, "Do not sync to packets without CTE" }, + { }, +}; + +static const struct bitfield_data create_sync_options[] = { + { 0, "Use Periodic Advertiser List" }, + { 1, "Reporting initially disabled" }, + { }, +}; + +static const struct bitfield_data create_sync_options_alt[] = { + { 0, "Use advertising SID, Advertiser Address Type and address"}, + { 1, "Reporting initially enabled" }, + { }, +}; + +static void print_create_sync_cte_type(uint8_t flags) { - const struct bt_hci_cmd_le_periodic_adv_create_sync *cmd = data; - const char *str; + uint8_t mask = flags; - switch (cmd->filter_policy) { - case 0x00: - str = "Use specified advertising parameters"; - break; - case 0x01: - str = "Use Periodic Advertiser List"; - break; - default: - str = "Reserved"; - break; + print_field("Sync CTE type: 0x%4.4x", flags); + + mask = print_bitfield(2, flags, create_sync_cte_type); + + if (mask) { + print_text(COLOR_UNKNOWN_ADV_FLAG, + "Unknown sync CTE type properties (0x%4.4x)", + mask); } +} - print_field("Filter policy: %s (0x%2.2x)", str, cmd->filter_policy); +static void print_create_sync_options(uint8_t flags) +{ + uint8_t mask = flags; + int i; + + print_field("Options: 0x%4.4x", flags); + + for (i = 0; create_sync_options[i].str; i++) { + if (flags & (1 << create_sync_options[i].bit)) { + print_field("%s", create_sync_options[i].str); + mask &= ~(1 << create_sync_options[i].bit); + } else { + print_field("%s", create_sync_options_alt[i].str); + mask &= ~(1 << create_sync_options_alt[i].bit); + } + } + + if (mask) { + print_text(COLOR_UNKNOWN_ADV_FLAG, + " Unknown options (0x%4.4x)", mask); + } +} + +static void le_periodic_adv_create_sync_cmd(const void *data, uint8_t size) +{ + const struct bt_hci_cmd_le_periodic_adv_create_sync *cmd = data; + + print_create_sync_options(cmd->options); print_field("SID: 0x%2.2x", cmd->sid); print_addr_type("Adv address type", cmd->addr_type); print_addr("Adv address", cmd->addr, cmd->addr_type); @@ -7346,7 +7392,7 @@ static void le_periodic_adv_create_sync_cmd(const void *data, uint8_t size) print_field("Sync timeout: %d msec (0x%4.4x)", le16_to_cpu(cmd->sync_timeout) * 10, le16_to_cpu(cmd->sync_timeout)); - print_field("Unused: 0x%2.2x", cmd->unused); + print_create_sync_cte_type(cmd->sync_cte_type); } static void le_periodic_adv_term_sync_cmd(const void *data, uint8_t size) @@ -9648,7 +9694,25 @@ static void le_per_adv_report_evt(const void *data, uint8_t size) else print_field("RSSI: reserved (0x%2.2x)", (uint8_t) evt->rssi); - print_field("Unused: (0x%2.2x)", evt->unused); + + switch (evt->cte_type) { + case 0x00: + str = "AoA Constant Tone Extension"; + break; + case 0x01: + str = "AoA Constant Tone Extension with 1us slots"; + break; + case 0x02: + str = "AoD Constant Tone Extension with 2us slots"; + break; + case 0xff: + str = "No Constant Tone Extension"; + break; + default: + str = "Reserved"; + color_on = COLOR_RED; + break; + } switch (evt->data_status) { case 0x00: From patchwork Tue Jan 7 09:18:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szymon Czapracki X-Patchwork-Id: 197526 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 79993C33C9B for ; Tue, 7 Jan 2020 09:18:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4E1A32087F for ; Tue, 7 Jan 2020 09:18:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=codecoup-pl.20150623.gappssmtp.com header.i=@codecoup-pl.20150623.gappssmtp.com header.b="HjCx31Un" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727154AbgAGJS7 (ORCPT ); Tue, 7 Jan 2020 04:18:59 -0500 Received: from mail-lj1-f169.google.com ([209.85.208.169]:44866 "EHLO mail-lj1-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726327AbgAGJS6 (ORCPT ); Tue, 7 Jan 2020 04:18:58 -0500 Received: by mail-lj1-f169.google.com with SMTP id u71so53908284lje.11 for ; Tue, 07 Jan 2020 01:18:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codecoup-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=As14hH5XTd91cqludgJ3ZyIIxEQXQtCoXFONbDuSuOY=; b=HjCx31UnS6dgpILh/wtsLpyp2x2jYTFmMyqj6v+9YJ3Vye88N7FVsI3mFmPOtZT8wM dvL6p8IggFfcos7JDo4XjwAQVXRQyGvf+99qHZyv9MYg+aQs/kg7974eT/srAYjMkdHI pPsmOLxBG9t3fi8INAc8qqAaHgqfD0/ClTVkfcezksTl4+hReQz+8lkChuhqJRKnYazK Q0ZczXa30A//Kahq0W0QJWExua94M3GbJTc8MNekJYsDCSPH3nl8JRm+V059onok6BYC YkP1pR3z2fuZVOMEHnpgk/8qV3bZJ6tQdh08vpFTEbolZ5yCODIrqQGO4QtvVM78ZFTD TCQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=As14hH5XTd91cqludgJ3ZyIIxEQXQtCoXFONbDuSuOY=; b=fVa4fRlu8lQd9hCFMggBpoOUo+TvCiQPIb0iQfTYfwYHK2RsosWB1bNxEBde9S39ik hJTHYgvHm+bjTBs1LyEXvoH30EAFDHxazmDOvo2vE1uFg5x+v86JUxHn7g0WGlXWmf1o 5EOJSfHxZJqNmONzzDOubAvT6DR8nwC3KH7huKviLJOTKrGnu3U0/ZYC+Pe96U87D6zM TLXI6wauc1JKtoGKRPQYwMCCahmtiS7Fgz0WnHxGiClFAiTOi5i/OV1gXtkTlPqdzBIR 5rWDXbTPmn/geT82CaS50lWjQI84Mva6d3WmStKZtfXLjmUKWjgO6X7RsZN51CaTb5x/ ccVg== X-Gm-Message-State: APjAAAXHOM7aQvYWsqAB5khRFAd+jjoyq88uWoPquCFS5haLM8if8+g9 esQozVuYox4VpJEqiFsE67kyQUpMi+8= X-Google-Smtp-Source: APXvYqzFrdIJ7ZqvdLg0idamrZNMBwgf2+QCIeeEFGsAWMtgLmWSEDUz0tq4aIdMYi76fGK5MvJY0A== X-Received: by 2002:a2e:8595:: with SMTP id b21mr43034503lji.219.1578388736729; Tue, 07 Jan 2020 01:18:56 -0800 (PST) Received: from tp480.int.codecoup.pl ([95.143.243.62]) by smtp.gmail.com with ESMTPSA id d24sm30345292lfb.94.2020.01.07.01.18.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jan 2020 01:18:56 -0800 (PST) From: Szymon Czapracki To: linux-bluetooth@vger.kernel.org Cc: Szymon Czapracki Subject: [PATCH 3/8] monitor: Decode LE Set Periodic Advertising Receive Enable command Date: Tue, 7 Jan 2020 10:18:28 +0100 Message-Id: <20200107091833.14921-3-szymon.czapracki@codecoup.pl> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200107091833.14921-1-szymon.czapracki@codecoup.pl> References: <20200107091833.14921-1-szymon.czapracki@codecoup.pl> MIME-Version: 1.0 Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org < HCI Command: LE Periodic Advertising Receive Enable (0x08|0x0059) plen 3 Sync handle: 0 Reporting: Enabled (0x01) > HCI Event: Command Status (0x0f) plen 4 LE Periodic Advertising Receive Enable (0x08|0x0059) ncmd 1 Status: Unknown HCI Command (0x01) Change-Id: I19d3bfb7034992a14273b742b38f2c6cc6bd6deb --- monitor/bt.h | 6 ++++++ monitor/packet.c | 11 +++++++++++ 2 files changed, 17 insertions(+) diff --git a/monitor/bt.h b/monitor/bt.h index e14c1771f..bb373b528 100644 --- a/monitor/bt.h +++ b/monitor/bt.h @@ -2461,6 +2461,12 @@ struct bt_hci_cmd_le_tx_test_v3 { uint8_t antenna_ids[0]; } __attribute__ ((packed)); +#define BT_HCI_CMD_SET_PERIODIC_ADV_REC_ENABLE 0x2059 +struct bt_hci_cmd_set_periodic_adv_rec_enable { + uint16_t sync_handle; + uint8_t enable; +} __attribute__ ((packed)); + #define BT_HCI_EVT_INQUIRY_COMPLETE 0x01 struct bt_hci_evt_inquiry_complete { uint8_t status; diff --git a/monitor/packet.c b/monitor/packet.c index 76bb9f239..c1e449a68 100644 --- a/monitor/packet.c +++ b/monitor/packet.c @@ -7590,6 +7590,14 @@ static void le_tx_test_cmd_v3(const void *data, uint8_t size) print_field(" Antenna ID: %u", cmd->antenna_ids[i]); } +static void le_periodic_adv_rec_enable(const void *data, uint8_t size) +{ + const struct bt_hci_cmd_le_set_periodic_adv_enable *cmd = data; + + print_field("Sync handle: %d", cmd->handle); + print_enable("Reporting", cmd->enable); +} + struct opcode_data { uint16_t opcode; int bit; @@ -8383,6 +8391,9 @@ static const struct opcode_data opcode_table[] = { { 0x2050, 316, "LE Transmitter Test command [v3]", le_tx_test_cmd_v3, 9, false, status_rsp, 1, true }, + { 0x2059, 325, "LE Periodic Advertising Receive Enable", + le_periodic_adv_rec_enable, 3, true, + status_rsp, 1, true }, { } }; From patchwork Tue Jan 7 09:18:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szymon Czapracki X-Patchwork-Id: 197525 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9D0BC33C99 for ; Tue, 7 Jan 2020 09:19:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A03C42087F for ; Tue, 7 Jan 2020 09:19:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=codecoup-pl.20150623.gappssmtp.com header.i=@codecoup-pl.20150623.gappssmtp.com header.b="oV93hU/p" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727559AbgAGJTC (ORCPT ); Tue, 7 Jan 2020 04:19:02 -0500 Received: from mail-lf1-f45.google.com ([209.85.167.45]:34214 "EHLO mail-lf1-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727277AbgAGJTC (ORCPT ); Tue, 7 Jan 2020 04:19:02 -0500 Received: by mail-lf1-f45.google.com with SMTP id l18so30191327lfc.1 for ; Tue, 07 Jan 2020 01:19:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codecoup-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KzmDCgSzwDe/oBRTdtouSyE3ygFLPIKVa0QL4AISUOE=; b=oV93hU/pDF9ONwmDR2CpPUvx60dJfyeFmAyRe6AFIIgI+QvdZluY0Gc+kN50/OzqBI +Jtgw/76reX6qSL0FndlaDC6DNiE6z2ylyAurJg/+SIaZdeqtBUyHmV1tUGx38mDaW6h 3Q6Ff4n/PUWEzDsygJU7KyaVJxkMiFEHhYmFe8XYNl75lbIP2jgCIbJ41pvy26eyfCms 3HaItKwGs2HNQy0Iv04IlpjegPmyJBUuULLj/Z13jxA5oiD5MfvtTdvJj7tV6N+rGxB6 ROjM2Hy8OUQoxCXtxc48GfmWi8Jz9l6cPk4Z+XXM1G5jvAZaaIt2/lDJfUUrovQNP1av DAQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KzmDCgSzwDe/oBRTdtouSyE3ygFLPIKVa0QL4AISUOE=; b=ujCvdzi4HpFIaWlPZ4N8LDDMLyrVEvV+hXMzNoMd/d81jI5OmmkmugYsuCejzSRVtf nWrNrVQ7OU31O071EPnQosQldzDj7viiV1netDOts/IN2iiWBh/R0TCDcGPNfwjh6mTt wy6wF7hBaIUrzk0OUocxic0LC2RFpRKPU7VEiD6WpQ4Di4WWwXyfE+0oj54gJBkxq5G6 V8AjoTwj2rJSf1RjZ+AOqhCZXHCqkd1EVT+v0Bl85Oo2kNvQ9VmV1eCuVN5FyKqGppWi j86tkOpjut9JaONcjYy/J36NMUcafwyZOI7k96rRM8m5YXnZYU7t+z2lWeEdvbk/Fp7r C5mw== X-Gm-Message-State: APjAAAWw/u8QvRsVz2XBhuteQIqNg0FSYfG+2TCe4DxL5ZuhWYuQkGyZ fjiosXTUDwtIgwf7oRAqu+zIH/KxO38= X-Google-Smtp-Source: APXvYqxPb4YkONhtRXJTfqtDj8wFC0PfOGTgY6wyxqZORm+awaqFHOOkW01UZATf6YwTBgiAracvfg== X-Received: by 2002:ac2:485c:: with SMTP id 28mr58608144lfy.118.1578388739725; Tue, 07 Jan 2020 01:18:59 -0800 (PST) Received: from tp480.int.codecoup.pl ([95.143.243.62]) by smtp.gmail.com with ESMTPSA id d24sm30345292lfb.94.2020.01.07.01.18.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jan 2020 01:18:59 -0800 (PST) From: Szymon Czapracki To: linux-bluetooth@vger.kernel.org Cc: Szymon Czapracki Subject: [PATCH 5/8] monitor: Decode LE Periodic Advertising Set Info Transfer command Date: Tue, 7 Jan 2020 10:18:30 +0100 Message-Id: <20200107091833.14921-5-szymon.czapracki@codecoup.pl> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200107091833.14921-1-szymon.czapracki@codecoup.pl> References: <20200107091833.14921-1-szymon.czapracki@codecoup.pl> MIME-Version: 1.0 Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org < HCI Command: LE Periodic Advertising Set Info Transfer (0x08|0x005b) plen 5 Connection handle: 1 Service data: 0x0000 Advertising handle: 0 > HCI Event: Command Status (0x0f) plen 4 LE Periodic Advertising Set Info Transfer (0x08|0x005b) ncmd 1 Status: Unknown HCI Command (0x01) Change-Id: I4167e85f29e20304d1b72ec537ece70a68e8407e --- monitor/bt.h | 7 +++++++ monitor/packet.c | 12 ++++++++++++ 2 files changed, 19 insertions(+) diff --git a/monitor/bt.h b/monitor/bt.h index efaf80f55..f8422ccc9 100644 --- a/monitor/bt.h +++ b/monitor/bt.h @@ -2474,6 +2474,13 @@ struct bt_hci_cmd_periodic_sync_trans { uint16_t sync_handle; } __attribute__ ((packed)); +#define BT_HCI_CMD_PERIODIC_ADV_SET_INFO_TRANS 0x205b +struct bt_hci_cmd_periodic_adv_set_info_trans { + uint16_t handle; + uint16_t service_data; + uint16_t adv_handle; +} __attribute__ ((packed)); + #define BT_HCI_EVT_INQUIRY_COMPLETE 0x01 struct bt_hci_evt_inquiry_complete { uint8_t status; diff --git a/monitor/packet.c b/monitor/packet.c index 06fd72537..3c3399c0c 100644 --- a/monitor/packet.c +++ b/monitor/packet.c @@ -7614,6 +7614,15 @@ static void le_periodic_adv_sync_trans(const void *data, uint8_t size) print_field("Sync handle: %d", cmd->sync_handle); } +static void le_periodic_adv_set_info_trans(const void *data, uint8_t size) +{ + const struct bt_hci_cmd_periodic_adv_set_info_trans *cmd = data; + + print_field("Connection handle: %d", cmd->handle); + print_field("Service data: 0x%4.4x", cmd->service_data); + print_field("Advertising handle: %d", cmd->adv_handle); +} + struct opcode_data { uint16_t opcode; int bit; @@ -8413,6 +8422,9 @@ static const struct opcode_data opcode_table[] = { { 0x205a, 326, "LE Periodic Advertising Sync Transfer", le_periodic_adv_sync_trans, 6, true, status_handle_rsp, 3, true }, + { 0x205b, 327, "LE Periodic Advertising Set Info Transfer", + le_periodic_adv_set_info_trans, 5, true, + status_handle_rsp, 3, true }, { } }; From patchwork Tue Jan 7 09:18:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szymon Czapracki X-Patchwork-Id: 197524 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS,UNWANTED_LANGUAGE_BODY,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B526EC33C99 for ; Tue, 7 Jan 2020 09:19:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8934E2087F for ; Tue, 7 Jan 2020 09:19:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=codecoup-pl.20150623.gappssmtp.com header.i=@codecoup-pl.20150623.gappssmtp.com header.b="fjJV4N/p" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727647AbgAGJTF (ORCPT ); Tue, 7 Jan 2020 04:19:05 -0500 Received: from mail-lf1-f50.google.com ([209.85.167.50]:35902 "EHLO mail-lf1-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727277AbgAGJTE (ORCPT ); Tue, 7 Jan 2020 04:19:04 -0500 Received: by mail-lf1-f50.google.com with SMTP id n12so38356843lfe.3 for ; Tue, 07 Jan 2020 01:19:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codecoup-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=r73C6ne2NnSVANSGEmSR1oc9/o9IyEoqU1rQR1TV3SI=; b=fjJV4N/pUhF8Q7RhAYglGtx16WYOe/ddPZ1MDxK1TJPtmAFomCo5MDH8kzmDQD6FxL Bc4jUkNqaN0yK/RXM1A9pFY4oZq7ZE5Zmz0/HDTPvZIC8eEfhPo1HfWZIwsUXtM2RDXS 8GPjqoEbk70tsxjfiQojo3rjXZsHJzcIgr0T0Ji8I4hT9TOWV39noYybwEKkeALL0nwv K5YmrqkLfkx0sNYyhnB+Jj/hOUqftVT9Co0ZdyVfXQ6viRIRV+6a4X4TuNqiHpkPPSIY 2YTnnTBkPnqfCcYTEU9nMJrAJBw2CW6yM4mLbc8CsTanZmpqWw7RWmCnKWvsE+LVeWA4 d2/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=r73C6ne2NnSVANSGEmSR1oc9/o9IyEoqU1rQR1TV3SI=; b=RSi3C7Khc6ai1XE4u+aTeucZKJc3p+bCacgb8OmIz8sof+OsNzUAf+4Lf3bO5e8HBQ Kl6lmSTsu0m2pReesLTV/HzelfBsyntpTy8OezfRFHyx0HNgOtro3f4u5kS+UKvmGjJl UApFMoE7n1vA0p5AaMSxOvf0FOh7u0djfox+TeuVQrHx+joWwYH1tOLPdjFfFTznhwkO EKYIaAp3aziLNCWwjAxxFGZjHz6ncZhmrikj50JYTO5wdxU5rCAJDmQW+KYSPTWQMRMV k0WzrHzvYL5CgFKCAesGUCu0sINT7GscjOl3FPY87OV/UumhSk56DfX5AkYzk/BTkyqu NmUw== X-Gm-Message-State: APjAAAXccWE7qch4oyE8AHpX2w9a9vH67JJaTKn0vTWU011UCGQfjcga dC8XDT5cLMQiXKsF6dAboCfA1P2PKVc= X-Google-Smtp-Source: APXvYqyahnpEZOzIv7306AjBaegi+413+njKVkeDVOIoEw6Vw+iMLktosS7/xqgbEprdsTDs8CRIxg== X-Received: by 2002:a19:86d7:: with SMTP id i206mr57270716lfd.119.1578388742591; Tue, 07 Jan 2020 01:19:02 -0800 (PST) Received: from tp480.int.codecoup.pl ([95.143.243.62]) by smtp.gmail.com with ESMTPSA id d24sm30345292lfb.94.2020.01.07.01.19.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jan 2020 01:19:02 -0800 (PST) From: Szymon Czapracki To: linux-bluetooth@vger.kernel.org Cc: Szymon Czapracki Subject: [PATCH 7/8] monitor: Decode LE Set Default Periodic Adv Sync Transfer Params. command Date: Tue, 7 Jan 2020 10:18:32 +0100 Message-Id: <20200107091833.14921-7-szymon.czapracki@codecoup.pl> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200107091833.14921-1-szymon.czapracki@codecoup.pl> References: <20200107091833.14921-1-szymon.czapracki@codecoup.pl> MIME-Version: 1.0 Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org < HCI Command: LE Set Default Periodic Advertisng Sync Transfer Parameters (0x08|0x005d) plen 6 Mode: Enabled with report events disabled (0x01) Skip: 0x00 Sync timeout: 0 msec (0x0000) Sync CTE type: 0x0000 > HCI Event: Command Status (0x0f) plen 4 LE Set Default Periodic Advertisng Sync Transfer Parameters (0x08|0x005d) ncmd 1 Status: Unknown HCI Command (0x01) Change-Id: Ia88ddc33a59724f5e32624942759b3ef4d6b70aa --- monitor/bt.h | 8 ++++++++ monitor/packet.c | 17 +++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/monitor/bt.h b/monitor/bt.h index 2ec2ea0a7..1859dfb21 100644 --- a/monitor/bt.h +++ b/monitor/bt.h @@ -2490,6 +2490,14 @@ struct bt_hci_cmd_periodic_adv_sync_trans_params { uint8_t cte_type; } __attribute__ ((packed)); +#define BT_HCI_CMD_DEFAULT_PERIODIC_ADV_SYNC_TRANS_PARAMS 0x205d +struct bt_hci_cmd_default_periodic_adv_sync_trans_params { + uint8_t mode; + uint16_t skip; + uint16_t sync_timeout; + uint8_t cte_type; +} __attribute__ ((packed)); + #define BT_HCI_EVT_INQUIRY_COMPLETE 0x01 struct bt_hci_evt_inquiry_complete { uint8_t status; diff --git a/monitor/packet.c b/monitor/packet.c index 4a8404a02..d34533966 100644 --- a/monitor/packet.c +++ b/monitor/packet.c @@ -7658,6 +7658,19 @@ static void le_periodic_adv_sync_trans_params(const void *data, uint8_t size) print_create_sync_cte_type(cmd->cte_type); } +static void le_set_default_periodic_adv_sync_trans_params(const void *data, + uint8_t size) +{ + const struct bt_hci_cmd_default_periodic_adv_sync_trans_params *cmd = data; + + print_sync_mode(cmd->mode); + print_field("Skip: 0x%2.2x", cmd->skip); + print_field("Sync timeout: %d msec (0x%4.4x)", + le16_to_cpu(cmd->sync_timeout) * 10, + le16_to_cpu(cmd->sync_timeout)); + print_create_sync_cte_type(cmd->cte_type); +} + struct opcode_data { uint16_t opcode; int bit; @@ -8463,6 +8476,10 @@ static const struct opcode_data opcode_table[] = { { 0x205c, 328, "LE Periodic Advertising Sync Transfer Parameters", le_periodic_adv_sync_trans_params, 8, true, status_handle_rsp, 3, true}, + { 0x205d, 329, "LE Set Default Periodic Advertisng Sync Transfer " + "Parameters", + le_set_default_periodic_adv_sync_trans_params, + 6, true, status_rsp, 1, true}, { } };