summaryrefslogtreecommitdiffstats
path: root/src/modules/bluetooth/bluetooth-util.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.dentz-von@nokia.com>2010-12-02 14:11:13 +0200
committerLuiz Augusto von Dentz <luiz.dentz-von@nokia.com>2011-03-14 13:36:55 -0300
commit8c982a4afece524fec5d928425477f3e7a56b817 (patch)
tree6040913f80d46e290b4083bd25f713b2ef6e7957 /src/modules/bluetooth/bluetooth-util.c
parentdda564f50b55340ff4bfbaa8d6d6fc6427f764f4 (diff)
bluetooth: handle Acquire API change
Acquire now return input and output MTU of the file descriptor so it is no longer necessary to get those after acquiring the fd, which less round trips and faster response time when switching profiles.
Diffstat (limited to 'src/modules/bluetooth/bluetooth-util.c')
-rw-r--r--src/modules/bluetooth/bluetooth-util.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/modules/bluetooth/bluetooth-util.c b/src/modules/bluetooth/bluetooth-util.c
index e6f6e17e..17ba1302 100644
--- a/src/modules/bluetooth/bluetooth-util.c
+++ b/src/modules/bluetooth/bluetooth-util.c
@@ -934,10 +934,11 @@ const pa_bluetooth_transport* pa_bluetooth_device_get_transport(const pa_bluetoo
return NULL;
}
-int pa_bluetooth_transport_acquire(const pa_bluetooth_transport *t, const char *accesstype) {
+int pa_bluetooth_transport_acquire(const pa_bluetooth_transport *t, const char *accesstype, size_t *imtu, size_t *omtu) {
DBusMessage *m, *r;
DBusError err;
int ret;
+ uint16_t i, o;
pa_assert(t);
pa_assert(t->y);
@@ -955,7 +956,7 @@ int pa_bluetooth_transport_acquire(const pa_bluetooth_transport *t, const char *
}
#ifdef DBUS_TYPE_UNIX_FD
- if (!dbus_message_get_args(r, &err, DBUS_TYPE_UNIX_FD, &ret, DBUS_TYPE_INVALID)) {
+ if (!dbus_message_get_args(r, &err, DBUS_TYPE_UNIX_FD, &ret, DBUS_TYPE_UINT16, &i, DBUS_TYPE_UINT16, &o, DBUS_TYPE_INVALID)) {
pa_log("Failed to parse org.bluez.MediaTransport.Acquire(): %s", err.message);
ret = -1;
dbus_error_free(&err);
@@ -963,6 +964,12 @@ int pa_bluetooth_transport_acquire(const pa_bluetooth_transport *t, const char *
}
#endif
+ if (imtu)
+ *imtu = i;
+
+ if (omtu)
+ *omtu = o;
+
fail:
dbus_message_unref(r);
return ret;