All of lore.kernel.org
 help / color / mirror / Atom feed
From: Abhay Maheta <abhay.maheshbhai.maheta@intel.com>
To: linux-bluetooth@vger.kernel.org
Cc: Abhay Maheta <abhay.maheshbhai.maheta@intel.com>,
	Abhay Maheta <mabhay125@gmail.com>
Subject: [PATCH BlueZ v3 1/6] shared/bap: Fix handling for Company ID and Vendor Codec ID
Date: Thu, 29 Dec 2022 21:22:55 +0530	[thread overview]
Message-ID: <20221229155257.341327-2-abhay.maheshbhai.maheta@intel.com> (raw)
In-Reply-To: <20221229155257.341327-1-abhay.maheshbhai.maheta@intel.com>

This adds fixes for handing for Company ID and Vendor Codec ID
while adding PAC record to database and responding to Attribute
Read Request for Sink/Source PAC Characteristics.
---
 src/shared/bap.c | 5 +++++
 src/shared/bap.h | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/shared/bap.c b/src/shared/bap.c
index 2919f243f..0cafb75e6 100644
--- a/src/shared/bap.c
+++ b/src/shared/bap.c
@@ -344,6 +344,8 @@ static void pac_foreach(void *data, void *user_data)
 
 	p = util_iov_push(iov, sizeof(*p));
 	p->codec.id = pac->codec.id;
+	p->codec.cid = pac->codec.cid;
+	p->codec.vid = pac->codec.vid;
 
 	if (pac->data) {
 		p->cc_len = pac->data->iov_len;
@@ -2383,6 +2385,9 @@ struct bt_bap_pac *bt_bap_add_vendor_pac(struct gatt_db *db,
 	if (!bdb)
 		return NULL;
 
+	if ((id != 0xff) && ((cid != 0U)  || (vid != 0U)))
+		return NULL;
+
 	codec.id = id;
 	codec.cid = cid;
 	codec.vid = vid;
diff --git a/src/shared/bap.h b/src/shared/bap.h
index 3558d0445..47a15636c 100644
--- a/src/shared/bap.h
+++ b/src/shared/bap.h
@@ -39,8 +39,8 @@ struct bt_bap_stream;
 
 struct bt_bap_codec {
 	uint8_t  id;
-	uint16_t vid;
 	uint16_t cid;
+	uint16_t vid;
 } __packed;
 
 struct bt_ltv {
-- 
2.25.1


  reply	other threads:[~2022-12-29 15:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-29 15:52 [PATCH BlueZ v3 0/6] To add support for Metadata, CID, VID Abhay Maheta
2022-12-29 15:52 ` Abhay Maheta [this message]
2022-12-29 17:31   ` bluez.test.bot
2022-12-29 15:52 ` [PATCH BlueZ v3 2/6] shared/bap: Add support to set stream metadata Abhay Maheta
2023-01-04  0:24   ` Luiz Augusto von Dentz
2023-01-04 16:39     ` Maheta, Abhay
2022-12-29 15:52 ` [PATCH BlueZ v3 3/6] profiles: Add Support for Metadata, CID and VID Abhay Maheta
2022-12-29 15:53 ` [PATCH BlueZ v3 4/6] media-api: Add CompanyID, VendorCodecID, Metadata Abhay Maheta
2023-01-04  0:26   ` Luiz Augusto von Dentz
2022-12-29 15:53 ` [PATCH BlueZ v3 5/6] client/player: Add support for Company ID, Vendor ID Abhay Maheta
2023-01-04  0:41   ` Luiz Augusto von Dentz
2022-12-29 15:53 ` [PATCH BlueZ v3 6/6] client/player: Add support for Metadata in BAP Profile Abhay Maheta
2023-01-04  0:32   ` Luiz Augusto von Dentz
2023-01-04  0:30 ` [PATCH BlueZ v3 0/6] To add support for Metadata, CID, VID patchwork-bot+bluetooth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221229155257.341327-2-abhay.maheshbhai.maheta@intel.com \
    --to=abhay.maheshbhai.maheta@intel.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=mabhay125@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.