Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp658807ybl; Wed, 8 Jan 2020 03:48:15 -0800 (PST) X-Google-Smtp-Source: APXvYqz3/U7OOb/ucWf1ngmGZ7ToWpEm6T3bkv7Y3aGoWxQht1Shdbe6/qkcOO9tR+vJnzwF86wF X-Received: by 2002:a05:6830:1185:: with SMTP id u5mr3579764otq.147.1578484095670; Wed, 08 Jan 2020 03:48:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578484095; cv=none; d=google.com; s=arc-20160816; b=KNpCU+q0VfBPhhYTdVeqag9yHUDT3dJ4A+Pv2e4Q2ZmxI90hQbSstd0FpoTxHNU+sE WgAFLZ+u3IvZ2EnpFU5td/bSLAu7R7/mr+ZlmLUhmExzwxPQuGi3sTLrBE59BiPr9MHL o7kpKqxIr6ZwnnHJwmIKbA6a/o3M0c92LwBIDDb7dg15k+KQthGN3kRfSR2vVe++bwL7 DEzTySfMIVWcPibroxzTZz0dU/nJi3svRJtexGt8c/OLCcuqKupCswvgci9dii+rQWfw MiwierU3FKkkmKcFJWLe9IZzODCSXz3g65/hmrIrkAlIkDilmdGHH27bpFird0IdbC4H aIhA== 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=FRecKNJ4qdrMcD0dhtNiFMLXR1mz2rfeOaSdEJlv/ns=; b=Yf6zOdofpEui0S3HGL4ZpVY/6RMu314gCxAQHZROkPpZfrvir0z6cxYtjEd8ON0UIs kTK0MJbRqvaiTo4tkACGCgP7Tt8DObQmw4HybG/Fx3hOiNVBrk6SlZll6yyn0VhsaICo 88Q1hKAGyGQFSVcHR30fu5yULtPTrO0UxLF5E4QSrhoEUGHWEErpWWNysA/OFXCvPFY4 YlWg9PctygPjItar88suokMsrLaDE/WsQY1iUtO9KFTx8wsqJIEK72rDtUOlnHVAN9cS nydPeYvirY4XV4GgGTB+15/p0zdCMlGbygjK+jlGWmRmsUOHrq2woNjg5RfkkKkgwsXv 9+vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codecoup-pl.20150623.gappssmtp.com header.s=20150623 header.b=0eJnEtZD; 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 z18si1685809otq.121.2020.01.08.03.48.05; Wed, 08 Jan 2020 03:48:15 -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=0eJnEtZD; 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 S1727319AbgAHLsC (ORCPT + 99 others); Wed, 8 Jan 2020 06:48:02 -0500 Received: from mail-lj1-f178.google.com ([209.85.208.178]:44229 "EHLO mail-lj1-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727316AbgAHLsC (ORCPT ); Wed, 8 Jan 2020 06:48:02 -0500 Received: by mail-lj1-f178.google.com with SMTP id u71so2955056lje.11 for ; Wed, 08 Jan 2020 03:48:01 -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=FRecKNJ4qdrMcD0dhtNiFMLXR1mz2rfeOaSdEJlv/ns=; b=0eJnEtZD3ces6e6SfW8qtYWngTAxkB1igG74eTVOfwib02m6aO7Uqk4H6qANflzTFg dfVGhJ3V3L0nRjKzp4WSuH/jDppfuhOxqqs1vpDItO+aX15h/cCdwxVFcxlS8UODVh2W LYlY97wqvcRIkTO2q76S2KDInIPUgzQ+zaLmJ8d5PQ0qt4toXEpoG41CoBNscsUj7u8A aH3DHnIkJz0yr6UcKxSzlpKOfubYtRYuOcpJeDsmBC008ZqaMc5Erh4SBOfmIwlWaGHL C1cbQ4eYWCwDomJTK6anBE1DkRpIyjUXj9G3KPw1VBAWn5AUNEh1gapuo5F0wYnsg95p 4bfQ== 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=FRecKNJ4qdrMcD0dhtNiFMLXR1mz2rfeOaSdEJlv/ns=; b=H+7w9KSNVuoM27lwEYBeZ+b3pn+mqP+6sMFcSa/2BSphAfZXWDt3AYgHr6wWqaaJM5 D1i9mpdSFkCS4JhGs/13NGb3fwRDWjpxxjn2tYRUT3qw/opLQZvOeSo7NgxmpWPCyVVH JDzSuRKhS5a0rSFwF9cjfLftD3QoHjupJwbLBqn8+kJTJU8pYCVUODTm5cBe9wof+ZOF Ay7xyPZB6/80BwWOuyAhbkaAq75eq+M3D1wFAQCblSJS6rLmAy8Kqa/t9MN1bnucGH5m HA3GQrSv2R2JegQbyNb6fwMdqqO07mC+yxul1gpEVwi6ijx/rpIQijBp9LB96iqlrUEF xm+Q== X-Gm-Message-State: APjAAAXdKY9Me5j6Y9l1fE07Mrk/Qy4jOaZeP8WRcDir4gjmLtEVtu8X 5rzfZo01KVYRtULG8aXasGWbmUurblY= X-Received: by 2002:a2e:884c:: with SMTP id z12mr2565163ljj.55.1578484080285; Wed, 08 Jan 2020 03:48:00 -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.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jan 2020 03:47:59 -0800 (PST) From: Szymon Czapracki To: linux-bluetooth@vger.kernel.org Cc: Szymon Czapracki Subject: [PATCH v2 4/8] monitor: Decode LE Periodic Advertising Sync Transfer command Date: Wed, 8 Jan 2020 12:47:48 +0100 Message-Id: <20200108114752.133076-4-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 < HCI Command: LE Periodic Advertising Sync Transfer (0x08|0x005a) plen 6 Connection handle: 1 Service data: 0x0001 Sync handle: 1 > HCI Event: Command Status (0x0f) plen 4 LE Periodic Advertising Sync Transfer (0x08|0x005a) ncmd 1 Status: Unknown HCI Command (0x01) --- monitor/bt.h | 7 +++++++ monitor/packet.c | 20 ++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/monitor/bt.h b/monitor/bt.h index bb373b528..efaf80f55 100644 --- a/monitor/bt.h +++ b/monitor/bt.h @@ -2467,6 +2467,13 @@ struct bt_hci_cmd_set_periodic_adv_rec_enable { uint8_t enable; } __attribute__ ((packed)); +#define BT_HCI_CMD_PERIODIC_SYNC_TRANS 0x205a +struct bt_hci_cmd_periodic_sync_trans { + uint16_t handle; + uint16_t service_data; + uint16_t sync_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 e5681b5ff..23eb48374 100644 --- a/monitor/packet.c +++ b/monitor/packet.c @@ -4019,6 +4019,14 @@ static void status_rsp(const void *data, uint8_t size) print_status(status); } +static void status_handle_rsp(const void *data, uint8_t size) +{ + uint8_t status = *((const uint8_t *) data); + + print_status(status); + print_field("Connection handle: %d", get_u8(data + 1)); +} + static void status_bdaddr_rsp(const void *data, uint8_t size) { uint8_t status = *((const uint8_t *) data); @@ -7592,6 +7600,15 @@ static void le_periodic_adv_rec_enable(const void *data, uint8_t size) print_enable("Reporting", cmd->enable); } +static void le_periodic_adv_sync_trans(const void *data, uint8_t size) +{ + const struct bt_hci_cmd_periodic_sync_trans *cmd = data; + + print_field("Connection handle: %d", cmd->handle); + print_field("Service data: 0x%4.4x", cmd->service_data); + print_field("Sync handle: %d", cmd->sync_handle); +} + struct opcode_data { uint16_t opcode; int bit; @@ -8388,6 +8405,9 @@ static const struct opcode_data opcode_table[] = { { 0x2059, 325, "LE Periodic Advertising Receive Enable", le_periodic_adv_rec_enable, 3, true, status_rsp, 1, true }, + { 0x205a, 326, "LE Periodic Advertising Sync Transfer", + le_periodic_adv_sync_trans, 6, true, + status_handle_rsp, 3, true }, { } }; -- 2.24.1