mirror of git://git.sysmocom.de/ofono
stkutil: Move advance of ctlv to parse_dataobj
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().
This commit is contained in:
parent
a9c0be7339
commit
def5c38094
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue