diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c
index 2476366..88d1705 100644
--- a/profiles/audio/bap.c
+++ b/profiles/audio/bap.c
unsigned int io_id;
bool recreate;
bool cig_active;
+ uint8_t sid;
struct iovec *caps;
struct iovec *metadata;
unsigned int id;
}
static void create_stream_for_bis(struct bap_data *bap_data,
- struct bt_bap_pac *lpac, struct bt_bap_qos *qos,
- struct iovec *caps, struct iovec *meta, char *path)
+ struct bt_bap_pac *lpac, uint8_t sid,
+ struct bt_bap_qos *qos, struct iovec *caps,
+ struct iovec *meta, char *path)
{
struct bap_setup *setup;
setup->stream = bt_bap_stream_new(bap_data->bap,
lpac, NULL, &setup->qos, caps);
+ setup->sid = sid;
bt_bap_stream_set_user_data(setup->stream, path);
bt_bap_stream_config(setup->stream, &setup->qos,
caps, NULL, NULL);
NULL, NULL);
}
-static void bis_handler(uint8_t bis, uint8_t sgrp, struct iovec *caps,
- struct iovec *meta, struct bt_bap_qos *qos, void *user_data)
+static void bis_handler(uint8_t sid, uint8_t bis, uint8_t sgrp,
+ struct iovec *caps, struct iovec *meta,
+ struct bt_bap_qos *qos, void *user_data)
{
struct bap_data *data = user_data;
struct bt_bap_pac *lpac;
char *path;
- bt_bap_bis_probe(data->bap, bis, sgrp, caps, meta, qos);
+ bt_bap_bis_probe(data->bap, sid, bis, sgrp, caps, meta, qos);
/* Check if this BIS matches any local PAC */
- bt_bap_verify_bis(data->bap, bis,
- caps, &lpac);
+ bt_bap_verify_bis(data->bap, bis, caps, &lpac);
if (!lpac)
return;
- if (asprintf(&path, "%s/bis%d",
- device_get_path(data->device),
- bis) < 0)
+ if (asprintf(&path, "%s/sid%d/bis%d", device_get_path(data->device),
+ sid, bis) < 0)
return;
- create_stream_for_bis(data, lpac, qos,
- caps, meta, path);
+ create_stream_for_bis(data, lpac, sid, qos, caps, meta, path);
}
static gboolean big_info_report_cb(GIOChannel *io, GIOCondition cond,
struct bt_iso_qos qos;
struct iovec iov;
struct bt_bap_qos bap_qos = {0};
+ uint8_t sid;
DBG("BIG Info received");
bt_io_get(io, &err,
BT_IO_OPT_BASE, &base,
BT_IO_OPT_QOS, &qos,
+ BT_IO_OPT_ISO_BC_SID, &sid,
BT_IO_OPT_INVALID);
if (err) {
error("%s", err->message);
/* Create BAP QoS structure */
bt_bap_iso_qos_to_bap_qos(&qos, &bap_qos);
- bt_bap_parse_base(&iov, &bap_qos, bap_debug, bis_handler, data);
+ bt_bap_parse_base(sid, &iov, &bap_qos, bap_debug, bis_handler, data);
util_iov_free(bap_qos.bcast.bcode, 1);
btd_device_get_bdaddr_type(bap_data->device),
BT_IO_OPT_MODE, BT_IO_MODE_ISO,
BT_IO_OPT_QOS, &bap_sink_pa_qos,
+ BT_IO_OPT_ISO_BC_SID, setup->sid,
BT_IO_OPT_INVALID);
if (!bap_data->listen_io) {
error("%s", err->message);
diff --git a/profiles/audio/bass.c b/profiles/audio/bass.c
index c36f432..46ac0f4 100644
--- a/profiles/audio/bass.c
+++ b/profiles/audio/bass.c
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_probe(uint8_t sid, 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);
setup_configure_stream(setup);
}
-static void bis_handler(uint8_t bis, uint8_t sgrp, struct iovec *caps,
- struct iovec *meta, struct bt_bap_qos *qos, void *user_data)
+static void bis_handler(uint8_t sid, uint8_t bis, uint8_t sgrp,
+ struct iovec *caps, struct iovec *meta,
+ struct bt_bap_qos *qos, void *user_data)
{
struct bass_delegator *dg = user_data;
struct bt_bap_pac *lpac;
struct bt_iso_qos qos;
struct iovec iov;
struct bt_bap_qos bap_qos = {0};
+ uint8_t sid;
dg->io_id = 0;
bt_io_get(io, &err,
BT_IO_OPT_BASE, &base,
BT_IO_OPT_QOS, &qos,
+ BT_IO_OPT_ISO_BC_SID, &sid,
BT_IO_OPT_INVALID);
if (err) {
error("%s", err->message);
/* Create BAP QoS structure */
bt_bap_iso_qos_to_bap_qos(&qos, &bap_qos);
- bt_bap_parse_base(&iov, &bap_qos, bass_debug, bis_handler, dg);
+ bt_bap_parse_base(sid, &iov, &bap_qos, bass_debug, bis_handler, dg);
util_iov_free(bap_qos.bcast.bcode, 1);
return assistant;
}
-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_probe(uint8_t sid, 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;
diff --git a/src/shared/bap.c b/src/shared/bap.c
index 3758aa0..3a11cb0 100644
--- a/src/shared/bap.c
+++ b/src/shared/bap.c
return false;
}
-void bt_bap_bis_probe(struct bt_bap *bap, uint8_t bis, uint8_t sgrp,
- struct iovec *caps, struct iovec *meta, struct bt_bap_qos *qos)
+void bt_bap_bis_probe(struct bt_bap *bap, uint8_t sid, uint8_t bis,
+ uint8_t sgrp, struct iovec *caps, struct iovec *meta,
+ struct bt_bap_qos *qos)
{
const struct queue_entry *entry;
entry = entry->next;
if (cb->probe)
- cb->probe(bis, sgrp, caps, meta, qos, cb->data);
+ cb->probe(sid, bis, sgrp, caps, meta, qos, cb->data);
}
bt_bap_unref(bap);
}
-bool bt_bap_parse_base(struct iovec *iov,
+bool bt_bap_parse_base(uint8_t sid, struct iovec *iov,
struct bt_bap_qos *qos,
util_debug_func_t func,
bt_bap_bis_func_t handler,
if (!bis_cc)
continue;
- handler(bis_index, idx, bis_cc, &meta,
+ handler(sid, bis_index, idx, bis_cc, &meta,
qos, user_data);
util_iov_free(bis_cc, 1);
diff --git a/src/shared/bap.h b/src/shared/bap.h
index dfd1699..d105814 100644
--- a/src/shared/bap.h
+++ b/src/shared/bap.h
void *user_data);
typedef void (*bt_bap_func_t)(struct bt_bap *bap, void *user_data);
-typedef void (*bt_bap_bis_func_t)(uint8_t bis, uint8_t sgrp,
- struct iovec *caps, struct iovec *meta,
- struct bt_bap_qos *qos, void *user_data);
+typedef void (*bt_bap_bis_func_t)(uint8_t sid, uint8_t bis, uint8_t sgrp,
+ struct iovec *caps, struct iovec *meta,
+ struct bt_bap_qos *qos, void *user_data);
typedef void (*bt_bap_bcode_reply_t)(void *user_data, int err);
struct iovec *caps,
struct bt_bap_pac **lpac);
-bool bt_bap_parse_base(struct iovec *base,
+bool bt_bap_parse_base(uint8_t sid, struct iovec *base,
struct bt_bap_qos *qos,
util_debug_func_t func,
bt_bap_bis_func_t handler,
bt_bap_destroy_func_t destroy);
bool bt_bap_bis_cb_unregister(struct bt_bap *bap, unsigned int id);
-void bt_bap_bis_probe(struct bt_bap *bap, uint8_t bis, uint8_t sgrp,
- struct iovec *caps, struct iovec *meta, struct bt_bap_qos *qos);
+void bt_bap_bis_probe(struct bt_bap *bap, uint8_t sid, uint8_t bis,
+ uint8_t sgrp, struct iovec *caps, struct iovec *meta,
+ struct bt_bap_qos *qos);
void bt_bap_bis_remove(struct bt_bap *bap);
void bt_bap_req_bcode(struct bt_bap_stream *stream,