From: Yang Gu <yang.gu@intel.com>
To: ofono@ofono.org
Subject: [PATCH 1/7] stkutil: Move advance of ctlv to parse_dataobj
Date: Tue, 27 Apr 2010 17:47:06 +0800 [thread overview]
Message-ID: <1272361632-21352-1-git-send-email-yang.gu@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1258 bytes --]
Not all the proactive commands have comprehension tlv other than command
details and device identities. So the appropriate code should be moved to
parse_dataobj() from stk_command_new_from_pdu().
---
src/stkutil.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/stkutil.c b/src/stkutil.c
index b4279c1..3323550 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -2030,6 +2030,10 @@ static gboolean parse_dataobj(struct comprehension_tlv_iter *iter,
entries = g_slist_prepend(entries, entry);
}
+
+ if (comprehension_tlv_iter_next(iter) != TRUE)
+ goto out;
+
entries = g_slist_reverse(entries);
for (l = entries; l; l = l->next) {
@@ -2048,6 +2052,7 @@ static gboolean parse_dataobj(struct comprehension_tlv_iter *iter,
}
}
+out:
for (l = entries; l; l = l->next) {
struct dataobj_handler_entry *entry = l->data;
@@ -2295,9 +2300,6 @@ struct stk_command *stk_command_new_from_pdu(const unsigned char *pdu,
command->src = data[0];
command->dst = data[1];
- if (comprehension_tlv_iter_next(&iter) != TRUE)
- return FALSE;
-
switch (command->type) {
case STK_COMMAND_TYPE_DISPLAY_TEXT:
ok = parse_display_text(command, &iter);
--
1.7.0.4
next reply other threads:[~2010-04-27 9:47 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-27 9:47 Yang Gu [this message]
2010-04-27 9:47 ` [PATCH 2/7] stkutil: Use struct to represent frame id Yang Gu
2010-04-27 9:47 ` [PATCH 3/7] test-stkutil: Refactor the implementation to test display text Yang Gu
2010-04-27 9:47 ` [PATCH 4/7] stkutil: Add parser for more time proactive commands Yang Gu
2010-04-27 9:47 ` [PATCH 5/7] test-stkutil: Add unit test for more time parser Yang Gu
2010-04-27 9:47 ` [PATCH 6/7] stkutil: Change some dataobj parser to use char * instead of char ** Yang Gu
2010-04-27 9:47 ` [PATCH 7/7] stkutil: Make get inkey parser use its own struct Yang Gu
2010-04-27 14:36 ` [PATCH 1/7] stkutil: Move advance of ctlv to parse_dataobj 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=1272361632-21352-1-git-send-email-yang.gu@intel.com \
--to=yang.gu@intel.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