All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/13] Add parser for browsing status objects
@ 2010-04-22 15:12 Yang Gu
  2010-04-22 15:12 ` [PATCH 02/13] Add parser for frame layout objects Yang Gu
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: Yang Gu @ 2010-04-22 15:12 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1185 bytes --]

---
 src/stkutil.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/stkutil.c b/src/stkutil.c
index 50471ee..b855b0f 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -1570,6 +1570,14 @@ static gboolean parse_dataobj_battery_state(struct comprehension_tlv_iter *iter,
 	return parse_dataobj_common_byte(iter, byte);
 }
 
+/* Defined in TS 102.223 Section 8.77 */
+static gboolean parse_dataobj_browsing_status(
+		struct comprehension_tlv_iter *iter, void *user)
+{
+	struct stk_common_byte_array *array = user;
+	return parse_dataobj_common_byte_array(iter, array);
+}
+
 /* Defined in TS 102.223 Section 8.80 */
 static gboolean parse_dataobj_frame_id(struct comprehension_tlv_iter *iter,
 					void *user)
@@ -1731,6 +1739,8 @@ static dataobj_handler handler_for_type(enum stk_data_object_type type)
 		return parse_dataobj_network_search_mode;
 	case STK_DATA_OBJECT_TYPE_BATTERY_STATE:
 		return parse_dataobj_battery_state;
+	case STK_DATA_OBJECT_TYPE_BROWSING_STATUS:
+		return parse_dataobj_browsing_status;
 	case STK_DATA_OBJECT_TYPE_FRAME_ID:
 		return parse_dataobj_frame_id;
 	default:
-- 
1.7.0.4


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

* [PATCH 02/13] Add parser for frame layout objects
  2010-04-22 15:12 [PATCH 01/13] Add parser for browsing status objects Yang Gu
@ 2010-04-22 15:12 ` Yang Gu
  2010-04-22 15:12 ` [PATCH 03/13] Add parser for frames information objects Yang Gu
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Yang Gu @ 2010-04-22 15:12 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 2506 bytes --]

---
 src/stkutil.c |   26 ++++++++++++++++++++++++++
 src/stkutil.h |   16 ++++++++++++++++
 2 files changed, 42 insertions(+), 0 deletions(-)

diff --git a/src/stkutil.c b/src/stkutil.c
index b855b0f..fab60a9 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -1578,6 +1578,30 @@ static gboolean parse_dataobj_browsing_status(
 	return parse_dataobj_common_byte_array(iter, array);
 }
 
+/* Defined in TS 102.223 Section 8.78 */
+static gboolean parse_dataobj_frame_layout(struct comprehension_tlv_iter *iter,
+						void *user)
+{
+	struct stk_frame_layout *fl = user;
+	const unsigned char *data;
+	unsigned char len = comprehension_tlv_iter_get_length(iter);
+
+	if (len < 2)
+		return FALSE;
+
+	data = comprehension_tlv_iter_get_data(iter);
+
+	if (data[0] != STK_LAYOUT_HORIZONTAL &&
+			data[0] != STK_LAYOUT_VERTICAL)
+		return FALSE;
+
+	fl->layout = data[0];
+	fl->len = len - 1;
+	memcpy(fl->size, data + 1, fl->len);
+
+	return TRUE;
+}
+
 /* Defined in TS 102.223 Section 8.80 */
 static gboolean parse_dataobj_frame_id(struct comprehension_tlv_iter *iter,
 					void *user)
@@ -1741,6 +1765,8 @@ static dataobj_handler handler_for_type(enum stk_data_object_type type)
 		return parse_dataobj_battery_state;
 	case STK_DATA_OBJECT_TYPE_BROWSING_STATUS:
 		return parse_dataobj_browsing_status;
+	case STK_DATA_OBJECT_TYPE_FRAME_LAYOUT:
+		return parse_dataobj_frame_layout;
 	case STK_DATA_OBJECT_TYPE_FRAME_ID:
 		return parse_dataobj_frame_id;
 	default:
diff --git a/src/stkutil.h b/src/stkutil.h
index 98da709..52b62af 100644
--- a/src/stkutil.h
+++ b/src/stkutil.h
@@ -365,6 +365,11 @@ enum stk_battery_state {
 	STK_BATTERY_FULL = 	0x04
 };
 
+enum stk_frame_layout_type {
+	STK_LAYOUT_HORIZONTAL = 	0x01,
+	STK_LAYOUT_VERTICAL = 		0x02
+};
+
 /* For data object that only has a byte array with undetermined length */
 struct stk_common_byte_array {
 	unsigned char *array;
@@ -693,6 +698,17 @@ struct stk_item_text_attribute_list {
 	unsigned char len;
 };
 
+/*
+ * According to 102.223 Section 8.78 the length of CTLV is 1 byte. This means
+ * that the maximum length is 127 bytes for the total length of layout and
+ * relative-sized frame. Thus the maximum length of relative size is 126 bytes.
+ */
+struct stk_frame_layout {
+	unsigned char layout;
+	unsigned char size[126];
+	unsigned int len;
+};
+
 struct stk_command_display_text {
 	char *text;
 	struct stk_icon_id icon_id;
-- 
1.7.0.4


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

* [PATCH 03/13] Add parser for frames information objects
  2010-04-22 15:12 [PATCH 01/13] Add parser for browsing status objects Yang Gu
  2010-04-22 15:12 ` [PATCH 02/13] Add parser for frame layout objects Yang Gu
