Commit graph

21 commits

Author SHA1 Message Date
João Paulo Rechi Vita
82fd8cc845 bluetooth: Protect from a misbehaving bluetoothd
bluetoothd always send the GetManagedObjects() reply messages with the
objects array argument following an in-depth order starting from the
root. That means parents will always be known at the time their children
objects are parsed, if clients parse the objects in the same order they
appear in the array, as we do in PulseAudio.

This commit tries to protect PulseAudio in the case bluetoothd changes
that behavior for some reason. It hasn't been tested, since this
situation never occurs.
2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
89e97215c7 bluetooth: Parse BlueZ 5 device properties
This code is based on previous work by Mikel Astiz.
2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
877f0a7d54 bluetooth: Handle PropertiesChanged for org.bluez.Adapter1 2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
a59177e666 bluetooth: Register endpoints with BlueZ 5 adapter 2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
42dccb6b37 bluetooth: Parse BlueZ 5 adapter properties 2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
f1d8958fb6 bluetooth: Parse BlueZ 5 D-Bus interfaces
Parse the arguments of the InterfacesAdded signal and the
GetManagedObjects() reply.

This code is based on previous work by Mikel Astiz.
2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
878eccb680 bluetooth: Handle InterfacesAdded and InterfacesRemoved
This code is based on previous work by Mikel Astiz.
2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
1e58120a5c bluetooth: Create a function to remove only one adapter object 2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
b8edddddd3 bluetooth: Get managed objects
Get objects from the BlueZ 5 object manager. This code is based on
previous work by Mikel Astiz.
2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
d186d0f105 bluetooth: Add utility function to send D-Bus messages with reply 2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
63108c5cc8 bluetooth: Implement org.bluez.MediaEndpoint1.ClearConfiguration() 2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
2594909338 bluetooth: Implement org.bluez.MediaEndpoint1.SelectConfiguration() 2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
449d6cb1e2 bluetooth: Implement org.bluez.MediaEndpoint1.SetConfiguration() 2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
aff6fa79ba bluetooth: Register MediaEndpoint1 objects with D-Bus 2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
e78e7e698c bluetooth: Create pa_bluetooth_transport for BlueZ 5 support
Create the pa_bluetooth_transport structure to store information about
the bluetooth transport and utility functions to manipulate this
structure. The acquire() and release() operations are function pointers
in the pa_bluetooth_transport structure to make possible for different
transport backends to provide different implementations of these
operations. Thre is also a userdata field for the transport backend
provide data for the acquire/release functions.

This commit also creates a new function
pa_bluetooth_device_any_transport_connected() to check if there is any
audio connection between the host and a remote device.
2013-09-29 16:54:37 +03:00
João Paulo Rechi Vita
c3efb24aa7 bluetooth: Remove all devices and adapters when org.bluez goes away 2013-09-29 16:54:36 +03:00
João Paulo Rechi Vita
9be71b5838 bluetooth: Create pa_bluetooth_device for BlueZ 5 support
Create a structure pa_bluetooth_device to store information about the
bluetooth device and utility functions to manipulate this structure.
2013-09-29 16:54:36 +03:00
João Paulo Rechi Vita
546da17cbe bluetooth: Create pa_bluetooth_adapter for BlueZ 5 support 2013-09-29 16:54:36 +03:00
João Paulo Rechi Vita
19a23cef10 bluetooth: Create infrastrucure for bluetooth hooks
Create a pa_bluetooth_hook enum type and API to get pa_hooks from the
opaque pa_bluetooth_discovery struct.
2013-09-29 16:54:36 +03:00
João Paulo Rechi Vita
dcc28a23f9 bluetooth: Track org.bluez for BlueZ 5 2013-09-29 16:54:36 +03:00
João Paulo Rechi Vita
0103cd1379 bluetooth: Create pa_bluetooth_discovery for BlueZ 5
pa_bluetooth_discovery is the struct that holds information about known
Bluetooth audio devices and other information about the Bluetooth stack.

This commit also creates bluez5-util.[ch], which will hold a lot of
utility functions to help with the BlueZ 5 support.
2013-09-29 16:54:36 +03:00