Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp23188ybl; Tue, 7 Jan 2020 01:19:21 -0800 (PST) X-Google-Smtp-Source: APXvYqysCADcWQyRm8/4s77E1CjMoEF4+70oB7N2Y1xjHs2SslI8tAIj1KMrFLfd7810hoLYcdZv X-Received: by 2002:a9d:65da:: with SMTP id z26mr112996302oth.197.1578388761611; Tue, 07 Jan 2020 01:19:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578388761; cv=none; d=google.com; s=arc-20160816; b=e5f7DzHoTj6I0UfM4HStmr+IdoBbO1n1d61ug5WUdxPFyz3hGMkR9jJ8L7QHPb4lj3 OGXvJSite8NLEwor6iFHItg8uUgtHQnyQ9KGw/9ioZimtHJKzhVVTVPvha4wXhk49bq9 uTB2e1X3Q6sHJUhwdnT4u+UMRhs6ZubDEyDfHz0pXYtxhUduCTQ9Ki7cDyzLxxqkGOsg ykd1V08icQM4cNhoGaUs0nbzz+VNs2MmVw7oUFi7wIGsvxp0I4gPPBiXngubijFYCB9w DXR8QXyNHg78x+Q/mM9o/wmxgXySkpAPSfwiJfVFm7+0bizHRe9YCHiO+/MJ4eaPiJ9e nOpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=SSvUPMj9oDG8ge9IMvQUvFjkR/T0aekFdLjEpPzlIdY=; b=nBvXja405xj2a3dZ+AZiZj74E3E+24ImHMl9s9t+aSbSfMANGQUsT4nvfMl2ziw7HQ HRuN0+cPAfPcF507oU/A90ckhi4fUcmdHZ3E4mQuvmoUK0fwKNhUEafV+Dq9furhZHWi BoEbqrEk9eKpjTbx6ErK8gH/hvf+C20GQIyZAKdE2OWi4TqIX17RBAKntoZS1D+1Unnm 8lPUSfH79USlmNj3BitJnxITTUotwyK9y4EOk2fw98QLR7EmGYzz8X0CdLYSNXDd14BK xX9JpfS7PhjERZfyeklKA11xVQnsRUaZVIbTYt4t9O8SsP8C7PJ63GIVlUcRG75guJHm oJHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codecoup-pl.20150623.gappssmtp.com header.s=20150623 header.b=RjqY1w4R; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i2si35222064otc.130.2020.01.07.01.19.00; Tue, 07 Jan 2020 01:19:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codecoup-pl.20150623.gappssmtp.com header.s=20150623 header.b=RjqY1w4R; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726690AbgAGJS5 (ORCPT + 99 others); Tue, 7 Jan 2020 04:18:57 -0500 Received: from mail-lj1-f180.google.com ([209.85.208.180]:40552 "EHLO mail-lj1-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726327AbgAGJS5 (ORCPT ); Tue, 7 Jan 2020 04:18:57 -0500 Received: by mail-lj1-f180.google.com with SMTP id u1so53912044ljk.7 for ; Tue, 07 Jan 2020 01:18:56 -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=SSvUPMj9oDG8ge9IMvQUvFjkR/T0aekFdLjEpPzlIdY=; b=RjqY1w4RKtqKJ9t2SohNvFguXVyS1vEcvkWl23D/TnlMa35jQ9QI4g74GEZGvHFF0x 9pgku1YHxozEjfDvlBHR2r4RQ84xJsLWqNZmJigNaCLG3aAaby9WSbschOQYHN20zm3n BYO+VlmbVhD5Epe/qtApI/MXb8eJOqCfKCmT7toBkzmhiEzJfI1G1NeCblDrAwk9k60F mp7ftlr5yTWdD+YfFBqX0q9mlPPw8hCTqKiNpf+0f+gxtsmJHkJ/oJA2Rwy4dh6dNqh3 4g8pI8vpVB/OZPKZfFUItQhqzJafOlyPZ0jQBchblB2nJcIuGjzNu6cPJqNetsOFS9gB dEaA== 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=SSvUPMj9oDG8ge9IMvQUvFjkR/T0aekFdLjEpPzlIdY=; b=Vw+tRCFDMdUzvqe0qSEQx0ZRujDxrwgR3S3S8UnlJV2MO0r/msd9yIF4rcM2SoVrZq Ook4FFAk+QmlEXVs/k0+ymV9P287p1jQQtRa6rOjfhlRvF/+nJtgPTTNxiI+z4XvWGlh pdcpVx/PBXLPOyMG/Efwaw+dFfZ6XdDG5M2jXOAlSZzQYdX3R18G5iWgcQpmQ6ll+Hts 0+FpXZGXIqYrfaxGjmypzYZo0rgKd7f6yqr3e6o6627OaRaN2LGtf6gdtPk7+vm+n+fZ sJdSaRUYuTprl3R9Ct1T3MwPkq8OxxkRsx1kQ53ej/J/750sEOZ+lBO1Is/BYDqKc4HN x5BQ== X-Gm-Message-State: APjAAAVHk5Uj/YdNzBljt8ZaqWEzNH8xhnRxvdtISTpkrK1Q9T+JDvbY SYlZw4wAKBZxOP9LpFeMv/NDK7vv0jU= X-Received: by 2002:a2e:9ec3:: with SMTP id h3mr14397518ljk.159.1578388735255; Tue, 07 Jan 2020 01:18:55 -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.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jan 2020 01:18:54 -0800 (PST) From: Szymon Czapracki To: linux-bluetooth@vger.kernel.org Cc: Szymon Czapracki Subject: [PATCH 2/8] monitor: Decode LE Periodic Advertising Sync Transfer Received Event Date: Tue, 7 Jan 2020 10:18:27 +0100 Message-Id: <20200107091833.14921-2-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 Content-Transfer-Encoding: 8bit Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Change-Id: I5a7c2d36ca5aee61441c2aab6adeb16058ab062f --- monitor/bt.h | 14 ++++++++++++++ monitor/packet.c | 27 +++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/monitor/bt.h b/monitor/bt.h index ecf3782c9..e14c1771f 100644 --- a/monitor/bt.h +++ b/monitor/bt.h @@ -3140,6 +3140,20 @@ struct bt_hci_evt_le_chan_select_alg { uint8_t algorithm; } __attribute__ ((packed)); +#define BT_HCI_EVT_LE_PER_ADV_SYNC_TRANS_REC 0x18 +struct bt_hci_evt_le_per_adv_sync_trans_rec { + uint8_t status; + uint16_t handle; + uint16_t service_data; + uint16_t sync_handle; + uint8_t sid; + uint8_t addr_type; + uint8_t addr[6]; + uint8_t phy; + uint16_t interval; + uint8_t clock_accuracy; +} __attribute__ ((packed)); + #define BT_HCI_ERR_SUCCESS 0x00 #define BT_HCI_ERR_UNKNOWN_COMMAND 0x01 #define BT_HCI_ERR_UNKNOWN_CONN_ID 0x02 diff --git a/monitor/packet.c b/monitor/packet.c index 64f75cf8e..76bb9f239 100644 --- a/monitor/packet.c +++ b/monitor/packet.c @@ -600,6 +600,12 @@ static void print_addr_type(const char *label, uint8_t addr_type) case 0x01: str = "Random"; break; + case 0x02: + str = "Public Identity Address"; + break; + case 0x03: + str = "Random Identity Address"; + break; default: str = "Reserved"; break; @@ -9788,6 +9794,24 @@ static void le_chan_select_alg_evt(const void *data, uint8_t size) print_field("Algorithm: %s (0x%2.2x)", str, evt->algorithm); } +static void le_per_adv_sync_trans_rec_evt(const void *data, uint8_t size) +{ + const struct bt_hci_evt_le_per_adv_sync_trans_rec *evt = data; + + print_status(evt->status); + print_field("Handle: %d", evt->handle); + print_field("Connection handle: %d", evt->handle); + print_field("Service data: 0x%4.4x", evt->service_data); + print_field("Sync handle: %d", evt->sync_handle); + print_field("SID: 0x%2.2x", evt->sid); + print_addr_type("Address type:", evt->addr_type); + print_addr("Addres:", evt->addr, evt->addr_type); + print_le_phy("PHY:", evt->phy); + print_field("Periodic advertising Interval: %.3f", + 1.25 * evt->interval); + print_clock_accuracy(evt->clock_accuracy); +} + struct subevent_data { uint8_t subevent; const char *str; @@ -9871,6 +9895,9 @@ static const struct subevent_data le_meta_event_table[] = { le_scan_req_received_evt, 8, true}, { 0x14, "LE Channel Selection Algorithm", le_chan_select_alg_evt, 3, true}, + { 0x18, "LE Periodic Advertising Sync Transfer Received", + le_per_adv_sync_trans_rec_evt, 19, + true}, { } }; -- 2.24.1