1 #ifndef foobluetoothutilhfoo
2 #define foobluetoothutilhfoo
5 This file is part of PulseAudio.
7 Copyright 2008 Joao Paulo Rechi Vita
9 PulseAudio is free software; you can redistribute it and/or modify
10 it under the terms of the GNU Lesser General Public License as
11 published by the Free Software Foundation; either version 2 of the
12 License, or (at your option) any later version.
14 PulseAudio is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 General Public License for more details.
19 You should have received a copy of the GNU Lesser General Public
20 License along with PulseAudio; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
25 #include <dbus/dbus.h>
27 #include <pulsecore/llist.h>
28 #include <pulsecore/macro.h>
29 #include <pulsecore/core-util.h>
31 typedef struct pa_bluetooth_uuid pa_bluetooth_uuid
;
32 typedef struct pa_bluetooth_device pa_bluetooth_device
;
33 typedef struct pa_bluetooth_discovery pa_bluetooth_discovery
;
37 struct pa_bluetooth_uuid
{
39 PA_LLIST_FIELDS(pa_bluetooth_uuid
);
42 struct pa_bluetooth_device
{
43 void *data
; /* arbitrary information for the one owning the discovery object */
45 int device_info_valid
; /* 0: no results yet; 1: good results; -1: bad results ... */
46 int audio_sink_info_valid
; /* ... same here ... */
47 int headset_info_valid
; /* ... and here */
49 /* Device information */
55 PA_LLIST_HEAD(pa_bluetooth_uuid
, uuids
);
60 /* AudioSink information */
61 int audio_sink_connected
;
63 /* Headset information */
64 int headset_connected
;
67 void pa_bluetooth_device_free(pa_bluetooth_device
*d
);
69 pa_bluetooth_device
* pa_bluetooth_get_device(DBusConnection
*c
, const char* path
);
70 pa_bluetooth_device
* pa_bluetooth_find_device(DBusConnection
*c
, const char* address
);
72 typedef void (*pa_bluetooth_device_callback_t
)(struct userdata
*u
, pa_bluetooth_device
*d
, pa_bool_t good
);
73 pa_bluetooth_discovery
* pa_bluetooth_discovery_new(DBusConnection
*c
, pa_bluetooth_device_callback_t cb
, struct userdata
*u
);
74 void pa_bluetooth_discovery_free(pa_bluetooth_discovery
*d
);
75 void pa_bluetooth_discovery_sync(pa_bluetooth_discovery
*d
);
77 const char*pa_bluetooth_get_form_factor(uint32_t class);
79 char *pa_bluetooth_cleanup_name(const char *name
);