diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c
index b8c75f1..dfdf872 100644
--- a/profiles/audio/bap.c
+++ b/profiles/audio/bap.c
/* TODO: Check if stream capabilities match add support for Latency
* and PHY.
*/
- if (ep->stream)
- ep->id = bt_bap_stream_config(ep->stream, &ep->qos, ep->caps,
- config_cb, ep);
- else
- ep->stream = bt_bap_config(ep->data->bap, ep->lpac, ep->rpac,
- &ep->qos, ep->caps,
- config_cb, ep);
+ if (!ep->stream)
+ ep->stream = bt_bap_stream_new(ep->data->bap, ep->lpac,
+ ep->rpac, &ep->qos, ep->caps);
- if (!ep->stream) {
+ ep->id = bt_bap_stream_config(ep->stream, &ep->qos, ep->caps,
+ config_cb, ep);
+ if (!ep->id) {
DBG("Unable to config stream");
free(ep->caps);
ep->caps = NULL;
/* TODO: Check if stream capabilities match add support for Latency
* and PHY.
*/
- if (ep->stream)
- ep->id = bt_bap_stream_config(ep->stream, &ep->qos, ep->caps,
- config_cb, ep);
- else
- ep->stream = bt_bap_config(ep->data->bap, ep->lpac, ep->rpac,
- &ep->qos, ep->caps,
- config_cb, ep);
+ if (!ep->stream)
+ ep->stream = bt_bap_stream_new(ep->data->bap, ep->lpac,
+ ep->rpac, &ep->qos, ep->caps);
- if (!ep->stream) {
+ ep->id = bt_bap_stream_config(ep->stream, &ep->qos, ep->caps,
+ config_cb, ep);
+ if (!ep->id) {
DBG("Unable to config stream");
util_iov_free(ep->caps, 1);
ep->caps = NULL;
diff --git a/src/shared/bap.c b/src/shared/bap.c
index 3ebcd81..952b7be 100644
--- a/src/shared/bap.c
+++ b/src/shared/bap.c
return 0;
}
-struct bt_bap_stream *bt_bap_config(struct bt_bap *bap,
+struct bt_bap_stream *bt_bap_stream_new(struct bt_bap *bap,
struct bt_bap_pac *lpac,
struct bt_bap_pac *rpac,
struct bt_bap_qos *pqos,
- struct iovec *data,
- bt_bap_stream_func_t func,
- void *user_data)
+ struct iovec *data)
{
struct bt_bap_stream *stream;
struct bt_bap_endpoint *ep;
struct match_pac match;
- int id;
if (!bap || !bap->rdb || queue_isempty(bap->remote_eps))
return NULL;
if (!stream)
stream = bap_stream_new(bap, ep, lpac, rpac, data, true);
- id = bt_bap_stream_config(stream, pqos, data, func, user_data);
- if (!id) {
- DBG(bap, "Unable to config stream");
- queue_remove(bap->streams, stream);
- ep->stream = NULL;
- free(stream);
- return NULL;
- }
-
return stream;
}
diff --git a/src/shared/bap.h b/src/shared/bap.h
index 47a1563..bd13abe 100644
--- a/src/shared/bap.h
+++ b/src/shared/bap.h
int bt_bap_select(struct bt_bap_pac *lpac, struct bt_bap_pac *rpac,
bt_bap_pac_select_t func, void *user_data);
-struct bt_bap_stream *bt_bap_config(struct bt_bap *bap,
+struct bt_bap_stream *bt_bap_stream_new(struct bt_bap *bap,
struct bt_bap_pac *lpac,
struct bt_bap_pac *rpac,
struct bt_bap_qos *pqos,
- struct iovec *data,
- bt_bap_stream_func_t func,
- void *user_data);
+ struct iovec *data);
struct bt_bap *bt_bap_stream_get_session(struct bt_bap_stream *stream);
uint8_t bt_bap_stream_get_state(struct bt_bap_stream *stream);