diff --git a/src/shared/bap.c b/src/shared/bap.c
index 6400d1d..9e9ea14 100644
--- a/src/shared/bap.c
+++ b/src/shared/bap.c
uint32_t bt_bap_pac_get_locations(struct bt_bap_pac *pac)
{
- struct bt_pacs *pacs = pac->bdb->pacs;
+ struct bt_pacs *pacs;
+
+ if (!pac)
+ return 0;
+
+ pacs = pac->bdb->pacs;
switch (pac->type) {
case BT_BAP_SOURCE:
}
}
+uint16_t bt_bap_pac_get_supported_context(struct bt_bap_pac *pac)
+{
+ struct bt_pacs *pacs;
+
+ if (!pac)
+ return 0;
+
+ pacs = pac->bdb->pacs;
+
+ switch (pac->type) {
+ case BT_BAP_SOURCE:
+ return pacs->supported_source_context_value;
+ case BT_BAP_SINK:
+ return pacs->supported_sink_context_value;
+ default:
+ return 0;
+ }
+}
+
+uint16_t bt_bap_pac_get_context(struct bt_bap_pac *pac)
+{
+ struct bt_pacs *pacs;
+
+ if (!pac)
+ return 0;
+
+ pacs = pac->bdb->pacs;
+
+ switch (pac->type) {
+ case BT_BAP_SOURCE:
+ return pacs->source_context_value;
+ case BT_BAP_SINK:
+ return pacs->sink_context_value;
+ default:
+ return 0;
+ }
+}
+
+struct bt_bap_pac_qos *bt_bap_pac_get_qos(struct bt_bap_pac *pac)
+{
+ if (!pac || !pac->qos.phy)
+ return NULL;
+
+ return &pac->qos;
+}
+
uint8_t bt_bap_stream_get_type(struct bt_bap_stream *stream)
{
if (!stream)
diff --git a/src/shared/bap.h b/src/shared/bap.h
index 72d6022..ebe4dbf 100644
--- a/src/shared/bap.h
+++ b/src/shared/bap.h
uint32_t bt_bap_pac_get_locations(struct bt_bap_pac *pac);
+uint16_t bt_bap_pac_get_supported_context(struct bt_bap_pac *pac);
+
+uint16_t bt_bap_pac_get_context(struct bt_bap_pac *pac);
+
+struct bt_bap_pac_qos *bt_bap_pac_get_qos(struct bt_bap_pac *pac);
+
uint8_t bt_bap_stream_get_type(struct bt_bap_stream *stream);
struct bt_bap_stream *bt_bap_pac_get_stream(struct bt_bap_pac *pac);