* [PATCH 1/8] stk: Make parse_dataobj not consume extra data
@ 2010-05-26 14:39 Yang Gu
2010-05-26 14:39 ` [PATCH 2/8] stk: Add parser for launch browser commands Yang Gu
` (7 more replies)
0 siblings, 8 replies; 9+ messages in thread
From: Yang Gu @ 2010-05-26 14:39 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1174 bytes --]
---
src/stkutil.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/src/stkutil.c b/src/stkutil.c
index 016bde9..fd5b7c6 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -2023,6 +2023,7 @@ static gboolean parse_dataobj(struct comprehension_tlv_iter *iter,
GSList *l;
va_list args;
gboolean minimum_set = TRUE;
+ struct comprehension_tlv_iter iter_old;
va_start(args, type);
@@ -2056,11 +2057,14 @@ static gboolean parse_dataobj(struct comprehension_tlv_iter *iter,
if (handler(iter, entry->data))
entry->parsed = TRUE;
+ comprehension_tlv_iter_copy(iter, &iter_old);
+
if (comprehension_tlv_iter_next(iter) == FALSE)
break;
}
}
+ comprehension_tlv_iter_copy(&iter_old, iter);
out:
for (l = entries; l; l = l->next) {
struct dataobj_handler_entry *entry = l->data;
@@ -2293,6 +2297,9 @@ static GSList *parse_item_list(struct comprehension_tlv_iter *iter)
struct stk_item item;
GSList *list = NULL;
+ if (comprehension_tlv_iter_next(iter) != TRUE)
+ return NULL;
+
if (comprehension_tlv_iter_get_tag(iter) != tag)
return NULL;
--
1.7.0.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/8] stk: Add parser for launch browser commands
2010-05-26 14:39 [PATCH 1/8] stk: Make parse_dataobj not consume extra data Yang Gu
@ 2010-05-26 14:39 ` Yang Gu
2010-05-26 14:39 ` [PATCH 3/8] teststk: Add check of len in byte array Yang Gu
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Yang Gu @ 2010-05-26 14:39 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 4786 bytes --]
---
src/stkutil.c | 103 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
src/stkutil.h | 16 +++++++++
2 files changed, 119 insertions(+), 0 deletions(-)
diff --git a/src/stkutil.c b/src/stkutil.c
index fd5b7c6..12af7fc 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -2865,6 +2865,106 @@ static gboolean parse_language_notification(struct stk_command *command,
return TRUE;
}
+static void destroy_launch_browser(struct stk_command *command)
+{
+ g_free(command->launch_browser.url);
+ g_free(command->launch_browser.bearer.array);
+ g_slist_foreach(command->launch_browser.prov_file_refs,
+ (GFunc)g_free, NULL);
+ g_slist_free(command->launch_browser.prov_file_refs);
+ g_free(command->launch_browser.text_gateway_proxy_id);
+ g_free(command->launch_browser.alpha_id);
+ g_free(command->launch_browser.network_name.array);
+ g_free(command->launch_browser.text_usr);
+ g_free(command->launch_browser.text_passwd);
+}
+
+static GSList *parse_provisioining_file_reference_list(
+ struct comprehension_tlv_iter *iter)
+{
+ unsigned short tag = STK_DATA_OBJECT_TYPE_PROVISIONING_FILE_REFERENCE;
+ struct comprehension_tlv_iter iter_old;
+ struct stk_file file;
+ GSList *list = NULL;
+
+ if (comprehension_tlv_iter_get_tag(iter) != tag)
+ return NULL;
+
+ do {
+ comprehension_tlv_iter_copy(iter, &iter_old);
+ memset(&file, 0, sizeof(file));
+
+ if (parse_dataobj_provisioning_file_reference(iter, &file)
+ == TRUE)
+ list = g_slist_prepend(list,
+ g_memdup(&file, sizeof(file)));
+ } while (comprehension_tlv_iter_next(iter) == TRUE &&
+ comprehension_tlv_iter_get_tag(iter) == tag);
+
+ comprehension_tlv_iter_copy(&iter_old, iter);
+ list = g_slist_reverse(list);
+
+ return list;
+}
+
+static gboolean parse_launch_browser(struct stk_command *command,
+ struct comprehension_tlv_iter *iter)
+{
+ struct stk_command_launch_browser *obj = &command->launch_browser;
+ gboolean ret;
+
+ if (command->src != STK_DEVICE_IDENTITY_TYPE_UICC)
+ return FALSE;
+
+ if (command->dst != STK_DEVICE_IDENTITY_TYPE_TERMINAL)
+ return FALSE;
+
+ ret = parse_dataobj(iter,
+ STK_DATA_OBJECT_TYPE_BROWSER_ID, 0,
+ &obj->browser_id,
+ STK_DATA_OBJECT_TYPE_URL,
+ DATAOBJ_FLAG_MANDATORY | DATAOBJ_FLAG_MINIMUM,
+ &obj->url,
+ STK_DATA_OBJECT_TYPE_BEARER, 0,
+ &obj->bearer,
+ STK_DATA_OBJECT_TYPE_INVALID);
+
+ if (ret == FALSE)
+ goto error;
+
+ obj->prov_file_refs = parse_provisioining_file_reference_list(iter);
+
+ ret = parse_dataobj(iter,
+ STK_DATA_OBJECT_TYPE_TEXT, 0,
+ &obj->text_gateway_proxy_id,
+ STK_DATA_OBJECT_TYPE_ALPHA_ID, 0,
+ &obj->alpha_id,
+ STK_DATA_OBJECT_TYPE_ICON_ID, 0,
+ &obj->icon_id,
+ STK_DATA_OBJECT_TYPE_TEXT_ATTRIBUTE, 0,
+ &obj->text_attr,
+ STK_DATA_OBJECT_TYPE_FRAME_ID, 0,
+ &obj->frame_id,
+ STK_DATA_OBJECT_TYPE_NETWORK_ACCESS_NAME, 0,
+ &obj->network_name,
+ STK_DATA_OBJECT_TYPE_TEXT, 0,
+ &obj->text_usr,
+ STK_DATA_OBJECT_TYPE_TEXT, 0,
+ &obj->text_passwd,
+ STK_DATA_OBJECT_TYPE_INVALID);
+
+ if (ret == FALSE)
+ return FALSE;
+
+ command->destructor = destroy_launch_browser;
+
+ return TRUE;
+
+error:
+ destroy_launch_browser(command);
+ return FALSE;
+}
+
struct stk_command *stk_command_new_from_pdu(const unsigned char *pdu,
unsigned int len)
{
@@ -2992,6 +3092,9 @@ struct stk_command *stk_command_new_from_pdu(const unsigned char *pdu,
case STK_COMMAND_TYPE_LANGUAGE_NOTIFICATION:
ok = parse_language_notification(command, &iter);
break;
+ case STK_COMMAND_TYPE_LAUNCH_BROWSER:
+ ok = parse_launch_browser(command, &iter);
+ break;
default:
ok = FALSE;
break;
diff --git a/src/stkutil.h b/src/stkutil.h
index 33a1325..1bc419b 100644
--- a/src/stkutil.h
+++ b/src/stkutil.h
@@ -992,6 +992,21 @@ struct stk_command_language_notification {
char language[3];
};
+struct stk_command_launch_browser {
+ unsigned char browser_id;
+ char *url;
+ struct stk_common_byte_array bearer;
+ GSList *prov_file_refs;
+ char *text_gateway_proxy_id;
+ char *alpha_id;
+ struct stk_icon_id icon_id;
+ struct stk_text_attribute text_attr;
+ struct stk_frame_id frame_id;
+ struct stk_common_byte_array network_name;
+ char *text_usr;
+ char *text_passwd;
+};
+
struct stk_command {
unsigned char number;
unsigned char type;
@@ -1017,6 +1032,7 @@ struct stk_command {
struct stk_command_run_at_command run_at_command;
struct stk_command_send_dtmf send_dtmf;
struct stk_command_language_notification language_notification;
+ struct stk_command_launch_browser launch_browser;
};
void (*destructor)(struct stk_command *command);
--
1.7.0.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 3/8] teststk: Add check of len in byte array
2010-05-26 14:39 [PATCH 1/8] stk: Make parse_dataobj not consume extra data Yang Gu
2010-05-26 14:39 ` [PATCH 2/8] stk: Add parser for launch browser commands Yang Gu
@ 2010-05-26 14:39 ` Yang Gu
2010-05-26 14:39 ` [PATCH 4/8] teststk: Use check_common_text() to check string Yang Gu
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Yang Gu @ 2010-05-26 14:39 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 462 bytes --]
---
unit/test-stkutil.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/unit/test-stkutil.c b/unit/test-stkutil.c
index 173ab2d..e01cb17 100644
--- a/unit/test-stkutil.c
+++ b/unit/test-stkutil.c
@@ -82,6 +82,7 @@ static inline void check_common_byte_array(
}
g_assert(command->len != 0);
+ g_assert(command->len == test->len);
g_assert(g_mem_equal(command->array, test->array, test->len));
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 4/8] teststk: Use check_common_text() to check string
2010-05-26 14:39 [PATCH 1/8] stk: Make parse_dataobj not consume extra data Yang Gu
2010-05-26 14:39 ` [PATCH 2/8] stk: Add parser for launch browser commands Yang Gu
2010-05-26 14:39 ` [PATCH 3/8] teststk: Add check of len in byte array Yang Gu
@ 2010-05-26 14:39 ` Yang Gu
2010-05-26 14:39 ` [PATCH 5/8] stk: Fix the parser of send sms Yang Gu
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Yang Gu @ 2010-05-26 14:39 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1438 bytes --]
---
unit/test-stkutil.c | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/unit/test-stkutil.c b/unit/test-stkutil.c
index e01cb17..2999412 100644
--- a/unit/test-stkutil.c
+++ b/unit/test-stkutil.c
@@ -91,7 +91,7 @@ static inline void check_address(const struct stk_address *command,
const struct stk_address *test)
{
g_assert(command->ton_npi == test->ton_npi);
- g_assert(g_str_equal(command->number, test->number));
+ check_common_text(command->number, test->number);
}
/* Defined in TS 102.223 Section 8.2 */
@@ -139,11 +139,7 @@ static void check_item(const struct stk_item *command,
const struct stk_item *test)
{
g_assert(command->id == test->id);
-
- if (command->text == NULL)
- g_assert(test->text == NULL);
- else
- g_assert(g_str_equal(command->text, test->text));
+ check_common_text(command->text, test->text);
}
/* Defined in TS 102.223 Section 8.10 */
@@ -181,8 +177,8 @@ static void check_gsm_sms_tpdu(const struct sms *command,
{
g_assert(command->submit.mr == test->submit.mr);
g_assert(command->submit.udl == test->submit.udl);
- g_assert(g_str_equal(command->submit.daddr.address,
- test->submit.daddr.address));
+ check_common_text(command->submit.daddr.address,
+ test->submit.daddr.address);
g_assert(g_mem_equal(command->submit.ud, test->submit.ud,
test->submit.udl));
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 5/8] stk: Fix the parser of send sms
2010-05-26 14:39 [PATCH 1/8] stk: Make parse_dataobj not consume extra data Yang Gu
` (2 preceding siblings ...)
2010-05-26 14:39 ` [PATCH 4/8] teststk: Use check_common_text() to check string Yang Gu
@ 2010-05-26 14:39 ` Yang Gu
2010-05-26 14:39 ` [PATCH 6/8] teststk: Add cases for send sms parser Yang Gu
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Yang Gu @ 2010-05-26 14:39 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 2834 bytes --]
---
src/stkutil.c | 52 +++++++++++++++++++++++++++++++++++++++++++---------
1 files changed, 43 insertions(+), 9 deletions(-)
diff --git a/src/stkutil.c b/src/stkutil.c
index 12af7fc..3adb9e3 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -61,11 +61,15 @@ typedef gboolean (*dataobj_writer)(struct stk_tlv_builder *,
/*
* Defined in TS 102.223 Section 8.13
- * GSM SMS PDUs are limited to 164 bytes according to 23.040
+ * The type of gsm sms can be SMS-COMMAND AND SMS-SUBMIT. According to 23.040,
+ * the maximum length is 164 bytes. But for SMS-SUBMIT, sms may be packed by
+ * ME. Thus the maximum length of messsage could be 160 bytes, instead of 140
+ * bytes. So the total maximum length could be 184 bytes. Refer TS 31.111,
+ * section 6.4.10 for details.
*/
struct gsm_sms_tpdu {
unsigned int len;
- unsigned char tpdu[164];
+ unsigned char tpdu[184];
};
static char *decode_text(unsigned char dcs, int len, const unsigned char *data)
@@ -2453,6 +2457,7 @@ static gboolean parse_send_sms(struct stk_command *command,
if (command->dst != STK_DEVICE_IDENTITY_TYPE_NETWORK)
return FALSE;
+ memset(&gsm_tpdu, 0, sizeof(gsm_tpdu));
ret = parse_dataobj(iter, STK_DATA_OBJECT_TYPE_ALPHA_ID, 0,
&obj->alpha_id,
STK_DATA_OBJECT_TYPE_ADDRESS, 0,
@@ -2469,20 +2474,49 @@ static gboolean parse_send_sms(struct stk_command *command,
&obj->frame_id,
STK_DATA_OBJECT_TYPE_INVALID);
+ command->destructor = destroy_send_sms;
+
if (ret == FALSE)
return FALSE;
- command->destructor = destroy_send_sms;
+ if (gsm_tpdu.len == 0 && obj->cdma_sms.len == 0)
+ return FALSE;
+
+ if (gsm_tpdu.len > 0 && obj->cdma_sms.len > 0)
+ return FALSE;
if (gsm_tpdu.len > 0) {
if (sms_decode(gsm_tpdu.tpdu, gsm_tpdu.len, TRUE, gsm_tpdu.len,
- &obj->gsm_sms) == FALSE) {
- command->destructor(command);
- return FALSE;
+ &obj->gsm_sms) == FALSE) {
+ /* packing by ME must be not required */
+ if ((command->qualifier & 0x01) == 0)
+ return FALSE;
+
+ if (obj->gsm_sms.type != SMS_TYPE_SUBMIT)
+ return FALSE;
+
+ if (obj->gsm_sms.submit.udl == 0)
+ return FALSE;
+ }
+
+ /* packing is needed */
+ if (command->qualifier & 0x01) {
+ unsigned char *packed;
+ long packed_size;
+ unsigned char *in;
+ struct sms_submit *s = &obj->gsm_sms.submit;
+
+ if (obj->gsm_sms.type != SMS_TYPE_SUBMIT)
+ return FALSE;
+
+ /* Set dcs to default alphabet */
+ s->dcs = 0xF0;
+
+ in = gsm_tpdu.tpdu + gsm_tpdu.len - s->udl;
+ packed = pack_7bit(in, s->udl, 0,
+ FALSE, &packed_size, 0);
+ memcpy(s->ud, packed, packed_size);
}
- } else if (obj->cdma_sms.len == 0) {
- command->destructor(command);
- return FALSE;
}
return TRUE;
--
1.7.0.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 6/8] teststk: Add cases for send sms parser
2010-05-26 14:39 [PATCH 1/8] stk: Make parse_dataobj not consume extra data Yang Gu
` (3 preceding siblings ...)
2010-05-26 14:39 ` [PATCH 5/8] stk: Fix the parser of send sms Yang Gu
@ 2010-05-26 14:39 ` Yang Gu
2010-05-26 14:39 ` [PATCH 7/8] teststk: Add test for launch browser parser Yang Gu
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Yang Gu @ 2010-05-26 14:39 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 53472 bytes --]
---
src/smsutil.c | 3 +
unit/test-stkutil.c | 1767 ++++++++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 1748 insertions(+), 22 deletions(-)
diff --git a/src/smsutil.c b/src/smsutil.c
index 6f8e9c5..29bd881 100644
--- a/src/smsutil.c
+++ b/src/smsutil.c
@@ -1276,6 +1276,9 @@ static gboolean decode_submit(const unsigned char *pdu, int len,
if ((len - offset) < expected)
return FALSE;
+ if (expected > (int)sizeof(out->submit.ud))
+ return FALSE;
+
memcpy(out->submit.ud, pdu+offset, expected);
return TRUE;
diff --git a/unit/test-stkutil.c b/unit/test-stkutil.c
index 2999412..77e05c4 100644
--- a/unit/test-stkutil.c
+++ b/unit/test-stkutil.c
@@ -34,9 +34,40 @@
#include <ofono/types.h>
#include "smsutil.h"
#include "stkutil.h"
+#include "util.h"
#define MAX_ITEM 100
+struct sms_submit_test {
+ gboolean rd;
+ enum sms_validity_period_format vpf;
+ gboolean rp;
+ gboolean udhi;
+ gboolean srr;
+ guint8 mr;
+ struct sms_address daddr;
+ guint8 pid;
+ guint8 dcs;
+ struct sms_validity_period vp;
+ guint8 udl;
+ guint8 ud[160];
+};
+
+struct sms_test {
+ struct sms_address sc_addr;
+ enum sms_type type;
+ union {
+ struct sms_deliver deliver;
+ struct sms_deliver_ack_report deliver_ack_report;
+ struct sms_deliver_err_report deliver_err_report;
+ struct sms_submit_test submit;
+ struct sms_submit_ack_report submit_ack_report;
+ struct sms_submit_err_report submit_err_report;
+ struct sms_command command;
+ struct sms_status_report status_report;
+ };
+};
+
static gboolean g_mem_equal(const unsigned char *v1, const unsigned char *v2,
unsigned int len)
{
@@ -172,15 +203,73 @@ static void check_response_length(const struct stk_response_length *command,
}
/* Defined in TS 102.223 Section 8.13 */
-static void check_gsm_sms_tpdu(const struct sms *command,
- const struct sms *test)
+static void check_gsm_sms(const struct sms *command,
+ const struct sms_test *test)
{
- g_assert(command->submit.mr == test->submit.mr);
- g_assert(command->submit.udl == test->submit.udl);
- check_common_text(command->submit.daddr.address,
- test->submit.daddr.address);
- g_assert(g_mem_equal(command->submit.ud, test->submit.ud,
- test->submit.udl));
+ switch (test->type) {
+ case SMS_TYPE_SUBMIT: {
+ const struct sms_submit *cs = &command->submit;
+ const struct sms_submit_test *ts = &test->submit;
+ enum sms_charset charset;
+
+ g_assert(cs->rd == ts->rd);
+ g_assert(cs->vpf == ts->vpf);
+ g_assert(cs->rp == ts->rp);
+ g_assert(cs->udhi == ts->udhi);
+ g_assert(cs->srr == ts->srr);
+ g_assert(cs->mr == ts->mr);
+
+ g_assert(cs->daddr.number_type == cs->daddr.number_type);
+ g_assert(cs->daddr.numbering_plan == cs->daddr.numbering_plan);
+ g_assert(g_str_equal(cs->daddr.address, ts->daddr.address));
+
+ g_assert(cs->pid == ts->pid);
+ g_assert(cs->dcs == ts->dcs);
+
+ switch (ts->vpf) {
+ case SMS_VALIDITY_PERIOD_FORMAT_RELATIVE:
+ g_assert(cs->vp.relative == ts->vp.relative);
+ break;
+ case SMS_VALIDITY_PERIOD_FORMAT_ABSOLUTE: {
+ const struct sms_scts *ca = &cs->vp.absolute;
+ const struct sms_scts *ta = &ts->vp.absolute;
+ g_assert(ca->year == ta->year);
+ g_assert(ca->month == ta->month);
+ g_assert(ca->day == ta->day);
+ g_assert(ca->hour == ta->hour);
+ g_assert(ca->minute == ta->minute);
+ g_assert(ca->second == ta->second);
+ g_assert(ca->timezone == ta->timezone);
+ break;
+ }
+ case SMS_VALIDITY_PERIOD_FORMAT_ENHANCED:
+ g_assert(g_mem_equal(cs->vp.enhanced,
+ ts->vp.enhanced, 7));
+ break;
+ default:
+ break;
+ }
+
+ g_assert(cs->udl == ts->udl);
+
+ sms_dcs_decode(ts->dcs, NULL, &charset, NULL, NULL);
+
+ if (charset == SMS_CHARSET_8BIT)
+ g_assert(g_str_equal(cs->ud, ts->ud));
+ else {
+ GSList *sms_list = NULL;
+ char *message;
+ sms_list = g_slist_prepend(sms_list, (void *)command);
+ message = sms_decode_text(sms_list);
+ g_assert(g_str_equal(message, ts->ud));
+ g_free(message);
+ }
+
+ break;
+ }
+ default:
+ g_assert(FALSE);
+ }
}
/* Defined in TS 102.223 Section 8.15 */
@@ -7596,7 +7685,7 @@ struct send_sms_test {
unsigned char qualifier;
char *alpha_id;
struct stk_address address;
- struct sms gsm_sms;
+ struct sms_test gsm_sms;
struct stk_common_byte_array cdma_sms;
struct stk_icon_id icon_id;
struct stk_text_attribute text_attr;
@@ -7605,15 +7694,615 @@ struct send_sms_test {
/* 3GPP TS 31.124 Section 27.22.4.10.1.4.2 */
static unsigned char send_sms_111[] = { 0xD0, 0x37, 0x81, 0x03, 0x01, 0x13,
- 0x00, 0x82, 0x02, 0x81, 0x83, 0x85,
- 0x07, 0x53, 0x65, 0x6E, 0x64, 0x20,
- 0x53, 0x4D, 0x86, 0x09, 0x91, 0x11,
- 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
- 0xF8, 0x8B, 0x18, 0x01, 0x00, 0x09,
- 0x91, 0x10, 0x32, 0x54, 0x76, 0xF8,
- 0x40, 0xF4, 0x0C, 0x54, 0x65, 0x73,
- 0x74, 0x20, 0x4D, 0x65, 0x73, 0x73,
- 0x61, 0x67, 0x65 };
+ 0x00, 0x82, 0x02, 0x81, 0x83,
+ 0x85, 0x07, 0x53, 0x65, 0x6E,
+ 0x64, 0x20, 0x53, 0x4D, 0x86,
+ 0x09, 0x91, 0x11, 0x22, 0x33,
+ 0x44, 0x55, 0x66, 0x77, 0xF8,
+ 0x8B, 0x18, 0x01, 0x00, 0x09,
+ 0x91, 0x10, 0x32, 0x54, 0x76,
+ 0xF8, 0x40, 0xF4, 0x0C, 0x54,
+ 0x65, 0x73, 0x74, 0x20, 0x4D,
+ 0x65, 0x73, 0x73, 0x61, 0x67,
+ 0x65 };
+
+static unsigned char send_sms_121[] = { 0xD0, 0x32, 0x81, 0x03, 0x01, 0x13,
+ 0x01, 0x82, 0x02, 0x81, 0x83,
+ 0x85, 0x07, 0x53, 0x65, 0x6E,
+ 0x64, 0x20, 0x53, 0x4D, 0x86,
+ 0x09, 0x91, 0x11, 0x22, 0x33,
+ 0x44, 0x55, 0x66, 0x77, 0xF8,
+ 0x8B, 0x13, 0x01, 0x00, 0x09,
+ 0x91, 0x10, 0x32, 0x54, 0x76,
+ 0xF8, 0x40, 0xF4, 0x07, 0x53,
+ 0x65, 0x6E, 0x64, 0x20, 0x53,
+ 0x4D };
+
+static unsigned char send_sms_131[] = { 0xD0, 0x3D, 0x81, 0x03, 0x01, 0x13,
+ 0x00, 0x82, 0x02, 0x81, 0x83,
+ 0x85, 0x0D, 0x53, 0x68, 0x6F,
+ 0x72, 0x74, 0x20, 0x4D, 0x65,
+ 0x73, 0x73, 0x61, 0x67, 0x65,
+ 0x86, 0x09, 0x91, 0x11, 0x22,
+ 0x33, 0x44, 0x55, 0x66, 0x77,
+ 0xF8, 0x8B, 0x18, 0x01, 0x00,
+ 0x09, 0x91, 0x10, 0x32, 0x54,
+ 0x76, 0xF8, 0x40, 0xF0, 0x0D,
+ 0x53, 0xF4, 0x5B, 0x4E, 0x07,
+ 0x35, 0xCB, 0xF3, 0x79, 0xF8,
+ 0x5C, 0x06 };
+
+static unsigned char send_sms_141[] = { 0xD0, 0x81, 0xFD, 0x81, 0x03, 0x01,
+ 0x13, 0x01, 0x82, 0x02, 0x81,
+ 0x83, 0x85, 0x38, 0x54, 0x68,
+ 0x65, 0x20, 0x61, 0x64, 0x64,
+ 0x72, 0x65, 0x73, 0x73, 0x20,
+ 0x64, 0x61, 0x74, 0x61, 0x20,
+ 0x6F, 0x62, 0x6A, 0x65, 0x63,
+ 0x74, 0x20, 0x68, 0x6F, 0x6C,
+ 0x64, 0x73, 0x20, 0x74, 0x68,
+ 0x65, 0x20, 0x52, 0x50, 0x11,
+ 0x44, 0x65, 0x73, 0x74, 0x69,
+ 0x6E, 0x61, 0x74, 0x69, 0x6F,
+ 0x6E, 0x11, 0x41, 0x64, 0x64,
+ 0x72, 0x65, 0x73, 0x73, 0x86,
+ 0x09, 0x91, 0x11, 0x22, 0x33,
+ 0x44, 0x55, 0x66, 0x77, 0xF8,
+ 0x8B, 0x81, 0xAC, 0x01, 0x00,
+ 0x09, 0x91, 0x10, 0x32, 0x54,
+ 0x76, 0xF8, 0x40, 0xF4, 0xA0,
+ 0x54, 0x77, 0x6F, 0x20, 0x74,
+ 0x79, 0x70, 0x65, 0x73, 0x20,
+ 0x61, 0x72, 0x65, 0x20, 0x64,
+ 0x65, 0x66, 0x69, 0x6E, 0x65,
+ 0x64, 0x3A, 0x20, 0x2D, 0x20,
+ 0x41, 0x20, 0x73, 0x68, 0x6F,
+ 0x72, 0x74, 0x20, 0x6D, 0x65,
+ 0x73, 0x73, 0x61, 0x67, 0x65,
+ 0x20, 0x74, 0x6F, 0x20, 0x62,
+ 0x65, 0x20, 0x73, 0x65, 0x6E,
+ 0x74, 0x20, 0x74, 0x6F, 0x20,
+ 0x74, 0x68, 0x65, 0x20, 0x6E,
+ 0x65, 0x74, 0x77, 0x6F, 0x72,
+ 0x6B, 0x20, 0x69, 0x6E, 0x20,
+ 0x61, 0x6E, 0x20, 0x53, 0x4D,
+ 0x53, 0x2D, 0x53, 0x55, 0x42,
+ 0x4D, 0x49, 0x54, 0x20, 0x6D,
+ 0x65, 0x73, 0x73, 0x61, 0x67,
+ 0x65, 0x2C, 0x20, 0x6F, 0x72,
+ 0x20, 0x61, 0x6E, 0x20, 0x53,
+ 0x4D, 0x53, 0x2D, 0x43, 0x4F,
+ 0x4D, 0x4D, 0x41, 0x4E, 0x44,
+ 0x20, 0x6D, 0x65, 0x73, 0x73,
+ 0x61, 0x67, 0x65, 0x2C, 0x20,
+ 0x77, 0x68, 0x65, 0x72, 0x65,
+ 0x20, 0x74, 0x68, 0x65, 0x20,
+ 0x75, 0x73, 0x65, 0x72, 0x20,
+ 0x64, 0x61, 0x74, 0x61, 0x20,
+ 0x63, 0x61, 0x6E, 0x20, 0x62,
+ 0x65, 0x20, 0x70, 0x61, 0x73,
+ 0x73, 0x65, 0x64, 0x20, 0x74,
+ 0x72, 0x61, 0x6E, 0x73, 0x70 };
+
+static unsigned char send_sms_151[] = { 0xD0, 0x81, 0xE9, 0x81, 0x03, 0x01,
+ 0x13, 0x00, 0x82, 0x02, 0x81,
+ 0x83, 0x85, 0x38, 0x54, 0x68,
+ 0x65, 0x20, 0x61, 0x64, 0x64,
+ 0x72, 0x65, 0x73, 0x73, 0x20,
+ 0x64, 0x61, 0x74, 0x61, 0x20,
+ 0x6F, 0x62, 0x6A, 0x65, 0x63,
+ 0x74, 0x20, 0x68, 0x6F, 0x6C,
+ 0x64, 0x73, 0x20, 0x74, 0x68,
+ 0x65, 0x20, 0x52, 0x50, 0x20,
+ 0x44, 0x65, 0x73, 0x74, 0x69,
+ 0x6E, 0x61, 0x74, 0x69, 0x6F,
+ 0x6E, 0x20, 0x41, 0x64, 0x64,
+ 0x72, 0x65, 0x73, 0x73, 0x86,
+ 0x09, 0x91, 0x11, 0x22, 0x33,
+ 0x44, 0x55, 0x66, 0x77, 0xF8,
+ 0x8B, 0x81, 0x98, 0x01, 0x00,
+ 0x09, 0x91, 0x10, 0x32, 0x54,
+ 0x76, 0xF8, 0x40, 0xF0, 0xA0,
+ 0xD4, 0xFB, 0x1B, 0x44, 0xCF,
+ 0xC3, 0xCB, 0x73, 0x50, 0x58,
+ 0x5E, 0x06, 0x91, 0xCB, 0xE6,
+ 0xB4, 0xBB, 0x4C, 0xD6, 0x81,
+ 0x5A, 0xA0, 0x20, 0x68, 0x8E,
+ 0x7E, 0xCB, 0xE9, 0xA0, 0x76,
+ 0x79, 0x3E, 0x0F, 0x9F, 0xCB,
+ 0x20, 0xFA, 0x1B, 0x24, 0x2E,
+ 0x83, 0xE6, 0x65, 0x37, 0x1D,
+ 0x44, 0x7F, 0x83, 0xE8, 0xE8,
+ 0x32, 0xC8, 0x5D, 0xA6, 0xDF,
+ 0xDF, 0xF2, 0x35, 0x28, 0xED,
+ 0x06, 0x85, 0xDD, 0xA0, 0x69,
+ 0x73, 0xDA, 0x9A, 0x56, 0x85,
+ 0xCD, 0x24, 0x15, 0xD4, 0x2E,
+ 0xCF, 0xE7, 0xE1, 0x73, 0x99,
+ 0x05, 0x7A, 0xCB, 0x41, 0x61,
+ 0x37, 0x68, 0xDA, 0x9C, 0xB6,
+ 0x86, 0xCF, 0x66, 0x33, 0xE8,
+ 0x24, 0x82, 0xDA, 0xE5, 0xF9,
+ 0x3C, 0x7C, 0x2E, 0xB3, 0x40,
+ 0x77, 0x74, 0x59, 0x5E, 0x06,
+ 0xD1, 0xD1, 0x65, 0x50, 0x7D,
+ 0x5E, 0x96, 0x83, 0xC8, 0x61,
+ 0x7A, 0x18, 0x34, 0x0E, 0xBB,
+ 0x41, 0xE2, 0x32, 0x08, 0x1E,
+ 0x9E, 0xCF, 0xCB, 0x64, 0x10,
+ 0x5D, 0x1E, 0x76, 0xCF, 0xE1 };
+
+static unsigned char send_sms_161[] = { 0xD0, 0x81, 0xFD, 0x81, 0x03, 0x01,
+ 0x13, 0x00, 0x82, 0x02, 0x81,
+ 0x83, 0x85, 0x81, 0xE6, 0x54,
+ 0x77, 0x6F, 0x20, 0x74, 0x79,
+ 0x70, 0x65, 0x73, 0x20, 0x61,
+ 0x72, 0x65, 0x20, 0x64, 0x65,
+ 0x66, 0x69, 0x6E, 0x65, 0x64,
+ 0x3A, 0x20, 0x2D, 0x20, 0x41,
+ 0x20, 0x73, 0x68, 0x6F, 0x72,
+ 0x74, 0x20, 0x6D, 0x65, 0x73,
+ 0x73, 0x61, 0x67, 0x65, 0x20,
+ 0x74, 0x6F, 0x20, 0x62, 0x65,
+ 0x20, 0x73, 0x65, 0x6E, 0x74,
+ 0x20, 0x74, 0x6F, 0x20, 0x74,
+ 0x68, 0x65, 0x20, 0x6E, 0x65,
+ 0x74, 0x77, 0x6F, 0x72, 0x6B,
+ 0x20, 0x69, 0x6E, 0x20, 0x61,
+ 0x6E, 0x20, 0x53, 0x4D, 0x53,
+ 0x2D, 0x53, 0x55, 0x42, 0x4D,
+ 0x49, 0x54, 0x20, 0x6D, 0x65,
+ 0x73, 0x73, 0x61, 0x67, 0x65,
+ 0x2C, 0x20, 0x6F, 0x72, 0x20,
+ 0x61, 0x6E, 0x20, 0x53, 0x4D,
+ 0x53, 0x2D, 0x43, 0x4F, 0x4D,
+ 0x4D, 0x41, 0x4E, 0x44, 0x20,
+ 0x6D, 0x65, 0x73, 0x73, 0x61,
+ 0x67, 0x65, 0x2C, 0x20, 0x77,
+ 0x68, 0x65, 0x72, 0x65, 0x20,
+ 0x74, 0x68, 0x65, 0x20, 0x75,
+ 0x73, 0x65, 0x72, 0x20, 0x64,
+ 0x61, 0x74, 0x61, 0x20, 0x63,
+ 0x61, 0x6E, 0x20, 0x62, 0x65,
+ 0x20, 0x70, 0x61, 0x73, 0x73,
+ 0x65, 0x64, 0x20, 0x74, 0x72,
+ 0x61, 0x6E, 0x73, 0x70, 0x61,
+ 0x72, 0x65, 0x6E, 0x74, 0x6C,
+ 0x79, 0x3B, 0x20, 0x2D, 0x20,
+ 0x41, 0x20, 0x73, 0x68, 0x6F,
+ 0x72, 0x74, 0x20, 0x6D, 0x65,
+ 0x73, 0x73, 0x61, 0x67, 0x65,
+ 0x20, 0x74, 0x6F, 0x20, 0x62,
+ 0x65, 0x20, 0x73, 0x65, 0x6E,
+ 0x74, 0x20, 0x74, 0x6F, 0x20,
+ 0x74, 0x68, 0x65, 0x20, 0x6E,
+ 0x65, 0x74, 0x77, 0x6F, 0x72,
+ 0x6B, 0x20, 0x69, 0x6E, 0x20,
+ 0x61, 0x6E, 0x20, 0x53, 0x4D,
+ 0x53, 0x2D, 0x53, 0x55, 0x42,
+ 0x4D, 0x49, 0x54, 0x20, 0x8B,
+ 0x09, 0x01, 0x00, 0x02, 0x91,
+ 0x10, 0x40, 0xF0, 0x01, 0x20 };
+
+static unsigned char send_sms_171[] = { 0xD0, 0x30, 0x81, 0x03, 0x01, 0x13,
+ 0x00, 0x82, 0x02, 0x81, 0x83,
+ 0x85, 0x00, 0x86, 0x09, 0x91,
+ 0x11, 0x22, 0x33, 0x44, 0x55,
+ 0x66, 0x77, 0xF8, 0x8B, 0x18,
+ 0x01, 0x00, 0x09, 0x91, 0x10,
+ 0x32, 0x54, 0x76, 0xF8, 0x40,
+ 0xF4, 0x0C, 0x54, 0x65, 0x73,
+ 0x74, 0x20, 0x4D, 0x65, 0x73,
+ 0x73, 0x61, 0x67, 0x65 };
+
+static unsigned char send_sms_181[] = { 0xD0, 0x2E, 0x81, 0x03, 0x01, 0x13,
+ 0x00, 0x82, 0x02, 0x81, 0x83,
+ 0x86, 0x09, 0x91, 0x11, 0x22,
+ 0x33, 0x44, 0x55, 0x66, 0x77,
+ 0xF8, 0x8B, 0x18, 0x01, 0x00,
+ 0x09, 0x91, 0x10, 0x32, 0x54,
+ 0x76, 0xF8, 0x40, 0xF4, 0x0C,
+ 0x54, 0x65, 0x73, 0x74, 0x20,
+ 0x4D, 0x65, 0x73, 0x73, 0x61,
+ 0x67, 0x65 };
+
+static unsigned char send_sms_211[] = { 0xD0, 0x55, 0x81, 0x03, 0x01, 0x13,
+ 0x00, 0x82, 0x02, 0x81, 0x83,
+ 0x85, 0x19, 0x80, 0x04, 0x17,
+ 0x04, 0x14, 0x04, 0x20, 0x04,
+ 0x10, 0x04, 0x12, 0x04, 0x21,
+ 0x04, 0x22, 0x04, 0x12, 0x04,
+ 0x23, 0x04, 0x19, 0x04, 0x22,
+ 0x04, 0x15, 0x86, 0x09, 0x91,
+ 0x11, 0x22, 0x33, 0x44, 0x55,
+ 0x66, 0x77, 0xF8, 0x8B, 0x24,
+ 0x01, 0x00, 0x09, 0x91, 0x10,
+ 0x32, 0x54, 0x76, 0xF8, 0x40,
+ 0x08, 0x18, 0x04, 0x17, 0x04,
+ 0x14, 0x04, 0x20, 0x04, 0x10,
+ 0x04, 0x12, 0x04, 0x21, 0x04,
+ 0x22, 0x04, 0x12, 0x04, 0x23,
+ 0x04, 0x19, 0x04, 0x22, 0x04,
+ 0x15 };
+
+static unsigned char send_sms_212[] = { 0xD0, 0x4B, 0x81, 0x03, 0x01, 0x13,
+ 0x00, 0x82, 0x02, 0x81, 0x83,
+ 0x85, 0x0F, 0x81, 0x0C, 0x08,
+ 0x97, 0x94, 0xA0, 0x90, 0x92,
+ 0xA1, 0xA2, 0x92, 0xA3, 0x99,
+ 0xA2, 0x95, 0x86, 0x09, 0x91,
+ 0x11, 0x22, 0x33, 0x44, 0x55,
+ 0x66, 0x77, 0xF8, 0x8B, 0x24,
+ 0x01, 0x00, 0x09, 0x91, 0x10,
+ 0x32, 0x54, 0x76, 0xF8, 0x40,
+ 0x08, 0x18, 0x04, 0x17, 0x04,
+ 0x14, 0x04, 0x20, 0x04, 0x10,
+ 0x04, 0x12, 0x04, 0x21, 0x04,
+ 0x22, 0x04, 0x12, 0x04, 0x23,
+ 0x04, 0x19, 0x04, 0x22, 0x04,
+ 0x15 };
+
+static unsigned char send_sms_213[] = { 0xD0, 0x4C, 0x81, 0x03, 0x01, 0x13,
+ 0x00, 0x82, 0x02, 0x81, 0x83,
+ 0x85, 0x10, 0x82, 0x0C, 0x04,
+ 0x10, 0x87, 0x84, 0x90, 0x80,
+ 0x82, 0x91, 0x92, 0x82, 0x93,
+ 0x89, 0x92, 0x85, 0x86, 0x09,
+ 0x91, 0x11, 0x22, 0x33, 0x44,
+ 0x55, 0x66, 0x77, 0xF8, 0x8B,
+ 0x24, 0x01, 0x00, 0x09, 0x91,
+ 0x10, 0x32, 0x54, 0x76, 0xF8,
+ 0x40, 0x08, 0x18, 0x04, 0x17,
+ 0x04, 0x14, 0x04, 0x20, 0x04,
+ 0x10, 0x04, 0x12, 0x04, 0x21,
+ 0x04, 0x22, 0x04, 0x12, 0x04,
+ 0x23, 0x04, 0x19, 0x04, 0x22,
+ 0x04, 0x15 };
+
+static unsigned char send_sms_311[] = { 0xD0, 0x3B, 0x81, 0x03, 0x01, 0x13,
+ 0x00, 0x82, 0x02, 0x81, 0x83,
+ 0x85, 0x07, 0x4E, 0x4F, 0x20,
+ 0x49, 0x43, 0x4F, 0x4E, 0x86,
+ 0x09, 0x91, 0x11, 0x22, 0x33,
+ 0x44, 0x55, 0x66, 0x77, 0xF8,
+ 0x8B, 0x18, 0x01, 0x00, 0x09,
+ 0x91, 0x10, 0x32, 0x54, 0x76,
+ 0xF8, 0x40, 0xF4, 0x0C, 0x54,
+ 0x65, 0x73, 0x74, 0x20, 0x4D,
+ 0x65, 0x73, 0x73, 0x61, 0x67,
+ 0x65, 0x9E, 0x02, 0x00, 0x01 };
+
+static unsigned char send_sms_321[] = { 0xD0, 0x3B, 0x81, 0x03, 0x01, 0x13,
+ 0x00, 0x82, 0x02, 0x81, 0x83,
+ 0x85, 0x07, 0x53, 0x65, 0x6E,
+ 0x64, 0x20, 0x53, 0x4D, 0x86,
+ 0x09, 0x91, 0x11, 0x22, 0x33,
+ 0x44, 0x55, 0x66, 0x77, 0xF8,
+ 0x8B, 0x18, 0x01, 0x00, 0x09,
+ 0x91, 0x10, 0x32, 0x54, 0x76,
+ 0xF8, 0x40, 0xF4, 0x0C, 0x54,
+ 0x65, 0x73, 0x74, 0x20, 0x4D,
+ 0x65, 0x73, 0x73, 0x61, 0x67,
+ 0x65, 0x1E, 0x02, 0x01, 0x01 };
+
+static unsigned char send_sms_411[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x13,
+ 0x00, 0x82, 0x02, 0x81, 0x83,
+ 0x85, 0x10, 0x54, 0x65, 0x78,
+ 0x74, 0x20, 0x41, 0x74, 0x74,
+ 0x72, 0x69, 0x62, 0x75, 0x74,
+ 0x65, 0x20, 0x31, 0x8B, 0x09,
+ 0x01, 0x00, 0x02, 0x91, 0x10,
+ 0x40, 0xF0, 0x01, 0x20, 0xD0,
+ 0x04, 0x00, 0x10, 0x00, 0xB4 };
+
+static unsigned char send_sms_412[] = { 0xD0, 0x26, 0x81, 0x03, 0x01, 0x13,
+ 0x00, 0x82, 0x02, 0x81, 0x83,
+ 0x85, 0x10, 0x54, 0x65, 0x78,
+ 0x74, 0x20, 0x41, 0x74, 0x74,
+ 0x72, 0x69, 0x62, 0x75, 0x74,
+ 0x65, 0x20, 0x32, 0x8B, 0x09,
+ 0x01, 0x00, 0x02, 0x91, 0x10,
+ 0x40, 0xF0, 0x01, 0x20 };
+
+static unsigned char send_sms_421[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x13,
+ 0x00, 0x82, 0x02, 0x81, 0x83,
+ 0x85, 0x10, 0x54, 0x65, 0x78,
+ 0x74, 0x20, 0x41, 0x74, 0x74,
+ 0x72, 0x69, 0x62, 0x75, 0x74,
+ 0x65, 0x20, 0x31, 0x8B, 0x09,
+ 0x01, 0x00, 0x02, 0x91, 0x10,
+ 0x40, 0xF0, 0x01, 0x20, 0xD0,
+ 0x04, 0x00, 0x10, 0x01, 0xB4 };
+
+static unsigned char send_sms_422[] = { 0xD0, 0x26, 0x81, 0x03, 0x01, 0x13,
+ 0x00, 0x82, 0x02, 0x81, 0x83,
+ 0x85, 0x10, 0x54, 0x65, 0x78,
+ 0x74, 0x20, 0x41, 0x74, 0x74,
+ 0x72, 0x69, 0x62, 0x75, 0x74,
+ 0x65, 0x20, 0x32, 0x8B, 0x09,
+ 0x01, 0x00, 0x02, 0x91, 0x10,
+ 0x40, 0xF0, 0x01, 0x20 };
+
+static unsigned char send_sms_431[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x13,
+ 0x00, 0x82, 0x02, 0x81, 0x83,
+ 0x85, 0x10, 0x54, 0x65, 0x78,
+ 0x74, 0x20, 0x41, 0x74, 0x74,
+ 0x72, 0x69, 0x62, 0x75, 0x74,
+ 0x65, 0x20, 0x31, 0x8B, 0x09,
+ 0x01, 0x00, 0x02, 0x91, 0x10,
+ 0x40, 0xF0, 0x01, 0x20, 0xD0,
+ 0x04, 0x00, 0x10, 0x02, 0xB4 };
+
+static unsigned char send_sms_432[] = { 0xD0, 0x26, 0x81, 0x03, 0x01, 0x13,
+ 0x00, 0x82, 0x02, 0x81, 0x83,
+ 0x85, 0x10, 0x54, 0x65, 0x78,
+ 0x74, 0x20, 0x41, 0x74, 0x74,
+ 0x72, 0x69, 0x62, 0x75, 0x74,
+ 0x65, 0x20, 0x32, 0x8B, 0x09,
+ 0x01, 0x00, 0x02, 0x91, 0x10,
+ 0x40, 0xF0, 0x01, 0x20 };
+
+static unsigned char send_sms_441[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x13,
+ 0x00, 0x82, 0x02, 0x81, 0x83,
+ 0x85, 0x10, 0x54, 0x65, 0x78,
+ 0x74, 0x20, 0x41, 0x74, 0x74,
+ 0x72, 0x69, 0x62, 0x75, 0x74,
+ 0x65, 0x20, 0x31, 0x8B, 0x09,
+ 0x01, 0x00, 0x02, 0x91, 0x10,
+ 0x40, 0xF0, 0x01, 0x20, 0xD0,
+ 0x04, 0x00, 0x10, 0x04, 0xB4 };
+
+static unsigned char send_sms_442[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x13,
+ 0x00, 0x82, 0x02, 0x81, 0x83,
+ 0x85, 0x10, 0x54, 0x65, 0x78,
+ 0x74, 0x20, 0x41, 0x74, 0x74,
+ 0x72, 0x69, 0x62, 0x75, 0x74,
+ 0x65, 0x20, 0x32, 0x8B, 0x09,
+ 0x01, 0x00, 0x02, 0x91, 0x10,
+ 0x40, 0xF0, 0x01, 0x20, 0xD0,
+ 0x04, 0x00, 0x10, 0x00, 0xB4 };
+
+static unsigned char send_sms_443[] = { 0xD0, 0x26, 0x81, 0x03, 0x01, 0x13,
+ 0x00, 0x82, 0x02, 0x81, 0x83,
+ 0x85, 0x10, 0x54, 0x65, 0x78,
+ 0x74, 0x20, 0x41, 0x74, 0x74,
+ 0x72, 0x69, 0x62, 0x75, 0x74,
+ 0x65, 0x20, 0x33, 0x8B, 0x09,
+ 0x01, 0x00, 0x02, 0x91, 0x10,
+ 0x40, 0xF0, 0x01, 0x20 };
+
+static unsigned char send_sms_451[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x13,
+ 0x00, 0x82, 0x02, 0x81, 0x83,
+ 0x85, 0x10, 0x54, 0x65, 0x78,
+ 0x74, 0x20, 0x41, 0x74, 0x74,
+ 0x72, 0x69, 0x62, 0x75, 0x74,
+ 0x65, 0x20, 0x31, 0x8B, 0x09,
+ 0x01, 0x00, 0x02, 0x91, 0x10,
+ 0x40, 0xF0, 0x01, 0x20, 0xD0,
+ 0x04, 0x00, 0x10, 0x08, 0xB4 };
+
+static unsigned char send_sms_452[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x13,
+ 0x00, 0x82, 0x02, 0x81, 0x83,
+ 0x85, 0x10, 0x54, 0x65, 0x78,
+ 0x74, 0x20, 0x41, 0x74, 0x74,
+ 0x72, 0x69, 0x62, 0x75, 0x74,
+ 0x65, 0x20, 0x32, 0x8B, 0x09,
+ 0x01, 0x00, 0x02, 0x91, 0x10,
+ 0x40, 0xF0, 0x01, 0x20, 0xD0,
+ 0x04, 0x00, 0x10, 0x00, 0xB4 };
+
+static unsigned char send_sms_453[] = { 0xD0, 0x26, 0x81, 0x03, 0x01, 0x13,
+ 0x00, 0x82, 0x02, 0x81, 0x83,
+ 0x85, 0x10, 0x54, 0x65, 0x78,
+ 0x74, 0x20, 0x41, 0x74, 0x74,
+ 0x72, 0x69, 0x62, 0x75, 0x74,
+ 0x65, 0x20, 0x33, 0x8B, 0x09,
+ 0x01, 0x00, 0x02, 0x91, 0x10,
+ 0x40, 0xF0, 0x01, 0x20 };
+
+static unsigned char send_sms_461[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x13,
+ 0x00, 0x82, 0x02, 0x81, 0x83,
+ 0x85, 0x10, 0x54, 0x65, 0x78,
+ 0x74, 0x20, 0x41, 0x74, 0x74,
+ 0x72, 0x69, 0x62, 0x75, 0x74,
+ 0x65, 0x20, 0x31, 0x8B, 0x09,
+ 0x01, 0x00, 0x02, 0x91, 0x10,
+ 0x40, 0xF0, 0x01, 0x20, 0xD0,
+ 0x04, 0x00, 0x10, 0x10, 0xB4 };
+
+static unsigned char send_sms_462[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x13,
+ 0x00, 0x82, 0x02, 0x81, 0x83,
+ 0x85, 0x10, 0x54, 0x65, 0x78,
+ 0x74, 0x20, 0x41, 0x74, 0x74,
+ 0x72, 0x69, 0x62, 0x75, 0x74,
+ 0x65, 0x20, 0x32, 0x8B, 0x09,
+ 0x01, 0x00, 0x02, 0x91, 0x10,
+ 0x40, 0xF0, 0x01, 0x20, 0xD0,
+ 0x04, 0x00, 0x10, 0x00, 0xB4 };
+
+static unsigned char send_sms_463[] = { 0xD0, 0x26, 0x81, 0x03, 0x01, 0x13,
+ 0x00, 0x82, 0x02, 0x81, 0x83,
+ 0x85, 0x10, 0x54, 0x65, 0x78,
+ 0x74, 0x20, 0x41, 0x74, 0x74,
+ 0x72, 0x69, 0x62, 0x75, 0x74,
+ 0x65, 0x20, 0x33, 0x8B, 0x09,
+ 0x01, 0x00, 0x02, 0x91, 0x10,
+ 0x40, 0xF0, 0x01, 0x20 };
+
+static unsigned char send_sms_471[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x13,
+ 0x00, 0x82, 0x02, 0x81, 0x83,
+ 0x85, 0x10, 0x54, 0x65, 0x78,
+ 0x74, 0x20, 0x41, 0x74, 0x74,
+ 0x72, 0x69, 0x62, 0x75, 0x74,
+ 0x65, 0x20, 0x31, 0x8B, 0x09,
+ 0x01, 0x00, 0x02, 0x91, 0x10,
+ 0x40, 0xF0, 0x01, 0x20, 0xD0,
+ 0x04, 0x00, 0x10, 0x20, 0xB4 };
+
+static unsigned char send_sms_472[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x13,
+ 0x00, 0x82, 0x02, 0x81, 0x83,
+ 0x85, 0x10, 0x54, 0x65, 0x78,
+ 0x74, 0x20, 0x41, 0x74, 0x74,
+ 0x72, 0x69, 0x62, 0x75, 0x74,
+ 0x65, 0x20, 0x32, 0x8B, 0x09,
+ 0x01, 0x00, 0x02, 0x91, 0x10,
+ 0x40, 0xF0, 0x01, 0x20, 0xD0,
+ 0x04, 0x00, 0x10, 0x00, 0xB4 };
+
+static unsigned char send_sms_473[] = { 0xD0, 0x26, 0x81, 0x03, 0x01, 0x13,
+ 0x00, 0x82, 0x02, 0x81, 0x83,
+ 0x85, 0x10, 0x54, 0x65, 0x78,
+ 0x74, 0x20, 0x41, 0x74, 0x74,
+ 0x72, 0x69, 0x62, 0x75, 0x74,
+ 0x65, 0x20, 0x33, 0x8B, 0x09,
+ 0x01, 0x00, 0x02, 0x91, 0x10,
+ 0x40, 0xF0, 0x01, 0x20 };
+
+static unsigned char send_sms_481[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x13,
+ 0x00, 0x82, 0x02, 0x81, 0x83,
+ 0x85, 0x10, 0x54, 0x65, 0x78,
+ 0x74, 0x20, 0x41, 0x74, 0x74,
+ 0x72, 0x69, 0x62, 0x75, 0x74,
+ 0x65, 0x20, 0x31, 0x8B, 0x09,
+ 0x01, 0x00, 0x02, 0x91, 0x10,
+ 0x40, 0xF0, 0x01, 0x20, 0xD0,
+ 0x04, 0x00, 0x10, 0x40, 0xB4 };
+
+static unsigned char send_sms_482[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x13,
+ 0x00, 0x82, 0x02, 0x81, 0x83,
+ 0x85, 0x10, 0x54, 0x65, 0x78,
+ 0x74, 0x20, 0x41, 0x74, 0x74,
+ 0x72, 0x69, 0x62, 0x75, 0x74,
+ 0x65, 0x20, 0x32, 0x8B, 0x09,
+ 0x01, 0x00, 0x02, 0x91, 0x10,
+ 0x40, 0xF0, 0x01, 0x20, 0xD0,
+ 0x04, 0x00, 0x10, 0x00, 0xB4 };
+
+static unsigned char send_sms_483[] = { 0xD0, 0x26, 0x81, 0x03, 0x01, 0x13,
+ 0x00, 0x82, 0x02, 0x81, 0x83,
+ 0x85, 0x10, 0x54, 0x65, 0x78,
+ 0x74, 0x20, 0x41, 0x74, 0x74,
+ 0x72, 0x69, 0x62, 0x75, 0x74,
+ 0x65, 0x20, 0x33, 0x8B, 0x09,
+ 0x01, 0x00, 0x02, 0x91, 0x10,
+ 0x40, 0xF0, 0x01, 0x20 };
+
+static unsigned char send_sms_491[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x13,
+ 0x00, 0x82, 0x02, 0x81, 0x83,
+ 0x85, 0x10, 0x54, 0x65, 0x78,
+ 0x74, 0x20, 0x41, 0x74, 0x74,
+ 0x72, 0x69, 0x62, 0x75, 0x74,
+ 0x65, 0x20, 0x31, 0x8B, 0x09,
+ 0x01, 0x00, 0x02, 0x91, 0x10,
+ 0x40, 0xF0, 0x01, 0x20, 0xD0,
+ 0x04, 0x00, 0x10, 0x80, 0xB4 };
+
+static unsigned char send_sms_492[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x13,
+ 0x00, 0x82, 0x02, 0x81, 0x83,
+ 0x85, 0x10, 0x54, 0x65, 0x78,
+ 0x74, 0x20, 0x41, 0x74, 0x74,
+ 0x72, 0x69, 0x62, 0x75, 0x74,
+ 0x65, 0x20, 0x32, 0x8B, 0x09,
+ 0x01, 0x00, 0x02, 0x91, 0x10,
+ 0x40, 0xF0, 0x01, 0x20, 0xD0,
+ 0x04, 0x00, 0x10, 0x00, 0xB4 };
+
+static unsigned char send_sms_493[] = { 0xD0, 0x26, 0x81, 0x03, 0x01, 0x13,
+ 0x00, 0x82, 0x02, 0x81, 0x83,
+ 0x85, 0x10, 0x54, 0x65, 0x78,
+ 0x74, 0x20, 0x41, 0x74, 0x74,
+ 0x72, 0x69, 0x62, 0x75, 0x74,
+ 0x65, 0x20, 0x33, 0x8B, 0x09,
+ 0x01, 0x00, 0x02, 0x91, 0x10,
+ 0x40, 0xF0, 0x01, 0x20 };
+
+static unsigned char send_sms_4101[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x13,
+ 0x00, 0x82, 0x02, 0x81, 0x83,
+ 0x85, 0x10, 0x54, 0x65, 0x78,
+ 0x74, 0x20, 0x41, 0x74, 0x74,
+ 0x72, 0x69, 0x62, 0x75, 0x74,
+ 0x65, 0x20, 0x31, 0x8B, 0x09,
+ 0x01, 0x00, 0x02, 0x91, 0x10,
+ 0x40, 0xF0, 0x01, 0x20, 0xD0,
+ 0x04, 0x00, 0x10, 0x00, 0xB4 };
+
+static unsigned char send_sms_4102[] = { 0xD0, 0x26, 0x81, 0x03, 0x01, 0x13,
+ 0x00, 0x82, 0x02, 0x81, 0x83,
+ 0x85, 0x10, 0x54, 0x65, 0x78,
+ 0x74, 0x20, 0x41, 0x74, 0x74,
+ 0x72, 0x69, 0x62, 0x75, 0x74,
+ 0x65, 0x20, 0x32, 0x8B, 0x09,
+ 0x01, 0x00, 0x02, 0x91, 0x10,
+ 0x40, 0xF0, 0x01, 0x20 };
+
+static unsigned char send_sms_511[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x13,
+ 0x00, 0x82, 0x02, 0x81, 0x83,
+ 0x85, 0x05, 0x80, 0x4E, 0x2D,
+ 0x4E, 0x00, 0x86, 0x09, 0x91,
+ 0x11, 0x22, 0x33, 0x44, 0x55,
+ 0x66, 0x77, 0xF8, 0x8B, 0x10,
+ 0x01, 0x00, 0x09, 0x91, 0x10,
+ 0x32, 0x54, 0x76, 0xF8, 0x40,
+ 0x08, 0x04, 0x4E, 0x2D, 0x4E,
+ 0x00 };
+
+static unsigned char send_sms_512[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x13,
+ 0x00, 0x82, 0x02, 0x81, 0x83,
+ 0x85, 0x05, 0x81, 0x02, 0x9C,
+ 0xAD, 0x80, 0x86, 0x09, 0x91,
+ 0x11, 0x22, 0x33, 0x44, 0x55,
+ 0x66, 0x77, 0xF8, 0x8B, 0x10,
+ 0x01, 0x00, 0x09, 0x91, 0x10,
+ 0x32, 0x54, 0x76, 0xF8, 0x40,
+ 0x08, 0x04, 0x4E, 0x2D, 0x4E,
+ 0x00 };
+
+static unsigned char send_sms_513[] = { 0xD0, 0x2E, 0x81, 0x03, 0x01, 0x13,
+ 0x00, 0x82, 0x02, 0x81, 0x83,
+ 0x85, 0x06, 0x82, 0x02, 0x4E,
+ 0x00, 0xAD, 0x80, 0x86, 0x09,
+ 0x91, 0x11, 0x22, 0x33, 0x44,
+ 0x55, 0x66, 0x77, 0xF8, 0x8B,
+ 0x10, 0x01, 0x00, 0x09, 0x91,
+ 0x10, 0x32, 0x54, 0x76, 0xF8,
+ 0x40, 0x08, 0x04, 0x4E, 0x2D,
+ 0x4E, 0x00 };
+
+static unsigned char send_sms_611[] = { 0xD0, 0x35, 0x81, 0x03, 0x01, 0x13,
+ 0x00, 0x82, 0x02, 0x81, 0x83,
+ 0x85, 0x09, 0x80, 0x00, 0x38,
+ 0x00, 0x30, 0x30, 0xEB, 0x00,
+ 0x30, 0x86, 0x09, 0x91, 0x11,
+ 0x22, 0x33, 0x44, 0x55, 0x66,
+ 0x77, 0xF8, 0x8B, 0x14, 0x01,
+ 0x00, 0x09, 0x91, 0x10, 0x32,
+ 0x54, 0x76, 0xF8, 0x40, 0x08,
+ 0x08, 0x00, 0x38, 0x00, 0x30,
+ 0x30, 0xEB, 0x00, 0x31 };
+
+static unsigned char send_sms_612[] = { 0xD0, 0x33, 0x81, 0x03, 0x01, 0x13,
+ 0x00, 0x82, 0x02, 0x81, 0x83,
+ 0x85, 0x07, 0x81, 0x04, 0x61,
+ 0x38, 0x31, 0xEB, 0x31, 0x86,
+ 0x09, 0x91, 0x11, 0x22, 0x33,
+ 0x44, 0x55, 0x66, 0x77, 0xF8,
+ 0x8B, 0x14, 0x01, 0x00, 0x09,
+ 0x91, 0x10, 0x32, 0x54, 0x76,
+ 0xF8, 0x40, 0x08, 0x08, 0x00,
+ 0x38, 0x00, 0x30, 0x30, 0xEB,
+ 0x00, 0x32 };
+
+static unsigned char send_sms_613[] = { 0xD0, 0x34, 0x81, 0x03, 0x01, 0x13,
+ 0x00, 0x82, 0x02, 0x81, 0x83,
+ 0x85, 0x08, 0x82, 0x04, 0x30,
+ 0xA0, 0x38, 0x32, 0xCB, 0x32,
+ 0x86, 0x09, 0x91, 0x11, 0x22,
+ 0x33, 0x44, 0x55, 0x66, 0x77,
+ 0xF8, 0x8B, 0x14, 0x01, 0x00,
+ 0x09, 0x91, 0x10, 0x32, 0x54,
+ 0x76, 0xF8, 0x40, 0x08, 0x08,
+ 0x00, 0x38, 0x00, 0x30, 0x30,
+ 0xEB, 0x00, 0x33 };
static struct send_sms_test send_sms_data_111 = {
.pdu = send_sms_111,
@@ -7629,12 +8318,958 @@ static struct send_sms_test send_sms_data_111 = {
{.submit = {
.mr = 0x00,
.daddr.address = "012345678",
+ .pid = 0x40,
+ .dcs = 0xF4,
.udl = 12,
.ud = "Test Message"
} }
}
};
+static struct send_sms_test send_sms_data_121 = {
+ .pdu = send_sms_121,
+ .pdu_len = sizeof(send_sms_121),
+ .qualifier = 0x01,
+ .alpha_id = "Send SM",
+ .address = {
+ .ton_npi = 0x91,
+ .number = "112233445566778"
+ },
+ .gsm_sms = {
+ {}, SMS_TYPE_SUBMIT,
+ {.submit = {
+ .mr = 0x00,
+ .daddr.address = "012345678",
+ .pid = 0x40,
+ .dcs = 0xF0,
+ .udl = 7,
+ .ud = "Send SM"
+ } }
+ }
+};
+
+static struct send_sms_test send_sms_data_131 = {
+ .pdu = send_sms_131,
+ .pdu_len = sizeof(send_sms_131),
+ .qualifier = 0x00,
+ .alpha_id = "Short Message",
+ .address = {
+ .ton_npi = 0x91,
+ .number = "112233445566778"
+ },
+ .gsm_sms = {
+ {}, SMS_TYPE_SUBMIT,
+ {.submit = {
+ .mr = 0x00,
+ .daddr.address = "012345678",
+ .pid = 0x40,
+ .dcs = 0xF0,
+ .udl = 13,
+ .ud = "Short Message"
+ } }
+ },
+};
+
+static struct send_sms_test send_sms_data_141 = {
+ .pdu = send_sms_141,
+ .pdu_len = sizeof(send_sms_141),
+ .qualifier = 0x01,
+ .alpha_id = "The address data object holds the RP_Destination_Address",
+ .address = {
+ .ton_npi = 0x91,
+ .number = "112233445566778"
+ },
+ .gsm_sms = {
+ {}, SMS_TYPE_SUBMIT,
+ {.submit = {
+ .mr = 0x00,
+ .daddr.address = "012345678",
+ .pid = 0x40,
+ .dcs = 0xF0,
+ .udl = 160,
+ .ud = "Two types are defined: - A short message to be "
+ "sent to the network in an SMS-SUBMIT message, "
+ "or an SMS-COMMAND message, where the user "
+ "data can be passed transp"
+ } }
+ }
+};
+
+static struct send_sms_test send_sms_data_151 = {
+ .pdu = send_sms_151,
+ .pdu_len = sizeof(send_sms_151),
+ .qualifier = 0x00,
+ .alpha_id = "The address data object holds the RP Destination Address",
+ .address = {
+ .ton_npi = 0x91,
+ .number = "112233445566778"
+ },
+ .gsm_sms = {
+ {}, SMS_TYPE_SUBMIT,
+ {.submit = {
+ .mr = 0x00,
+ .daddr.address = "012345678",
+ .pid = 0x40,
+ .dcs = 0xF0,
+ .udl = 160,
+ .ud = "Two types are defined: - A short message to be "
+ "sent to the network in an SMS-SUBMIT message, "
+ "or an SMS-COMMAND message, where the user "
+ "data can be passed transp"
+ } }
+ }
+};
+
+/* There should be a space after alpha_id */
+static struct send_sms_test send_sms_data_161 = {
+ .pdu = send_sms_161,
+ .pdu_len = sizeof(send_sms_161),
+ .qualifier = 0x00,
+ .alpha_id = "Two types are defined: - A short message to be sent to "
+ "the network in an SMS-SUBMIT message, or an "
+ "SMS-COMMAND message, where the user data can be "
+ "passed transparently; - A short message to be sent "
+ "to the network in an SMS-SUBMIT ",
+ .gsm_sms = {
+ {}, SMS_TYPE_SUBMIT,
+ {.submit = {
+ .mr = 0x00,
+ .daddr.address = "01",
+ .pid = 0x40,
+ .dcs = 0xF0,
+ .udl = 1,
+ .ud = " "
+ } }
+ }
+};
+
+static struct send_sms_test send_sms_data_171 = {
+ .pdu = send_sms_171,
+ .pdu_len = sizeof(send_sms_171),
+ .qualifier = 0x00,
+ .address = {
+ .ton_npi = 0x91,
+ .number = "112233445566778"
+ },
+ .gsm_sms = {
+ {}, SMS_TYPE_SUBMIT,
+ {.submit = {
+ .mr = 0x00,
+ .daddr.address = "012345678",
+ .pid = 0x40,
+ .dcs = 0xF4,
+ .udl = 12,
+ .ud = "Test Message"
+ } }
+ }
+};
+
+static struct send_sms_test send_sms_data_181 = {
+ .pdu = send_sms_181,
+ .pdu_len = sizeof(send_sms_181),
+ .qualifier = 0x00,
+ .address = {
+ .ton_npi = 0x91,
+ .number = "112233445566778"
+ },
+ .gsm_sms = {
+ {}, SMS_TYPE_SUBMIT,
+ {.submit = {
+ .mr = 0x00,
+ .daddr.address = "012345678",
+ .pid = 0x40,
+ .dcs = 0xF4,
+ .udl = 12,
+ .ud = "Test Message"
+ } }
+ }
+};
+
+static struct send_sms_test send_sms_data_211 = {
+ .pdu = send_sms_211,
+ .pdu_len = sizeof(send_sms_211),
+ .qualifier = 0x00,
+ .alpha_id = "ЗДРАВСТВУЙТЕ",
+ .address = {
+ .ton_npi = 0x91,
+ .number = "112233445566778"
+ },
+ .gsm_sms = {
+ {}, SMS_TYPE_SUBMIT,
+ {.submit = {
+ .mr = 0x00,
+ .daddr.address = "012345678",
+ .pid = 0x40,
+ .dcs = 0x08,
+ .udl = 24,
+ .ud = "ЗДРАВСТВУЙТЕ"
+ } }
+ }
+};
+
+static struct send_sms_test send_sms_data_212 = {
+ .pdu = send_sms_212,
+ .pdu_len = sizeof(send_sms_212),
+ .qualifier = 0x00,
+ .alpha_id = "ЗДРАВСТВУЙТЕ",
+ .address = {
+ .ton_npi = 0x91,
+ .number = "112233445566778"
+ },
+ .gsm_sms = {
+ {}, SMS_TYPE_SUBMIT,
+ {.submit = {
+ .mr = 0x00,
+ .daddr.address = "012345678",
+ .pid = 0x40,
+ .dcs = 0x08,
+ .udl = 24,
+ .ud = "ЗДРАВСТВУЙТЕ"
+ } }
+ }
+};
+
+static struct send_sms_test send_sms_data_213 = {
+ .pdu = send_sms_213,
+ .pdu_len = sizeof(send_sms_213),
+ .qualifier = 0x00,
+ .alpha_id = "ЗДРАВСТВУЙТЕ",
+ .address = {
+ .ton_npi = 0x91,
+ .number = "112233445566778"
+ },
+ .gsm_sms = {
+ {}, SMS_TYPE_SUBMIT,
+ {.submit = {
+ .mr = 0x00,
+ .daddr.address = "012345678",
+ .pid = 0x40,
+ .dcs = 0x08,
+ .udl = 24,
+ .ud = "ЗДРАВСТВУЙТЕ"
+ } }
+ }
+};
+
+static struct send_sms_test send_sms_data_311 = {
+ .pdu = send_sms_311,
+ .pdu_len = sizeof(send_sms_311),
+ .qualifier = 0x00,
+ .alpha_id = "NO ICON",
+ .address = {
+ .ton_npi = 0x91,
+ .number = "112233445566778"
+ },
+ .gsm_sms = {
+ {}, SMS_TYPE_SUBMIT,
+ {.submit = {
+ .mr = 0x00,
+ .daddr.address = "012345678",
+ .pid = 0x40,
+ .dcs = 0xF4,
+ .udl = 12,
+ .ud = "Test Message"
+ } }
+ },
+ .icon_id = {
+ .qualifier = STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY,
+ .id = 0x01
+ }
+};
+
+static struct send_sms_test send_sms_data_321 = {
+ .pdu = send_sms_321,
+ .pdu_len = sizeof(send_sms_321),
+ .qualifier = 0x00,
+ .alpha_id = "Send SM",
+ .address = {
+ .ton_npi = 0x91,
+ .number = "112233445566778"
+ },
+ .gsm_sms = {
+ {}, SMS_TYPE_SUBMIT,
+ {.submit = {
+ .mr = 0x00,
+ .daddr.address = "012345678",
+ .pid = 0x40,
+ .dcs = 0xF4,
+ .udl = 12,
+ .ud = "Test Message"
+ } }
+ },
+ .icon_id = {
+ .qualifier = STK_ICON_QUALIFIER_TYPE_NON_SELF_EXPLANATORY,
+ .id = 0x01
+ }
+};
+
+static struct send_sms_test send_sms_data_411 = {
+ .pdu = send_sms_411,
+ .pdu_len = sizeof(send_sms_411),
+ .qualifier = 0x00,
+ .alpha_id = "Text Attribute 1",
+ .gsm_sms = {
+ {}, SMS_TYPE_SUBMIT,
+ {.submit = {
+ .mr = 0x00,
+ .daddr.address = "01",
+ .pid = 0x40,
+ .dcs = 0xF0,
+ .udl = 1,
+ .ud = " "
+ } }
+ },
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x10, 0x00, 0xB4 }
+ }
+};
+
+static struct send_sms_test send_sms_data_412 = {
+ .pdu = send_sms_412,
+ .pdu_len = sizeof(send_sms_412),
+ .qualifier = 0x00,
+ .alpha_id = "Text Attribute 2",
+ .gsm_sms = {
+ {}, SMS_TYPE_SUBMIT,
+ {.submit = {
+ .mr = 0x00,
+ .daddr.address = "01",
+ .pid = 0x40,
+ .dcs = 0xF0,
+ .udl = 1,
+ .ud = " "
+ } }
+ }
+};
+
+static struct send_sms_test send_sms_data_421 = {
+ .pdu = send_sms_421,
+ .pdu_len = sizeof(send_sms_421),
+ .qualifier = 0x00,
+ .alpha_id = "Text Attribute 1",
+ .gsm_sms = {
+ {}, SMS_TYPE_SUBMIT,
+ {.submit = {
+ .mr = 0x00,
+ .daddr.address = "01",
+ .pid = 0x40,
+ .dcs = 0xF0,
+ .udl = 1,
+ .ud = " "
+ } }
+ },
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x10, 0x01, 0xB4 }
+ }
+};
+
+static struct send_sms_test send_sms_data_422 = {
+ .pdu = send_sms_422,
+ .pdu_len = sizeof(send_sms_422),
+ .qualifier = 0x00,
+ .alpha_id = "Text Attribute 2",
+ .gsm_sms = {
+ {}, SMS_TYPE_SUBMIT,
+ {.submit = {
+ .mr = 0x00,
+ .daddr.address = "01",
+ .pid = 0x40,
+ .dcs = 0xF0,
+ .udl = 1,
+ .ud = " "
+ } }
+ }
+};
+
+static struct send_sms_test send_sms_data_431 = {
+ .pdu = send_sms_431,
+ .pdu_len = sizeof(send_sms_431),
+ .qualifier = 0x00,
+ .alpha_id = "Text Attribute 1",
+ .gsm_sms = {
+ {}, SMS_TYPE_SUBMIT,
+ {.submit = {
+ .mr = 0x00,
+ .daddr.address = "01",
+ .pid = 0x40,
+ .dcs = 0xF0,
+ .udl = 1,
+ .ud = " "
+ } }
+ },
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x10, 0x02, 0xB4 }
+ }
+};
+
+static struct send_sms_test send_sms_data_432 = {
+ .pdu = send_sms_432,
+ .pdu_len = sizeof(send_sms_432),
+ .qualifier = 0x00,
+ .alpha_id = "Text Attribute 2",
+ .gsm_sms = {
+ {}, SMS_TYPE_SUBMIT,
+ {.submit = {
+ .mr = 0x00,
+ .daddr.address = "01",
+ .pid = 0x40,
+ .dcs = 0xF0,
+ .udl = 1,
+ .ud = " "
+ } }
+ }
+};
+
+static struct send_sms_test send_sms_data_441 = {
+ .pdu = send_sms_441,
+ .pdu_len = sizeof(send_sms_441),
+ .qualifier = 0x00,
+ .alpha_id = "Text Attribute 1",
+ .gsm_sms = {
+ {}, SMS_TYPE_SUBMIT,
+ {.submit = {
+ .mr = 0x00,
+ .daddr.address = "01",
+ .pid = 0x40,
+ .dcs = 0xF0,
+ .udl = 1,
+ .ud = " "
+ } }
+ },
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x10, 0x04, 0xB4 }
+ }
+};
+
+static struct send_sms_test send_sms_data_442 = {
+ .pdu = send_sms_442,
+ .pdu_len = sizeof(send_sms_442),
+ .qualifier = 0x00,
+ .alpha_id = "Text Attribute 2",
+ .gsm_sms = {
+ {}, SMS_TYPE_SUBMIT,
+ {.submit = {
+ .mr = 0x00,
+ .daddr.address = "01",
+ .pid = 0x40,
+ .dcs = 0xF0,
+ .udl = 1,
+ .ud = " "
+ } }
+ },
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x10, 0x00, 0xB4 }
+ }
+};
+
+static struct send_sms_test send_sms_data_443 = {
+ .pdu = send_sms_443,
+ .pdu_len = sizeof(send_sms_443),
+ .qualifier = 0x00,
+ .alpha_id = "Text Attribute 3",
+ .gsm_sms = {
+ {}, SMS_TYPE_SUBMIT,
+ {.submit = {
+ .mr = 0x00,
+ .daddr.address = "01",
+ .pid = 0x40,
+ .dcs = 0xF0,
+ .udl = 1,
+ .ud = " "
+ } }
+ }
+};
+
+static struct send_sms_test send_sms_data_451 = {
+ .pdu = send_sms_451,
+ .pdu_len = sizeof(send_sms_451),
+ .qualifier = 0x00,
+ .alpha_id = "Text Attribute 1",
+ .gsm_sms = {
+ {}, SMS_TYPE_SUBMIT,
+ {.submit = {
+ .mr = 0x00,
+ .daddr.address = "01",
+ .pid = 0x40,
+ .dcs = 0xF0,
+ .udl = 1,
+ .ud = " "
+ } }
+ },
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x10, 0x08, 0xB4 }
+ }
+};
+
+static struct send_sms_test send_sms_data_452 = {
+ .pdu = send_sms_452,
+ .pdu_len = sizeof(send_sms_452),
+ .qualifier = 0x00,
+ .alpha_id = "Text Attribute 2",
+ .gsm_sms = {
+ {}, SMS_TYPE_SUBMIT,
+ {.submit = {
+ .mr = 0x00,
+ .daddr.address = "01",
+ .pid = 0x40,
+ .dcs = 0xF0,
+ .udl = 1,
+ .ud = " "
+ } }
+ },
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x10, 0x00, 0xB4 }
+ }
+};
+
+static struct send_sms_test send_sms_data_453 = {
+ .pdu = send_sms_453,
+ .pdu_len = sizeof(send_sms_453),
+ .qualifier = 0x00,
+ .alpha_id = "Text Attribute 3",
+ .gsm_sms = {
+ {}, SMS_TYPE_SUBMIT,
+ {.submit = {
+ .mr = 0x00,
+ .daddr.address = "01",
+ .pid = 0x40,
+ .dcs = 0xF0,
+ .udl = 1,
+ .ud = " "
+ } }
+ }
+};
+
+static struct send_sms_test send_sms_data_461 = {
+ .pdu = send_sms_461,
+ .pdu_len = sizeof(send_sms_461),
+ .qualifier = 0x00,
+ .alpha_id = "Text Attribute 1",
+ .gsm_sms = {
+ {}, SMS_TYPE_SUBMIT,
+ {.submit = {
+ .mr = 0x00,
+ .daddr.address = "01",
+ .pid = 0x40,
+ .dcs = 0xF0,
+ .udl = 1,
+ .ud = " "
+ } }
+ },
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x10, 0x10, 0xB4 }
+ }
+};
+
+static struct send_sms_test send_sms_data_462 = {
+ .pdu = send_sms_462,
+ .pdu_len = sizeof(send_sms_462),
+ .qualifier = 0x00,
+ .alpha_id = "Text Attribute 2",
+ .gsm_sms = {
+ {}, SMS_TYPE_SUBMIT,
+ {.submit = {
+ .mr = 0x00,
+ .daddr.address = "01",
+ .pid = 0x40,
+ .dcs = 0xF0,
+ .udl = 1,
+ .ud = " "
+ } }
+ },
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x10, 0x00, 0xB4 }
+ }
+};
+
+static struct send_sms_test send_sms_data_463 = {
+ .pdu = send_sms_463,
+ .pdu_len = sizeof(send_sms_463),
+ .qualifier = 0x00,
+ .alpha_id = "Text Attribute 3",
+ .gsm_sms = {
+ {}, SMS_TYPE_SUBMIT,
+ {.submit = {
+ .mr = 0x00,
+ .daddr.address = "01",
+ .pid = 0x40,
+ .dcs = 0xF0,
+ .udl = 1,
+ .ud = " "
+ } }
+ }
+};
+
+static struct send_sms_test send_sms_data_471 = {
+ .pdu = send_sms_471,
+ .pdu_len = sizeof(send_sms_471),
+ .qualifier = 0x00,
+ .alpha_id = "Text Attribute 1",
+ .gsm_sms = {
+ {}, SMS_TYPE_SUBMIT,
+ {.submit = {
+ .mr = 0x00,
+ .daddr.address = "01",
+ .pid = 0x40,
+ .dcs = 0xF0,
+ .udl = 1,
+ .ud = " "
+ } }
+ },
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x10, 0x20, 0xB4 }
+ }
+};
+
+static struct send_sms_test send_sms_data_472 = {
+ .pdu = send_sms_472,
+ .pdu_len = sizeof(send_sms_472),
+ .qualifier = 0x00,
+ .alpha_id = "Text Attribute 2",
+ .gsm_sms = {
+ {}, SMS_TYPE_SUBMIT,
+ {.submit = {
+ .mr = 0x00,
+ .daddr.address = "01",
+ .pid = 0x40,
+ .dcs = 0xF0,
+ .udl = 1,
+ .ud = " "
+ } }
+ },
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x10, 0x00, 0xB4 }
+ }
+};
+
+static struct send_sms_test send_sms_data_473 = {
+ .pdu = send_sms_473,
+ .pdu_len = sizeof(send_sms_473),
+ .qualifier = 0x00,
+ .alpha_id = "Text Attribute 3",
+ .gsm_sms = {
+ {}, SMS_TYPE_SUBMIT,
+ {.submit = {
+ .mr = 0x00,
+ .daddr.address = "01",
+ .pid = 0x40,
+ .dcs = 0xF0,
+ .udl = 1,
+ .ud = " "
+ } }
+ }
+};
+
+static struct send_sms_test send_sms_data_481 = {
+ .pdu = send_sms_481,
+ .pdu_len = sizeof(send_sms_481),
+ .qualifier = 0x00,
+ .alpha_id = "Text Attribute 1",
+ .gsm_sms = {
+ {}, SMS_TYPE_SUBMIT,
+ {.submit = {
+ .mr = 0x00,
+ .daddr.address = "01",
+ .pid = 0x40,
+ .dcs = 0xF0,
+ .udl = 1,
+ .ud = " "
+ } }
+ },
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x10, 0x40, 0xB4 }
+ }
+};
+
+static struct send_sms_test send_sms_data_482 = {
+ .pdu = send_sms_482,
+ .pdu_len = sizeof(send_sms_482),
+ .qualifier = 0x00,
+ .alpha_id = "Text Attribute 2",
+ .gsm_sms = {
+ {}, SMS_TYPE_SUBMIT,
+ {.submit = {
+ .mr = 0x00,
+ .daddr.address = "01",
+ .pid = 0x40,
+ .dcs = 0xF0,
+ .udl = 1,
+ .ud = " "
+ } }
+ },
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x10, 0x00, 0xB4 }
+ }
+};
+
+static struct send_sms_test send_sms_data_483 = {
+ .pdu = send_sms_483,
+ .pdu_len = sizeof(send_sms_483),
+ .qualifier = 0x00,
+ .alpha_id = "Text Attribute 3",
+ .gsm_sms = {
+ {}, SMS_TYPE_SUBMIT,
+ {.submit = {
+ .mr = 0x00,
+ .daddr.address = "01",
+ .pid = 0x40,
+ .dcs = 0xF0,
+ .udl = 1,
+ .ud = " "
+ } }
+ }
+};
+
+static struct send_sms_test send_sms_data_491 = {
+ .pdu = send_sms_491,
+ .pdu_len = sizeof(send_sms_491),
+ .qualifier = 0x00,
+ .alpha_id = "Text Attribute 1",
+ .gsm_sms = {
+ {}, SMS_TYPE_SUBMIT,
+ {.submit = {
+ .mr = 0x00,
+ .daddr.address = "01",
+ .pid = 0x40,
+ .dcs = 0xF0,
+ .udl = 1,
+ .ud = " "
+ } }
+ },
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x10, 0x80, 0xB4 }
+ }
+};
+
+static struct send_sms_test send_sms_data_492 = {
+ .pdu = send_sms_492,
+ .pdu_len = sizeof(send_sms_492),
+ .qualifier = 0x00,
+ .alpha_id = "Text Attribute 2",
+ .gsm_sms = {
+ {}, SMS_TYPE_SUBMIT,
+ {.submit = {
+ .mr = 0x00,
+ .daddr.address = "01",
+ .pid = 0x40,
+ .dcs = 0xF0,
+ .udl = 1,
+ .ud = " "
+ } }
+ },
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x10, 0x00, 0xB4 }
+ }
+};
+
+static struct send_sms_test send_sms_data_493 = {
+ .pdu = send_sms_493,
+ .pdu_len = sizeof(send_sms_493),
+ .qualifier = 0x00,
+ .alpha_id = "Text Attribute 3",
+ .gsm_sms = {
+ {}, SMS_TYPE_SUBMIT,
+ {.submit = {
+ .mr = 0x00,
+ .daddr.address = "01",
+ .pid = 0x40,
+ .dcs = 0xF0,
+ .udl = 1,
+ .ud = " "
+ } }
+ }
+};
+
+static struct send_sms_test send_sms_data_4101 = {
+ .pdu = send_sms_4101,
+ .pdu_len = sizeof(send_sms_4101),
+ .qualifier = 0x00,
+ .alpha_id = "Text Attribute 1",
+ .gsm_sms = {
+ {}, SMS_TYPE_SUBMIT,
+ {.submit = {
+ .mr = 0x00,
+ .daddr.address = "01",
+ .pid = 0x40,
+ .dcs = 0xF0,
+ .udl = 1,
+ .ud = " "
+ } }
+ },
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x10, 0x00, 0xB4 }
+ }
+};
+
+static struct send_sms_test send_sms_data_4102 = {
+ .pdu = send_sms_4102,
+ .pdu_len = sizeof(send_sms_4102),
+ .qualifier = 0x00,
+ .alpha_id = "Text Attribute 2",
+ .gsm_sms = {
+ {}, SMS_TYPE_SUBMIT,
+ {.submit = {
+ .mr = 0x00,
+ .daddr.address = "01",
+ .pid = 0x40,
+ .dcs = 0xF0,
+ .udl = 1,
+ .ud = " "
+ } }
+ }
+};
+
+/* The TP-UDL should be 4, instead of 24 */
+static struct send_sms_test send_sms_data_511 = {
+ .pdu = send_sms_511,
+ .pdu_len = sizeof(send_sms_511),
+ .qualifier = 0x00,
+ .alpha_id = "中一",
+ .address = {
+ .ton_npi = 0x91,
+ .number = "112233445566778"
+ },
+ .gsm_sms = {
+ {}, SMS_TYPE_SUBMIT,
+ {.submit = {
+ .mr = 0x00,
+ .daddr.address = "012345678",
+ .pid = 0x40,
+ .dcs = 0x08,
+ .udl = 4,
+ .ud = "中一"
+ } }
+ }
+};
+
+/* The TP-UDL should be 4, instead of 24 */
+static struct send_sms_test send_sms_data_512 = {
+ .pdu = send_sms_512,
+ .pdu_len = sizeof(send_sms_512),
+ .qualifier = 0x00,
+ .alpha_id = "中一",
+ .address = {
+ .ton_npi = 0x91,
+ .number = "112233445566778"
+ },
+ .gsm_sms = {
+ {}, SMS_TYPE_SUBMIT,
+ {.submit = {
+ .mr = 0x00,
+ .daddr.address = "012345678",
+ .pid = 0x40,
+ .dcs = 0x08,
+ .udl = 4,
+ .ud = "中一"
+ } }
+ }
+};
+
+/* The TP-UDL should be 4, instead of 24 */
+static struct send_sms_test send_sms_data_513 = {
+ .pdu = send_sms_513,
+ .pdu_len = sizeof(send_sms_513),
+ .qualifier = 0x00,
+ .alpha_id = "中一",
+ .address = {
+ .ton_npi = 0x91,
+ .number = "112233445566778"
+ },
+ .gsm_sms = {
+ {}, SMS_TYPE_SUBMIT,
+ {.submit = {
+ .mr = 0x00,
+ .daddr.address = "012345678",
+ .pid = 0x40,
+ .dcs = 0x08,
+ .udl = 4,
+ .ud = "中一"
+ } }
+ }
+};
+
+static struct send_sms_test send_sms_data_611 = {
+ .pdu = send_sms_611,
+ .pdu_len = sizeof(send_sms_611),
+ .qualifier = 0x00,
+ .alpha_id = "80ル0",
+ .address = {
+ .ton_npi = 0x91,
+ .number = "112233445566778"
+ },
+ .gsm_sms = {
+ {}, SMS_TYPE_SUBMIT,
+ {.submit = {
+ .mr = 0x00,
+ .daddr.address = "012345678",
+ .pid = 0x40,
+ .dcs = 0x08,
+ .udl = 8,
+ .ud = "80ル1"
+ } }
+ }
+};
+
+static struct send_sms_test send_sms_data_612 = {
+ .pdu = send_sms_612,
+ .pdu_len = sizeof(send_sms_612),
+ .qualifier = 0x00,
+ .alpha_id = "81ル1",
+ .address = {
+ .ton_npi = 0x91,
+ .number = "112233445566778"
+ },
+ .gsm_sms = {
+ {}, SMS_TYPE_SUBMIT,
+ {.submit = {
+ .mr = 0x00,
+ .daddr.address = "012345678",
+ .pid = 0x40,
+ .dcs = 0x08,
+ .udl = 8,
+ .ud = "80ル2"
+ } }
+ }
+};
+
+static struct send_sms_test send_sms_data_613 = {
+ .pdu = send_sms_613,
+ .pdu_len = sizeof(send_sms_613),
+ .qualifier = 0x00,
+ .alpha_id = "82ル2",
+ .address = {
+ .ton_npi = 0x91,
+ .number = "112233445566778"
+ },
+ .gsm_sms = {
+ {}, SMS_TYPE_SUBMIT,
+ {.submit = {
+ .mr = 0x00,
+ .daddr.address = "012345678",
+ .pid = 0x40,
+ .dcs = 0x08,
+ .udl = 8,
+ .ud = "80ル3"
+ } }
+ }
+};
+
static void test_send_sms(gconstpointer data)
{
const struct send_sms_test *test = data;
@@ -7653,11 +9288,11 @@ static void test_send_sms(gconstpointer data)
check_alpha_id(command->send_sms.alpha_id, test->alpha_id);
check_address(&command->send_sms.address, &test->address);
- check_gsm_sms_tpdu(&command->send_sms.gsm_sms, &test->gsm_sms);
+ check_gsm_sms(&command->send_sms.gsm_sms, &test->gsm_sms);
check_cdma_sms_tpdu(&command->send_sms.cdma_sms, &test->cdma_sms);
- check_icon_id(&command->select_item.icon_id, &test->icon_id);
- check_text_attr(&command->select_item.text_attr, &test->text_attr);
- check_frame_id(&command->select_item.frame_id, &test->frame_id);
+ check_icon_id(&command->send_sms.icon_id, &test->icon_id);
+ check_text_attr(&command->send_sms.text_attr, &test->text_attr);
+ check_frame_id(&command->send_sms.frame_id, &test->frame_id);
stk_command_free(command);
}
@@ -15022,6 +16657,94 @@ int main(int argc, char **argv)
g_test_add_data_func("/teststk/Send SMS 1.1.1",
&send_sms_data_111, test_send_sms);
+ g_test_add_data_func("/teststk/Send SMS 1.2.1",
+ &send_sms_data_121, test_send_sms);
+ g_test_add_data_func("/teststk/Send SMS 1.3.1",
+ &send_sms_data_131, test_send_sms);
+ g_test_add_data_func("/teststk/Send SMS 1.4.1",
+ &send_sms_data_141, test_send_sms);
+ g_test_add_data_func("/teststk/Send SMS 1.5.1",
+ &send_sms_data_151, test_send_sms);
+ g_test_add_data_func("/teststk/Send SMS 1.6.1",
+ &send_sms_data_161, test_send_sms);
+ g_test_add_data_func("/teststk/Send SMS 1.7.1",
+ &send_sms_data_171, test_send_sms);
+ g_test_add_data_func("/teststk/Send SMS 1.8.1",
+ &send_sms_data_181, test_send_sms);
+ g_test_add_data_func("/teststk/Send SMS 2.1.1",
+ &send_sms_data_211, test_send_sms);
+ g_test_add_data_func("/teststk/Send SMS 2.1.2",
+ &send_sms_data_212, test_send_sms);
+ g_test_add_data_func("/teststk/Send SMS 2.1.3",
+ &send_sms_data_213, test_send_sms);
+ g_test_add_data_func("/teststk/Send SMS 3.1.1",
+ &send_sms_data_311, test_send_sms);
+ g_test_add_data_func("/teststk/Send SMS 3.2.1",
+ &send_sms_data_321, test_send_sms);
+ g_test_add_data_func("/teststk/Send SMS 4.1.1",
+ &send_sms_data_411, test_send_sms);
+ g_test_add_data_func("/teststk/Send SMS 4.1.2",
+ &send_sms_data_412, test_send_sms);
+ g_test_add_data_func("/teststk/Send SMS 4.2.1",
+ &send_sms_data_421, test_send_sms);
+ g_test_add_data_func("/teststk/Send SMS 4.2.2",
+ &send_sms_data_422, test_send_sms);
+ g_test_add_data_func("/teststk/Send SMS 4.3.1",
+ &send_sms_data_431, test_send_sms);
+ g_test_add_data_func("/teststk/Send SMS 4.3.2",
+ &send_sms_data_432, test_send_sms);
+ g_test_add_data_func("/teststk/Send SMS 4.4.1",
+ &send_sms_data_441, test_send_sms);
+ g_test_add_data_func("/teststk/Send SMS 4.4.2",
+ &send_sms_data_442, test_send_sms);
+ g_test_add_data_func("/teststk/Send SMS 4.4.3",
+ &send_sms_data_443, test_send_sms);
+ g_test_add_data_func("/teststk/Send SMS 4.5.1",
+ &send_sms_data_451, test_send_sms);
+ g_test_add_data_func("/teststk/Send SMS 4.5.2",
+ &send_sms_data_452, test_send_sms);
+ g_test_add_data_func("/teststk/Send SMS 4.5.3",
+ &send_sms_data_453, test_send_sms);
+ g_test_add_data_func("/teststk/Send SMS 4.6.1",
+ &send_sms_data_461, test_send_sms);
+ g_test_add_data_func("/teststk/Send SMS 4.6.2",
+ &send_sms_data_462, test_send_sms);
+ g_test_add_data_func("/teststk/Send SMS 4.6.3",
+ &send_sms_data_463, test_send_sms);
+ g_test_add_data_func("/teststk/Send SMS 4.7.1",
+ &send_sms_data_471, test_send_sms);
+ g_test_add_data_func("/teststk/Send SMS 4.7.2",
+ &send_sms_data_472, test_send_sms);
+ g_test_add_data_func("/teststk/Send SMS 4.7.3",
+ &send_sms_data_473, test_send_sms);
+ g_test_add_data_func("/teststk/Send SMS 4.8.1",
+ &send_sms_data_481, test_send_sms);
+ g_test_add_data_func("/teststk/Send SMS 4.8.2",
+ &send_sms_data_482, test_send_sms);
+ g_test_add_data_func("/teststk/Send SMS 4.8.3",
+ &send_sms_data_483, test_send_sms);
+ g_test_add_data_func("/teststk/Send SMS 4.9.1",
+ &send_sms_data_491, test_send_sms);
+ g_test_add_data_func("/teststk/Send SMS 4.9.2",
+ &send_sms_data_492, test_send_sms);
+ g_test_add_data_func("/teststk/Send SMS 4.9.3",
+ &send_sms_data_493, test_send_sms);
+ g_test_add_data_func("/teststk/Send SMS 4.10.1",
+ &send_sms_data_4101, test_send_sms);
+ g_test_add_data_func("/teststk/Send SMS 4.10.2",
+ &send_sms_data_4102, test_send_sms);
+ g_test_add_data_func("/teststk/Send SMS 5.1.1",
+ &send_sms_data_511, test_send_sms);
+ g_test_add_data_func("/teststk/Send SMS 5.1.2",
+ &send_sms_data_512, test_send_sms);
+ g_test_add_data_func("/teststk/Send SMS 5.1.3",
+ &send_sms_data_513, test_send_sms);
+ g_test_add_data_func("/teststk/Send SMS 6.1.1",
+ &send_sms_data_611, test_send_sms);
+ g_test_add_data_func("/teststk/Send SMS 6.1.2",
+ &send_sms_data_612, test_send_sms);
+ g_test_add_data_func("/teststk/Send SMS 6.1.3",
+ &send_sms_data_613, test_send_sms);
g_test_add_data_func("/teststk/Send SMS response 1.1.1",
&send_sms_response_data_111,
--
1.7.0.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 7/8] teststk: Add test for launch browser parser
2010-05-26 14:39 [PATCH 1/8] stk: Make parse_dataobj not consume extra data Yang Gu
` (4 preceding siblings ...)
2010-05-26 14:39 ` [PATCH 6/8] teststk: Add cases for send sms parser Yang Gu
@ 2010-05-26 14:39 ` Yang Gu
2010-05-26 14:39 ` [PATCH 8/8] Move destructor prior to return Yang Gu
2010-05-27 17:48 ` [PATCH 1/8] stk: Make parse_dataobj not consume extra data Denis Kenzior
7 siblings, 0 replies; 9+ messages in thread
From: Yang Gu @ 2010-05-26 14:39 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 27949 bytes --]
---
unit/test-stkutil.c | 790 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 790 insertions(+), 0 deletions(-)
diff --git a/unit/test-stkutil.c b/unit/test-stkutil.c
index 77e05c4..2637ec0 100644
--- a/unit/test-stkutil.c
+++ b/unit/test-stkutil.c
@@ -397,6 +397,49 @@ static inline void check_language(const char *command, const char *test)
check_common_text(command, test);
}
+/* Defined in TS 102.223 Section 8.47 */
+static inline void check_browser_id(const unsigned char command,
+ const unsigned char test)
+{
+ check_common_byte(command, test);
+}
+
+/* Defined in TS 102.223 Section 8.48 */
+static inline void check_url(const char *command, const char *test)
+{
+ check_common_text(command, test);
+}
+
+/* Defined in TS 102.223 Section 8.49 */
+static inline void check_bearer(const struct stk_common_byte_array *command,
+ const struct stk_common_byte_array *test)
+{
+ check_common_byte_array(command, test);
+}
+
+/* Defined in TS 102.223 Section 8.50 */
+static void check_provisioning_file_reference(const struct stk_file *command,
+ const struct stk_file *test)
+{
+ g_assert(command->len == test->len);
+ g_assert(g_mem_equal(command->file, test->file, test->len));
+}
+
+static void check_provisioning_file_references(GSList *command,
+ const struct stk_file *test)
+{
+ struct stk_file *sf;
+ GSList *l;
+ unsigned int i = 0;
+
+ for (l = command; l; l = l->next) {
+ sf = l->data;
+ check_provisioning_file_reference(sf, &test[i++]);
+ }
+
+ g_assert(test[i].len == 0);
+}
+
/* Defined in TS 102.223 Section 8.60 */
static inline void check_aid(const struct stk_aid *command,
const struct stk_aid *test)
@@ -13835,6 +13878,676 @@ static void test_language_notification(gconstpointer data)
stk_command_free(command);
}
+struct launch_browser_test {
+ const unsigned char *pdu;
+ unsigned int pdu_len;
+ unsigned char qualifier;
+ unsigned char browser_id;
+ char *url;
+ struct stk_common_byte_array bearer;
+ struct stk_file prov_file_refs[MAX_ITEM];
+ char *text_gateway_proxy_id;
+ char *alpha_id;
+ struct stk_icon_id icon_id;
+ struct stk_text_attribute text_attr;
+ struct stk_frame_id frame_id;
+ struct stk_common_byte_array network_name;
+ char *text_usr;
+ char *text_passwd;
+};
+
+static unsigned char launch_browser_111[] = { 0xD0, 0x18, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0B,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C };
+
+static unsigned char launch_browser_121[] = { 0xD0, 0x1F, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x12, 0x68, 0x74,
+ 0x74, 0x70, 0x3A, 0x2F, 0x2F,
+ 0x78, 0x78, 0x78, 0x2E, 0x79,
+ 0x79, 0x79, 0x2E, 0x7A, 0x7A,
+ 0x7A, 0x05, 0x00 };
+
+static unsigned char launch_browser_131[] = { 0xD0, 0x0E, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x30, 0x01, 0x00, 0x31,
+ 0x00 };
+
+static unsigned char launch_browser_141[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x32, 0x01,
+ 0x03, 0x0D, 0x10, 0x04, 0x61,
+ 0x62, 0x63, 0x2E, 0x64, 0x65,
+ 0x66, 0x2E, 0x67, 0x68, 0x69,
+ 0x2E, 0x6A, 0x6B, 0x6C };
+
+static unsigned char launch_browser_211[] = { 0xD0, 0x18, 0x81, 0x03, 0x01,
+ 0x15, 0x02, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0B,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C };
+
+static unsigned char launch_browser_221[] = { 0xD0, 0x18, 0x81, 0x03, 0x01,
+ 0x15, 0x03, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0B,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C };
+
+static unsigned char launch_browser_231[] = { 0xD0, 0x0B, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00 };
+
+static unsigned char launch_browser_311[] = { 0xD0, 0x26, 0x81, 0x03, 0x01,
+ 0x15, 0x02, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x19,
+ 0x80, 0x04, 0x17, 0x04, 0x14,
+ 0x04, 0x20, 0x04, 0x10, 0x04,
+ 0x12, 0x04, 0x21, 0x04, 0x22,
+ 0x04, 0x12, 0x04, 0x23, 0x04,
+ 0x19, 0x04, 0x22, 0x04, 0x15 };
+
+static unsigned char launch_browser_411[] = { 0xD0, 0x21, 0x81, 0x03, 0x01,
+ 0x15, 0x02, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x10,
+ 0x4E, 0x6F, 0x74, 0x20, 0x73,
+ 0x65, 0x6C, 0x66, 0x20, 0x65,
+ 0x78, 0x70, 0x6C, 0x61, 0x6E,
+ 0x2E, 0x1E, 0x02, 0x01, 0x01 };
+
+static unsigned char launch_browser_421[] = { 0xD0, 0x1D, 0x81, 0x03, 0x01,
+ 0x15, 0x02, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0C,
+ 0x53, 0x65, 0x6C, 0x66, 0x20,
+ 0x65, 0x78, 0x70, 0x6C, 0x61,
+ 0x6E, 0x2E, 0x1E, 0x02, 0x00,
+ 0x01 };
+
+static unsigned char launch_browser_511[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x31, 0xD0, 0x04,
+ 0x00, 0x0D, 0x00, 0xB4 };
+
+static unsigned char launch_browser_512[] = { 0xD0, 0x1A, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x32 };
+
+static unsigned char launch_browser_521[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x31, 0xD0, 0x04,
+ 0x00, 0x0D, 0x01, 0xB4 };
+
+static unsigned char launch_browser_522[] = { 0xD0, 0x1A, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x32 };
+
+static unsigned char launch_browser_531[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x31, 0xD0, 0x04,
+ 0x00, 0x0D, 0x02, 0xB4 };
+
+static unsigned char launch_browser_532[] = { 0xD0, 0x1A, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x32 };
+
+static unsigned char launch_browser_541[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x31, 0xD0, 0x04,
+ 0x00, 0x0D, 0x04, 0xB4 };
+
+static unsigned char launch_browser_542[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x32, 0xD0, 0x04,
+ 0x00, 0x0D, 0x00, 0xB4 };
+
+static unsigned char launch_browser_543[] = { 0xD0, 0x1A, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x33 };
+
+static unsigned char launch_browser_551[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x31, 0xD0, 0x04,
+ 0x00, 0x0D, 0x08, 0xB4 };
+
+static unsigned char launch_browser_552[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x32, 0xD0, 0x04,
+ 0x00, 0x0D, 0x00, 0xB4 };
+
+static unsigned char launch_browser_553[] = { 0xD0, 0x1A, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x33 };
+
+static unsigned char launch_browser_561[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x31, 0xD0, 0x04,
+ 0x00, 0x0D, 0x10, 0xB4 };
+
+static unsigned char launch_browser_562[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x32, 0xD0, 0x04,
+ 0x00, 0x0D, 0x00, 0xB4 };
+
+static unsigned char launch_browser_563[] = { 0xD0, 0x1A, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x33 };
+
+static unsigned char launch_browser_571[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x31, 0xD0, 0x04,
+ 0x00, 0x0D, 0x20, 0xB4 };
+
+static unsigned char launch_browser_572[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x32, 0xD0, 0x04,
+ 0x00, 0x0D, 0x00, 0xB4 };
+
+static unsigned char launch_browser_573[] = { 0xD0, 0x1A, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x33 };
+
+static unsigned char launch_browser_581[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x31, 0xD0, 0x04,
+ 0x00, 0x0D, 0x40, 0xB4 };
+
+static unsigned char launch_browser_582[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x32, 0xD0, 0x04,
+ 0x00, 0x0D, 0x00, 0xB4 };
+
+static unsigned char launch_browser_583[] = { 0xD0, 0x1A, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x33 };
+
+static unsigned char launch_browser_591[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x31, 0xD0, 0x04,
+ 0x00, 0x0D, 0x80, 0xB4 };
+
+static unsigned char launch_browser_592[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x32, 0xD0, 0x04,
+ 0x00, 0x0D, 0x00, 0xB4 };
+
+static unsigned char launch_browser_593[] = { 0xD0, 0x1A, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x33 };
+
+static unsigned char launch_browser_5101[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x31, 0xD0, 0x04,
+ 0x00, 0x0D, 0x00, 0xB4 };
+
+static unsigned char launch_browser_5102[] = { 0xD0, 0x1A, 0x81, 0x03, 0x01,
+ 0x15, 0x00, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x0D,
+ 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6C, 0x74, 0x20, 0x55, 0x52,
+ 0x4C, 0x20, 0x32 };
+
+static unsigned char launch_browser_611[] = { 0xD0, 0x12, 0x81, 0x03, 0x01,
+ 0x15, 0x02, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x05,
+ 0x80, 0x4F, 0x60, 0x59, 0x7D };
+
+static unsigned char launch_browser_711[] = { 0xD0, 0x10, 0x81, 0x03, 0x01,
+ 0x15, 0x02, 0x82, 0x02, 0x81,
+ 0x82, 0x31, 0x00, 0x05, 0x03,
+ 0x80, 0x30, 0xEB };
+
+static struct launch_browser_test launch_browser_data_111 = {
+ .pdu = launch_browser_111,
+ .pdu_len = sizeof(launch_browser_111),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL"
+};
+
+static struct launch_browser_test launch_browser_data_121 = {
+ .pdu = launch_browser_121,
+ .pdu_len = sizeof(launch_browser_121),
+ .qualifier = 0x00,
+ .url = "http://xxx.yyy.zzz"
+};
+
+static struct launch_browser_test launch_browser_data_131 = {
+ .pdu = launch_browser_131,
+ .pdu_len = sizeof(launch_browser_131),
+ .qualifier = 0x00
+};
+
+static struct launch_browser_test launch_browser_data_141 = {
+ .pdu = launch_browser_141,
+ .pdu_len = sizeof(launch_browser_141),
+ .qualifier = 0x00,
+ .bearer = {
+ .len = 1,
+ .array = (unsigned char *) "\x03"
+ },
+ .text_gateway_proxy_id = "abc.def.ghi.jkl"
+};
+
+static struct launch_browser_test launch_browser_data_211 = {
+ .pdu = launch_browser_211,
+ .pdu_len = sizeof(launch_browser_211),
+ .qualifier = 0x02,
+ .alpha_id = "Default URL"
+};
+
+static struct launch_browser_test launch_browser_data_221 = {
+ .pdu = launch_browser_221,
+ .pdu_len = sizeof(launch_browser_221),
+ .qualifier = 0x03,
+ .alpha_id = "Default URL"
+};
+
+static struct launch_browser_test launch_browser_data_231 = {
+ .pdu = launch_browser_231,
+ .pdu_len = sizeof(launch_browser_231),
+ .qualifier = 0x00
+};
+
+static struct launch_browser_test launch_browser_data_311 = {
+ .pdu = launch_browser_311,
+ .pdu_len = sizeof(launch_browser_311),
+ .qualifier = 0x02,
+ .alpha_id = "ЗДРАВСТВУЙТЕ"
+};
+
+static struct launch_browser_test launch_browser_data_411 = {
+ .pdu = launch_browser_411,
+ .pdu_len = sizeof(launch_browser_411),
+ .qualifier = 0x02,
+ .alpha_id = "Not self explan.",
+ .icon_id = {
+ .qualifier = STK_ICON_QUALIFIER_TYPE_NON_SELF_EXPLANATORY,
+ .id = 0x01
+ }
+};
+
+static struct launch_browser_test launch_browser_data_421 = {
+ .pdu = launch_browser_421,
+ .pdu_len = sizeof(launch_browser_421),
+ .qualifier = 0x02,
+ .alpha_id = "Self explan.",
+ .icon_id = {
+ .qualifier = STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY,
+ .id = 0x01
+ }
+};
+
+static struct launch_browser_test launch_browser_data_511 = {
+ .pdu = launch_browser_511,
+ .pdu_len = sizeof(launch_browser_511),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 1",
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x0D, 0x00, 0xB4 }
+ }
+};
+
+static struct launch_browser_test launch_browser_data_512 = {
+ .pdu = launch_browser_512,
+ .pdu_len = sizeof(launch_browser_512),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 2"
+};
+
+static struct launch_browser_test launch_browser_data_521 = {
+ .pdu = launch_browser_521,
+ .pdu_len = sizeof(launch_browser_521),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 1",
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x0D, 0x01, 0xB4 }
+ }
+};
+
+static struct launch_browser_test launch_browser_data_522 = {
+ .pdu = launch_browser_522,
+ .pdu_len = sizeof(launch_browser_522),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 2"
+};
+
+static struct launch_browser_test launch_browser_data_531 = {
+ .pdu = launch_browser_531,
+ .pdu_len = sizeof(launch_browser_531),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 1",
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x0D, 0x02, 0xB4 }
+ }
+};
+
+static struct launch_browser_test launch_browser_data_532 = {
+ .pdu = launch_browser_532,
+ .pdu_len = sizeof(launch_browser_532),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 2"
+};
+
+static struct launch_browser_test launch_browser_data_541 = {
+ .pdu = launch_browser_541,
+ .pdu_len = sizeof(launch_browser_541),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 1",
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x0D, 0x04, 0xB4 }
+ }
+};
+
+static struct launch_browser_test launch_browser_data_542 = {
+ .pdu = launch_browser_542,
+ .pdu_len = sizeof(launch_browser_542),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 2",
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x0D, 0x00, 0xB4 }
+ }
+};
+
+static struct launch_browser_test launch_browser_data_543 = {
+ .pdu = launch_browser_543,
+ .pdu_len = sizeof(launch_browser_543),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 3"
+};
+
+static struct launch_browser_test launch_browser_data_551 = {
+ .pdu = launch_browser_551,
+ .pdu_len = sizeof(launch_browser_551),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 1",
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x0D, 0x08, 0xB4 }
+ }
+};
+
+static struct launch_browser_test launch_browser_data_552 = {
+ .pdu = launch_browser_552,
+ .pdu_len = sizeof(launch_browser_552),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 2",
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x0D, 0x00, 0xB4 }
+ }
+};
+
+static struct launch_browser_test launch_browser_data_553 = {
+ .pdu = launch_browser_553,
+ .pdu_len = sizeof(launch_browser_553),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 3"
+};
+
+static struct launch_browser_test launch_browser_data_561 = {
+ .pdu = launch_browser_561,
+ .pdu_len = sizeof(launch_browser_561),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 1",
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x0D, 0x10, 0xB4 }
+ }
+};
+
+static struct launch_browser_test launch_browser_data_562 = {
+ .pdu = launch_browser_562,
+ .pdu_len = sizeof(launch_browser_562),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 2",
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x0D, 0x00, 0xB4 }
+ }
+};
+
+static struct launch_browser_test launch_browser_data_563 = {
+ .pdu = launch_browser_563,
+ .pdu_len = sizeof(launch_browser_563),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 3"
+};
+
+static struct launch_browser_test launch_browser_data_571 = {
+ .pdu = launch_browser_571,
+ .pdu_len = sizeof(launch_browser_571),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 1",
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x0D, 0x20, 0xB4 }
+ }
+};
+
+static struct launch_browser_test launch_browser_data_572 = {
+ .pdu = launch_browser_572,
+ .pdu_len = sizeof(launch_browser_572),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 2",
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x0D, 0x00, 0xB4 }
+ }
+};
+
+static struct launch_browser_test launch_browser_data_573 = {
+ .pdu = launch_browser_573,
+ .pdu_len = sizeof(launch_browser_573),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 3"
+};
+
+static struct launch_browser_test launch_browser_data_581 = {
+ .pdu = launch_browser_581,
+ .pdu_len = sizeof(launch_browser_581),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 1",
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x0D, 0x40, 0xB4 }
+ }
+};
+
+static struct launch_browser_test launch_browser_data_582 = {
+ .pdu = launch_browser_582,
+ .pdu_len = sizeof(launch_browser_582),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 2",
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x0D, 0x00, 0xB4 }
+ }
+};
+
+static struct launch_browser_test launch_browser_data_583 = {
+ .pdu = launch_browser_583,
+ .pdu_len = sizeof(launch_browser_583),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 3"
+};
+
+static struct launch_browser_test launch_browser_data_591 = {
+ .pdu = launch_browser_591,
+ .pdu_len = sizeof(launch_browser_591),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 1",
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x0D, 0x80, 0xB4 }
+ }
+};
+
+static struct launch_browser_test launch_browser_data_592 = {
+ .pdu = launch_browser_592,
+ .pdu_len = sizeof(launch_browser_592),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 2",
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x0D, 0x00, 0xB4 }
+ }
+};
+
+static struct launch_browser_test launch_browser_data_593 = {
+ .pdu = launch_browser_593,
+ .pdu_len = sizeof(launch_browser_593),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 3"
+};
+
+static struct launch_browser_test launch_browser_data_5101 = {
+ .pdu = launch_browser_5101,
+ .pdu_len = sizeof(launch_browser_5101),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 1",
+ .text_attr = {
+ .len = 4,
+ .attributes = { 0x00, 0x0D, 0x00, 0xB4 }
+ }
+};
+
+static struct launch_browser_test launch_browser_data_5102 = {
+ .pdu = launch_browser_5102,
+ .pdu_len = sizeof(launch_browser_5102),
+ .qualifier = 0x00,
+ .alpha_id = "Default URL 2"
+};
+
+static struct launch_browser_test launch_browser_data_611 = {
+ .pdu = launch_browser_611,
+ .pdu_len = sizeof(launch_browser_611),
+ .qualifier = 0x02,
+ .alpha_id = "你好"
+};
+
+static struct launch_browser_test launch_browser_data_711 = {
+ .pdu = launch_browser_711,
+ .pdu_len = sizeof(launch_browser_711),
+ .qualifier = 0x02,
+ .alpha_id = "ル"
+};
+
+static void test_launch_browser(gconstpointer data)
+{
+ const struct launch_browser_test *test = data;
+ struct stk_command *command;
+
+ command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
+
+ g_assert(command);
+
+ g_assert(command->number == 1);
+ g_assert(command->type == STK_COMMAND_TYPE_LAUNCH_BROWSER);
+ g_assert(command->qualifier == test->qualifier);
+
+ g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
+ g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_TERMINAL);
+
+ check_browser_id(command->launch_browser.browser_id, test->browser_id);
+ check_url(command->launch_browser.url, test->url);
+ check_bearer(&command->launch_browser.bearer, &test->bearer);
+ check_provisioning_file_references(
+ command->launch_browser.prov_file_refs, test->prov_file_refs);
+ check_text(command->launch_browser.text_gateway_proxy_id,
+ test->text_gateway_proxy_id);
+ check_alpha_id(command->launch_browser.alpha_id, test->alpha_id);
+ check_icon_id(&command->launch_browser.icon_id, &test->icon_id);
+ check_text_attr(&command->launch_browser.text_attr, &test->text_attr);
+ check_frame_id(&command->launch_browser.frame_id, &test->frame_id);
+ check_text(command->launch_browser.text_usr, test->text_usr);
+ check_text(command->launch_browser.text_passwd, test->text_passwd);
+
+ stk_command_free(command);
+}
+
struct terminal_response_test {
const unsigned char *pdu;
unsigned int pdu_len;
@@ -17246,5 +17959,82 @@ int main(int argc, char **argv)
g_test_add_data_func("/teststk/Language Notification 1.2.1",
&language_notification_data_121, test_language_notification);
+ g_test_add_data_func("/teststk/Launch Browser 1.1.1",
+ &launch_browser_data_111, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 1.2.1",
+ &launch_browser_data_121, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 1.3.1",
+ &launch_browser_data_131, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 1.4.1",
+ &launch_browser_data_141, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 2.1.1",
+ &launch_browser_data_211, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 2.2.1",
+ &launch_browser_data_221, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 2.3.1",
+ &launch_browser_data_231, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 3.1.1",
+ &launch_browser_data_311, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 4.1.1",
+ &launch_browser_data_411, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 4.2.1",
+ &launch_browser_data_421, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.1.1",
+ &launch_browser_data_511, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.1.2",
+ &launch_browser_data_512, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.2.1",
+ &launch_browser_data_521, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.2.2",
+ &launch_browser_data_522, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.3.1",
+ &launch_browser_data_531, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.3.2",
+ &launch_browser_data_532, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.4.1",
+ &launch_browser_data_541, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.4.2",
+ &launch_browser_data_542, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.4.3",
+ &launch_browser_data_543, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.5.1",
+ &launch_browser_data_551, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.5.2",
+ &launch_browser_data_552, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.5.3",
+ &launch_browser_data_553, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.6.1",
+ &launch_browser_data_561, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.6.2",
+ &launch_browser_data_562, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.6.3",
+ &launch_browser_data_563, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.7.1",
+ &launch_browser_data_571, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.7.2",
+ &launch_browser_data_572, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.7.3",
+ &launch_browser_data_573, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.8.1",
+ &launch_browser_data_581, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.8.2",
+ &launch_browser_data_582, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.8.3",
+ &launch_browser_data_583, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.9.1",
+ &launch_browser_data_591, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.9.2",
+ &launch_browser_data_592, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.9.3",
+ &launch_browser_data_593, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.10.1",
+ &launch_browser_data_5101, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 5.10.2",
+ &launch_browser_data_5102, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 6.1.1",
+ &launch_browser_data_611, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser 7.1.1",
+ &launch_browser_data_711, test_launch_browser);
+
return g_test_run();
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 8/8] Move destructor prior to return
2010-05-26 14:39 [PATCH 1/8] stk: Make parse_dataobj not consume extra data Yang Gu
` (5 preceding siblings ...)
2010-05-26 14:39 ` [PATCH 7/8] teststk: Add test for launch browser parser Yang Gu
@ 2010-05-26 14:39 ` Yang Gu
2010-05-27 17:48 ` [PATCH 1/8] stk: Make parse_dataobj not consume extra data Denis Kenzior
7 siblings, 0 replies; 9+ messages in thread
From: Yang Gu @ 2010-05-26 14:39 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 4766 bytes --]
---
src/stkutil.c | 60 +++++++++++++++++++++++++-------------------------------
1 files changed, 27 insertions(+), 33 deletions(-)
diff --git a/src/stkutil.c b/src/stkutil.c
index 3adb9e3..1a0c678 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -2116,11 +2116,11 @@ static gboolean parse_display_text(struct stk_command *command,
&obj->frame_id,
STK_DATA_OBJECT_TYPE_INVALID);
+ command->destructor = destroy_display_text;
+
if (ret == FALSE)
return FALSE;
- command->destructor = destroy_display_text;
-
return TRUE;
}
@@ -2154,11 +2154,11 @@ static gboolean parse_get_inkey(struct stk_command *command,
&obj->frame_id,
STK_DATA_OBJECT_TYPE_INVALID);
+ command->destructor = destroy_get_inkey;
+
if (ret == FALSE)
return FALSE;
- command->destructor = destroy_get_inkey;
-
return TRUE;
}
@@ -2196,11 +2196,11 @@ static gboolean parse_get_input(struct stk_command *command,
&obj->frame_id,
STK_DATA_OBJECT_TYPE_INVALID);
+ command->destructor = destroy_get_input;
+
if (ret == FALSE)
return FALSE;
- command->destructor = destroy_get_input;
-
return TRUE;
}
@@ -2247,11 +2247,11 @@ static gboolean parse_play_tone(struct stk_command *command,
&obj->frame_id,
STK_DATA_OBJECT_TYPE_INVALID);
+ command->destructor = destroy_play_tone;
+
if (ret == FALSE)
return FALSE;
- command->destructor = destroy_play_tone;
-
return TRUE;
}
@@ -2275,8 +2275,6 @@ static gboolean parse_poll_interval(struct stk_command *command,
if (ret == FALSE)
return FALSE;
- command->destructor = NULL;
-
return TRUE;
}
@@ -2330,10 +2328,12 @@ static gboolean parse_setup_menu(struct stk_command *command,
gboolean ret;
if (command->src != STK_DEVICE_IDENTITY_TYPE_UICC)
- goto error;
+ return FALSE;
if (command->dst != STK_DEVICE_IDENTITY_TYPE_TERMINAL)
- goto error;
+ return FALSE;
+
+ command->destructor = destroy_setup_menu;
ret = parse_dataobj(iter,
STK_DATA_OBJECT_TYPE_ALPHA_ID,
@@ -2342,12 +2342,12 @@ static gboolean parse_setup_menu(struct stk_command *command,
STK_DATA_OBJECT_TYPE_INVALID);
if (ret == FALSE)
- goto error;
+ return FALSE;
obj->items = parse_item_list(iter);
if (obj->items == NULL)
- goto error;
+ return FALSE;
ret = parse_dataobj(iter,
STK_DATA_OBJECT_TYPE_ITEMS_NEXT_ACTION_INDICATOR, 0,
@@ -2363,15 +2363,9 @@ static gboolean parse_setup_menu(struct stk_command *command,
STK_DATA_OBJECT_TYPE_INVALID);
if (ret == FALSE)
- goto error;
-
- command->destructor = destroy_setup_menu;
+ return FALSE;
return TRUE;
-
-error:
- destroy_setup_menu(command);
- return FALSE;
}
static void destroy_select_item(struct stk_command *command)
@@ -2566,11 +2560,11 @@ static gboolean parse_setup_call(struct stk_command *command,
&obj->frame_id,
STK_DATA_OBJECT_TYPE_INVALID);
+ command->destructor = destroy_setup_call;
+
if (ret == FALSE)
return FALSE;
- command->destructor = destroy_setup_call;
-
return TRUE;
}
@@ -2607,11 +2601,11 @@ static gboolean parse_refresh(struct stk_command *command,
&obj->frame_id,
STK_DATA_OBJECT_TYPE_INVALID);
+ command->destructor = destroy_refresh;
+
if (ret == FALSE)
return FALSE;
- command->destructor = destroy_refresh;
-
return TRUE;
}
@@ -2790,11 +2784,11 @@ static gboolean parse_setup_idle_mode_text(struct stk_command *command,
&obj->frame_id,
STK_DATA_OBJECT_TYPE_INVALID);
+ command->destructor = destroy_setup_idle_mode_text;
+
if (ret == FALSE)
return FALSE;
- command->destructor = destroy_setup_idle_mode_text;
-
return TRUE;
}
@@ -2829,11 +2823,11 @@ static gboolean parse_run_at_command(struct stk_command *command,
&obj->frame_id,
STK_DATA_OBJECT_TYPE_INVALID);
+ command->destructor = destroy_run_at_command;
+
if (ret == FALSE)
return FALSE;
- command->destructor = destroy_run_at_command;
-
return TRUE;
}
@@ -2868,11 +2862,11 @@ static gboolean parse_send_dtmf(struct stk_command *command,
&obj->frame_id,
STK_DATA_OBJECT_TYPE_INVALID);
+ command->destructor = destroy_send_dtmf;
+
if (ret == FALSE)
return FALSE;
- command->destructor = destroy_send_dtmf;
-
return TRUE;
}
@@ -2987,11 +2981,11 @@ static gboolean parse_launch_browser(struct stk_command *command,
&obj->text_passwd,
STK_DATA_OBJECT_TYPE_INVALID);
+ command->destructor = destroy_launch_browser;
+
if (ret == FALSE)
return FALSE;
- command->destructor = destroy_launch_browser;
-
return TRUE;
error:
--
1.7.0.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 1/8] stk: Make parse_dataobj not consume extra data
2010-05-26 14:39 [PATCH 1/8] stk: Make parse_dataobj not consume extra data Yang Gu
` (6 preceding siblings ...)
2010-05-26 14:39 ` [PATCH 8/8] Move destructor prior to return Yang Gu
@ 2010-05-27 17:48 ` Denis Kenzior
7 siblings, 0 replies; 9+ messages in thread
From: Denis Kenzior @ 2010-05-27 17:48 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 281 bytes --]
Hi Yang,
> ---
> src/stkutil.c | 7 +++++++
> 1 files changed, 7 insertions(+), 0 deletions(-)
I applied patches 2..8 in this series (with some refactoring). For this patch
I decided to fix it differently. Let me know if I screwed something up.
Thanks,
-Denis
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2010-05-27 17:48 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-26 14:39 [PATCH 1/8] stk: Make parse_dataobj not consume extra data Yang Gu
2010-05-26 14:39 ` [PATCH 2/8] stk: Add parser for launch browser commands Yang Gu
2010-05-26 14:39 ` [PATCH 3/8] teststk: Add check of len in byte array Yang Gu
2010-05-26 14:39 ` [PATCH 4/8] teststk: Use check_common_text() to check string Yang Gu
2010-05-26 14:39 ` [PATCH 5/8] stk: Fix the parser of send sms Yang Gu
2010-05-26 14:39 ` [PATCH 6/8] teststk: Add cases for send sms parser Yang Gu
2010-05-26 14:39 ` [PATCH 7/8] teststk: Add test for launch browser parser Yang Gu
2010-05-26 14:39 ` [PATCH 8/8] Move destructor prior to return Yang Gu
2010-05-27 17:48 ` [PATCH 1/8] stk: Make parse_dataobj not consume extra data Denis Kenzior
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox