Open Source Telephony
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH 09/12] atmodem: add gnss driver
Date: Mon, 28 Mar 2011 18:06:35 -0500	[thread overview]
Message-ID: <4D91147B.1010401@gmail.com> (raw)
In-Reply-To: <1300974396-15801-10-git-send-email-jarko.poutiainen@tieto.com>

[-- Attachment #1: Type: text/plain, Size: 1817 bytes --]

Hi Jarko,

On 03/24/2011 08:46 AM, Jarko Poutiainen wrote:
> ---
>  Makefile.am               |    3 +-
>  drivers/atmodem/atmodem.c |    2 +
>  drivers/atmodem/atmodem.h |    3 +
>  drivers/atmodem/gnss.c    |  282 +++++++++++++++++++++++++++++++++++++++++++++
>  4 files changed, 289 insertions(+), 1 deletions(-)
>  create mode 100644 drivers/atmodem/gnss.c

I applied this patch, however:

> +static gboolean gnss_parse_report(GAtResult *result, const char *prefix,
> +					const char **xml)
> +{
> +	GAtResultIter iter;
> +
> +	g_at_result_iter_init(&iter, result);
> +
> +	if (!g_at_result_iter_next(&iter, prefix))
> +		return FALSE;
> +
> +	if (!g_at_result_iter_next_unquoted_string(&iter, xml))
> +		return FALSE;
> +
> +	return TRUE;
> +}
> +
> +static void gnss_report(GAtResult *result, gpointer user_data)
> +{
> +	struct ofono_gnss *gnss = user_data;
> +	const char *xml;
> +
> +	DBG("");
> +
> +	xml = NULL;
> +	if (!gnss_parse_report(result, "+CPOSR:", &xml)) {
> +		ofono_error("Unable to parse CPOSR notification");
> +		return;
> +	}
> +
> +	if (xml == NULL) {
> +		ofono_error("Unable to parse CPOSR notification");
> +		return;
> +	}
> +
> +	ofono_gnss_notify_posr_request(gnss, xml);
> +}

The implementation of CPOSR is pretty much unacceptable.  You're relying
on the agent to parse the XML piecemeal.  I don't like this at all.  It
creates unnecessary round-trips over D-Bus for each CPOSR we receive,
not to mention ambiguity in exceptional conditions (e.g. a modem reset
happens during CPOSR emission).

I'd like you to modify the driver to detect the start and end of CPOSR
strings, assemble the XML fragments into a single chunk and only call
ofono_gnss_notify_posr_request once the XML string is assembled.

Regards,
-Denis

  reply	other threads:[~2011-03-28 23:06 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-24 13:46 [PATCH 00/12] Basic E911 support Jarko Poutiainen
2011-03-24 13:46 ` [PATCH 01/12] dbus: add gnss interface definition Jarko Poutiainen
2011-03-24 13:46 ` [PATCH 02/12] include: add gnss.h file Jarko Poutiainen
2011-03-24 13:46 ` [PATCH 03/12] src: add atom type for gnss Jarko Poutiainen
2011-03-24 13:46 ` [PATCH 04/12] src: add gnss atom and agent implementation Jarko Poutiainen
2011-03-24 13:46 ` [PATCH 05/12] gatchat: introduce send for +CPOS Jarko Poutiainen
2011-03-24 13:46 ` [PATCH 06/12] gatchat: new hint to handle +CPOS Jarko Poutiainen
2011-03-24 13:46 ` [PATCH 07/12] gatchat: implementation for +CPOS send Jarko Poutiainen
2011-03-28 23:00   ` Denis Kenzior
2011-03-24 13:46 ` [PATCH 08/12] gatchat: fix gatsyntax to support +CPOS Jarko Poutiainen
2011-03-24 13:46 ` [PATCH 09/12] atmodem: add gnss driver Jarko Poutiainen
2011-03-28 23:06   ` Denis Kenzior [this message]
2011-03-24 13:46 ` [PATCH 10/12] ste: add support for gnss Jarko Poutiainen
2011-03-24 13:46 ` [PATCH 11/12] ofono.conf: add positioning agent interface Jarko Poutiainen
2011-03-24 13:46 ` [PATCH 12/12] test: add test-gnss Jarko Poutiainen
2011-03-28 22:56 ` [PATCH 00/12] Basic E911 support Denis Kenzior
2011-03-29 10:19   ` Jarko Poutiainen
  -- strict thread matches above, loose matches on Subject: below --
2011-03-11 12:22 [PATCH 00/12] basic " Jarko Poutiainen
2011-03-11 12:23 ` [PATCH 09/12] atmodem: add gnss driver Jarko Poutiainen
2011-03-18  5:03   ` Denis Kenzior
2011-03-18 12:50     ` Jarko Poutiainen
2011-03-18 14:45       ` Denis Kenzior

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=4D91147B.1010401@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