Open Source Telephony
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH 08/12] gatchat: fix gatsyntax to support +CPOS
Date: Thu, 17 Mar 2011 23:53:50 -0500	[thread overview]
Message-ID: <4D82E55E.3050503@gmail.com> (raw)
In-Reply-To: <1299846189-15132-9-git-send-email-jarko.poutiainen@tieto.com>

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

Hi Jarko,

On 03/11/2011 06:23 AM, Jarko Poutiainen wrote:
> ---
>  gatchat/gatsyntax.c |   19 +++++++++++++++++++
>  1 files changed, 19 insertions(+), 0 deletions(-)
> 
> diff --git a/gatchat/gatsyntax.c b/gatchat/gatsyntax.c
> index 2fc70b8..f1d896b 100644
> --- a/gatchat/gatsyntax.c
> +++ b/gatchat/gatsyntax.c
> @@ -64,6 +64,9 @@ static void gsmv1_hint(GAtSyntax *syntax, GAtSyntaxExpectHint hint)
>  	case G_AT_SYNTAX_EXPECT_MULTILINE:
>  		syntax->state = GSMV1_STATE_GUESS_MULTILINE_RESPONSE;
>  		break;
> +	case G_AT_SYNTAX_EXPECT_SHORT_PROMPT:
> +		syntax->state = GSMV1_STATE_PROMPT;
> +		break;
>  	default:
>  		break;
>  	};
> @@ -195,6 +198,13 @@ static GAtSyntaxResult gsmv1_feed(GAtSyntax *syntax,
>  				i += 1;
>  				res = G_AT_SYNTAX_RESULT_PROMPT;
>  				goto out;
> +			} else if (byte == '\r')
> +				break;
> +			else if (byte == '\n') {
> +				syntax->state = GSMV1_STATE_IDLE;
> +				i += 1;
> +				res = G_AT_SYNTAX_RESULT_PROMPT;
> +				goto out;

Please just create a dedicated state for this one and don't hack the
PROMPT state.

>  			}
>  
>  			syntax->state = GSMV1_STATE_RESPONSE;
> @@ -239,6 +249,8 @@ static void gsm_permissive_hint(GAtSyntax *syntax, GAtSyntaxExpectHint hint)
>  {
>  	if (hint == G_AT_SYNTAX_EXPECT_PDU)
>  		syntax->state = GSM_PERMISSIVE_STATE_GUESS_PDU;
> +	else if (hint == G_AT_SYNTAX_EXPECT_SHORT_PROMPT)
> +		syntax->state = GSM_PERMISSIVE_STATE_PROMPT;
>  }
>  
>  static GAtSyntaxResult gsm_permissive_feed(GAtSyntax *syntax,
> @@ -298,6 +310,13 @@ static GAtSyntaxResult gsm_permissive_feed(GAtSyntax *syntax,
>  				i += 1;
>  				res = G_AT_SYNTAX_RESULT_PROMPT;
>  				goto out;
> +			} else if (byte == '\r')
> +				break;
> +			else if (byte == '\n') {
> +				syntax->state = GSM_PERMISSIVE_STATE_IDLE;
> +				i += 1;
> +				res = G_AT_SYNTAX_RESULT_PROMPT;
> +				goto out;

Same comment here, and man you better pray that your modem doesn't
insert unsolicited notifications between you sending a CPOSR and you
receiving a prompt ;)

>  			}
>  
>  			syntax->state = GSM_PERMISSIVE_STATE_RESPONSE;

Regards,
-Denis

  reply	other threads:[~2011-03-18  4:53 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-11 12:22 [PATCH 00/12] basic E911 support Jarko Poutiainen
2011-03-11 12:22 ` [PATCH 01/12] dbus: add gnss interface definition Jarko Poutiainen
2011-03-18  4:26   ` Denis Kenzior
2011-03-18 12:19     ` Jarko Poutiainen
2011-03-11 12:22 ` [PATCH 02/12] include: add gnss.h file Jarko Poutiainen
2011-03-18  4:29   ` Denis Kenzior
2011-03-18 12:24     ` Jarko Poutiainen
2011-03-11 12:23 ` [PATCH 03/12] src: add atom type for gnss Jarko Poutiainen
2011-03-11 12:23 ` [PATCH 04/12] src: add gnss atom and agent implementation Jarko Poutiainen
2011-03-18  4:39   ` Denis Kenzior
2011-03-18 12:37     ` Jarko Poutiainen
2011-03-18 14:38       ` Denis Kenzior
2011-03-11 12:23 ` [PATCH 05/12] gatchat:introduce send for +CPOS Jarko Poutiainen
2011-03-11 12:23 ` [PATCH 06/12] gatchat:new hint to handle +CPOS Jarko Poutiainen
2011-03-11 12:23 ` [PATCH 07/12] gatchat: implementation for +CPOS send Jarko Poutiainen
2011-03-18  4:42   ` Denis Kenzior
2011-03-18 13:05     ` Jarko Poutiainen
2011-03-18 14:52       ` Denis Kenzior
2011-03-11 12:23 ` [PATCH 08/12] gatchat: fix gatsyntax to support +CPOS Jarko Poutiainen
2011-03-18  4:53   ` Denis Kenzior [this message]
2011-03-18 13:56     ` Jarko Poutiainen
2011-03-18 14:49       ` Denis Kenzior
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
2011-03-11 12:23 ` [PATCH 10/12] ste: add support for gnss Jarko Poutiainen
2011-03-11 12:23 ` [PATCH 11/12] ofono.conf: add positioning agent interface Jarko Poutiainen
2011-03-11 12:23 ` [PATCH 12/12] test: add test-gnss Jarko Poutiainen
  -- strict thread matches above, loose matches on Subject: below --
2011-03-24 13:46 [PATCH 00/12] Basic E911 support Jarko Poutiainen
2011-03-24 13:46 ` [PATCH 08/12] gatchat: fix gatsyntax to support +CPOS Jarko Poutiainen

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=4D82E55E.3050503@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