]> code.delx.au - pulseaudio/blob - src/modules/bluetooth/bluetooth-util.h
Updated catalan po
[pulseaudio] / src / modules / bluetooth / bluetooth-util.h
1 #ifndef foobluetoothutilhfoo
2 #define foobluetoothutilhfoo
3
4 /***
5 This file is part of PulseAudio.
6
7 Copyright 2008 Joao Paulo Rechi Vita
8
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.
13
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.
18
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
22 USA.
23 ***/
24
25 #include <dbus/dbus.h>
26
27 #include <pulsecore/llist.h>
28 #include <pulsecore/macro.h>
29 #include <pulsecore/core-util.h>
30
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;
34
35 struct userdata;
36
37 struct pa_bluetooth_uuid {
38 char *uuid;
39 PA_LLIST_FIELDS(pa_bluetooth_uuid);
40 };
41
42 struct pa_bluetooth_device {
43 void *data; /* arbitrary information for the one owning the discovery object */
44
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 */
48
49 /* Device information */
50 char *name;
51 char *path;
52 int paired;
53 char *alias;
54 int device_connected;
55 PA_LLIST_HEAD(pa_bluetooth_uuid, uuids);
56 char *address;
57 int class;
58 int trusted;
59
60 /* AudioSink information */
61 int audio_sink_connected;
62
63 /* Headset information */
64 int headset_connected;
65 };
66
67 void pa_bluetooth_device_free(pa_bluetooth_device *d);
68
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);
71
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);
76
77 const char*pa_bluetooth_get_form_factor(uint32_t class);
78
79 char *pa_bluetooth_cleanup_name(const char *name);
80
81 #endif