@ 2010-04-22 15:12 ` Yang Gu
  2010-04-22 15:12 ` [PATCH 04/13] Add parser for meid objects Yang Gu
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Yang Gu @ 2010-04-22 15:12 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 2239 bytes --]

---
 src/stkutil.c |   31 +++++++++++++++++++++++++++++++
 src/stkutil.h |   12 ++++++++++++
 2 files changed, 43 insertions(+), 0 deletions(-)

diff --git a/src/stkutil.c b/src/stkutil.c
index fab60a9..f2b4fba 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -1602,6 +1602,35 @@ static gboolean parse_dataobj_frame_layout(struct comprehension_tlv_iter *iter,
 	return TRUE;
 }
 
+/* Defined in TS 102.223 Section 8.79 */
+static gboolean parse_dataobj_frames_info(struct comprehension_tlv_iter *iter,
+						void *user)
+{
+	struct stk_frames_info *fi = user;
+	const unsigned char *data;
+	unsigned char len = comprehension_tlv_iter_get_length(iter);
+
+	if (len < 1)
+		return FALSE;
+
+	data = comprehension_tlv_iter_get_data(iter);
+
+	if (data[0] > 0x0f)
+		return FALSE;
+
+	if ((len == 1 && data[0] != 0) || (len > 1 && data[0] == 0))
+		return FALSE;
+
+	if (len == 1)
+		return TRUE;
+
+	fi->id = data[0];
+	fi->len = len - 1;
+	memcpy(fi->list, data + 1, fi->len);
+
+	return TRUE;
+}
+
 /* Defined in TS 102.223 Section 8.80 */
 static gboolean parse_dataobj_frame_id(struct comprehension_tlv_iter *iter,
 					void *user)
@@ -1767,6 +1796,8 @@ static dataobj_handler handler_for_type(enum stk_data_object_type type)
 		return parse_dataobj_browsing_status;
 	case STK_DATA_OBJECT_TYPE_FRAME_LAYOUT:
 		return parse_dataobj_frame_layout;
+	case STK_DATA_OBJECT_TYPE_FRAMES_INFO:
+		return parse_dataobj_frames_info;
 	case STK_DATA_OBJECT_TYPE_FRAME_ID:
 		return parse_dataobj_frame_id;
 	default:
diff --git a/src/stkutil.h b/src/stkutil.h
index 52b62af..c2579dc 100644
--- a/src/stkutil.h
+++ b/src/stkutil.h
@@ -709,6 +709,18 @@ struct stk_frame_layout {
 	unsigned int len;
 };
 
