From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH v2] Skip unsolicied CREG/CGREG correctly while checking GPRS attach status
Date: Sat, 11 Dec 2010 08:52:13 -0600 [thread overview]
Message-ID: <4D03901D.9060105@gmail.com> (raw)
In-Reply-To: <AANLkTimrnKDQTyN8DudYiBVpc51Ca2S2nbEu_JuHVz6j@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1023 bytes --]
Hi Tonny,
> In your proposed patch, it bypass the unsolicited response only if the
> 2nd number after +CGREG: is not single digit, however if the lac is
> single digit, we will still get the wrong state number.
The lac is given as a 2 byte number and should always be printed as four
hexadecimal letters. If this is not the case, then you should have a
serious talk with your vendor.
>
> So I still believe we should check whether we are at the end of the
> return string before parsing the unquoted lac and ci. If we are at the
> end of the string, then this is a unsolicited code and we should ignore
> it. How do you think?
>
I'm against this, if you really want to guard against this, then use the
approach similar to comprehension_tlv_iter_copy in src/simutil.[ch].
You can use that to 'peek' ahead and figure out whether the response
contains 3 or 4 elements.
But again, you would not be having this issue in the first place if your
vendor followed standards ;)
Regards,
-Denis
next prev parent reply other threads:[~2010-12-11 14:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-03 15:20 [PATCH v2] Skip unsolicied CREG/CGREG correctly while checking GPRS attach status Tonny Tzeng
2010-12-07 3:41 ` Denis Kenzior
2010-12-11 14:09 ` Tonny Tzeng
2010-12-11 14:52 ` Denis Kenzior [this message]
2010-12-11 15:08 ` Tonny Tzeng
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=4D03901D.9060105@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