3 * BlueZ - Bluetooth protocol stack for Linux
5 * Copyright (C) 2006-2010 Nokia Corporation
6 * Copyright (C) 2004-2010 Marcel Holtmann <marcel@holtmann.org>
7 * Copyright (C) 2011 BMW Car IT GmbH. All rights reserved.
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 typedef void (*a2dp_endpoint_select_t) (struct a2dp_setup *setup, void *ret,
31 typedef void (*a2dp_endpoint_config_t) (struct a2dp_setup *setup, gboolean ret);
33 struct a2dp_endpoint {
34 const char *(*get_name) (struct a2dp_sep *sep, void *user_data);
35 size_t (*get_capabilities) (struct a2dp_sep *sep,
36 uint8_t **capabilities,
38 int (*select_configuration) (struct a2dp_sep *sep,
39 uint8_t *capabilities,
41 struct a2dp_setup *setup,
42 a2dp_endpoint_select_t cb,
44 int (*set_configuration) (struct a2dp_sep *sep,
45 uint8_t *configuration,
47 struct a2dp_setup *setup,
48 a2dp_endpoint_config_t cb,
50 void (*clear_configuration) (struct a2dp_sep *sep, void *user_data);
51 void (*set_delay) (struct a2dp_sep *sep, uint16_t delay,
55 typedef void (*a2dp_discover_cb_t) (struct avdtp *session, GSList *seps,
56 struct avdtp_error *err,
58 typedef void (*a2dp_select_cb_t) (struct avdtp *session,
59 struct a2dp_sep *sep, GSList *caps,
61 typedef void (*a2dp_config_cb_t) (struct avdtp *session, struct a2dp_sep *sep,
62 struct avdtp_stream *stream,
63 struct avdtp_error *err,
65 typedef void (*a2dp_stream_cb_t) (struct avdtp *session,
66 struct avdtp_error *err,
69 struct a2dp_sep *a2dp_add_sep(struct btd_adapter *adapter, uint8_t type,
70 uint8_t codec, gboolean delay_reporting,
71 struct a2dp_endpoint *endpoint,
72 void *user_data, GDestroyNotify destroy,
74 void a2dp_remove_sep(struct a2dp_sep *sep);
77 unsigned int a2dp_discover(struct avdtp *session, a2dp_discover_cb_t cb,
79 unsigned int a2dp_select_capabilities(struct avdtp *session,
80 uint8_t type, const char *sender,
83 unsigned int a2dp_config(struct avdtp *session, struct a2dp_sep *sep,
84 a2dp_config_cb_t cb, GSList *caps,
86 unsigned int a2dp_resume(struct avdtp *session, struct a2dp_sep *sep,
87 a2dp_stream_cb_t cb, void *user_data);
88 unsigned int a2dp_suspend(struct avdtp *session, struct a2dp_sep *sep,
89 a2dp_stream_cb_t cb, void *user_data);
90 gboolean a2dp_cancel(unsigned int id);
92 gboolean a2dp_sep_lock(struct a2dp_sep *sep, struct avdtp *session);
93 gboolean a2dp_sep_unlock(struct a2dp_sep *sep, struct avdtp *session);
94 struct avdtp_stream *a2dp_sep_get_stream(struct a2dp_sep *sep);
95 struct btd_device *a2dp_setup_get_device(struct a2dp_setup *setup);
96 struct avdtp *a2dp_avdtp_get(struct btd_device *device);