+/*
+ * According to 102.223 Section 8.79 the length of CTLV is 1 byte. This means
+ * that the maximum length is 127 bytes for the total length of default frame
+ * id and frame information list. Thus the maximum length of frame information
+ * list is 126 bytes.
+ */
+struct stk_frames_info {
+	unsigned char id;
+	unsigned char list[126];
+	unsigned int len;
+};
+
 struct stk_command_display_text {
 	char *text;
 	struct stk_icon_id icon_id;
-- 
1.7.0.4


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

* [PATCH 04/13] Add parser for meid objects
  2010-04-22 15:12 [PATCH 01/13] Add parser for browsing status objects Yang Gu
  2010-04-22 15:12 ` [PATCH 02/13] Add parser for frame layout objects Yang Gu
  2010-04-22 15:12 ` [PATCH 03/13] Add parser for frames information objects Yang Gu
@ 2010-04-22 15:12 ` Yang Gu
  2010-04-22 15:12 ` [PATCH 05/13] Add parser for multimedia message reference objects Yang Gu
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Yang Gu @ 2010-04-22 15:12 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1185 bytes --]

---
 src/stkutil.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/src/stkutil.c b/src/stkutil.c
index f2b4fba..3dca39c 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -1651,6 +1651,24 @@ static gboolean parse_dataobj_frame_id(struct comprehension_tlv_iter *iter,
 	return TRUE;
 }
 
+/* Defined in TS 102.223 Section 8.81 */
+static gboolean parse_dataobj_meid(struct comprehension_tlv_iter *iter,
+					void *user)
+{
+	unsigned char **meid = user;
+	const unsigned char *data;
+
+	if (comprehension_tlv_iter_get_length(iter) != 8)
+		return FALSE;
+
+	data = comprehension_tlv_iter_get_data(iter);
+
+	/* Assume meid is 8 bytes long */
+	memcpy(*meid, data, 8);
+
+	return TRUE;
+}
+
 static dataobj_handler handler_for_type(enum stk_data_object_type type)
 {
 	switch (type) {
@@ -1800,6 +1818,8 @@ static dataobj_handler handler_for_type(enum stk_data_object_type type)
 		return parse_dataobj_frames_info;
 	case STK_DATA_OBJECT_TYPE_FRAME_ID:
 		return parse_dataobj_frame_id;
+	case STK_DATA_OBJECT_TYPE_MEID:
+		return parse_dataobj_meid;
 	default:
 		return NULL;
 	};
-- 
1.7.0.4


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

* [PATCH 05/13] Add parser for multimedia message reference objects
  2010-04-22 15:12 [PATCH 01/13] Add parser for browsing status objects Yang Gu
                   ` (2 preceding siblings ...)
  2010-04-22 15:12 ` [PATCH 04/13] Add parser for meid objects Yang Gu
@ 2010-04-22 15:12 ` Yang Gu
  2010-04-22 15:12 ` [PATCH 06/13] Add parser for multimedia message identifier objects Yang Gu
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Yang Gu @ 2010-04-22 15:12 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1766 bytes --]

---
 src/stkutil.c |   20 ++++++++++++++++++++
 src/stkutil.h |    9 +++++++++
 2 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/src/stkutil.c b/src/stkutil.c
index 3dca39c..a33c4e9 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -1669,6 +1669,24 @@ static gboolean parse_dataobj_meid(struct comprehension_tlv_iter *iter,
 	return TRUE;
 }
 
