From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH 2/2] plugins: Handle HE910 and UE910 variants
Date: Thu, 26 Jan 2017 13:33:37 -0600 [thread overview]
Message-ID: <6e150fed-2ddc-3778-916b-1920333cbdbd@gmail.com> (raw)
In-Reply-To: <20170126162253.25442-3-gluedig@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2428 bytes --]
Hi Piotr,
On 01/26/2017 10:22 AM, Piotr Haber wrote:
> Telit modems HE910 and UE910 share the same USB
> vendor and device IDs (1bc7:0021) but they are
> different devices.
> HE910 is HSPA Class 14/6 and UE910 is Class 8/6.
> Both come in voice-enabled variants.
> HE910 also comes in variants with built-in GPS.
> ---
> plugins/xe910.c | 167 ++++++++++++++++++++++++++++++++++++++++++++++++--------
> 1 file changed, 143 insertions(+), 24 deletions(-)
>
I went ahead and applied a modified version of this patch. Mostly
fixing all sorts of coding style issues (spaces being used for
indentation, etc)
Please pay attention to our coding style guidelines.
Also, I modified the patch in 2 places:
> @@ -201,16 +229,8 @@ static void cfun_enable_cb(gboolean ok, GAtResult *result, gpointer user_data)
>
> DBG("%p", modem);
>
> - if (!ok) {
> - g_at_chat_unref(data->chat);
> - data->chat = NULL;
> -
> - g_at_chat_unref(data->modem);
> - data->modem = NULL;
> -
> - ofono_modem_set_powered(modem, FALSE);
> - return;
> - }
> + if (!ok)
> + return;
>
I squished this change since you want to clean up properly if the CFUN
fails.
> /*
> * Switch data carrier detect signal off.
<snip>
> +static void cfun_gmm_cb(gboolean ok, GAtResult *result, gpointer user_data)
> +{
> + struct ofono_modem *modem = user_data;
> + struct xe910_data *data = ofono_modem_get_data(modem);
> + const char * model_variant;
> +
> + DBG("%p", modem);
> +
> + if (!ok)
> + goto error;
> +
> + /* Get +GMM response */
> + if(!at_util_parse_attr(result, "", &model_variant))
> + goto error;
>
> + /* Try to find modem model and variant */
> + if(!find_model_variant(modem, model_variant)) {
> + ofono_info("Unknown xE910 model/variant %s", model_variant);
> + goto error;
> + }
> +
> + /* Set phone functionality */
> + if (g_at_chat_send(data->chat, "AT+CFUN=1", none_prefix,
> + cfun_enable_cb, modem, NULL) > 0)
> + return;
> +
> +error:
> + g_at_chat_unref(data->chat);
> + data->chat = NULL;
> +
> + g_at_chat_unref(data->modem);
> + data->modem = NULL;
> +
> + ofono_modem_set_powered(modem, FALSE);
> + return;
I took out this pointless return statement.
> +}
> +
> static int xe910_enable(struct ofono_modem *modem)
> {
> struct xe910_data *data = ofono_modem_get_data(modem);
Regards,
-Denis
prev parent reply other threads:[~2017-01-26 19:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-26 16:22 [PATCH 0/2] More generic support of Telit xE910 family Piotr Haber
2017-01-26 16:22 ` [PATCH 1/2] plugins: rename he910 to xe910 Piotr Haber
2017-01-26 19:30 ` Denis Kenzior
2017-01-26 16:22 ` [PATCH 2/2] plugins: Handle HE910 and UE910 variants Piotr Haber
2017-01-26 19:33 ` 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=6e150fed-2ddc-3778-916b-1920333cbdbd@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