diff options
author | Abhay Maheta <abhay.maheshbhai.maheta@intel.com> | 2022-12-29 21:22:55 +0530 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2023-01-03 15:42:56 -0800 |
commit | 441eeb2a14482ec4d81a90eae5b42fa925371e97 (patch) | |
tree | 0008aee5fed3fb38c0f4a6deb6d5fa7e2c3b9d5c /src/shared | |
parent | 7a32f29180351dbac3727c7f4a08a577093ceddc (diff) | |
download | bluez-441eeb2a14482ec4d81a90eae5b42fa925371e97.tar.gz |
shared/bap: Fix handling for Company ID and Vendor Codec ID
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.
Diffstat (limited to 'src/shared')
-rw-r--r-- | src/shared/bap.c | 5 | ||||
-rw-r--r-- | src/shared/bap.h | 2 |
2 files changed, 6 insertions, 1 deletions
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 { |