+/* Defined in TS 102.223 Section 8.82 */
+static gboolean parse_dataobj_mms_reference(struct comprehension_tlv_iter *iter,
+						void *user)
+{
+	struct stk_mms_reference *mr = 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);
+	mr->len = len;
+	memcpy(mr->ref, data, len);
+
+	return TRUE;
+}
+
 static dataobj_handler handler_for_type(enum stk_data_object_type type)
 {
 	switch (type) {
@@ -1820,6 +1838,8 @@ static dataobj_handler handler_for_type(enum stk_data_object_type type)
 		return parse_dataobj_frame_id;
 	case STK_DATA_OBJECT_TYPE_MEID:
 		return parse_dataobj_meid;
+	case STK_DATA_OBJECT_TYPE_MMS_REFERENCE:
+		return parse_dataobj_mms_reference;
 	default:
 		return NULL;
 	};
diff --git a/src/stkutil.h b/src/stkutil.h
index c2579dc..b1e4c5e 100644
--- a/src/stkutil.h
+++ b/src/stkutil.h
@@ -721,6 +721,15 @@ struct stk_frames_info {
 	unsigned int len;
 };
 
+/*
+ * According to 102.223 Section 8.82 the length of CTLV is 1 byte. This means
+ * that the maximum size is 127 according to the rules of CTLVs.
+ */
+struct stk_mms_reference {
+	unsigned char ref[127];
+	unsigned char len;
+};
+
 struct stk_command_display_text {
 	char *text;
 	struct stk_icon_id icon_id;
-- 
1.7.0.4


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

* [PATCH 06/13] Add parser for multimedia message identifier objects
  2010-04-22 15:12 [PATCH 01/13] Add parser for browsing status objects Yang Gu
                   ` (3 preceding siblings ...)
  2010-04-22 15:12 ` [PATCH 05/13] Add parser for multimedia message reference objects Yang Gu
@ 2010-04-22 15:12 ` Yang Gu
  2010-04-22 15:12 ` [PATCH 07/13] Add parser for multimedia message transfer status objects Yang Gu
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Yang Gu @ 2010-04-22 15:12 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1754 bytes --]

---
 src/stkutil.c |   20 ++++++++++++++++++++
 src/stkutil.h |    9 +++++++++
 2 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/src/stkutil.c b/src/stkutil.c
index a33c4e9..45ff7e3 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 b1e4c5e..c4e2c91 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;
-- 
1.7.0.4


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

* [PATCH 07/13] Add parser for multimedia message transfer status objects
  2010-04-22 15:12 [PATCH 01/13] Add parser for browsing status objects Yang Gu
                   ` (4 preceding siblings ...)
  2010-04-22 15:12 ` [PATCH 06/13] Add parser for multimedia message identifier objects Yang Gu
@ 2010-04-22 15:12 ` Yang Gu
  2010-04-22 15:12 ` [PATCH 08/13] Add parser for mm content identifier objects Yang Gu
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Yang Gu @ 2010-04-22 15:12 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1809 bytes --]

---
 src/stkutil.c |   20 ++++++++++++++++++++
 src/stkutil.h |    9 +++++++++
 2 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/src/stkutil.c b/src/stkutil.c
index 45ff7e3..c2b3cd5 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -1705,6 +1705,24 @@ static gboolean parse_dataobj_mms_id(struct comprehension_tlv_iter *iter,
 	return TRUE;
 }
 
