From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH -v3 2/3] phonesim: Add modem reset trigger
Date: Tue, 23 Nov 2010 04:59:33 -0600 [thread overview]
Message-ID: <4CEB9E95.8000703@gmail.com> (raw)
In-Reply-To: <1290202590-23190-2-git-send-email-padovan@profusion.mobi>
[-- Attachment #1: Type: text/plain, Size: 1220 bytes --]
Hi Gustavo,
On 11/19/2010 03:36 PM, Gustavo F. Padovan wrote:
> ---
> plugins/phonesim.c | 10 ++++++++++
> 1 files changed, 10 insertions(+), 0 deletions(-)
>
> diff --git a/plugins/phonesim.c b/plugins/phonesim.c
> index d2faf42..7426da6 100644
> --- a/plugins/phonesim.c
> +++ b/plugins/phonesim.c
> @@ -237,6 +237,13 @@ static void cfun_set_on_cb(gboolean ok, GAtResult *result, gpointer user_data)
> ofono_modem_set_powered(modem, ok);
> }
>
> +static void crst_notify(GAtResult *result, gpointer user_data)
> +{
> + struct ofono_modem *modem = user_data;
> +
> + ofono_modem_reset(modem);
I suggest you simply clean up the phonesim connection (e.g. closing the
tcp socket) when you receive this notification, and then call
modem_reset at the end.
> +}
> +
> static void phonesim_disconnected(gpointer user_data)
> {
> struct ofono_modem *modem = user_data;
> @@ -389,6 +396,9 @@ static int phonesim_enable(struct ofono_modem *modem)
> g_at_chat_send(data->chat, "AT+CSCS=\"GSM\"", none_prefix,
> NULL, NULL, NULL);
>
> + g_at_chat_register(data->chat, "+CRST:",
> + crst_notify, FALSE, modem, NULL);
> +
> return 0;
> }
>
Regards,
-Denis
next prev parent reply other threads:[~2010-11-23 10:59 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-19 21:36 [PATCH -v3 1/3] Add ofono_modem_reset() Gustavo F. Padovan
2010-11-19 21:36 ` [PATCH -v3 2/3] phonesim: Add modem reset trigger Gustavo F. Padovan
2010-11-19 21:36 ` [PATCH -v3 3/3] modem: add support to restore state when resetting the modem Gustavo F. Padovan
2010-11-23 11:04 ` Denis Kenzior
2010-11-23 17:50 ` Gustavo F. Padovan
2010-11-23 21:33 ` Gustavo F. Padovan
2010-11-23 22:07 ` Denis Kenzior
2010-11-23 10:59 ` Denis Kenzior [this message]
2010-11-23 20:01 ` [PATCH -v3 2/3] phonesim: Add modem reset trigger Gustavo F. Padovan
2010-11-23 21:52 ` Denis Kenzior
2010-11-23 10:57 ` [PATCH -v3 1/3] Add ofono_modem_reset() Denis Kenzior
2010-11-23 17:41 ` Gustavo F. Padovan
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=4CEB9E95.8000703@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.