All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/7] stkutil: Move advance of ctlv to parse_dataobj
@ 2010-04-27  9:47 Yang Gu
  2010-04-27  9:47 ` [PATCH 2/7] stkutil: Use struct to represent frame id Yang Gu
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Yang Gu @ 2010-04-27  9:47 UTC (permalink / raw)
  To: ofono

[-- 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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-04-27 14:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-27  9:47 [PATCH 1/7] stkutil: Move advance of ctlv to parse_dataobj Yang Gu
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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.