+/* Defined in TS 102.223 Section 8.84 */
+static gboolean parse_dataobj_mms_transfer_status(
+		struct comprehension_tlv_iter *iter, void *user)
+{
+	struct stk_mms_transfer_status *mts = 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);
+	mts->len = len;
+	memcpy(mts->status, data, len);
+
+	return TRUE;
+}
+
 static dataobj_handler handler_for_type(enum stk_data_object_type type)
 {
 	switch (type) {
@@ -1860,6 +1878,8 @@ static dataobj_handler handler_for_type(enum stk_data_object_type type)
 		return parse_dataobj_mms_reference;
 	case STK_DATA_OBJECT_TYPE_MMS_ID:
 		return parse_dataobj_mms_id;
+	case STK_DATA_OBJECT_TYPE_MMS_TRANSFER_STATUS:
+		return parse_dataobj_mms_transfer_status;
 	default:
 		return NULL;
 	};
diff --git a/src/stkutil.h b/src/stkutil.h
index c4e2c91..937bbc6 100644
--- a/src/stkutil.h
+++ b/src/stkutil.h
@@ -739,6 +739,15 @@ struct stk_mms_id {
 	unsigned char len;
 };
 
+/*
+ * According to 102.223 Section 8.84 the length of CTLV is 1 byte. This means
+ * that the maximum size is 127 according to the rules of CTLVs.
+ */
+struct stk_mms_transfer_status {
+	unsigned char status[127];
+	unsigned char len;
+};
+
 struct stk_command_display_text {
 	char *text;
 	struct stk_icon_id icon_id;
-- 
1.7.0.4


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

* [PATCH 08/13] Add parser for mm content identifier objects
  2010-04-22 15:12 [PATCH 01/13] Add parser for browsing status objects Yang Gu
                   ` (5 preceding siblings ...)
  2010-04-22 15:12 ` [PATCH 07/13] Add parser for multimedia message transfer status objects Yang Gu
@ 2010-04-22 15:12 ` Yang Gu
  2010-04-22 15:12 ` [PATCH 09/13] Add parser for multimedia message notification objects Yang Gu
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Yang Gu @ 2010-04-22 15:12 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1785 bytes --]

---
 src/stkutil.c |   20 ++++++++++++++++++++
 src/stkutil.h |    9 +++++++++
 2 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/src/stkutil.c b/src/stkutil.c
index c2b3cd5..b4702b2 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -1723,6 +1723,24 @@ static gboolean parse_dataobj_mms_transfer_status(
 	return TRUE;
 }
 
+/* Defined in TS 102.223 Section 8.85 */
+static gboolean parse_dataobj_mms_content_id(
+		struct comprehension_tlv_iter *iter, void *user)
+{
+	struct stk_mms_content_id *mci = 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);
+	mci->len = len;
+	memcpy(mci->id, data, len);
+
+	return TRUE;
+}
+
 static dataobj_handler handler_for_type(enum stk_data_object_type type)
 {
 	switch (type) {
@@ -1880,6 +1898,8 @@ static dataobj_handler handler_for_type(enum stk_data_object_type type)
 		return parse_dataobj_mms_id;
 	case STK_DATA_OBJECT_TYPE_MMS_TRANSFER_STATUS:
 		return parse_dataobj_mms_transfer_status;
+	case STK_DATA_OBJECT_TYPE_MMS_CONTENT_ID:
+		return parse_dataobj_mms_content_id;
 	default:
 		return NULL;
 	};
diff --git a/src/stkutil.h b/src/stkutil.h
index 937bbc6..267e296 100644
--- a/src/stkutil.h
+++ b/src/stkutil.h
@@ -748,6 +748,15 @@ struct stk_mms_transfer_status {
 	unsigned char len;
 };
 
+/*
+ * According to 102.223 Section 8.85 the length of CTLV is 1 byte. This means
+ * that the maximum size is 127 according to the rules of CTLVs.
+ */
+struct stk_mms_content_id {
+	unsigned char id[127];
+	unsigned char len;
+};
+
 struct stk_command_display_text {
 	char *text;
 	struct stk_icon_id icon_id;
-- 
1.7.0.4


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

* [PATCH 09/13] Add parser for multimedia message notification objects
  2010-04-22 15:12 [PATCH 01/13] Add parser for browsing status objects Yang Gu
                   ` (6 preceding siblings ...)
  2010-04-22 15:12 ` [PATCH 08/13] Add parser for mm content identifier objects Yang Gu
@ 2010-04-22 15:12 ` Yang Gu
  2010-04-22 15:12 ` [PATCH 10/13] Add parser for last envelope objects Yang Gu
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Yang Gu @ 2010-04-22 15:12 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1028 bytes --]

---
 src/stkutil.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/stkutil.c b/src/stkutil.c
index b4702b2..f1a6738 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -1741,6 +1741,14 @@ static gboolean parse_dataobj_mms_content_id(
 	return TRUE;
 }
 
+/* Defined in TS 102.223 Section 8.86 */
+static gboolean parse_dataobj_mms_notification(
+		struct comprehension_tlv_iter *iter, void *user)
+{
+	struct stk_common_byte_array *array = user;
+	return parse_dataobj_common_byte_array(iter, array);
+}
+
 static dataobj_handler handler_for_type(enum stk_data_object_type type)
 {
 	switch (type) {
@@ -1900,6 +1908,8 @@ static dataobj_handler handler_for_type(enum stk_data_object_type type)
 		return parse_dataobj_mms_transfer_status;
 	case STK_DATA_OBJECT_TYPE_MMS_CONTENT_ID:
 		return parse_dataobj_mms_content_id;
+	case STK_DATA_OBJECT_TYPE_MMS_NOTIFICATION:
+		return parse_dataobj_mms_notification;
 	default:
 		return NULL;
 	};
-- 
1.7.0.4


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

* [PATCH 10/13] Add parser for last envelope objects
  2010-04-22 15:12 [PATCH 01/13] Add parser for browsing status objects Yang Gu
                   ` (7 preceding siblings ...)
  2010-04-22 15:12 ` [PATCH 09/13] Add parser for multimedia message notification objects Yang Gu
@ 2010-04-22 15:12 ` Yang Gu
  2010-04-22 15:12 ` [PATCH 11/13] Add parser for registry application data objects Yang Gu
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Yang Gu @ 2010-04-22 15:12 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1033 bytes --]

---
 src/stkutil.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/stkutil.c b/src/stkutil.c
index f1a6738..83cf500 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -1749,6 +1749,14 @@ static gboolean parse_dataobj_mms_notification(
 	return parse_dataobj_common_byte_array(iter, array);
 }
 
+/* Defined in TS 102.223 Section 8.87 */
+static gboolean parse_dataobj_last_envelope(struct comprehension_tlv_iter *iter,
+						void *user)
+{
+	gboolean *ret = user;
+	return parse_dataobj_common_bool(iter, ret);
+}
+
 static dataobj_handler handler_for_type(enum stk_data_object_type type)
 {
 	switch (type) {
@@ -1910,6 +1918,8 @@ static dataobj_handler handler_for_type(enum stk_data_object_type type)
 		return parse_dataobj_mms_content_id;
 	case STK_DATA_OBJECT_TYPE_MMS_NOTIFICATION:
 		return parse_dataobj_mms_notification;
+	case STK_DATA_OBJECT_TYPE_LAST_ENVELOPE:
+		return parse_dataobj_last_envelope;
 	default:
 		return NULL;
 	};
-- 
1.7.0.4


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

* [PATCH 11/13] Add parser for registry application data objects
  2010-04-22 15:12 [PATCH 01/13] Add parser for browsing status objects Yang Gu
                   ` (8 preceding siblings ...)
  2010-04-22 15:12 ` [PATCH 10/13] Add parser for last envelope objects Yang Gu
@ 2010-04-22 15:12 ` Yang Gu
  2010-04-22 15:12 ` [PATCH 12/13] Add parser for activate descriptor objects Yang Gu
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Yang Gu @ 2010-04-22 15:12 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1950 bytes --]

---
 src/stkutil.c |   28 ++++++++++++++++++++++++++++
 src/stkutil.h |    7 +++++++
 2 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/src/stkutil.c b/src/stkutil.c
index 83cf500..a0c0d25 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -1757,6 +1757,32 @@ static gboolean parse_dataobj_last_envelope(struct comprehension_tlv_iter *iter,
 	return parse_dataobj_common_bool(iter, ret);
 }
 
+/* Defined in TS 102.223 Section 8.88 */
+static gboolean parse_dataobj_registry_application_data(
+		struct comprehension_tlv_iter *iter, void *user)
+{
+	struct stk_registry_application_data *rad = user;
+	const unsigned char *data;
+	char *utf8;
+	unsigned int len = comprehension_tlv_iter_get_length(iter);
+
+	if (len < 5)
+		return FALSE;
+
+	data = comprehension_tlv_iter_get_data(iter);
+
+	utf8 = decode_text(data[2], len - 4, data + 4);
+
+	if (utf8 == NULL)
+		return FALSE;
+
+	rad->name = utf8;
+	rad->port = (data[0] << 8) + data[1];
+	rad->type = data[3];
+
+	return TRUE;
+}
+
 static dataobj_handler handler_for_type(enum stk_data_object_type type)
 {
 	switch (type) {
@@ -1920,6 +1946,8 @@ static dataobj_handler handler_for_type(enum stk_data_object_type type)
 		return parse_dataobj_mms_notification;
 	case STK_DATA_OBJECT_TYPE_LAST_ENVELOPE:
 		return parse_dataobj_last_envelope;
+	case STK_DATA_OBJECT_TYPE_REGISTRY_APPLICATION_DATA:
+		return parse_dataobj_registry_application_data;
 	default:
 		return NULL;
 	};
diff --git a/src/stkutil.h b/src/stkutil.h
index 267e296..b7341c7 100644
--- a/src/stkutil.h
+++ b/src/stkutil.h
@@ -757,6 +757,13 @@ struct stk_mms_content_id {
 	unsigned char len;
 };
 
+/* Defined in TS 102.223 Section 8.88 */
+struct stk_registry_application_data {
+	unsigned short port;
+	unsigned char type;
+	char *name;
+};
+
 struct stk_command_display_text {
 	char *text;
 	struct stk_icon_id icon_id;
-- 
1.7.0.4


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

* [PATCH 12/13] Add parser for activate descriptor objects
  2010-04-22 15:12 [PATCH 01/13] Add parser for browsing status objects Yang Gu
                   ` (9 preceding siblings ...)
  2010-04-22 15:12 ` [PATCH 11/13] Add parser for registry application data objects Yang Gu
@ 2010-04-22 15:12 ` Yang Gu
  2010-04-22 15:12 ` [PATCH 13/13] Add parser for broadcast network information objects Yang Gu
  2010-04-23 16:54 ` [PATCH 01/13] Add parser for browsing status objects Denis Kenzior
  12 siblings, 0 replies; 14+ messages in thread
From: Yang Gu @ 2010-04-22 15:12 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1247 bytes --]

---
 src/stkutil.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/src/stkutil.c b/src/stkutil.c
index a0c0d25..75b0035 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -1783,6 +1783,26 @@ static gboolean parse_dataobj_registry_application_data(
 	return TRUE;
 }
 
+/* Defined in TS 102.223 Section 8.89 */
+static gboolean parse_dataobj_activate_descriptor(
+		struct comprehension_tlv_iter *iter, void *user)
+{
+	unsigned char *byte = user;
+	const unsigned char *data;
+
+	if (comprehension_tlv_iter_get_length(iter) != 1)
+		return FALSE;
+
+	data = comprehension_tlv_iter_get_data(iter);
+
+	if (data[0] != 0x01)
+		return FALSE;
+
+	*byte = data[0];
+
+	return TRUE;
+}
+
 static dataobj_handler handler_for_type(enum stk_data_object_type type)
 {
 	switch (type) {
@@ -1948,6 +1968,8 @@ static dataobj_handler handler_for_type(enum stk_data_object_type type)
 		return parse_dataobj_last_envelope;
 	case STK_DATA_OBJECT_TYPE_REGISTRY_APPLICATION_DATA:
 		return parse_dataobj_registry_application_data;
+	case STK_DATA_OBJECT_TYPE_ACTIVATE_DESCRIPTOR:
+		return parse_dataobj_activate_descriptor;
 	default:
 		return NULL;
 	};
-- 
1.7.0.4


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

* [PATCH 13/13] Add parser for broadcast network information objects
  2010-04-22 15:12 [PATCH 01/13] Add parser for browsing status objects Yang Gu
                   ` (10 preceding siblings ...)
  2010-04-22 15:12 ` [PATCH 12/13] Add parser for activate descriptor objects Yang Gu
@ 2010-04-22 15:12 ` Yang Gu
  2010-04-23 16:54 ` [PATCH 01/13] Add parser for browsing status objects Denis Kenzior
  12 siblings, 0 replies; 14+ messages in thread
From: Yang Gu @ 2010-04-22 15:12 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 2547 bytes --]

---
 src/stkutil.c |   25 +++++++++++++++++++++++++
 src/stkutil.h |   19 +++++++++++++++++++
 2 files changed, 44 insertions(+), 0 deletions(-)

diff --git a/src/stkutil.c b/src/stkutil.c
index 75b0035..a457e36 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -1803,6 +1803,29 @@ static gboolean parse_dataobj_activate_descriptor(
 	return TRUE;
 }
 
+/* Defined in TS 102.223 Section 8.90 */
+static gboolean parse_dataobj_broadcast_network_info(
+		struct comprehension_tlv_iter *iter, void *user)
+{
+	struct stk_broadcast_network_information *bni = user;
+	const unsigned char *data;
+	unsigned int len = comprehension_tlv_iter_get_length(iter);
+
+	if (len < 2)
+		return FALSE;
+
+	data = comprehension_tlv_iter_get_data(iter);
+
+	if (data[0] > 0x03)
+		return FALSE;
+
+	bni->tech = data[0];
+	bni->len = len - 1;
+	memcpy(bni->loc_info, data + 1, bni->len);
+
+	return TRUE;
+}
+
 static dataobj_handler handler_for_type(enum stk_data_object_type type)
 {
 	switch (type) {
@@ -1970,6 +1993,8 @@ static dataobj_handler handler_for_type(enum stk_data_object_type type)
 		return parse_dataobj_registry_application_data;
 	case STK_DATA_OBJECT_TYPE_ACTIVATE_DESCRIPTOR:
 		return parse_dataobj_activate_descriptor;
+	case STK_DATA_OBJECT_TYPE_BROADCAST_NETWORK_INFO:
+		return parse_dataobj_broadcast_network_info;
 	default:
 		return NULL;
 	};
diff --git a/src/stkutil.h b/src/stkutil.h
index b7341c7..5d2a818 100644
--- a/src/stkutil.h
+++ b/src/stkutil.h
@@ -370,6 +370,13 @@ enum stk_frame_layout_type {
 	STK_LAYOUT_VERTICAL = 		0x02
 };
 
+enum stk_broadcast_network_technology {
+	STK_BROADCAST_NETWORK_DVB_H = 0x00,
+	STK_BROADCAST_NETWORK_DVB_T = 0x01,
+	STK_BROADCAST_NETWORK_DVB_SH = 0x02,
+	STK_BROADCAST_NETWORK_T_DMB = 0x03
+};
+
 /* For data object that only has a byte array with undetermined length */
 struct stk_common_byte_array {
 	unsigned char *array;
@@ -764,6 +771,18 @@ struct stk_registry_application_data {
 	char *name;
 };
 
+/*
+ * According to 102.223 Section 8.90 the length of CTLV is 1 byte. This means
+ * that the maximum length is 127 bytes for the total length of broadcast
+ * network technology and location information. Thus the maximum length of
+ * location information is 126 bytes.
+ */
+struct stk_broadcast_network_information {
+	unsigned char tech;
+	unsigned char loc_info[126];
+	unsigned int len;
+};
+
 struct stk_command_display_text {
 	char *text;
 	struct stk_icon_id icon_id;
-- 
1.7.0.4


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

* Re: [PATCH 01/13] Add parser for browsing status objects
  2010-04-22 15:12 [PATCH 01/13] Add parser for browsing status objects Yang Gu
                   ` (11 preceding siblings ...)
  2010-04-22 15:12 ` [PATCH 13/13] Add parser for broadcast network information objects Yang Gu
@ 2010-04-23 16:54 ` Denis Kenzior
  12 siblings, 0 replies; 14+ messages in thread
From: Denis Kenzior @ 2010-04-23 16:54 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 174 bytes --]

Hi Yang,

> ---
>  src/stkutil.c |   10 ++++++++++
>  1 files changed, 10 insertions(+), 0 deletions(-)

All 13 patches have been applied, thanks.

Regards,
-Denis

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

end of thread, other threads:[~2010-04-23 16:54 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-22 15:12 [PATCH 01/13] Add parser for browsing status objects Yang Gu
2010-04-22 15:12 ` [PATCH 02/13] Add parser for frame layout objects Yang Gu
2010-04-22 15:12 ` [PATCH 03/13] Add parser for frames information objects Yang Gu
2010-04-22 15:12 ` [PATCH 04/13] Add parser for meid objects Yang Gu
2010-04-22 15:12 ` [PATCH 05/13] Add parser for multimedia message reference objects Yang Gu
2010-04-22 15:12 ` [PATCH 06/13] Add parser for multimedia message identifier objects Yang Gu
2010-04-22 15:12 ` [PATCH 07/13] Add parser for multimedia message transfer status objects Yang Gu
2010-04-22 15:12 ` [PATCH 08/13] Add parser for mm content identifier objects Yang Gu
2010-04-22 15:12 ` [PATCH 09/13] Add parser for multimedia message notification objects Yang Gu
2010-04-22 15:12 ` [PATCH 10/13] Add parser for last envelope objects Yang Gu
2010-04-22 15:12 ` [PATCH 11/13] Add parser for registry application data objects Yang Gu
2010-04-22 15:12 ` [PATCH 12/13] Add parser for activate descriptor objects Yang Gu
2010-04-22 15:12 ` [PATCH 13/13] Add parser for broadcast network information objects Yang Gu
2010-04-23 16:54 ` [PATCH 01/13] Add parser for browsing status objects 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.