mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2025-01-24 13:23:29 +08:00
audio/A2DP: Add implemention of SEP close indication
This commit is contained in:
parent
7f2f807a69
commit
4ae4b66c99
@ -514,6 +514,12 @@ static void setup_free(void *data)
|
||||
g_free(setup);
|
||||
}
|
||||
|
||||
static void setup_remove(struct a2dp_setup *setup)
|
||||
{
|
||||
setups = g_slist_remove(setups, setup);
|
||||
setup_free(setup);
|
||||
}
|
||||
|
||||
static void setup_add(struct a2dp_device *dev, struct a2dp_endpoint *endpoint,
|
||||
struct a2dp_preset *preset, struct avdtp_stream *stream)
|
||||
{
|
||||
@ -615,10 +621,35 @@ static gboolean sep_open_ind(struct avdtp *session, struct avdtp_local_sep *sep,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean sep_close_ind(struct avdtp *session,
|
||||
struct avdtp_local_sep *sep,
|
||||
struct avdtp_stream *stream,
|
||||
uint8_t *err,
|
||||
void *user_data)
|
||||
{
|
||||
struct a2dp_endpoint *endpoint = user_data;
|
||||
struct a2dp_setup *setup;
|
||||
|
||||
DBG("");
|
||||
|
||||
setup = find_setup(endpoint->id);
|
||||
if (!setup) {
|
||||
error("Unable to find stream setup for endpoint %u",
|
||||
endpoint->id);
|
||||
*err = AVDTP_SEP_NOT_IN_USE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
setup_remove(setup);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static struct avdtp_sep_ind sep_ind = {
|
||||
.get_capability = sep_getcap_ind,
|
||||
.set_configuration = sep_setconf_ind,
|
||||
.open = sep_open_ind,
|
||||
.close = sep_close_ind,
|
||||
};
|
||||
|
||||
static uint8_t register_endpoint(const uint8_t *uuid, uint8_t codec,
|
||||
|
Loading…
Reference in New Issue
Block a user