Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp3722054rwr; Sat, 22 Apr 2023 10:17:29 -0700 (PDT) X-Google-Smtp-Source: AKy350YTDLkXU1atQSy3F7ZqeVrWjEIlW1RUva+lLnpKnDiYN+tqHodELK+y3YtzwSBky9yVXrwj X-Received: by 2002:a17:902:e5c5:b0:1a6:48e6:ea8e with SMTP id u5-20020a170902e5c500b001a648e6ea8emr16206879plf.4.1682183849583; Sat, 22 Apr 2023 10:17:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682183849; cv=none; d=google.com; s=arc-20160816; b=vAl6kl5dk6k+m9Etyqh5l5qNU8+HsHs8pwLFcWwwMbXxiVTDzfgLFnoufkzsZWFaQZ acgpq5HXN8adMYmfDW5DOmH9U9XRXQPbn8DSNbH2itwurV7XKIqwMvljvS7C/C0e6fRc Or/eyiCpSlnvA4A9CHKca96Qarhc4657Cisnuc7yq8CpuxpjzPnGTKr2XV7r7B9gXnwe 0/iGRJrDlxGq47OyNAKHF9OJ+zfDXmpjqjHY9knjDFG/qRy7m3D9iR5H7wj1lZymPoMT F/v8hISyOV5G1LZl00fpCHw1nKy6gZXul7OgURdMWaw5O5hpbYc10LLJWPHWKDzHAeOv R73w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=tH9S1AUTcnj8ngSA0sTvPa6tm0MXnRe0NHK1Kqs5xC8=; b=ZaQwrPLvSknZ8R87qlyE8lVSltNpBkp3nxhdFT9vfRqmiDoe02E3RiJtlUOXrGGTns UoC5wRDjhKDfOHhnBm6rtqv3HCRugivx/Zkn382pxieGwMJGuXbE2nhfbwaJ7tmByLGD WnFP2B6g9YKnOIV5eNq4KCVOZKe4EA3zbYEdQ9zjlwoM8LvEQcq63f+Fmq5g9/aF4TNZ uA+s0qQdPCwV7Sexaq4GGGXBfB8WXk5nNvN1xr5e73bEGfEfAWtWSj+lF/nVPSMFKHDP WwDdk5LysZKGBKTu2NAHpyHcQGkE36FzAqwHsWSwMSHV0cQw0laZ6CzTIFLSZgWM3DRM /sKw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w14-20020a17090a1b8e00b00247735d1475si9950350pjc.143.2023.04.22.10.17.14; Sat, 22 Apr 2023 10:17:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229698AbjDVRGG (ORCPT + 99 others); Sat, 22 Apr 2023 13:06:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229693AbjDVRGD (ORCPT ); Sat, 22 Apr 2023 13:06:03 -0400 Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C32C32702 for ; Sat, 22 Apr 2023 10:06:01 -0700 (PDT) Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 457C32401B6 for ; Sat, 22 Apr 2023 19:06:00 +0200 (CEST) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Q3d875qPLz6txJ; Sat, 22 Apr 2023 19:05:59 +0200 (CEST) From: Pauli Virtanen To: linux-bluetooth@vger.kernel.org Cc: Pauli Virtanen Subject: [PATCH BlueZ 1/2] shared/bap: add function to get location from PAC Date: Sat, 22 Apr 2023 17:05:56 +0000 Message-Id: <3cc705b0fa000b4cfc5071ae13f4c0fcb31bfc25.1682182441.git.pav@iki.fi> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NEUTRAL,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Add function to get the PACS Sink/Source Audio Locations field relevant for a given PAC. --- src/shared/bap.c | 14 ++++++++++++++ src/shared/bap.h | 2 ++ 2 files changed, 16 insertions(+) diff --git a/src/shared/bap.c b/src/shared/bap.c index 1fff7e0fd..5a12a64d2 100644 --- a/src/shared/bap.c +++ b/src/shared/bap.c @@ -2442,6 +2442,20 @@ uint8_t bt_bap_pac_get_type(struct bt_bap_pac *pac) return pac->type; } +uint32_t bt_bap_pac_get_locations(struct bt_bap_pac *pac) +{ + struct bt_pacs *pacs = pac->bdb->pacs; + + switch (pac->type) { + case BT_BAP_SOURCE: + return pacs->source_loc_value; + case BT_BAP_SINK: + return pacs->sink_loc_value; + default: + return 0; + } +} + static void notify_pac_removed(void *data, void *user_data) { struct bt_bap_pac_changed *changed = data; diff --git a/src/shared/bap.h b/src/shared/bap.h index bd13abef9..0d419aa74 100644 --- a/src/shared/bap.h +++ b/src/shared/bap.h @@ -128,6 +128,8 @@ bool bt_bap_remove_pac(struct bt_bap_pac *pac); uint8_t bt_bap_pac_get_type(struct bt_bap_pac *pac); +uint32_t bt_bap_pac_get_locations(struct bt_bap_pac *pac); + struct bt_bap_stream *bt_bap_pac_get_stream(struct bt_bap_pac *pac); /* Session related function */ -- 2.40.0