[PATCH 1/7] stkutil: Move advance of ctlv to parse_dataobj
Yang Gu
yang.gu at intel.com
Tue Apr 27 02:47:06 PDT 2010
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
More information about the ofono
mailing list