3
3
* BlueZ - Bluetooth protocol stack for Linux
5
* Copyright (C) 2006-2007 Nokia Corporation
6
* Copyright (C) 2004-2009 Marcel Holtmann <marcel@holtmann.org>
5
* Copyright (C) 2006-2010 Nokia Corporation
6
* Copyright (C) 2004-2010 Marcel Holtmann <marcel@holtmann.org>
9
9
* This program is free software; you can redistribute it and/or modify
53
48
#define AVDTP_HEADER_COMPRESSION 0x05
54
49
#define AVDTP_MULTIPLEXING 0x06
55
50
#define AVDTP_MEDIA_CODEC 0x07
51
#define AVDTP_DELAY_REPORTING 0x08
52
#define AVDTP_ERRNO 0xff
57
54
/* AVDTP error definitions */
58
55
#define AVDTP_BAD_HEADER_FORMAT 0x01
131
128
struct avdtp_error *err,
132
129
void *user_data);
131
typedef void (*avdtp_set_configuration_cb) (struct avdtp *session,
132
struct avdtp_stream *stream,
133
struct avdtp_error *err);
134
135
/* Callbacks for when a reply is received to a command that we sent */
135
136
struct avdtp_sep_cfm {
136
137
void (*set_configuration) (struct avdtp *session,
162
163
struct avdtp_local_sep *lsep,
163
164
struct avdtp_stream *stream,
164
165
struct avdtp_error *err, void *user_data);
166
void (*delay_report) (struct avdtp *session, struct avdtp_local_sep *lsep,
167
struct avdtp_stream *stream,
168
struct avdtp_error *err, void *user_data);
167
171
/* Callbacks for indicating when we received a new command. The return value
169
173
struct avdtp_sep_ind {
170
174
gboolean (*get_capability) (struct avdtp *session,
171
175
struct avdtp_local_sep *sep,
172
177
GSList **caps, uint8_t *err,
173
178
void *user_data);
174
179
gboolean (*set_configuration) (struct avdtp *session,
175
180
struct avdtp_local_sep *lsep,
176
181
struct avdtp_stream *stream,
177
GSList *caps, uint8_t *err,
178
uint8_t *category, void *user_data);
183
avdtp_set_configuration_cb cb,
179
185
gboolean (*get_configuration) (struct avdtp *session,
180
186
struct avdtp_local_sep *lsep,
181
187
uint8_t *err, void *user_data);
198
204
gboolean (*reconfigure) (struct avdtp *session,
199
205
struct avdtp_local_sep *lsep,
200
206
uint8_t *err, void *user_data);
207
gboolean (*delayreport) (struct avdtp *session,
208
struct avdtp_local_sep *lsep,
209
uint8_t rseid, uint16_t delay,
210
uint8_t *err, void *user_data);
203
213
typedef void (*avdtp_discover_cb_t) (struct avdtp *session, GSList *seps,
223
233
struct avdtp_service_capability *avdtp_get_codec(struct avdtp_remote_sep *sep);
235
gboolean avdtp_get_delay_reporting(struct avdtp_remote_sep *sep);
225
237
struct avdtp_stream *avdtp_get_stream(struct avdtp_remote_sep *sep);
227
239
int avdtp_discover(struct avdtp *session, avdtp_discover_cb_t cb,
264
276
struct avdtp_stream *stream);
265
277
int avdtp_start(struct avdtp *session, struct avdtp_stream *stream);
266
278
int avdtp_suspend(struct avdtp *session, struct avdtp_stream *stream);
267
int avdtp_close(struct avdtp *session, struct avdtp_stream *stream);
279
int avdtp_close(struct avdtp *session, struct avdtp_stream *stream,
268
281
int avdtp_abort(struct avdtp *session, struct avdtp_stream *stream);
282
int avdtp_delay_report(struct avdtp *session, struct avdtp_stream *stream,
270
285
struct avdtp_local_sep *avdtp_register_sep(const bdaddr_t *src, uint8_t type,
271
286
uint8_t media_type,
272
287
uint8_t codec_type,
288
gboolean delay_reporting,
273
289
struct avdtp_sep_ind *ind,
274
290
struct avdtp_sep_cfm *cfm,
275
291
void *user_data);
277
293
/* Find a matching pair of local and remote SEP ID's */
278
int avdtp_get_seps(struct avdtp *session, uint8_t type, uint8_t media,
279
uint8_t codec, struct avdtp_local_sep **lsep,
280
struct avdtp_remote_sep **rsep);
294
struct avdtp_remote_sep *avdtp_find_remote_sep(struct avdtp *session,
295
struct avdtp_local_sep *lsep);
282
297
int avdtp_unregister_sep(struct avdtp_local_sep *sep);
286
301
void avdtp_error_init(struct avdtp_error *err, uint8_t type, int id);
287
302
const char *avdtp_strerror(struct avdtp_error *err);
288
avdtp_error_type_t avdtp_error_type(struct avdtp_error *err);
303
uint8_t avdtp_error_category(struct avdtp_error *err);
289
304
int avdtp_error_error_code(struct avdtp_error *err);
290
305
int avdtp_error_posix_errno(struct avdtp_error *err);
294
309
void avdtp_set_auto_disconnect(struct avdtp *session, gboolean auto_dc);
295
310
gboolean avdtp_stream_setup_active(struct avdtp *session);
311
void avdtp_set_device_disconnect(struct avdtp *session, gboolean dev_dc);
297
int avdtp_init(const bdaddr_t *src, GKeyFile *config);
313
int avdtp_init(const bdaddr_t *src, GKeyFile *config, uint16_t *version);
298
314
void avdtp_exit(const bdaddr_t *src);