From patchwork Tue Apr 26 23:03:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Augusto von Dentz X-Patchwork-Id: 566218 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 23B47C433F5 for ; Tue, 26 Apr 2022 23:03:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355987AbiDZXG7 (ORCPT ); Tue, 26 Apr 2022 19:06:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234676AbiDZXG6 (ORCPT ); Tue, 26 Apr 2022 19:06:58 -0400 Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CF3B8BF23 for ; Tue, 26 Apr 2022 16:03:49 -0700 (PDT) Received: by mail-io1-xd2f.google.com with SMTP id p62so659391iod.0 for ; Tue, 26 Apr 2022 16:03:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=A7LzyN3BLdbjimxUb8J0gDuiLBJbokhGYzF2kcOy5uA=; b=kmNDYJrQGSXzfwutaKhdRntfJx8SlDjf5gjZKlGrgaOIZ11Ki5dvJqqPkV8Mdtuc3E CseR8uy4YNiSJ4oWxk8+ZGf18ZNC5r0UEJvOjXHV7Y8JBRfYor49nUGNYgZ5EkONaqLD 3dpbXcCVOBKQ8IRepavOGpS4r/vSiEhbfX57R7697n0QnIyii8Dskaw+mPtBTMmS6EPA 0iEVftNdBSC0mHGpdjDn/MOKdSkHc8WqSr9qj/qqOKWEEFTYrjAGynH8+RUbTWpJvw+A NqrneV959JE8AJwms1Qx3BWQ69HA5svKGS7gUcKr2vaDOSS/vuBFyRoO7Z5IKWn/7ZWj 7CiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=A7LzyN3BLdbjimxUb8J0gDuiLBJbokhGYzF2kcOy5uA=; b=Jze7cOmLtQ0MOwFNIFfhpqdo/r/sdibFNvf66w6g/Kn3EnoTTwfai2cQXCgba91wnx u0CPRtZcmbu/9YK1OFiXjOAMLb935S8tnxEAC60vabl0voV26OSy5BMhE6zep+oOpcT8 K0a4YvQ9TbrlEa2FGFeXldzqiLKV/5LD2G62/rswOciCwgVuCbaeoSXvaEFXh94VC36J FHPhDh/T1xPhR1SFO8eFf0RiFr/PRJb70KuSa1Qrb8pCWAFrJ55JGl/8zcI0PatXsz8t 5oJgJVO2FnLw4gov6EBqlcS7N/0sBuJKy6AEZZM6snY3Ddn15OtFOWEqtGC9AvERR97m /+XQ== X-Gm-Message-State: AOAM5322fnozKw6dGh0Zj3mWkfdIsiGggkhaluzwvxNCN0Nokw2TQpjh G6qeZa8UzbiWB3RDSzW2BDIU7gKm4nQ= X-Google-Smtp-Source: ABdhPJzeQYIA7QKZBOd6bLpZhmdp7hSNaVvNCm3oV/CEj417bgjEI4BSC5Z3IQG7nhyhtdfuQD+SFA== X-Received: by 2002:a05:6638:1487:b0:323:7543:6cb9 with SMTP id j7-20020a056638148700b0032375436cb9mr11076614jak.98.1651014228730; Tue, 26 Apr 2022 16:03:48 -0700 (PDT) Received: from lvondent-mobl4.. (c-71-56-157-77.hsd1.or.comcast.net. [71.56.157.77]) by smtp.gmail.com with ESMTPSA id m16-20020a056e020df000b002ccc1d58ca5sm8437194ilj.54.2022.04.26.16.03.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Apr 2022 16:03:48 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ 1/4] btmon: Add proper decoding to Service Data UUID Date: Tue, 26 Apr 2022 16:03:44 -0700 Message-Id: <20220426230347.857783-1-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Luiz Augusto von Dentz This adds proper decoding for Service Data UUID: Service Data: Apple, Inc. (0xfd6f) Data: e6b07e19815e902100b8b2f4a55255fd18f0c6be --- monitor/packet.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/monitor/packet.c b/monitor/packet.c index 6ef2fba3b..471b0dd4d 100644 --- a/monitor/packet.c +++ b/monitor/packet.c @@ -3301,6 +3301,14 @@ static void print_uuid128_list(const char *label, const void *data, } } +static void print_service_data(const uint8_t *data, uint8_t data_len) +{ + uint16_t uuid = get_le16(&data[0]); + + print_field("Service Data: %s (0x%4.4x)", bt_uuid16_to_str(uuid), uuid); + print_hex_field(" Data", &data[2], data_len - 2); +} + static const struct bitfield_data eir_flags_table[] = { { 0, "LE Limited Discoverable Mode" }, { 1, "LE General Discoverable Mode" }, @@ -3703,9 +3711,7 @@ static void print_eir(const uint8_t *eir, uint8_t eir_len, bool le) case BT_EIR_SERVICE_DATA: if (data_len < 2) break; - sprintf(label, "Service Data (UUID 0x%4.4x)", - get_le16(&data[0])); - print_hex_field(label, &data[2], data_len - 2); + print_service_data(data, data_len); break; case BT_EIR_RANDOM_ADDRESS: From patchwork Tue Apr 26 23:03:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Augusto von Dentz X-Patchwork-Id: 566831 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC5E1C433EF for ; Tue, 26 Apr 2022 23:03:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355992AbiDZXHB (ORCPT ); Tue, 26 Apr 2022 19:07:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355985AbiDZXG7 (ORCPT ); Tue, 26 Apr 2022 19:06:59 -0400 Received: from mail-io1-xd30.google.com (mail-io1-xd30.google.com [IPv6:2607:f8b0:4864:20::d30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ABDFE8BF42 for ; Tue, 26 Apr 2022 16:03:50 -0700 (PDT) Received: by mail-io1-xd30.google.com with SMTP id g21so516541iom.13 for ; Tue, 26 Apr 2022 16:03:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=mSAUZ+oaGBwM/63LP16uwbTzIdQvEG2+1IRQIpGQ9jw=; b=LnbGJmQjFxLD5B5afUnE3c93T2PUaFk1ugqjXHBd8LLst2VMgD7Q3q5Ritl9x9TlMc 9ciRZBw5oZ48fxXZceJOePh8ghsC/toIzz/zo/ZTQql9wWnKyry9DDe7GE8DOxMnrGmh ASq24tC10hi4ApojEQn7wymqxmclVttdUh8N6ruImg9JIsewdZhZimWR4k5Ni2OBIS3T VzM2V1+uto2ZLv/xyNbDYC5PvClGQXYg+gPQIDteHsR4hnC0EBiVTNLE6AT5+tvffKrR 1MbGhK/5tqCQJP0wzim68T9kK/rPHwPmackwpUZIyIPRIIDQxDk4bkiH8psyWbBAqYk6 x4Eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mSAUZ+oaGBwM/63LP16uwbTzIdQvEG2+1IRQIpGQ9jw=; b=74+rBHbuND+rlA5KngKJ07JuVaQ0GHo9PefD2G0vcJAGpjYTR+25nJS+bTSo07Onem 8p3xqMQWLMIOv5jbYYV3qoktKFy6HQ7INJgxvfazA7hqXoKhttygykaPeauKyimMKBhg bVgOZioUqOxKmdR54kKZ1hRag56dVkU2xtH0QgVESidaYbNBvWn+JPzjrmvXrI/G5021 9VYHPlD3NmjLRjRtCKZ3q1AyPY4+RH7M7YauDk8ZDYhn7xxUK/hIUSYnBeZdkqM6NO3S c5zXSCxV58w9tS4gVzcs9GAULHRxef0Uuemnd5EwKlfcq+V/5rR7hsGAlNj/LKSVtE34 NWlw== X-Gm-Message-State: AOAM531fFKrDR4Dvo4EcGcWznjbG8mY+0LD28BQQn1M6an3oMizDkTm+ omfh+4LELo2JXWwuT1fbDE1mrChbmbo= X-Google-Smtp-Source: ABdhPJy5953fDPwuMdVExW224e/eypfvKhoMVKp5Cv5mgD+mv0ckTqzE3uLDhWnCu5k2nmqktTa1sQ== X-Received: by 2002:a05:6602:398b:b0:657:ab5a:ce2a with SMTP id bw11-20020a056602398b00b00657ab5ace2amr1830772iob.78.1651014229790; Tue, 26 Apr 2022 16:03:49 -0700 (PDT) Received: from lvondent-mobl4.. (c-71-56-157-77.hsd1.or.comcast.net. [71.56.157.77]) by smtp.gmail.com with ESMTPSA id m16-20020a056e020df000b002ccc1d58ca5sm8437194ilj.54.2022.04.26.16.03.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Apr 2022 16:03:49 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ 2/4] btmon: Add support for decoding Broadcast Audio Annoucements Date: Tue, 26 Apr 2022 16:03:45 -0700 Message-Id: <20220426230347.857783-2-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220426230347.857783-1-luiz.dentz@gmail.com> References: <20220426230347.857783-1-luiz.dentz@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Luiz Augusto von Dentz This adds support for decoding Broadcast Audio Announcements as shown on: Basic Audio Profile / Profile Specification Page 34 of 146 Table 3.14: Broadcast Source AD format when transmitting Broadcast Audio Announcements < HCI Command: LE Set Extended Advertising Data (0x08|0x0037) plen 36 Handle: 0x00 Operation: Complete extended advertising data (0x03) Fragment preference: Minimize fragmentation (0x01) Data length: 0x20 Service Data: Broadcast Audio Announcement (0x1852) Broadcast ID: 904177 (0x0dcbf1) Name (complete): Broadcast Audio Source --- monitor/packet.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/monitor/packet.c b/monitor/packet.c index 471b0dd4d..b376d5a8b 100644 --- a/monitor/packet.c +++ b/monitor/packet.c @@ -3301,11 +3301,44 @@ static void print_uuid128_list(const char *label, const void *data, } } +static void print_broadcast_annoucement(const uint8_t *data, uint8_t data_len) +{ + uint32_t bid; + + if (data_len < 3) { + print_hex_field(" Data", data, data_len); + return; + } + + bid = get_le24(data); + print_field("Broadcast ID: %u (0x%06x)", bid, bid); +} + +static const struct service_data_decoder { + uint16_t uuid; + void (*func)(const uint8_t *data, uint8_t data_len); +} service_data_decoders[] = { + { 0x1852, print_broadcast_annoucement } +}; + static void print_service_data(const uint8_t *data, uint8_t data_len) { uint16_t uuid = get_le16(&data[0]); + size_t i; print_field("Service Data: %s (0x%4.4x)", bt_uuid16_to_str(uuid), uuid); + + for (i = 0; i < ARRAY_SIZE(service_data_decoders); i++) { + const struct service_data_decoder *decoder; + + decoder = &service_data_decoders[i]; + + if (decoder->uuid == uuid) { + decoder->func(&data[2], data_len - 2); + return; + } + } + print_hex_field(" Data", &data[2], data_len - 2); } From patchwork Tue Apr 26 23:03:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Augusto von Dentz X-Patchwork-Id: 566217 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 26A6DC433F5 for ; Tue, 26 Apr 2022 23:03:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355995AbiDZXHD (ORCPT ); Tue, 26 Apr 2022 19:07:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355993AbiDZXHB (ORCPT ); Tue, 26 Apr 2022 19:07:01 -0400 Received: from mail-io1-xd34.google.com (mail-io1-xd34.google.com [IPv6:2607:f8b0:4864:20::d34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A812F8BF7C for ; Tue, 26 Apr 2022 16:03:51 -0700 (PDT) Received: by mail-io1-xd34.google.com with SMTP id z18so172056iob.5 for ; Tue, 26 Apr 2022 16:03:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=EYpkBNMgdqUzGGcbORl6WvByS0U8NcW87VYkbwsCJVs=; b=TuMJKK4OdXhF94IGZ06HE97cFtluxOi/PGUdEvylqPLjiIWaVo58AWziQZ2MGKRMo6 zkCs5tCndooQVza5qJQ4i4FFsVB5hdiNx6niYHS8MTQxbKLKMBbXgwoogbE5cChF55Gq Ws9Tne8MywFkU1b86kvgihVti+ZcYunn6vD3pHX9lWXXnfXLPbpZ5Qqyj2sE2ruhmiDF h2GXDzI0+RPUgYoGKmoz11k6JT0rYTJMByL0YA9QL7LoSVM1syeYxMrwUFZTLPvygWXo 0YElggKYAyRCawGDcE+3vW0RERpPG5ACSL+FnV56xQ7Dpl5a7zB4V95kfjZdkTf9M6sa XZug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EYpkBNMgdqUzGGcbORl6WvByS0U8NcW87VYkbwsCJVs=; b=LXTDlxeGOLwfj75Pslp1DkgWDQDna+dMOvNBmH9NmcxHh7Hp8shNvfdQDTwKEnEd8Z KmSwcoYpWNtCt/Twcr7itsAPZtaCB4oSnuK8/kQMbSHMOWybFDMMy5QE6E2REyn4ZGQY X/ipbeUDxX8c1F6Jn1HMJBSZH1k8mCVlzm6ANAg+vAXaLMJuzZvrOuDbd4OJI8rWFsxx qqeYebZq00PVzahk8wz6vgBycXwAr94UHiZGzAxjebUDpWYucy15xzv51L5nbEuW51td 0Vr0aklbZcEDqKgMh/FNishLqUBhNE1JaYKX3kGHZy/tpekq3yNAcHzEJkYuyJhcSalC aoWA== X-Gm-Message-State: AOAM530rKJuiGX6Z1xpnF0nKZU9JglTOlcsE8gqaZXPZNUmXiY7ACl37 0HcUijZxW3p3pCU755zXRnlpfyo1ESY= X-Google-Smtp-Source: ABdhPJwjm1/efhiMw8zqBoULTQ4/iFJU/blk1v1TxZrwPfNtG7sFb2MyKik8iFJitNoK7gy1zYQXig== X-Received: by 2002:a05:6638:3397:b0:32a:8ab7:3f0 with SMTP id h23-20020a056638339700b0032a8ab703f0mr10463808jav.260.1651014230678; Tue, 26 Apr 2022 16:03:50 -0700 (PDT) Received: from lvondent-mobl4.. (c-71-56-157-77.hsd1.or.comcast.net. [71.56.157.77]) by smtp.gmail.com with ESMTPSA id m16-20020a056e020df000b002ccc1d58ca5sm8437194ilj.54.2022.04.26.16.03.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Apr 2022 16:03:50 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ 3/4] btmon: Add support for decoding Basic Audio Annoucements Date: Tue, 26 Apr 2022 16:03:46 -0700 Message-Id: <20220426230347.857783-3-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220426230347.857783-1-luiz.dentz@gmail.com> References: <20220426230347.857783-1-luiz.dentz@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Luiz Augusto von Dentz This adds support for decoding Basic Audio Announcements as shown on: Basic Audio Profile / Profile Specification Page 36 of 146 Table 3.15: Format of BASE used in Basic Audio Announcements < HCI Command: LE Set Periodic Advertising Data (0x08|0x003f) plen 36 Handle: 0 Operation: Complete ext advertising data (0x03) Data length: 0x21 Service Data: Basic Audio Announcement (0x1851) Presetation Delay: 40000 Number of Subgroups: 1 Subgroup #0: Number of BIS(s): 1 Codec: Reserved (0x06) Codec Specific Configuration: 010101020403010000020428 Metadata: 020202 BIS #0: Index: 1 Codec Specific Configuration: --- monitor/bt.h | 28 +++++++++++++ monitor/packet.c | 106 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 134 insertions(+) diff --git a/monitor/bt.h b/monitor/bt.h index e9f72de36..644c97c98 100644 --- a/monitor/bt.h +++ b/monitor/bt.h @@ -3517,6 +3517,34 @@ struct bt_hci_evt_le_per_sync_established { uint8_t clock_accuracy; } __attribute__ ((packed)); +struct bt_hci_le_pa_base_codec { + uint8_t id; + uint16_t cid; + uint16_t vid; +} __attribute__ ((packed)); + +struct bt_hci_lv_data { + uint8_t len; + uint8_t data[]; +} __attribute__ ((packed)); + +struct bt_hci_le_pa_base_bis { + uint8_t index; + struct bt_hci_lv_data codec_cfg[]; +} __attribute__ ((packed)); + +struct bt_hci_le_pa_base_subgroup { + uint8_t num_bis; + struct bt_hci_le_pa_base_codec codec; + uint8_t data[]; +} __attribute__ ((packed)); + +struct bt_hci_le_pa_base_data { + uint8_t pd[3]; + uint8_t num_subgroups; + struct bt_hci_le_pa_base_subgroup subgroups[]; +} __attribute__ ((packed)); + #define BT_HCI_EVT_LE_PA_REPORT 0x0f struct bt_hci_le_pa_report { uint16_t handle; diff --git a/monitor/packet.c b/monitor/packet.c index b376d5a8b..9d7677bb1 100644 --- a/monitor/packet.c +++ b/monitor/packet.c @@ -3301,6 +3301,111 @@ static void print_uuid128_list(const char *label, const void *data, } } +static void *iov_pull(struct iovec *iov, size_t len) +{ + void *data; + + if (iov->iov_len < len) + return NULL; + + data = iov->iov_base; + iov->iov_base += len; + iov->iov_len -= len; + + return data; +} + +static void print_base_annoucement(const uint8_t *data, uint8_t data_len) +{ + struct iovec iov; + struct bt_hci_le_pa_base_data *base_data; + uint8_t i; + + iov.iov_base = (void *) data; + iov.iov_len = data_len; + + base_data = iov_pull(&iov, sizeof(*base_data)); + if (!base_data) + goto done; + + /* Level 1 - BASE */ + print_field(" Presetation Delay: %u", get_le24(base_data->pd)); + print_field(" Number of Subgroups: %u", base_data->num_subgroups); + + /* Level 2 - Subgroups*/ + for (i = 0; i < base_data->num_subgroups; i++) { + struct bt_hci_le_pa_base_subgroup *subgroup; + struct bt_hci_lv_data *codec_cfg; + struct bt_hci_lv_data *metadata; + uint8_t j; + + print_field(" Subgroup #%u:", i); + + subgroup = iov_pull(&iov, sizeof(*subgroup)); + if (!subgroup) + goto done; + + print_field(" Number of BIS(s): %u", subgroup->num_bis); + print_codec_id(" Codec", subgroup->codec.id); + + if (subgroup->codec.id == 0xff) { + uint16_t id; + + id = le16_to_cpu(subgroup->codec.vid); + print_field(" Codec Company ID: %s (0x%04x)", + bt_compidtostr(id), id); + print_field(" Codec Vendor ID: 0x%04x", + subgroup->codec.vid); + } + + codec_cfg = iov_pull(&iov, sizeof(*codec_cfg)); + if (!codec_cfg) + goto done; + + if (!iov_pull(&iov, codec_cfg->len)) + goto done; + + print_hex_field(" Codec Specific Configuration", + codec_cfg->data, codec_cfg->len); + + metadata = iov_pull(&iov, sizeof(*metadata)); + if (!metadata) + goto done; + + if (!iov_pull(&iov, metadata->len)) + goto done; + + print_hex_field(" Metadata", metadata->data, metadata->len); + + /* Level 3 - BIS(s)*/ + for (j = 0; j < subgroup->num_bis; j++) { + struct bt_hci_le_pa_base_bis *bis; + + print_field(" BIS #%u:", j); + + bis = iov_pull(&iov, sizeof(*bis)); + if (!bis) + goto done; + + print_field(" Index: %u", bis->index); + + codec_cfg = iov_pull(&iov, sizeof(*codec_cfg)); + if (!codec_cfg) + goto done; + + if (!iov_pull(&iov, codec_cfg->len)) + goto done; + + print_hex_field(" Codec Specific Configuration", + codec_cfg->data, codec_cfg->len); + } + } + +done: + if (iov.iov_len) + print_hex_field(" Data", iov.iov_base, iov.iov_len); +} + static void print_broadcast_annoucement(const uint8_t *data, uint8_t data_len) { uint32_t bid; @@ -3318,6 +3423,7 @@ static const struct service_data_decoder { uint16_t uuid; void (*func)(const uint8_t *data, uint8_t data_len); } service_data_decoders[] = { + { 0x1851, print_base_annoucement }, { 0x1852, print_broadcast_annoucement } }; From patchwork Tue Apr 26 23:03:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Augusto von Dentz X-Patchwork-Id: 566830 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85C17C433FE for ; Tue, 26 Apr 2022 23:03:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355996AbiDZXHE (ORCPT ); Tue, 26 Apr 2022 19:07:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355994AbiDZXHB (ORCPT ); Tue, 26 Apr 2022 19:07:01 -0400 Received: from mail-io1-xd2c.google.com (mail-io1-xd2c.google.com [IPv6:2607:f8b0:4864:20::d2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A19778C7DE for ; Tue, 26 Apr 2022 16:03:52 -0700 (PDT) Received: by mail-io1-xd2c.google.com with SMTP id f2so314255ioh.7 for ; Tue, 26 Apr 2022 16:03:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=Upa4p2fK0/wqfCCgaMpeFcUQl2tIIqKk2ieT4fuRaVM=; b=EG8ACBZvYOJUEhFPqF7JamjJZyvLrh3A5+0WsZ+ubImCtzxFUNbMNjKntNT/XKmiRK DAM4twuPTSC7sadQVqyOXhSNhMe2ZimRkcWmaKkIJdP6vx7cwabrxwkFkcWB8FCRgke4 k67uv+K6CjWTcfA28mLJFPjaRU+u3YLV+AuJ0ZLONL/QCCYXOQq413YQ7qnHAd/nrRWA 76jytvt0Vg5G5BKDjlGGLJhUAkUTDeJhtfaOxfR4vV/cmLcAcpX61f2c6GY+5TIaMMV2 KWltZxDdmcz/KQZd8ALiUChEzgnw2pxLh4sI3bcgqIsXBoZsHXQbxboAnCleG6ArsxH2 pg6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Upa4p2fK0/wqfCCgaMpeFcUQl2tIIqKk2ieT4fuRaVM=; b=PNjYbgbXXwoMvXZAl6VeeWZJm/o/mz38m4jHE76lrUnnkrzFSUvvs/sUnggmJtuS0L jrOk2SzpeCPMSJzDMp3s7P9X7r+l8zYAPT2H4W3tKyrjYnGOCD8PJKNdnVM8j9B3DwZH u5TfITlxkvgGwLBgMesALib5EwQatQnlZe/4A0PWzqFGR3+3SW/gGrVXn8oOW7l4VcMQ L+uSmNtsCDSHcllmES6I1ASCWc0Afeodk6Fjm7a3B+6WFkV5CpizLxB6JicJvoJUGK4v uExPU22CkwXxS/JXegw6vNZ+2L3NDBqQ48xb4lPQzB+Gia/x6XagCXZUH+nf8RoLb2Pr aKJw== X-Gm-Message-State: AOAM531qvJatYj2vFz1gBrb3afIpJUDmXryHxS1Q0tesgZRdz4AUokXI akYIugNeo6XUj8pSWbuVUQ24kZspxmY= X-Google-Smtp-Source: ABdhPJw1l/RQHLBFsZ9Yp3Wc74glhpkg9G5/Utqi7v67Uow9JguwkYbc6Thj6jjYgX5ujZFS3yfObw== X-Received: by 2002:a05:6638:24d6:b0:323:cda4:170d with SMTP id y22-20020a05663824d600b00323cda4170dmr11009789jat.269.1651014231806; Tue, 26 Apr 2022 16:03:51 -0700 (PDT) Received: from lvondent-mobl4.. (c-71-56-157-77.hsd1.or.comcast.net. [71.56.157.77]) by smtp.gmail.com with ESMTPSA id m16-20020a056e020df000b002ccc1d58ca5sm8437194ilj.54.2022.04.26.16.03.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Apr 2022 16:03:51 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ 4/4] btmon: Fix not decoding LC3 id Date: Tue, 26 Apr 2022 16:03:47 -0700 Message-Id: <20220426230347.857783-4-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220426230347.857783-1-luiz.dentz@gmail.com> References: <20220426230347.857783-1-luiz.dentz@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Luiz Augusto von Dentz This enablind decoding LC3 codec id (0x06). --- monitor/packet.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/monitor/packet.c b/monitor/packet.c index 9d7677bb1..d409e4e63 100644 --- a/monitor/packet.c +++ b/monitor/packet.c @@ -1337,6 +1337,9 @@ static void print_codec_id(const char *label, uint8_t codec) case 0x05: str = "mSBC"; break; + case 0x06: + str = "LC3"; + break; case 0xff: str = "Vendor specific"; break;