Hi Claudio,
On Fri, Mar 08, 2013, Claudio Takahasi wrote:
> This patch adds the call of NewConnection method when the SCO connection
> is established for HF initiated scenarios.
> ---
> src/handsfree-audio.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/src/handsfree-audio.c b/src/handsfree-audio.c
> index f5d0a7b..6fa8b67 100644
> --- a/src/handsfree-audio.c
> +++ b/src/handsfree-audio.c
> @@ -242,12 +242,19 @@ static gboolean sco_connect_cb(GIOChannel *io,
> GIOCondition cond,
> {
> struct ofono_handsfree_card *card = user_data;
> DBusMessage *reply;
> + int sk;
>
> if (cond & (G_IO_ERR | G_IO_HUP | G_IO_NVAL)) {
> reply = __ofono_error_failed(card->msg);
> goto done;
> }
>
> + sk = g_io_channel_unix_get_fd(io);
> +
> + send_new_connection(card->path, sk);
> +
> + close(sk);
> +
> reply = dbus_message_new_method_return(card->msg);
Shouldn't you be adding a watch for the connected SCO socket instead of
closing it? Is it not necessary for oFono to know the SCO state? (to
detect when PA did shutdown() on the socket, return "already connected"
for Connect(), etc.)
Johan
_______________________________________________
ofono mailing list
[email protected]
http://lists.ofono.org/listinfo/ofono