From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH 4/4] hfp: set timeout service level connection procedure
Date: Fri, 05 Feb 2010 13:54:34 -0600 [thread overview]
Message-ID: <201002051354.34983.denkenz@gmail.com> (raw)
In-Reply-To: <1326572835-9013-1-git-send-email-padovan@profusion.mobi>
[-- Attachment #1: Type: text/plain, Size: 2736 bytes --]
Hi Gustavo,
> If it expires we call org.bluez.HandsfreeGateway.Disconnect()
> ---
> drivers/hfpmodem/hfpmodem.h | 1 +
> plugins/hfp.c | 27 +++++++++++++++++++++++++++
> 2 files changed, 28 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/hfpmodem/hfpmodem.h b/drivers/hfpmodem/hfpmodem.h
> index 6ec8a7c..deb6399 100644
> --- a/drivers/hfpmodem/hfpmodem.h
> +++ b/drivers/hfpmodem/hfpmodem.h
> @@ -71,6 +71,7 @@ struct hfp_data {
> unsigned int hf_features;
> unsigned char cind_pos[HFP_INDICATOR_LAST];
> unsigned int cind_val[HFP_INDICATOR_LAST];
> + unsigned int connect_to;
Don't need to use g_source for this, see below.
> };
>
> extern void hfp_netreg_init();
> diff --git a/plugins/hfp.c b/plugins/hfp.c
> index d0af7e8..0c1c508 100644
> --- a/plugins/hfp.c
> +++ b/plugins/hfp.c
> @@ -99,6 +99,8 @@ static void sevice_level_conn_established(struct
> ofono_modem *modem) dbus_message_unref(data->slc_msg);
> data->slc_msg = NULL;
>
> + g_source_remove(data->connect_to);
> +
Don't need this
> ofono_info("Service level connection established");
>
> g_at_chat_send(data->chat, "AT+CMEE=1", NULL, NULL, NULL, NULL);
> @@ -118,6 +120,8 @@ static void service_level_conn_failed(struct
> ofono_modem *modem) dbus_message_unref(data->slc_msg);
> data->slc_msg = NULL;
>
> + g_source_remove(data->connect_to);
> +
Or this
> ofono_error("Service level connection failed");
> ofono_modem_set_powered(modem, FALSE);
> clear_data(modem);
> @@ -785,11 +789,34 @@ static int hfp_connect_ofono_handsfree(struct
> ofono_modem *modem) NULL, NULL, DBUS_TYPE_INVALID);
> }
>
> +static gboolean hfp_enable_timeout(gpointer user_data)
> +{
> + struct ofono_modem *modem = user_data;
> + struct hfp_data *data = ofono_modem_get_data(modem);
> + int ret;
> +
> + if (ofono_modem_get_powered(modem))
> + return FALSE;
> +
> + ret = send_method_call(BLUEZ_SERVICE, data->handsfree_path,
> + BLUEZ_GATEWAY_INTERFACE, "Disconnect",
> + NULL, NULL, DBUS_TYPE_INVALID);
> + if (ret < 0)
> + ofono_error("GetProperties failed(%d)", ret);
What does GetProperties have to do here?
> +
> + return FALSE;
> +}
> +
> /* power up hardware */
> static int hfp_enable(struct ofono_modem *modem)
> {
> + struct hfp_data *data = ofono_modem_get_data(modem);
> +
> DBG("%p", modem);
>
> + data->connect_to =
> + g_timeout_add_seconds(15, hfp_enable_timeout, modem);
> +
> if (hfp_connect_ofono_handsfree(modem) < 0)
In hfp_connect_ofono_handsfree, simply set a proper timeout and callback
function. You don't need to use a g_source here@all.
> return -EINVAL;
>
Regards,
-Denis
next prev parent reply other threads:[~2010-02-05 19:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-05 18:47 [PATCH 1/3] hfp: create modem for new devices paired on runtime Gustavo F. Padovan
2010-02-05 18:47 ` [PATCH 2/3] hfp: Don't call UnregisterAgent if a Release was received Gustavo F. Padovan
2010-02-05 18:47 ` [PATCH 3/3] hfp: wait Disconnect reply to power down the modem Gustavo F. Padovan
2010-02-05 19:13 ` [PATCH 4/4] hfp: set timeout service level connection procedure Gustavo F. Padovan
2010-02-05 19:54 ` Denis Kenzior [this message]
2010-02-05 19:37 ` [PATCH 3/3] hfp: wait Disconnect reply to power down the modem Denis Kenzior
2010-02-05 19:37 ` [PATCH 2/3] hfp: Don't call UnregisterAgent if a Release was received Denis Kenzior
2010-02-05 19:36 ` [PATCH 1/3] hfp: create modem for new devices paired on runtime Denis Kenzior
2010-07-08 7:03 ` =?unknown-8bit?q?R=C3=A9mi?= Denis-Courmont
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201002051354.34983.denkenz@gmail.com \
--to=denkenz@gmail.com \
--cc=ofono@ofono.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox