* [PATCH 1/6] Add parser for location information objects
@ 2010-03-24 9:35 Yang Gu
2010-03-24 9:35 ` [PATCH 2/6] Add macro for ber-tlv more time Yang Gu
2010-03-24 20:00 ` [PATCH 1/6] Add parser for location information objects Denis Kenzior
0 siblings, 2 replies; 12+ messages in thread
From: Yang Gu @ 2010-03-24 9:35 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 3288 bytes --]
---
src/simutil.c | 2 +-
src/simutil.h | 1 +
src/stkutil.c | 32 ++++++++++++++++++++++++++++++++
src/stkutil.h | 9 +++++++++
4 files changed, 43 insertions(+), 1 deletions(-)
diff --git a/src/simutil.c b/src/simutil.c
index d9383b7..65ffa36 100644
--- a/src/simutil.c
+++ b/src/simutil.c
@@ -538,7 +538,7 @@ static char *sim_network_name_parse(const unsigned char *buffer, int length,
return ret;
}
-static void parse_mcc_mnc(const guint8 *bcd, char *mcc, char *mnc)
+void parse_mcc_mnc(const guint8 *bcd, char *mcc, char *mnc)
{
static const char digit_lut[] = "0123456789*#abd\0";
guint8 digit;
diff --git a/src/simutil.h b/src/simutil.h
index 043c21f..09964a8 100644
--- a/src/simutil.h
+++ b/src/simutil.h
@@ -181,6 +181,7 @@ const struct sim_eons_operator_info *sim_eons_lookup(struct sim_eons *eons,
const char *mnc);
void sim_eons_free(struct sim_eons *eons);
+void parse_mcc_mnc(const guint8 *bcd, char *mcc, char *mnc);
struct sim_spdi *sim_spdi_new(const guint8 *tlv, int length);
gboolean sim_spdi_lookup(struct sim_spdi *spdi,
const char *mcc, const char *mnc);
diff --git a/src/stkutil.c b/src/stkutil.c
index 9c83f49..a6b0284 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -519,6 +519,36 @@ error:
return FALSE;
}
+/* Defined in TS 102.223 Section 8.19 */
+static gboolean parse_dataobj_location_info(
+ struct comprehension_tlv_iter *iter, void *user)
+{
+ struct stk_location_info *li = user;
+ const unsigned char *data;
+ unsigned int len;
+
+ if (comprehension_tlv_iter_get_tag(iter) !=
+ STK_DATA_OBJECT_TYPE_LOCATION_INFO)
+ return FALSE;
+
+ len = comprehension_tlv_iter_get_length(iter);
+ if ((len != 5) && (len != 7) && (len != 9))
+ return FALSE;
+
+ data = comprehension_tlv_iter_get_data(iter);
+
+ parse_mcc_mnc(data, li->mcc, li->mnc);
+ memcpy(li->lac_tac, data + 3, 2);
+
+ if (len >= 7)
+ memcpy(li->cell_id, data+5, 2);
+
+ if (len == 9)
+ memcpy(li->ext_cell_id, data+7, 2);
+
+ return TRUE;
+}
+
/* Defined in TS 102.223 Section 8.31 */
static gboolean parse_dataobj_icon_id(struct comprehension_tlv_iter *iter,
void *user)
@@ -638,6 +668,8 @@ static dataobj_handler handler_for_type(enum stk_data_object_type type)
return parse_dataobj_tone;
case STK_DATA_OBJECT_TYPE_FILE_LIST:
return parse_dataobj_file_list;
+ case STK_DATA_OBJECT_TYPE_LOCATION_INFO:
+ return parse_dataobj_location_info;
case STK_DATA_OBJECT_TYPE_ICON_ID:
return parse_dataobj_icon_id;
case STK_DATA_OBJECT_TYPE_IMMEDIATE_RESPONSE:
diff --git a/src/stkutil.h b/src/stkutil.h
index 93ac854..00c985a 100644
--- a/src/stkutil.h
+++ b/src/stkutil.h
@@ -345,6 +345,15 @@ struct stk_result {
unsigned char *additional;
};
+/* Defined in TS 102.223 Section 8.19 */
+struct stk_location_info {
+ char mnc[OFONO_MAX_MNC_LENGTH + 1];
+ char mcc[OFONO_MAX_MCC_LENGTH + 1];
+ unsigned char lac_tac[2];
+ unsigned char cell_id[2];
+ unsigned char ext_cell_id[2];
+};
+
/* Define the struct of single file in TS102.223 Section 8.18.
* According to TS 11.11 Section 6.2, each file id has two bytes, and the
* maximum Dedicated File level is 2. So the maximum size of file is 8, which
--
1.6.3.3
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 2/6] Add macro for ber-tlv more time
2010-03-24 9:35 [PATCH 1/6] Add parser for location information objects Yang Gu
@ 2010-03-24 9:35 ` Yang Gu
2010-03-24 9:35 ` [PATCH 3/6] Unify some macro names of ber-tlv and comprehension tlv Yang Gu
2010-03-24 17:15 ` [PATCH 2/6] Add macro for ber-tlv more time Denis Kenzior
2010-03-24 20:00 ` [PATCH 1/6] Add parser for location information objects Denis Kenzior
1 sibling, 2 replies; 12+ messages in thread
From: Yang Gu @ 2010-03-24 9:35 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 694 bytes --]
---
src/stkutil.h | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/stkutil.h b/src/stkutil.h
index 00c985a..4b7c382 100644
--- a/src/stkutil.h
+++ b/src/stkutil.h
@@ -37,8 +37,9 @@ enum stk_envelope_type {
/* TS 102.223 Section 9.4 */
enum stk_command_type {
STK_COMMAND_TYPE_REFRESH = 0x01,
- STK_COMMAND_TYPE_POLL_INTERVAL = 0x02,
- STK_COMMAND_TYPE_POLLING_OFF = 0x03,
+ STK_COMMAND_TYPE_MORE_TIME = 0x02,
+ STK_COMMAND_TYPE_POLL_INTERVAL = 0x03,
+ STK_COMMAND_TYPE_POLLING_OFF = 0x04,
STK_COMMAND_TYPE_SETUP_EVENT_LIST = 0x05,
STK_COMMAND_TYPE_SETUP_CALL = 0x10,
STK_COMMAND_TYPE_SEND_SS = 0x11,
--
1.6.3.3
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 3/6] Unify some macro names of ber-tlv and comprehension tlv
2010-03-24 9:35 ` [PATCH 2/6] Add macro for ber-tlv more time Yang Gu
@ 2010-03-24 9:35 ` Yang Gu
2010-03-24 9:35 ` [PATCH 4/6] Add macro name of comprehension tlv cdma sms tpdu Yang Gu
2010-03-24 17:03 ` [PATCH 3/6] Unify some macro names of ber-tlv and comprehension tlv Denis Kenzior
2010-03-24 17:15 ` [PATCH 2/6] Add macro for ber-tlv more time Denis Kenzior
1 sibling, 2 replies; 12+ messages in thread
From: Yang Gu @ 2010-03-24 9:35 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 2707 bytes --]
---
src/stkutil.h | 22 +++++++++++-----------
1 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/src/stkutil.h b/src/stkutil.h
index 4b7c382..5724d29 100644
--- a/src/stkutil.h
+++ b/src/stkutil.h
@@ -54,7 +54,7 @@ enum stk_command_type {
STK_COMMAND_TYPE_GET_INPUT = 0x23,
STK_COMMAND_TYPE_SELECT_ITEM = 0x24,
STK_COMMAND_TYPE_SETUP_MENU = 0x25,
- STK_COMMAND_TYPE_PROVIDE_LOCAL_INFORMATION = 0x26,
+ STK_COMMAND_TYPE_PROVIDE_LOCAL_INFO = 0x26,
STK_COMMAND_TYPE_TIMER_MANAGEMENT = 0x27,
STK_COMMAND_TYPE_SETUP_IDLE_MODE_TEXT = 0x28,
STK_COMMAND_TYPE_PERFORM_CARD_APDU = 0x30,
@@ -69,13 +69,13 @@ enum stk_command_type {
STK_COMMAND_TYPE_SEND_DATA = 0x43,
STK_COMMAND_TYPE_GET_CHANNEL_STATUS = 0x44,
STK_COMMAND_TYPE_SERVICE_SEARCH = 0x45,
- STK_COMMAND_TYPE_GET_SERVICE_INFORMATION = 0x46,
+ STK_COMMAND_TYPE_GET_SERVICE_INFO = 0x46,
STK_COMMAND_TYPE_DECLARE_SERVICE = 0x47,
STK_COMMAND_TYPE_SET_FRAMES = 0x50,
STK_COMMAND_TYPE_GET_FRAMES_STATUS = 0x51,
- STK_COMMAND_TYPE_RETRIEVE_MMS = 0x60,
- STK_COMMAND_TYPE_SUBMIT_MMS = 0x61,
- STK_COMMAND_TYPE_DISPLAY_MMS = 0x62,
+ STK_COMMAND_TYPE_RETRIEVE_MM = 0x60,
+ STK_COMMAND_TYPE_SUBMIT_MM = 0x61,
+ STK_COMMAND_TYPE_DISPLAY_MM = 0x62,
STK_COMMAND_TYPE_ACTIVATE = 0x70,
STK_COMMAND_TYPE_END_SESSION = 0x81,
};
@@ -131,7 +131,7 @@ enum stk_data_object_type {
STK_DATA_OBJECT_TYPE_BROWSER_ID = 0x30,
STK_DATA_OBJECT_TYPE_URL = 0x31,
STK_DATA_OBJECT_TYPE_BEARER = 0x32,
- STK_DATA_OBJECT_TYPE_PROVISIONING_REFERENCE_FILE = 0x33,
+ STK_DATA_OBJECT_TYPE_PROVISIONING_FILE_REFERENCE = 0x33,
STK_DATA_OBJECT_TYPE_BROWSER_TERMINATION_CAUSE = 0x34,
STK_DATA_OBJECT_TYPE_BEARER_DESCRIPTION = 0x35,
STK_DATA_OBJECT_TYPE_CHANNEL_DATA = 0x36,
@@ -162,12 +162,12 @@ enum stk_data_object_type {
STK_DATA_OBJECT_TYPE_FRAME_LAYOUT = 0x66,
STK_DATA_OBJECT_TYPE_FRAMES_INFO = 0x67,
STK_DATA_OBJECT_TYPE_FRAME_ID = 0x68,
- STK_DATA_OBJECT_TYPE_MMS_REFERENCE = 0x6A,
- STK_DATA_OBJECT_TYPE_MMS_ID = 0x6B,
- STK_DATA_OBJECT_TYPE_MMS_TRANSFER_STATUS = 0x6C,
+ STK_DATA_OBJECT_TYPE_MM_REFERENCE = 0x6A,
+ STK_DATA_OBJECT_TYPE_MM_ID = 0x6B,
+ STK_DATA_OBJECT_TYPE_MM_TRANSFER_STATUS = 0x6C,
STK_DATA_OBJECT_TYPE_MEID = 0x6D,
- STK_DATA_OBJECT_TYPE_CONTENT_ID = 0x6E,
- STK_DATA_OBJECT_TYPE_MMS_NOTIFICATION = 0x6F,
+ STK_DATA_OBJECT_TYPE_MM_CONTENT_ID = 0x6E,
+ STK_DATA_OBJECT_TYPE_MM_NOTIFICATION = 0x6F,
STK_DATA_OBJECT_TYPE_LAST_ENVELOPE = 0x70,
STK_DATA_OBJECT_TYPE_REGISTRY_APPLICATION_DATA = 0x71,
STK_DATA_OBJECT_TYPE_ROUTING_AREA_INFO = 0x73,
--
1.6.3.3
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 4/6] Add macro name of comprehension tlv cdma sms tpdu
2010-03-24 9:35 ` [PATCH 3/6] Unify some macro names of ber-tlv and comprehension tlv Yang Gu
@ 2010-03-24 9:35 ` Yang Gu
2010-03-24 9:35 ` [PATCH 5/6] Add parser for imei objects Yang Gu
2010-03-24 17:15 ` [PATCH 4/6] Add macro name of comprehension tlv cdma sms tpdu Denis Kenzior
2010-03-24 17:03 ` [PATCH 3/6] Unify some macro names of ber-tlv and comprehension tlv Denis Kenzior
1 sibling, 2 replies; 12+ messages in thread
From: Yang Gu @ 2010-03-24 9:35 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 622 bytes --]
---
src/stkutil.h | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/src/stkutil.h b/src/stkutil.h
index 5724d29..d2cbee0 100644
--- a/src/stkutil.h
+++ b/src/stkutil.h
@@ -151,6 +151,7 @@ enum stk_data_object_type {
STK_DATA_OBJECT_TYPE_SERVICE_AVAILABILITY = 0x45,
STK_DATA_OBJECT_TYPE_ESN = 0x46,
STK_DATA_OBJECT_TYPE_NETWORK_ACCESS_NAME = 0x47,
+ STK_DATA_OBJECT_TYPE_CDMA_SMS_TPDU = 0x48,
STK_DATA_OBJECT_TYPE_REMOTE_ENTITY_ADDRESS = 0x49,
STK_DATA_OBJECT_TYPE_TEXT_ATTRIBUTE = 0x50,
STK_DATA_OBJECT_TYPE_ITEM_TEXT_ATTRIBUTE_LIST = 0x51,
--
1.6.3.3
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 5/6] Add parser for imei objects
2010-03-24 9:35 ` [PATCH 4/6] Add macro name of comprehension tlv cdma sms tpdu Yang Gu
@ 2010-03-24 9:35 ` Yang Gu
2010-03-24 9:35 ` [PATCH 6/6] Add parser for help request objects Yang Gu
2010-03-24 17:38 ` [PATCH 5/6] Add parser for imei objects Denis Kenzior
2010-03-24 17:15 ` [PATCH 4/6] Add macro name of comprehension tlv cdma sms tpdu Denis Kenzior
1 sibling, 2 replies; 12+ messages in thread
From: Yang Gu @ 2010-03-24 9:35 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1379 bytes --]
---
src/stkutil.c | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/src/stkutil.c b/src/stkutil.c
index a6b0284..3e423b5 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -549,6 +549,28 @@ static gboolean parse_dataobj_location_info(
return TRUE;
}
+/* Defined in TS 102.223 Section 8.20 */
+static gboolean parse_dataobj_imei(struct comprehension_tlv_iter *iter,
+ void *user)
+{
+ char **imei = user;
+ const unsigned char *data;
+ unsigned int len;
+
+ if (comprehension_tlv_iter_get_tag(iter) !=
+ STK_DATA_OBJECT_TYPE_IMEI)
+ return FALSE;
+
+ len = comprehension_tlv_iter_get_length(iter);
+ if (len != 8)
+ return FALSE;
+
+ data = comprehension_tlv_iter_get_data(iter);
+ memcpy(*imei, data, len);
+
+ return TRUE;
+}
+
/* Defined in TS 102.223 Section 8.31 */
static gboolean parse_dataobj_icon_id(struct comprehension_tlv_iter *iter,
void *user)
@@ -670,6 +692,8 @@ static dataobj_handler handler_for_type(enum stk_data_object_type type)
return parse_dataobj_file_list;
case STK_DATA_OBJECT_TYPE_LOCATION_INFO:
return parse_dataobj_location_info;
+ case STK_DATA_OBJECT_TYPE_IMEI:
+ return parse_dataobj_imei;
case STK_DATA_OBJECT_TYPE_ICON_ID:
return parse_dataobj_icon_id;
case STK_DATA_OBJECT_TYPE_IMMEDIATE_RESPONSE:
--
1.6.3.3
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 6/6] Add parser for help request objects
2010-03-24 9:35 ` [PATCH 5/6] Add parser for imei objects Yang Gu
@ 2010-03-24 9:35 ` Yang Gu
2010-03-24 17:44 ` Denis Kenzior
2010-03-24 17:38 ` [PATCH 5/6] Add parser for imei objects Denis Kenzior
1 sibling, 1 reply; 12+ messages in thread
From: Yang Gu @ 2010-03-24 9:35 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1764 bytes --]
---
src/stkutil.c | 27 +++++++++++++++++++++++++++
1 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/src/stkutil.c b/src/stkutil.c
index 3e423b5..215013d 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -50,6 +50,23 @@ struct gsm_sms_tpdu {
unsigned char tpdu[164];
};
+/* For data object to indicate the existence */
+static gboolean parse_dataobj_common_bool(struct comprehension_tlv_iter *iter,
+ void *user, enum stk_data_object_type type)
+{
+ gboolean *ret = user;
+
+ if (comprehension_tlv_iter_get_tag(iter) != type)
+ return FALSE;
+
+ if (comprehension_tlv_iter_get_length(iter) != 0)
+ return FALSE;
+
+ *ret = TRUE;
+
+ return TRUE;
+}
+
/* Defined in TS 102.223 Section 8.1 */
static gboolean parse_dataobj_address(struct comprehension_tlv_iter *iter,
void *user)
@@ -571,6 +588,14 @@ static gboolean parse_dataobj_imei(struct comprehension_tlv_iter *iter,
return TRUE;
}
+/* Defined in TS 102.223 Section 8.21 */
+static gboolean parse_dataobj_help_request(struct comprehension_tlv_iter *iter,
+ void *user)
+{
+ return parse_dataobj_common_bool(iter, user,
+ STK_DATA_OBJECT_TYPE_HELP_REQUEST);
+}
+
/* Defined in TS 102.223 Section 8.31 */
static gboolean parse_dataobj_icon_id(struct comprehension_tlv_iter *iter,
void *user)
@@ -694,6 +719,8 @@ static dataobj_handler handler_for_type(enum stk_data_object_type type)
return parse_dataobj_location_info;
case STK_DATA_OBJECT_TYPE_IMEI:
return parse_dataobj_imei;
+ case STK_DATA_OBJECT_TYPE_HELP_REQUEST:
+ return parse_dataobj_help_request;
case STK_DATA_OBJECT_TYPE_ICON_ID:
return parse_dataobj_icon_id;
case STK_DATA_OBJECT_TYPE_IMMEDIATE_RESPONSE:
--
1.6.3.3
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 3/6] Unify some macro names of ber-tlv and comprehension tlv
2010-03-24 9:35 ` [PATCH 3/6] Unify some macro names of ber-tlv and comprehension tlv Yang Gu
2010-03-24 9:35 ` [PATCH 4/6] Add macro name of comprehension tlv cdma sms tpdu Yang Gu
@ 2010-03-24 17:03 ` Denis Kenzior
1 sibling, 0 replies; 12+ messages in thread
From: Denis Kenzior @ 2010-03-24 17:03 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 3084 bytes --]
Hi Yang,
> ---
> src/stkutil.h | 22 +++++++++++-----------
> 1 files changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/src/stkutil.h b/src/stkutil.h
> index 4b7c382..5724d29 100644
> --- a/src/stkutil.h
> +++ b/src/stkutil.h
> @@ -54,7 +54,7 @@ enum stk_command_type {
> STK_COMMAND_TYPE_GET_INPUT = 0x23,
> STK_COMMAND_TYPE_SELECT_ITEM = 0x24,
> STK_COMMAND_TYPE_SETUP_MENU = 0x25,
> - STK_COMMAND_TYPE_PROVIDE_LOCAL_INFORMATION = 0x26,
> + STK_COMMAND_TYPE_PROVIDE_LOCAL_INFO = 0x26,
I'm fine with this one
> STK_COMMAND_TYPE_TIMER_MANAGEMENT = 0x27,
> STK_COMMAND_TYPE_SETUP_IDLE_MODE_TEXT = 0x28,
> STK_COMMAND_TYPE_PERFORM_CARD_APDU = 0x30,
> @@ -69,13 +69,13 @@ enum stk_command_type {
> STK_COMMAND_TYPE_SEND_DATA = 0x43,
> STK_COMMAND_TYPE_GET_CHANNEL_STATUS = 0x44,
> STK_COMMAND_TYPE_SERVICE_SEARCH = 0x45,
> - STK_COMMAND_TYPE_GET_SERVICE_INFORMATION = 0x46,
> + STK_COMMAND_TYPE_GET_SERVICE_INFO = 0x46,
And I'm fine with this one
> STK_COMMAND_TYPE_DECLARE_SERVICE = 0x47,
> STK_COMMAND_TYPE_SET_FRAMES = 0x50,
> STK_COMMAND_TYPE_GET_FRAMES_STATUS = 0x51,
> - STK_COMMAND_TYPE_RETRIEVE_MMS = 0x60,
> - STK_COMMAND_TYPE_SUBMIT_MMS = 0x61,
> - STK_COMMAND_TYPE_DISPLAY_MMS = 0x62,
> + STK_COMMAND_TYPE_RETRIEVE_MM = 0x60,
> + STK_COMMAND_TYPE_SUBMIT_MM = 0x61,
> + STK_COMMAND_TYPE_DISPLAY_MM = 0x62,
This one is silly, MM is multimedia message, MMS is a much clearer name
> STK_COMMAND_TYPE_ACTIVATE = 0x70,
> STK_COMMAND_TYPE_END_SESSION = 0x81,
> };
> @@ -131,7 +131,7 @@ enum stk_data_object_type {
> STK_DATA_OBJECT_TYPE_BROWSER_ID = 0x30,
> STK_DATA_OBJECT_TYPE_URL = 0x31,
> STK_DATA_OBJECT_TYPE_BEARER = 0x32,
> - STK_DATA_OBJECT_TYPE_PROVISIONING_REFERENCE_FILE = 0x33,
> + STK_DATA_OBJECT_TYPE_PROVISIONING_FILE_REFERENCE = 0x33,
I'm ok with this one
> STK_DATA_OBJECT_TYPE_BROWSER_TERMINATION_CAUSE = 0x34,
> STK_DATA_OBJECT_TYPE_BEARER_DESCRIPTION = 0x35,
> STK_DATA_OBJECT_TYPE_CHANNEL_DATA = 0x36,
> @@ -162,12 +162,12 @@ enum stk_data_object_type {
> STK_DATA_OBJECT_TYPE_FRAME_LAYOUT = 0x66,
> STK_DATA_OBJECT_TYPE_FRAMES_INFO = 0x67,
> STK_DATA_OBJECT_TYPE_FRAME_ID = 0x68,
> - STK_DATA_OBJECT_TYPE_MMS_REFERENCE = 0x6A,
> - STK_DATA_OBJECT_TYPE_MMS_ID = 0x6B,
> - STK_DATA_OBJECT_TYPE_MMS_TRANSFER_STATUS = 0x6C,
> + STK_DATA_OBJECT_TYPE_MM_REFERENCE = 0x6A,
> + STK_DATA_OBJECT_TYPE_MM_ID = 0x6B,
> + STK_DATA_OBJECT_TYPE_MM_TRANSFER_STATUS = 0x6C,
Keep MMS here
> STK_DATA_OBJECT_TYPE_MEID = 0x6D,
> - STK_DATA_OBJECT_TYPE_CONTENT_ID = 0x6E,
> - STK_DATA_OBJECT_TYPE_MMS_NOTIFICATION = 0x6F,
> + STK_DATA_OBJECT_TYPE_MM_CONTENT_ID = 0x6E,
Rename this MMS_CONTENT_ID
> + STK_DATA_OBJECT_TYPE_MM_NOTIFICATION = 0x6F,
Keep MMS here
> STK_DATA_OBJECT_TYPE_LAST_ENVELOPE = 0x70,
> STK_DATA_OBJECT_TYPE_REGISTRY_APPLICATION_DATA = 0x71,
> STK_DATA_OBJECT_TYPE_ROUTING_AREA_INFO = 0x73,
>
Regards,
-Denis
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/6] Add macro for ber-tlv more time
2010-03-24 9:35 ` [PATCH 2/6] Add macro for ber-tlv more time Yang Gu
2010-03-24 9:35 ` [PATCH 3/6] Unify some macro names of ber-tlv and comprehension tlv Yang Gu
@ 2010-03-24 17:15 ` Denis Kenzior
1 sibling, 0 replies; 12+ messages in thread
From: Denis Kenzior @ 2010-03-24 17:15 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 167 bytes --]
Hi Yang,
> ---
> src/stkutil.h | 5 +++--
> 1 files changed, 3 insertions(+), 2 deletions(-)
>
This patch has been applied, thanks.
Regards,
-Denis
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 4/6] Add macro name of comprehension tlv cdma sms tpdu
2010-03-24 9:35 ` [PATCH 4/6] Add macro name of comprehension tlv cdma sms tpdu Yang Gu
2010-03-24 9:35 ` [PATCH 5/6] Add parser for imei objects Yang Gu
@ 2010-03-24 17:15 ` Denis Kenzior
1 sibling, 0 replies; 12+ messages in thread
From: Denis Kenzior @ 2010-03-24 17:15 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 163 bytes --]
Hi Yang,
> ---
> src/stkutil.h | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
This patch has been applied, thanks.
Regards,
-Denis
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 5/6] Add parser for imei objects
2010-03-24 9:35 ` [PATCH 5/6] Add parser for imei objects Yang Gu
2010-03-24 9:35 ` [PATCH 6/6] Add parser for help request objects Yang Gu
@ 2010-03-24 17:38 ` Denis Kenzior
1 sibling, 0 replies; 12+ messages in thread
From: Denis Kenzior @ 2010-03-24 17:38 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1124 bytes --]
Hi Yang,
> ---
> src/stkutil.c | 24 ++++++++++++++++++++++++
> 1 files changed, 24 insertions(+), 0 deletions(-)
>
> diff --git a/src/stkutil.c b/src/stkutil.c
> index a6b0284..3e423b5 100644
> --- a/src/stkutil.c
> +++ b/src/stkutil.c
> @@ -549,6 +549,28 @@ static gboolean parse_dataobj_location_info(
> return TRUE;
> }
>
> +/* Defined in TS 102.223 Section 8.20 */
> +static gboolean parse_dataobj_imei(struct comprehension_tlv_iter *iter,
> + void *user)
> +{
> + char **imei = user;
So this one implies character data (e.g. string), but...
> + const unsigned char *data;
> + unsigned int len;
> +
> + if (comprehension_tlv_iter_get_tag(iter) !=
> + STK_DATA_OBJECT_TYPE_IMEI)
> + return FALSE;
> +
> + len = comprehension_tlv_iter_get_length(iter);
> + if (len != 8)
> + return FALSE;
> +
> + data = comprehension_tlv_iter_get_data(iter);
> + memcpy(*imei, data, len);
Here you copy binary data into a string array. Since IMEI is essentially bcd
encoded I suggest you parse it into string form here.
> +
> + return TRUE;
> +}
> +
Regards,
-Denis
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 6/6] Add parser for help request objects
2010-03-24 9:35 ` [PATCH 6/6] Add parser for help request objects Yang Gu
@ 2010-03-24 17:44 ` Denis Kenzior
0 siblings, 0 replies; 12+ messages in thread
From: Denis Kenzior @ 2010-03-24 17:44 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 2057 bytes --]
Hi Yang,
> ---
> src/stkutil.c | 27 +++++++++++++++++++++++++++
> 1 files changed, 27 insertions(+), 0 deletions(-)
>
> diff --git a/src/stkutil.c b/src/stkutil.c
> index 3e423b5..215013d 100644
> --- a/src/stkutil.c
> +++ b/src/stkutil.c
> @@ -50,6 +50,23 @@ struct gsm_sms_tpdu {
> unsigned char tpdu[164];
> };
>
> +/* For data object to indicate the existence */
> +static gboolean parse_dataobj_common_bool(struct comprehension_tlv_iter
> *iter, + void *user, enum stk_data_object_type type)
> +{
> + gboolean *ret = user;
> +
> + if (comprehension_tlv_iter_get_tag(iter) != type)
> + return FALSE;
> +
> + if (comprehension_tlv_iter_get_length(iter) != 0)
> + return FALSE;
> +
> + *ret = TRUE;
> +
> + return TRUE;
> +}
> +
> /* Defined in TS 102.223 Section 8.1 */
> static gboolean parse_dataobj_address(struct comprehension_tlv_iter *iter,
> void *user)
> @@ -571,6 +588,14 @@ static gboolean parse_dataobj_imei(struct
> comprehension_tlv_iter *iter, return TRUE;
> }
>
> +/* Defined in TS 102.223 Section 8.21 */
> +static gboolean parse_dataobj_help_request(struct comprehension_tlv_iter
> *iter, + void *user)
> +{
> + return parse_dataobj_common_bool(iter, user,
> + STK_DATA_OBJECT_TYPE_HELP_REQUEST);
> +}
> +
Your patch looks fine, but after looking at the spec I couldn't find any other
data object that had this structure. What else is this going to be used for?
> /* Defined in TS 102.223 Section 8.31 */
> static gboolean parse_dataobj_icon_id(struct comprehension_tlv_iter *iter,
> void *user)
> @@ -694,6 +719,8 @@ static dataobj_handler handler_for_type(enum
> stk_data_object_type type) return parse_dataobj_location_info;
> case STK_DATA_OBJECT_TYPE_IMEI:
> return parse_dataobj_imei;
> + case STK_DATA_OBJECT_TYPE_HELP_REQUEST:
> + return parse_dataobj_help_request;
> case STK_DATA_OBJECT_TYPE_ICON_ID:
> return parse_dataobj_icon_id;
> case STK_DATA_OBJECT_TYPE_IMMEDIATE_RESPONSE:
>
Regards,
-Denis
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/6] Add parser for location information objects
2010-03-24 9:35 [PATCH 1/6] Add parser for location information objects Yang Gu
2010-03-24 9:35 ` [PATCH 2/6] Add macro for ber-tlv more time Yang Gu
@ 2010-03-24 20:00 ` Denis Kenzior
1 sibling, 0 replies; 12+ messages in thread
From: Denis Kenzior @ 2010-03-24 20:00 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 3878 bytes --]
Hi Yang,
> ---
> src/simutil.c | 2 +-
> src/simutil.h | 1 +
> src/stkutil.c | 32 ++++++++++++++++++++++++++++++++
> src/stkutil.h | 9 +++++++++
> 4 files changed, 43 insertions(+), 1 deletions(-)
>
> diff --git a/src/simutil.c b/src/simutil.c
> index d9383b7..65ffa36 100644
> --- a/src/simutil.c
> +++ b/src/simutil.c
> @@ -538,7 +538,7 @@ static char *sim_network_name_parse(const unsigned char
> *buffer, int length, return ret;
> }
>
> -static void parse_mcc_mnc(const guint8 *bcd, char *mcc, char *mnc)
> +void parse_mcc_mnc(const guint8 *bcd, char *mcc, char *mnc)
If this is becoming public api, then it should have a sim_ prefix like the rest
of the functions in simutil.h.
> {
> static const char digit_lut[] = "0123456789*#abd\0";
> guint8 digit;
> diff --git a/src/simutil.h b/src/simutil.h
> index 043c21f..09964a8 100644
> --- a/src/simutil.h
> +++ b/src/simutil.h
> @@ -181,6 +181,7 @@ const struct sim_eons_operator_info
> *sim_eons_lookup(struct sim_eons *eons, const char *mnc);
> void sim_eons_free(struct sim_eons *eons);
>
> +void parse_mcc_mnc(const guint8 *bcd, char *mcc, char *mnc);
> struct sim_spdi *sim_spdi_new(const guint8 *tlv, int length);
> gboolean sim_spdi_lookup(struct sim_spdi *spdi,
> const char *mcc, const char *mnc);
> diff --git a/src/stkutil.c b/src/stkutil.c
> index 9c83f49..a6b0284 100644
> --- a/src/stkutil.c
> +++ b/src/stkutil.c
> @@ -519,6 +519,36 @@ error:
> return FALSE;
> }
>
> +/* Defined in TS 102.223 Section 8.19 */
> +static gboolean parse_dataobj_location_info(
> + struct comprehension_tlv_iter *iter, void *user)
> +{
> + struct stk_location_info *li = user;
> + const unsigned char *data;
> + unsigned int len;
> +
> + if (comprehension_tlv_iter_get_tag(iter) !=
> + STK_DATA_OBJECT_TYPE_LOCATION_INFO)
> + return FALSE;
> +
> + len = comprehension_tlv_iter_get_length(iter);
> + if ((len != 5) && (len != 7) && (len != 9))
> + return FALSE;
> +
> + data = comprehension_tlv_iter_get_data(iter);
> +
> + parse_mcc_mnc(data, li->mcc, li->mnc);
> + memcpy(li->lac_tac, data + 3, 2);
> +
> + if (len >= 7)
> + memcpy(li->cell_id, data+5, 2);
> +
> + if (len == 9)
> + memcpy(li->ext_cell_id, data+7, 2);
See my comments below, these should be proper integers. Make sure the byte-
ordering is correct.
> +
> + return TRUE;
> +}
> +
> /* Defined in TS 102.223 Section 8.31 */
> static gboolean parse_dataobj_icon_id(struct comprehension_tlv_iter *iter,
> void *user)
> @@ -638,6 +668,8 @@ static dataobj_handler handler_for_type(enum
> stk_data_object_type type) return parse_dataobj_tone;
> case STK_DATA_OBJECT_TYPE_FILE_LIST:
> return parse_dataobj_file_list;
> + case STK_DATA_OBJECT_TYPE_LOCATION_INFO:
> + return parse_dataobj_location_info;
> case STK_DATA_OBJECT_TYPE_ICON_ID:
> return parse_dataobj_icon_id;
> case STK_DATA_OBJECT_TYPE_IMMEDIATE_RESPONSE:
> diff --git a/src/stkutil.h b/src/stkutil.h
> index 93ac854..00c985a 100644
> --- a/src/stkutil.h
> +++ b/src/stkutil.h
> @@ -345,6 +345,15 @@ struct stk_result {
> unsigned char *additional;
> };
>
> +/* Defined in TS 102.223 Section 8.19 */
> +struct stk_location_info {
> + char mnc[OFONO_MAX_MNC_LENGTH + 1];
> + char mcc[OFONO_MAX_MCC_LENGTH + 1];
> + unsigned char lac_tac[2];
This should be just unsigned short
> + unsigned char cell_id[2];
And this one
> + unsigned char ext_cell_id[2];
And this one too
You also need a ofono_bool_t to signify the presence of lac/ci/ext_ci
> +};
> +
> /* Define the struct of single file in TS102.223 Section 8.18.
> * According to TS 11.11 Section 6.2, each file id has two bytes, and the
> * maximum Dedicated File level is 2. So the maximum size of file is 8,
> which
>
Regards,
-Denis
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2010-03-24 20:00 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-24 9:35 [PATCH 1/6] Add parser for location information objects Yang Gu
2010-03-24 9:35 ` [PATCH 2/6] Add macro for ber-tlv more time Yang Gu
2010-03-24 9:35 ` [PATCH 3/6] Unify some macro names of ber-tlv and comprehension tlv Yang Gu
2010-03-24 9:35 ` [PATCH 4/6] Add macro name of comprehension tlv cdma sms tpdu Yang Gu
2010-03-24 9:35 ` [PATCH 5/6] Add parser for imei objects Yang Gu
2010-03-24 9:35 ` [PATCH 6/6] Add parser for help request objects Yang Gu
2010-03-24 17:44 ` Denis Kenzior
2010-03-24 17:38 ` [PATCH 5/6] Add parser for imei objects Denis Kenzior
2010-03-24 17:15 ` [PATCH 4/6] Add macro name of comprehension tlv cdma sms tpdu Denis Kenzior
2010-03-24 17:03 ` [PATCH 3/6] Unify some macro names of ber-tlv and comprehension tlv Denis Kenzior
2010-03-24 17:15 ` [PATCH 2/6] Add macro for ber-tlv more time Denis Kenzior
2010-03-24 20:00 ` [PATCH 1/6] Add parser for location information objects Denis Kenzior
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox