From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH -v4 04/21] telit: add telit_sap_disable()
Date: Tue, 27 Sep 2011 23:34:30 -0500 [thread overview]
Message-ID: <4E82A3D6.4010704@gmail.com> (raw)
In-Reply-To: <1317157460-17012-4-git-send-email-padovan@profusion.mobi>
[-- Attachment #1: Type: text/plain, Size: 2172 bytes --]
Hi Gustavo,
On 09/27/2011 04:04 PM, Gustavo F. Padovan wrote:
> From: "Gustavo F. Padovan" <padovan@profusion.mobi>
>
> Support to disable the SAP modem from the sap plugin
> ---
> plugins/bluetooth.h | 1 +
> plugins/telit.c | 30 ++++++++++++++++++++++++++++++
> 2 files changed, 31 insertions(+), 0 deletions(-)
>
> diff --git a/plugins/bluetooth.h b/plugins/bluetooth.h
> index 6cde7bc..96e3215 100644
> --- a/plugins/bluetooth.h
> +++ b/plugins/bluetooth.h
> @@ -46,6 +46,7 @@ struct bluetooth_profile {
> struct bluetooth_sap_driver {
> const char *name;
> int (*enable) (struct ofono_modem *modem);
> + int (*disable) (struct ofono_modem *modem);
> };
>
> struct server;
> diff --git a/plugins/telit.c b/plugins/telit.c
> index a5f9941..b9a5b23 100644
> --- a/plugins/telit.c
> +++ b/plugins/telit.c
> @@ -139,6 +139,20 @@ static void rsen_enable_cb(gboolean ok, GAtResult *result, gpointer user_data)
> }
> }
>
> +static void rsen_disable_cb(gboolean ok, GAtResult *result, gpointer user_data)
> +{
> + struct ofono_modem *modem = user_data;
> + struct telit_data *data = ofono_modem_get_data(modem);
> +
> + DBG("%p", modem);
> +
> + g_at_chat_unref(data->chat);
> + data->chat = NULL;
> +
> + if (ok)
> + ofono_modem_set_powered(modem, FALSE);
> +}
> +
> static int telit_sap_open()
> {
> const char *device = "/dev/ttyUSB4";
> @@ -191,9 +205,25 @@ static int telit_sap_enable(struct ofono_modem *modem)
> return fd;
> }
>
> +static int telit_sap_disable(struct ofono_modem *modem)
> +{
> + struct telit_data *data = ofono_modem_get_data(modem);
> +
> + DBG("%p", modem);
> +
> + g_at_chat_cancel_all(data->chat);
> + g_at_chat_unregister_all(data->chat);
> +
> + g_at_chat_send(data->chat, "AT#RSEN=0", rsen_prefix,
> + rsen_disable_cb, modem, NULL);
> +
> + return 0;
Do you mean to return -EINPROGRESS here?
> +}
> +
> static struct bluetooth_sap_driver sap_driver = {
> .name = "telit",
> .enable = telit_sap_enable,
> + .disable = telit_sap_disable,
> };
>
> static int telit_probe(struct ofono_modem *modem)
Regards,
-Denis
prev parent reply other threads:[~2011-09-28 4:34 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-27 21:04 [PATCH -v4 01/21] udevng: look also to VID Gustavo F. Padovan
2011-09-27 21:04 ` [PATCH -v4 02/21] sap: add watch for the Bluetooth Link Gustavo F. Padovan
2011-09-27 21:04 ` [PATCH -v4 03/21] sap: add support to enable SAP Gustavo F. Padovan
2011-09-27 21:04 ` [PATCH -v4 04/21] telit: add telit_sap_disable() Gustavo F. Padovan
2011-09-27 21:04 ` [PATCH -v4 05/21] sap: add support to the disable the SAP client Gustavo F. Padovan
2011-09-27 21:04 ` [PATCH -v4 06/21] telit: add aux GAtChat Gustavo F. Padovan
2011-09-27 21:04 ` [PATCH -v4 07/21] sap: enable modem only when #RSEN is 1 Gustavo F. Padovan
2011-09-27 21:04 ` [PATCH -v4 08/21] telit: enable the telit modem when SAP is enabled Gustavo F. Padovan
2011-09-27 21:04 ` [PATCH -v4 09/21] sap: add pre_sim handling Gustavo F. Padovan
2011-09-27 21:04 ` [PATCH -v4 10/21] sap: add set_online handling Gustavo F. Padovan
2011-09-27 21:04 ` [PATCH -v4 11/21] sap: add post_sim handling Gustavo F. Padovan
2011-09-27 21:04 ` [PATCH -v4 12/21] sap: add post_online handling Gustavo F. Padovan
2011-09-27 21:04 ` [PATCH -v4 13/21] telit: improve sap disable Gustavo F. Padovan
2011-09-27 21:04 ` [PATCH -v4 14/21] sap: disconnect link if enable() fails Gustavo F. Padovan
2011-09-27 21:04 ` [PATCH -v4 15/21] sap: do a proper shutdown of the channels Gustavo F. Padovan
2011-09-27 21:04 ` [PATCH -v4 16/21] sap: retrigger bluetooth GetProperties call Gustavo F. Padovan
2011-09-27 21:04 ` [PATCH -v4 17/21] telit: add needed flags to proper connect the serial port Gustavo F. Padovan
2011-09-27 21:04 ` [PATCH -v4 18/21] sap: de-register DBus callback if BlueZ goes down Gustavo F. Padovan
2011-09-27 21:04 ` [PATCH -v4 19/21] sap: remove server_path Gustavo F. Padovan
2011-09-27 21:04 ` [PATCH -v4 20/21] sap: clean up sap modem destruction Gustavo F. Padovan
2011-09-27 21:04 ` [PATCH -v4 21/21] sap: fix sap modem remove Gustavo F. Padovan
2011-09-28 4:45 ` Denis Kenzior
2011-09-28 4:37 ` [PATCH -v4 16/21] sap: retrigger bluetooth GetProperties call Denis Kenzior
2011-09-28 4:34 ` Denis Kenzior [this message]
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=4E82A3D6.4010704@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.