summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2010-03-12 08:19:25 -0600
committerDenis Kenzior <denkenz@gmail.com>2010-03-15 21:02:06 -0500
commit6986cc4760f61eb1d5d078051cdab8ef1489927a (patch)
treebaf5890f8a8ff07b0da23e6db1730c5578c85aae
parenta74bd04edff25ec086e2d5672e8751f0fd8d9c5c (diff)
downloadofono-6986cc4760f61eb1d5d078051cdab8ef1489927a.tar.bz2
Refactor: stk result dataobject
-rw-r--r--src/stkutil.c4
-rw-r--r--src/stkutil.h43
2 files changed, 44 insertions, 3 deletions
diff --git a/src/stkutil.c b/src/stkutil.c
index a8c3d807..7655b60a 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -246,7 +246,7 @@ static gboolean parse_dataobj_response_len(struct comprehension_tlv_iter *iter,
/* Defined in TS 102.223 Section 8.12 */
static gboolean parse_dataobj_result(struct comprehension_tlv_iter *iter,
- void *user)
+ void *user)
{
struct stk_result *result = user;
const unsigned char *data;
@@ -268,7 +268,7 @@ static gboolean parse_dataobj_result(struct comprehension_tlv_iter *iter,
(data[0] == 0x3c) || (data[0] == 0x3d)))
return FALSE;
- result->general = data[0];
+ result->type = data[0];
result->additional_len = len - 1;
result->additional = g_malloc(len-1);
memcpy(result->additional, data+1, len-1);
diff --git a/src/stkutil.h b/src/stkutil.h
index 9b3464e4..116fe777 100644
--- a/src/stkutil.h
+++ b/src/stkutil.h
@@ -192,6 +192,47 @@ enum stk_duration_type {
STK_DURATION_TYPE_SECOND_TENTHS = 0x02,
};
+/* Defined according to TS 102.223 Section 8.12 */
+enum stk_result_type {
+ /* 0x00 to 0x1F are used to indicate that command has been performed */
+ STK_RESULT_TYPE_SUCCESS = 0x00,
+ STK_RESULT_TYPE_PARTIAL = 0x01,
+ STK_RESULT_TYPE_MISSING_INFO = 0x02,
+ STK_RESULT_TYPE_REFRESH_WITH_EFS = 0x03,
+ STK_RESULT_TYPE_NO_ICON = 0x04,
+ STK_RESULT_TYPE_CALL_CONTROL = 0x05,
+ STK_RESULT_TYPE_NO_SERVICE = 0x06,
+ STK_RESULT_TYPE_MODIFED = 0x07,
+ STK_RESULT_TYPE_REFRES_NO_NAA = 0x08,
+ STK_RESULT_TYPE_NO_TONE = 0x09,
+ STK_RESULT_TYPE_USER_TERMINATED = 0x10,
+ STK_RESULT_TYPE_GO_BACK = 0x11,
+ STK_RESULT_TYPE_NO_RESPONSE = 0x12,
+ STK_RESULT_TYPE_HELP_REQUESTED = 0x13,
+
+ /* 0x20 to 0x2F are used to indicate that SIM should retry */
+ STK_RESULT_TYPE_TERMINAL_BUSY = 0x20,
+ STK_RESULT_TYPE_NETWORK_UNAVAILABLE = 0x21,
+ STK_RESULT_TYPE_USER_REJECT = 0x22,
+ STK_RESULT_TYPE_USER_CANCEL = 0x23,
+ STK_RESULT_TYPE_TIMER_CONFLICT = 0x24,
+ STK_RESULT_TYPE_CALL_CONTROL_TEMPORARY = 0x25,
+ STK_RESULT_TYPE_BROWSER_TEMPORARY = 0x26,
+ STK_RESULT_TYPE_MMS_TEMPORARY = 0x27,
+
+ /* 0x30 to 0x3F are used to indicate permanent problems */
+ STK_RESULT_TYPE_NOT_CAPABLE = 0x30,
+ STK_RESULT_TYPE_COMMAND_NOT_UNDERSTOOD = 0x31,
+ STK_RESULT_TYPE_DATA_NOT_UNDERSTOOD = 0x32,
+ STK_RESULT_TYPE_COMMAND_ID_UNKNOWN = 0x33,
+ STK_RESULT_TYPE_MINIMUM_NOT_MET = 0x36,
+ STK_RESULT_TYPE_CALL_CONTROL_PERMANENT = 0x39,
+ STK_RESULT_TYPE_BIP_ERROR = 0x3A,
+ STK_RESULT_TYPE_ACCESS_TECHNOLOGY_ERROR = 0x3B,
+ STK_RESULT_TYPE_FRAMES_ERROR = 0x3C,
+ STK_RESULT_TYPE_MMS_ERROR = 0x3D,
+};
+
/* Defined in TS 102.223 Section 8.1 */
struct stk_address {
unsigned char ton_npi;
@@ -268,7 +309,7 @@ struct stk_response_length {
/* Defined in TS 102.223 Section 8.12 */
struct stk_result {
- unsigned char general;
+ enum stk_result_type type;
unsigned int additional_len;
unsigned char *additional;
};