From 8f3ef04b4310bfbbe0aa8042585340e1832cacf6 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Thu, 7 Oct 2010 17:22:41 +0300 Subject: bluetooth: Add support for Media API Make use of D-Bus to transfer file descriptors. --- src/modules/bluetooth/bluetooth-util.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/modules/bluetooth/bluetooth-util.h') diff --git a/src/modules/bluetooth/bluetooth-util.h b/src/modules/bluetooth/bluetooth-util.h index 9cee3de3..ce551967 100644 --- a/src/modules/bluetooth/bluetooth-util.h +++ b/src/modules/bluetooth/bluetooth-util.h @@ -25,6 +25,7 @@ #include #include +#include #include #include @@ -45,6 +46,7 @@ typedef struct pa_bluetooth_uuid pa_bluetooth_uuid; typedef struct pa_bluetooth_device pa_bluetooth_device; typedef struct pa_bluetooth_discovery pa_bluetooth_discovery; +typedef struct pa_bluetooth_transport pa_bluetooth_transport; struct userdata; @@ -53,6 +55,23 @@ struct pa_bluetooth_uuid { PA_LLIST_FIELDS(pa_bluetooth_uuid); }; +enum profile { + PROFILE_A2DP, + PROFILE_A2DP_SOURCE, + PROFILE_HSP, + PROFILE_HFGW, + PROFILE_OFF +}; + +struct pa_bluetooth_transport { + pa_bluetooth_discovery *y; + char *path; + enum profile profile; + uint8_t codec; + uint8_t *config; + int config_size; +}; + /* This enum is shared among Audio, Headset, AudioSink, and AudioSource, although not all values are acceptable in all profiles */ typedef enum pa_bt_audio_state { PA_BT_AUDIO_STATE_INVALID = -1, @@ -70,6 +89,7 @@ struct pa_bluetooth_device { /* Device information */ char *name; char *path; + pa_hashmap *transports; int paired; char *alias; int device_connected; @@ -103,6 +123,12 @@ void pa_bluetooth_discovery_sync(pa_bluetooth_discovery *d); const pa_bluetooth_device* pa_bluetooth_discovery_get_by_path(pa_bluetooth_discovery *d, const char* path); const pa_bluetooth_device* pa_bluetooth_discovery_get_by_address(pa_bluetooth_discovery *d, const char* address); +const pa_bluetooth_transport* pa_bluetooth_discovery_get_transport(pa_bluetooth_discovery *y, const char *path); +const pa_bluetooth_transport* pa_bluetooth_device_get_transport(const pa_bluetooth_device *d, enum profile profile); + +int pa_bluetooth_transport_acquire(const pa_bluetooth_transport *t, const char *accesstype); +void pa_bluetooth_transport_release(const pa_bluetooth_transport *t, const char *accesstype); + pa_hook* pa_bluetooth_discovery_hook(pa_bluetooth_discovery *d); const char* pa_bluetooth_get_form_factor(uint32_t class); -- cgit