diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c
index b36e45e..37168e5 100644
--- a/profiles/audio/bap.c
+++ b/profiles/audio/bap.c
struct bt_bap_pac *lpac;
char *path;
- bass_add_stream(data->device, meta, caps, qos, sgrp, bis);
+ bt_bap_bis_probe(data->bap, bis, sgrp, caps, meta, qos);
/* Check if this BIS matches any local PAC */
bt_bap_verify_bis(data->bap, bis,
return;
}
- bap_data_remove(data);
+ bt_bap_bis_remove(data->bap);
- bass_remove_stream(device);
+ bap_data_remove(data);
}
static int bap_probe(struct btd_service *service)
diff --git a/profiles/audio/bass.c b/profiles/audio/bass.c
index 96e7677..f5fe606 100644
--- a/profiles/audio/bass.c
+++ b/profiles/audio/bass.c
struct bt_bass *bass;
unsigned int src_id;
unsigned int cp_id;
+ unsigned int bis_id;
};
struct bass_assistant {
static void bass_data_add(struct bass_data *data);
static void bass_data_remove(struct bass_data *data);
+static void bis_probe(uint8_t bis, uint8_t sgrp, struct iovec *caps,
+ struct iovec *meta, struct bt_bap_qos *qos, void *user_data);
+static void bis_remove(struct bt_bap *bap, void *user_data);
+
+
static void bass_debug(const char *str, void *user_data)
{
DBG_IDX(0xffff, "%s", str);
/* Create BASS session with the Broadcast Source */
data = bass_data_new(device);
+ data->bis_id = bt_bap_bis_cb_register(bap, bis_probe,
+ bis_remove, device, NULL);
bass_data_add(data);
/* Remove BASS session with the Broadcast Source device */
data = queue_find(sessions, match_device, device);
- if (data)
+ if (data) {
+ bt_bap_bis_cb_unregister(bap, data->bis_id);
bass_data_remove(data);
+ }
dg = queue_remove_if(delegators, delegator_match_device, device);
if (!dg)
return assistant;
}
-void bass_add_stream(struct btd_device *device, struct iovec *meta,
- struct iovec *caps, struct bt_bap_qos *qos,
- uint8_t sgrp, uint8_t bis)
+static void bis_probe(uint8_t bis, uint8_t sgrp, struct iovec *caps,
+ struct iovec *meta, struct bt_bap_qos *qos, void *user_data)
{
+ struct btd_device *device = user_data;
const struct queue_entry *entry;
struct bt_bap *bap;
struct bt_bap_pac *pac;
assistant->path, MEDIA_ASSISTANT_INTERFACE);
}
-void bass_remove_stream(struct btd_device *device)
+static void bis_remove(struct bt_bap *bap, void *user_data)
{
+ struct btd_device *device = user_data;
+
queue_remove_all(assistants, assistant_match_device,
device, unregister_assistant);
}
diff --git a/profiles/audio/bass.h b/profiles/audio/bass.h
index 99b7552..42a2c04 100644
--- a/profiles/audio/bass.h
+++ b/profiles/audio/bass.h
*
*/
-void bass_add_stream(struct btd_device *device, struct iovec *meta,
- struct iovec *caps, struct bt_bap_qos *qos,
- uint8_t sgrp, uint8_t bis);
-void bass_remove_stream(struct btd_device *device);
-
typedef void (*bt_bass_bcode_func_t)(void *user_data, int err);
void bass_req_bcode(struct bt_bap_stream *stream,