Hi Simon,

<snip>

@@ -123,14 +168,24 @@ static DBusMessage *profile_new_connection(DBusConnection 
*conn,

        ofono_emulator_register(em, fd);

-       fd_dup = dup(fd);
-       io = g_io_channel_unix_new(fd_dup);
+       io = g_io_channel_unix_new(fd);

The comment in commit 9332299b indicates that a dup() was needed to properly detect HUP events. Can you double check that this change is indeed correct?

        g_io_add_watch_full(io, G_PRIORITY_DEFAULT, G_IO_HUP, io_hup_cb,
                                                g_strdup(device), g_free);
        g_io_channel_unref(io);

-       g_hash_table_insert(connection_hash, g_strdup(device),
-                                               GINT_TO_POINTER(fd_dup));
+       dev = g_new0(struct device_info, 1);
+       dev->fd = fd;
+
+       dev->card = ofono_handsfree_card_create(0,
+                                       OFONO_HANDSFREE_CARD_TYPE_GATEWAY,
+                                       NULL, NULL);
+
+       ofono_handsfree_card_set_local(dev->card, local);
+       ofono_handsfree_card_set_remote(dev->card, remote);
+
+       g_hash_table_insert(connection_hash, g_strdup(device), dev);
+
+       ofono_handsfree_card_register(dev->card);


On HFP 1.6 and 1.7, the audio should not be triggered until SLC is established. Whats your plan to ensure that PulseAudio does not start using the audio device until then? FYI, the earlier attempt to add AG support had src/emulator.c make the ofono_handsfree_card_register() call at the appropriate time.

Regards,
-Denis
_______________________________________________
ofono mailing list
[email protected]
https://lists.ofono.org/mailman/listinfo/ofono

Reply via email to