diff options
| author | Lennart Poettering <lennart@poettering.net> | 2009-03-30 20:34:49 +0200 | 
|---|---|---|
| committer | Lennart Poettering <lennart@poettering.net> | 2009-03-30 20:34:49 +0200 | 
| commit | 1390564227a01678f78431cd19e7c2077e962db5 (patch) | |
| tree | 1e406c35a86ac607629597fdf82a4de4c7c84f2d /src/modules/bluetooth/bluetooth-util.h | |
| parent | d33be12fde0910e4a7515c3f6a8b8f2165624cb0 (diff) | |
| parent | 87fcb3d5925cc030e957f55399f8c3e96c66cbb5 (diff) | |
Merge commit 'elmarco/bluetooth-fixes'
Diffstat (limited to 'src/modules/bluetooth/bluetooth-util.h')
| -rw-r--r-- | src/modules/bluetooth/bluetooth-util.h | 39 | 
1 files changed, 33 insertions, 6 deletions
diff --git a/src/modules/bluetooth/bluetooth-util.h b/src/modules/bluetooth/bluetooth-util.h index 1d05e63c..54114738 100644 --- a/src/modules/bluetooth/bluetooth-util.h +++ b/src/modules/bluetooth/bluetooth-util.h @@ -28,6 +28,20 @@  #include <pulsecore/macro.h>  #include <pulsecore/core-util.h> +/* UUID copied from bluez/audio/device.h */ +#define GENERIC_AUDIO_UUID      "00001203-0000-1000-8000-00805F9B34FB" + +#define HSP_HS_UUID             "00001108-0000-1000-8000-00805F9B34FB" +#define HSP_AG_UUID             "00001112-0000-1000-8000-00805F9B34FB" + +#define HFP_HS_UUID             "0000111E-0000-1000-8000-00805F9B34FB" +#define HFP_AG_UUID             "0000111F-0000-1000-8000-00805F9B34FB" + +#define ADVANCED_AUDIO_UUID     "0000110D-0000-1000-8000-00805F9B34FB" + +#define A2DP_SOURCE_UUID        "0000110A-0000-1000-8000-00805F9B34FB" +#define A2DP_SINK_UUID          "0000110B-0000-1000-8000-00805F9B34FB" +  typedef struct pa_bluetooth_uuid pa_bluetooth_uuid;  typedef struct pa_bluetooth_device pa_bluetooth_device;  typedef struct pa_bluetooth_discovery pa_bluetooth_discovery; @@ -39,12 +53,20 @@ struct pa_bluetooth_uuid {      PA_LLIST_FIELDS(pa_bluetooth_uuid);  }; +/* This enum is shared among Audio, Headset, and AudioSink, although not all values are acceptable in all profiles */ +enum pa_bt_audio_state { +    PA_BT_AUDIO_STATE_INVALID = -1, +    PA_BT_AUDIO_STATE_DISCONNECTED, +    PA_BT_AUDIO_STATE_CONNECTING, +    PA_BT_AUDIO_STATE_CONNECTED, +    PA_BT_AUDIO_STATE_PLAYING, +    PA_BT_AUDIO_STATE_LAST +}; +  struct pa_bluetooth_device {      pa_bool_t dead;      int device_info_valid;      /* 0: no results yet; 1: good results; -1: bad results ... */ -    int audio_sink_info_valid;  /* ... same here ... */ -    int headset_info_valid;     /* ... and here */      /* Device information */      char *name; @@ -57,11 +79,14 @@ struct pa_bluetooth_device {      int class;      int trusted; -    /* AudioSink information */ -    int audio_sink_connected; +    /* Audio state */ +    int audio_state; -    /* Headset information */ -    int headset_connected; +    /* AudioSink state */ +    int audio_sink_state; + +    /* Headset state */ +    int headset_state;  };  pa_bluetooth_discovery* pa_bluetooth_discovery_get(pa_core *core); @@ -79,4 +104,6 @@ const char* pa_bluetooth_get_form_factor(uint32_t class);  char *pa_bluetooth_cleanup_name(const char *name); +pa_bool_t pa_bluetooth_uuid_has(pa_bluetooth_uuid *uuids, const char *uuid); +  #endif  | 
