summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYang Gu <gyagp0@gmail.com>2010-04-22 23:12:23 +0800
committerDenis Kenzior <denkenz@gmail.com>2010-04-23 11:52:18 -0500
commit18ee08e598247629bdd9daec38187b5584b2b21d (patch)
treea30c3f42714488e80b6edc6f7d6a64fdbec3682d
parentb1b75d90d5237344c56a5b72084a913bc59cc4b7 (diff)
downloadofono-18ee08e598247629bdd9daec38187b5584b2b21d.tar.bz2
stkutil: Add parser for MMS identifier objects
-rw-r--r--src/stkutil.c20
-rw-r--r--src/stkutil.h9
2 files changed, 29 insertions, 0 deletions
diff --git a/src/stkutil.c b/src/stkutil.c
index a33c4e9e..45ff7e39 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -1687,6 +1687,24 @@ static gboolean parse_dataobj_mms_reference(struct comprehension_tlv_iter *iter,
return TRUE;
}
+/* Defined in TS 102.223 Section 8.83 */
+static gboolean parse_dataobj_mms_id(struct comprehension_tlv_iter *iter,
+ void *user)
+{
+ struct stk_mms_id *mi = user;
+ const unsigned char *data;
+ unsigned int len = comprehension_tlv_iter_get_length(iter);
+
+ if (len < 1)
+ return FALSE;
+
+ data = comprehension_tlv_iter_get_data(iter);
+ mi->len = len;
+ memcpy(mi->id, data, len);
+
+ return TRUE;
+}
+
static dataobj_handler handler_for_type(enum stk_data_object_type type)
{
switch (type) {
@@ -1840,6 +1858,8 @@ static dataobj_handler handler_for_type(enum stk_data_object_type type)
return parse_dataobj_meid;
case STK_DATA_OBJECT_TYPE_MMS_REFERENCE:
return parse_dataobj_mms_reference;
+ case STK_DATA_OBJECT_TYPE_MMS_ID:
+ return parse_dataobj_mms_id;
default:
return NULL;
};
diff --git a/src/stkutil.h b/src/stkutil.h
index b1e4c5e9..c4e2c915 100644
--- a/src/stkutil.h
+++ b/src/stkutil.h
@@ -730,6 +730,15 @@ struct stk_mms_reference {
unsigned char len;
};
+/*
+ * According to 102.223 Section 8.83 the length of CTLV is 1 byte. This means
+ * that the maximum size is 127 according to the rules of CTLVs.
+ */
+struct stk_mms_id {
+ unsigned char id[127];
+ unsigned char len;
+};
+
struct stk_command_display_text {
char *text;
struct stk_icon_id icon_id;