bluetooth: Add state to transport objects

Transport objects have an associated state even though it's not
explicitly exposed in BlueZ's D-Bus API (prior to 5.0). Instead, the
state is implicitly represented in the profile-specific D-Bus interface
(i.e. org.bluez.Headset, org.bluez.AudioSink, etc.) but it can be
convenient that bluetooth-util would abstract this separation.
This commit is contained in:
Mikel Astiz 2012-12-10 08:30:38 +01:00 committed by Tanu Kaskinen
parent ab26cafaf4
commit 439745505a
2 changed files with 33 additions and 0 deletions

View file

@ -84,6 +84,12 @@ typedef enum pa_bluetooth_transport_hook {
PA_BLUETOOTH_TRANSPORT_HOOK_MAX
} pa_bluetooth_transport_hook_t;
typedef enum pa_bluetooth_transport_state {
PA_BLUETOOTH_TRANSPORT_STATE_DISCONNECTED,
PA_BLUETOOTH_TRANSPORT_STATE_IDLE, /* Connected but not playing */
PA_BLUETOOTH_TRANSPORT_STATE_PLAYING
} pa_bluetooth_transport_state_t;
struct pa_bluetooth_transport {
pa_bluetooth_device *device;
char *owner;
@ -92,6 +98,8 @@ struct pa_bluetooth_transport {
uint8_t codec;
uint8_t *config;
int config_size;
pa_bluetooth_transport_state_t state;
pa_bool_t nrec;
pa_hook hooks[PA_BLUETOOTH_TRANSPORT_HOOK_MAX];