Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp658772ybl; Wed, 8 Jan 2020 03:48:13 -0800 (PST) X-Google-Smtp-Source: APXvYqzdLOy82DOZ7sYgDB19FTS8OgNxXsBe5u9aTJDTTnYfGNyRXeB1K88zza8489hNrEVjWW6w X-Received: by 2002:a9d:5885:: with SMTP id x5mr3755317otg.132.1578484093771; Wed, 08 Jan 2020 03:48:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578484093; cv=none; d=google.com; s=arc-20160816; b=wTD07e+GE/cHEd793f3DC1W4cEtmBshqfx/i5rYtVzyet2JzD80bu/mCV+HWdxR1/Z 8kXzTDnCr5SlBcp5WAvhrGYL73h+lh0BtfBvZYCxPRLFwR/32/vB+3d680YdBpzk6t3a wx5cZetZfNnbMaEUC419vkUbvu9odza0VO840NyZEnLcuwzzn4fQuWbKzCJ/tCbQ3vp5 dQPar6dmTCk4duUYoxcizN4FydQwIkPKs1FwbRmJ7Q1qN+pX6ciG2+FCyUVS5aKQ6DCO BRcEs+zlFqovmHVHFuGXEkyxqSgUbDy9g8nulJV3h8/BJSHl4CZHMcgaF2UK641LAqOM lQoQ== 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=VTlDCnPfKcd55lI+sDtv699lS0147jpqjrgEWgI7T/k=; b=KahtTO3JSMrA+dK4xsecQyxrheT5pj0EUF+SiI/WEK7z1ZxSmWLvWDajuo5xxstYgX S/pA42vpdkAmIiIqYjWTA2QCpF3qEr1reCwjFuuQtAAZfeHMjlHWIeoeenQi1mWqespr vPtowR2+cvfD62ORvoIqIKBXNeQz/lSaYIVhUJiW7ti8xRYTX9K/WOQFRS24721pXIr0 VuriLAgzDcFG0a8IqJsX61p9uD87MOsmUu6OC0PLZuZ5OomhaF/F8dEwX+IuHDsieeLF R3pvpTyXGbkwcw933PCeFl7cM25aCRbbDlSjaLDMNKTUrVLi4yHS89vBlrd/DnAf9mKx SHaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codecoup-pl.20150623.gappssmtp.com header.s=20150623 header.b=cH9nmtcQ; 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 w18si1620383otj.148.2020.01.08.03.48.02; Wed, 08 Jan 2020 03:48:13 -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=cH9nmtcQ; 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 S1727345AbgAHLsB (ORCPT + 99 others); Wed, 8 Jan 2020 06:48:01 -0500 Received: from mail-lj1-f180.google.com ([209.85.208.180]:44225 "EHLO mail-lj1-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726290AbgAHLsB (ORCPT ); Wed, 8 Jan 2020 06:48:01 -0500 Received: by mail-lj1-f180.google.com with SMTP id u71so2954892lje.11 for ; Wed, 08 Jan 2020 03:47:58 -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=VTlDCnPfKcd55lI+sDtv699lS0147jpqjrgEWgI7T/k=; b=cH9nmtcQUTnVGNZzgqUhfe4qVQsUcctrAi7eEZPasa1u71Z1kxmw7De8vDPwt49kOj J+Zv9I/pXGdJT16I1MI5PK5mYZTyi0EVB1av/TWALHUuTOHRoS1gnbRIjDjNPZR2iMvf 7WX6g+4nOIiDvSobTBNLpNyNnpvZiVzzlD2gsWLIZI9ENqIzvQK/xsyKzj65CTSp1lqz XLHL+mnSHEUbL1xfd4159HXTz9q7GrXnC6fOhd0cm7pzyKwWwnCoBEoWu3IvRllHCOas Kwu/DlYPTFDk875v4hRSpcp1+uZbmNEJvGLYGn4+RHMsMo/K7v4cexvBDZyku6jOJBhN lvDQ== 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=VTlDCnPfKcd55lI+sDtv699lS0147jpqjrgEWgI7T/k=; b=rANEWnPcVy0TIcKAazewmt39s9oMtDj1VPvis4uwj0BJ0Stb+nmS4kW1WB3prTu1Kt DOGjRmREau0/I2ufpXFp5FoNa+WX2/kIbbQIjDn1kwalodqgmhXJmDRCRa3x0MUS/r7l onJJbYLxn2B4RODf/WHyEwit1pGzeukkpMP6DYrX1NwBTkrnJCI5l42LpBBK7Yyd7jcv 4SQhvuZSCDCQWqv90gxvb1R1Y4+Jd3VpU9Jl+qxTifQMmeeL0EP+L2H7b6I0E0r0uU0Z +j9NsdMLbfQ9b6j+j4AJ30zhtgn9V3nw9jn94awIp1q3HAejBWeHEzdFYGkQ8WcixMXP soHg== X-Gm-Message-State: APjAAAXnBOTOKVCC/xBZQAzouAZaQBoUmVPzGKh04IAnBFuwbKjceSoB Gt0MpIpUf7Y8VBybz03LueMvO0tFwKY= X-Received: by 2002:a2e:9a11:: with SMTP id o17mr2477510lji.256.1578484077524; Wed, 08 Jan 2020 03:47:57 -0800 (PST) Received: from tp480.int.codecoup.pl ([95.143.243.62]) by smtp.gmail.com with ESMTPSA id e17sm1130645ljg.101.2020.01.08.03.47.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jan 2020 03:47:57 -0800 (PST) From: Szymon Czapracki To: linux-bluetooth@vger.kernel.org Cc: Szymon Czapracki Subject: [PATCH v2 2/8] monitor: Decode LE Periodic Advertising Sync Transfer Received Event Date: Wed, 8 Jan 2020 12:47:46 +0100 Message-Id: <20200108114752.133076-2-szymon.czapracki@codecoup.pl> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200108114752.133076-1-szymon.czapracki@codecoup.pl> References: <20200108114752.133076-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 --- monitor/bt.h | 14 ++++++++++++++ monitor/packet.c | 21 +++++++++++++++++++++ 2 files changed, 35 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..8e5219bef 100644 --- a/monitor/packet.c +++ b/monitor/packet.c @@ -9788,6 +9788,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_peer_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 +9889,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