}
static int hf_audio_agent_transport_acquire(pa_bluetooth_transport *t, bool optional, size_t *imtu, size_t *omtu) {
- return -1;
+ hf_audio_agent_data *hfdata = t->userdata;
+ hf_audio_card *hfac = pa_hashmap_get(hfdata->hf_audio_cards, t->path);
+
+ if (!optional) {
+ DBusMessage *m;
+
+ pa_assert_se(m = dbus_message_new_method_call(t->owner, t->path, "org.ofono.HandsfreeAudioCard", "Connect"));
+ pa_assert_se(dbus_connection_send(pa_dbus_connection_get(hfdata->connection), m, NULL));
+
+ return -1;
+ }
+
+ /* The correct block size should take into account the SCO MTU from
+ * the Bluetooth adapter and (for adapters in the USB bus) the MxPS
+ * value from the Isoc USB endpoint in use by btusb and should be
+ * made available to userspace by the Bluetooth kernel subsystem.
+ * Meanwhile the empiric value 48 will be used. */
+ if (imtu)
+ *imtu = 48;
+ if (omtu)
+ *omtu = 48;
+
+ if (hfac) {
+ t->codec = hfac->codec;
+ return hfac->fd;
+ } else
+ return -1;
}
static void hf_audio_agent_transport_release(pa_bluetooth_transport *t) {