From: Luiz Augusto von Dentz Date: Mon, 19 Jun 2023 20:30:28 +0000 (-0700) Subject: shared/bap: Add unespecified bit in audio context to PAC records X-Git-Tag: accepted/tizen/unified/20240117.163238~164 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=03b7bf223a01da27c82fc73f64964f56d70f9074;p=platform%2Fupstream%2Fbluez.git shared/bap: Add unespecified bit in audio context to PAC records This makes sure unespecified bit is properly marked in both audio contexts since that required by many platforms in order to work properly and while doing that add proper defines to the defaults values used in PACS. --- diff --git a/src/shared/bap.c b/src/shared/bap.c index 4b31536..270f0fd 100644 --- a/src/shared/bap.c +++ b/src/shared/bap.c @@ -47,6 +47,14 @@ #define BAP_PROCESS_TIMEOUT 10 +#define PACS_SRC_LOCATION 0x00000001 +#define PACS_SNK_LOCATION 0x00000003 + +#define PACS_SRC_CTXT 0x000f +#define PACS_SUPPORTED_SRC_CTXT PACS_SRC_CTXT +#define PACS_SNK_CTXT 0x0fff +#define PACS_SUPPORTED_SNK_CTXT PACS_SNK_CTXT + struct bt_bap_pac_changed { unsigned int id; bt_bap_pac_func_t added; @@ -467,12 +475,12 @@ static struct bt_pacs *pacs_new(struct gatt_db *db) pacs = new0(struct bt_pacs, 1); /* Set default values */ - pacs->sink_loc_value = 0x00000003; - pacs->source_loc_value = 0x00000001; - pacs->sink_context_value = 0x0fff; - pacs->source_context_value = 0x000e; - pacs->supported_sink_context_value = 0x0fff; - pacs->supported_source_context_value = 0x000e; + pacs->sink_loc_value = PACS_SNK_LOCATION; + pacs->source_loc_value = PACS_SRC_LOCATION; + pacs->sink_context_value = PACS_SNK_CTXT; + pacs->source_context_value = PACS_SRC_CTXT; + pacs->supported_sink_context_value = PACS_SUPPORTED_SNK_CTXT; + pacs->supported_source_context_value = PACS_SUPPORTED_SRC_CTXT; /* Populate DB with PACS attributes */ bt_uuid16_create(&uuid, PACS_UUID);