9d9afa110fa305b45fa8a34d9fbada5f61b852d8
[platform/upstream/ofono.git] / unit / test-stkutil.c
1 /*
2  *
3  *  oFono - Open Source Telephony
4  *
5  *  Copyright (C) 2008-2011  Intel Corporation. All rights reserved.
6  *
7  *  This program is free software; you can redistribute it and/or modify
8  *  it under the terms of the GNU General Public License version 2 as
9  *  published by the Free Software Foundation.
10  *
11  *  This program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *  GNU General Public License for more details.
15  *
16  *  You should have received a copy of the GNU General Public License
17  *  along with this program; if not, write to the Free Software
18  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19  *
20  */
21
22 #ifdef HAVE_CONFIG_H
23 #include <config.h>
24 #endif
25
26 #include <stdio.h>
27 #include <unistd.h>
28 #include <stdlib.h>
29 #include <string.h>
30 #include <stdint.h>
31
32 #include <glib.h>
33 #include <glib/gprintf.h>
34
35 #include <ofono/types.h>
36 #include "smsutil.h"
37 #include "stkutil.h"
38 #include "util.h"
39
40 #include "stk-test-data.h"
41
42 #define MAX_ITEM 100
43
44 struct sms_submit_test {
45         gboolean rd;
46         enum sms_validity_period_format vpf;
47         gboolean rp;
48         gboolean udhi;
49         gboolean srr;
50         guint8 mr;
51         struct sms_address daddr;
52         guint8 pid;
53         guint8 dcs;
54         struct sms_validity_period vp;
55         guint8 udl;
56         guint8 ud[160];
57 };
58
59 struct sms_test {
60         struct sms_address sc_addr;
61         enum sms_type type;
62         union {
63                 struct sms_deliver deliver;
64                 struct sms_deliver_ack_report deliver_ack_report;
65                 struct sms_deliver_err_report deliver_err_report;
66                 struct sms_submit_test submit;
67                 struct sms_submit_ack_report submit_ack_report;
68                 struct sms_submit_err_report submit_err_report;
69                 struct sms_command command;
70                 struct sms_status_report status_report;
71         };
72 };
73
74 static gboolean g_mem_equal(const unsigned char *v1, const unsigned char *v2,
75                                 unsigned int len)
76 {
77         unsigned int i;
78
79         for (i = 0; i < len; i++)
80                 if (v1[i] != v2[i])
81                         return FALSE;
82
83         return TRUE;
84 }
85
86 static inline void check_common_bool(const ofono_bool_t command,
87                                         const ofono_bool_t test)
88 {
89         g_assert(command == test);
90 }
91
92 static inline void check_common_byte(const unsigned char command,
93                                         const unsigned char test)
94 {
95         g_assert(command == test);
96 }
97
98 static inline void check_common_text(const char *command, const char *test)
99 {
100         if (test == NULL) {
101                 g_assert(command == NULL);
102                 return;
103         }
104
105         g_assert(command != NULL);
106         g_assert(g_str_equal(command, test));
107 }
108
109 static inline void check_common_byte_array(
110                                 const struct stk_common_byte_array *command,
111                                 const struct stk_common_byte_array *test)
112 {
113         if (test->len == 0) {
114                 g_assert(command->len == 0);
115                 return;
116         }
117
118         g_assert(command->len != 0);
119         g_assert(command->len == test->len);
120         g_assert(g_mem_equal(command->array, test->array, test->len));
121 }
122
123 /* Defined in TS 102.223 Section 8.1 */
124 static inline void check_address(const struct stk_address *command,
125                                         const struct stk_address *test)
126 {
127         g_assert(command->ton_npi == test->ton_npi);
128         check_common_text(command->number, test->number);
129 }
130
131 /* Defined in TS 102.223 Section 8.2 */
132 static inline void check_alpha_id(const char *command, const char *test)
133 {
134         if (test != NULL && strlen(test) > 0)
135                 check_common_text(command, test);
136         else
137                 g_assert(command == NULL);
138 }
139
140 /* Defined in TS 102.223 Section 8.3 */
141 static void check_subaddress(const struct stk_subaddress *command,
142                                         const struct stk_subaddress *test)
143 {
144         if (test->len == 0) {
145                 g_assert(command->len == 0);
146                 return;
147         }
148
149         g_assert(command->len != 0);
150         g_assert(g_mem_equal(command->subaddr, test->subaddr, test->len));
151 }
152
153 /* Defined in TS 102.223 Section 8.4 */
154 static void check_ccp(const struct stk_ccp *command,
155                                         const struct stk_ccp *test)
156 {
157         if (test->len == 0) {
158                 g_assert(command->len == 0);
159                 return;
160         }
161
162         g_assert(command->len != 0);
163         g_assert(g_mem_equal(command->ccp, test->ccp, test->len));
164 }
165
166 /* Defined in TS 102.223 Section 8.8 */
167 static void check_duration(const struct stk_duration *command,
168                                         const struct stk_duration *test)
169 {
170         g_assert(command->unit == test->unit);
171         g_assert(command->interval == test->interval);
172 }
173
174 /* Defined in TS 102.223 Section 8.9 */
175 static void check_item(const struct stk_item *command,
176                                         const struct stk_item *test)
177 {
178         g_assert(command->id == test->id);
179         check_common_text(command->text, test->text);
180 }
181
182 /* Defined in TS 102.223 Section 8.10 */
183 static inline void check_item_id(const unsigned char command,
184                                         const unsigned char test)
185 {
186         check_common_byte(command, test);
187 }
188
189 static void check_items(GSList *command, const struct stk_item *test)
190 {
191         struct stk_item *si;
192         GSList *l;
193         unsigned int i = 0;
194
195         for (l = command; l; l = l->next) {
196                 si = l->data;
197                 check_item(si, &test[i++]);
198         }
199
200         g_assert(test[i].id == 0);
201 }
202
203 /* Defined in TS 102.223 Section 8.11 */
204 static void check_response_length(const struct stk_response_length *command,
205                                         const struct stk_response_length *test)
206 {
207         g_assert(command->min == test->min);
208         g_assert(command->max == test->max);
209 }
210
211 /* Defined in TS 102.223 Section 8.13 */
212 static void check_gsm_sms(const struct sms *command,
213                                         const struct sms_test *test)
214 {
215         g_assert(command->sc_addr.number_type == test->sc_addr.number_type);
216         g_assert(command->sc_addr.numbering_plan ==
217                         test->sc_addr.numbering_plan);
218         g_assert(g_str_equal(command->sc_addr.address, test->sc_addr.address));
219
220         switch (test->type) {
221         case SMS_TYPE_SUBMIT: {
222                 const struct sms_submit *cs = &command->submit;
223                 const struct sms_submit_test *ts = &test->submit;
224                 enum sms_charset charset;
225
226                 g_assert(cs->rd == ts->rd);
227                 g_assert(cs->vpf == ts->vpf);
228                 g_assert(cs->rp == ts->rp);
229                 g_assert(cs->udhi == ts->udhi);
230                 g_assert(cs->srr == ts->srr);
231                 g_assert(cs->mr == ts->mr);
232
233                 g_assert(cs->daddr.number_type == ts->daddr.number_type);
234                 g_assert(cs->daddr.numbering_plan == ts->daddr.numbering_plan);
235                 g_assert(g_str_equal(cs->daddr.address, ts->daddr.address));
236
237                 g_assert(cs->pid == ts->pid);
238                 g_assert(cs->dcs == ts->dcs);
239
240                 switch (ts->vpf) {
241                 case SMS_VALIDITY_PERIOD_FORMAT_RELATIVE:
242                         g_assert(cs->vp.relative == ts->vp.relative);
243                         break;
244                 case SMS_VALIDITY_PERIOD_FORMAT_ABSOLUTE: {
245                         const struct sms_scts *ca = &cs->vp.absolute;
246                         const struct sms_scts *ta = &ts->vp.absolute;
247                         g_assert(ca->year == ta->year);
248                         g_assert(ca->month == ta->month);
249                         g_assert(ca->day == ta->day);
250                         g_assert(ca->hour == ta->hour);
251                         g_assert(ca->minute == ta->minute);
252                         g_assert(ca->second == ta->second);
253                         g_assert(ca->has_timezone == ta->has_timezone);
254
255                         if (ta->has_timezone)
256                                 g_assert(ca->timezone == ta->timezone);
257
258                         break;
259                 }
260                 case SMS_VALIDITY_PERIOD_FORMAT_ENHANCED:
261                         g_assert(g_mem_equal(cs->vp.enhanced,
262                                                         ts->vp.enhanced, 7));
263                         break;
264                 default:
265                         break;
266                 }
267
268                 g_assert(cs->udl == ts->udl);
269
270                 sms_dcs_decode(ts->dcs, NULL, &charset, NULL, NULL);
271
272                 if (charset == SMS_CHARSET_8BIT)
273                         g_assert(g_str_equal(cs->ud, ts->ud));
274                 else {
275                         GSList *sms_list = NULL;
276                         char *message;
277                         sms_list = g_slist_prepend(sms_list, (void *)command);
278                         message = sms_decode_text(sms_list);
279                         g_assert(g_str_equal(message, ts->ud));
280                         g_free(message);
281                 }
282
283                 break;
284         }
285         default:
286                 g_assert(FALSE);
287         }
288 }
289
290 /* Defined in TS 102.223 Section 8.14 */
291 static inline void check_ss(const struct stk_ss *command,
292                                         const struct stk_ss *test)
293 {
294         g_assert(command->ton_npi == test->ton_npi);
295         check_common_text(command->ss, test->ss);
296 }
297
298 /* Defined in TS 102.223 Section 8.15 */
299 static inline void check_text(const char *command, const char *test)
300 {
301         check_common_text(command, test);
302 }
303
304 /* Defined in TS 102.223 Section 8.16 */
305 static inline void check_tone(const ofono_bool_t command,
306                                         const ofono_bool_t test)
307 {
308         check_common_bool(command, test);
309 }
310
311 /* Defined in TS 102.223 Section 8.17 */
312 static inline void check_ussd(const struct stk_ussd_string *command,
313                                                         const char *test)
314 {
315         char *utf8 = ussd_decode(command->dcs, command->len, command->string);
316         check_common_text(utf8, test);
317         g_free(utf8);
318 }
319
320 /* Defined in TS 102.223 Section 8.18 */
321 static void check_file_list(GSList *command, const struct stk_file *test)
322 {
323         struct stk_file *sf;
324         GSList *l;
325         unsigned int i = 0;
326
327         for (l = command; l; l = l->next) {
328                 sf = l->data;
329                 g_assert(sf->len == test[i].len);
330                 g_assert(g_mem_equal(sf->file, test[i++].file, sf->len));
331         }
332
333         g_assert(test[i].len == 0);
334 }
335
336 /* Defined in TS 102.223 Section 8.23 */
337 static inline void check_default_text(const char *command, const char *test)
338 {
339         check_common_text(command, test);
340 }
341
342 /* Defined in TS 102.223 Section 8.24 */
343 static void check_items_next_action_indicator(
344                         const struct stk_items_next_action_indicator *command,
345                         const struct stk_items_next_action_indicator *test)
346 {
347         g_assert(command->len == test->len);
348         g_assert(g_mem_equal(command->list, test->list, test->len));
349 }
350
351 /* Defined in TS 102.223 Section 8.25 */
352 static void check_event_list(const struct stk_event_list *command,
353                                 const struct stk_event_list *test)
354 {
355         g_assert(command->len == test->len);
356         g_assert(g_mem_equal(command->list, test->list, test->len));
357 }
358
359 /* Defined in TS 102.223 Section 8.31 */
360 static void check_icon_id(const struct stk_icon_id *command,
361                                         const struct stk_icon_id *test)
362 {
363         g_assert(command->id == test->id);
364         g_assert(command->qualifier == test->qualifier);
365 }
366
367 /* Defined in TS 102.223 Section 8.32 */
368 static void check_item_icon_id_list(const struct stk_item_icon_id_list *command,
369                                 const struct stk_item_icon_id_list *test)
370 {
371         g_assert(command->qualifier == test->qualifier);
372         g_assert(command->len == test->len);
373         g_assert(g_mem_equal(command->list, test->list, test->len));
374 }
375
376 /* Defined in TS 102.223 Section 8.35 */
377 static void check_c_apdu(const struct stk_c_apdu *command,
378                                 const struct stk_c_apdu *test)
379 {
380         g_assert(command->cla == test->cla);
381         g_assert(command->ins == test->ins);
382         g_assert(command->p1 == test->p1);
383         g_assert(command->p2 == test->p2);
384         g_assert(command->lc == test->lc);
385         g_assert(g_mem_equal(command->data, test->data, test->lc));
386
387         if (test->has_le)
388                 g_assert(command->le == test->le);
389 }
390
391 /* Defined in TS 102.223 Section 8.37 */
392 static inline void check_timer_id(const unsigned char command,
393                                         const unsigned char test)
394 {
395         check_common_byte(command, test);
396 }
397
398 /* Defined in TS 102.223 Section 8.38 */
399 static inline void check_timer_value(const struct stk_timer_value *command,
400                                         const struct stk_timer_value *test)
401 {
402         g_assert(command->hour == test->hour);
403         g_assert(command->minute == test->minute);
404         g_assert(command->second == test->second);
405 }
406
407 /* Defined in TS 102.223 Section 8.40 */
408 static inline void check_at_command(const char *command, const char *test)
409 {
410         check_common_text(command, test);
411 }
412
413 /* Defined in TS 102.223 Section 8.43 */
414 static inline void check_imm_resp(const unsigned char command,
415                                         const unsigned char test)
416 {
417         check_common_byte(command, test);
418 }
419
420 /* Defined in TS 102.223 Section 8.44 */
421 static inline void check_dtmf_string(const char *command, const char *test)
422 {
423         check_common_text(command, test);
424 }
425
426 /* Defined in TS 102.223 Section 8.45 */
427 static inline void check_language(const char *command, const char *test)
428 {
429         check_common_text(command, test);
430 }
431
432 /* Defined in TS 102.223 Section 8.47 */
433 static inline void check_browser_id(const unsigned char command,
434                                         const unsigned char test)
435 {
436         check_common_byte(command, test);
437 }
438
439 /* Defined in TS 102.223 Section 8.48 */
440 static inline void check_url(const char *command, const char *test)
441 {
442         check_common_text(command, test);
443 }
444
445 /* Defined in TS 102.223 Section 8.49 */
446 static inline void check_bearer(const struct stk_common_byte_array *command,
447                                 const struct stk_common_byte_array *test)
448 {
449         check_common_byte_array(command, test);
450 }
451
452 /* Defined in TS 102.223 Section 8.50 */
453 static void check_provisioning_file_reference(const struct stk_file *command,
454                                         const struct stk_file *test)
455 {
456         g_assert(command->len == test->len);
457         g_assert(g_mem_equal(command->file, test->file, test->len));
458 }
459
460 static void check_provisioning_file_references(GSList *command,
461                                                 const struct stk_file *test)
462 {
463         struct stk_file *sf;
464         GSList *l;
465         unsigned int i = 0;
466
467         for (l = command; l; l = l->next) {
468                 sf = l->data;
469                 check_provisioning_file_reference(sf, &test[i++]);
470         }
471
472         g_assert(test[i].len == 0);
473 }
474
475 /* Defined in TS 102.223 Section 8.52 */
476 static void check_bearer_desc(const struct stk_bearer_description *command,
477                                 const struct stk_bearer_description *test)
478 {
479         g_assert(command->type == test->type);
480
481         if (test->type == STK_BEARER_TYPE_GPRS_UTRAN) {
482                 check_common_byte(command->gprs.precedence,
483                                 test->gprs.precedence);
484                 check_common_byte(command->gprs.delay,
485                                 test->gprs.delay);
486                 check_common_byte(command->gprs.reliability,
487                                 test->gprs.reliability);
488                 check_common_byte(command->gprs.peak,
489                                 test->gprs.peak);
490                 check_common_byte(command->gprs.mean,
491                                 test->gprs.mean);
492                 check_common_byte(command->gprs.pdp_type,
493                                 test->gprs.pdp_type);
494
495                 return;
496         }
497 }
498
499 /* Defined in TS 102.223 Section 8.53 */
500 static inline void check_channel_data(
501                                 const struct stk_common_byte_array *command,
502                                 const struct stk_common_byte_array *test)
503 {
504         check_common_byte_array(command, test);
505 }
506
507 /* Defined in TS 102.223 Section 8.58 */
508 static inline void check_other_address(
509                                 const struct stk_other_address *command,
510                                 const struct stk_other_address *test)
511 {
512         check_common_byte(command->type, test->type);
513
514         if (test->type == STK_ADDRESS_IPV4)
515                 g_assert(command->addr.ipv4 == test->addr.ipv4);
516         else
517                 g_assert(g_mem_equal(command->addr.ipv6, test->addr.ipv6, 16));
518 }
519
520 /* Defined in TS 102.223 Section 8.59 */
521 static void check_uicc_te_interface(const struct stk_uicc_te_interface *command,
522                                 const struct stk_uicc_te_interface *test)
523 {
524         check_common_byte(command->protocol, test->protocol);
525         g_assert(command->port == test->port);
526 }
527
528 /* Defined in TS 102.223 Section 8.60 */
529 static inline void check_aid(const struct stk_aid *command,
530                                         const struct stk_aid *test)
531 {
532         g_assert(g_mem_equal(command->aid, test->aid, test->len));
533 }
534
535 /* Defined in TS 102.223 Section 8.70 */
536 static inline void check_network_access_name(const char *command,
537                                                 const char *test)
538 {
539         check_common_text(command, test);
540 }
541
542 /* Defined in TS 102.223 Section 8.71 */
543 static inline void check_cdma_sms_tpdu(
544                                 const struct stk_common_byte_array *command,
545                                 const struct stk_common_byte_array *test)
546 {
547         check_common_byte_array(command, test);
548 }
549
550 static void check_text_attr_html(const struct stk_text_attribute *test,
551                                 char *text, const char *expected_html)
552 {
553         char *html;
554         unsigned short attrs[256];
555         int i;
556
557         if (expected_html == NULL)
558                 return;
559
560         for (i = 0; i < test->len; i += 4) {
561                 attrs[i] = test->attributes[i];
562                 attrs[i + 1] = test->attributes[i + 1];
563                 attrs[i + 2] = test->attributes[i + 2];
564                 attrs[i + 3] = test->attributes[i + 3];
565         }
566         html = stk_text_to_html(text, attrs, test->len / 4);
567
568         g_assert(memcmp(html, expected_html, strlen(expected_html)) == 0);
569
570         g_free(html);
571 }
572
573 /* Defined in TS 102.223 Section 8.72 */
574 static void check_text_attr(const struct stk_text_attribute *command,
575                                         const struct stk_text_attribute *test)
576 {
577         g_assert(command->len == test->len);
578         g_assert(g_mem_equal(command->attributes, test->attributes, test->len));
579 }
580
581 /* Defined in TS 102.223 Section 8.73 */
582 static void check_item_text_attribute_list(
583                         const struct stk_item_text_attribute_list *command,
584                         const struct stk_item_text_attribute_list *test)
585 {
586         g_assert(command->len == test->len);
587         g_assert(g_mem_equal(command->list, test->list, test->len));
588 }
589
590 /* Defined in TS 102.223 Section 8.80 */
591 static void check_frame_id(const struct stk_frame_id *command,
592                                         const struct stk_frame_id *test)
593 {
594         g_assert(command->has_id == test->has_id);
595         if (test->has_id)
596                 g_assert(command->id == test->id);
597 }
598
599 struct display_text_test {
600         const unsigned char *pdu;
601         unsigned int pdu_len;
602         unsigned char qualifier;
603         const char *text;
604         struct stk_icon_id icon_id;
605         ofono_bool_t immediate_response;
606         struct stk_duration duration;
607         struct stk_text_attribute text_attr;
608         struct stk_frame_id frame_id;
609         const char *html;
610 };
611
612 static struct display_text_test display_text_data_111 = {
613         .pdu = display_text_111,
614         .pdu_len = sizeof(display_text_111),
615         .qualifier = 0x80,
616         .text = "Toolkit Test 1"
617 };
618
619 static struct display_text_test display_text_data_131 = {
620         .pdu = display_text_131,
621         .pdu_len = sizeof(display_text_131),
622         .qualifier = 0x81,
623         .text = "Toolkit Test 2"
624 };
625
626 static struct display_text_test display_text_data_141 = {
627         .pdu = display_text_141,
628         .pdu_len = sizeof(display_text_141),
629         .qualifier = 0x80,
630         .text = "Toolkit Test 3"
631 };
632
633 static struct display_text_test display_text_data_151 = {
634         .pdu = display_text_151,
635         .pdu_len = sizeof(display_text_151),
636         .qualifier = 0x00,
637         .text = "Toolkit Test 4"
638 };
639
640 static struct display_text_test display_text_data_161 = {
641         .pdu = display_text_161,
642         .pdu_len = sizeof(display_text_161),
643         .qualifier = 0x80,
644         .text = "This command instructs the ME to display a text message. "
645                         "It allows the SIM to define the priority of that "
646                         "message, and the text string format. Two types of "
647                         "prio"
648 };
649
650 static struct display_text_test display_text_data_171 = {
651         .pdu = display_text_171,
652         .pdu_len = sizeof(display_text_171),
653         .qualifier = 0x80,
654         .text = "<GO-BACKWARDS>"
655 };
656
657 static struct display_text_test display_text_data_511 = {
658         .pdu = display_text_511,
659         .pdu_len = sizeof(display_text_511),
660         .qualifier = 0x80,
661         .text = "Basic Icon",
662         .icon_id = {
663                 .qualifier = STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY,
664                 .id = 0x01
665         }
666 };
667
668 static struct display_text_test display_text_data_521 = {
669         .pdu = display_text_521,
670         .pdu_len = sizeof(display_text_521),
671         .qualifier = 0x80,
672         .text = "Colour Icon",
673         .icon_id = {
674                 .qualifier = STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY,
675                 .id = 0x02
676         }
677 };
678
679 static struct display_text_test display_text_data_531 = {
680         .pdu = display_text_531,
681         .pdu_len = sizeof(display_text_531),
682         .qualifier = 0x80,
683         .text = "Basic Icon",
684         .icon_id = {
685                 .qualifier = STK_ICON_QUALIFIER_TYPE_NON_SELF_EXPLANATORY,
686                 .id = 0x01
687         }
688 };
689
690 static struct display_text_test display_text_data_611 = {
691         .pdu = display_text_611,
692         .pdu_len = sizeof(display_text_611),
693         .qualifier = 0x80,
694         .text = "ЗДРАВСТВУЙТЕ"
695 };
696
697 static struct display_text_test display_text_data_711 = {
698         .pdu = display_text_711,
699         .pdu_len = sizeof(display_text_711),
700         .qualifier = 0x80,
701         .text = "10 Second",
702         .duration = {
703                 .unit = STK_DURATION_TYPE_SECONDS,
704                 .interval = 10,
705         }
706 };
707
708 static struct display_text_test display_text_data_811 = {
709         .pdu = display_text_811,
710         .pdu_len = sizeof(display_text_811),
711         .qualifier = 0x80,
712         .text = "Text Attribute 1",
713         .text_attr = {
714                 .len = 4,
715                 .attributes = { 0x00, 0x10, 0x00, 0xB4 },
716         },
717         .html = "<div style=\"text-align: left;\"><span style=\"color: "
718                 "#347235;background-color: #FFFF00;\">Text Attribute 1</span>"
719                 "</div>",
720 };
721
722 static struct display_text_test display_text_data_821 = {
723         .pdu = display_text_821,
724         .pdu_len = sizeof(display_text_821),
725         .qualifier = 0x80,
726         .text = "Text Attribute 1",
727         .text_attr = {
728                 .len = 4,
729                 .attributes = { 0x00, 0x10, 0x01, 0xB4 },
730         },
731         .html = "<div style=\"text-align: center;\"><span style=\"color: "
732                 "#347235;background-color: #FFFF00;\">Text Attribute 1</span>"
733                 "</div>",
734 };
735
736 static struct display_text_test display_text_data_831 = {
737         .pdu = display_text_831,
738         .pdu_len = sizeof(display_text_831),
739         .qualifier = 0x80,
740         .text = "Text Attribute 1",
741         .text_attr = {
742                 .len = 4,
743                 .attributes = { 0x00, 0x10, 0x02, 0xB4 },
744         },
745         .html = "<div style=\"text-align: right;\"><span style=\"color: "
746                 "#347235;background-color: #FFFF00;\">Text Attribute 1</span>"
747                 "</div>",
748 };
749
750 static struct display_text_test display_text_data_841 = {
751         .pdu = display_text_841,
752         .pdu_len = sizeof(display_text_841),
753         .qualifier = 0x80,
754         .text = "Text Attribute 1",
755         .text_attr = {
756                 .len = 4,
757                 .attributes = { 0x00, 0x10, 0x04, 0xB4 },
758         },
759         .html = "<div style=\"text-align: left;\"><span style=\"font-size: "
760                 "big;color: #347235;background-color: #FFFF00;\">"
761                 "Text Attribute 1</span></div>",
762 };
763
764 static struct display_text_test display_text_data_851 = {
765         .pdu = display_text_851,
766         .pdu_len = sizeof(display_text_851),
767         .qualifier = 0x80,
768         .text = "Text Attribute 1",
769         .text_attr = {
770                 .len = 4,
771                 .attributes = { 0x00, 0x10, 0x08, 0xB4 },
772         },
773         .html = "<div style=\"text-align: left;\"><span style=\"font-size: "
774                 "small;color: #347235;background-color: #FFFF00;\">"
775                 "Text Attribute 1</span></div>",
776 };
777
778 static struct display_text_test display_text_data_861 = {
779         .pdu = display_text_861,
780         .pdu_len = sizeof(display_text_861),
781         .qualifier = 0x80,
782         .text = "Text Attribute 1",
783         .text_attr = {
784                 .len = 4,
785                 .attributes = { 0x00, 0x10, 0x10, 0xB4 },
786         },
787         .html = "<div style=\"text-align: left;\"><span style=\"font-weight: "
788                 "bold;color: #347235;background-color: #FFFF00;\">"
789                 "Text Attribute 1</span></div>",
790 };
791
792 static struct display_text_test display_text_data_871 = {
793         .pdu = display_text_871,
794         .pdu_len = sizeof(display_text_871),
795         .qualifier = 0x80,
796         .text = "Text Attribute 1",
797         .text_attr = {
798                 .len = 4,
799                 .attributes = { 0x00, 0x10, 0x20, 0xB4 },
800         },
801         .html = "<div style=\"text-align: left;\"><span style=\"font-style: "
802                 "italic;color: #347235;background-color: #FFFF00;\">"
803                 "Text Attribute 1</span></div>",
804 };
805
806 static struct display_text_test display_text_data_881 = {
807         .pdu = display_text_881,
808         .pdu_len = sizeof(display_text_881),
809         .qualifier = 0x80,
810         .text = "Text Attribute 1",
811         .text_attr = {
812                 .len = 4,
813                 .attributes = { 0x00, 0x10, 0x40, 0xB4 },
814         },
815         .html = "<div style=\"text-align: left;\"><span style=\""
816                 "text-decoration: underline;color: #347235;"
817                 "background-color: #FFFF00;\">Text Attribute 1</span></div>",
818 };
819
820 static struct display_text_test display_text_data_891 = {
821         .pdu = display_text_891,
822         .pdu_len = sizeof(display_text_891),
823         .qualifier = 0x80,
824         .text = "Text Attribute 1",
825         .text_attr = {
826                 .len = 4,
827                 .attributes = { 0x00, 0x10, 0x80, 0xB4 },
828         },
829         .html = "<div style=\"text-align: left;\"><span style=\""
830                 "text-decoration: line-through;color: #347235;"
831                 "background-color: #FFFF00;\">Text Attribute 1</span></div>",
832 };
833
834 static struct display_text_test display_text_data_911 = {
835         .pdu = display_text_911,
836         .pdu_len = sizeof(display_text_911),
837         .qualifier = 0x80,
838         .text = "你好"
839 };
840
841 static struct display_text_test display_text_data_1011 = {
842         .pdu = display_text_1011,
843         .pdu_len = sizeof(display_text_1011),
844         .qualifier = 0x80,
845         .text = "80ル"
846 };
847
848 /* Defined in TS 102.384 Section 27.22.4.1 */
849 static void test_display_text(gconstpointer data)
850 {
851         const struct display_text_test *test = data;
852         struct stk_command *command;
853
854         command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
855
856         g_assert(command);
857         g_assert(command->status == STK_PARSE_RESULT_OK);
858
859         g_assert(command->number == 1);
860         g_assert(command->type == STK_COMMAND_TYPE_DISPLAY_TEXT);
861         g_assert(command->qualifier == test->qualifier);
862
863         g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
864         g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_DISPLAY);
865
866         g_assert(command->display_text.text);
867         check_text(command->display_text.text, test->text);
868         check_icon_id(&command->display_text.icon_id, &test->icon_id);
869         check_imm_resp(command->display_text.immediate_response,
870                                                 test->immediate_response);
871         check_duration(&command->display_text.duration, &test->duration);
872         check_text_attr(&command->display_text.text_attr,
873                                                 &test->text_attr);
874         check_text_attr_html(&command->display_text.text_attr,
875                                 command->display_text.text,
876                                 test->html);
877         check_frame_id(&command->display_text.frame_id, &test->frame_id);
878
879         stk_command_free(command);
880 }
881
882 struct get_inkey_test {
883         const unsigned char *pdu;
884         unsigned int pdu_len;
885         unsigned char qualifier;
886         char *text;
887         struct stk_icon_id icon_id;
888         struct stk_duration duration;
889         struct stk_text_attribute text_attr;
890         struct stk_frame_id frame_id;
891         char *html;
892 };
893
894 static unsigned char get_inkey_611[] = { 0xD0, 0x19, 0x81, 0x03, 0x01, 0x22,
895                                                 0x00, 0x82, 0x02, 0x81, 0x82,
896                                                 0x8D, 0x0A, 0x04, 0x3C, 0x4E,
897                                                 0x4F, 0x2D, 0x49, 0x43, 0x4F,
898                                                 0x4E, 0x3E, 0x1E, 0x02, 0x00,
899                                                 0x01 };
900
901 static unsigned char get_inkey_621[] = { 0xD0, 0x1C, 0x81, 0x03, 0x01, 0x22,
902                                                 0x00, 0x82, 0x02, 0x81, 0x82,
903                                                 0x8D, 0x0D, 0x04, 0x3C, 0x42,
904                                                 0x41, 0x53, 0x49, 0x43, 0x2D,
905                                                 0x49, 0x43, 0x4F, 0x4E, 0x3E,
906                                                 0x1E, 0x02, 0x01, 0x01 };
907
908 static unsigned char get_inkey_631[] = { 0xD0, 0x19, 0x81, 0x03, 0x01, 0x22,
909                                                 0x00, 0x82, 0x02, 0x81, 0x82,
910                                                 0x8D, 0x0A, 0x04, 0x3C, 0x4E,
911                                                 0x4F, 0x2D, 0x49, 0x43, 0x4F,
912                                                 0x4E, 0x3E, 0x1E, 0x02, 0x00,
913                                                 0x02 };
914
915 static unsigned char get_inkey_641[] = { 0xD0, 0x1D, 0x81, 0x03, 0x01, 0x22,
916                                                 0x00, 0x82, 0x02, 0x81, 0x82,
917                                                 0x8D, 0x0E, 0x04, 0x3C, 0x43,
918                                                 0x4F, 0x4C, 0x4F, 0x55, 0x52,
919                                                 0x2D, 0x49, 0x43, 0x4F, 0x4E,
920                                                 0x3E, 0x1E, 0x02, 0x01, 0x02 };
921
922 static unsigned char get_inkey_711[] = { 0xD0, 0x15, 0x81, 0x03, 0x01, 0x22,
923                                                 0x80, 0x82, 0x02, 0x81, 0x82,
924                                                 0x8D, 0x0A, 0x04, 0x45, 0x6E,
925                                                 0x74, 0x65, 0x72, 0x20, 0x22,
926                                                 0x2B, 0x22 };
927
928 static unsigned char get_inkey_712[] = { 0xD0, 0x15, 0x81, 0x03, 0x01, 0x22,
929                                                 0x80, 0x82, 0x02, 0x81, 0x82,
930                                                 0x8D, 0x0A, 0x04, 0x45, 0x6E,
931                                                 0x74, 0x65, 0x72, 0x20, 0x22,
932                                                 0x2B, 0x22 };
933
934 static unsigned char get_inkey_811[] = { 0xD0, 0x19, 0x81, 0x03, 0x01, 0x22,
935                                                 0x00, 0x82, 0x02, 0x81, 0x82,
936                                                 0x8D, 0x0A, 0x04, 0x45, 0x6E,
937                                                 0x74, 0x65, 0x72, 0x20, 0x22,
938                                                 0x2B, 0x22, 0x84, 0x02, 0x01,
939                                                 0x0A };
940
941 static unsigned char get_inkey_911[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x22,
942                                                 0x00, 0x82, 0x02, 0x81, 0x82,
943                                                 0x8D, 0x0A, 0x04, 0x45, 0x6E,
944                                                 0x74, 0x65, 0x72, 0x20, 0x22,
945                                                 0x2B, 0x22, 0xD0, 0x04, 0x00,
946                                                 0x09, 0x00, 0xB4 };
947
948 static unsigned char get_inkey_912[] = { 0xD0, 0x15, 0x81, 0x03, 0x01, 0x22,
949                                                 0x00, 0x82, 0x02, 0x81, 0x82,
950                                                 0x8D, 0x0A, 0x04, 0x45, 0x6E,
951                                                 0x74, 0x65, 0x72, 0x20, 0x22,
952                                                 0x23, 0x22 };
953
954 static unsigned char get_inkey_921[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x22,
955                                                 0x00, 0x82, 0x02, 0x81, 0x82,
956                                                 0x8D, 0x0A, 0x04, 0x45, 0x6E,
957                                                 0x74, 0x65, 0x72, 0x20, 0x22,
958                                                 0x2B, 0x22, 0xD0, 0x04, 0x00,
959                                                 0x09, 0x01, 0xB4 };
960
961 static unsigned char get_inkey_922[] = { 0xD0, 0x15, 0x81, 0x03, 0x01, 0x22,
962                                                 0x00, 0x82, 0x02, 0x81, 0x82,
963                                                 0x8D, 0x0A, 0x04, 0x45, 0x6E,
964                                                 0x74, 0x65, 0x72, 0x20, 0x22,
965                                                 0x23, 0x22 };
966
967 static unsigned char get_inkey_931[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x22,
968                                                 0x00, 0x82, 0x02, 0x81, 0x82,
969                                                 0x8D, 0x0A, 0x04, 0x45, 0x6E,
970                                                 0x74, 0x65, 0x72, 0x20, 0x22,
971                                                 0x2B, 0x22, 0xD0, 0x04, 0x00,
972                                                 0x09, 0x02, 0xB4 };
973
974 static unsigned char get_inkey_932[] = { 0xD0, 0x15, 0x81, 0x03, 0x01, 0x22,
975                                                 0x00, 0x82, 0x02, 0x81, 0x82,
976                                                 0x8D, 0x0A, 0x04, 0x45, 0x6E,
977                                                 0x74, 0x65, 0x72, 0x20, 0x22,
978                                                 0x23, 0x22 };
979
980 static unsigned char get_inkey_941[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x22,
981                                                 0x00, 0x82, 0x02, 0x81, 0x82,
982                                                 0x8D, 0x0A, 0x04, 0x45, 0x6E,
983                                                 0x74, 0x65, 0x72, 0x20, 0x22,
984                                                 0x2B, 0x22, 0xD0, 0x04, 0x00,
985                                                 0x09, 0x04, 0xB4 };
986
987 static unsigned char get_inkey_942[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x22,
988                                                 0x00, 0x82, 0x02, 0x81, 0x82,
989                                                 0x8D, 0x0A, 0x04, 0x45, 0x6E,
990                                                 0x74, 0x65, 0x72, 0x20, 0x22,
991                                                 0x23, 0x22, 0xD0, 0x04, 0x00,
992                                                 0x09, 0x00, 0xB4 };
993
994 static unsigned char get_inkey_943[] = { 0xD0, 0x15, 0x81, 0x03, 0x01, 0x22,
995                                                 0x00, 0x82, 0x02, 0x81, 0x82,
996                                                 0x8D, 0x0A, 0x04, 0x45, 0x6E,
997                                                 0x74, 0x65, 0x72, 0x20, 0x22,
998                                                 0x23, 0x22 };
999
1000 static unsigned char get_inkey_951[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x22,
1001                                                 0x00, 0x82, 0x02, 0x81, 0x82,
1002                                                 0x8D, 0x0A, 0x04, 0x45, 0x6E,
1003                                                 0x74, 0x65, 0x72, 0x20, 0x22,
1004                                                 0x2B, 0x22, 0xD0, 0x04, 0x00,
1005                                                 0x09, 0x08, 0xB4 };
1006
1007 static unsigned char get_inkey_952[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x22,
1008                                                 0x00, 0x82, 0x02, 0x81, 0x82,
1009                                                 0x8D, 0x0A, 0x04, 0x45, 0x6E,
1010                                                 0x74, 0x65, 0x72, 0x20, 0x22,
1011                                                 0x23, 0x22, 0xD0, 0x04, 0x00,
1012                                                 0x09, 0x00, 0xB4 };
1013
1014 static unsigned char get_inkey_953[] = { 0xD0, 0x15, 0x81, 0x03, 0x01, 0x22,
1015                                                 0x00, 0x82, 0x02, 0x81, 0x82,
1016                                                 0x8D, 0x0A, 0x04, 0x45, 0x6E,
1017                                                 0x74, 0x65, 0x72, 0x20, 0x22,
1018                                                 0x23, 0x22 };
1019
1020 static unsigned char get_inkey_961[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x22,
1021                                                 0x00, 0x82, 0x02, 0x81, 0x82,
1022                                                 0x8D, 0x0A, 0x04, 0x45, 0x6E,
1023                                                 0x74, 0x65, 0x72, 0x20, 0x22,
1024                                                 0x2B, 0x22, 0xD0, 0x04, 0x00,
1025                                                 0x09, 0x10, 0xB4 };
1026
1027 static unsigned char get_inkey_962[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x22,
1028                                                 0x00, 0x82, 0x02, 0x81, 0x82,
1029                                                 0x8D, 0x0A, 0x04, 0x45, 0x6E,
1030                                                 0x74, 0x65, 0x72, 0x20, 0x22,
1031                                                 0x23, 0x22, 0xD0, 0x04, 0x00,
1032                                                 0x09, 0x00, 0xB4 };
1033
1034 static unsigned char get_inkey_963[] = { 0xD0, 0x15, 0x81, 0x03, 0x01, 0x22,
1035                                                 0x00, 0x82, 0x02, 0x81, 0x82,
1036                                                 0x8D, 0x0A, 0x04, 0x45, 0x6E,
1037                                                 0x74, 0x65, 0x72, 0x20, 0x22,
1038                                                 0x23, 0x22 };
1039
1040 static unsigned char get_inkey_971[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x22,
1041                                                 0x00, 0x82, 0x02, 0x81, 0x82,
1042                                                 0x8D, 0x0A, 0x04, 0x45, 0x6E,
1043                                                 0x74, 0x65, 0x72, 0x20, 0x22,
1044                                                 0x2B, 0x22, 0xD0, 0x04, 0x00,
1045                                                 0x09, 0x20, 0xB4 };
1046
1047 static unsigned char get_inkey_972[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x22,
1048                                                 0x00, 0x82, 0x02, 0x81, 0x82,
1049                                                 0x8D, 0x0A, 0x04, 0x45, 0x6E,
1050                                                 0x74, 0x65, 0x72, 0x20, 0x22,
1051                                                 0x23, 0x22, 0xD0, 0x04, 0x00,
1052                                                 0x09, 0x00, 0xB4 };
1053
1054 static unsigned char get_inkey_973[] = { 0xD0, 0x15, 0x81, 0x03, 0x01, 0x22,
1055                                                 0x00, 0x82, 0x02, 0x81, 0x82,
1056                                                 0x8D, 0x0A, 0x04, 0x45, 0x6E,
1057                                                 0x74, 0x65, 0x72, 0x20, 0x22,
1058                                                 0x23, 0x22 };
1059
1060 static unsigned char get_inkey_981[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x22,
1061                                                 0x00, 0x82, 0x02, 0x81, 0x82,
1062                                                 0x8D, 0x0A, 0x04, 0x45, 0x6E,
1063                                                 0x74, 0x65, 0x72, 0x20, 0x22,
1064                                                 0x2B, 0x22, 0xD0, 0x04, 0x00,
1065                                                 0x09, 0x40, 0xB4 };
1066
1067 static unsigned char get_inkey_982[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x22,
1068                                                 0x00, 0x82, 0x02, 0x81, 0x82,
1069                                                 0x8D, 0x0A, 0x04, 0x45, 0x6E,
1070                                                 0x74, 0x65, 0x72, 0x20, 0x22,
1071                                                 0x23, 0x22, 0xD0, 0x04, 0x00,
1072                                                 0x09, 0x00, 0xB4 };
1073
1074 static unsigned char get_inkey_983[] = { 0xD0, 0x15, 0x81, 0x03, 0x01, 0x22,
1075                                                 0x00, 0x82, 0x02, 0x81, 0x82,
1076                                                 0x8D, 0x0A, 0x04, 0x45, 0x6E,
1077                                                 0x74, 0x65, 0x72, 0x20, 0x22,
1078                                                 0x23, 0x22 };
1079
1080 static unsigned char get_inkey_991[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x22,
1081                                                 0x00, 0x82, 0x02, 0x81, 0x82,
1082                                                 0x8D, 0x0A, 0x04, 0x45, 0x6E,
1083                                                 0x74, 0x65, 0x72, 0x20, 0x22,
1084                                                 0x2B, 0x22, 0xD0, 0x04, 0x00,
1085                                                 0x09, 0x80, 0xB4 };
1086
1087 static unsigned char get_inkey_992a[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x22,
1088                                                 0x00, 0x82, 0x02, 0x81, 0x82,
1089                                                 0x8D, 0x0A, 0x04, 0x45, 0x6E,
1090                                                 0x74, 0x65, 0x72, 0x20, 0x22,
1091                                                 0x23, 0x22, 0xD0, 0x04, 0x00,
1092                                                 0x09, 0x00, 0xB4 };
1093
1094 static unsigned char get_inkey_992b[] = { 0xD0, 0x15, 0x81, 0x03, 0x01, 0x22,
1095                                                 0x00, 0x82, 0x02, 0x81, 0x82,
1096                                                 0x8D, 0x0A, 0x04, 0x45, 0x6E,
1097                                                 0x74, 0x65, 0x72, 0x20, 0x22,
1098                                                 0x23, 0x22 };
1099
1100 static unsigned char get_inkey_993[] = { 0xD0, 0x15, 0x81, 0x03, 0x01, 0x22,
1101                                                 0x00, 0x82, 0x02, 0x81, 0x82,
1102                                                 0x8D, 0x0A, 0x04, 0x45, 0x6E,
1103                                                 0x74, 0x65, 0x72, 0x20, 0x22,
1104                                                 0x23, 0x22 };
1105
1106 static unsigned char get_inkey_9101[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x22,
1107                                                 0x00, 0x82, 0x02, 0x81, 0x82,
1108                                                 0x8D, 0x0A, 0x04, 0x45, 0x6E,
1109                                                 0x74, 0x65, 0x72, 0x20, 0x22,
1110                                                 0x2B, 0x22, 0xD0, 0x04, 0x00,
1111                                                 0x09, 0x00, 0xB4 };
1112
1113 static unsigned char get_inkey_9102[] = { 0xD0, 0x15, 0x81, 0x03, 0x01, 0x22,
1114                                                 0x00, 0x82, 0x02, 0x81, 0x82,
1115                                                 0x8D, 0x0A, 0x04, 0x45, 0x6E,
1116                                                 0x74, 0x65, 0x72, 0x20, 0x22,
1117                                                 0x23, 0x22 };
1118
1119 static unsigned char get_inkey_1011[] = { 0xD0, 0x10, 0x81, 0x03, 0x01, 0x22,
1120                                                 0x00, 0x82, 0x02, 0x81, 0x82,
1121                                                 0x8D, 0x05, 0x08, 0x4F, 0x60,
1122                                                 0x59, 0x7D };
1123
1124 static unsigned char get_inkey_1021[] = { 0xD0, 0x81, 0x99, 0x81, 0x03, 0x01,
1125                                                 0x22, 0x00, 0x82, 0x02, 0x81,
1126                                                 0x82, 0x8D, 0x81, 0x8D, 0x08,
1127                                                 0x4F, 0x60, 0x59, 0x7D, 0x4F,
1128                                                 0x60, 0x59, 0x7D, 0x4F, 0x60,
1129                                                 0x59, 0x7D, 0x4F, 0x60, 0x59,
1130                                                 0x7D, 0x4F, 0x60, 0x59, 0x7D,
1131                                                 0x4F, 0x60, 0x59, 0x7D, 0x4F,
1132                                                 0x60, 0x59, 0x7D, 0x4F, 0x60,
1133                                                 0x59, 0x7D, 0x4F, 0x60, 0x59,
1134                                                 0x7D, 0x4F, 0x60, 0x59, 0x7D,
1135                                                 0x4F, 0x60, 0x59, 0x7D, 0x4F,
1136                                                 0x60, 0x59, 0x7D, 0x4F, 0x60,
1137                                                 0x59, 0x7D, 0x4F, 0x60, 0x59,
1138                                                 0x7D, 0x4F, 0x60, 0x59, 0x7D,
1139                                                 0x4F, 0x60, 0x59, 0x7D, 0x4F,
1140                                                 0x60, 0x59, 0x7D, 0x4F, 0x60,
1141                                                 0x59, 0x7D, 0x4F, 0x60, 0x59,
1142                                                 0x7D, 0x4F, 0x60, 0x59, 0x7D,
1143                                                 0x4F, 0x60, 0x59, 0x7D, 0x4F,
1144                                                 0x60, 0x59, 0x7D, 0x4F, 0x60,
1145                                                 0x59, 0x7D, 0x4F, 0x60, 0x59,
1146                                                 0x7D, 0x4F, 0x60, 0x59, 0x7D,
1147                                                 0x4F, 0x60, 0x59, 0x7D, 0x4F,
1148                                                 0x60, 0x59, 0x7D, 0x4F, 0x60,
1149                                                 0x59, 0x7D, 0x4F, 0x60, 0x59,
1150                                                 0x7D, 0x4F, 0x60, 0x59, 0x7D,
1151                                                 0x4F, 0x60, 0x59, 0x7D, 0x4F,
1152                                                 0x60, 0x59, 0x7D, 0x4F, 0x60,
1153                                                 0x59, 0x7D, 0x4F, 0x60, 0x59,
1154                                                 0x7D, 0x4F, 0x60, 0x59, 0x7D };
1155
1156 static unsigned char get_inkey_1111[] = { 0xD0, 0x11, 0x81, 0x03, 0x01, 0x22,
1157                                                 0x03, 0x82, 0x02, 0x81, 0x82,
1158                                                 0x8D, 0x06, 0x04, 0x45, 0x6E,
1159                                                 0x74, 0x65, 0x72 };
1160
1161 static unsigned char get_inkey_1211[] = { 0xD0, 0x0E, 0x81, 0x03, 0x01, 0x22,
1162                                                 0x00, 0x82, 0x02, 0x81, 0x82,
1163                                                 0x8D, 0x03, 0x08, 0x30, 0xEB };
1164
1165 static unsigned char get_inkey_1221[] = { 0xD0, 0x81, 0x99, 0x81, 0x03, 0x01,
1166                                                 0x22, 0x00, 0x82, 0x02, 0x81,
1167                                                 0x82, 0x8D, 0x81, 0x8D, 0x08,
1168                                                 0x30, 0xEB, 0x30, 0xEB, 0x30,
1169                                                 0xEB, 0x30, 0xEB, 0x30, 0xEB,
1170                                                 0x30, 0xEB, 0x30, 0xEB, 0x30,
1171                                                 0xEB, 0x30, 0xEB, 0x30, 0xEB,
1172                                                 0x30, 0xEB, 0x30, 0xEB, 0x30,
1173                                                 0xEB, 0x30, 0xEB, 0x30, 0xEB,
1174                                                 0x30, 0xEB, 0x30, 0xEB, 0x30,
1175                                                 0xEB, 0x30, 0xEB, 0x30, 0xEB,
1176                                                 0x30, 0xEB, 0x30, 0xEB, 0x30,
1177                                                 0xEB, 0x30, 0xEB, 0x30, 0xEB,
1178                                                 0x30, 0xEB, 0x30, 0xEB, 0x30,
1179                                                 0xEB, 0x30, 0xEB, 0x30, 0xEB,
1180                                                 0x30, 0xEB, 0x30, 0xEB, 0x30,
1181                                                 0xEB, 0x30, 0xEB, 0x30, 0xEB,
1182                                                 0x30, 0xEB, 0x30, 0xEB, 0x30,
1183                                                 0xEB, 0x30, 0xEB, 0x30, 0xEB,
1184                                                 0x30, 0xEB, 0x30, 0xEB, 0x30,
1185                                                 0xEB, 0x30, 0xEB, 0x30, 0xEB,
1186                                                 0x30, 0xEB, 0x30, 0xEB, 0x30,
1187                                                 0xEB, 0x30, 0xEB, 0x30, 0xEB,
1188                                                 0x30, 0xEB, 0x30, 0xEB, 0x30,
1189                                                 0xEB, 0x30, 0xEB, 0x30, 0xEB,
1190                                                 0x30, 0xEB, 0x30, 0xEB, 0x30,
1191                                                 0xEB, 0x30, 0xEB, 0x30, 0xEB,
1192                                                 0x30, 0xEB, 0x30, 0xEB, 0x30,
1193                                                 0xEB, 0x30, 0xEB, 0x30, 0xEB,
1194                                                 0x30, 0xEB, 0x30, 0xEB, 0x30,
1195                                                 0xEB, 0x30, 0xEB, 0x30, 0xEB };
1196
1197 static unsigned char get_inkey_1311[] = { 0xD0, 0x11, 0x81, 0x03, 0x01, 0x22,
1198                                                 0x03, 0x82, 0x02, 0x81, 0x82,
1199                                                 0x8D, 0x06, 0x04, 0x45, 0x6E,
1200                                                 0x74, 0x65, 0x72 };
1201
1202 static struct get_inkey_test get_inkey_data_111 = {
1203         .pdu = get_inkey_111,
1204         .pdu_len = sizeof(get_inkey_111),
1205         .qualifier = 0x00,
1206         .text = "Enter \"+\""
1207 };
1208
1209 static struct get_inkey_test get_inkey_data_121 = {
1210         .pdu = get_inkey_121,
1211         .pdu_len = sizeof(get_inkey_121),
1212         .qualifier = 0x00,
1213         .text = "Enter \"0\""
1214 };
1215
1216 static struct get_inkey_test get_inkey_data_131 = {
1217         .pdu = get_inkey_131,
1218         .pdu_len = sizeof(get_inkey_131),
1219         .qualifier = 0x00,
1220         .text = "<GO-BACKWARDS>"
1221 };
1222
1223 static struct get_inkey_test get_inkey_data_141 = {
1224         .pdu = get_inkey_141,
1225         .pdu_len = sizeof(get_inkey_141),
1226         .qualifier = 0x00,
1227         .text = "<ABORT>"
1228 };
1229
1230 static struct get_inkey_test get_inkey_data_151 = {
1231         .pdu = get_inkey_151,
1232         .pdu_len = sizeof(get_inkey_151),
1233         .qualifier = 0x01,
1234         .text = "Enter \"q\""
1235 };
1236
1237 static struct get_inkey_test get_inkey_data_161 = {
1238         .pdu = get_inkey_161,
1239         .pdu_len = sizeof(get_inkey_161),
1240         .qualifier = 0x01,
1241         .text = "Enter \"x\". This command instructs the ME to display text, "
1242                 "and to expect the user to enter a single character. Any "
1243                 "response entered by the user shall be passed t"
1244 };
1245
1246 static struct get_inkey_test get_inkey_data_211 = {
1247         .pdu = get_inkey_211,
1248         .pdu_len = sizeof(get_inkey_211),
1249         .qualifier = 0x00,
1250         .text = "<TIME-OUT>"
1251 };
1252
1253 static struct get_inkey_test get_inkey_data_311 = {
1254         .pdu = get_inkey_311,
1255         .pdu_len = sizeof(get_inkey_311),
1256         .qualifier = 0x00,
1257         .text = "ЗДРАВСТВУЙТЕ"
1258 };
1259
1260 static struct get_inkey_test get_inkey_data_321 = {
1261         .pdu = get_inkey_321,
1262         .pdu_len = sizeof(get_inkey_321),
1263         .qualifier = 0x00,
1264         .text = "ЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕ"
1265                 "ЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕ"
1266                 "ЗДРАВСТВУЙТЕЗДРАВСТВУЙ"
1267 };
1268
1269 static struct get_inkey_test get_inkey_data_411 = {
1270         .pdu = get_inkey_411,
1271         .pdu_len = sizeof(get_inkey_411),
1272         .qualifier = 0x03,
1273         .text = "Enter"
1274 };
1275
1276 static struct get_inkey_test get_inkey_data_511 = {
1277         .pdu = get_inkey_511,
1278         .pdu_len = sizeof(get_inkey_511),
1279         .qualifier = 0x04,
1280         .text = "Enter YES"
1281 };
1282
1283 static struct get_inkey_test get_inkey_data_512 = {
1284         .pdu = get_inkey_512,
1285         .pdu_len = sizeof(get_inkey_512),
1286         .qualifier = 0x04,
1287         .text = "Enter NO"
1288 };
1289
1290 static struct get_inkey_test get_inkey_data_611 = {
1291         .pdu = get_inkey_611,
1292         .pdu_len = sizeof(get_inkey_611),
1293         .qualifier = 0x00,
1294         .text = "<NO-ICON>",
1295         .icon_id = {
1296                 .qualifier = STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY,
1297                 .id = 0x01
1298         }
1299 };
1300
1301 static struct get_inkey_test get_inkey_data_621 = {
1302         .pdu = get_inkey_621,
1303         .pdu_len = sizeof(get_inkey_621),
1304         .qualifier = 0x00,
1305         .text = "<BASIC-ICON>",
1306         .icon_id = {
1307                 .qualifier = STK_ICON_QUALIFIER_TYPE_NON_SELF_EXPLANATORY,
1308                 .id = 0x01
1309         }
1310 };
1311
1312 static struct get_inkey_test get_inkey_data_631 = {
1313         .pdu = get_inkey_631,
1314         .pdu_len = sizeof(get_inkey_631),
1315         .qualifier = 0x00,
1316         .text = "<NO-ICON>",
1317         .icon_id = {
1318                 .qualifier = STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY,
1319                 .id = 0x02
1320         }
1321 };
1322
1323 static struct get_inkey_test get_inkey_data_641 = {
1324         .pdu = get_inkey_641,
1325         .pdu_len = sizeof(get_inkey_641),
1326         .qualifier = 0x00,
1327         .text = "<COLOUR-ICON>",
1328         .icon_id = {
1329                 .qualifier = STK_ICON_QUALIFIER_TYPE_NON_SELF_EXPLANATORY,
1330                 .id = 0x02
1331         }
1332 };
1333
1334 static struct get_inkey_test get_inkey_data_711 = {
1335         .pdu = get_inkey_711,
1336         .pdu_len = sizeof(get_inkey_711),
1337         .qualifier = 0x80,
1338         .text = "Enter \"+\""
1339 };
1340
1341 static struct get_inkey_test get_inkey_data_712 = {
1342         .pdu = get_inkey_712,
1343         .pdu_len = sizeof(get_inkey_712),
1344         .qualifier = 0x80,
1345         .text = "Enter \"+\""
1346 };
1347
1348 static struct get_inkey_test get_inkey_data_811 = {
1349         .pdu = get_inkey_811,
1350         .pdu_len = sizeof(get_inkey_811),
1351         .qualifier = 0x00,
1352         .text = "Enter \"+\"",
1353         .duration = {
1354                 .unit = STK_DURATION_TYPE_SECONDS,
1355                 .interval = 10
1356         }
1357 };
1358
1359 static struct get_inkey_test get_inkey_data_911 = {
1360         .pdu = get_inkey_911,
1361         .pdu_len = sizeof(get_inkey_911),
1362         .qualifier = 0x00,
1363         .text = "Enter \"+\"",
1364         .text_attr = {
1365                 .len = 4,
1366                 .attributes = { 0x00, 0x09, 0x00, 0xB4 }
1367         },
1368         .html = "<div style=\"text-align: left;\"><span style=\"color: "
1369                 "#347235;background-color: #FFFF00;\">Enter \"+\"</span></div>",
1370 };
1371
1372 static struct get_inkey_test get_inkey_data_912 = {
1373         .pdu = get_inkey_912,
1374         .pdu_len = sizeof(get_inkey_912),
1375         .qualifier = 0x00,
1376         .text = "Enter \"#\""
1377 };
1378
1379 static struct get_inkey_test get_inkey_data_921 = {
1380         .pdu = get_inkey_921,
1381         .pdu_len = sizeof(get_inkey_921),
1382         .qualifier = 0x00,
1383         .text = "Enter \"+\"",
1384         .text_attr = {
1385                 .len = 4,
1386                 .attributes = { 0x00, 0x09, 0x01, 0xB4 }
1387         },
1388         .html = "<div style=\"text-align: center;\"><span style=\"color: "
1389                 "#347235;background-color: #FFFF00;\">Enter \"+\"</span>"
1390                 "</div>",
1391 };
1392
1393 static struct get_inkey_test get_inkey_data_922 = {
1394         .pdu = get_inkey_922,
1395         .pdu_len = sizeof(get_inkey_922),
1396         .qualifier = 0x00,
1397         .text = "Enter \"#\""
1398 };
1399
1400 static struct get_inkey_test get_inkey_data_931 = {
1401         .pdu = get_inkey_931,
1402         .pdu_len = sizeof(get_inkey_931),
1403         .qualifier = 0x00,
1404         .text = "Enter \"+\"",
1405         .text_attr = {
1406                 .len = 4,
1407                 .attributes = { 0x00, 0x09, 0x02, 0xB4 }
1408         },
1409         .html = "<div style=\"text-align: right;\"><span style=\"color: "
1410                 "#347235;background-color: #FFFF00;\">Enter \"+\"</span>"
1411                 "</div>",
1412 };
1413
1414 static struct get_inkey_test get_inkey_data_932 = {
1415         .pdu = get_inkey_932,
1416         .pdu_len = sizeof(get_inkey_932),
1417         .qualifier = 0x00,
1418         .text = "Enter \"#\""
1419 };
1420
1421 static struct get_inkey_test get_inkey_data_941 = {
1422         .pdu = get_inkey_941,
1423         .pdu_len = sizeof(get_inkey_941),
1424         .qualifier = 0x00,
1425         .text = "Enter \"+\"",
1426         .text_attr = {
1427                 .len = 4,
1428                 .attributes = { 0x00, 0x09, 0x04, 0xB4 }
1429         },
1430         .html = "<div style=\"text-align: left;\"><span style=\"font-size: "
1431                 "big;color: #347235;background-color: #FFFF00;\">Enter \"+\""
1432                 "</span></div>",
1433 };
1434
1435 static struct get_inkey_test get_inkey_data_942 = {
1436         .pdu = get_inkey_942,
1437         .pdu_len = sizeof(get_inkey_942),
1438         .qualifier = 0x00,
1439         .text = "Enter \"#\"",
1440         .text_attr = {
1441                 .len = 4,
1442                 .attributes = { 0x00, 0x09, 0x00, 0xB4 }
1443         },
1444         .html = "<div style=\"text-align: left;\"><span style=\"color: "
1445                 "#347235;background-color: #FFFF00;\">Enter \"#\"</span></div>",
1446 };
1447
1448 static struct get_inkey_test get_inkey_data_943 = {
1449         .pdu = get_inkey_943,
1450         .pdu_len = sizeof(get_inkey_943),
1451         .qualifier = 0x00,
1452         .text = "Enter \"#\""
1453 };
1454
1455 static struct get_inkey_test get_inkey_data_951 = {
1456         .pdu = get_inkey_951,
1457         .pdu_len = sizeof(get_inkey_951),
1458         .qualifier = 0x00,
1459         .text = "Enter \"+\"",
1460         .text_attr = {
1461                 .len = 4,
1462                 .attributes = { 0x00, 0x09, 0x08, 0xB4 }
1463         },
1464         .html = "<div style=\"text-align: left;\"><span style=\"font-size: "
1465                 "small;color: #347235;background-color: #FFFF00;\">"
1466                 "Enter \"+\"</span></div>",
1467 };
1468
1469 static struct get_inkey_test get_inkey_data_952 = {
1470         .pdu = get_inkey_952,
1471         .pdu_len = sizeof(get_inkey_952),
1472         .qualifier = 0x00,
1473         .text = "Enter \"#\"",
1474         .text_attr = {
1475                 .len = 4,
1476                 .attributes = { 0x00, 0x09, 0x00, 0xB4 }
1477         },
1478         .html = "<div style=\"text-align: left;\"><span style=\"color: "
1479                 "#347235;background-color: #FFFF00;\">Enter \"#\"</span></div>",
1480 };
1481
1482 static struct get_inkey_test get_inkey_data_953 = {
1483         .pdu = get_inkey_953,
1484         .pdu_len = sizeof(get_inkey_953),
1485         .qualifier = 0x00,
1486         .text = "Enter \"#\""
1487 };
1488
1489 static struct get_inkey_test get_inkey_data_961 = {
1490         .pdu = get_inkey_961,
1491         .pdu_len = sizeof(get_inkey_961),
1492         .qualifier = 0x00,
1493         .text = "Enter \"+\"",
1494         .text_attr = {
1495                 .len = 4,
1496                 .attributes = { 0x00, 0x09, 0x10, 0xB4 }
1497         },
1498         .html = "<div style=\"text-align: left;\"><span style=\"font-weight: "
1499                 "bold;color: #347235;background-color: #FFFF00;\">Enter \"+\""
1500                 "</span></div>",
1501 };
1502
1503 static struct get_inkey_test get_inkey_data_962 = {
1504         .pdu = get_inkey_962,
1505         .pdu_len = sizeof(get_inkey_962),
1506         .qualifier = 0x00,
1507         .text = "Enter \"#\"",
1508         .text_attr = {
1509                 .len = 4,
1510                 .attributes = { 0x00, 0x09, 0x00, 0xB4 }
1511         },
1512         .html = "<div style=\"text-align: left;\"><span style=\"color: "
1513                 "#347235;background-color: #FFFF00;\">Enter \"#\"</span></div>",
1514 };
1515
1516 static struct get_inkey_test get_inkey_data_963 = {
1517         .pdu = get_inkey_963,
1518         .pdu_len = sizeof(get_inkey_963),
1519         .qualifier = 0x00,
1520         .text = "Enter \"#\""
1521 };
1522
1523 static struct get_inkey_test get_inkey_data_971 = {
1524         .pdu = get_inkey_971,
1525         .pdu_len = sizeof(get_inkey_971),
1526         .qualifier = 0x00,
1527         .text = "Enter \"+\"",
1528         .text_attr = {
1529                 .len = 4,
1530                 .attributes = { 0x00, 0x09, 0x20, 0xB4 }
1531         },
1532         .html = "<div style=\"text-align: left;\"><span style=\"font-style: "
1533                 "italic;color: #347235;background-color: #FFFF00;\">"
1534                 "Enter \"+\"</span></div>",
1535 };
1536
1537 static struct get_inkey_test get_inkey_data_972 = {
1538         .pdu = get_inkey_972,
1539         .pdu_len = sizeof(get_inkey_972),
1540         .qualifier = 0x00,
1541         .text = "Enter \"#\"",
1542         .text_attr = {
1543                 .len = 4,
1544                 .attributes = { 0x00, 0x09, 0x00, 0xB4 }
1545         },
1546         .html = "<div style=\"text-align: left;\"><span style=\"color: "
1547                 "#347235;background-color: #FFFF00;\">Enter \"#\"</span></div>",
1548 };
1549
1550 static struct get_inkey_test get_inkey_data_973 = {
1551         .pdu = get_inkey_973,
1552         .pdu_len = sizeof(get_inkey_973),
1553         .qualifier = 0x00,
1554         .text = "Enter \"#\""
1555 };
1556
1557 static struct get_inkey_test get_inkey_data_981 = {
1558         .pdu = get_inkey_981,
1559         .pdu_len = sizeof(get_inkey_981),
1560         .qualifier = 0x00,
1561         .text = "Enter \"+\"",
1562         .text_attr = {
1563                 .len = 4,
1564                 .attributes = { 0x00, 0x09, 0x40, 0xB4 }
1565         },
1566         .html = "<div style=\"text-align: left;\"><span style=\""
1567                 "text-decoration: underline;color: #347235;"
1568                 "background-color: #FFFF00;\">Enter \"+\"</span></div>",
1569 };
1570
1571 static struct get_inkey_test get_inkey_data_982 = {
1572         .pdu = get_inkey_982,
1573         .pdu_len = sizeof(get_inkey_982),
1574         .qualifier = 0x00,
1575         .text = "Enter \"#\"",
1576         .text_attr = {
1577                 .len = 4,
1578                 .attributes = { 0x00, 0x09, 0x00, 0xB4 }
1579         },
1580         .html = "<div style=\"text-align: left;\"><span style=\"color: "
1581                 "#347235;background-color: #FFFF00;\">Enter \"#\"</span></div>",
1582 };
1583
1584 static struct get_inkey_test get_inkey_data_983 = {
1585         .pdu = get_inkey_983,
1586         .pdu_len = sizeof(get_inkey_983),
1587         .qualifier = 0x00,
1588         .text = "Enter \"#\""
1589 };
1590
1591 static struct get_inkey_test get_inkey_data_991 = {
1592         .pdu = get_inkey_991,
1593         .pdu_len = sizeof(get_inkey_991),
1594         .qualifier = 0x00,
1595         .text = "Enter \"+\"",
1596         .text_attr = {
1597                 .len = 4,
1598                 .attributes = { 0x00, 0x09, 0x80, 0xB4 }
1599         },
1600         .html = "<div style=\"text-align: left;\"><span style=\""
1601                 "text-decoration: line-through;color: #347235;"
1602                 "background-color: #FFFF00;\">Enter \"+\"</span></div>",
1603 };
1604
1605 static struct get_inkey_test get_inkey_data_992a = {
1606         .pdu = get_inkey_992a,
1607         .pdu_len = sizeof(get_inkey_992a),
1608         .qualifier = 0x00,
1609         .text = "Enter \"#\"",
1610         .text_attr = {
1611                 .len = 4,
1612                 .attributes = { 0x00, 0x09, 0x00, 0xB4 }
1613         },
1614         .html = "<div style=\"text-align: left;\"><span style=\"color: "
1615                 "#347235;background-color: #FFFF00;\">Enter \"#\"</span></div>",
1616 };
1617
1618 static struct get_inkey_test get_inkey_data_992b = {
1619         .pdu = get_inkey_992b,
1620         .pdu_len = sizeof(get_inkey_992b),
1621         .qualifier = 0x00,
1622         .text = "Enter \"#\""
1623 };
1624
1625 static struct get_inkey_test get_inkey_data_993 = {
1626         .pdu = get_inkey_993,
1627         .pdu_len = sizeof(get_inkey_993),
1628         .qualifier = 0x00,
1629         .text = "Enter \"#\""
1630 };
1631
1632 static struct get_inkey_test get_inkey_data_9101 = {
1633         .pdu = get_inkey_9101,
1634         .pdu_len = sizeof(get_inkey_9101),
1635         .qualifier = 0x00,
1636         .text = "Enter \"+\"",
1637         .text_attr = {
1638                 .len = 4,
1639                 .attributes = { 0x00, 0x09, 0x00, 0xB4 }
1640         },
1641         .html = "<div style=\"text-align: left;\"><span style=\"color: "
1642                 "#347235;background-color: #FFFF00;\">Enter \"+\"</span></div>",
1643 };
1644
1645 static struct get_inkey_test get_inkey_data_9102 = {
1646         .pdu = get_inkey_9102,
1647         .pdu_len = sizeof(get_inkey_9102),
1648         .qualifier = 0x00,
1649         .text = "Enter \"#\""
1650 };
1651
1652 static struct get_inkey_test get_inkey_data_1011 = {
1653         .pdu = get_inkey_1011,
1654         .pdu_len = sizeof(get_inkey_1011),
1655         .qualifier = 0x00,
1656         .text = "你好"
1657 };
1658
1659 static struct get_inkey_test get_inkey_data_1021 = {
1660         .pdu = get_inkey_1021,
1661         .pdu_len = sizeof(get_inkey_1021),
1662         .qualifier = 0x00,
1663         .text = "你好你好你好你好你好你好你好你好你好你好"
1664                 "你好你好你好你好你好你好你好你好你好你好"
1665                 "你好你好你好你好你好你好你好你好你好你好"
1666                 "你好你好你好你好你好"
1667 };
1668
1669 static struct get_inkey_test get_inkey_data_1111 = {
1670         .pdu = get_inkey_1111,
1671         .pdu_len = sizeof(get_inkey_1111),
1672         .qualifier = 0x03,
1673         .text = "Enter"
1674 };
1675
1676 static struct get_inkey_test get_inkey_data_1211 = {
1677         .pdu = get_inkey_1211,
1678         .pdu_len = sizeof(get_inkey_1211),
1679         .qualifier = 0x00,
1680         .text = "ル"
1681 };
1682
1683 static struct get_inkey_test get_inkey_data_1221 = {
1684         .pdu = get_inkey_1221,
1685         .pdu_len = sizeof(get_inkey_1221),
1686         .qualifier = 0x00,
1687         .text = "ルルルルルルルルルルルルルルルルルルルル"
1688                 "ルルルルルルルルルルルルルルルルルルルル"
1689                 "ルルルルルルルルルルルルルルルルルルルル"
1690                 "ルルルルルルルルルル"
1691 };
1692
1693 static struct get_inkey_test get_inkey_data_1311 = {
1694         .pdu = get_inkey_1311,
1695         .pdu_len = sizeof(get_inkey_1311),
1696         .qualifier = 0x03,
1697         .text = "Enter"
1698 };
1699
1700 /* Defined in TS 102.384 Section 27.22.4.2 */
1701 static void test_get_inkey(gconstpointer data)
1702 {
1703         const struct get_inkey_test *test = data;
1704         struct stk_command *command;
1705
1706         command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
1707
1708         g_assert(command);
1709         g_assert(command->status == STK_PARSE_RESULT_OK);
1710
1711         g_assert(command->number == 1);
1712         g_assert(command->type == STK_COMMAND_TYPE_GET_INKEY);
1713         g_assert(command->qualifier == test->qualifier);
1714
1715         g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
1716         g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_TERMINAL);
1717
1718         g_assert(command->get_inkey.text);
1719         check_text(command->get_inkey.text, test->text);
1720         check_icon_id(&command->get_inkey.icon_id, &test->icon_id);
1721         check_duration(&command->get_inkey.duration, &test->duration);
1722         check_text_attr(&command->get_inkey.text_attr,
1723                                                 &test->text_attr);
1724         check_text_attr_html(&command->get_inkey.text_attr,
1725                                 command->get_inkey.text, test->html);
1726         check_frame_id(&command->get_inkey.frame_id, &test->frame_id);
1727
1728         stk_command_free(command);
1729 }
1730
1731 struct get_input_test {
1732         const unsigned char *pdu;
1733         unsigned int pdu_len;
1734         unsigned char qualifier;
1735         char *text;
1736         struct stk_response_length resp_len;
1737         char *default_text;
1738         struct stk_icon_id icon_id;
1739         struct stk_text_attribute text_attr;
1740         struct stk_frame_id frame_id;
1741         char *html;
1742 };
1743
1744 static unsigned char get_input_111[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23,
1745                                                 0x00, 0x82, 0x02, 0x81, 0x82,
1746                                                 0x8D, 0x0C, 0x04, 0x45, 0x6E,
1747                                                 0x74, 0x65, 0x72, 0x20, 0x31,
1748                                                 0x32, 0x33, 0x34, 0x35, 0x91,
1749                                                 0x02, 0x05, 0x05 };
1750
1751 static unsigned char get_input_121[] = { 0xD0, 0x1A, 0x81, 0x03, 0x01, 0x23,
1752                                                 0x08, 0x82, 0x02, 0x81, 0x82,
1753                                                 0x8D, 0x0B, 0x00, 0x45, 0x37,
1754                                                 0xBD, 0x2C, 0x07, 0xD9, 0x6E,
1755                                                 0xAA, 0xD1, 0x0A, 0x91, 0x02,
1756                                                 0x05, 0x05 };
1757
1758 static unsigned char get_input_131[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23,
1759                                                 0x01, 0x82, 0x02, 0x81, 0x82,
1760                                                 0x8D, 0x0C, 0x04, 0x45, 0x6E,
1761                                                 0x74, 0x65, 0x72, 0x20, 0x41,
1762                                                 0x62, 0x43, 0x64, 0x45, 0x91,
1763                                                 0x02, 0x05, 0x05 };
1764
1765 static unsigned char get_input_141[] = { 0xD0, 0x27, 0x81, 0x03, 0x01, 0x23,
1766                                                 0x04, 0x82, 0x02, 0x81, 0x82,
1767                                                 0x8D, 0x18, 0x04, 0x50, 0x61,
1768                                                 0x73, 0x73, 0x77, 0x6F, 0x72,
1769                                                 0x64, 0x20, 0x31, 0x3C, 0x53,
1770                                                 0x45, 0x4E, 0x44, 0x3E, 0x32,
1771                                                 0x33, 0x34, 0x35, 0x36, 0x37,
1772                                                 0x38, 0x91, 0x02, 0x04, 0x08 };
1773
1774 static unsigned char get_input_151[] = { 0xD0, 0x24, 0x81, 0x03, 0x01, 0x23,
1775                                                 0x00, 0x82, 0x02, 0x81, 0x82,
1776                                                 0x8D, 0x15, 0x04, 0x45, 0x6E,
1777                                                 0x74, 0x65, 0x72, 0x20, 0x31,
1778                                                 0x2E, 0x2E, 0x39, 0x2C, 0x30,
1779                                                 0x2E, 0x2E, 0x39, 0x2C, 0x30,
1780                                                 0x28, 0x31, 0x29, 0x91, 0x02,
1781                                                 0x01, 0x14 };
1782
1783 static unsigned char get_input_161[] = { 0xD0, 0x1E, 0x81, 0x03, 0x01, 0x23,
1784                                                 0x00, 0x82, 0x02, 0x81, 0x82,
1785                                                 0x8D, 0x0F, 0x04, 0x3C, 0x47,
1786                                                 0x4F, 0x2D, 0x42, 0x41, 0x43,
1787                                                 0x4B, 0x57, 0x41, 0x52, 0x44,
1788                                                 0x53, 0x3E, 0x91, 0x02, 0x00,
1789                                                 0x08 };
1790
1791 static unsigned char get_input_171[] = { 0xD0, 0x17, 0x81, 0x03, 0x01, 0x23,
1792                                                 0x00, 0x82, 0x02, 0x81, 0x82,
1793                                                 0x8D, 0x08, 0x04, 0x3C, 0x41,
1794                                                 0x42, 0x4F, 0x52, 0x54, 0x3E,
1795                                                 0x91, 0x02, 0x00, 0x08 };
1796
1797 static unsigned char get_input_181[] = { 0xD0, 0x81, 0xB1, 0x81, 0x03, 0x01,
1798                                                 0x23, 0x00, 0x82, 0x02, 0x81,
1799                                                 0x82, 0x8D, 0x81, 0xA1, 0x04,
1800                                                 0x2A, 0x2A, 0x2A, 0x31, 0x31,
1801                                                 0x31, 0x31, 0x31, 0x31, 0x31,
1802                                                 0x31, 0x31, 0x31, 0x23, 0x23,
1803                                                 0x23, 0x2A, 0x2A, 0x2A, 0x32,
1804                                                 0x32, 0x32, 0x32, 0x32, 0x32,
1805                                                 0x32, 0x32, 0x32, 0x32, 0x23,
1806                                                 0x23, 0x23, 0x2A, 0x2A, 0x2A,
1807                                                 0x33, 0x33, 0x33, 0x33, 0x33,
1808                                                 0x33, 0x33, 0x33, 0x33, 0x33,
1809                                                 0x23, 0x23, 0x23, 0x2A, 0x2A,
1810                                                 0x2A, 0x34, 0x34, 0x34, 0x34,
1811                                                 0x34, 0x34, 0x34, 0x34, 0x34,
1812                                                 0x34, 0x23, 0x23, 0x23, 0x2A,
1813                                                 0x2A, 0x2A, 0x35, 0x35, 0x35,
1814                                                 0x35, 0x35, 0x35, 0x35, 0x35,
1815                                                 0x35, 0x35, 0x23, 0x23, 0x23,
1816                                                 0x2A, 0x2A, 0x2A, 0x36, 0x36,
1817                                                 0x36, 0x36, 0x36, 0x36, 0x36,
1818                                                 0x36, 0x36, 0x36, 0x23, 0x23,
1819                                                 0x23, 0x2A, 0x2A, 0x2A, 0x37,
1820                                                 0x37, 0x37, 0x37, 0x37, 0x37,
1821                                                 0x37, 0x37, 0x37, 0x37, 0x23,
1822                                                 0x23, 0x23, 0x2A, 0x2A, 0x2A,
1823                                                 0x38, 0x38, 0x38, 0x38, 0x38,
1824                                                 0x38, 0x38, 0x38, 0x38, 0x38,
1825                                                 0x23, 0x23, 0x23, 0x2A, 0x2A,
1826                                                 0x2A, 0x39, 0x39, 0x39, 0x39,
1827                                                 0x39, 0x39, 0x39, 0x39, 0x39,
1828                                                 0x39, 0x23, 0x23, 0x23, 0x2A,
1829                                                 0x2A, 0x2A, 0x30, 0x30, 0x30,
1830                                                 0x30, 0x30, 0x30, 0x30, 0x30,
1831                                                 0x30, 0x30, 0x23, 0x23, 0x23,
1832                                                 0x91, 0x02, 0xA0, 0xA0 };
1833
1834 static unsigned char get_input_191[] = { 0xD0, 0x16, 0x81, 0x03, 0x01, 0x23,
1835                                                 0x00, 0x82, 0x02, 0x81, 0x82,
1836                                                 0x8D, 0x07, 0x04, 0x3C, 0x53,
1837                                                 0x45, 0x4E, 0x44, 0x3E, 0x91,
1838                                                 0x02, 0x00, 0x01 };
1839
1840 static unsigned char get_input_1101[] = { 0xD0, 0x0F, 0x81, 0x03, 0x01, 0x23,
1841                                                 0x00, 0x82, 0x02, 0x81, 0x82,
1842                                                 0x8D, 0x00, 0x91, 0x02, 0x01,
1843                                                 0x05 };
1844
1845 static unsigned char get_input_211[] = { 0xD0, 0x1A, 0x81, 0x03, 0x01, 0x23,
1846                                                 0x00, 0x82, 0x02, 0x81, 0x82,
1847                                                 0x8D, 0x0B, 0x04, 0x3C, 0x54,
1848                                                 0x49, 0x4D, 0x45, 0x2D, 0x4F,
1849                                                 0x55, 0x54, 0x3E, 0x91, 0x02,
1850                                                 0x00, 0x0A };
1851
1852 static unsigned char get_input_311[] = { 0xD0, 0x28, 0x81, 0x03, 0x01, 0x23,
1853                                                 0x01, 0x82, 0x02, 0x81, 0x82,
1854                                                 0x8D, 0x19, 0x08, 0x04, 0x17,
1855                                                 0x04, 0x14, 0x04, 0x20, 0x04,
1856                                                 0x10, 0x04, 0x12, 0x04, 0x21,
1857                                                 0x04, 0x22, 0x04, 0x12, 0x04,
1858                                                 0x23, 0x04, 0x19, 0x04, 0x22,
1859                                                 0x04, 0x15, 0x91, 0x02, 0x05,
1860                                                 0x05 };
1861
1862 static unsigned char get_input_321[] = { 0xD0, 0x81, 0x9D, 0x81, 0x03, 0x01,
1863                                                 0x23, 0x01, 0x82, 0x02, 0x81,
1864                                                 0x82, 0x8D, 0x81, 0x8D, 0x08,
1865                                                 0x04, 0x17, 0x04, 0x14, 0x04,
1866                                                 0x20, 0x04, 0x10, 0x04, 0x12,
1867                                                 0x04, 0x21, 0x04, 0x22, 0x04,
1868                                                 0x12, 0x04, 0x23, 0x04, 0x19,
1869                                                 0x04, 0x22, 0x04, 0x15, 0x04,
1870                                                 0x17, 0x04, 0x14, 0x04, 0x20,
1871                                                 0x04, 0x10, 0x04, 0x12, 0x04,
1872                                                 0x21, 0x04, 0x22, 0x04, 0x12,
1873                                                 0x04, 0x23, 0x04, 0x19, 0x04,
1874                                                 0x22, 0x04, 0x15, 0x04, 0x17,
1875                                                 0x04, 0x14, 0x04, 0x20, 0x04,
1876                                                 0x10, 0x04, 0x12, 0x04, 0x21,
1877                                                 0x04, 0x22, 0x04, 0x12, 0x04,
1878                                                 0x23, 0x04, 0x19, 0x04, 0x22,
1879                                                 0x04, 0x15, 0x04, 0x17, 0x04,
1880                                                 0x14, 0x04, 0x20, 0x04, 0x10,
1881                                                 0x04, 0x12, 0x04, 0x21, 0x04,
1882                                                 0x22, 0x04, 0x12, 0x04, 0x23,
1883                                                 0x04, 0x19, 0x04, 0x22, 0x04,
1884                                                 0x15, 0x04, 0x17, 0x04, 0x14,
1885                                                 0x04, 0x20, 0x04, 0x10, 0x04,
1886                                                 0x12, 0x04, 0x21, 0x04, 0x22,
1887                                                 0x04, 0x12, 0x04, 0x23, 0x04,
1888                                                 0x19, 0x04, 0x22, 0x04, 0x15,
1889                                                 0x04, 0x17, 0x04, 0x14, 0x04,
1890                                                 0x20, 0x04, 0x10, 0x04, 0x12,
1891                                                 0x04, 0x21, 0x04, 0x22, 0x04,
1892                                                 0x12, 0x04, 0x23, 0x04, 0x19,
1893                                                 0x91, 0x02, 0x05, 0x05 };
1894
1895 static unsigned char get_input_411[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23,
1896                                                 0x03, 0x82, 0x02, 0x81, 0x82,
1897                                                 0x8D, 0x0C, 0x04, 0x45, 0x6E,
1898                                                 0x74, 0x65, 0x72, 0x20, 0x48,
1899                                                 0x65, 0x6C, 0x6C, 0x6F, 0x91,
1900                                                 0x02, 0x0C, 0x0C };
1901
1902 static unsigned char get_input_421[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23,
1903                                                 0x03, 0x82, 0x02, 0x81, 0x82,
1904                                                 0x8D, 0x0C, 0x04, 0x45, 0x6E,
1905                                                 0x74, 0x65, 0x72, 0x20, 0x48,
1906                                                 0x65, 0x6C, 0x6C, 0x6F, 0x91,
1907                                                 0x02, 0x05, 0xFF };
1908
1909 static unsigned char get_input_511[] = { 0xD0, 0x23, 0x81, 0x03, 0x01, 0x23,
1910                                                 0x00, 0x82, 0x02, 0x81, 0x82,
1911                                                 0x8D, 0x0C, 0x04, 0x45, 0x6E,
1912                                                 0x74, 0x65, 0x72, 0x20, 0x31,
1913                                                 0x32, 0x33, 0x34, 0x35, 0x91,
1914                                                 0x02, 0x05, 0x05, 0x17, 0x06,
1915                                                 0x04, 0x31, 0x32, 0x33, 0x34,
1916                                                 0x35 };
1917
1918 static unsigned char get_input_521[] = { 0xD0, 0x81, 0xBA, 0x81, 0x03, 0x01,
1919                                                 0x23, 0x00, 0x82, 0x02, 0x81,
1920                                                 0x82, 0x8D, 0x07, 0x04, 0x45,
1921                                                 0x6E, 0x74, 0x65, 0x72, 0x3A,
1922                                                 0x91, 0x02, 0xA0, 0xA0, 0x17,
1923                                                 0x81, 0xA1, 0x04, 0x2A, 0x2A,
1924                                                 0x2A, 0x31, 0x31, 0x31, 0x31,
1925                                                 0x31, 0x31, 0x31, 0x31, 0x31,
1926                                                 0x31, 0x23, 0x23, 0x23, 0x2A,
1927                                                 0x2A, 0x2A, 0x32, 0x32, 0x32,
1928                                                 0x32, 0x32, 0x32, 0x32, 0x32,
1929                                                 0x32, 0x32, 0x23, 0x23, 0x23,
1930                                                 0x2A, 0x2A, 0x2A, 0x33, 0x33,
1931                                                 0x33, 0x33, 0x33, 0x33, 0x33,
1932                                                 0x33, 0x33, 0x33, 0x23, 0x23,
1933                                                 0x23, 0x2A, 0x2A, 0x2A, 0x34,
1934                                                 0x34, 0x34, 0x34, 0x34, 0x34,
1935                                                 0x34, 0x34, 0x34, 0x34, 0x23,
1936                                                 0x23, 0x23, 0x2A, 0x2A, 0x2A,
1937                                                 0x35, 0x35, 0x35, 0x35, 0x35,
1938                                                 0x35, 0x35, 0x35, 0x35, 0x35,
1939                                                 0x23, 0x23, 0x23, 0x2A, 0x2A,
1940                                                 0x2A, 0x36, 0x36, 0x36, 0x36,
1941                                                 0x36, 0x36, 0x36, 0x36, 0x36,
1942                                                 0x36, 0x23, 0x23, 0x23, 0x2A,
1943                                                 0x2A, 0x2A, 0x37, 0x37, 0x37,
1944                                                 0x37, 0x37, 0x37, 0x37, 0x37,
1945                                                 0x37, 0x37, 0x23, 0x23, 0x23,
1946                                                 0x2A, 0x2A, 0x2A, 0x38, 0x38,
1947                                                 0x38, 0x38, 0x38, 0x38, 0x38,
1948                                                 0x38, 0x38, 0x38, 0x23, 0x23,
1949                                                 0x23, 0x2A, 0x2A, 0x2A, 0x39,
1950                                                 0x39, 0x39, 0x39, 0x39, 0x39,
1951                                                 0x39, 0x39, 0x39, 0x39, 0x23,
1952                                                 0x23, 0x23, 0x2A, 0x2A, 0x2A,
1953                                                 0x30, 0x30, 0x30, 0x30, 0x30,
1954                                                 0x30, 0x30, 0x30, 0x30, 0x30,
1955                                                 0x23, 0x23, 0x23 };
1956
1957 static unsigned char get_input_611[] = { 0xD0, 0x1D, 0x81, 0x03, 0x01, 0x23,
1958                                                 0x00, 0x82, 0x02, 0x81, 0x82,
1959                                                 0x8D, 0x0A, 0x04, 0x3C, 0x4E,
1960                                                 0x4F, 0x2D, 0x49, 0x43, 0x4F,
1961                                                 0x4E, 0x3E, 0x91, 0x02, 0x00,
1962                                                 0x0A, 0x1E, 0x02, 0x00, 0x01 };
1963
1964 static unsigned char get_input_621[] = { 0xD0, 0x20, 0x81, 0x03, 0x01, 0x23,
1965                                                 0x00, 0x82, 0x02, 0x81, 0x82,
1966                                                 0x8D, 0x0D, 0x04, 0x3C, 0x42,
1967                                                 0x41, 0x53, 0x49, 0x43, 0x2D,
1968                                                 0x49, 0x43, 0x4F, 0x4E, 0x3E,
1969                                                 0x91, 0x02, 0x00, 0x0A, 0x1E,
1970                                                 0x02, 0x01, 0x01 };
1971
1972 static unsigned char get_input_631[] = { 0xD0, 0x1D, 0x81, 0x03, 0x01, 0x23,
1973                                                 0x00, 0x82, 0x02, 0x81, 0x82,
1974                                                 0x8D, 0x0A, 0x04, 0x3C, 0x4E,
1975                                                 0x4F, 0x2D, 0x49, 0x43, 0x4F,
1976                                                 0x4E, 0x3E, 0x91, 0x02, 0x00,
1977                                                 0x0A, 0x1E, 0x02, 0x00, 0x02 };
1978
1979 static unsigned char get_input_641[] = { 0xD0, 0x21, 0x81, 0x03, 0x01, 0x23,
1980                                                 0x00, 0x82, 0x02, 0x81, 0x82,
1981                                                 0x8D, 0x0E, 0x04, 0x3C, 0x43,
1982                                                 0x4F, 0x4C, 0x4F, 0x55, 0x52,
1983                                                 0x2D, 0x49, 0x43, 0x4F, 0x4E,
1984                                                 0x3E, 0x91, 0x02, 0x00, 0x0A,
1985                                                 0x1E, 0x02, 0x01, 0x02 };
1986
1987 static unsigned char get_input_711[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23,
1988                                                 0x80, 0x82, 0x02, 0x81, 0x82,
1989                                                 0x8D, 0x0C, 0x04, 0x45, 0x6E,
1990                                                 0x74, 0x65, 0x72, 0x20, 0x31,
1991                                                 0x32, 0x33, 0x34, 0x35, 0x91,
1992                                                 0x02, 0x05, 0x05 };
1993
1994 static unsigned char get_input_811[] = { 0xD0, 0x21, 0x81, 0x03, 0x01, 0x23,
1995                                                 0x00, 0x82, 0x02, 0x81, 0x82,
1996                                                 0x8D, 0x0C, 0x04, 0x45, 0x6E,
1997                                                 0x74, 0x65, 0x72, 0x20, 0x31,
1998                                                 0x32, 0x33, 0x34, 0x35, 0x91,
1999                                                 0x02, 0x05, 0x05, 0xD0, 0x04,
2000                                                 0x00, 0x0B, 0x00, 0xB4 };
2001
2002 static unsigned char get_input_812[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23,
2003                                                 0x00, 0x82, 0x02, 0x81, 0x82,
2004                                                 0x8D, 0x0C, 0x04, 0x45, 0x6E,
2005                                                 0x74, 0x65, 0x72, 0x20, 0x32,
2006                                                 0x32, 0x32, 0x32, 0x32, 0x91,
2007                                                 0x02, 0x05, 0x05 };
2008
2009 static unsigned char get_input_821[] = { 0xD0, 0x21, 0x81, 0x03, 0x01, 0x23,
2010                                                 0x00, 0x82, 0x02, 0x81, 0x82,
2011                                                 0x8D, 0x0C, 0x04, 0x45, 0x6E,
2012                                                 0x74, 0x65, 0x72, 0x20, 0x31,
2013                                                 0x32, 0x33, 0x34, 0x35, 0x91,
2014                                                 0x02, 0x05, 0x05, 0xD0, 0x04,
2015                                                 0x00, 0x0B, 0x01, 0xB4 };
2016
2017 static unsigned char get_input_822[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23,
2018                                                 0x00, 0x82, 0x02, 0x81, 0x82,
2019                                                 0x8D, 0x0C, 0x04, 0x45, 0x6E,
2020                                                 0x74, 0x65, 0x72, 0x20, 0x32,
2021                                                 0x32, 0x32, 0x32, 0x32, 0x91,
2022                                                 0x02, 0x05, 0x05 };
2023
2024 static unsigned char get_input_831[] = { 0xD0, 0x21, 0x81, 0x03, 0x01, 0x23,
2025                                                 0x00, 0x82, 0x02, 0x81, 0x82,
2026                                                 0x8D, 0x0C, 0x04, 0x45, 0x6E,
2027                                                 0x74, 0x65, 0x72, 0x20, 0x31,
2028                                                 0x32, 0x33, 0x34, 0x35, 0x91,
2029                                                 0x02, 0x05, 0x05, 0xD0, 0x04,
2030                                                 0x00, 0x0B, 0x02, 0xB4 };
2031
2032 static unsigned char get_input_832[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23,
2033                                                 0x00, 0x82, 0x02, 0x81, 0x82,
2034                                                 0x8D, 0x0C, 0x04, 0x45, 0x6E,
2035                                                 0x74, 0x65, 0x72, 0x20, 0x32,
2036                                                 0x32, 0x32, 0x32, 0x32, 0x91,
2037                                                 0x02, 0x05, 0x05 };
2038
2039 static unsigned char get_input_841[] = { 0xD0, 0x21, 0x81, 0x03, 0x01, 0x23,
2040                                                 0x00, 0x82, 0x02, 0x81, 0x82,
2041                                                 0x8D, 0x0C, 0x04, 0x45, 0x6E,
2042                                                 0x74, 0x65, 0x72, 0x20, 0x31,
2043                                                 0x32, 0x33, 0x34, 0x35, 0x91,
2044                                                 0x02, 0x05, 0x05, 0xD0, 0x04,
2045                                                 0x00, 0x0B, 0x04, 0xB4 };
2046
2047 static unsigned char get_input_842[] = { 0xD0, 0x21, 0x81, 0x03, 0x01, 0x23,
2048                                                 0x00, 0x82, 0x02, 0x81, 0x82,
2049                                                 0x8D, 0x0C, 0x04, 0x45, 0x6E,
2050                                                 0x74, 0x65, 0x72, 0x20, 0x32,
2051                                                 0x32, 0x32, 0x32, 0x32, 0x91,
2052                                                 0x02, 0x05, 0x05, 0xD0, 0x04,
2053                                                 0x00, 0x0B, 0x00, 0xB4 };
2054
2055 static unsigned char get_input_843[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23,
2056                                                 0x00, 0x82, 0x02, 0x81, 0x82,
2057                                                 0x8D, 0x0C, 0x04, 0x45, 0x6E,
2058                                                 0x74, 0x65, 0x72, 0x20, 0x33,
2059                                                 0x33, 0x33, 0x33, 0x33, 0x91,
2060                                                 0x02, 0x05, 0x05 };
2061
2062 static unsigned char get_input_851[] = { 0xD0, 0x21, 0x81, 0x03, 0x01, 0x23,
2063                                                 0x00, 0x82, 0x02, 0x81, 0x82,
2064                                                 0x8D, 0x0C, 0x04, 0x45, 0x6E,
2065                                                 0x74, 0x65, 0x72, 0x20, 0x31,
2066                                                 0x32, 0x33, 0x34, 0x35, 0x91,
2067                                                 0x02, 0x05, 0x05, 0xD0, 0x04,
2068                                                 0x00, 0x0B, 0x08, 0xB4 };
2069
2070 static unsigned char get_input_852[] = { 0xD0, 0x21, 0x81, 0x03, 0x01, 0x23,
2071                                                 0x00, 0x82, 0x02, 0x81, 0x82,
2072                                                 0x8D, 0x0C, 0x04, 0x45, 0x6E,
2073                                                 0x74, 0x65, 0x72, 0x20, 0x32,
2074                                                 0x32, 0x32, 0x32, 0x32, 0x91,
2075                                                 0x02, 0x05, 0x05, 0xD0, 0x04,
2076                                                 0x00, 0x0B, 0x00, 0xB4 };
2077
2078 static unsigned char get_input_853[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23,
2079                                                 0x00, 0x82, 0x02, 0x81, 0x82,
2080                                                 0x8D, 0x0C, 0x04, 0x45, 0x6E,
2081                                                 0x74, 0x65, 0x72, 0x20, 0x33,
2082                                                 0x33, 0x33, 0x33, 0x33, 0x91,
2083                                                 0x02, 0x05, 0x05 };
2084
2085 static unsigned char get_input_861[] = { 0xD0, 0x21, 0x81, 0x03, 0x01, 0x23,
2086                                                 0x00, 0x82, 0x02, 0x81, 0x82,
2087                                                 0x8D, 0x0C, 0x04, 0x45, 0x6E,
2088                                                 0x74, 0x65, 0x72, 0x20, 0x31,
2089                                                 0x32, 0x33, 0x34, 0x35, 0x91,
2090                                                 0x02, 0x05, 0x05, 0xD0, 0x04,
2091                                                 0x00, 0x0B, 0x10, 0xB4 };
2092
2093 static unsigned char get_input_862[] = { 0xD0, 0x21, 0x81, 0x03, 0x01, 0x23,
2094                                                 0x00, 0x82, 0x02, 0x81, 0x82,
2095                                                 0x8D, 0x0C, 0x04, 0x45, 0x6E,
2096                                                 0x74, 0x65, 0x72, 0x20, 0x32,
2097                                                 0x32, 0x32, 0x32, 0x32, 0x91,
2098                                                 0x02, 0x05, 0x05, 0xD0, 0x04,
2099                                                 0x00, 0x0B, 0x00, 0xB4 };
2100
2101 static unsigned char get_input_863[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23,
2102                                                 0x00, 0x82, 0x02, 0x81, 0x82,
2103                                                 0x8D, 0x0C, 0x04, 0x45, 0x6E,
2104                                                 0x74, 0x65, 0x72, 0x20, 0x33,
2105                                                 0x33, 0x33, 0x33, 0x33, 0x91,
2106                                                 0x02, 0x05, 0x05 };
2107
2108 static unsigned char get_input_871[] = { 0xD0, 0x21, 0x81, 0x03, 0x01, 0x23,
2109                                                 0x00, 0x82, 0x02, 0x81, 0x82,
2110                                                 0x8D, 0x0C, 0x04, 0x45, 0x6E,
2111                                                 0x74, 0x65, 0x72, 0x20, 0x31,
2112                                                 0x32, 0x33, 0x34, 0x35, 0x91,
2113                                                 0x02, 0x05, 0x05, 0xD0, 0x04,
2114                                                 0x00, 0x0B, 0x20, 0xB4 };
2115
2116 static unsigned char get_input_872[] = { 0xD0, 0x21, 0x81, 0x03, 0x01, 0x23,
2117                                                 0x00, 0x82, 0x02, 0x81, 0x82,
2118                                                 0x8D, 0x0C, 0x04, 0x45, 0x6E,
2119                                                 0x74, 0x65, 0x72, 0x20, 0x32,
2120                                                 0x32, 0x32, 0x32, 0x32, 0x91,
2121                                                 0x02, 0x05, 0x05, 0xD0, 0x04,
2122                                                 0x00, 0x0B, 0x00, 0xB4 };
2123
2124 static unsigned char get_input_873[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23,
2125                                                 0x00, 0x82, 0x02, 0x81, 0x82,
2126                                                 0x8D, 0x0C, 0x04, 0x45, 0x6E,
2127                                                 0x74, 0x65, 0x72, 0x20, 0x33,
2128                                                 0x33, 0x33, 0x33, 0x33, 0x91,
2129                                                 0x02, 0x05, 0x05 };
2130
2131 static unsigned char get_input_881[] = { 0xD0, 0x21, 0x81, 0x03, 0x01, 0x23,
2132                                                 0x00, 0x82, 0x02, 0x81, 0x82,
2133                                                 0x8D, 0x0C, 0x04, 0x45, 0x6E,
2134                                                 0x74, 0x65, 0x72, 0x20, 0x31,
2135                                                 0x32, 0x33, 0x34, 0x35, 0x91,
2136                                                 0x02, 0x05, 0x05, 0xD0, 0x04,
2137                                                 0x00, 0x0B, 0x40, 0xB4 };
2138
2139 static unsigned char get_input_882[] = { 0xD0, 0x21, 0x81, 0x03, 0x01, 0x23,
2140                                                 0x00, 0x82, 0x02, 0x81, 0x82,
2141                                                 0x8D, 0x0C, 0x04, 0x45, 0x6E,
2142                                                 0x74, 0x65, 0x72, 0x20, 0x32,
2143                                                 0x32, 0x32, 0x32, 0x32, 0x91,
2144                                                 0x02, 0x05, 0x05, 0xD0, 0x04,
2145                                                 0x00, 0x0B, 0x00, 0xB4 };
2146
2147 static unsigned char get_input_883[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23,
2148                                                 0x00, 0x82, 0x02, 0x81, 0x82,
2149                                                 0x8D, 0x0C, 0x04, 0x45, 0x6E,
2150                                                 0x74, 0x65, 0x72, 0x20, 0x33,
2151                                                 0x33, 0x33, 0x33, 0x33, 0x91,
2152                                                 0x02, 0x05, 0x05 };
2153
2154 static unsigned char get_input_891[] = { 0xD0, 0x21, 0x81, 0x03, 0x01, 0x23,
2155                                                 0x00, 0x82, 0x02, 0x81, 0x82,
2156                                                 0x8D, 0x0C, 0x04, 0x45, 0x6E,
2157                                                 0x74, 0x65, 0x72, 0x20, 0x31,
2158                                                 0x32, 0x33, 0x34, 0x35, 0x91,
2159                                                 0x02, 0x05, 0x05, 0xD0, 0x04,
2160                                                 0x00, 0x0B, 0x80, 0xB4 };
2161
2162 static unsigned char get_input_892[] = { 0xD0, 0x21, 0x81, 0x03, 0x01, 0x23,
2163                                                 0x00, 0x82, 0x02, 0x81, 0x82,
2164                                                 0x8D, 0x0C, 0x04, 0x45, 0x6E,
2165                                                 0x74, 0x65, 0x72, 0x20, 0x32,
2166                                                 0x32, 0x32, 0x32, 0x32, 0x91,
2167                                                 0x02, 0x05, 0x05, 0xD0, 0x04,
2168                                                 0x00, 0x0B, 0x00, 0xB4 };
2169
2170 static unsigned char get_input_893[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23,
2171                                                 0x00, 0x82, 0x02, 0x81, 0x82,
2172                                                 0x8D, 0x0C, 0x04, 0x45, 0x6E,
2173                                                 0x74, 0x65, 0x72, 0x20, 0x33,
2174                                                 0x33, 0x33, 0x33, 0x33, 0x91,
2175                                                 0x02, 0x05, 0x05 };
2176
2177 static unsigned char get_input_8101[] = { 0xD0, 0x21, 0x81, 0x03, 0x01, 0x23,
2178                                                 0x00, 0x82, 0x02, 0x81, 0x82,
2179                                                 0x8D, 0x0C, 0x04, 0x45, 0x6E,
2180                                                 0x74, 0x65, 0x72, 0x20, 0x31,
2181                                                 0x32, 0x33, 0x34, 0x35, 0x91,
2182                                                 0x02, 0x05, 0x05, 0xD0, 0x04,
2183                                                 0x00, 0x0B, 0x00, 0xB4 };
2184
2185 static unsigned char get_input_8102[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23,
2186                                                 0x00, 0x82, 0x02, 0x81, 0x82,
2187                                                 0x8D, 0x0C, 0x04, 0x45, 0x6E,
2188                                                 0x74, 0x65, 0x72, 0x20, 0x32,
2189                                                 0x32, 0x32, 0x32, 0x32, 0x91,
2190                                                 0x02, 0x05, 0x05 };
2191
2192 static unsigned char get_input_911[] = { 0xD0, 0x14, 0x81, 0x03, 0x01, 0x23,
2193                                                 0x01, 0x82, 0x02, 0x81, 0x82,
2194                                                 0x8D, 0x05, 0x08, 0x4F, 0x60,
2195                                                 0x59, 0x7D, 0x91, 0x02, 0x05,
2196                                                 0x05 };
2197
2198 static unsigned char get_input_921[] = { 0xD0, 0x81, 0x9D, 0x81, 0x03, 0x01,
2199                                                 0x23, 0x01, 0x82, 0x02, 0x81,
2200                                                 0x82, 0x8D, 0x81, 0x8D, 0x08,
2201                                                 0x4F, 0x60, 0x59, 0x7D, 0x4F,
2202                                                 0x60, 0x59, 0x7D, 0x4F, 0x60,
2203                                                 0x59, 0x7D, 0x4F, 0x60, 0x59,
2204                                                 0x7D, 0x4F, 0x60, 0x59, 0x7D,
2205                                                 0x4F, 0x60, 0x59, 0x7D, 0x4F,
2206                                                 0x60, 0x59, 0x7D, 0x4F, 0x60,
2207                                                 0x59, 0x7D, 0x4F, 0x60, 0x59,
2208                                                 0x7D, 0x4F, 0x60, 0x59, 0x7D,
2209                                                 0x4F, 0x60, 0x59, 0x7D, 0x4F,
2210                                                 0x60, 0x59, 0x7D, 0x4F, 0x60,
2211                                                 0x59, 0x7D, 0x4F, 0x60, 0x59,
2212                                                 0x7D, 0x4F, 0x60, 0x59, 0x7D,
2213                                                 0x4F, 0x60, 0x59, 0x7D, 0x4F,
2214                                                 0x60, 0x59, 0x7D, 0x4F, 0x60,
2215                                                 0x59, 0x7D, 0x4F, 0x60, 0x59,
2216                                                 0x7D, 0x4F, 0x60, 0x59, 0x7D,
2217                                                 0x4F, 0x60, 0x59, 0x7D, 0x4F,
2218                                                 0x60, 0x59, 0x7D, 0x4F, 0x60,
2219                                                 0x59, 0x7D, 0x4F, 0x60, 0x59,
2220                                                 0x7D, 0x4F, 0x60, 0x59, 0x7D,
2221                                                 0x4F, 0x60, 0x59, 0x7D, 0x4F,
2222                                                 0x60, 0x59, 0x7D, 0x4F, 0x60,
2223                                                 0x59, 0x7D, 0x4F, 0x60, 0x59,
2224                                                 0x7D, 0x4F, 0x60, 0x59, 0x7D,
2225                                                 0x4F, 0x60, 0x59, 0x7D, 0x4F,
2226                                                 0x60, 0x59, 0x7D, 0x4F, 0x60,
2227                                                 0x59, 0x7D, 0x4F, 0x60, 0x59,
2228                                                 0x7D, 0x4F, 0x60, 0x59, 0x7D,
2229                                                 0x91, 0x02, 0x05, 0x05 };
2230
2231 static unsigned char get_input_1011[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23,
2232                                                 0x03, 0x82, 0x02, 0x81, 0x82,
2233                                                 0x8D, 0x0C, 0x04, 0x45, 0x6E,
2234                                                 0x74, 0x65, 0x72, 0x20, 0x48,
2235                                                 0x65, 0x6C, 0x6C, 0x6F, 0x91,
2236                                                 0x02, 0x02, 0x02 };
2237
2238 static unsigned char get_input_1021[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23,
2239                                                 0x03, 0x82, 0x02, 0x81, 0x82,
2240                                                 0x8D, 0x0C, 0x04, 0x45, 0x6E,
2241                                                 0x74, 0x65, 0x72, 0x20, 0x48,
2242                                                 0x65, 0x6C, 0x6C, 0x6F, 0x91,
2243                                                 0x02, 0x05, 0xFF };
2244
2245 static unsigned char get_input_1111[] = { 0xD0, 0x12, 0x81, 0x03, 0x01, 0x23,
2246                                                 0x01, 0x82, 0x02, 0x81, 0x82,
2247                                                 0x8D, 0x03, 0x08, 0x30, 0xEB,
2248                                                 0x91, 0x02, 0x05, 0x05 };
2249
2250 static unsigned char get_input_1121[] = { 0xD0, 0x81, 0x9D, 0x81, 0x03, 0x01,
2251                                                 0x23, 0x01, 0x82, 0x02, 0x81,
2252                                                 0x82, 0x8D, 0x81, 0x8D, 0x08,
2253                                                 0x30, 0xEB, 0x30, 0xEB, 0x30,
2254                                                 0xEB, 0x30, 0xEB, 0x30, 0xEB,
2255                                                 0x30, 0xEB, 0x30, 0xEB, 0x30,
2256                                                 0xEB, 0x30, 0xEB, 0x30, 0xEB,
2257                                                 0x30, 0xEB, 0x30, 0xEB, 0x30,
2258                                                 0xEB, 0x30, 0xEB, 0x30, 0xEB,
2259                                                 0x30, 0xEB, 0x30, 0xEB, 0x30,
2260                                                 0xEB, 0x30, 0xEB, 0x30, 0xEB,
2261                                                 0x30, 0xEB, 0x30, 0xEB, 0x30,
2262                                                 0xEB, 0x30, 0xEB, 0x30, 0xEB,
2263                                                 0x30, 0xEB, 0x30, 0xEB, 0x30,
2264                                                 0xEB, 0x30, 0xEB, 0x30, 0xEB,
2265                                                 0x30, 0xEB, 0x30, 0xEB, 0x30,
2266                                                 0xEB, 0x30, 0xEB, 0x30, 0xEB,
2267                                                 0x30, 0xEB, 0x30, 0xEB, 0x30,
2268                                                 0xEB, 0x30, 0xEB, 0x30, 0xEB,
2269                                                 0x30, 0xEB, 0x30, 0xEB, 0x30,
2270                                                 0xEB, 0x30, 0xEB, 0x30, 0xEB,
2271                                                 0x30, 0xEB, 0x30, 0xEB, 0x30,
2272                                                 0xEB, 0x30, 0xEB, 0x30, 0xEB,
2273                                                 0x30, 0xEB, 0x30, 0xEB, 0x30,
2274                                                 0xEB, 0x30, 0xEB, 0x30, 0xEB,
2275                                                 0x30, 0xEB, 0x30, 0xEB, 0x30,
2276                                                 0xEB, 0x30, 0xEB, 0x30, 0xEB,
2277                                                 0x30, 0xEB, 0x30, 0xEB, 0x30,
2278                                                 0xEB, 0x30, 0xEB, 0x30, 0xEB,
2279                                                 0x30, 0xEB, 0x30, 0xEB, 0x30,
2280                                                 0xEB, 0x30, 0xEB, 0x30, 0xEB,
2281                                                 0x91, 0x02, 0x05, 0x05 };
2282
2283 static unsigned char get_input_1211[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23,
2284                                                 0x03, 0x82, 0x02, 0x81, 0x82,
2285                                                 0x8D, 0x0C, 0x04, 0x45, 0x6E,
2286                                                 0x74, 0x65, 0x72, 0x20, 0x48,
2287                                                 0x65, 0x6C, 0x6C, 0x6F, 0x91,
2288                                                 0x02, 0x02, 0x02 };
2289
2290 static unsigned char get_input_1221[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x23,
2291                                                 0x03, 0x82, 0x02, 0x81, 0x82,
2292                                                 0x8D, 0x0C, 0x04, 0x45, 0x6E,
2293                                                 0x74, 0x65, 0x72, 0x20, 0x48,
2294                                                 0x65, 0x6C, 0x6C, 0x6F, 0x91,
2295                                                 0x02, 0x05, 0xFF };
2296
2297 static struct get_input_test get_input_data_111 = {
2298         .pdu = get_input_111,
2299         .pdu_len = sizeof(get_input_111),
2300         .qualifier = 0x00,
2301         .text = "Enter 12345",
2302         .resp_len = {
2303                 .min = 5,
2304                 .max = 5
2305         }
2306 };
2307
2308 static struct get_input_test get_input_data_121 = {
2309         .pdu = get_input_121,
2310         .pdu_len = sizeof(get_input_121),
2311         .qualifier = 0x08,
2312         .text = "Enter 67*#+",
2313         .resp_len = {
2314                 .min = 5,
2315                 .max = 5
2316         }
2317 };
2318
2319 static struct get_input_test get_input_data_131 = {
2320         .pdu = get_input_131,
2321         .pdu_len = sizeof(get_input_131),
2322         .qualifier = 0x01,
2323         .text = "Enter AbCdE",
2324         .resp_len = {
2325                 .min = 5,
2326                 .max = 5
2327         }
2328 };
2329
2330 static struct get_input_test get_input_data_141 = {
2331         .pdu = get_input_141,
2332         .pdu_len = sizeof(get_input_141),
2333         .qualifier = 0x04,
2334         .text = "Password 1<SEND>2345678",
2335         .resp_len = {
2336                 .min = 4,
2337                 .max = 8
2338         }
2339 };
2340
2341 static struct get_input_test get_input_data_151 = {
2342         .pdu = get_input_151,
2343         .pdu_len = sizeof(get_input_151),
2344         .qualifier = 0x00,
2345         .text = "Enter 1..9,0..9,0(1)",
2346         .resp_len = {
2347                 .min = 1,
2348                 .max = 20
2349         }
2350 };
2351
2352 static struct get_input_test get_input_data_161 = {
2353         .pdu = get_input_161,
2354         .pdu_len = sizeof(get_input_161),
2355         .qualifier = 0x00,
2356         .text = "<GO-BACKWARDS>",
2357         .resp_len = {
2358                 .min = 0,
2359                 .max = 8
2360         }
2361 };
2362
2363 static struct get_input_test get_input_data_171 = {
2364         .pdu = get_input_171,
2365         .pdu_len = sizeof(get_input_171),
2366         .qualifier = 0x00,
2367         .text = "<ABORT>",
2368         .resp_len = {
2369                 .min = 0,
2370                 .max = 8
2371         }
2372 };
2373
2374 static struct get_input_test get_input_data_181 = {
2375         .pdu = get_input_181,
2376         .pdu_len = sizeof(get_input_181),
2377         .qualifier = 0x00,
2378         .text = "***1111111111###***2222222222###***3333333333###"
2379                 "***4444444444###***5555555555###***6666666666###"
2380                 "***7777777777###***8888888888###***9999999999###"
2381                 "***0000000000###",
2382         .resp_len = {
2383                 .min = 160,
2384                 .max = 160
2385         }
2386 };
2387
2388 static struct get_input_test get_input_data_191 = {
2389         .pdu = get_input_191,
2390         .pdu_len = sizeof(get_input_191),
2391         .qualifier = 0x00,
2392         .text = "<SEND>",
2393         .resp_len = {
2394                 .min = 0,
2395                 .max = 1
2396         }
2397 };
2398
2399 static struct get_input_test get_input_data_1101 = {
2400         .pdu = get_input_1101,
2401         .pdu_len = sizeof(get_input_1101),
2402         .qualifier = 0x00,
2403         .text = "",
2404         .resp_len = {
2405                 .min = 1,
2406                 .max = 5
2407         }
2408 };
2409
2410 static struct get_input_test get_input_data_211 = {
2411         .pdu = get_input_211,
2412         .pdu_len = sizeof(get_input_211),
2413         .qualifier = 0x00,
2414         .text = "<TIME-OUT>",
2415         .resp_len = {
2416                 .min = 0,
2417                 .max = 10
2418         }
2419 };
2420
2421 static struct get_input_test get_input_data_311 = {
2422         .pdu = get_input_311,
2423         .pdu_len = sizeof(get_input_311),
2424         .qualifier = 0x01,
2425         .text = "ЗДРАВСТВУЙТЕ",
2426         .resp_len = {
2427                 .min = 5,
2428                 .max = 5
2429         }
2430 };
2431
2432 static struct get_input_test get_input_data_321 = {
2433         .pdu = get_input_321,
2434         .pdu_len = sizeof(get_input_321),
2435         .qualifier = 0x01,
2436         .text = "ЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕ"
2437                 "ЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕ"
2438                 "ЗДРАВСТВУЙТЕЗДРАВСТВУЙ",
2439         .resp_len = {
2440                 .min = 5,
2441                 .max = 5
2442         }
2443 };
2444
2445 static struct get_input_test get_input_data_411 = {
2446         .pdu = get_input_411,
2447         .pdu_len = sizeof(get_input_411),
2448         .qualifier = 0x03,
2449         .text = "Enter Hello",
2450         .resp_len = {
2451                 .min = 12,
2452                 .max = 12
2453         }
2454 };
2455
2456 static struct get_input_test get_input_data_421 = {
2457         .pdu = get_input_421,
2458         .pdu_len = sizeof(get_input_421),
2459         .qualifier = 0x03,
2460         .text = "Enter Hello",
2461         .resp_len = {
2462                 .min = 5,
2463                 .max = 0xFF
2464         }
2465 };
2466
2467 static struct get_input_test get_input_data_511 = {
2468         .pdu = get_input_511,
2469         .pdu_len = sizeof(get_input_511),
2470         .qualifier = 0x00,
2471         .text = "Enter 12345",
2472         .resp_len = {
2473                 .min = 5,
2474                 .max = 5
2475         },
2476         .default_text = "12345"
2477 };
2478
2479 static struct get_input_test get_input_data_521 = {
2480         .pdu = get_input_521,
2481         .pdu_len = sizeof(get_input_521),
2482         .qualifier = 0x00,
2483         .text = "Enter:",
2484         .resp_len = {
2485                 .min = 160,
2486                 .max = 160
2487         },
2488         .default_text = "***1111111111###***2222222222###***3333333333###"
2489                         "***4444444444###***5555555555###***6666666666###"
2490                         "***7777777777###***8888888888###***9999999999###"
2491                         "***0000000000###"
2492 };
2493
2494 static struct get_input_test get_input_data_611 = {
2495         .pdu = get_input_611,
2496         .pdu_len = sizeof(get_input_611),
2497         .qualifier = 0x00,
2498         .text = "<NO-ICON>",
2499         .resp_len = {
2500                 .min = 0,
2501                 .max = 10
2502         },
2503         .icon_id = {
2504                 .qualifier = STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY,
2505                 .id = 0x01
2506         }
2507 };
2508
2509 static struct get_input_test get_input_data_621 = {
2510         .pdu = get_input_621,
2511         .pdu_len = sizeof(get_input_621),
2512         .qualifier = 0x00,
2513         .text = "<BASIC-ICON>",
2514         .resp_len = {
2515                 .min = 0,
2516                 .max = 10
2517         },
2518         .icon_id = {
2519                 .qualifier = STK_ICON_QUALIFIER_TYPE_NON_SELF_EXPLANATORY,
2520                 .id = 0x01
2521         }
2522 };
2523
2524 static struct get_input_test get_input_data_631 = {
2525         .pdu = get_input_631,
2526         .pdu_len = sizeof(get_input_631),
2527         .qualifier = 0x00,
2528         .text = "<NO-ICON>",
2529         .resp_len = {
2530                 .min = 0,
2531                 .max = 10
2532         },
2533         .icon_id = {
2534                 .qualifier = STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY,
2535                 .id = 0x02
2536         }
2537 };
2538
2539 static struct get_input_test get_input_data_641 = {
2540         .pdu = get_input_641,
2541         .pdu_len = sizeof(get_input_641),
2542         .qualifier = 0x00,
2543         .text = "<COLOUR-ICON>",
2544         .resp_len = {
2545                 .min = 0,
2546                 .max = 10
2547         },
2548         .icon_id = {
2549                 .qualifier = STK_ICON_QUALIFIER_TYPE_NON_SELF_EXPLANATORY,
2550                 .id = 0x02
2551         }
2552 };
2553
2554 static struct get_input_test get_input_data_711 = {
2555         .pdu = get_input_711,
2556         .pdu_len = sizeof(get_input_711),
2557         .qualifier = 0x80,
2558         .text = "Enter 12345",
2559         .resp_len = {
2560                 .min = 5,
2561                 .max = 5
2562         }
2563 };
2564
2565 static struct get_input_test get_input_data_811 = {
2566         .pdu = get_input_811,
2567         .pdu_len = sizeof(get_input_811),
2568         .qualifier = 0x00,
2569         .text = "Enter 12345",
2570         .resp_len = {
2571                 .min = 5,
2572                 .max = 5
2573         },
2574         .text_attr = {
2575                 .len = 4,
2576                 .attributes = { 0x00, 0x0B, 0x00, 0xB4 }
2577         },
2578         .html = "<div style=\"text-align: left;\"><span style=\"color: "
2579                 "#347235;background-color: #FFFF00;\">Enter 12345</span></div>"
2580 };
2581
2582 static struct get_input_test get_input_data_812 = {
2583         .pdu = get_input_812,
2584         .pdu_len = sizeof(get_input_812),
2585         .qualifier = 0x00,
2586         .text = "Enter 22222",
2587         .resp_len = {
2588                 .min = 5,
2589                 .max = 5
2590         }
2591 };
2592
2593 static struct get_input_test get_input_data_821 = {
2594         .pdu = get_input_821,
2595         .pdu_len = sizeof(get_input_821),
2596         .qualifier = 0x00,
2597         .text = "Enter 12345",
2598         .resp_len = {
2599                 .min = 5,
2600                 .max = 5
2601         },
2602         .text_attr = {
2603                 .len = 4,
2604                 .attributes = { 0x00, 0x0B, 0x01, 0xB4 }
2605         },
2606         .html = "<div style=\"text-align: center;\"><span style=\"color: "
2607                 "#347235;background-color: #FFFF00;\">Enter 12345</span>"
2608                 "</div>",
2609 };
2610
2611 static struct get_input_test get_input_data_822 = {
2612         .pdu = get_input_822,
2613         .pdu_len = sizeof(get_input_822),
2614         .qualifier = 0x00,
2615         .text = "Enter 22222",
2616         .resp_len = {
2617                 .min = 5,
2618                 .max = 5
2619         }
2620 };
2621
2622 static struct get_input_test get_input_data_831 = {
2623         .pdu = get_input_831,
2624         .pdu_len = sizeof(get_input_831),
2625         .qualifier = 0x00,
2626         .text = "Enter 12345",
2627         .resp_len = {
2628                 .min = 5,
2629                 .max = 5
2630         },
2631         .text_attr = {
2632                 .len = 4,
2633                 .attributes = { 0x00, 0x0B, 0x02, 0xB4 }
2634         },
2635         .html = "<div style=\"text-align: right;\"><span style=\"color: "
2636                 "#347235;background-color: #FFFF00;\">Enter 12345</span>"
2637                 "</div>",
2638 };
2639
2640 static struct get_input_test get_input_data_832 = {
2641         .pdu = get_input_832,
2642         .pdu_len = sizeof(get_input_832),
2643         .qualifier = 0x00,
2644         .text = "Enter 22222",
2645         .resp_len = {
2646                 .min = 5,
2647                 .max = 5
2648         }
2649 };
2650
2651 static struct get_input_test get_input_data_841 = {
2652         .pdu = get_input_841,
2653         .pdu_len = sizeof(get_input_841),
2654         .qualifier = 0x00,
2655         .text = "Enter 12345",
2656         .resp_len = {
2657                 .min = 5,
2658                 .max = 5
2659         },
2660         .text_attr = {
2661                 .len = 4,
2662                 .attributes = { 0x00, 0x0B, 0x04, 0xB4 }
2663         },
2664         .html = "<div style=\"text-align: left;\"><span style=\"font-size: "
2665                 "big;color: #347235;background-color: #FFFF00;\">Enter 12345"
2666                 "</span></div>",
2667 };
2668
2669 static struct get_input_test get_input_data_842 = {
2670         .pdu = get_input_842,
2671         .pdu_len = sizeof(get_input_842),
2672         .qualifier = 0x00,
2673         .text = "Enter 22222",
2674         .resp_len = {
2675                 .min = 5,
2676                 .max = 5
2677         },
2678         .text_attr = {
2679                 .len = 4,
2680                 .attributes = { 0x00, 0x0B, 0x00, 0xB4 }
2681         },
2682         .html = "<div style=\"text-align: left;\"><span style=\"color: "
2683                 "#347235;background-color: #FFFF00;\">Enter 22222</span></div>"
2684 };
2685
2686 static struct get_input_test get_input_data_843 = {
2687         .pdu = get_input_843,
2688         .pdu_len = sizeof(get_input_843),
2689         .qualifier = 0x00,
2690         .text = "Enter 33333",
2691         .resp_len = {
2692                 .min = 5,
2693                 .max = 5
2694         }
2695 };
2696
2697 static struct get_input_test get_input_data_851 = {
2698         .pdu = get_input_851,
2699         .pdu_len = sizeof(get_input_851),
2700         .qualifier = 0x00,
2701         .text = "Enter 12345",
2702         .resp_len = {
2703                 .min = 5,
2704                 .max = 5
2705         },
2706         .text_attr = {
2707                 .len = 4,
2708                 .attributes = { 0x00, 0x0B, 0x08, 0xB4 }
2709         },
2710         .html = "<div style=\"text-align: left;\"><span style=\"font-size: "
2711                 "small;color: #347235;background-color: #FFFF00;\">Enter "
2712                 "12345</span></div>",
2713 };
2714
2715 static struct get_input_test get_input_data_852 = {
2716         .pdu = get_input_852,
2717         .pdu_len = sizeof(get_input_852),
2718         .qualifier = 0x00,
2719         .text = "Enter 22222",
2720         .resp_len = {
2721                 .min = 5,
2722                 .max = 5
2723         },
2724         .text_attr = {
2725                 .len = 4,
2726                 .attributes = { 0x00, 0x0B, 0x00, 0xB4 }
2727         },
2728         .html = "<div style=\"text-align: left;\"><span style=\"color: "
2729                 "#347235;background-color: #FFFF00;\">Enter 22222</span></div>",
2730 };
2731
2732 static struct get_input_test get_input_data_853 = {
2733         .pdu = get_input_853,
2734         .pdu_len = sizeof(get_input_853),
2735         .qualifier = 0x00,
2736         .text = "Enter 33333",
2737         .resp_len = {
2738                 .min = 5,
2739                 .max = 5
2740         }
2741 };
2742
2743 static struct get_input_test get_input_data_861 = {
2744         .pdu = get_input_861,
2745         .pdu_len = sizeof(get_input_861),
2746         .qualifier = 0x00,
2747         .text = "Enter 12345",
2748         .resp_len = {
2749                 .min = 5,
2750                 .max = 5
2751         },
2752         .text_attr = {
2753                 .len = 4,
2754                 .attributes = { 0x00, 0x0B, 0x10, 0xB4 }
2755         },
2756         .html = "<div style=\"text-align: left;\"><span style=\"font-weight: "
2757                 "bold;color: #347235;background-color: #FFFF00;\">Enter "
2758                 "12345</span></div>"
2759 };
2760
2761 static struct get_input_test get_input_data_862 = {
2762         .pdu = get_input_862,
2763         .pdu_len = sizeof(get_input_862),
2764         .qualifier = 0x00,
2765         .text = "Enter 22222",
2766         .resp_len = {
2767                 .min = 5,
2768                 .max = 5
2769         },
2770         .text_attr = {
2771                 .len = 4,
2772                 .attributes = { 0x00, 0x0B, 0x00, 0xB4 }
2773         },
2774         .html = "<div style=\"text-align: left;\"><span style=\"color: "
2775                 "#347235;background-color: #FFFF00;\">Enter 22222</span></div>",
2776 };
2777
2778 static struct get_input_test get_input_data_863 = {
2779         .pdu = get_input_863,
2780         .pdu_len = sizeof(get_input_863),
2781         .qualifier = 0x00,
2782         .text = "Enter 33333",
2783         .resp_len = {
2784                 .min = 5,
2785                 .max = 5
2786         }
2787 };
2788
2789 static struct get_input_test get_input_data_871 = {
2790         .pdu = get_input_871,
2791         .pdu_len = sizeof(get_input_871),
2792         .qualifier = 0x00,
2793         .text = "Enter 12345",
2794         .resp_len = {
2795                 .min = 5,
2796                 .max = 5
2797         },
2798         .text_attr = {
2799                 .len = 4,
2800                 .attributes = { 0x00, 0x0B, 0x20, 0xB4 }
2801         },
2802         .html = "<div style=\"text-align: left;\"><span style=\"font-style: "
2803                 "italic;color: #347235;background-color: #FFFF00;\">Enter "
2804                 "12345</span></div>",
2805 };
2806
2807 static struct get_input_test get_input_data_872 = {
2808         .pdu = get_input_872,
2809         .pdu_len = sizeof(get_input_872),
2810         .qualifier = 0x00,
2811         .text = "Enter 22222",
2812         .resp_len = {
2813                 .min = 5,
2814                 .max = 5
2815         },
2816         .text_attr = {
2817                 .len = 4,
2818                 .attributes = { 0x00, 0x0B, 0x00, 0xB4 }
2819         },
2820         .html = "<div style=\"text-align: left;\"><span style=\"color: "
2821                 "#347235;background-color: #FFFF00;\">Enter 22222</span></div>",
2822 };
2823
2824 static struct get_input_test get_input_data_873 = {
2825         .pdu = get_input_873,
2826         .pdu_len = sizeof(get_input_873),
2827         .qualifier = 0x00,
2828         .text = "Enter 33333",
2829         .resp_len = {
2830                 .min = 5,
2831                 .max = 5
2832         }
2833 };
2834
2835 static struct get_input_test get_input_data_881 = {
2836         .pdu = get_input_881,
2837         .pdu_len = sizeof(get_input_881),
2838         .qualifier = 0x00,
2839         .text = "Enter 12345",
2840         .resp_len = {
2841                 .min = 5,
2842                 .max = 5
2843         },
2844         .text_attr = {
2845                 .len = 4,
2846                 .attributes = { 0x00, 0x0B, 0x40, 0xB4 }
2847         },
2848         .html = "<div style=\"text-align: left;\"><span "
2849                 "style=\"text-decoration: underline;color: #347235;"
2850                 "background-color: #FFFF00;\">Enter 12345</span></div>",
2851 };
2852
2853 static struct get_input_test get_input_data_882 = {
2854         .pdu = get_input_882,
2855         .pdu_len = sizeof(get_input_882),
2856         .qualifier = 0x00,
2857         .text = "Enter 22222",
2858         .resp_len = {
2859                 .min = 5,
2860                 .max = 5
2861         },
2862         .text_attr = {
2863                 .len = 4,
2864                 .attributes = { 0x00, 0x0B, 0x00, 0xB4 }
2865         },
2866         .html = "<div style=\"text-align: left;\"><span style=\"color: "
2867                 "#347235;background-color: #FFFF00;\">Enter 22222</span></div>",
2868 };
2869
2870 static struct get_input_test get_input_data_883 = {
2871         .pdu = get_input_883,
2872         .pdu_len = sizeof(get_input_883),
2873         .qualifier = 0x00,
2874         .text = "Enter 33333",
2875         .resp_len = {
2876                 .min = 5,
2877                 .max = 5
2878         }
2879 };
2880
2881 static struct get_input_test get_input_data_891 = {
2882         .pdu = get_input_891,
2883         .pdu_len = sizeof(get_input_891),
2884         .qualifier = 0x00,
2885         .text = "Enter 12345",
2886         .resp_len = {
2887                 .min = 5,
2888                 .max = 5
2889         },
2890         .text_attr = {
2891                 .len = 4,
2892                 .attributes = { 0x00, 0x0B, 0x80, 0xB4 }
2893         },
2894         .html = "<div style=\"text-align: left;\"><span "
2895                 "style=\"text-decoration: line-through;color: #347235;"
2896                 "background-color: #FFFF00;\">Enter 12345</span></div>",
2897 };
2898
2899 static struct get_input_test get_input_data_892 = {
2900         .pdu = get_input_892,
2901         .pdu_len = sizeof(get_input_892),
2902         .qualifier = 0x00,
2903         .text = "Enter 22222",
2904         .resp_len = {
2905                 .min = 5,
2906                 .max = 5
2907         },
2908         .text_attr = {
2909                 .len = 4,
2910                 .attributes = { 0x00, 0x0B, 0x00, 0xB4 }
2911         },
2912         .html = "<div style=\"text-align: left;\"><span style=\"color: "
2913                 "#347235;background-color: #FFFF00;\">Enter 22222</span></div>",
2914 };
2915
2916 static struct get_input_test get_input_data_893 = {
2917         .pdu = get_input_893,
2918         .pdu_len = sizeof(get_input_893),
2919         .qualifier = 0x00,
2920         .text = "Enter 33333",
2921         .resp_len = {
2922                 .min = 5,
2923                 .max = 5
2924         }
2925 };
2926
2927 static struct get_input_test get_input_data_8101 = {
2928         .pdu = get_input_8101,
2929         .pdu_len = sizeof(get_input_8101),
2930         .qualifier = 0x00,
2931         .text = "Enter 12345",
2932         .resp_len = {
2933                 .min = 5,
2934                 .max = 5
2935         },
2936         .text_attr = {
2937                 .len = 4,
2938                 .attributes = { 0x00, 0x0B, 0x00, 0xB4 }
2939         },
2940         .html = "<div style=\"text-align: left;\"><span style=\"color: "
2941                 "#347235;background-color: #FFFF00;\">Enter 12345</span></div>",
2942 };
2943
2944 static struct get_input_test get_input_data_8102 = {
2945         .pdu = get_input_8102,
2946         .pdu_len = sizeof(get_input_8102),
2947         .qualifier = 0x00,
2948         .text = "Enter 22222",
2949         .resp_len = {
2950                 .min = 5,
2951                 .max = 5
2952         }
2953 };
2954
2955 static struct get_input_test get_input_data_911 = {
2956         .pdu = get_input_911,
2957         .pdu_len = sizeof(get_input_911),
2958         .qualifier = 0x01,
2959         .text = "你好",
2960         .resp_len = {
2961                 .min = 5,
2962                 .max = 5
2963         }
2964 };
2965
2966 static struct get_input_test get_input_data_921 = {
2967         .pdu = get_input_921,
2968         .pdu_len = sizeof(get_input_921),
2969         .qualifier = 0x01,
2970         .text = "你好你好你好你好你好你好你好你好你好你好"
2971                 "你好你好你好你好你好你好你好你好你好你好"
2972                 "你好你好你好你好你好你好你好你好你好你好"
2973                 "你好你好你好你好你好",
2974         .resp_len = {
2975                 .min = 5,
2976                 .max = 5
2977         }
2978 };
2979
2980 static struct get_input_test get_input_data_1011 = {
2981         .pdu = get_input_1011,
2982         .pdu_len = sizeof(get_input_1011),
2983         .qualifier = 0x03,
2984         .text = "Enter Hello",
2985         .resp_len = {
2986                 .min = 2,
2987                 .max = 2
2988         }
2989 };
2990
2991 static struct get_input_test get_input_data_1021 = {
2992         .pdu = get_input_1021,
2993         .pdu_len = sizeof(get_input_1021),
2994         .qualifier = 0x03,
2995         .text = "Enter Hello",
2996         .resp_len = {
2997                 .min = 5,
2998                 .max = 0xFF
2999         }
3000 };
3001
3002 static struct get_input_test get_input_data_1111 = {
3003         .pdu = get_input_1111,
3004         .pdu_len = sizeof(get_input_1111),
3005         .qualifier = 0x01,
3006         .text = "ル",
3007         .resp_len = {
3008                 .min = 5,
3009                 .max = 5
3010         }
3011 };
3012
3013 static struct get_input_test get_input_data_1121 = {
3014         .pdu = get_input_1121,
3015         .pdu_len = sizeof(get_input_1121),
3016         .qualifier = 0x01,
3017         .text = "ルルルルルルルルルルルルルルルルルルルル"
3018                 "ルルルルルルルルルルルルルルルルルルルル"
3019                 "ルルルルルルルルルルルルルルルルルルルル"
3020                 "ルルルルルルルルルル",
3021         .resp_len = {
3022                 .min = 5,
3023                 .max = 5
3024         }
3025 };
3026
3027 static struct get_input_test get_input_data_1211 = {
3028         .pdu = get_input_1211,
3029         .pdu_len = sizeof(get_input_1211),
3030         .qualifier = 0x03,
3031         .text = "Enter Hello",
3032         .resp_len = {
3033                 .min = 2,
3034                 .max = 2
3035         }
3036 };
3037
3038 static struct get_input_test get_input_data_1221 = {
3039         .pdu = get_input_1221,
3040         .pdu_len = sizeof(get_input_1221),
3041         .qualifier = 0x03,
3042         .text = "Enter Hello",
3043         .resp_len = {
3044                 .min = 5,
3045                 .max = 0xFF
3046         }
3047 };
3048
3049 /* Defined in TS 102.384 Section 27.22.4.3 */
3050 static void test_get_input(gconstpointer data)
3051 {
3052         const struct get_input_test *test = data;
3053         struct stk_command *command;
3054
3055         command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
3056
3057         g_assert(command);
3058         g_assert(command->status == STK_PARSE_RESULT_OK);
3059
3060         g_assert(command->number == 1);
3061         g_assert(command->type == STK_COMMAND_TYPE_GET_INPUT);
3062         g_assert(command->qualifier == test->qualifier);
3063
3064         g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
3065         g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_TERMINAL);
3066
3067         if (test->text)
3068                 g_assert(command->get_input.text);
3069         check_text(command->get_input.text, test->text);
3070         check_response_length(&command->get_input.resp_len, &test->resp_len);
3071         check_default_text(command->get_input.default_text, test->default_text);
3072         check_icon_id(&command->get_input.icon_id, &test->icon_id);
3073         check_text_attr(&command->get_input.text_attr,
3074                                                 &test->text_attr);
3075         check_text_attr_html(&command->get_input.text_attr,
3076                                 command->get_input.text, test->html);
3077         check_frame_id(&command->get_input.frame_id, &test->frame_id);
3078
3079         stk_command_free(command);
3080 }
3081
3082 struct more_time_test {
3083         const unsigned char *pdu;
3084         unsigned int pdu_len;
3085         unsigned char qualifier;
3086 };
3087
3088 static unsigned char more_time_111[] = { 0xD0, 0x09, 0x81, 0x03, 0x01, 0x02,
3089                                                 0x00, 0x82, 0x02, 0x81, 0x82 };
3090
3091 static struct more_time_test more_time_data_111 = {
3092         .pdu = more_time_111,
3093         .pdu_len = sizeof(more_time_111),
3094         .qualifier = 0x00,
3095 };
3096
3097 /* Defined in TS 102.384 Section 27.22.4.4 */
3098 static void test_more_time(gconstpointer data)
3099 {
3100         const struct get_input_test *test = data;
3101         struct stk_command *command;
3102
3103         command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
3104
3105         g_assert(command);
3106         g_assert(command->status == STK_PARSE_RESULT_OK);
3107
3108         g_assert(command->number == 1);
3109         g_assert(command->type == STK_COMMAND_TYPE_MORE_TIME);
3110         g_assert(command->qualifier == test->qualifier);
3111
3112         g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
3113         g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_TERMINAL);
3114
3115         stk_command_free(command);
3116 }
3117
3118 struct play_tone_test {
3119         const unsigned char *pdu;
3120         unsigned int pdu_len;
3121         unsigned char qualifier;
3122         char *alpha_id;
3123         unsigned char tone;
3124         struct stk_duration duration;
3125         struct stk_icon_id icon_id;
3126         struct stk_text_attribute text_attr;
3127         struct stk_frame_id frame_id;
3128         char *html;
3129 };
3130
3131 static unsigned char play_tone_111[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x20,
3132                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3133                                                 0x85, 0x09, 0x44, 0x69, 0x61,
3134                                                 0x6C, 0x20, 0x54, 0x6F, 0x6E,
3135                                                 0x65, 0x8E, 0x01, 0x01, 0x84,
3136                                                 0x02, 0x01, 0x05 };
3137
3138 static unsigned char play_tone_112[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x20,
3139                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3140                                                 0x85, 0x09, 0x53, 0x75, 0x62,
3141                                                 0x2E, 0x20, 0x42, 0x75, 0x73,
3142                                                 0x79, 0x8E, 0x01, 0x02, 0x84,
3143                                                 0x02, 0x01, 0x05 };
3144
3145 static unsigned char play_tone_113[] = { 0xD0, 0x1C, 0x81, 0x03, 0x01, 0x20,
3146                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3147                                                 0x85, 0x0A, 0x43, 0x6F, 0x6E,
3148                                                 0x67, 0x65, 0x73, 0x74, 0x69,
3149                                                 0x6F, 0x6E, 0x8E, 0x01, 0x03,
3150                                                 0x84, 0x02, 0x01, 0x05 };
3151
3152 static unsigned char play_tone_114[] = { 0xD0, 0x18, 0x81, 0x03, 0x01, 0x20,
3153                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3154                                                 0x85, 0x06, 0x52, 0x50, 0x20,
3155                                                 0x41, 0x63, 0x6B, 0x8E, 0x01,
3156                                                 0x04, 0x84, 0x02, 0x01, 0x05 };
3157
3158 static unsigned char play_tone_115[] = { 0xD0, 0x17, 0x81, 0x03, 0x01, 0x20,
3159                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3160                                                 0x85, 0x05, 0x4E, 0x6F, 0x20,
3161                                                 0x52, 0x50, 0x8E, 0x01, 0x05,
3162                                                 0x84, 0x02, 0x01, 0x05 };
3163
3164 static unsigned char play_tone_116[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x20,
3165                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3166                                                 0x85, 0x09, 0x53, 0x70, 0x65,
3167                                                 0x63, 0x20, 0x49, 0x6E, 0x66,
3168                                                 0x6F, 0x8E, 0x01, 0x06, 0x84,
3169                                                 0x02, 0x01, 0x05 };
3170
3171 static unsigned char play_tone_117[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x20,
3172                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3173                                                 0x85, 0x09, 0x43, 0x61, 0x6C,
3174                                                 0x6C, 0x20, 0x57, 0x61, 0x69,
3175                                                 0x74, 0x8E, 0x01, 0x07, 0x84,
3176                                                 0x02, 0x01, 0x05 };
3177
3178 static unsigned char play_tone_118[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x20,
3179                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3180                                                 0x85, 0x09, 0x52, 0x69, 0x6E,
3181                                                 0x67, 0x20, 0x54, 0x6F, 0x6E,
3182                                                 0x65, 0x8E, 0x01, 0x08, 0x84,
3183                                                 0x02, 0x01, 0x05 };
3184
3185 static unsigned char play_tone_119[] = { 0xD0, 0x81, 0xFD, 0x81, 0x03, 0x01,
3186                                                 0x20, 0x00, 0x82, 0x02, 0x81,
3187                                                 0x03, 0x85, 0x81, 0xF1, 0x54,
3188                                                 0x68, 0x69, 0x73, 0x20, 0x63,
3189                                                 0x6F, 0x6D, 0x6D, 0x61, 0x6E,
3190                                                 0x64, 0x20, 0x69, 0x6E, 0x73,
3191                                                 0x74, 0x72, 0x75, 0x63, 0x74,
3192                                                 0x73, 0x20, 0x74, 0x68, 0x65,
3193                                                 0x20, 0x4D, 0x45, 0x20, 0x74,
3194                                                 0x6F, 0x20, 0x70, 0x6C, 0x61,
3195                                                 0x79, 0x20, 0x61, 0x6E, 0x20,
3196                                                 0x61, 0x75, 0x64, 0x69, 0x6F,
3197                                                 0x20, 0x74, 0x6F, 0x6E, 0x65,
3198                                                 0x2E, 0x20, 0x55, 0x70, 0x6F,
3199                                                 0x6E, 0x20, 0x72, 0x65, 0x63,
3200                                                 0x65, 0x69, 0x76, 0x69, 0x6E,
3201                                                 0x67, 0x20, 0x74, 0x68, 0x69,
3202                                                 0x73, 0x20, 0x63, 0x6F, 0x6D,
3203                                                 0x6D, 0x61, 0x6E, 0x64, 0x2C,
3204                                                 0x20, 0x74, 0x68, 0x65, 0x20,
3205                                                 0x4D, 0x45, 0x20, 0x73, 0x68,
3206                                                 0x61, 0x6C, 0x6C, 0x20, 0x63,
3207                                                 0x68, 0x65, 0x63, 0x6B, 0x20,
3208                                                 0x69, 0x66, 0x20, 0x69, 0x74,
3209                                                 0x20, 0x69, 0x73, 0x20, 0x63,
3210                                                 0x75, 0x72, 0x72, 0x65, 0x6E,
3211                                                 0x74, 0x6C, 0x79, 0x20, 0x69,
3212                                                 0x6E, 0x2C, 0x20, 0x6F, 0x72,
3213                                                 0x20, 0x69, 0x6E, 0x20, 0x74,
3214                                                 0x68, 0x65, 0x20, 0x70, 0x72,
3215                                                 0x6F, 0x63, 0x65, 0x73, 0x73,
3216                                                 0x20, 0x6F, 0x66, 0x20, 0x73,
3217                                                 0x65, 0x74, 0x74, 0x69, 0x6E,
3218                                                 0x67, 0x20, 0x75, 0x70, 0x20,
3219                                                 0x28, 0x53, 0x45, 0x54, 0x2D,
3220                                                 0x55, 0x50, 0x20, 0x6D, 0x65,
3221                                                 0x73, 0x73, 0x61, 0x67, 0x65,
3222                                                 0x20, 0x73, 0x65, 0x6E, 0x74,
3223                                                 0x20, 0x74, 0x6F, 0x20, 0x74,
3224                                                 0x68, 0x65, 0x20, 0x6E, 0x65,
3225                                                 0x74, 0x77, 0x6F, 0x72, 0x6B,
3226                                                 0x2C, 0x20, 0x73, 0x65, 0x65,
3227                                                 0x20, 0x47, 0x53, 0x4D, 0x22,
3228                                                 0x30, 0x34, 0x2E, 0x30, 0x38,
3229                                                 0x22, 0x28, 0x38, 0x29, 0x29,
3230                                                 0x2C, 0x20, 0x61, 0x20, 0x73,
3231                                                 0x70, 0x65, 0x65, 0x63, 0x68,
3232                                                 0x20, 0x63, 0x61, 0x6C, 0x6C,
3233                                                 0x2E, 0x20, 0x2D, 0x20, 0x49,
3234                                                 0x66, 0x20, 0x74, 0x68, 0x65,
3235                                                 0x20, 0x4D, 0x45, 0x20, 0x49 };
3236
3237 static unsigned char play_tone_1110[] = { 0xD0, 0x16, 0x81, 0x03, 0x01, 0x20,
3238                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3239                                                 0x85, 0x04, 0x42, 0x65, 0x65,
3240                                                 0x70, 0x8E, 0x01, 0x10, 0x84,
3241                                                 0x02, 0x01, 0x01 };
3242
3243 static unsigned char play_tone_1111[] = { 0xD0, 0x1A, 0x81, 0x03, 0x01, 0x20,
3244                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3245                                                 0x85, 0x08, 0x50, 0x6F, 0x73,
3246                                                 0x69, 0x74, 0x69, 0x76, 0x65,
3247                                                 0x8E, 0x01, 0x11, 0x84, 0x02,
3248                                                 0x01, 0x01 };
3249
3250 static unsigned char play_tone_1112[] = { 0xD0, 0x1A, 0x81, 0x03, 0x01, 0x20,
3251                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3252                                                 0x85, 0x08, 0x4E, 0x65, 0x67,
3253                                                 0x61, 0x74, 0x69, 0x76, 0x65,
3254                                                 0x8E, 0x01, 0x12, 0x84, 0x02,
3255                                                 0x01, 0x01 };
3256
3257 static unsigned char play_tone_1113[] = { 0xD0, 0x17, 0x81, 0x03, 0x01, 0x20,
3258                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3259                                                 0x85, 0x05, 0x51, 0x75, 0x69,
3260                                                 0x63, 0x6B, 0x8E, 0x01, 0x10,
3261                                                 0x84, 0x02, 0x02, 0x02 };
3262
3263 static unsigned char play_tone_1114[] = { 0xD0, 0x19, 0x81, 0x03, 0x01, 0x20,
3264                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3265                                                 0x85, 0x07, 0x3C, 0x41, 0x42,
3266                                                 0x4F, 0x52, 0x54, 0x3E, 0x8E,
3267                                                 0x01, 0x06, 0x84, 0x02, 0x00,
3268                                                 0x01 };
3269
3270 static unsigned char play_tone_1115[] = { 0xD0, 0x09, 0x81, 0x03, 0x01, 0x20,
3271                                                 0x00, 0x82, 0x02, 0x81, 0x03 };
3272
3273 static unsigned char play_tone_211[] = { 0xD0, 0x2B, 0x81, 0x03, 0x01, 0x20,
3274                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3275                                                 0x85, 0x19, 0x80, 0x04, 0x17,
3276                                                 0x04, 0x14, 0x04, 0x20, 0x04,
3277                                                 0x10, 0x04, 0x12, 0x04, 0x21,
3278                                                 0x04, 0x22, 0x04, 0x12, 0x04,
3279                                                 0x23, 0x04, 0x19, 0x04, 0x22,
3280                                                 0x04, 0x15, 0x8E, 0x01, 0x11,
3281                                                 0x84, 0x02, 0x01, 0x01 };
3282
3283
3284 static unsigned char play_tone_212[] = { 0xD0, 0x21, 0x81, 0x03, 0x01, 0x20,
3285                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3286                                                 0x85, 0x0F, 0x81, 0x0C, 0x08,
3287                                                 0x97, 0x94, 0xA0, 0x90, 0x92,
3288                                                 0xA1, 0xA2, 0x92, 0xA3, 0x99,
3289                                                 0xA2, 0x95, 0x8E, 0x01, 0x11,
3290                                                 0x84, 0x02, 0x01, 0x01 };
3291
3292 static unsigned char play_tone_213[] = { 0xD0, 0x22, 0x81, 0x03, 0x01, 0x20,
3293                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3294                                                 0x85, 0x10, 0x82, 0x0C, 0x04,
3295                                                 0x10, 0x87, 0x84, 0x90, 0x80,
3296                                                 0x82, 0x91, 0x92, 0x82, 0x93,
3297                                                 0x89, 0x92, 0x85, 0x8E, 0x01,
3298                                                 0x11, 0x84, 0x02, 0x01, 0x01 };
3299
3300 static unsigned char play_tone_311[] = { 0xD0, 0x22, 0x81, 0x03, 0x01, 0x20,
3301                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3302                                                 0x85, 0x0C, 0x3C, 0x42, 0x41,
3303                                                 0x53, 0x49, 0x43, 0x2D, 0x49,
3304                                                 0x43, 0x4F, 0x4E, 0x3E, 0x8E,
3305                                                 0x01, 0x11, 0x84, 0x02, 0x01,
3306                                                 0x01, 0x1E, 0x02, 0x00, 0x01 };
3307
3308 static unsigned char play_tone_321[] = { 0xD0, 0x22, 0x81, 0x03, 0x01, 0x20,
3309                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3310                                                 0x85, 0x0C, 0x3C, 0x42, 0x41,
3311                                                 0x53, 0x49, 0x43, 0x2D, 0x49,
3312                                                 0x43, 0x4F, 0x4E, 0x3E, 0x8E,
3313                                                 0x01, 0x11, 0x84, 0x02, 0x01,
3314                                                 0x01, 0x1E, 0x02, 0x01, 0x01 };
3315
3316 static unsigned char play_tone_331[] = { 0xD0, 0x23, 0x81, 0x03, 0x01, 0x20,
3317                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3318                                                 0x85, 0x0D, 0x3C, 0x43, 0x4F,
3319                                                 0x4C, 0x4F, 0x55, 0x52, 0x2D,
3320                                                 0x49, 0x43, 0x4F, 0x4E, 0x3E,
3321                                                 0x8E, 0x01, 0x11, 0x84, 0x02,
3322                                                 0x01, 0x01, 0x1E, 0x02, 0x00,
3323                                                 0x02 };
3324
3325 static unsigned char play_tone_341[] = { 0xD0, 0x23, 0x81, 0x03, 0x01, 0x20,
3326                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3327                                                 0x85, 0x0D, 0x3C, 0x43, 0x4F,
3328                                                 0x4C, 0x4F, 0x55, 0x52, 0x2D,
3329                                                 0x49, 0x43, 0x4F, 0x4E, 0x3E,
3330                                                 0x8E, 0x01, 0x11, 0x84, 0x02,
3331                                                 0x01, 0x01, 0x1E, 0x02, 0x01,
3332                                                 0x02 };
3333
3334 static unsigned char play_tone_411[] = { 0xD0, 0x28, 0x81, 0x03, 0x01, 0x20,
3335                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3336                                                 0x85, 0x10, 0x54, 0x65, 0x78,
3337                                                 0x74, 0x20, 0x41, 0x74, 0x74,
3338                                                 0x72, 0x69, 0x62, 0x75, 0x74,
3339                                                 0x65, 0x20, 0x31, 0x8E, 0x01,
3340                                                 0x11, 0x84, 0x02, 0x01, 0x01,
3341                                                 0xD0, 0x04, 0x00, 0x10, 0x00,
3342                                                 0xB4 };
3343
3344 static unsigned char play_tone_412[] = { 0xD0, 0x22, 0x81, 0x03, 0x01, 0x20,
3345                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3346                                                 0x85, 0x10, 0x54, 0x65, 0x78,
3347                                                 0x74, 0x20, 0x41, 0x74, 0x74,
3348                                                 0x72, 0x69, 0x62, 0x75, 0x74,
3349                                                 0x65, 0x20, 0x32, 0x8E, 0x01,
3350                                                 0x11, 0x84, 0x02, 0x01, 0x01 };
3351
3352 static unsigned char play_tone_421[] = { 0xD0, 0x28, 0x81, 0x03, 0x01, 0x20,
3353                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3354                                                 0x85, 0x10, 0x54, 0x65, 0x78,
3355                                                 0x74, 0x20, 0x41, 0x74, 0x74,
3356                                                 0x72, 0x69, 0x62, 0x75, 0x74,
3357                                                 0x65, 0x20, 0x31, 0x8E, 0x01,
3358                                                 0x11, 0x84, 0x02, 0x01, 0x01,
3359                                                 0xD0, 0x04, 0x00, 0x10, 0x01,
3360                                                 0xB4 };
3361
3362 static unsigned char play_tone_422[] = { 0xD0, 0x22, 0x81, 0x03, 0x01, 0x20,
3363                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3364                                                 0x85, 0x10, 0x54, 0x65, 0x78,
3365                                                 0x74, 0x20, 0x41, 0x74, 0x74,
3366                                                 0x72, 0x69, 0x62, 0x75, 0x74,
3367                                                 0x65, 0x20, 0x32, 0x8E, 0x01,
3368                                                 0x11, 0x84, 0x02, 0x01, 0x01 };
3369
3370 static unsigned char play_tone_431[] = { 0xD0, 0x28, 0x81, 0x03, 0x01, 0x20,
3371                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3372                                                 0x85, 0x10, 0x54, 0x65, 0x78,
3373                                                 0x74, 0x20, 0x41, 0x74, 0x74,
3374                                                 0x72, 0x69, 0x62, 0x75, 0x74,
3375                                                 0x65, 0x20, 0x31, 0x8E, 0x01,
3376                                                 0x11, 0x84, 0x02, 0x01, 0x01,
3377                                                 0xD0, 0x04, 0x00, 0x10, 0x02,
3378                                                 0xB4 };
3379
3380 static unsigned char play_tone_432[] = { 0xD0, 0x22, 0x81, 0x03, 0x01, 0x20,
3381                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3382                                                 0x85, 0x10, 0x54, 0x65, 0x78,
3383                                                 0x74, 0x20, 0x41, 0x74, 0x74,
3384                                                 0x72, 0x69, 0x62, 0x75, 0x74,
3385                                                 0x65, 0x20, 0x32, 0x8E, 0x01,
3386                                                 0x11, 0x84, 0x02, 0x01, 0x01 };
3387
3388 static unsigned char play_tone_441[] = { 0xD0, 0x28, 0x81, 0x03, 0x01, 0x20,
3389                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3390                                                 0x85, 0x10, 0x54, 0x65, 0x78,
3391                                                 0x74, 0x20, 0x41, 0x74, 0x74,
3392                                                 0x72, 0x69, 0x62, 0x75, 0x74,
3393                                                 0x65, 0x20, 0x31, 0x8E, 0x01,
3394                                                 0x11, 0x84, 0x02, 0x01, 0x01,
3395                                                 0xD0, 0x04, 0x00, 0x10, 0x04,
3396                                                 0xB4 };
3397
3398 static unsigned char play_tone_442[] = { 0xD0, 0x28, 0x81, 0x03, 0x01, 0x20,
3399                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3400                                                 0x85, 0x10, 0x54, 0x65, 0x78,
3401                                                 0x74, 0x20, 0x41, 0x74, 0x74,
3402                                                 0x72, 0x69, 0x62, 0x75, 0x74,
3403                                                 0x65, 0x20, 0x32, 0x8E, 0x01,
3404                                                 0x11, 0x84, 0x02, 0x01, 0x01,
3405                                                 0xD0, 0x04, 0x00, 0x10, 0x00,
3406                                                 0xB4 };
3407
3408 static unsigned char play_tone_443[] = { 0xD0, 0x22, 0x81, 0x03, 0x01, 0x20,
3409                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3410                                                 0x85, 0x10, 0x54, 0x65, 0x78,
3411                                                 0x74, 0x20, 0x41, 0x74, 0x74,
3412                                                 0x72, 0x69, 0x62, 0x75, 0x74,
3413                                                 0x65, 0x20, 0x33, 0x8E, 0x01,
3414                                                 0x11, 0x84, 0x02, 0x01, 0x01 };
3415
3416 static unsigned char play_tone_451[] = { 0xD0, 0x28, 0x81, 0x03, 0x01, 0x20,
3417                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3418                                                 0x85, 0x10, 0x54, 0x65, 0x78,
3419                                                 0x74, 0x20, 0x41, 0x74, 0x74,
3420                                                 0x72, 0x69, 0x62, 0x75, 0x74,
3421                                                 0x65, 0x20, 0x31, 0x8E, 0x01,
3422                                                 0x11, 0x84, 0x02, 0x01, 0x01,
3423                                                 0xD0, 0x04, 0x00, 0x10, 0x08,
3424                                                 0xB4 };
3425
3426 static unsigned char play_tone_452[] = { 0xD0, 0x28, 0x81, 0x03, 0x01, 0x20,
3427                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3428                                                 0x85, 0x10, 0x54, 0x65, 0x78,
3429                                                 0x74, 0x20, 0x41, 0x74, 0x74,
3430                                                 0x72, 0x69, 0x62, 0x75, 0x74,
3431                                                 0x65, 0x20, 0x32, 0x8E, 0x01,
3432                                                 0x11, 0x84, 0x02, 0x01, 0x01,
3433                                                 0xD0, 0x04, 0x00, 0x10, 0x00,
3434                                                 0xB4 };
3435
3436 static unsigned char play_tone_453[] = { 0xD0, 0x22, 0x81, 0x03, 0x01, 0x20,
3437                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3438                                                 0x85, 0x10, 0x54, 0x65, 0x78,
3439                                                 0x74, 0x20, 0x41, 0x74, 0x74,
3440                                                 0x72, 0x69, 0x62, 0x75, 0x74,
3441                                                 0x65, 0x20, 0x33, 0x8E, 0x01,
3442                                                 0x11, 0x84, 0x02, 0x01, 0x01 };
3443
3444 static unsigned char play_tone_461[] = { 0xD0, 0x28, 0x81, 0x03, 0x01, 0x20,
3445                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3446                                                 0x85, 0x10, 0x54, 0x65, 0x78,
3447                                                 0x74, 0x20, 0x41, 0x74, 0x74,
3448                                                 0x72, 0x69, 0x62, 0x75, 0x74,
3449                                                 0x65, 0x20, 0x31, 0x8E, 0x01,
3450                                                 0x11, 0x84, 0x02, 0x01, 0x01,
3451                                                 0xD0, 0x04, 0x00, 0x0E, 0x10,
3452                                                 0xB4 };
3453
3454 static unsigned char play_tone_462[] = { 0xD0, 0x28, 0x81, 0x03, 0x01, 0x20,
3455                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3456                                                 0x85, 0x10, 0x54, 0x65, 0x78,
3457                                                 0x74, 0x20, 0x41, 0x74, 0x74,
3458                                                 0x72, 0x69, 0x62, 0x75, 0x74,
3459                                                 0x65, 0x20, 0x32, 0x8E, 0x01,
3460                                                 0x11, 0x84, 0x02, 0x01, 0x01,
3461                                                 0xD0, 0x04, 0x00, 0x10, 0x00,
3462                                                 0xB4 };
3463
3464 static unsigned char play_tone_463[] = { 0xD0, 0x22, 0x81, 0x03, 0x01, 0x20,
3465                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3466                                                 0x85, 0x10, 0x54, 0x65, 0x78,
3467                                                 0x74, 0x20, 0x41, 0x74, 0x74,
3468                                                 0x72, 0x69, 0x62, 0x75, 0x74,
3469                                                 0x65, 0x20, 0x33, 0x8E, 0x01,
3470                                                 0x11, 0x84, 0x02, 0x01, 0x01 };
3471
3472 static unsigned char play_tone_471[] = { 0xD0, 0x28, 0x81, 0x03, 0x01, 0x20,
3473                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3474                                                 0x85, 0x10, 0x54, 0x65, 0x78,
3475                                                 0x74, 0x20, 0x41, 0x74, 0x74,
3476                                                 0x72, 0x69, 0x62, 0x75, 0x74,
3477                                                 0x65, 0x20, 0x31, 0x8E, 0x01,
3478                                                 0x11, 0x84, 0x02, 0x01, 0x01,
3479                                                 0xD0, 0x04, 0x00, 0x0E, 0x20,
3480                                                 0xB4 };
3481
3482 static unsigned char play_tone_472[] = { 0xD0, 0x28, 0x81, 0x03, 0x01, 0x20,
3483                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3484                                                 0x85, 0x10, 0x54, 0x65, 0x78,
3485                                                 0x74, 0x20, 0x41, 0x74, 0x74,
3486                                                 0x72, 0x69, 0x62, 0x75, 0x74,
3487                                                 0x65, 0x20, 0x32, 0x8E, 0x01,
3488                                                 0x11, 0x84, 0x02, 0x01, 0x01,
3489                                                 0xD0, 0x04, 0x00, 0x10, 0x00,
3490                                                 0xB4 };
3491
3492 static unsigned char play_tone_473[] = { 0xD0, 0x22, 0x81, 0x03, 0x01, 0x20,
3493                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3494                                                 0x85, 0x10, 0x54, 0x65, 0x78,
3495                                                 0x74, 0x20, 0x41, 0x74, 0x74,
3496                                                 0x72, 0x69, 0x62, 0x75, 0x74,
3497                                                 0x65, 0x20, 0x33, 0x8E, 0x01,
3498                                                 0x11, 0x84, 0x02, 0x01, 0x01 };
3499
3500 static unsigned char play_tone_481[] = { 0xD0, 0x28, 0x81, 0x03, 0x01, 0x20,
3501                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3502                                                 0x85, 0x10, 0x54, 0x65, 0x78,
3503                                                 0x74, 0x20, 0x41, 0x74, 0x74,
3504                                                 0x72, 0x69, 0x62, 0x75, 0x74,
3505                                                 0x65, 0x20, 0x31, 0x8E, 0x01,
3506                                                 0x11, 0x84, 0x02, 0x01, 0x01,
3507                                                 0xD0, 0x04, 0x00, 0x10, 0x40,
3508                                                 0xB4 };
3509
3510 static unsigned char play_tone_482[] = { 0xD0, 0x28, 0x81, 0x03, 0x01, 0x20,
3511                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3512                                                 0x85, 0x10, 0x54, 0x65, 0x78,
3513                                                 0x74, 0x20, 0x41, 0x74, 0x74,
3514                                                 0x72, 0x69, 0x62, 0x75, 0x74,
3515                                                 0x65, 0x20, 0x32, 0x8E, 0x01,
3516                                                 0x11, 0x84, 0x02, 0x01, 0x01,
3517                                                 0xD0, 0x04, 0x00, 0x10, 0x00,
3518                                                 0xB4 };
3519
3520 static unsigned char play_tone_483[] = { 0xD0, 0x22, 0x81, 0x03, 0x01, 0x20,
3521                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3522                                                 0x85, 0x10, 0x54, 0x65, 0x78,
3523                                                 0x74, 0x20, 0x41, 0x74, 0x74,
3524                                                 0x72, 0x69, 0x62, 0x75, 0x74,
3525                                                 0x65, 0x20, 0x33, 0x8E, 0x01,
3526                                                 0x11, 0x84, 0x02, 0x01, 0x01 };
3527
3528 static unsigned char play_tone_491[] = { 0xD0, 0x28, 0x81, 0x03, 0x01, 0x20,
3529                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3530                                                 0x85, 0x10, 0x54, 0x65, 0x78,
3531                                                 0x74, 0x20, 0x41, 0x74, 0x74,
3532                                                 0x72, 0x69, 0x62, 0x75, 0x74,
3533                                                 0x65, 0x20, 0x31, 0x8E, 0x01,
3534                                                 0x11, 0x84, 0x02, 0x01, 0x01,
3535                                                 0xD0, 0x04, 0x00, 0x10, 0x80,
3536                                                 0xB4 };
3537
3538 static unsigned char play_tone_492[] = { 0xD0, 0x28, 0x81, 0x03, 0x01, 0x20,
3539                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3540                                                 0x85, 0x10, 0x54, 0x65, 0x78,
3541                                                 0x74, 0x20, 0x41, 0x74, 0x74,
3542                                                 0x72, 0x69, 0x62, 0x75, 0x74,
3543                                                 0x65, 0x20, 0x32, 0x8E, 0x01,
3544                                                 0x11, 0x84, 0x02, 0x01, 0x01,
3545                                                 0xD0, 0x04, 0x00, 0x10, 0x00,
3546                                                 0xB4 };
3547
3548 static unsigned char play_tone_493[] = { 0xD0, 0x22, 0x81, 0x03, 0x01, 0x20,
3549                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3550                                                 0x85, 0x10, 0x54, 0x65, 0x78,
3551                                                 0x74, 0x20, 0x41, 0x74, 0x74,
3552                                                 0x72, 0x69, 0x62, 0x75, 0x74,
3553                                                 0x65, 0x20, 0x33, 0x8E, 0x01,
3554                                                 0x11, 0x84, 0x02, 0x01, 0x01 };
3555
3556 static unsigned char play_tone_4101[] = { 0xD0, 0x28, 0x81, 0x03, 0x01, 0x20,
3557                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3558                                                 0x85, 0x10, 0x54, 0x65, 0x78,
3559                                                 0x74, 0x20, 0x41, 0x74, 0x74,
3560                                                 0x72, 0x69, 0x62, 0x75, 0x74,
3561                                                 0x65, 0x20, 0x31, 0x8E, 0x01,
3562                                                 0x11, 0x84, 0x02, 0x01, 0x01,
3563                                                 0xD0, 0x04, 0x00, 0x10, 0x00,
3564                                                 0xB4 };
3565
3566 static unsigned char play_tone_4102[] = { 0xD0, 0x22, 0x81, 0x03, 0x01, 0x20,
3567                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3568                                                 0x85, 0x10, 0x54, 0x65, 0x78,
3569                                                 0x74, 0x20, 0x41, 0x74, 0x74,
3570                                                 0x72, 0x69, 0x62, 0x75, 0x74,
3571                                                 0x65, 0x20, 0x32, 0x8E, 0x01,
3572                                                 0x11, 0x84, 0x02, 0x01, 0x01 };
3573
3574 static unsigned char play_tone_511[] = { 0xD0, 0x17, 0x81, 0x03, 0x01, 0x20,
3575                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3576                                                 0x85, 0x05, 0x80, 0x4E, 0x2D,
3577                                                 0x4E, 0x00, 0x8E, 0x01, 0x11,
3578                                                 0x84, 0x02, 0x01, 0x01 };
3579
3580 static unsigned char play_tone_512[] = { 0xD0, 0x17, 0x81, 0x03, 0x01, 0x20,
3581                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3582                                                 0x85, 0x05, 0x81, 0x02, 0x9C,
3583                                                 0xAD, 0x80, 0x8E, 0x01, 0x11,
3584                                                 0x84, 0x02, 0x01, 0x01 };
3585
3586 static unsigned char play_tone_513[] = { 0xD0, 0x18, 0x81, 0x03, 0x01, 0x20,
3587                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3588                                                 0x85, 0x06, 0x82, 0x02, 0x4E,
3589                                                 0x00, 0xAD, 0x80, 0x8E, 0x01,
3590                                                 0x11, 0x84, 0x02, 0x01, 0x01 };
3591
3592 static unsigned char play_tone_611[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x20,
3593                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3594                                                 0x85, 0x09, 0x80, 0x00, 0x38,
3595                                                 0x00, 0x30, 0x30, 0xEB, 0x00,
3596                                                 0x30, 0x8E, 0x01, 0x01, 0x84,
3597                                                 0x02, 0x01, 0x05 };
3598
3599 static unsigned char play_tone_612[] = { 0xD0, 0x19, 0x81, 0x03, 0x01, 0x20,
3600                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3601                                                 0x85, 0x07, 0x81, 0x04, 0x61,
3602                                                 0x38, 0x31, 0xEB, 0x31, 0x8E,
3603                                                 0x01, 0x01, 0x84, 0x02, 0x01,
3604                                                 0x05 };
3605
3606 static unsigned char play_tone_613[] = { 0xD0, 0x1A, 0x81, 0x03, 0x01, 0x20,
3607                                                 0x00, 0x82, 0x02, 0x81, 0x03,
3608                                                 0x85, 0x08, 0x82, 0x04, 0x30,
3609                                                 0xA0, 0x38, 0x32, 0xCB, 0x32,
3610                                                 0x8E, 0x01, 0x01, 0x84, 0x02,
3611                                                 0x01, 0x05 };
3612
3613 static struct play_tone_test play_tone_data_111 = {
3614         .pdu = play_tone_111,
3615         .pdu_len = sizeof(play_tone_111),
3616         .qualifier = 0x00,
3617         .alpha_id = "Dial Tone",
3618         .tone = STK_TONE_TYPE_DIAL_TONE,
3619         .duration = {
3620                 .unit = STK_DURATION_TYPE_SECONDS,
3621                 .interval = 5
3622         }
3623 };
3624
3625 static struct play_tone_test play_tone_data_112 = {
3626         .pdu = play_tone_112,
3627         .pdu_len = sizeof(play_tone_112),
3628         .qualifier = 0x00,
3629         .alpha_id = "Sub. Busy",
3630         .tone = STK_TONE_TYPE_BUSY_TONE,
3631         .duration = {
3632                 .unit = STK_DURATION_TYPE_SECONDS,
3633                 .interval = 5
3634         }
3635 };
3636
3637 static struct play_tone_test play_tone_data_113 = {
3638         .pdu = play_tone_113,
3639         .pdu_len = sizeof(play_tone_113),
3640         .qualifier = 0x00,
3641         .alpha_id = "Congestion",
3642         .tone = STK_TONE_TYPE_CONGESTION,
3643         .duration = {
3644                 .unit = STK_DURATION_TYPE_SECONDS,
3645                 .interval = 5
3646         }
3647 };
3648
3649 static struct play_tone_test play_tone_data_114 = {
3650         .pdu = play_tone_114,
3651         .pdu_len = sizeof(play_tone_114),
3652         .qualifier = 0x00,
3653         .alpha_id = "RP Ack",
3654         .tone = STK_TONE_TYPE_RP_ACK,
3655         .duration = {
3656                 .unit = STK_DURATION_TYPE_SECONDS,
3657                 .interval = 5
3658         }
3659 };
3660
3661 static struct play_tone_test play_tone_data_115 = {
3662         .pdu = play_tone_115,
3663         .pdu_len = sizeof(play_tone_115),
3664         .qualifier = 0x00,
3665         .alpha_id = "No RP",
3666         .tone = STK_TONE_TYPE_CALL_DROPPED,
3667         .duration = {
3668                 .unit = STK_DURATION_TYPE_SECONDS,
3669                 .interval = 5
3670         }
3671 };
3672
3673 static struct play_tone_test play_tone_data_116 = {
3674         .pdu = play_tone_116,
3675         .pdu_len = sizeof(play_tone_116),
3676         .qualifier = 0x00,
3677         .alpha_id = "Spec Info",
3678         .tone = STK_TONE_TYPE_ERROR,
3679         .duration = {
3680                 .unit = STK_DURATION_TYPE_SECONDS,
3681                 .interval = 5
3682         }
3683 };
3684
3685 static struct play_tone_test play_tone_data_117 = {
3686         .pdu = play_tone_117,
3687         .pdu_len = sizeof(play_tone_117),
3688         .qualifier = 0x00,
3689         .alpha_id = "Call Wait",
3690         .tone = STK_TONE_TYPE_CALL_WAITING,
3691         .duration = {
3692                 .unit = STK_DURATION_TYPE_SECONDS,
3693                 .interval = 5
3694         }
3695 };
3696
3697 static struct play_tone_test play_tone_data_118 = {
3698         .pdu = play_tone_118,
3699         .pdu_len = sizeof(play_tone_118),
3700         .qualifier = 0x00,
3701         .alpha_id = "Ring Tone",
3702         .tone = STK_TONE_TYPE_RINGING,
3703         .duration = {
3704                 .unit = STK_DURATION_TYPE_SECONDS,
3705                 .interval = 5
3706         }
3707 };
3708
3709 static struct play_tone_test play_tone_data_119 = {
3710         .pdu = play_tone_119,
3711         .pdu_len = sizeof(play_tone_119),
3712         .qualifier = 0x00,
3713         .alpha_id = "This command instructs the ME to play an audio tone. "
3714                         "Upon receiving this command, the ME shall check "
3715                         "if it is currently in, or in the process of setting "
3716                         "up (SET-UP message sent to the network, see "
3717                         "GSM\"04.08\"(8)), a speech call. - If the ME I"
3718 };
3719
3720 static struct play_tone_test play_tone_data_1110 = {
3721         .pdu = play_tone_1110,
3722         .pdu_len = sizeof(play_tone_1110),
3723         .qualifier = 0x00,
3724         .alpha_id = "Beep",
3725         .tone = STK_TONE_TYPE_GENERAL_BEEP,
3726         .duration = {
3727                 .unit = STK_DURATION_TYPE_SECONDS,
3728                 .interval = 1
3729         }
3730 };
3731
3732 static struct play_tone_test play_tone_data_1111 = {
3733         .pdu = play_tone_1111,
3734         .pdu_len = sizeof(play_tone_1111),
3735         .qualifier = 0x00,
3736         .alpha_id = "Positive",
3737         .tone = STK_TONE_TYPE_POSITIVE_ACK,
3738         .duration = {
3739                 .unit = STK_DURATION_TYPE_SECONDS,
3740                 .interval = 1
3741         }
3742 };
3743
3744 static struct play_tone_test play_tone_data_1112 = {
3745         .pdu = play_tone_1112,
3746         .pdu_len = sizeof(play_tone_1112),
3747         .qualifier = 0x00,
3748         .alpha_id = "Negative",
3749         .tone = STK_TONE_TYPE_NEGATIVE_ACK,
3750         .duration = {
3751                 .unit = STK_DURATION_TYPE_SECONDS,
3752                 .interval = 1
3753         }
3754 };
3755
3756 static struct play_tone_test play_tone_data_1113 = {
3757         .pdu = play_tone_1113,
3758         .pdu_len = sizeof(play_tone_1113),
3759         .qualifier = 0x00,
3760         .alpha_id = "Quick",
3761         .tone = STK_TONE_TYPE_GENERAL_BEEP,
3762         .duration = {
3763                 .unit = STK_DURATION_TYPE_SECOND_TENTHS,
3764                 .interval = 2
3765         }
3766 };
3767
3768 static struct play_tone_test play_tone_data_1114 = {
3769         .pdu = play_tone_1114,
3770         .pdu_len = sizeof(play_tone_1114),
3771         .qualifier = 0x00,
3772         .alpha_id = "<ABORT>",
3773         .tone = STK_TONE_TYPE_ERROR,
3774         .duration = {
3775                 .unit = STK_DURATION_TYPE_MINUTES,
3776                 .interval = 1
3777         }
3778 };
3779
3780 static struct play_tone_test play_tone_data_1115 = {
3781         .pdu = play_tone_1115,
3782         .pdu_len = sizeof(play_tone_1115),
3783         .qualifier = 0x00
3784 };
3785
3786 static struct play_tone_test play_tone_data_211 = {
3787         .pdu = play_tone_211,
3788         .pdu_len = sizeof(play_tone_211),
3789         .qualifier = 0x00,
3790         .alpha_id = "ЗДРАВСТВУЙТЕ",
3791         .tone = STK_TONE_TYPE_POSITIVE_ACK,
3792         .duration = {
3793                 .unit = STK_DURATION_TYPE_SECONDS,
3794                 .interval = 1
3795         }
3796 };
3797
3798 static struct play_tone_test play_tone_data_212 = {
3799         .pdu = play_tone_212,
3800         .pdu_len = sizeof(play_tone_212),
3801         .qualifier = 0x00,
3802         .alpha_id = "ЗДРАВСТВУЙТЕ",
3803         .tone = STK_TONE_TYPE_POSITIVE_ACK,
3804         .duration = {
3805                 .unit = STK_DURATION_TYPE_SECONDS,
3806                 .interval = 1
3807         }
3808 };
3809
3810 static struct play_tone_test play_tone_data_213 = {
3811         .pdu = play_tone_213,
3812         .pdu_len = sizeof(play_tone_213),
3813         .qualifier = 0x00,
3814         .alpha_id = "ЗДРАВСТВУЙТЕ",
3815         .tone = STK_TONE_TYPE_POSITIVE_ACK,
3816         .duration = {
3817                 .unit = STK_DURATION_TYPE_SECONDS,
3818                 .interval = 1
3819         }
3820 };
3821
3822 static struct play_tone_test play_tone_data_311 = {
3823         .pdu = play_tone_311,
3824         .pdu_len = sizeof(play_tone_311),
3825         .qualifier = 0x00,
3826         .alpha_id = "<BASIC-ICON>",
3827         .tone = STK_TONE_TYPE_POSITIVE_ACK,
3828         .duration = {
3829                 .unit = STK_DURATION_TYPE_SECONDS,
3830                 .interval = 1
3831         },
3832         .icon_id = {
3833             .qualifier = STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY,
3834             .id = 0x01
3835         }
3836 };
3837
3838 static struct play_tone_test play_tone_data_321 = {
3839         .pdu = play_tone_321,
3840         .pdu_len = sizeof(play_tone_321),
3841         .qualifier = 0x00,
3842         .alpha_id = "<BASIC-ICON>",
3843         .tone = STK_TONE_TYPE_POSITIVE_ACK,
3844         .duration = {
3845                 .unit = STK_DURATION_TYPE_SECONDS,
3846                 .interval = 1
3847         },
3848         .icon_id = {
3849             .qualifier = STK_ICON_QUALIFIER_TYPE_NON_SELF_EXPLANATORY,
3850             .id = 0x01
3851         }
3852 };
3853
3854 static struct play_tone_test play_tone_data_331 = {
3855         .pdu = play_tone_331,
3856         .pdu_len = sizeof(play_tone_331),
3857         .qualifier = 0x00,
3858         .alpha_id = "<COLOUR-ICON>",
3859         .tone = STK_TONE_TYPE_POSITIVE_ACK,
3860         .duration = {
3861                 .unit = STK_DURATION_TYPE_SECONDS,
3862                 .interval = 1
3863         },
3864         .icon_id = {
3865             .qualifier = STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY,
3866             .id = 0x02
3867         }
3868 };
3869
3870 static struct play_tone_test play_tone_data_341 = {
3871         .pdu = play_tone_341,
3872         .pdu_len = sizeof(play_tone_341),
3873         .qualifier = 0x00,
3874         .alpha_id = "<COLOUR-ICON>",
3875         .tone = STK_TONE_TYPE_POSITIVE_ACK,
3876         .duration = {
3877                 .unit = STK_DURATION_TYPE_SECONDS,
3878                 .interval = 1
3879         },
3880         .icon_id = {
3881             .qualifier = STK_ICON_QUALIFIER_TYPE_NON_SELF_EXPLANATORY,
3882             .id = 0x02
3883         }
3884 };
3885
3886 static struct play_tone_test play_tone_data_411 = {
3887         .pdu = play_tone_411,
3888         .pdu_len = sizeof(play_tone_411),
3889         .qualifier = 0x00,
3890         .alpha_id = "Text Attribute 1",
3891         .tone = STK_TONE_TYPE_POSITIVE_ACK,
3892         .duration = {
3893                 .unit = STK_DURATION_TYPE_SECONDS,
3894                 .interval = 1
3895         },
3896         .text_attr = {
3897                 .len = 4,
3898                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
3899         },
3900         .html = "<div style=\"text-align: left;\"><span style=\"color: "
3901                 "#347235;background-color: #FFFF00;\">Text Attribute 1</span>"
3902                 "</div>",
3903 };
3904
3905 static struct play_tone_test play_tone_data_412 = {
3906         .pdu = play_tone_412,
3907         .pdu_len = sizeof(play_tone_412),
3908         .qualifier = 0x00,
3909         .alpha_id = "Text Attribute 2",
3910         .tone = STK_TONE_TYPE_POSITIVE_ACK,
3911         .duration = {
3912                 .unit = STK_DURATION_TYPE_SECONDS,
3913                 .interval = 1
3914         }
3915 };
3916
3917 static struct play_tone_test play_tone_data_421 = {
3918         .pdu = play_tone_421,
3919         .pdu_len = sizeof(play_tone_421),
3920         .qualifier = 0x00,
3921         .alpha_id = "Text Attribute 1",
3922         .tone = STK_TONE_TYPE_POSITIVE_ACK,
3923         .duration = {
3924                 .unit = STK_DURATION_TYPE_SECONDS,
3925                 .interval = 1
3926         },
3927         .text_attr = {
3928                 .len = 4,
3929                 .attributes = { 0x00, 0x10, 0x01, 0xB4 }
3930         },
3931         .html = "<div style=\"text-align: center;\"><span style=\"color: "
3932                 "#347235;background-color: #FFFF00;\">Text Attribute 1</span>"
3933                 "</div>",
3934 };
3935
3936 static struct play_tone_test play_tone_data_422 = {
3937         .pdu = play_tone_422,
3938         .pdu_len = sizeof(play_tone_422),
3939         .qualifier = 0x00,
3940         .alpha_id = "Text Attribute 2",
3941         .tone = STK_TONE_TYPE_POSITIVE_ACK,
3942         .duration = {
3943                 .unit = STK_DURATION_TYPE_SECONDS,
3944                 .interval = 1
3945         }
3946 };
3947
3948 static struct play_tone_test play_tone_data_431 = {
3949         .pdu = play_tone_431,
3950         .pdu_len = sizeof(play_tone_431),
3951         .qualifier = 0x00,
3952         .alpha_id = "Text Attribute 1",
3953         .tone = STK_TONE_TYPE_POSITIVE_ACK,
3954         .duration = {
3955                 .unit = STK_DURATION_TYPE_SECONDS,
3956                 .interval = 1
3957         },
3958         .text_attr = {
3959                 .len = 4,
3960                 .attributes = { 0x00, 0x10, 0x02, 0xB4 }
3961         },
3962         .html = "<div style=\"text-align: right;\"><span style=\"color: "
3963                 "#347235;background-color: #FFFF00;\">Text Attribute 1</span>"
3964                 "</div>",
3965 };
3966
3967 static struct play_tone_test play_tone_data_432 = {
3968         .pdu = play_tone_432,
3969         .pdu_len = sizeof(play_tone_432),
3970         .qualifier = 0x00,
3971         .alpha_id = "Text Attribute 2",
3972         .tone = STK_TONE_TYPE_POSITIVE_ACK,
3973         .duration = {
3974                 .unit = STK_DURATION_TYPE_SECONDS,
3975                 .interval = 1
3976         }
3977 };
3978
3979 static struct play_tone_test play_tone_data_441 = {
3980         .pdu = play_tone_441,
3981         .pdu_len = sizeof(play_tone_441),
3982         .qualifier = 0x00,
3983         .alpha_id = "Text Attribute 1",
3984         .tone = STK_TONE_TYPE_POSITIVE_ACK,
3985         .duration = {
3986                 .unit = STK_DURATION_TYPE_SECONDS,
3987                 .interval = 1
3988         },
3989         .text_attr = {
3990                 .len = 4,
3991                 .attributes = { 0x00, 0x10, 0x04, 0xB4 }
3992         },
3993         .html = "<div style=\"text-align: left;\"><span style=\"font-size: "
3994                 "big;color: #347235;background-color: #FFFF00;\">"
3995                 "Text Attribute 1</span></div>",
3996 };
3997
3998 static struct play_tone_test play_tone_data_442 = {
3999         .pdu = play_tone_442,
4000         .pdu_len = sizeof(play_tone_442),
4001         .qualifier = 0x00,
4002         .alpha_id = "Text Attribute 2",
4003         .tone = STK_TONE_TYPE_POSITIVE_ACK,
4004         .duration = {
4005                 .unit = STK_DURATION_TYPE_SECONDS,
4006                 .interval = 1
4007         },
4008         .text_attr = {
4009                 .len = 4,
4010                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
4011         },
4012         .html = "<div style=\"text-align: left;\"><span style=\"color: "
4013                 "#347235;background-color: #FFFF00;\">Text Attribute 2</span>"
4014                 "</div>",
4015 };
4016
4017 static struct play_tone_test play_tone_data_443 = {
4018         .pdu = play_tone_443,
4019         .pdu_len = sizeof(play_tone_443),
4020         .qualifier = 0x00,
4021         .alpha_id = "Text Attribute 3",
4022         .tone = STK_TONE_TYPE_POSITIVE_ACK,
4023         .duration = {
4024                 .unit = STK_DURATION_TYPE_SECONDS,
4025                 .interval = 1
4026         }
4027 };
4028
4029 static struct play_tone_test play_tone_data_451 = {
4030         .pdu = play_tone_451,
4031         .pdu_len = sizeof(play_tone_451),
4032         .qualifier = 0x00,
4033         .alpha_id = "Text Attribute 1",
4034         .tone = STK_TONE_TYPE_POSITIVE_ACK,
4035         .duration = {
4036                 .unit = STK_DURATION_TYPE_SECONDS,
4037                 .interval = 1
4038         },
4039         .text_attr = {
4040                 .len = 4,
4041                 .attributes = { 0x00, 0x10, 0x08, 0xB4 }
4042         },
4043         .html = "<div style=\"text-align: left;\"><span style=\"font-size: "
4044                 "small;color: #347235;background-color: #FFFF00;\">"
4045                 "Text Attribute 1</span></div>",
4046 };
4047
4048 static struct play_tone_test play_tone_data_452 = {
4049         .pdu = play_tone_452,
4050         .pdu_len = sizeof(play_tone_452),
4051         .qualifier = 0x00,
4052         .alpha_id = "Text Attribute 2",
4053         .tone = STK_TONE_TYPE_POSITIVE_ACK,
4054         .duration = {
4055                 .unit = STK_DURATION_TYPE_SECONDS,
4056                 .interval = 1
4057         },
4058         .text_attr = {
4059                 .len = 4,
4060                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
4061         },
4062         .html = "<div style=\"text-align: left;\"><span style=\"color: "
4063                 "#347235;background-color: #FFFF00;\">Text Attribute 2</span>"
4064                 "</div>",
4065 };
4066
4067 static struct play_tone_test play_tone_data_453 = {
4068         .pdu = play_tone_453,
4069         .pdu_len = sizeof(play_tone_453),
4070         .qualifier = 0x00,
4071         .alpha_id = "Text Attribute 3",
4072         .tone = STK_TONE_TYPE_POSITIVE_ACK,
4073         .duration = {
4074                 .unit = STK_DURATION_TYPE_SECONDS,
4075                 .interval = 1
4076         }
4077 };
4078
4079 static struct play_tone_test play_tone_data_461 = {
4080         .pdu = play_tone_461,
4081         .pdu_len = sizeof(play_tone_461),
4082         .qualifier = 0x00,
4083         .alpha_id = "Text Attribute 1",
4084         .tone = STK_TONE_TYPE_POSITIVE_ACK,
4085         .duration = {
4086                 .unit = STK_DURATION_TYPE_SECONDS,
4087                 .interval = 1
4088         },
4089         .text_attr = {
4090                 .len = 4,
4091                 .attributes = { 0x00, 0x0E, 0x10, 0xB4 }
4092         },
4093         .html = "<div style=\"text-align: left;\"><span style=\"font-weight: "
4094                 "bold;color: #347235;background-color: #FFFF00;\">"
4095                 "Text Attribute</span></div> 1"
4096 };
4097
4098 static struct play_tone_test play_tone_data_462 = {
4099         .pdu = play_tone_462,
4100         .pdu_len = sizeof(play_tone_462),
4101         .qualifier = 0x00,
4102         .alpha_id = "Text Attribute 2",
4103         .tone = STK_TONE_TYPE_POSITIVE_ACK,
4104         .duration = {
4105                 .unit = STK_DURATION_TYPE_SECONDS,
4106                 .interval = 1
4107         },
4108         .text_attr = {
4109                 .len = 4,
4110                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
4111         },
4112         .html = "<div style=\"text-align: left;\"><span style=\"color: "
4113                 "#347235;background-color: #FFFF00;\">Text Attribute 2</span>"
4114                 "</div>",
4115 };
4116
4117 static struct play_tone_test play_tone_data_463 = {
4118         .pdu = play_tone_463,
4119         .pdu_len = sizeof(play_tone_463),
4120         .qualifier = 0x00,
4121         .alpha_id = "Text Attribute 3",
4122         .tone = STK_TONE_TYPE_POSITIVE_ACK,
4123         .duration = {
4124                 .unit = STK_DURATION_TYPE_SECONDS,
4125                 .interval = 1
4126         }
4127 };
4128
4129 static struct play_tone_test play_tone_data_471 = {
4130         .pdu = play_tone_471,
4131         .pdu_len = sizeof(play_tone_471),
4132         .qualifier = 0x00,
4133         .alpha_id = "Text Attribute 1",
4134         .tone = STK_TONE_TYPE_POSITIVE_ACK,
4135         .duration = {
4136                 .unit = STK_DURATION_TYPE_SECONDS,
4137                 .interval = 1
4138         },
4139         .text_attr = {
4140                 .len = 4,
4141                 .attributes = { 0x00, 0x0E, 0x20, 0xB4 }
4142         },
4143         .html = "<div style=\"text-align: left;\"><span style=\"font-style: "
4144                 "italic;color: #347235;background-color: #FFFF00;\">"
4145                 "Text Attribute</span></div> 1",
4146 };
4147
4148 static struct play_tone_test play_tone_data_472 = {
4149         .pdu = play_tone_472,
4150         .pdu_len = sizeof(play_tone_472),
4151         .qualifier = 0x00,
4152         .alpha_id = "Text Attribute 2",
4153         .tone = STK_TONE_TYPE_POSITIVE_ACK,
4154         .duration = {
4155                 .unit = STK_DURATION_TYPE_SECONDS,
4156                 .interval = 1
4157         },
4158         .text_attr = {
4159                 .len = 4,
4160                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
4161         },
4162         .html = "<div style=\"text-align: left;\"><span style=\"color: "
4163                 "#347235;background-color: #FFFF00;\">Text Attribute 2</span>"
4164                 "</div>",
4165 };
4166
4167 static struct play_tone_test play_tone_data_473 = {
4168         .pdu = play_tone_473,
4169         .pdu_len = sizeof(play_tone_473),
4170         .qualifier = 0x00,
4171         .alpha_id = "Text Attribute 3",
4172         .tone = STK_TONE_TYPE_POSITIVE_ACK,
4173         .duration = {
4174                 .unit = STK_DURATION_TYPE_SECONDS,
4175                 .interval = 1
4176         }
4177 };
4178
4179 static struct play_tone_test play_tone_data_481 = {
4180         .pdu = play_tone_481,
4181         .pdu_len = sizeof(play_tone_481),
4182         .qualifier = 0x00,
4183         .alpha_id = "Text Attribute 1",
4184         .tone = STK_TONE_TYPE_POSITIVE_ACK,
4185         .duration = {
4186                 .unit = STK_DURATION_TYPE_SECONDS,
4187                 .interval = 1
4188         },
4189         .text_attr = {
4190                 .len = 4,
4191                 .attributes = { 0x00, 0x10, 0x40, 0xB4 }
4192         },
4193         .html = "<div style=\"text-align: left;\"><span "
4194                 "style=\"text-decoration: underline;color: #347235;"
4195                 "background-color: #FFFF00;\">Text Attribute 1</span></div>",
4196 };
4197
4198 static struct play_tone_test play_tone_data_482 = {
4199         .pdu = play_tone_482,
4200         .pdu_len = sizeof(play_tone_482),
4201         .qualifier = 0x00,
4202         .alpha_id = "Text Attribute 2",
4203         .tone = STK_TONE_TYPE_POSITIVE_ACK,
4204         .duration = {
4205                 .unit = STK_DURATION_TYPE_SECONDS,
4206                 .interval = 1
4207         },
4208         .text_attr = {
4209                 .len = 4,
4210                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
4211         },
4212         .html = "<div style=\"text-align: left;\"><span style=\"color: "
4213                 "#347235;background-color: #FFFF00;\">Text Attribute 2</span>"
4214                 "</div>",
4215 };
4216
4217 static struct play_tone_test play_tone_data_483 = {
4218         .pdu = play_tone_483,
4219         .pdu_len = sizeof(play_tone_483),
4220         .qualifier = 0x00,
4221         .alpha_id = "Text Attribute 3",
4222         .tone = STK_TONE_TYPE_POSITIVE_ACK,
4223         .duration = {
4224                 .unit = STK_DURATION_TYPE_SECONDS,
4225                 .interval = 1
4226         }
4227 };
4228
4229 static struct play_tone_test play_tone_data_491 = {
4230         .pdu = play_tone_491,
4231         .pdu_len = sizeof(play_tone_491),
4232         .qualifier = 0x00,
4233         .alpha_id = "Text Attribute 1",
4234         .tone = STK_TONE_TYPE_POSITIVE_ACK,
4235         .duration = {
4236                 .unit = STK_DURATION_TYPE_SECONDS,
4237                 .interval = 1
4238         },
4239         .text_attr = {
4240                 .len = 4,
4241                 .attributes = { 0x00, 0x10, 0x80, 0xB4 }
4242         },
4243         .html = "<div style=\"text-align: left;\"><span "
4244                 "style=\"text-decoration: line-through;color: #347235;"
4245                 "background-color: #FFFF00;\">Text Attribute 1</span></div>",
4246 };
4247
4248 static struct play_tone_test play_tone_data_492 = {
4249         .pdu = play_tone_492,
4250         .pdu_len = sizeof(play_tone_492),
4251         .qualifier = 0x00,
4252         .alpha_id = "Text Attribute 2",
4253         .tone = STK_TONE_TYPE_POSITIVE_ACK,
4254         .duration = {
4255                 .unit = STK_DURATION_TYPE_SECONDS,
4256                 .interval = 1
4257         },
4258         .text_attr = {
4259                 .len = 4,
4260                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
4261         },
4262         .html = "<div style=\"text-align: left;\"><span style=\"color: "
4263                 "#347235;background-color: #FFFF00;\">Text Attribute 2</span>"
4264                 "</div>",
4265 };
4266
4267 static struct play_tone_test play_tone_data_493 = {
4268         .pdu = play_tone_493,
4269         .pdu_len = sizeof(play_tone_493),
4270         .qualifier = 0x00,
4271         .alpha_id = "Text Attribute 3",
4272         .tone = STK_TONE_TYPE_POSITIVE_ACK,
4273         .duration = {
4274                 .unit = STK_DURATION_TYPE_SECONDS,
4275                 .interval = 1
4276         }
4277 };
4278
4279 static struct play_tone_test play_tone_data_4101 = {
4280         .pdu = play_tone_4101,
4281         .pdu_len = sizeof(play_tone_4101),
4282         .qualifier = 0x00,
4283         .alpha_id = "Text Attribute 1",
4284         .tone = STK_TONE_TYPE_POSITIVE_ACK,
4285         .duration = {
4286                 .unit = STK_DURATION_TYPE_SECONDS,
4287                 .interval = 1
4288         },
4289         .text_attr = {
4290                 .len = 4,
4291                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
4292         },
4293         .html = "<div style=\"text-align: left;\"><span style=\"color: "
4294                 "#347235;background-color: #FFFF00;\">Text Attribute 1</span>",
4295 };
4296
4297 static struct play_tone_test play_tone_data_4102 = {
4298         .pdu = play_tone_4102,
4299         .pdu_len = sizeof(play_tone_4102),
4300         .qualifier = 0x00,
4301         .alpha_id = "Text Attribute 2",
4302         .tone = STK_TONE_TYPE_POSITIVE_ACK,
4303         .duration = {
4304                 .unit = STK_DURATION_TYPE_SECONDS,
4305                 .interval = 1
4306         }
4307 };
4308
4309 static struct play_tone_test play_tone_data_511 = {
4310         .pdu = play_tone_511,
4311         .pdu_len = sizeof(play_tone_511),
4312         .qualifier = 0x00,
4313         .alpha_id = "中一",
4314         .tone = STK_TONE_TYPE_POSITIVE_ACK,
4315         .duration = {
4316                 .unit = STK_DURATION_TYPE_SECONDS,
4317                 .interval = 1
4318         }
4319 };
4320
4321 static struct play_tone_test play_tone_data_512 = {
4322         .pdu = play_tone_512,
4323         .pdu_len = sizeof(play_tone_512),
4324         .qualifier = 0x00,
4325         .alpha_id = "中一",
4326         .tone = STK_TONE_TYPE_POSITIVE_ACK,
4327         .duration = {
4328                 .unit = STK_DURATION_TYPE_SECONDS,
4329                 .interval = 1
4330         }
4331 };
4332
4333 static struct play_tone_test play_tone_data_513 = {
4334         .pdu = play_tone_513,
4335         .pdu_len = sizeof(play_tone_513),
4336         .qualifier = 0x00,
4337         .alpha_id = "中一",
4338         .tone = STK_TONE_TYPE_POSITIVE_ACK,
4339         .duration = {
4340                 .unit = STK_DURATION_TYPE_SECONDS,
4341                 .interval = 1
4342         }
4343 };
4344
4345 static struct play_tone_test play_tone_data_611 = {
4346         .pdu = play_tone_611,
4347         .pdu_len = sizeof(play_tone_611),
4348         .qualifier = 0x00,
4349         .alpha_id = "80ル0",
4350         .tone = STK_TONE_TYPE_DIAL_TONE,
4351         .duration = {
4352                 .unit = STK_DURATION_TYPE_SECONDS,
4353                 .interval = 5
4354         }
4355 };
4356
4357 static struct play_tone_test play_tone_data_612 = {
4358         .pdu = play_tone_612,
4359         .pdu_len = sizeof(play_tone_612),
4360         .qualifier = 0x00,
4361         .alpha_id = "81ル1",
4362         .tone = STK_TONE_TYPE_DIAL_TONE,
4363         .duration = {
4364                 .unit = STK_DURATION_TYPE_SECONDS,
4365                 .interval = 5
4366         }
4367 };
4368
4369 static struct play_tone_test play_tone_data_613 = {
4370         .pdu = play_tone_613,
4371         .pdu_len = sizeof(play_tone_613),
4372         .qualifier = 0x00,
4373         .alpha_id = "82ル2",
4374         .tone = STK_TONE_TYPE_DIAL_TONE,
4375         .duration = {
4376                 .unit = STK_DURATION_TYPE_SECONDS,
4377                 .interval = 5
4378         }
4379 };
4380
4381 /* Defined in TS 102.384 Section 27.22.4.5 */
4382 static void test_play_tone(gconstpointer data)
4383 {
4384         const struct play_tone_test *test = data;
4385         struct stk_command *command;
4386
4387         command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
4388
4389         g_assert(command);
4390         g_assert(command->status == STK_PARSE_RESULT_OK);
4391
4392         g_assert(command->number == 1);
4393         g_assert(command->type == STK_COMMAND_TYPE_PLAY_TONE);
4394         g_assert(command->qualifier == test->qualifier);
4395
4396         g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
4397         g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_EARPIECE);
4398
4399         check_alpha_id(command->play_tone.alpha_id, test->alpha_id);
4400         check_tone(command->play_tone.tone, test->tone);
4401         check_duration(&command->play_tone.duration, &test->duration);
4402         check_icon_id(&command->play_tone.icon_id, &test->icon_id);
4403         check_text_attr(&command->play_tone.text_attr, &test->text_attr);
4404         check_text_attr_html(&command->play_tone.text_attr,
4405                                 command->play_tone.alpha_id, test->html);
4406         check_frame_id(&command->play_tone.frame_id, &test->frame_id);
4407
4408         stk_command_free(command);
4409 }
4410
4411 struct poll_interval_test {
4412         const unsigned char *pdu;
4413         unsigned int pdu_len;
4414         unsigned char qualifier;
4415         struct stk_duration duration;
4416 };
4417
4418 static unsigned char poll_interval_111[] = { 0xD0, 0x0D, 0x81, 0x03, 0x01, 0x03,
4419                                                 0x00, 0x82, 0x02, 0x81, 0x82,
4420                                                 0x84, 0x02, 0x01, 0x14 };
4421
4422 static struct poll_interval_test poll_interval_data_111 = {
4423         .pdu = poll_interval_111,
4424         .pdu_len = sizeof(poll_interval_111),
4425         .qualifier = 0x00,
4426         .duration = {
4427                 .unit = STK_DURATION_TYPE_SECONDS,
4428                 .interval = 20
4429         }
4430 };
4431
4432 /* Defined in TS 102.384 Section 27.22.4.6 */
4433 static void test_poll_interval(gconstpointer data)
4434 {
4435         const struct poll_interval_test *test = data;
4436         struct stk_command *command;
4437
4438         command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
4439
4440         g_assert(command);
4441         g_assert(command->status == STK_PARSE_RESULT_OK);
4442
4443         g_assert(command->number == 1);
4444         g_assert(command->type == STK_COMMAND_TYPE_POLL_INTERVAL);
4445         g_assert(command->qualifier == test->qualifier);
4446
4447         g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
4448         g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_TERMINAL);
4449
4450         check_duration(&command->poll_interval.duration, &test->duration);
4451
4452         stk_command_free(command);
4453 }
4454
4455 struct setup_menu_test {
4456         const unsigned char *pdu;
4457         unsigned int pdu_len;
4458         unsigned char qualifier;
4459         char *alpha_id;
4460         struct stk_item items[MAX_ITEM];
4461         struct stk_items_next_action_indicator next_act;
4462         struct stk_icon_id icon_id;
4463         struct stk_item_icon_id_list item_icon_id_list;
4464         struct stk_text_attribute text_attr;
4465         struct stk_item_text_attribute_list item_text_attr_list;
4466         char *html;
4467 };
4468
4469 static unsigned char setup_menu_111[] = { 0xD0, 0x3B, 0x81, 0x03, 0x01, 0x25,
4470                                                 0x00, 0x82, 0x02, 0x81, 0x82,
4471                                                 0x85, 0x0C, 0x54, 0x6F, 0x6F,
4472                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
4473                                                 0x4D, 0x65, 0x6E, 0x75, 0x8F,
4474                                                 0x07, 0x01, 0x49, 0x74, 0x65,
4475                                                 0x6D, 0x20, 0x31, 0x8F, 0x07,
4476                                                 0x02, 0x49, 0x74, 0x65, 0x6D,
4477                                                 0x20, 0x32, 0x8F, 0x07, 0x03,
4478                                                 0x49, 0x74, 0x65, 0x6D, 0x20,
4479                                                 0x33, 0x8F, 0x07, 0x04, 0x49,
4480                                                 0x74, 0x65, 0x6D, 0x20, 0x34 };
4481
4482 static unsigned char setup_menu_112[] = { 0xD0, 0x23, 0x81, 0x03, 0x01, 0x25,
4483                                                 0x00, 0x82, 0x02, 0x81, 0x82,
4484                                                 0x85, 0x0C, 0x54, 0x6F, 0x6F,
4485                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
4486                                                 0x4D, 0x65, 0x6E, 0x75, 0x8F,
4487                                                 0x04, 0x11, 0x4F, 0x6E, 0x65,
4488                                                 0x8F, 0x04, 0x12, 0x54, 0x77,
4489                                                 0x6F };
4490
4491 static unsigned char setup_menu_113[] = { 0xD0, 0x0D, 0x81, 0x03, 0x01, 0x25,
4492                                                 0x00, 0x82, 0x02, 0x81, 0x82,
4493                                                 0x85, 0x00, 0x8F, 0x00 };
4494
4495 static unsigned char setup_menu_121[] = { 0xD0, 0x81, 0xFC, 0x81, 0x03, 0x01,
4496                                                 0x25, 0x00, 0x82, 0x02, 0x81,
4497                                                 0x82, 0x85, 0x0A, 0x4C, 0x61,
4498                                                 0x72, 0x67, 0x65, 0x4D, 0x65,
4499                                                 0x6E, 0x75, 0x31, 0x8F, 0x05,
4500                                                 0x50, 0x5A, 0x65, 0x72, 0x6F,
4501                                                 0x8F, 0x04, 0x4F, 0x4F, 0x6E,
4502                                                 0x65, 0x8F, 0x04, 0x4E, 0x54,
4503                                                 0x77, 0x6F, 0x8F, 0x06, 0x4D,
4504                                                 0x54, 0x68, 0x72, 0x65, 0x65,
4505                                                 0x8F, 0x05, 0x4C, 0x46, 0x6F,
4506                                                 0x75, 0x72, 0x8F, 0x05, 0x4B,
4507                                                 0x46, 0x69, 0x76, 0x65, 0x8F,
4508                                                 0x04, 0x4A, 0x53, 0x69, 0x78,
4509                                                 0x8F, 0x06, 0x49, 0x53, 0x65,
4510                                                 0x76, 0x65, 0x6E, 0x8F, 0x06,
4511                                                 0x48, 0x45, 0x69, 0x67, 0x68,
4512                                                 0x74, 0x8F, 0x05, 0x47, 0x4E,
4513                                                 0x69, 0x6E, 0x65, 0x8F, 0x06,
4514                                                 0x46, 0x41, 0x6C, 0x70, 0x68,
4515                                                 0x61, 0x8F, 0x06, 0x45, 0x42,
4516                                                 0x72, 0x61, 0x76, 0x6F, 0x8F,
4517                                                 0x08, 0x44, 0x43, 0x68, 0x61,
4518                                                 0x72, 0x6C, 0x69, 0x65, 0x8F,
4519                                                 0x06, 0x43, 0x44, 0x65, 0x6C,
4520                                                 0x74, 0x61, 0x8F, 0x05, 0x42,
4521                                                 0x45, 0x63, 0x68, 0x6F, 0x8F,
4522                                                 0x09, 0x41, 0x46, 0x6F, 0x78,
4523                                                 0x2D, 0x74, 0x72, 0x6F, 0x74,
4524                                                 0x8F, 0x06, 0x40, 0x42, 0x6C,
4525                                                 0x61, 0x63, 0x6B, 0x8F, 0x06,
4526                                                 0x3F, 0x42, 0x72, 0x6F, 0x77,
4527                                                 0x6E, 0x8F, 0x04, 0x3E, 0x52,
4528                                                 0x65, 0x64, 0x8F, 0x07, 0x3D,
4529                                                 0x4F, 0x72, 0x61, 0x6E, 0x67,
4530                                                 0x65, 0x8F, 0x07, 0x3C, 0x59,
4531                                                 0x65, 0x6C, 0x6C, 0x6F, 0x77,
4532                                                 0x8F, 0x06, 0x3B, 0x47, 0x72,
4533                                                 0x65, 0x65, 0x6E, 0x8F, 0x05,
4534                                                 0x3A, 0x42, 0x6C, 0x75, 0x65,
4535                                                 0x8F, 0x07, 0x39, 0x56, 0x69,
4536                                                 0x6F, 0x6C, 0x65, 0x74, 0x8F,
4537                                                 0x05, 0x38, 0x47, 0x72, 0x65,
4538                                                 0x79, 0x8F, 0x06, 0x37, 0x57,
4539                                                 0x68, 0x69, 0x74, 0x65, 0x8F,
4540                                                 0x06, 0x36, 0x6D, 0x69, 0x6C,
4541                                                 0x6C, 0x69, 0x8F, 0x06, 0x35,
4542                                                 0x6D, 0x69, 0x63, 0x72, 0x6F,
4543                                                 0x8F, 0x05, 0x34, 0x6E, 0x61,
4544                                                 0x6E, 0x6F, 0x8F, 0x05, 0x33,
4545                                                 0x70, 0x69, 0x63, 0x6F };
4546
4547 static unsigned char setup_menu_122[] = { 0xD0, 0x81, 0xF3, 0x81, 0x03, 0x01,
4548                                                 0x25, 0x00, 0x82, 0x02, 0x81,
4549                                                 0x82, 0x85, 0x0A, 0x4C, 0x61,
4550                                                 0x72, 0x67, 0x65, 0x4D, 0x65,
4551                                                 0x6E, 0x75, 0x32, 0x8F, 0x1D,
4552                                                 0xFF, 0x31, 0x20, 0x43, 0x61,
4553                                                 0x6C, 0x6C, 0x20, 0x46, 0x6F,
4554                                                 0x72, 0x77, 0x61, 0x72, 0x64,
4555                                                 0x20, 0x55, 0x6E, 0x63, 0x6F,
4556                                                 0x6E, 0x64, 0x69, 0x74, 0x69,
4557                                                 0x6F, 0x6E, 0x61, 0x6C, 0x8F,
4558                                                 0x1C, 0xFE, 0x32, 0x20, 0x43,
4559                                                 0x61, 0x6C, 0x6C, 0x20, 0x46,
4560                                                 0x6F, 0x72, 0x77, 0x61, 0x72,
4561                                                 0x64, 0x20, 0x4F, 0x6E, 0x20,
4562                                                 0x55, 0x73, 0x65, 0x72, 0x20,
4563                                                 0x42, 0x75, 0x73, 0x79, 0x8F,
4564                                                 0x1B, 0xFD, 0x33, 0x20, 0x43,
4565                                                 0x61, 0x6C, 0x6C, 0x20, 0x46,
4566                                                 0x6F, 0x72, 0x77, 0x61, 0x72,
4567                                                 0x64, 0x20, 0x4F, 0x6E, 0x20,
4568                                                 0x4E, 0x6F, 0x20, 0x52, 0x65,
4569                                                 0x70, 0x6C, 0x79, 0x8F, 0x25,
4570                                                 0xFC, 0x34, 0x20, 0x43, 0x61,
4571                                                 0x6C, 0x6C, 0x20, 0x46, 0x6F,
4572                                                 0x72, 0x77, 0x61, 0x72, 0x64,
4573                                                 0x20, 0x4F, 0x6E, 0x20, 0x55,
4574                                                 0x73, 0x65, 0x72, 0x20, 0x4E,
4575                                                 0x6F, 0x74, 0x20, 0x52, 0x65,
4576                                                 0x61, 0x63, 0x68, 0x61, 0x62,
4577                                                 0x6C, 0x65, 0x8F, 0x20, 0xFB,
4578                                                 0x35, 0x20, 0x42, 0x61, 0x72,
4579                                                 0x72, 0x69, 0x6E, 0x67, 0x20,
4580                                                 0x4F, 0x66, 0x20, 0x41, 0x6C,
4581                                                 0x6C, 0x20, 0x4F, 0x75, 0x74,
4582                                                 0x67, 0x6F, 0x69, 0x6E, 0x67,
4583                                                 0x20, 0x43, 0x61, 0x6C, 0x6C,
4584                                                 0x73, 0x8F, 0x24, 0xFA, 0x36,
4585                                                 0x20, 0x42, 0x61, 0x72, 0x72,
4586                                                 0x69, 0x6E, 0x67, 0x20, 0x4F,
4587                                                 0x66, 0x20, 0x41, 0x6C, 0x6C,
4588                                                 0x20, 0x4F, 0x75, 0x74, 0x67,
4589                                                 0x6F, 0x69, 0x6E, 0x67, 0x20,
4590                                                 0x49, 0x6E, 0x74, 0x20, 0x43,
4591                                                 0x61, 0x6C, 0x6C, 0x73, 0x8F,
4592                                                 0x13, 0xF9, 0x37, 0x20, 0x43,
4593                                                 0x4C, 0x49, 0x20, 0x50, 0x72,
4594                                                 0x65, 0x73, 0x65, 0x6E, 0x74,
4595                                                 0x61, 0x74, 0x69, 0x6F, 0x6E };
4596
4597 static unsigned char setup_menu_123[] = { 0xD0, 0x81, 0xFC, 0x81, 0x03, 0x01,
4598                                                 0x25, 0x00, 0x82, 0x02, 0x81,
4599                                                 0x82, 0x85, 0x81, 0xEC, 0x54,
4600                                                 0x68, 0x65, 0x20, 0x53, 0x49,
4601                                                 0x4D, 0x20, 0x73, 0x68, 0x61,
4602                                                 0x6C, 0x6C, 0x20, 0x73, 0x75,
4603                                                 0x70, 0x70, 0x6C, 0x79, 0x20,
4604                                                 0x61, 0x20, 0x73, 0x65, 0x74,
4605                                                 0x20, 0x6F, 0x66, 0x20, 0x6D,
4606                                                 0x65, 0x6E, 0x75, 0x20, 0x69,
4607                                                 0x74, 0x65, 0x6D, 0x73, 0x2C,
4608                                                 0x20, 0x77, 0x68, 0x69, 0x63,
4609                                                 0x68, 0x20, 0x73, 0x68, 0x61,
4610                                                 0x6C, 0x6C, 0x20, 0x62, 0x65,
4611                                                 0x20, 0x69, 0x6E, 0x74, 0x65,
4612                                                 0x67, 0x72, 0x61, 0x74, 0x65,
4613                                                 0x64, 0x20, 0x77, 0x69, 0x74,
4614                                                 0x68, 0x20, 0x74, 0x68, 0x65,
4615                                                 0x20, 0x6D, 0x65, 0x6E, 0x75,
4616                                                 0x20, 0x73, 0x79, 0x73, 0x74,
4617                                                 0x65, 0x6D, 0x20, 0x28, 0x6F,
4618                                                 0x72, 0x20, 0x6F, 0x74, 0x68,
4619                                                 0x65, 0x72, 0x20, 0x4D, 0x4D,
4620                                                 0x49, 0x20, 0x66, 0x61, 0x63,
4621                                                 0x69, 0x6C, 0x69, 0x74, 0x79,
4622                                                 0x29, 0x20, 0x69, 0x6E, 0x20,
4623                                                 0x6F, 0x72, 0x64, 0x65, 0x72,
4624                                                 0x20, 0x74, 0x6F, 0x20, 0x67,
4625                                                 0x69, 0x76, 0x65, 0x20, 0x74,
4626                                                 0x68, 0x65, 0x20, 0x75, 0x73,
4627                                                 0x65, 0x72, 0x20, 0x74, 0x68,
4628                                                 0x65, 0x20, 0x6F, 0x70, 0x70,
4629                                                 0x6F, 0x72, 0x74, 0x75, 0x6E,
4630                                                 0x69, 0x74, 0x79, 0x20, 0x74,
4631                                                 0x6F, 0x20, 0x63, 0x68, 0x6F,
4632                                                 0x6F, 0x73, 0x65, 0x20, 0x6F,
4633                                                 0x6E, 0x65, 0x20, 0x6F, 0x66,
4634                                                 0x20, 0x74, 0x68, 0x65, 0x73,
4635                                                 0x65, 0x20, 0x6D, 0x65, 0x6E,
4636                                                 0x75, 0x20, 0x69, 0x74, 0x65,
4637                                                 0x6D, 0x73, 0x20, 0x61, 0x74,
4638                                                 0x20, 0x68, 0x69, 0x73, 0x20,
4639                                                 0x6F, 0x77, 0x6E, 0x20, 0x64,
4640                                                 0x69, 0x73, 0x63, 0x72, 0x65,
4641                                                 0x74, 0x69, 0x6F, 0x6E, 0x2E,
4642                                                 0x20, 0x45, 0x61, 0x63, 0x68,
4643                                                 0x20, 0x69, 0x74, 0x65, 0x6D,
4644                                                 0x20, 0x63, 0x6F, 0x6D, 0x70,
4645                                                 0x72, 0x69, 0x73, 0x65, 0x73,
4646                                                 0x20, 0x61, 0x20, 0x73, 0x68,
4647                                                 0x8F, 0x02, 0x01, 0x59 };
4648
4649 static unsigned char setup_menu_211[] = { 0xD0, 0x3B, 0x81, 0x03, 0x01, 0x25,
4650                                                 0x80, 0x82, 0x02, 0x81, 0x82,
4651                                                 0x85, 0x0C, 0x54, 0x6F, 0x6F,
4652                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
4653                                                 0x4D, 0x65, 0x6E, 0x75, 0x8F,
4654                                                 0x07, 0x01, 0x49, 0x74, 0x65,
4655                                                 0x6D, 0x20, 0x31, 0x8F, 0x07,
4656                                                 0x02, 0x49, 0x74, 0x65, 0x6D,
4657                                                 0x20, 0x32, 0x8F, 0x07, 0x03,
4658                                                 0x49, 0x74, 0x65, 0x6D, 0x20,
4659                                                 0x33, 0x8F, 0x07, 0x04, 0x49,
4660                                                 0x74, 0x65, 0x6D, 0x20, 0x34 };
4661
4662 static unsigned char setup_menu_311[] = { 0xD0, 0x41, 0x81, 0x03, 0x01, 0x25,
4663                                                 0x00, 0x82, 0x02, 0x81, 0x82,
4664                                                 0x85, 0x0C, 0x54, 0x6F, 0x6F,
4665                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
4666                                                 0x4D, 0x65, 0x6E, 0x75, 0x8F,
4667                                                 0x07, 0x01, 0x49, 0x74, 0x65,
4668                                                 0x6D, 0x20, 0x31, 0x8F, 0x07,
4669                                                 0x02, 0x49, 0x74, 0x65, 0x6D,
4670                                                 0x20, 0x32, 0x8F, 0x07, 0x03,
4671                                                 0x49, 0x74, 0x65, 0x6D, 0x20,
4672                                                 0x33, 0x8F, 0x07, 0x04, 0x49,
4673                                                 0x74, 0x65, 0x6D, 0x20, 0x34,
4674                                                 0x18, 0x04, 0x13, 0x10, 0x15,
4675                                                 0x26 };
4676
4677 static unsigned char setup_menu_411[] = { 0xD0, 0x3C, 0x81, 0x03, 0x01, 0x25,
4678                                                 0x00, 0x82, 0x02, 0x81, 0x82,
4679                                                 0x85, 0x0C, 0x54, 0x6F, 0x6F,
4680                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
4681                                                 0x4D, 0x65, 0x6E, 0x75, 0x8F,
4682                                                 0x07, 0x01, 0x49, 0x74, 0x65,
4683                                                 0x6D, 0x20, 0x31, 0x8F, 0x07,
4684                                                 0x02, 0x49, 0x74, 0x65, 0x6D,
4685                                                 0x20, 0x32, 0x8F, 0x07, 0x03,
4686                                                 0x49, 0x74, 0x65, 0x6D, 0x20,
4687                                                 0x33, 0x9E, 0x02, 0x01, 0x01,
4688                                                 0x9F, 0x04, 0x01, 0x05, 0x05,
4689                                                 0x05 };
4690
4691 static unsigned char setup_menu_421[] = { 0xD0, 0x3C, 0x81, 0x03, 0x01, 0x25,
4692                                                 0x00, 0x82, 0x02, 0x81, 0x82,
4693                                                 0x85, 0x0C, 0x54, 0x6F, 0x6F,
4694                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
4695                                                 0x4D, 0x65, 0x6E, 0x75, 0x8F,
4696                                                 0x07, 0x01, 0x49, 0x74, 0x65,
4697                                                 0x6D, 0x20, 0x31, 0x8F, 0x07,
4698                                                 0x02, 0x49, 0x74, 0x65, 0x6D,
4699                                                 0x20, 0x32, 0x8F, 0x07, 0x03,
4700                                                 0x49, 0x74, 0x65, 0x6D, 0x20,
4701                                                 0x33, 0x9E, 0x02, 0x00, 0x01,
4702                                                 0x9F, 0x04, 0x00, 0x05, 0x05,
4703                                                 0x05 };
4704
4705 static unsigned char setup_menu_511[] = { 0xD0, 0x29, 0x81, 0x03, 0x01, 0x25,
4706                                                 0x01, 0x82, 0x02, 0x81, 0x82,
4707                                                 0x85, 0x0C, 0x54, 0x6F, 0x6F,
4708                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
4709                                                 0x4D, 0x65, 0x6E, 0x75, 0x8F,
4710                                                 0x07, 0x01, 0x49, 0x74, 0x65,
4711                                                 0x6D, 0x20, 0x31, 0x8F, 0x07,
4712                                                 0x02, 0x49, 0x74, 0x65, 0x6D,
4713                                                 0x20, 0x32 };
4714
4715 static unsigned char setup_menu_611[] = { 0xD0, 0x48, 0x81, 0x03, 0x01, 0x25,
4716                                                 0x00, 0x82, 0x02, 0x81, 0x82,
4717                                                 0x85, 0x0E, 0x54, 0x6F, 0x6F,
4718                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
4719                                                 0x4D, 0x65, 0x6E, 0x75, 0x20,
4720                                                 0x31, 0x8F, 0x07, 0x01, 0x49,
4721                                                 0x74, 0x65, 0x6D, 0x20, 0x31,
4722                                                 0x8F, 0x07, 0x02, 0x49, 0x74,
4723                                                 0x65, 0x6D, 0x20, 0x32, 0x8F,
4724                                                 0x07, 0x03, 0x49, 0x74, 0x65,
4725                                                 0x6D, 0x20, 0x33, 0xD0, 0x04,
4726                                                 0x00, 0x0E, 0x00, 0xB4, 0xD1,
4727                                                 0x0C, 0x00, 0x06, 0x00, 0xB4,
4728                                                 0x00, 0x06, 0x00, 0xB4, 0x00,
4729                                                 0x06, 0x00, 0xB4 };
4730
4731 static unsigned char setup_menu_612[] = { 0xD0, 0x34, 0x81, 0x03, 0x01, 0x25,
4732                                                 0x00, 0x82, 0x02, 0x81, 0x82,
4733                                                 0x85, 0x0E, 0x54, 0x6F, 0x6F,
4734                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
4735                                                 0x4D, 0x65, 0x6E, 0x75, 0x20,
4736                                                 0x32, 0x8F, 0x07, 0x04, 0x49,
4737                                                 0x74, 0x65, 0x6D, 0x20, 0x34,
4738                                                 0x8F, 0x07, 0x05, 0x49, 0x74,
4739                                                 0x65, 0x6D, 0x20, 0x35, 0x8F,
4740                                                 0x07, 0x06, 0x49, 0x74, 0x65,
4741                                                 0x6D, 0x20, 0x36 };
4742
4743 static unsigned char setup_menu_621[] = { 0xD0, 0x48, 0x81, 0x03, 0x01, 0x25,
4744                                                 0x00, 0x82, 0x02, 0x81, 0x82,
4745                                                 0x85, 0x0E, 0x54, 0x6F, 0x6F,
4746                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
4747                                                 0x4D, 0x65, 0x6E, 0x75, 0x20,
4748                                                 0x31, 0x8F, 0x07, 0x01, 0x49,
4749                                                 0x74, 0x65, 0x6D, 0x20, 0x31,
4750                                                 0x8F, 0x07, 0x02, 0x49, 0x74,
4751                                                 0x65, 0x6D, 0x20, 0x32, 0x8F,
4752                                                 0x07, 0x03, 0x49, 0x74, 0x65,
4753                                                 0x6D, 0x20, 0x33, 0xD0, 0x04,
4754                                                 0x00, 0x0E, 0x01, 0xB4, 0xD1,
4755                                                 0x0C, 0x00, 0x06, 0x01, 0xB4,
4756                                                 0x00, 0x06, 0x01, 0xB4, 0x00,
4757                                                 0x06, 0x01, 0xB4 };
4758
4759 static unsigned char setup_menu_622[] = { 0xD0, 0x34, 0x81, 0x03, 0x01, 0x25,
4760                                                 0x00, 0x82, 0x02, 0x81, 0x82,
4761                                                 0x85, 0x0E, 0x54, 0x6F, 0x6F,
4762                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
4763                                                 0x4D, 0x65, 0x6E, 0x75, 0x20,
4764                                                 0x32, 0x8F, 0x07, 0x04, 0x49,
4765                                                 0x74, 0x65, 0x6D, 0x20, 0x34,
4766                                                 0x8F, 0x07, 0x05, 0x49, 0x74,
4767                                                 0x65, 0x6D, 0x20, 0x35, 0x8F,
4768                                                 0x07, 0x06, 0x49, 0x74, 0x65,
4769                                                 0x6D, 0x20, 0x36 };
4770
4771 static unsigned char setup_menu_631[] = { 0xD0, 0x48, 0x81, 0x03, 0x01, 0x25,
4772                                                 0x00, 0x82, 0x02, 0x81, 0x82,
4773                                                 0x85, 0x0E, 0x54, 0x6F, 0x6F,
4774                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
4775                                                 0x4D, 0x65, 0x6E, 0x75, 0x20,
4776                                                 0x31, 0x8F, 0x07, 0x01, 0x49,
4777                                                 0x74, 0x65, 0x6D, 0x20, 0x31,
4778                                                 0x8F, 0x07, 0x02, 0x49, 0x74,
4779                                                 0x65, 0x6D, 0x20, 0x32, 0x8F,
4780                                                 0x07, 0x03, 0x49, 0x74, 0x65,
4781                                                 0x6D, 0x20, 0x33, 0xD0, 0x04,
4782                                                 0x00, 0x0E, 0x02, 0xB4, 0xD1,
4783                                                 0x0C, 0x00, 0x06, 0x02, 0xB4,
4784                                                 0x00, 0x06, 0x02, 0xB4, 0x00,
4785                                                 0x06, 0x02, 0xB4 };
4786
4787 static unsigned char setup_menu_632[] = { 0xD0, 0x34, 0x81, 0x03, 0x01, 0x25,
4788                                                 0x00, 0x82, 0x02, 0x81, 0x82,
4789                                                 0x85, 0x0E, 0x54, 0x6F, 0x6F,
4790                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
4791                                                 0x4D, 0x65, 0x6E, 0x75, 0x20,
4792                                                 0x32, 0x8F, 0x07, 0x04, 0x49,
4793                                                 0x74, 0x65, 0x6D, 0x20, 0x34,
4794                                                 0x8F, 0x07, 0x05, 0x49, 0x74,
4795                                                 0x65, 0x6D, 0x20, 0x35, 0x8F,
4796                                                 0x07, 0x06, 0x49, 0x74, 0x65,
4797                                                 0x6D, 0x20, 0x36 };
4798
4799 static unsigned char setup_menu_641[] = { 0xD0, 0x48, 0x81, 0x03, 0x01, 0x25,
4800                                                 0x00, 0x82, 0x02, 0x81, 0x82,
4801                                                 0x85, 0x0E, 0x54, 0x6F, 0x6F,
4802                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
4803                                                 0x4D, 0x65, 0x6E, 0x75, 0x20,
4804                                                 0x31, 0x8F, 0x07, 0x01, 0x49,
4805                                                 0x74, 0x65, 0x6D, 0x20, 0x31,
4806                                                 0x8F, 0x07, 0x02, 0x49, 0x74,
4807                                                 0x65, 0x6D, 0x20, 0x32, 0x8F,
4808                                                 0x07, 0x03, 0x49, 0x74, 0x65,
4809                                                 0x6D, 0x20, 0x33, 0xD0, 0x04,
4810                                                 0x00, 0x0E, 0x04, 0xB4, 0xD1,
4811                                                 0x0C, 0x00, 0x06, 0x04, 0xB4,
4812                                                 0x00, 0x06, 0x04, 0xB4, 0x00,
4813                                                 0x06, 0x04, 0xB4 };
4814
4815 static unsigned char setup_menu_642[] = { 0xD0, 0x48, 0x81, 0x03, 0x01, 0x25,
4816                                                 0x00, 0x82, 0x02, 0x81, 0x82,
4817                                                 0x85, 0x0E, 0x54, 0x6F, 0x6F,
4818                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
4819                                                 0x4D, 0x65, 0x6E, 0x75, 0x20,
4820                                                 0x32, 0x8F, 0x07, 0x04, 0x49,
4821                                                 0x74, 0x65, 0x6D, 0x20, 0x34,
4822                                                 0x8F, 0x07, 0x05, 0x49, 0x74,
4823                                                 0x65, 0x6D, 0x20, 0x35, 0x8F,
4824                                                 0x07, 0x06, 0x49, 0x74, 0x65,
4825                                                 0x6D, 0x20, 0x36, 0xD0, 0x04,
4826                                                 0x00, 0x0E, 0x00, 0xB4, 0xD1,
4827                                                 0x0C, 0x00, 0x06, 0x00, 0xB4,
4828                                                 0x00, 0x06, 0x00, 0xB4, 0x00,
4829                                                 0x06, 0x00, 0xB4 };
4830
4831 static unsigned char setup_menu_643[] = { 0xD0, 0x34, 0x81, 0x03, 0x01, 0x25,
4832                                                 0x00, 0x82, 0x02, 0x81, 0x82,
4833                                                 0x85, 0x0E, 0x54, 0x6F, 0x6F,
4834                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
4835                                                 0x4D, 0x65, 0x6E, 0x75, 0x20,
4836                                                 0x33, 0x8F, 0x07, 0x07, 0x49,
4837                                                 0x74, 0x65, 0x6D, 0x20, 0x37,
4838                                                 0x8F, 0x07, 0x08, 0x49, 0x74,
4839                                                 0x65, 0x6D, 0x20, 0x38, 0x8F,
4840                                                 0x07, 0x09, 0x49, 0x74, 0x65,
4841                                                 0x6D, 0x20, 0x39 };
4842
4843 static unsigned char setup_menu_651[] = { 0xD0, 0x48, 0x81, 0x03, 0x01, 0x25,
4844                                                 0x00, 0x82, 0x02, 0x81, 0x82,
4845                                                 0x85, 0x0E, 0x54, 0x6F, 0x6F,
4846                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
4847                                                 0x4D, 0x65, 0x6E, 0x75, 0x20,
4848                                                 0x31, 0x8F, 0x07, 0x01, 0x49,
4849                                                 0x74, 0x65, 0x6D, 0x20, 0x31,
4850                                                 0x8F, 0x07, 0x02, 0x49, 0x74,
4851                                                 0x65, 0x6D, 0x20, 0x32, 0x8F,
4852                                                 0x07, 0x03, 0x49, 0x74, 0x65,
4853                                                 0x6D, 0x20, 0x33, 0xD0, 0x04,
4854                                                 0x00, 0x0E, 0x08, 0xB4, 0xD1,
4855                                                 0x0C, 0x00, 0x06, 0x08, 0xB4,
4856                                                 0x00, 0x06, 0x08, 0xB4, 0x00,
4857                                                 0x06, 0x08, 0xB4 };
4858
4859 static unsigned char setup_menu_661[] = { 0xD0, 0x48, 0x81, 0x03, 0x01, 0x25,
4860                                                 0x00, 0x82, 0x02, 0x81, 0x82,
4861                                                 0x85, 0x0E, 0x54, 0x6F, 0x6F,
4862                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
4863                                                 0x4D, 0x65, 0x6E, 0x75, 0x20,
4864                                                 0x31, 0x8F, 0x07, 0x01, 0x49,
4865                                                 0x74, 0x65, 0x6D, 0x20, 0x31,
4866                                                 0x8F, 0x07, 0x02, 0x49, 0x74,
4867                                                 0x65, 0x6D, 0x20, 0x32, 0x8F,
4868                                                 0x07, 0x03, 0x49, 0x74, 0x65,
4869                                                 0x6D, 0x20, 0x33, 0xD0, 0x04,
4870                                                 0x00, 0x0E, 0x10, 0xB4, 0xD1,
4871                                                 0x0C, 0x00, 0x06, 0x10, 0xB4,
4872                                                 0x00, 0x06, 0x10, 0xB4, 0x00,
4873                                                 0x06, 0x10, 0xB4 };
4874
4875 static unsigned char setup_menu_671[] = { 0xD0, 0x48, 0x81, 0x03, 0x01, 0x25,
4876                                                 0x00, 0x82, 0x02, 0x81, 0x82,
4877                                                 0x85, 0x0E, 0x54, 0x6F, 0x6F,
4878                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
4879                                                 0x4D, 0x65, 0x6E, 0x75, 0x20,
4880                                                 0x31, 0x8F, 0x07, 0x01, 0x49,
4881                                                 0x74, 0x65, 0x6D, 0x20, 0x31,
4882                                                 0x8F, 0x07, 0x02, 0x49, 0x74,
4883                                                 0x65, 0x6D, 0x20, 0x32, 0x8F,
4884                                                 0x07, 0x03, 0x49, 0x74, 0x65,
4885                                                 0x6D, 0x20, 0x33, 0xD0, 0x04,
4886                                                 0x00, 0x0E, 0x20, 0xB4, 0xD1,
4887                                                 0x0C, 0x00, 0x06, 0x20, 0xB4,
4888                                                 0x00, 0x06, 0x20, 0xB4, 0x00,
4889                                                 0x06, 0x20, 0xB4 };
4890
4891 static unsigned char setup_menu_681[] = { 0xD0, 0x48, 0x81, 0x03, 0x01, 0x25,
4892                                                 0x00, 0x82, 0x02, 0x81, 0x82,
4893                                                 0x85, 0x0E, 0x54, 0x6F, 0x6F,
4894                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
4895                                                 0x4D, 0x65, 0x6E, 0x75, 0x20,
4896                                                 0x31, 0x8F, 0x07, 0x01, 0x49,
4897                                                 0x74, 0x65, 0x6D, 0x20, 0x31,
4898                                                 0x8F, 0x07, 0x02, 0x49, 0x74,
4899                                                 0x65, 0x6D, 0x20, 0x32, 0x8F,
4900                                                 0x07, 0x03, 0x49, 0x74, 0x65,
4901                                                 0x6D, 0x20, 0x33, 0xD0, 0x04,
4902                                                 0x00, 0x0E, 0x40, 0xB4, 0xD1,
4903                                                 0x0C, 0x00, 0x06, 0x40, 0xB4,
4904                                                 0x00, 0x06, 0x40, 0xB4, 0x00,
4905                                                 0x06, 0x40, 0xB4 };
4906
4907 static unsigned char setup_menu_691[] = { 0xD0, 0x48, 0x81, 0x03, 0x01, 0x25,
4908                                                 0x00, 0x82, 0x02, 0x81, 0x82,
4909                                                 0x85, 0x0E, 0x54, 0x6F, 0x6F,
4910                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
4911                                                 0x4D, 0x65, 0x6E, 0x75, 0x20,
4912                                                 0x31, 0x8F, 0x07, 0x01, 0x49,
4913                                                 0x74, 0x65, 0x6D, 0x20, 0x31,
4914                                                 0x8F, 0x07, 0x02, 0x49, 0x74,
4915                                                 0x65, 0x6D, 0x20, 0x32, 0x8F,
4916                                                 0x07, 0x03, 0x49, 0x74, 0x65,
4917                                                 0x6D, 0x20, 0x33, 0xD0, 0x04,
4918                                                 0x00, 0x0E, 0x80, 0xB4, 0xD1,
4919                                                 0x0C, 0x00, 0x06, 0x80, 0xB4,
4920                                                 0x00, 0x06, 0x80, 0xB4, 0x00,
4921                                                 0x06, 0x80, 0xB4 };
4922
4923 static unsigned char setup_menu_6101[] = { 0xD0, 0x46, 0x81, 0x03, 0x01, 0x25,
4924                                                 0x00, 0x82, 0x02, 0x81, 0x82,
4925                                                 0x85, 0x0C, 0x54, 0x6F, 0x6F,
4926                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
4927                                                 0x4D, 0x65, 0x6E, 0x75, 0x8F,
4928                                                 0x07, 0x01, 0x49, 0x74, 0x65,
4929                                                 0x6D, 0x20, 0x31, 0x8F, 0x07,
4930                                                 0x02, 0x49, 0x74, 0x65, 0x6D,
4931                                                 0x20, 0x32, 0x8F, 0x07, 0x03,
4932                                                 0x49, 0x74, 0x65, 0x6D, 0x20,
4933                                                 0x33, 0xD0, 0x04, 0x00, 0x0C,
4934                                                 0x00, 0xB4, 0xD1, 0x0C, 0x00,
4935                                                 0x06, 0x00, 0xB4, 0x00, 0x06,
4936                                                 0x00, 0xB4, 0x00, 0x06, 0x00,
4937                                                 0xB4 };
4938
4939 static unsigned char setup_menu_711[] = { 0xD0, 0x81, 0x9C, 0x81, 0x03, 0x01,
4940                                                 0x25, 0x00, 0x82, 0x02, 0x81,
4941                                                 0x82, 0x85, 0x19, 0x80, 0x04,
4942                                                 0x17, 0x04, 0x14, 0x04, 0x20,
4943                                                 0x04, 0x10, 0x04, 0x12, 0x04,
4944                                                 0x21, 0x04, 0x22, 0x04, 0x12,
4945                                                 0x04, 0x23, 0x04, 0x19, 0x04,
4946                                                 0x22, 0x04, 0x15, 0x8F, 0x1C,
4947                                                 0x01, 0x80, 0x04, 0x17, 0x04,
4948                                                 0x14, 0x04, 0x20, 0x04, 0x10,
4949                                                 0x04, 0x12, 0x04, 0x21, 0x04,
4950                                                 0x22, 0x04, 0x12, 0x04, 0x23,
4951                                                 0x04, 0x19, 0x04, 0x22, 0x04,
4952                                                 0x15, 0x00, 0x31, 0x8F, 0x1C,
4953                                                 0x02, 0x80, 0x04, 0x17, 0x04,
4954                                                 0x14, 0x04, 0x20, 0x04, 0x10,
4955                                                 0x04, 0x12, 0x04, 0x21, 0x04,
4956                                                 0x22, 0x04, 0x12, 0x04, 0x23,
4957                                                 0x04, 0x19, 0x04, 0x22, 0x04,
4958                                                 0x15, 0x00, 0x32, 0x8F, 0x1C,
4959                                                 0x03, 0x80, 0x04, 0x17, 0x04,
4960                                                 0x14, 0x04, 0x20, 0x04, 0x10,
4961                                                 0x04, 0x12, 0x04, 0x21, 0x04,
4962                                                 0x22, 0x04, 0x12, 0x04, 0x23,
4963                                                 0x04, 0x19, 0x04, 0x22, 0x04,
4964                                                 0x15, 0x00, 0x33, 0x8F, 0x1C,
4965                                                 0x04, 0x80, 0x04, 0x17, 0x04,
4966                                                 0x14, 0x04, 0x20, 0x04, 0x10,
4967                                                 0x04, 0x12, 0x04, 0x21, 0x04,
4968                                                 0x22, 0x04, 0x12, 0x04, 0x23,
4969                                                 0x04, 0x19, 0x04, 0x22, 0x04,
4970                                                 0x15, 0x00, 0x34 };
4971
4972 static unsigned char setup_menu_712[] = { 0xD0, 0x60, 0x81, 0x03, 0x01, 0x25,
4973                                                 0x00, 0x82, 0x02, 0x81, 0x82,
4974                                                 0x85, 0x19, 0x80, 0x04, 0x17,
4975                                                 0x04, 0x14, 0x04, 0x20, 0x04,
4976                                                 0x10, 0x04, 0x12, 0x04, 0x21,
4977                                                 0x04, 0x22, 0x04, 0x12, 0x04,
4978                                                 0x23, 0x04, 0x19, 0x04, 0x22,
4979                                                 0x04, 0x15, 0x8F, 0x1C, 0x11,
4980                                                 0x80, 0x04, 0x17, 0x04, 0x14,
4981                                                 0x04, 0x20, 0x04, 0x10, 0x04,
4982                                                 0x12, 0x04, 0x21, 0x04, 0x22,
4983                                                 0x04, 0x12, 0x04, 0x23, 0x04,
4984                                                 0x19, 0x04, 0x22, 0x04, 0x15,
4985                                                 0x00, 0x35, 0x8F, 0x1C, 0x12,
4986                                                 0x80, 0x04, 0x17, 0x04, 0x14,
4987                                                 0x04, 0x20, 0x04, 0x10, 0x04,
4988                                                 0x12, 0x04, 0x21, 0x04, 0x22,
4989                                                 0x04, 0x12, 0x04, 0x23, 0x04,
4990                                                 0x19, 0x04, 0x22, 0x04, 0x15,
4991                                                 0x00, 0x36 };
4992
4993 static unsigned char setup_menu_713[] = { 0xD0, 0x0D, 0x81, 0x03, 0x01, 0x25,
4994                                                 0x00, 0x82, 0x02, 0x81, 0x82,
4995                                                 0x85, 0x00, 0x8F, 0x00 };
4996
4997 static unsigned char setup_menu_811[] = { 0xD0, 0x3C, 0x81, 0x03, 0x01, 0x25,
4998                                                 0x00, 0x82, 0x02, 0x81, 0x82,
4999                                                 0x85, 0x09, 0x80, 0x5D, 0xE5,
5000                                                 0x51, 0x77, 0x7B, 0xB1, 0x53,
5001                                                 0x55, 0x8F, 0x08, 0x01, 0x80,
5002                                                 0x98, 0x79, 0x76, 0xEE, 0x4E,
5003                                                 0x00, 0x8F, 0x08, 0x02, 0x80,
5004                                                 0x98, 0x79, 0x76, 0xEE, 0x4E,
5005                                                 0x8C, 0x8F, 0x08, 0x03, 0x80,
5006                                                 0x98, 0x79, 0x76, 0xEE, 0x4E,
5007                                                 0x09, 0x8F, 0x08, 0x04, 0x80,
5008                                                 0x98, 0x79, 0x76, 0xEE, 0x56,
5009                                                 0xDB };
5010
5011 static unsigned char setup_menu_812[] = { 0xD0, 0x20, 0x81, 0x03, 0x01, 0x25,
5012                                                 0x00, 0x82, 0x02, 0x81, 0x82,
5013                                                 0x85, 0x09, 0x80, 0x5D, 0xE5,
5014                                                 0x51, 0x77, 0x7B, 0xB1, 0x53,
5015                                                 0x55, 0x8F, 0x04, 0x11, 0x80,
5016                                                 0x4E, 0x00, 0x8F, 0x04, 0x12,
5017                                                 0x80, 0x4E, 0x8C };
5018
5019 static unsigned char setup_menu_813[] = { 0xD0, 0x0D, 0x81, 0x03, 0x01, 0x25,
5020                                                 0x00, 0x82, 0x02, 0x81, 0x82,
5021                                                 0x85, 0x00, 0x8F, 0x00 };
5022
5023 static unsigned char setup_menu_911[] = { 0xD0, 0x44, 0x81, 0x03, 0x01, 0x25,
5024                                                 0x00, 0x82, 0x02, 0x81, 0x82,
5025                                                 0x85, 0x09, 0x80, 0x00, 0x38,
5026                                                 0x00, 0x30, 0x30, 0xEB, 0x00,
5027                                                 0x30, 0x8F, 0x0A, 0x01, 0x80,
5028                                                 0x00, 0x38, 0x00, 0x30, 0x30,
5029                                                 0xEB, 0x00, 0x31, 0x8F, 0x0A,
5030                                                 0x02, 0x80, 0x00, 0x38, 0x00,
5031                                                 0x30, 0x30, 0xEB, 0x00, 0x32,
5032                                                 0x8F, 0x0A, 0x03, 0x80, 0x00,
5033                                                 0x38, 0x00, 0x30, 0x30, 0xEB,
5034                                                 0x00, 0x33, 0x8F, 0x0A, 0x04,
5035                                                 0x80, 0x00, 0x38, 0x00, 0x30,
5036                                                 0x30, 0xEB, 0x00, 0x34 };
5037
5038 static unsigned char setup_menu_912[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x25,
5039                                                 0x00, 0x82, 0x02, 0x81, 0x82,
5040                                                 0x85, 0x09, 0x80, 0x00, 0x38,
5041                                                 0x00, 0x30, 0x30, 0xEB, 0x00,
5042                                                 0x30, 0x8F, 0x0A, 0x11, 0x80,
5043                                                 0x00, 0x38, 0x00, 0x30, 0x30,
5044                                                 0xEB, 0x00, 0x35, 0x8F, 0x0A,
5045                                                 0x12, 0x80, 0x00, 0x38, 0x00,
5046                                                 0x30, 0x30, 0xEB, 0x00, 0x36 };
5047
5048 static unsigned char setup_menu_913[] = { 0xD0, 0x0D, 0x81, 0x03, 0x01, 0x25,
5049                                                 0x00, 0x82, 0x02, 0x81, 0x82,
5050                                                 0x85, 0x00, 0x8F, 0x00 };
5051
5052 /* Negative case: No item is present */
5053 static unsigned char setup_menu_neg_1[] = { 0xD0, 0x0B, 0x81, 0x03, 0x01, 0x25,
5054                                                 0x00, 0x82, 0x02, 0x81, 0x82,
5055                                                 0x85, 0x00 };
5056
5057 /* Negative case: Two empty items*/
5058 static unsigned char setup_menu_neg_2[] = { 0xD0, 0x0F, 0x81, 0x03, 0x01, 0x25,
5059                                                 0x00, 0x82, 0x02, 0x81, 0x82,
5060                                                 0x85, 0x00, 0x8F, 0x00, 0x8F,
5061                                                 0x00 };
5062
5063 /* Negative case: valid item + empty item */
5064 static unsigned char setup_menu_neg_3[] = { 0xD0, 0x16, 0x81, 0x03, 0x01, 0x25,
5065                                                 0x00, 0x82, 0x02, 0x81, 0x82,
5066                                                 0x85, 0x00, 0x8F, 0x07, 0x01,
5067                                                 0x49, 0x74, 0x65, 0x6D, 0x20,
5068                                                 0x31, 0x8F, 0x00 };
5069
5070 /* Negative case: empty item + valid item */
5071 static unsigned char setup_menu_neg_4[] = { 0xD0, 0x16, 0x81, 0x03, 0x01, 0x25,
5072                                                 0x00, 0x82, 0x02, 0x81, 0x82,
5073                                                 0x85, 0x00, 0x8F, 0x00, 0x8F,
5074                                                 0x07, 0x01, 0x49, 0x74, 0x65,
5075                                                 0x6D, 0x20, 0x31 };
5076
5077 static struct setup_menu_test setup_menu_data_111 = {
5078         .pdu = setup_menu_111,
5079         .pdu_len = sizeof(setup_menu_111),
5080         .qualifier = 0x00,
5081         .alpha_id = "Toolkit Menu",
5082         .items = {
5083                 { .id = 1, .text = "Item 1" },
5084                 { .id = 2, .text = "Item 2" },
5085                 { .id = 3, .text = "Item 3" },
5086                 { .id = 4, .text = "Item 4" },
5087         }
5088 };
5089
5090 static struct setup_menu_test setup_menu_data_112 = {
5091         .pdu = setup_menu_112,
5092         .pdu_len = sizeof(setup_menu_112),
5093         .qualifier = 0x00,
5094         .alpha_id = "Toolkit Menu",
5095         .items = {
5096                 { .id = 0x11, .text = "One" },
5097                 { .id = 0x12, .text = "Two" },
5098         }
5099 };
5100
5101 static struct setup_menu_test setup_menu_data_113 = {
5102         .pdu = setup_menu_113,
5103         .pdu_len = sizeof(setup_menu_113),
5104         .qualifier = 0x00,
5105         .alpha_id = ""
5106 };
5107
5108 static struct setup_menu_test setup_menu_data_121 = {
5109         .pdu = setup_menu_121,
5110         .pdu_len = sizeof(setup_menu_121),
5111         .qualifier = 0x00,
5112         .alpha_id = "LargeMenu1",
5113         .items = {
5114                 { .id = 0x50, .text = "Zero" },
5115                 { .id = 0x4F, .text = "One" },
5116                 { .id = 0x4E, .text = "Two" },
5117                 { .id = 0x4D, .text = "Three" },
5118                 { .id = 0x4C, .text = "Four" },
5119                 { .id = 0x4B, .text = "Five" },
5120                 { .id = 0x4A, .text = "Six" },
5121                 { .id = 0x49, .text = "Seven" },
5122                 { .id = 0x48, .text = "Eight" },
5123                 { .id = 0x47, .text = "Nine" },
5124                 { .id = 0x46, .text = "Alpha" },
5125                 { .id = 0x45, .text = "Bravo" },
5126                 { .id = 0x44, .text = "Charlie" },
5127                 { .id = 0x43, .text = "Delta" },
5128                 { .id = 0x42, .text = "Echo" },
5129                 { .id = 0x41, .text = "Fox-trot" },
5130                 { .id = 0x40, .text = "Black" },
5131                 { .id = 0x3F, .text = "Brown" },
5132                 { .id = 0x3E, .text = "Red" },
5133                 { .id = 0x3D, .text = "Orange" },
5134                 { .id = 0x3C, .text = "Yellow" },
5135                 { .id = 0x3B, .text = "Green" },
5136                 { .id = 0x3A, .text = "Blue" },
5137                 { .id = 0x39, .text = "Violet" },
5138                 { .id = 0x38, .text = "Grey" },
5139                 { .id = 0x37, .text = "White" },
5140                 { .id = 0x36, .text = "milli" },
5141                 { .id = 0x35, .text = "micro" },
5142                 { .id = 0x34, .text = "nano" },
5143                 { .id = 0x33, .text = "pico" },
5144         }
5145 };
5146
5147 static struct setup_menu_test setup_menu_data_122 = {
5148         .pdu = setup_menu_122,
5149         .pdu_len = sizeof(setup_menu_122),
5150         .qualifier = 0x00,
5151         .alpha_id = "LargeMenu2",
5152         .items = {
5153                 { .id = 0xFF, .text = "1 Call Forward Unconditional" },
5154                 { .id = 0xFE, .text = "2 Call Forward On User Busy" },
5155                 { .id = 0xFD, .text = "3 Call Forward On No Reply" },
5156                 { .id = 0xFC, .text = "4 Call Forward On User Not Reachable" },
5157                 { .id = 0xFB, .text = "5 Barring Of All Outgoing Calls" },
5158                 { .id = 0xFA, .text = "6 Barring Of All Outgoing Int Calls" },
5159                 { .id = 0xF9, .text = "7 CLI Presentation" },
5160         }
5161 };
5162
5163 static struct setup_menu_test setup_menu_data_123 = {
5164         .pdu = setup_menu_123,
5165         .pdu_len = sizeof(setup_menu_123),
5166         .qualifier = 0x00,
5167         .alpha_id = "The SIM shall supply a set of menu items, which shall "
5168                         "be integrated with the menu system (or other MMI "
5169                         "facility) in order to give the user the opportunity "
5170                         "to choose one of these menu items at his own "
5171                         "discretion. Each item comprises a sh",
5172         .items = {
5173                 { .id = 0x01, .text = "Y" }
5174         }
5175 };
5176
5177 static struct setup_menu_test setup_menu_data_211 = {
5178         .pdu = setup_menu_211,
5179         .pdu_len = sizeof(setup_menu_211),
5180         .qualifier = 0x80,
5181         .alpha_id = "Toolkit Menu",
5182         .items = {
5183                 { .id = 1, .text = "Item 1" },
5184                 { .id = 2, .text = "Item 2" },
5185                 { .id = 3, .text = "Item 3" },
5186                 { .id = 4, .text = "Item 4" },
5187         }
5188 };
5189
5190 static struct setup_menu_test setup_menu_data_311 = {
5191         .pdu = setup_menu_311,
5192         .pdu_len = sizeof(setup_menu_311),
5193         .qualifier = 0x00,
5194         .alpha_id = "Toolkit Menu",
5195         .items = {
5196                 { .id = 1, .text = "Item 1" },
5197                 { .id = 2, .text = "Item 2" },
5198                 { .id = 3, .text = "Item 3" },
5199                 { .id = 4, .text = "Item 4" },
5200         },
5201         .next_act = {
5202                 .list = { STK_COMMAND_TYPE_SEND_SMS,
5203                                 STK_COMMAND_TYPE_SETUP_CALL,
5204                                 STK_COMMAND_TYPE_LAUNCH_BROWSER,
5205                                 STK_COMMAND_TYPE_PROVIDE_LOCAL_INFO },
5206                 .len = 4
5207         }
5208 };
5209
5210 static struct setup_menu_test setup_menu_data_411 = {
5211         .pdu = setup_menu_411,
5212         .pdu_len = sizeof(setup_menu_411),
5213         .qualifier = 0x00,
5214         .alpha_id = "Toolkit Menu",
5215         .items = {
5216                 { .id = 1, .text = "Item 1" },
5217                 { .id = 2, .text = "Item 2" },
5218                 { .id = 3, .text = "Item 3" },
5219         },
5220         .icon_id = {
5221                 .qualifier = STK_ICON_QUALIFIER_TYPE_NON_SELF_EXPLANATORY,
5222                 .id = 1
5223         },
5224         .item_icon_id_list = {
5225                 .qualifier = STK_ICON_QUALIFIER_TYPE_NON_SELF_EXPLANATORY,
5226                 .list = { 5, 5, 5 },
5227                 .len = 3
5228         }
5229 };
5230
5231 static struct setup_menu_test setup_menu_data_421 = {
5232         .pdu = setup_menu_421,
5233         .pdu_len = sizeof(setup_menu_421),
5234         .qualifier = 0x00,
5235         .alpha_id = "Toolkit Menu",
5236         .items = {
5237                 { .id = 1, .text = "Item 1" },
5238                 { .id = 2, .text = "Item 2" },
5239                 { .id = 3, .text = "Item 3" },
5240         },
5241         .icon_id = {
5242                 .qualifier = STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY,
5243                 .id = 1
5244         },
5245         .item_icon_id_list = {
5246                 .qualifier = STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY,
5247                 .list = { 5, 5, 5 },
5248                 .len = 3
5249         }
5250 };
5251
5252 static struct setup_menu_test setup_menu_data_511 = {
5253         .pdu = setup_menu_511,
5254         .pdu_len = sizeof(setup_menu_511),
5255         .qualifier = 0x01,
5256         .alpha_id = "Toolkit Menu",
5257         .items = {
5258                 { .id = 1, .text = "Item 1" },
5259                 { .id = 2, .text = "Item 2" },
5260         }
5261 };
5262
5263 static struct setup_menu_test setup_menu_data_611 = {
5264         .pdu = setup_menu_611,
5265         .pdu_len = sizeof(setup_menu_611),
5266         .qualifier = 0x00,
5267         .alpha_id = "Toolkit Menu 1",
5268         .items = {
5269                 { .id = 1, .text = "Item 1" },
5270                 { .id = 2, .text = "Item 2" },
5271                 { .id = 3, .text = "Item 3" },
5272         },
5273         .text_attr = {
5274                 .len = 4,
5275                 .attributes = { 0x00, 0x0E, 0x00, 0xB4 }
5276         },
5277         .item_text_attr_list = {
5278                 .len = 12,
5279                 .list = { 0x00, 0x06, 0x00, 0xB4, 0x00, 0x06, 0x00, 0xB4,
5280                                 0x00, 0x06, 0x00, 0xB4 }
5281         },
5282         .html = "<div style=\"text-align: left;\"><span style=\"color: "
5283                 "#347235;background-color: #FFFF00;\">Toolkit Menu 1</span>"
5284                 "</div>",
5285 };
5286
5287 static struct setup_menu_test setup_menu_data_612 = {
5288         .pdu = setup_menu_612,
5289         .pdu_len = sizeof(setup_menu_612),
5290         .qualifier = 0x00,
5291         .alpha_id = "Toolkit Menu 2",
5292         .items = {
5293                 { .id = 4, .text = "Item 4" },
5294                 { .id = 5, .text = "Item 5" },
5295                 { .id = 6, .text = "Item 6" },
5296         }
5297 };
5298
5299 static struct setup_menu_test setup_menu_data_621 = {
5300         .pdu = setup_menu_621,
5301         .pdu_len = sizeof(setup_menu_621),
5302         .qualifier = 0x00,
5303         .alpha_id = "Toolkit Menu 1",
5304         .items = {
5305                 { .id = 1, .text = "Item 1" },
5306                 { .id = 2, .text = "Item 2" },
5307                 { .id = 3, .text = "Item 3" },
5308         },
5309         .text_attr = {
5310                 .len = 4,
5311                 .attributes = { 0x00, 0x0E, 0x01, 0xB4 }
5312         },
5313         .item_text_attr_list = {
5314                 .len = 12,
5315                 .list = { 0x00, 0x06, 0x01, 0xB4, 0x00, 0x06, 0x01, 0xB4,
5316                                 0x00, 0x06, 0x01, 0xB4 }
5317         },
5318         .html = "<div style=\"text-align: center;\"><span style=\"color: "
5319                 "#347235;background-color: #FFFF00;\">Toolkit Menu 1</span>"
5320                 "</div>"
5321 };
5322
5323 static struct setup_menu_test setup_menu_data_622 = {
5324         .pdu = setup_menu_622,
5325         .pdu_len = sizeof(setup_menu_622),
5326         .qualifier = 0x00,
5327         .alpha_id = "Toolkit Menu 2",
5328         .items = {
5329                 { .id = 4, .text = "Item 4" },
5330                 { .id = 5, .text = "Item 5" },
5331                 { .id = 6, .text = "Item 6" },
5332         }
5333 };
5334
5335 /*
5336  * Some problem with data of item #3 in item_text_attr_list
5337  * and the explanation
5338  */
5339 static struct setup_menu_test setup_menu_data_631 = {
5340         .pdu = setup_menu_631,
5341         .pdu_len = sizeof(setup_menu_631),
5342         .qualifier = 0x00,
5343         .alpha_id = "Toolkit Menu 1",
5344         .items = {
5345                 { .id = 1, .text = "Item 1" },
5346                 { .id = 2, .text = "Item 2" },
5347                 { .id = 3, .text = "Item 3" },
5348         },
5349         .text_attr = {
5350                 .len = 4,
5351                 .attributes = { 0x00, 0x0E, 0x02, 0xB4 }
5352         },
5353         .item_text_attr_list = {
5354                 .len = 12,
5355                 .list = { 0x00, 0x06, 0x02, 0xB4, 0x00, 0x06, 0x02, 0xB4,
5356                                 0x00, 0x06, 0x02, 0xB4 }
5357         },
5358         .html = "<div style=\"text-align: right;\"><span style=\"color: "
5359                 "#347235;background-color: #FFFF00;\">Toolkit Menu 1</span>"
5360                 "</div>"
5361 };
5362
5363 static struct setup_menu_test setup_menu_data_632 = {
5364         .pdu = setup_menu_632,
5365         .pdu_len = sizeof(setup_menu_632),
5366         .qualifier = 0x00,
5367         .alpha_id = "Toolkit Menu 2",
5368         .items = {
5369                 { .id = 4, .text = "Item 4" },
5370                 { .id = 5, .text = "Item 5" },
5371                 { .id = 6, .text = "Item 6" },
5372         }
5373 };
5374
5375 static struct setup_menu_test setup_menu_data_641 = {
5376         .pdu = setup_menu_641,
5377         .pdu_len = sizeof(setup_menu_641),
5378         .qualifier = 0x00,
5379         .alpha_id = "Toolkit Menu 1",
5380         .items = {
5381                 { .id = 1, .text = "Item 1" },
5382                 { .id = 2, .text = "Item 2" },
5383                 { .id = 3, .text = "Item 3" },
5384         },
5385         .text_attr = {
5386                 .len = 4,
5387                 .attributes = { 0x00, 0x0E, 0x04, 0xB4 }
5388         },
5389         .item_text_attr_list = {
5390                 .len = 12,
5391                 .list = { 0x00, 0x06, 0x04, 0xB4, 0x00, 0x06, 0x04, 0xB4,
5392                                 0x00, 0x06, 0x04, 0xB4 }
5393         },
5394         .html = "<div style=\"text-align: left;\"><span style=\"font-size: "
5395                 "big;color: #347235;background-color: #FFFF00;\">"
5396                 "Toolkit Menu 1</span></div>",
5397 };
5398
5399 static struct setup_menu_test setup_menu_data_642 = {
5400         .pdu = setup_menu_642,
5401         .pdu_len = sizeof(setup_menu_642),
5402         .qualifier = 0x00,
5403         .alpha_id = "Toolkit Menu 2",
5404         .items = {
5405                 { .id = 4, .text = "Item 4" },
5406                 { .id = 5, .text = "Item 5" },
5407                 { .id = 6, .text = "Item 6" },
5408         },
5409         .text_attr = {
5410                 .len = 4,
5411                 .attributes = { 0x00, 0x0E, 0x00, 0xB4 }
5412         },
5413         .item_text_attr_list = {
5414                 .len = 12,
5415                 .list = { 0x00, 0x06, 0x00, 0xB4, 0x00, 0x06, 0x00, 0xB4,
5416                                 0x00, 0x06, 0x00, 0xB4 }
5417         },
5418         .html = "<div style=\"text-align: left;\"><span style=\"color: "
5419                 "#347235;background-color: #FFFF00;\">Toolkit Menu 2</span>"
5420                 "</div>",
5421 };
5422
5423 static struct setup_menu_test setup_menu_data_643 = {
5424         .pdu = setup_menu_643,
5425         .pdu_len = sizeof(setup_menu_643),
5426         .qualifier = 0x00,
5427         .alpha_id = "Toolkit Menu 3",
5428         .items = {
5429                 { .id = 7, .text = "Item 7" },
5430                 { .id = 8, .text = "Item 8" },
5431                 { .id = 9, .text = "Item 9" },
5432         }
5433 };
5434
5435 static struct setup_menu_test setup_menu_data_651 = {
5436         .pdu = setup_menu_651,
5437         .pdu_len = sizeof(setup_menu_651),
5438         .qualifier = 0x00,
5439         .alpha_id = "Toolkit Menu 1",
5440         .items = {
5441                 { .id = 1, .text = "Item 1" },
5442                 { .id = 2, .text = "Item 2" },
5443                 { .id = 3, .text = "Item 3" },
5444         },
5445         .text_attr = {
5446                 .len = 4,
5447                 .attributes = { 0x00, 0x0E, 0x08, 0xB4 }
5448         },
5449         .item_text_attr_list = {
5450                 .len = 12,
5451                 .list = { 0x00, 0x06, 0x08, 0xB4, 0x00, 0x06, 0x08, 0xB4,
5452                                 0x00, 0x06, 0x08, 0xB4 }
5453         },
5454         .html = "<div style=\"text-align: left;\"><span style=\"font-size: "
5455                 "small;color: #347235;background-color: #FFFF00;\">"
5456                 "Toolkit Menu 1</span></div>",
5457 };
5458
5459 static struct setup_menu_test setup_menu_data_661 = {
5460         .pdu = setup_menu_661,
5461         .pdu_len = sizeof(setup_menu_661),
5462         .qualifier = 0x00,
5463         .alpha_id = "Toolkit Menu 1",
5464         .items = {
5465                 { .id = 1, .text = "Item 1" },
5466                 { .id = 2, .text = "Item 2" },
5467                 { .id = 3, .text = "Item 3" },
5468         },
5469         .text_attr = {
5470                 .len = 4,
5471                 .attributes = { 0x00, 0x0E, 0x10, 0xB4 }
5472         },
5473         .item_text_attr_list = {
5474                 .len = 12,
5475                 .list = { 0x00, 0x06, 0x10, 0xB4, 0x00, 0x06, 0x10, 0xB4,
5476                                 0x00, 0x06, 0x10, 0xB4 }
5477         },
5478         .html = "<div style=\"text-align: left;\"><span style=\"font-weight: "
5479                 "bold;color: #347235;background-color: #FFFF00;\">"
5480                 "Toolkit Menu 1</span></div>",
5481 };
5482
5483 static struct setup_menu_test setup_menu_data_671 = {
5484         .pdu = setup_menu_671,
5485         .pdu_len = sizeof(setup_menu_671),
5486         .qualifier = 0x00,
5487         .alpha_id = "Toolkit Menu 1",
5488         .items = {
5489                 { .id = 1, .text = "Item 1" },
5490                 { .id = 2, .text = "Item 2" },
5491                 { .id = 3, .text = "Item 3" },
5492         },
5493         .text_attr = {
5494                 .len = 4,
5495                 .attributes = { 0x00, 0x0E, 0x20, 0xB4 }
5496         },
5497         .item_text_attr_list = {
5498                 .len = 12,
5499                 .list = { 0x00, 0x06, 0x20, 0xB4, 0x00, 0x06, 0x20, 0xB4,
5500                                 0x00, 0x06, 0x20, 0xB4 }
5501         },
5502         .html = "<div style=\"text-align: left;\"><span style=\"font-style: "
5503                 "italic;color: #347235;background-color: #FFFF00;\">"
5504                 "Toolkit Menu 1</span></div>"
5505 };
5506
5507 static struct setup_menu_test setup_menu_data_681 = {
5508         .pdu = setup_menu_681,
5509         .pdu_len = sizeof(setup_menu_681),
5510         .qualifier = 0x00,
5511         .alpha_id = "Toolkit Menu 1",
5512         .items = {
5513                 { .id = 1, .text = "Item 1" },
5514                 { .id = 2, .text = "Item 2" },
5515                 { .id = 3, .text = "Item 3" },
5516         },
5517         .text_attr = {
5518                 .len = 4,
5519                 .attributes = { 0x00, 0x0E, 0x40, 0xB4 }
5520         },
5521         .item_text_attr_list = {
5522                 .len = 12,
5523                 .list = { 0x00, 0x06, 0x40, 0xB4, 0x00, 0x06, 0x40, 0xB4,
5524                                 0x00, 0x06, 0x40, 0xB4 }
5525         },
5526         .html = "<div style=\"text-align: left;\"><span "
5527                 "style=\"text-decoration: underline;color: #347235;"
5528                 "background-color: #FFFF00;\">Toolkit Menu 1</span></div>",
5529 };
5530
5531 static struct setup_menu_test setup_menu_data_691 = {
5532         .pdu = setup_menu_691,
5533         .pdu_len = sizeof(setup_menu_691),
5534         .qualifier = 0x00,
5535         .alpha_id = "Toolkit Menu 1",
5536         .items = {
5537                 { .id = 1, .text = "Item 1" },
5538                 { .id = 2, .text = "Item 2" },
5539                 { .id = 3, .text = "Item 3" },
5540         },
5541         .text_attr = {
5542                 .len = 4,
5543                 .attributes = { 0x00, 0x0E, 0x80, 0xB4 }
5544         },
5545         .item_text_attr_list = {
5546                 .len = 12,
5547                 .list = { 0x00, 0x06, 0x80, 0xB4, 0x00, 0x06, 0x80, 0xB4,
5548                                 0x00, 0x06, 0x80, 0xB4 }
5549         },
5550         .html = "<div style=\"text-align: left;\"><span "
5551                 "style=\"text-decoration: line-through;color: #347235;"
5552                 "background-color: #FFFF00;\">Toolkit Menu 1</span></div>",
5553 };
5554
5555 static struct setup_menu_test setup_menu_data_6101 = {
5556         .pdu = setup_menu_6101,
5557         .pdu_len = sizeof(setup_menu_6101),
5558         .qualifier = 0x00,
5559         .alpha_id = "Toolkit Menu",
5560         .items = {
5561                 { .id = 1, .text = "Item 1" },
5562                 { .id = 2, .text = "Item 2" },
5563                 { .id = 3, .text = "Item 3" },
5564         },
5565         .text_attr = {
5566                 .len = 4,
5567                 .attributes = { 0x00, 0x0C, 0x00, 0xB4 }
5568         },
5569         .item_text_attr_list = {
5570                 .len = 12,
5571                 .list = { 0x00, 0x06, 0x00, 0xB4, 0x00, 0x06, 0x00, 0xB4,
5572                                 0x00, 0x06, 0x00, 0xB4 }
5573         },
5574         .html = "<div style=\"text-align: left;\"><span style=\"color: "
5575                 "#347235;background-color: #FFFF00;\">Toolkit Menu</span>"
5576                 "</div>",
5577 };
5578
5579 static struct setup_menu_test setup_menu_data_711 = {
5580         .pdu = setup_menu_711,
5581         .pdu_len = sizeof(setup_menu_711),
5582         .qualifier = 0x00,
5583         .alpha_id = "ЗДРАВСТВУЙТЕ",
5584         .items = {
5585                 { .id = 1, .text = "ЗДРАВСТВУЙТЕ1" },
5586                 { .id = 2, .text = "ЗДРАВСТВУЙТЕ2" },
5587                 { .id = 3, .text = "ЗДРАВСТВУЙТЕ3" },
5588                 { .id = 4, .text = "ЗДРАВСТВУЙТЕ4" },
5589         }
5590 };
5591
5592 static struct setup_menu_test setup_menu_data_712 = {
5593         .pdu = setup_menu_712,
5594         .pdu_len = sizeof(setup_menu_712),
5595         .qualifier = 0x00,
5596         .alpha_id = "ЗДРАВСТВУЙТЕ",
5597         .items = {
5598                 { .id = 0x11, .text = "ЗДРАВСТВУЙТЕ5" },
5599                 { .id = 0x12, .text = "ЗДРАВСТВУЙТЕ6" },
5600         }
5601 };
5602
5603 static struct setup_menu_test setup_menu_data_713 = {
5604         .pdu = setup_menu_713,
5605         .pdu_len = sizeof(setup_menu_713),
5606         .qualifier = 0x00,
5607         .alpha_id = ""
5608 };
5609
5610 static struct setup_menu_test setup_menu_data_811 = {
5611         .pdu = setup_menu_811,
5612         .pdu_len = sizeof(setup_menu_811),
5613         .qualifier = 0x00,
5614         .alpha_id = "工具箱单",
5615         .items = {
5616                 { .id = 1, .text = "项目一" },
5617                 { .id = 2, .text = "项目二" },
5618                 { .id = 3, .text = "项目三" },
5619                 { .id = 4, .text = "项目四" },
5620         }
5621 };
5622
5623 static struct setup_menu_test setup_menu_data_812 = {
5624         .pdu = setup_menu_812,
5625         .pdu_len = sizeof(setup_menu_812),
5626         .qualifier = 0x00,
5627         .alpha_id = "工具箱单",
5628         .items = {
5629                 { .id = 0x11, .text = "一" },
5630                 { .id = 0x12, .text = "二" },
5631         }
5632 };
5633
5634 static struct setup_menu_test setup_menu_data_813 = {
5635         .pdu = setup_menu_813,
5636         .pdu_len = sizeof(setup_menu_813),
5637         .qualifier = 0x00,
5638         .alpha_id = ""
5639 };
5640
5641 static struct setup_menu_test setup_menu_data_911 = {
5642         .pdu = setup_menu_911,
5643         .pdu_len = sizeof(setup_menu_911),
5644         .qualifier = 0x00,
5645         .alpha_id = "80ル0",
5646         .items = {
5647                 { .id = 1, .text = "80ル1" },
5648                 { .id = 2, .text = "80ル2" },
5649                 { .id = 3, .text = "80ル3" },
5650                 { .id = 4, .text = "80ル4" },
5651         }
5652 };
5653
5654 static struct setup_menu_test setup_menu_data_912 = {
5655         .pdu = setup_menu_912,
5656         .pdu_len = sizeof(setup_menu_912),
5657         .qualifier = 0x00,
5658         .alpha_id = "80ル0",
5659         .items = {
5660                 { .id = 0x11, .text = "80ル5" },
5661                 { .id = 0x12, .text = "80ル6" },
5662         }
5663 };
5664
5665 static struct setup_menu_test setup_menu_data_913 = {
5666         .pdu = setup_menu_913,
5667         .pdu_len = sizeof(setup_menu_913),
5668         .qualifier = 0x00,
5669         .alpha_id = ""
5670 };
5671
5672 static struct setup_menu_test setup_menu_data_neg_1 = {
5673         .pdu = setup_menu_neg_1,
5674         .pdu_len = sizeof(setup_menu_neg_1)
5675 };
5676
5677 static struct setup_menu_test setup_menu_data_neg_2 = {
5678         .pdu = setup_menu_neg_2,
5679         .pdu_len = sizeof(setup_menu_neg_2)
5680 };
5681
5682 static struct setup_menu_test setup_menu_data_neg_3 = {
5683         .pdu = setup_menu_neg_3,
5684         .pdu_len = sizeof(setup_menu_neg_3)
5685 };
5686
5687 static struct setup_menu_test setup_menu_data_neg_4 = {
5688         .pdu = setup_menu_neg_4,
5689         .pdu_len = sizeof(setup_menu_neg_4)
5690 };
5691
5692 /* Defined in TS 102.384 Section 27.22.4.7 */
5693 static void test_setup_menu(gconstpointer data)
5694 {
5695         const struct setup_menu_test *test = data;
5696         struct stk_command *command;
5697
5698         command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
5699
5700         g_assert(command);
5701         g_assert(command->status == STK_PARSE_RESULT_OK);
5702
5703         g_assert(command->number == 1);
5704         g_assert(command->type == STK_COMMAND_TYPE_SETUP_MENU);
5705         g_assert(command->qualifier == test->qualifier);
5706
5707         g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
5708         g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_TERMINAL);
5709
5710         check_alpha_id(command->setup_menu.alpha_id, test->alpha_id);
5711         check_items(command->setup_menu.items, test->items);
5712         check_items_next_action_indicator(&command->setup_menu.next_act,
5713                                                 &test->next_act);
5714         check_icon_id(&command->setup_menu.icon_id, &test->icon_id);
5715         check_item_icon_id_list(&command->setup_menu.item_icon_id_list,
5716                                         &test->item_icon_id_list);
5717         check_text_attr(&command->setup_menu.text_attr, &test->text_attr);
5718         check_item_text_attribute_list(&command->setup_menu.item_text_attr_list,
5719                                         &test->item_text_attr_list);
5720         check_text_attr_html(&command->setup_menu.text_attr,
5721                                 command->setup_menu.alpha_id, test->html);
5722         stk_command_free(command);
5723 }
5724
5725 static void test_setup_menu_missing_val(gconstpointer data)
5726 {
5727         const struct setup_menu_test *test = data;
5728         struct stk_command *command;
5729
5730         command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
5731
5732         g_assert(command);
5733         g_assert(command->status == STK_PARSE_RESULT_MISSING_VALUE);
5734
5735         stk_command_free(command);
5736 }
5737
5738 static void test_setup_menu_neg(gconstpointer data)
5739 {
5740         const struct setup_menu_test *test = data;
5741         struct stk_command *command;
5742
5743         command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
5744
5745         g_assert(command);
5746         g_assert(command->status == STK_PARSE_RESULT_DATA_NOT_UNDERSTOOD);
5747
5748         stk_command_free(command);
5749 }
5750
5751 struct select_item_test {
5752         const unsigned char *pdu;
5753         unsigned int pdu_len;
5754         unsigned char qualifier;
5755         char *alpha_id;
5756         struct stk_item items[MAX_ITEM];
5757         struct stk_items_next_action_indicator next_act;
5758         unsigned char item_id;
5759         struct stk_icon_id icon_id;
5760         struct stk_item_icon_id_list item_icon_id_list;
5761         struct stk_text_attribute text_attr;
5762         struct stk_item_text_attribute_list item_text_attr_list;
5763         struct stk_frame_id frame_id;
5764         char *html;
5765 };
5766
5767 static unsigned char select_item_111[] = { 0xD0, 0x3D, 0x81, 0x03, 0x01, 0x24,
5768                                                 0x00, 0x82, 0x02, 0x81, 0x82,
5769                                                 0x85, 0x0E, 0x54, 0x6F, 0x6F,
5770                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
5771                                                 0x53, 0x65, 0x6C, 0x65, 0x63,
5772                                                 0x74, 0x8F, 0x07, 0x01, 0x49,
5773                                                 0x74, 0x65, 0x6D, 0x20, 0x31,
5774                                                 0x8F, 0x07, 0x02, 0x49, 0x74,
5775                                                 0x65, 0x6D, 0x20, 0x32, 0x8F,
5776                                                 0x07, 0x03, 0x49, 0x74, 0x65,
5777                                                 0x6D, 0x20, 0x33, 0x8F, 0x07,
5778                                                 0x04, 0x49, 0x74, 0x65, 0x6D,
5779                                                 0x20, 0x34 };
5780
5781 static unsigned char select_item_121[] = { 0xD0, 0x81, 0xFC, 0x81, 0x03, 0x01,
5782                                                 0x24, 0x00, 0x82, 0x02, 0x81,
5783                                                 0x82, 0x85, 0x0A, 0x4C, 0x61,
5784                                                 0x72, 0x67, 0x65, 0x4D, 0x65,
5785                                                 0x6E, 0x75, 0x31, 0x8F, 0x05,
5786                                                 0x50, 0x5A, 0x65, 0x72, 0x6F,
5787                                                 0x8F, 0x04, 0x4F, 0x4F, 0x6E,
5788                                                 0x65, 0x8F, 0x04, 0x4E, 0x54,
5789                                                 0x77, 0x6F, 0x8F, 0x06, 0x4D,
5790                                                 0x54, 0x68, 0x72, 0x65, 0x65,
5791                                                 0x8F, 0x05, 0x4C, 0x46, 0x6F,
5792                                                 0x75, 0x72, 0x8F, 0x05, 0x4B,
5793                                                 0x46, 0x69, 0x76, 0x65, 0x8F,
5794                                                 0x04, 0x4A, 0x53, 0x69, 0x78,
5795                                                 0x8F, 0x06, 0x49, 0x53, 0x65,
5796                                                 0x76, 0x65, 0x6E, 0x8F, 0x06,
5797                                                 0x48, 0x45, 0x69, 0x67, 0x68,
5798                                                 0x74, 0x8F, 0x05, 0x47, 0x4E,
5799                                                 0x69, 0x6E, 0x65, 0x8F, 0x06,
5800                                                 0x46, 0x41, 0x6C, 0x70, 0x68,
5801                                                 0x61, 0x8F, 0x06, 0x45, 0x42,
5802                                                 0x72, 0x61, 0x76, 0x6F, 0x8F,
5803                                                 0x08, 0x44, 0x43, 0x68, 0x61,
5804                                                 0x72, 0x6C, 0x69, 0x65, 0x8F,
5805                                                 0x06, 0x43, 0x44, 0x65, 0x6C,
5806                                                 0x74, 0x61, 0x8F, 0x05, 0x42,
5807                                                 0x45, 0x63, 0x68, 0x6F, 0x8F,
5808                                                 0x09, 0x41, 0x46, 0x6F, 0x78,
5809                                                 0x2D, 0x74, 0x72, 0x6F, 0x74,
5810                                                 0x8F, 0x06, 0x40, 0x42, 0x6C,
5811                                                 0x61, 0x63, 0x6B, 0x8F, 0x06,
5812                                                 0x3F, 0x42, 0x72, 0x6F, 0x77,
5813                                                 0x6E, 0x8F, 0x04, 0x3E, 0x52,
5814                                                 0x65, 0x64, 0x8F, 0x07, 0x3D,
5815                                                 0x4F, 0x72, 0x61, 0x6E, 0x67,
5816                                                 0x65, 0x8F, 0x07, 0x3C, 0x59,
5817                                                 0x65, 0x6C, 0x6C, 0x6F, 0x77,
5818                                                 0x8F, 0x06, 0x3B, 0x47, 0x72,
5819                                                 0x65, 0x65, 0x6E, 0x8F, 0x05,
5820                                                 0x3A, 0x42, 0x6C, 0x75, 0x65,
5821                                                 0x8F, 0x07, 0x39, 0x56, 0x69,
5822                                                 0x6F, 0x6C, 0x65, 0x74, 0x8F,
5823                                                 0x05, 0x38, 0x47, 0x72, 0x65,
5824                                                 0x79, 0x8F, 0x06, 0x37, 0x57,
5825                                                 0x68, 0x69, 0x74, 0x65, 0x8F,
5826                                                 0x06, 0x36, 0x6D, 0x69, 0x6C,
5827                                                 0x6C, 0x69, 0x8F, 0x06, 0x35,
5828                                                 0x6D, 0x69, 0x63, 0x72, 0x6F,
5829                                                 0x8F, 0x05, 0x34, 0x6E, 0x61,
5830                                                 0x6E, 0x6F, 0x8F, 0x05, 0x33,
5831                                                 0x70, 0x69, 0x63, 0x6F };
5832
5833 static unsigned char select_item_131[] = { 0xD0, 0x81, 0xFB, 0x81, 0x03, 0x01,
5834                                                 0x24, 0x00, 0x82, 0x02, 0x81,
5835                                                 0x82, 0x85, 0x0A, 0x4C, 0x61,
5836                                                 0x72, 0x67, 0x65, 0x4D, 0x65,
5837                                                 0x6E, 0x75, 0x32, 0x8F, 0x1E,
5838                                                 0xFF, 0x43, 0x61, 0x6C, 0x6C,
5839                                                 0x20, 0x46, 0x6F, 0x72, 0x77,
5840                                                 0x61, 0x72, 0x64, 0x69, 0x6E,
5841                                                 0x67, 0x20, 0x55, 0x6E, 0x63,
5842                                                 0x6F, 0x6E, 0x64, 0x69, 0x74,
5843                                                 0x69, 0x6F, 0x6E, 0x61, 0x6C,
5844                                                 0x8F, 0x1D, 0xFE, 0x43, 0x61,
5845                                                 0x6C, 0x6C, 0x20, 0x46, 0x6F,
5846                                                 0x72, 0x77, 0x61, 0x72, 0x64,
5847                                                 0x69, 0x6E, 0x67, 0x20, 0x4F,
5848                                                 0x6E, 0x20, 0x55, 0x73, 0x65,
5849                                                 0x72, 0x20, 0x42, 0x75, 0x73,
5850                                                 0x79, 0x8F, 0x1C, 0xFD, 0x43,
5851                                                 0x61, 0x6C, 0x6C, 0x20, 0x46,
5852                                                 0x6F, 0x72, 0x77, 0x61, 0x72,
5853                                                 0x64, 0x69, 0x6E, 0x67, 0x20,
5854                                                 0x4F, 0x6E, 0x20, 0x4E, 0x6F,
5855                                                 0x20, 0x52, 0x65, 0x70, 0x6C,
5856                                                 0x79, 0x8F, 0x26, 0xFC, 0x43,
5857                                                 0x61, 0x6C, 0x6C, 0x20, 0x46,
5858                                                 0x6F, 0x72, 0x77, 0x61, 0x72,
5859                                                 0x64, 0x69, 0x6E, 0x67, 0x20,
5860                                                 0x4F, 0x6E, 0x20, 0x55, 0x73,
5861                                                 0x65, 0x72, 0x20, 0x4E, 0x6F,
5862                                                 0x74, 0x20, 0x52, 0x65, 0x61,
5863                                                 0x63, 0x68, 0x61, 0x62, 0x6C,
5864                                                 0x65, 0x8F, 0x1E, 0xFB, 0x42,
5865                                                 0x61, 0x72, 0x72, 0x69, 0x6E,
5866                                                 0x67, 0x20, 0x4F, 0x66, 0x20,
5867                                                 0x41, 0x6C, 0x6C, 0x20, 0x4F,
5868                                                 0x75, 0x74, 0x67, 0x6F, 0x69,
5869                                                 0x6E, 0x67, 0x20, 0x43, 0x61,
5870                                                 0x6C, 0x6C, 0x73, 0x8F, 0x2C,
5871                                                 0xFA, 0x42, 0x61, 0x72, 0x72,
5872                                                 0x69, 0x6E, 0x67, 0x20, 0x4F,
5873                                                 0x66, 0x20, 0x41, 0x6C, 0x6C,
5874                                                 0x20, 0x4F, 0x75, 0x74, 0x67,
5875                                                 0x6F, 0x69, 0x6E, 0x67, 0x20,
5876                                                 0x49, 0x6E, 0x74, 0x65, 0x72,
5877                                                 0x6E, 0x61, 0x74, 0x69, 0x6F,
5878                                                 0x6E, 0x61, 0x6C, 0x20, 0x43,
5879                                                 0x61, 0x6C, 0x6C, 0x73, 0x8F,
5880                                                 0x11, 0xF9, 0x43, 0x4C, 0x49,
5881                                                 0x20, 0x50, 0x72, 0x65, 0x73,
5882                                                 0x65, 0x6E, 0x74, 0x61, 0x74,
5883                                                 0x69, 0x6F, 0x6E };
5884
5885 static unsigned char select_item_141[] = { 0xD0, 0x22, 0x81, 0x03, 0x01, 0x24,
5886                                                 0x00, 0x82, 0x02, 0x81, 0x82,
5887                                                 0x85, 0x0B, 0x53, 0x65, 0x6C,
5888                                                 0x65, 0x63, 0x74, 0x20, 0x49,
5889                                                 0x74, 0x65, 0x6D, 0x8F, 0x04,
5890                                                 0x11, 0x4F, 0x6E, 0x65, 0x8F,
5891                                                 0x04, 0x12, 0x54, 0x77, 0x6F };
5892
5893 static unsigned char select_item_151[] = { 0xD0, 0x81, 0xFD, 0x81, 0x03, 0x01,
5894                                                 0x24, 0x00, 0x82, 0x02, 0x81,
5895                                                 0x82, 0x85, 0x81, 0xED, 0x54,
5896                                                 0x68, 0x65, 0x20, 0x53, 0x49,
5897                                                 0x4D, 0x20, 0x73, 0x68, 0x61,
5898                                                 0x6C, 0x6C, 0x20, 0x73, 0x75,
5899                                                 0x70, 0x70, 0x6C, 0x79, 0x20,
5900                                                 0x61, 0x20, 0x73, 0x65, 0x74,
5901                                                 0x20, 0x6F, 0x66, 0x20, 0x69,
5902                                                 0x74, 0x65, 0x6D, 0x73, 0x20,
5903                                                 0x66, 0x72, 0x6F, 0x6D, 0x20,
5904                                                 0x77, 0x68, 0x69, 0x63, 0x68,
5905                                                 0x20, 0x74, 0x68, 0x65, 0x20,
5906                                                 0x75, 0x73, 0x65, 0x72, 0x20,
5907                                                 0x6D, 0x61, 0x79, 0x20, 0x63,
5908                                                 0x68, 0x6F, 0x6F, 0x73, 0x65,
5909                                                 0x20, 0x6F, 0x6E, 0x65, 0x2E,
5910                                                 0x20, 0x45, 0x61, 0x63, 0x68,
5911                                                 0x20, 0x69, 0x74, 0x65, 0x6D,
5912                                                 0x20, 0x63, 0x6F, 0x6D, 0x70,
5913                                                 0x72, 0x69, 0x73, 0x65, 0x73,
5914                                                 0x20, 0x61, 0x20, 0x73, 0x68,
5915                                                 0x6F, 0x72, 0x74, 0x20, 0x69,
5916                                                 0x64, 0x65, 0x6E, 0x74, 0x69,
5917                                                 0x66, 0x69, 0x65, 0x72, 0x20,
5918                                                 0x28, 0x75, 0x73, 0x65, 0x64,
5919                                                 0x20, 0x74, 0x6F, 0x20, 0x69,
5920                                                 0x6E, 0x64, 0x69, 0x63, 0x61,
5921                                                 0x74, 0x65, 0x20, 0x74, 0x68,
5922                                                 0x65, 0x20, 0x73, 0x65, 0x6C,
5923                                                 0x65, 0x63, 0x74, 0x69, 0x6F,
5924                                                 0x6E, 0x29, 0x20, 0x61, 0x6E,
5925                                                 0x64, 0x20, 0x61, 0x20, 0x74,
5926                                                 0x65, 0x78, 0x74, 0x20, 0x73,
5927                                                 0x74, 0x72, 0x69, 0x6E, 0x67,
5928                                                 0x2E, 0x20, 0x4F, 0x70, 0x74,
5929                                                 0x69, 0x6F, 0x6E, 0x61, 0x6C,
5930                                                 0x6C, 0x79, 0x20, 0x74, 0x68,
5931                                                 0x65, 0x20, 0x53, 0x49, 0x4D,
5932                                                 0x20, 0x6D, 0x61, 0x79, 0x20,
5933                                                 0x69, 0x6E, 0x63, 0x6C, 0x75,
5934                                                 0x64, 0x65, 0x20, 0x61, 0x6E,
5935                                                 0x20, 0x61, 0x6C, 0x70, 0x68,
5936                                                 0x61, 0x20, 0x69, 0x64, 0x65,
5937                                                 0x6E, 0x74, 0x69, 0x66, 0x69,
5938                                                 0x65, 0x72, 0x2E, 0x20, 0x54,
5939                                                 0x68, 0x65, 0x20, 0x61, 0x6C,
5940                                                 0x70, 0x68, 0x61, 0x20, 0x69,
5941                                                 0x64, 0x65, 0x6E, 0x74, 0x69,
5942                                                 0x66, 0x69, 0x65, 0x72, 0x20,
5943                                                 0x69, 0x8F, 0x02, 0x01, 0x59 };
5944
5945 static unsigned char select_item_161[] = { 0xD0, 0x81, 0xF3, 0x81, 0x03, 0x01,
5946                                                 0x24, 0x00, 0x82, 0x02, 0x81,
5947                                                 0x82, 0x85, 0x0A, 0x30, 0x4C,
5948                                                 0x61, 0x72, 0x67, 0x65, 0x4D,
5949                                                 0x65, 0x6E, 0x75, 0x8F, 0x1D,
5950                                                 0xFF, 0x31, 0x20, 0x43, 0x61,
5951                                                 0x6C, 0x6C, 0x20, 0x46, 0x6F,
5952                                                 0x72, 0x77, 0x61, 0x72, 0x64,
5953                                                 0x20, 0x55, 0x6E, 0x63, 0x6F,
5954                                                 0x6E, 0x64, 0x69, 0x74, 0x69,
5955                                                 0x6F, 0x6E, 0x61, 0x6C, 0x8F,
5956                                                 0x1C, 0xFE, 0x32, 0x20, 0x43,
5957                                                 0x61, 0x6C, 0x6C, 0x20, 0x46,
5958                                                 0x6F, 0x72, 0x77, 0x61, 0x72,
5959                                                 0x64, 0x20, 0x4F, 0x6E, 0x20,
5960                                                 0x55, 0x73, 0x65, 0x72, 0x20,
5961                                                 0x42, 0x75, 0x73, 0x79, 0x8F,
5962                                                 0x1B, 0xFD, 0x33, 0x20, 0x43,
5963                                                 0x61, 0x6C, 0x6C, 0x20, 0x46,
5964                                                 0x6F, 0x72, 0x77, 0x61, 0x72,
5965                                                 0x64, 0x20, 0x4F, 0x6E, 0x20,
5966                                                 0x4E, 0x6F, 0x20, 0x52, 0x65,
5967                                                 0x70, 0x6C, 0x79, 0x8F, 0x25,
5968                                                 0xFC, 0x34, 0x20, 0x43, 0x61,
5969                                                 0x6C, 0x6C, 0x20, 0x46, 0x6F,
5970                                                 0x72, 0x77, 0x61, 0x72, 0x64,
5971                                                 0x20, 0x4F, 0x6E, 0x20, 0x55,
5972                                                 0x73, 0x65, 0x72, 0x20, 0x4E,
5973                                                 0x6F, 0x74, 0x20, 0x52, 0x65,
5974                                                 0x61, 0x63, 0x68, 0x61, 0x62,
5975                                                 0x6C, 0x65, 0x8F, 0x20, 0xFB,
5976                                                 0x35, 0x20, 0x42, 0x61, 0x72,
5977                                                 0x72, 0x69, 0x6E, 0x67, 0x20,
5978                                                 0x4F, 0x66, 0x20, 0x41, 0x6C,
5979                                                 0x6C, 0x20, 0x4F, 0x75, 0x74,
5980                                                 0x67, 0x6F, 0x69, 0x6E, 0x67,
5981                                                 0x20, 0x43, 0x61, 0x6C, 0x6C,
5982                                                 0x73, 0x8F, 0x24, 0xFA, 0x36,
5983                                                 0x20, 0x42, 0x61, 0x72, 0x72,
5984                                                 0x69, 0x6E, 0x67, 0x20, 0x4F,
5985                                                 0x66, 0x20, 0x41, 0x6C, 0x6C,
5986                                                 0x20, 0x4F, 0x75, 0x74, 0x67,
5987                                                 0x6F, 0x69, 0x6E, 0x67, 0x20,
5988                                                 0x49, 0x6E, 0x74, 0x20, 0x43,
5989                                                 0x61, 0x6C, 0x6C, 0x73, 0x8F,
5990                                                 0x13, 0xF9, 0x37, 0x20, 0x43,
5991                                                 0x4C, 0x49, 0x20, 0x50, 0x72,
5992                                                 0x65, 0x73, 0x65, 0x6E, 0x74,
5993                                                 0x61, 0x74, 0x69, 0x6F, 0x6E };
5994
5995 static unsigned char select_item_211[] = { 0xD0, 0x39, 0x81, 0x03, 0x01, 0x24,
5996                                                 0x00, 0x82, 0x02, 0x81, 0x82,
5997                                                 0x85, 0x0E, 0x54, 0x6F, 0x6F,
5998                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
5999                                                 0x53, 0x65, 0x6C, 0x65, 0x63,
6000                                                 0x74, 0x8F, 0x07, 0x01, 0x49,
6001                                                 0x74, 0x65, 0x6D, 0x20, 0x31,
6002                                                 0x8F, 0x07, 0x02, 0x49, 0x74,
6003                                                 0x65, 0x6D, 0x20, 0x32, 0x8F,
6004                                                 0x07, 0x03, 0x49, 0x74, 0x65,
6005                                                 0x6D, 0x20, 0x33, 0x18, 0x03,
6006                                                 0x13, 0x10, 0x26 };
6007
6008 static unsigned char select_item_311[] = { 0xD0, 0x37, 0x81, 0x03, 0x01, 0x24,
6009                                                 0x00, 0x82, 0x02, 0x81, 0x82,
6010                                                 0x85, 0x0E, 0x54, 0x6F, 0x6F,
6011                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
6012                                                 0x53, 0x65, 0x6C, 0x65, 0x63,
6013                                                 0x74, 0x8F, 0x07, 0x01, 0x49,
6014                                                 0x74, 0x65, 0x6D, 0x20, 0x31,
6015                                                 0x8F, 0x07, 0x02, 0x49, 0x74,
6016                                                 0x65, 0x6D, 0x20, 0x32, 0x8F,
6017                                                 0x07, 0x03, 0x49, 0x74, 0x65,
6018                                                 0x6D, 0x20, 0x33, 0x90, 0x01,
6019                                                 0x02 };
6020
6021 static unsigned char select_item_411[] = { 0xD0, 0x34, 0x81, 0x03, 0x01, 0x24,
6022                                                 0x80, 0x82, 0x02, 0x81, 0x82,
6023                                                 0x85, 0x0E, 0x54, 0x6F, 0x6F,
6024                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
6025                                                 0x53, 0x65, 0x6C, 0x65, 0x63,
6026                                                 0x74, 0x8F, 0x07, 0x01, 0x49,
6027                                                 0x74, 0x65, 0x6D, 0x20, 0x31,
6028                                                 0x8F, 0x07, 0x02, 0x49, 0x74,
6029                                                 0x65, 0x6D, 0x20, 0x32, 0x8F,
6030                                                 0x07, 0x03, 0x49, 0x74, 0x65,
6031                                                 0x6D, 0x20, 0x33 };
6032
6033 static unsigned char select_item_511[] = { 0xD0, 0x3E, 0x81, 0x03, 0x01, 0x24,
6034                                                 0x00, 0x82, 0x02, 0x81, 0x82,
6035                                                 0x85, 0x0E, 0x54, 0x6F, 0x6F,
6036                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
6037                                                 0x53, 0x65, 0x6C, 0x65, 0x63,
6038                                                 0x74, 0x8F, 0x07, 0x01, 0x49,
6039                                                 0x74, 0x65, 0x6D, 0x20, 0x31,
6040                                                 0x8F, 0x07, 0x02, 0x49, 0x74,
6041                                                 0x65, 0x6D, 0x20, 0x32, 0x8F,
6042                                                 0x07, 0x03, 0x49, 0x74, 0x65,
6043                                                 0x6D, 0x20, 0x33, 0x9E, 0x02,
6044                                                 0x01, 0x01, 0x9F, 0x04, 0x01,
6045                                                 0x05, 0x05, 0x05 };
6046
6047 static unsigned char select_item_521[] = { 0xD0, 0x3E, 0x81, 0x03, 0x01, 0x24,
6048                                                 0x00, 0x82, 0x02, 0x81, 0x82,
6049                                                 0x85, 0x0E, 0x54, 0x6F, 0x6F,
6050                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
6051                                                 0x53, 0x65, 0x6C, 0x65, 0x63,
6052                                                 0x74, 0x8F, 0x07, 0x01, 0x49,
6053                                                 0x74, 0x65, 0x6D, 0x20, 0x31,
6054                                                 0x8F, 0x07, 0x02, 0x49, 0x74,
6055                                                 0x65, 0x6D, 0x20, 0x32, 0x8F,
6056                                                 0x07, 0x03, 0x49, 0x74, 0x65,
6057                                                 0x6D, 0x20, 0x33, 0x9E, 0x02,
6058                                                 0x00, 0x01, 0x9F, 0x04, 0x00,
6059                                                 0x05, 0x05, 0x05 };
6060
6061 static unsigned char select_item_611[] = { 0xD0, 0x34, 0x81, 0x03, 0x01, 0x24,
6062                                                 0x03, 0x82, 0x02, 0x81, 0x82,
6063                                                 0x85, 0x0E, 0x54, 0x6F, 0x6F,
6064                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
6065                                                 0x53, 0x65, 0x6C, 0x65, 0x63,
6066                                                 0x74, 0x8F, 0x07, 0x01, 0x49,
6067                                                 0x74, 0x65, 0x6D, 0x20, 0x31,
6068                                                 0x8F, 0x07, 0x02, 0x49, 0x74,
6069                                                 0x65, 0x6D, 0x20, 0x32, 0x8F,
6070                                                 0x07, 0x03, 0x49, 0x74, 0x65,
6071                                                 0x6D, 0x20, 0x33 };
6072
6073 static unsigned char select_item_621[] = { 0xD0, 0x34, 0x81, 0x03, 0x01, 0x24,
6074                                                 0x01, 0x82, 0x02, 0x81, 0x82,
6075                                                 0x85, 0x0E, 0x54, 0x6F, 0x6F,
6076                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
6077                                                 0x53, 0x65, 0x6C, 0x65, 0x63,
6078                                                 0x74, 0x8F, 0x07, 0x01, 0x49,
6079                                                 0x74, 0x65, 0x6D, 0x20, 0x31,
6080                                                 0x8F, 0x07, 0x02, 0x49, 0x74,
6081                                                 0x65, 0x6D, 0x20, 0x32, 0x8F,
6082                                                 0x07, 0x03, 0x49, 0x74, 0x65,
6083                                                 0x6D, 0x20, 0x33 };
6084
6085 static unsigned char select_item_711[] = { 0xD0, 0x2B, 0x81, 0x03, 0x01, 0x24,
6086                                                 0x04, 0x82, 0x02, 0x81, 0x82,
6087                                                 0x85, 0x0E, 0x54, 0x6F, 0x6F,
6088                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
6089                                                 0x53, 0x65, 0x6C, 0x65, 0x63,
6090                                                 0x74, 0x8F, 0x07, 0x01, 0x49,
6091                                                 0x74, 0x65, 0x6D, 0x20, 0x31,
6092                                                 0x8F, 0x07, 0x02, 0x49, 0x74,
6093                                                 0x65, 0x6D, 0x20, 0x32 };
6094
6095 static unsigned char select_item_811[] = { 0xD0, 0x30, 0x81, 0x03, 0x01, 0x24,
6096                                                 0x00, 0x82, 0x02, 0x81, 0x82,
6097                                                 0x85, 0x0A, 0x3C, 0x54, 0x49,
6098                                                 0x4D, 0x45, 0x2D, 0x4F, 0x55,
6099                                                 0x54, 0x3E, 0x8F, 0x07, 0x01,
6100                                                 0x49, 0x74, 0x65, 0x6D, 0x20,
6101                                                 0x31, 0x8F, 0x07, 0x02, 0x49,
6102                                                 0x74, 0x65, 0x6D, 0x20, 0x32,
6103                                                 0x8F, 0x07, 0x03, 0x49, 0x74,
6104                                                 0x65, 0x6D, 0x20, 0x33 };
6105
6106 static unsigned char select_item_911[] = { 0xD0, 0x3D, 0x81, 0x03, 0x01, 0x24,
6107                                                 0x00, 0x82, 0x02, 0x81, 0x82,
6108                                                 0x85, 0x10, 0x54, 0x6F, 0x6F,
6109                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
6110                                                 0x53, 0x65, 0x6C, 0x65, 0x63,
6111                                                 0x74, 0x20, 0x31, 0x8F, 0x07,
6112                                                 0x01, 0x49, 0x74, 0x65, 0x6D,
6113                                                 0x20, 0x31, 0x8F, 0x07, 0x02,
6114                                                 0x49, 0x74, 0x65, 0x6D, 0x20,
6115                                                 0x32, 0xD0, 0x04, 0x00, 0x10,
6116                                                 0x00, 0xB4, 0xD1, 0x08, 0x00,
6117                                                 0x06, 0x00, 0xB4, 0x00, 0x06,
6118                                                 0x00, 0xB4 };
6119
6120 static unsigned char select_item_912[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x24,
6121                                                 0x00, 0x82, 0x02, 0x81, 0x82,
6122                                                 0x85, 0x10, 0x54, 0x6F, 0x6F,
6123                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
6124                                                 0x53, 0x65, 0x6C, 0x65, 0x63,
6125                                                 0x74, 0x20, 0x32, 0x8F, 0x07,
6126                                                 0x01, 0x49, 0x74, 0x65, 0x6D,
6127                                                 0x20, 0x33, 0x8F, 0x07, 0x02,
6128                                                 0x49, 0x74, 0x65, 0x6D, 0x20,
6129                                                 0x34 };
6130
6131 static unsigned char select_item_921[] = { 0xD0, 0x3D, 0x81, 0x03, 0x01, 0x24,
6132                                                 0x00, 0x82, 0x02, 0x81, 0x82,
6133                                                 0x85, 0x10, 0x54, 0x6F, 0x6F,
6134                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
6135                                                 0x53, 0x65, 0x6C, 0x65, 0x63,
6136                                                 0x74, 0x20, 0x31, 0x8F, 0x07,
6137                                                 0x01, 0x49, 0x74, 0x65, 0x6D,
6138                                                 0x20, 0x31, 0x8F, 0x07, 0x02,
6139                                                 0x49, 0x74, 0x65, 0x6D, 0x20,
6140                                                 0x32, 0xD0, 0x04, 0x00, 0x10,
6141                                                 0x01, 0xB4, 0xD1, 0x08, 0x00,
6142                                                 0x06, 0x01, 0xB4, 0x00, 0x06,
6143                                                 0x01, 0xB4 };
6144
6145 static unsigned char select_item_922[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x24,
6146                                                 0x00, 0x82, 0x02, 0x81, 0x82,
6147                                                 0x85, 0x10, 0x54, 0x6F, 0x6F,
6148                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
6149                                                 0x53, 0x65, 0x6C, 0x65, 0x63,
6150                                                 0x74, 0x20, 0x32, 0x8F, 0x07,
6151                                                 0x01, 0x49, 0x74, 0x65, 0x6D,
6152                                                 0x20, 0x33, 0x8F, 0x07, 0x02,
6153                                                 0x49, 0x74, 0x65, 0x6D, 0x20,
6154                                                 0x34 };
6155
6156 static unsigned char select_item_931[] = { 0xD0, 0x3D, 0x81, 0x03, 0x01, 0x24,
6157                                                 0x00, 0x82, 0x02, 0x81, 0x82,
6158                                                 0x85, 0x10, 0x54, 0x6F, 0x6F,
6159                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
6160                                                 0x53, 0x65, 0x6C, 0x65, 0x63,
6161                                                 0x74, 0x20, 0x31, 0x8F, 0x07,
6162                                                 0x01, 0x49, 0x74, 0x65, 0x6D,
6163                                                 0x20, 0x31, 0x8F, 0x07, 0x02,
6164                                                 0x49, 0x74, 0x65, 0x6D, 0x20,
6165                                                 0x32, 0xD0, 0x04, 0x00, 0x10,
6166                                                 0x02, 0xB4, 0xD1, 0x08, 0x00,
6167                                                 0x06, 0x02, 0xB4, 0x00, 0x06,
6168                                                 0x02, 0xB4 };
6169
6170 static unsigned char select_item_932[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x24,
6171                                                 0x00, 0x82, 0x02, 0x81, 0x82,
6172                                                 0x85, 0x10, 0x54, 0x6F, 0x6F,
6173                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
6174                                                 0x53, 0x65, 0x6C, 0x65, 0x63,
6175                                                 0x74, 0x20, 0x32, 0x8F, 0x07,
6176                                                 0x01, 0x49, 0x74, 0x65, 0x6D,
6177                                                 0x20, 0x33, 0x8F, 0x07, 0x02,
6178                                                 0x49, 0x74, 0x65, 0x6D, 0x20,
6179                                                 0x34 };
6180
6181 static unsigned char select_item_941[] = { 0xD0, 0x3D, 0x81, 0x03, 0x01, 0x24,
6182                                                 0x00, 0x82, 0x02, 0x81, 0x82,
6183                                                 0x85, 0x10, 0x54, 0x6F, 0x6F,
6184                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
6185                                                 0x53, 0x65, 0x6C, 0x65, 0x63,
6186                                                 0x74, 0x20, 0x31, 0x8F, 0x07,
6187                                                 0x01, 0x49, 0x74, 0x65, 0x6D,
6188                                                 0x20, 0x31, 0x8F, 0x07, 0x02,
6189                                                 0x49, 0x74, 0x65, 0x6D, 0x20,
6190                                                 0x32, 0xD0, 0x04, 0x00, 0x10,
6191                                                 0x04, 0xB4, 0xD1, 0x08, 0x00,
6192                                                 0x06, 0x04, 0xB4, 0x00, 0x06,
6193                                                 0x04, 0xB4 };
6194
6195 static unsigned char select_item_942[] = { 0xD0, 0x3D, 0x81, 0x03, 0x01, 0x24,
6196                                                 0x00, 0x82, 0x02, 0x81, 0x82,
6197                                                 0x85, 0x10, 0x54, 0x6F, 0x6F,
6198                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
6199                                                 0x53, 0x65, 0x6C, 0x65, 0x63,
6200                                                 0x74, 0x20, 0x32, 0x8F, 0x07,
6201                                                 0x01, 0x49, 0x74, 0x65, 0x6D,
6202                                                 0x20, 0x33, 0x8F, 0x07, 0x02,
6203                                                 0x49, 0x74, 0x65, 0x6D, 0x20,
6204                                                 0x34, 0xD0, 0x04, 0x00, 0x10,
6205                                                 0x00, 0xB4, 0xD1, 0x08, 0x00,
6206                                                 0x06, 0x00, 0xB4, 0x00, 0x06,
6207                                                 0x00, 0xB4 };
6208
6209 static unsigned char select_item_943[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x24,
6210                                                 0x00, 0x82, 0x02, 0x81, 0x82,
6211                                                 0x85, 0x10, 0x54, 0x6F, 0x6F,
6212                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
6213                                                 0x53, 0x65, 0x6C, 0x65, 0x63,
6214                                                 0x74, 0x20, 0x33, 0x8F, 0x07,
6215                                                 0x01, 0x49, 0x74, 0x65, 0x6D,
6216                                                 0x20, 0x35, 0x8F, 0x07, 0x02,
6217                                                 0x49, 0x74, 0x65, 0x6D, 0x20,
6218                                                 0x36 };
6219
6220 static unsigned char select_item_951[] = { 0xD0, 0x3D, 0x81, 0x03, 0x01, 0x24,
6221                                                 0x00, 0x82, 0x02, 0x81, 0x82,
6222                                                 0x85, 0x10, 0x54, 0x6F, 0x6F,
6223                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
6224                                                 0x53, 0x65, 0x6C, 0x65, 0x63,
6225                                                 0x74, 0x20, 0x31, 0x8F, 0x07,
6226                                                 0x01, 0x49, 0x74, 0x65, 0x6D,
6227                                                 0x20, 0x31, 0x8F, 0x07, 0x02,
6228                                                 0x49, 0x74, 0x65, 0x6D, 0x20,
6229                                                 0x32, 0xD0, 0x04, 0x00, 0x10,
6230                                                 0x08, 0xB4, 0xD1, 0x08, 0x00,
6231                                                 0x06, 0x08, 0xB4, 0x00, 0x06,
6232                                                 0x08, 0xB4 };
6233
6234 static unsigned char select_item_952[] = { 0xD0, 0x3D, 0x81, 0x03, 0x01, 0x24,
6235                                                 0x00, 0x82, 0x02, 0x81, 0x82,
6236                                                 0x85, 0x10, 0x54, 0x6F, 0x6F,
6237                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
6238                                                 0x53, 0x65, 0x6C, 0x65, 0x63,
6239                                                 0x74, 0x20, 0x32, 0x8F, 0x07,
6240                                                 0x01, 0x49, 0x74, 0x65, 0x6D,
6241                                                 0x20, 0x33, 0x8F, 0x07, 0x02,
6242                                                 0x49, 0x74, 0x65, 0x6D, 0x20,
6243                                                 0x34, 0xD0, 0x04, 0x00, 0x10,
6244                                                 0x00, 0xB4, 0xD1, 0x08, 0x00,
6245                                                 0x06, 0x00, 0xB4, 0x00, 0x06,
6246                                                 0x00, 0xB4 };
6247
6248 static unsigned char select_item_953[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x24,
6249                                                 0x00, 0x82, 0x02, 0x81, 0x82,
6250                                                 0x85, 0x10, 0x54, 0x6F, 0x6F,
6251                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
6252                                                 0x53, 0x65, 0x6C, 0x65, 0x63,
6253                                                 0x74, 0x20, 0x33, 0x8F, 0x07,
6254                                                 0x01, 0x49, 0x74, 0x65, 0x6D,
6255                                                 0x20, 0x35, 0x8F, 0x07, 0x02,
6256                                                 0x49, 0x74, 0x65, 0x6D, 0x20,
6257                                                 0x36 };
6258
6259 static unsigned char select_item_961[] = { 0xD0, 0x3D, 0x81, 0x03, 0x01, 0x24,
6260                                                 0x00, 0x82, 0x02, 0x81, 0x82,
6261                                                 0x85, 0x10, 0x54, 0x6F, 0x6F,
6262                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
6263                                                 0x53, 0x65, 0x6C, 0x65, 0x63,
6264                                                 0x74, 0x20, 0x31, 0x8F, 0x07,
6265                                                 0x01, 0x49, 0x74, 0x65, 0x6D,
6266                                                 0x20, 0x31, 0x8F, 0x07, 0x02,
6267                                                 0x49, 0x74, 0x65, 0x6D, 0x20,
6268                                                 0x32, 0xD0, 0x04, 0x00, 0x10,
6269                                                 0x10, 0xB4, 0xD1, 0x08, 0x00,
6270                                                 0x06, 0x10, 0xB4, 0x00, 0x06,
6271                                                 0x10, 0xB4 };
6272
6273 static unsigned char select_item_962[] = { 0xD0, 0x3D, 0x81, 0x03, 0x01, 0x24,
6274                                                 0x00, 0x82, 0x02, 0x81, 0x82,
6275                                                 0x85, 0x10, 0x54, 0x6F, 0x6F,
6276                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
6277                                                 0x53, 0x65, 0x6C, 0x65, 0x63,
6278                                                 0x74, 0x20, 0x32, 0x8F, 0x07,
6279                                                 0x01, 0x49, 0x74, 0x65, 0x6D,
6280                                                 0x20, 0x33, 0x8F, 0x07, 0x02,
6281                                                 0x49, 0x74, 0x65, 0x6D, 0x20,
6282                                                 0x34, 0xD0, 0x04, 0x00, 0x10,
6283                                                 0x00, 0xB4, 0xD1, 0x08, 0x00,
6284                                                 0x06, 0x00, 0xB4, 0x00, 0x06,
6285                                                 0x00, 0xB4 };
6286
6287 static unsigned char select_item_963[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x24,
6288                                                 0x00, 0x82, 0x02, 0x81, 0x82,
6289                                                 0x85, 0x10, 0x54, 0x6F, 0x6F,
6290                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
6291                                                 0x53, 0x65, 0x6C, 0x65, 0x63,
6292                                                 0x74, 0x20, 0x33, 0x8F, 0x07,
6293                                                 0x01, 0x49, 0x74, 0x65, 0x6D,
6294                                                 0x20, 0x35, 0x8F, 0x07, 0x02,
6295                                                 0x49, 0x74, 0x65, 0x6D, 0x20,
6296                                                 0x36 };
6297
6298 static unsigned char select_item_971[] = { 0xD0, 0x3D, 0x81, 0x03, 0x01, 0x24,
6299                                                 0x00, 0x82, 0x02, 0x81, 0x82,
6300                                                 0x85, 0x10, 0x54, 0x6F, 0x6F,
6301                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
6302                                                 0x53, 0x65, 0x6C, 0x65, 0x63,
6303                                                 0x74, 0x20, 0x31, 0x8F, 0x07,
6304                                                 0x01, 0x49, 0x74, 0x65, 0x6D,
6305                                                 0x20, 0x31, 0x8F, 0x07, 0x02,
6306                                                 0x49, 0x74, 0x65, 0x6D, 0x20,
6307                                                 0x32, 0xD0, 0x04, 0x00, 0x10,
6308                                                 0x20, 0xB4, 0xD1, 0x08, 0x00,
6309                                                 0x06, 0x20, 0xB4, 0x00, 0x06,
6310                                                 0x20, 0xB4 };
6311
6312 static unsigned char select_item_972[] = { 0xD0, 0x3D, 0x81, 0x03, 0x01, 0x24,
6313                                                 0x00, 0x82, 0x02, 0x81, 0x82,
6314                                                 0x85, 0x10, 0x54, 0x6F, 0x6F,
6315                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
6316                                                 0x53, 0x65, 0x6C, 0x65, 0x63,
6317                                                 0x74, 0x20, 0x32, 0x8F, 0x07,
6318                                                 0x01, 0x49, 0x74, 0x65, 0x6D,
6319                                                 0x20, 0x33, 0x8F, 0x07, 0x02,
6320                                                 0x49, 0x74, 0x65, 0x6D, 0x20,
6321                                                 0x34, 0xD0, 0x04, 0x00, 0x10,
6322                                                 0x00, 0xB4, 0xD1, 0x08, 0x00,
6323                                                 0x06, 0x00, 0xB4, 0x00, 0x06,
6324                                                 0x00, 0xB4 };
6325
6326 static unsigned char select_item_973[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x24,
6327                                                 0x00, 0x82, 0x02, 0x81, 0x82,
6328                                                 0x85, 0x10, 0x54, 0x6F, 0x6F,
6329                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
6330                                                 0x53, 0x65, 0x6C, 0x65, 0x63,
6331                                                 0x74, 0x20, 0x33, 0x8F, 0x07,
6332                                                 0x01, 0x49, 0x74, 0x65, 0x6D,
6333                                                 0x20, 0x35, 0x8F, 0x07, 0x02,
6334                                                 0x49, 0x74, 0x65, 0x6D, 0x20,
6335                                                 0x36 };
6336
6337 static unsigned char select_item_981[] = { 0xD0, 0x3D, 0x81, 0x03, 0x01, 0x24,
6338                                                 0x00, 0x82, 0x02, 0x81, 0x82,
6339                                                 0x85, 0x10, 0x54, 0x6F, 0x6F,
6340                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
6341                                                 0x53, 0x65, 0x6C, 0x65, 0x63,
6342                                                 0x74, 0x20, 0x31, 0x8F, 0x07,
6343                                                 0x01, 0x49, 0x74, 0x65, 0x6D,
6344                                                 0x20, 0x31, 0x8F, 0x07, 0x02,
6345                                                 0x49, 0x74, 0x65, 0x6D, 0x20,
6346                                                 0x32, 0xD0, 0x04, 0x00, 0x10,
6347                                                 0x40, 0xB4, 0xD1, 0x08, 0x00,
6348                                                 0x06, 0x40, 0xB4, 0x00, 0x06,
6349                                                 0x40, 0xB4 };
6350
6351 static unsigned char select_item_982[] = { 0xD0, 0x3D, 0x81, 0x03, 0x01, 0x24,
6352                                                 0x00, 0x82, 0x02, 0x81, 0x82,
6353                                                 0x85, 0x10, 0x54, 0x6F, 0x6F,
6354                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
6355                                                 0x53, 0x65, 0x6C, 0x65, 0x63,
6356                                                 0x74, 0x20, 0x32, 0x8F, 0x07,
6357                                                 0x01, 0x49, 0x74, 0x65, 0x6D,
6358                                                 0x20, 0x33, 0x8F, 0x07, 0x02,
6359                                                 0x49, 0x74, 0x65, 0x6D, 0x20,
6360                                                 0x34, 0xD0, 0x04, 0x00, 0x10,
6361                                                 0x00, 0xB4, 0xD1, 0x08, 0x00,
6362                                                 0x06, 0x00, 0xB4, 0x00, 0x06,
6363                                                 0x00, 0xB4 };
6364
6365 static unsigned char select_item_983[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x24,
6366                                                 0x00, 0x82, 0x02, 0x81, 0x82,
6367                                                 0x85, 0x10, 0x54, 0x6F, 0x6F,
6368                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
6369                                                 0x53, 0x65, 0x6C, 0x65, 0x63,
6370                                                 0x74, 0x20, 0x33, 0x8F, 0x07,
6371                                                 0x01, 0x49, 0x74, 0x65, 0x6D,
6372                                                 0x20, 0x35, 0x8F, 0x07, 0x02,
6373                                                 0x49, 0x74, 0x65, 0x6D, 0x20,
6374                                                 0x36 };
6375
6376 static unsigned char select_item_991[] = { 0xD0, 0x3D, 0x81, 0x03, 0x01, 0x24,
6377                                                 0x00, 0x82, 0x02, 0x81, 0x82,
6378                                                 0x85, 0x10, 0x54, 0x6F, 0x6F,
6379                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
6380                                                 0x53, 0x65, 0x6C, 0x65, 0x63,
6381                                                 0x74, 0x20, 0x31, 0x8F, 0x07,
6382                                                 0x01, 0x49, 0x74, 0x65, 0x6D,
6383                                                 0x20, 0x31, 0x8F, 0x07, 0x02,
6384                                                 0x49, 0x74, 0x65, 0x6D, 0x20,
6385                                                 0x32, 0xD0, 0x04, 0x00, 0x10,
6386                                                 0x80, 0xB4, 0xD1, 0x08, 0x00,
6387                                                 0x06, 0x80, 0xB4, 0x00, 0x06,
6388                                                 0x80, 0xB4 };
6389
6390 static unsigned char select_item_992[] = { 0xD0, 0x3D, 0x81, 0x03, 0x01, 0x24,
6391                                                 0x00, 0x82, 0x02, 0x81, 0x82,
6392                                                 0x85, 0x10, 0x54, 0x6F, 0x6F,
6393                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
6394                                                 0x53, 0x65, 0x6C, 0x65, 0x63,
6395                                                 0x74, 0x20, 0x32, 0x8F, 0x07,
6396                                                 0x01, 0x49, 0x74, 0x65, 0x6D,
6397                                                 0x20, 0x33, 0x8F, 0x07, 0x02,
6398                                                 0x49, 0x74, 0x65, 0x6D, 0x20,
6399                                                 0x34, 0xD0, 0x04, 0x00, 0x10,
6400                                                 0x00, 0xB4, 0xD1, 0x08, 0x00,
6401                                                 0x06, 0x00, 0xB4, 0x00, 0x06,
6402                                                 0x00, 0xB4 };
6403
6404 static unsigned char select_item_993[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x24,
6405                                                 0x00, 0x82, 0x02, 0x81, 0x82,
6406                                                 0x85, 0x10, 0x54, 0x6F, 0x6F,
6407                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
6408                                                 0x53, 0x65, 0x6C, 0x65, 0x63,
6409                                                 0x74, 0x20, 0x33, 0x8F, 0x07,
6410                                                 0x01, 0x49, 0x74, 0x65, 0x6D,
6411                                                 0x20, 0x35, 0x8F, 0x07, 0x02,
6412                                                 0x49, 0x74, 0x65, 0x6D, 0x20,
6413                                                 0x36 };
6414
6415 static unsigned char select_item_9101[] = { 0xD0, 0x3D, 0x81, 0x03, 0x01, 0x24,
6416                                                 0x00, 0x82, 0x02, 0x81, 0x82,
6417                                                 0x85, 0x10, 0x54, 0x6F, 0x6F,
6418                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
6419                                                 0x53, 0x65, 0x6C, 0x65, 0x63,
6420                                                 0x74, 0x20, 0x31, 0x8F, 0x07,
6421                                                 0x01, 0x49, 0x74, 0x65, 0x6D,
6422                                                 0x20, 0x31, 0x8F, 0x07, 0x02,
6423                                                 0x49, 0x74, 0x65, 0x6D, 0x20,
6424                                                 0x32, 0xD0, 0x04, 0x00, 0x10,
6425                                                 0x00, 0xB4, 0xD1, 0x08, 0x00,
6426                                                 0x06, 0x00, 0xB4, 0x00, 0x06,
6427                                                 0x00, 0xB4 };
6428
6429 static unsigned char select_item_9102[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x24,
6430                                                 0x00, 0x82, 0x02, 0x81, 0x82,
6431                                                 0x85, 0x10, 0x54, 0x6F, 0x6F,
6432                                                 0x6C, 0x6B, 0x69, 0x74, 0x20,
6433                                                 0x53, 0x65, 0x6C, 0x65, 0x63,
6434                                                 0x74, 0x20, 0x32, 0x8F, 0x07,
6435                                                 0x01, 0x49, 0x74, 0x65, 0x6D,
6436                                                 0x20, 0x33, 0x8F, 0x07, 0x02,
6437                                                 0x49, 0x74, 0x65, 0x6D, 0x20,
6438                                                 0x34 };
6439
6440 static unsigned char select_item_1011[] = { 0xD0, 0x7E, 0x81, 0x03, 0x01, 0x24,
6441                                                 0x00, 0x82, 0x02, 0x81, 0x82,
6442                                                 0x85, 0x19, 0x80, 0x04, 0x17,
6443                                                 0x04, 0x14, 0x04, 0x20, 0x04,
6444                                                 0x10, 0x04, 0x12, 0x04, 0x21,
6445                                                 0x04, 0x22, 0x04, 0x12, 0x04,
6446                                                 0x23, 0x04, 0x19, 0x04, 0x22,
6447                                                 0x04, 0x15, 0x8F, 0x1C, 0x01,
6448                                                 0x80, 0x04, 0x17, 0x04, 0x14,
6449                                                 0x04, 0x20, 0x04, 0x10, 0x04,
6450                                                 0x12, 0x04, 0x21, 0x04, 0x22,
6451                                                 0x04, 0x12, 0x04, 0x23, 0x04,
6452                                                 0x19, 0x04, 0x22, 0x04, 0x15,
6453                                                 0x00, 0x31, 0x8F, 0x1C, 0x02,
6454                                                 0x80, 0x04, 0x17, 0x04, 0x14,
6455                                                 0x04, 0x20, 0x04, 0x10, 0x04,
6456                                                 0x12, 0x04, 0x21, 0x04, 0x22,
6457                                                 0x04, 0x12, 0x04, 0x23, 0x04,
6458                                                 0x19, 0x04, 0x22, 0x04, 0x15,
6459                                                 0x00, 0x32, 0x8F, 0x1C, 0x03,
6460                                                 0x80, 0x04, 0x17, 0x04, 0x14,
6461                                                 0x04, 0x20, 0x04, 0x10, 0x04,
6462                                                 0x12, 0x04, 0x21, 0x04, 0x22,
6463                                                 0x04, 0x12, 0x04, 0x23, 0x04,
6464                                                 0x19, 0x04, 0x22, 0x04, 0x15,
6465                                                 0x00, 0x33 };
6466
6467 static unsigned char select_item_1021[] = { 0xD0, 0x53, 0x81, 0x03, 0x01, 0x24,
6468                                                 0x00, 0x82, 0x02, 0x81, 0x82,
6469                                                 0x85, 0x0F, 0x81, 0x0C, 0x08,
6470                                                 0x97, 0x94, 0xA0, 0x90, 0x92,
6471                                                 0xA1, 0xA2, 0x92, 0xA3, 0x99,
6472                                                 0xA2, 0x95, 0x8F, 0x11, 0x01,
6473                                                 0x81, 0x0D, 0x08, 0x97, 0x94,
6474                                                 0xA0, 0x90, 0x92, 0xA1, 0xA2,
6475                                                 0x92, 0xA3, 0x99, 0xA2, 0x95,
6476                                                 0x31, 0x8F, 0x11, 0x02, 0x81,
6477                                                 0x0D, 0x08, 0x97, 0x94, 0xA0,
6478                                                 0x90, 0x92, 0xA1, 0xA2, 0x92,
6479                                                 0xA3, 0x99, 0xA2, 0x95, 0x32,
6480                                                 0x8F, 0x11, 0x03, 0x81, 0x0D,
6481                                                 0x08, 0x97, 0x94, 0xA0, 0x90,
6482                                                 0x92, 0xA1, 0xA2, 0x92, 0xA3,
6483                                                 0x99, 0xA2, 0x95, 0x33 };
6484
6485 static unsigned char select_item_1031[] = { 0xD0, 0x57, 0x81, 0x03, 0x01, 0x24,
6486                                                 0x00, 0x82, 0x02, 0x81, 0x82,
6487                                                 0x85, 0x10, 0x82, 0x0C, 0x04,
6488                                                 0x10, 0x87, 0x84, 0x90, 0x80,
6489                                                 0x82, 0x91, 0x92, 0x82, 0x93,
6490                                                 0x89, 0x92, 0x85, 0x8F, 0x12,
6491                                                 0x01, 0x82, 0x0D, 0x04, 0x10,
6492                                                 0x87, 0x84, 0x90, 0x80, 0x82,
6493                                                 0x91, 0x92, 0x82, 0x93, 0x89,
6494                                                 0x92, 0x85, 0x31, 0x8F, 0x12,
6495                                                 0x02, 0x82, 0x0D, 0x04, 0x10,
6496                                                 0x87, 0x84, 0x90, 0x80, 0x82,
6497                                                 0x91, 0x92, 0x82, 0x93, 0x89,
6498                                                 0x92, 0x85, 0x32, 0x8F, 0x12,
6499                                                 0x03, 0x82, 0x0D, 0x04, 0x10,
6500                                                 0x87, 0x84, 0x90, 0x80, 0x82,
6501                                                 0x91, 0x92, 0x82, 0x93, 0x89,
6502                                                 0x92, 0x85, 0x33 };
6503
6504 static unsigned char select_item_1111[] = { 0xD0, 0x3E, 0x81, 0x03, 0x01, 0x24,
6505                                                 0x00, 0x82, 0x02, 0x81, 0x82,
6506                                                 0x85, 0x0B, 0x80, 0x5D, 0xE5,
6507                                                 0x51, 0x77, 0x7B, 0xB1, 0x90,
6508                                                 0x09, 0x62, 0xE9, 0x8F, 0x08,
6509                                                 0x01, 0x80, 0x98, 0x79, 0x76,
6510                                                 0xEE, 0x4E, 0x00, 0x8F, 0x08,
6511                                                 0x02, 0x80, 0x98, 0x79, 0x76,
6512                                                 0xEE, 0x4E, 0x8C, 0x8F, 0x08,
6513                                                 0x03, 0x80, 0x98, 0x79, 0x76,
6514                                                 0xEE, 0x4E, 0x09, 0x8F, 0x08,
6515                                                 0x04, 0x80, 0x98, 0x79, 0x76,
6516                                                 0xEE, 0x56, 0xDB };
6517
6518 static unsigned char select_item_1211[] = { 0xD0, 0x38, 0x81, 0x03, 0x01, 0x24,
6519                                                 0x00, 0x82, 0x02, 0x81, 0x82,
6520                                                 0x85, 0x09, 0x80, 0x00, 0x38,
6521                                                 0x00, 0x30, 0x30, 0xEB, 0x00,
6522                                                 0x30, 0x8F, 0x0A, 0x01, 0x80,
6523                                                 0x00, 0x38, 0x00, 0x30, 0x30,
6524                                                 0xEB, 0x00, 0x31, 0x8F, 0x0A,
6525                                                 0x02, 0x80, 0x00, 0x38, 0x00,
6526                                                 0x30, 0x30, 0xEB, 0x00, 0x32,
6527                                                 0x8F, 0x0A, 0x03, 0x80, 0x00,
6528                                                 0x38, 0x00, 0x30, 0x30, 0xEB,
6529                                                 0x00, 0x33 };
6530
6531 static unsigned char select_item_1221[] = { 0xD0, 0x30, 0x81, 0x03, 0x01, 0x24,
6532                                                 0x00, 0x82, 0x02, 0x81, 0x82,
6533                                                 0x85, 0x07, 0x81, 0x04, 0x61,
6534                                                 0x38, 0x31, 0xEB, 0x30, 0x8F,
6535                                                 0x08, 0x01, 0x81, 0x04, 0x61,
6536                                                 0x38, 0x31, 0xEB, 0x31, 0x8F,
6537                                                 0x08, 0x02, 0x81, 0x04, 0x61,
6538                                                 0x38, 0x31, 0xEB, 0x32, 0x8F,
6539                                                 0x08, 0x03, 0x81, 0x04, 0x61,
6540                                                 0x38, 0x31, 0xEB, 0x33 };
6541
6542 static unsigned char select_item_1231[] = { 0xD0, 0x34, 0x81, 0x03, 0x01, 0x24,
6543                                                 0x00, 0x82, 0x02, 0x81, 0x82,
6544                                                 0x85, 0x08, 0x82, 0x04, 0x30,
6545                                                 0xA0, 0x38, 0x32, 0xCB, 0x30,
6546                                                 0x8F, 0x09, 0x01, 0x82, 0x04,
6547                                                 0x30, 0xA0, 0x38, 0x32, 0xCB,
6548                                                 0x31, 0x8F, 0x09, 0x02, 0x82,
6549                                                 0x04, 0x30, 0xA0, 0x38, 0x32,
6550                                                 0xCB, 0x32, 0x8F, 0x09, 0x03,
6551                                                 0x82, 0x04, 0x30, 0xA0, 0x38,
6552                                                 0x32, 0xCB, 0x33 };
6553
6554 static struct select_item_test select_item_data_111 = {
6555         .pdu = select_item_111,
6556         .pdu_len = sizeof(select_item_111),
6557         .qualifier = 0x00,
6558         .alpha_id = "Toolkit Select",
6559         .items = {
6560                 { .id = 1, .text = "Item 1" },
6561                 { .id = 2, .text = "Item 2" },
6562                 { .id = 3, .text = "Item 3" },
6563                 { .id = 4, .text = "Item 4" },
6564         }
6565 };
6566
6567 static struct select_item_test select_item_data_121 = {
6568         .pdu = select_item_121,
6569         .pdu_len = sizeof(select_item_121),
6570         .qualifier = 0x00,
6571         .alpha_id = "LargeMenu1",
6572         .items = {
6573                 { .id = 0x50, .text = "Zero" },
6574                 { .id = 0x4F, .text = "One" },
6575                 { .id = 0x4E, .text = "Two" },
6576                 { .id = 0x4D, .text = "Three" },
6577                 { .id = 0x4C, .text = "Four" },
6578                 { .id = 0x4B, .text = "Five" },
6579                 { .id = 0x4A, .text = "Six" },
6580                 { .id = 0x49, .text = "Seven" },
6581                 { .id = 0x48, .text = "Eight" },
6582                 { .id = 0x47, .text = "Nine" },
6583                 { .id = 0x46, .text = "Alpha" },
6584                 { .id = 0x45, .text = "Bravo" },
6585                 { .id = 0x44, .text = "Charlie" },
6586                 { .id = 0x43, .text = "Delta" },
6587                 { .id = 0x42, .text = "Echo" },
6588                 { .id = 0x41, .text = "Fox-trot" },
6589                 { .id = 0x40, .text = "Black" },
6590                 { .id = 0x3F, .text = "Brown" },
6591                 { .id = 0x3E, .text = "Red" },
6592                 { .id = 0x3D, .text = "Orange" },
6593                 { .id = 0x3C, .text = "Yellow" },
6594                 { .id = 0x3B, .text = "Green" },
6595                 { .id = 0x3A, .text = "Blue" },
6596                 { .id = 0x39, .text = "Violet" },
6597                 { .id = 0x38, .text = "Grey" },
6598                 { .id = 0x37, .text = "White" },
6599                 { .id = 0x36, .text = "milli" },
6600                 { .id = 0x35, .text = "micro" },
6601                 { .id = 0x34, .text = "nano" },
6602                 { .id = 0x33, .text = "pico" },
6603         }
6604 };
6605
6606 static struct select_item_test select_item_data_131 = {
6607         .pdu = select_item_131,
6608         .pdu_len = sizeof(select_item_131),
6609         .qualifier = 0x00,
6610         .alpha_id = "LargeMenu2",
6611         .items = {
6612                 { .id = 0xFF, .text = "Call Forwarding Unconditional" },
6613                 { .id = 0xFE, .text = "Call Forwarding On User Busy" },
6614                 { .id = 0xFD, .text = "Call Forwarding On No Reply" },
6615                 { .id = 0xFC, .text = "Call Forwarding On User Not Reachable" },
6616                 { .id = 0xFB, .text = "Barring Of All Outgoing Calls" },
6617                 { .id = 0xFA,
6618                         .text = "Barring Of All Outgoing International Calls" },
6619                 { .id = 0xF9, .text = "CLI Presentation" },
6620         }
6621 };
6622
6623 static struct select_item_test select_item_data_141 = {
6624         .pdu = select_item_141,
6625         .pdu_len = sizeof(select_item_141),
6626         .qualifier = 0x00,
6627         .alpha_id = "Select Item",
6628         .items = {
6629                 { .id = 0x11, .text = "One" },
6630                 { .id = 0x12, .text = "Two" },
6631         }
6632 };
6633
6634 static struct select_item_test select_item_data_151 = {
6635         .pdu = select_item_151,
6636         .pdu_len = sizeof(select_item_151),
6637         .qualifier = 0x00,
6638         .alpha_id = "The SIM shall supply a set of items from which the user "
6639                 "may choose one. Each item comprises a short identifier (used "
6640                 "to indicate the selection) and a text string. Optionally the "
6641                 "SIM may include an alpha identifier. The alpha identifier i",
6642         .items = {
6643                 { .id = 0x01, .text = "Y" },
6644         }
6645 };
6646
6647 static struct select_item_test select_item_data_161 = {
6648         .pdu = select_item_161,
6649         .pdu_len = sizeof(select_item_161),
6650         .qualifier = 0x00,
6651         .alpha_id = "0LargeMenu",
6652         .items = {
6653                 { .id = 0xFF, .text = "1 Call Forward Unconditional" },
6654                 { .id = 0xFE, .text = "2 Call Forward On User Busy" },
6655                 { .id = 0xFD, .text = "3 Call Forward On No Reply" },
6656                 { .id = 0xFC, .text = "4 Call Forward On User Not Reachable" },
6657                 { .id = 0xFB, .text = "5 Barring Of All Outgoing Calls" },
6658                 { .id = 0xFA, .text = "6 Barring Of All Outgoing Int Calls" },
6659                 { .id = 0xF9, .text = "7 CLI Presentation" },
6660         }
6661 };
6662
6663 static struct select_item_test select_item_data_211 = {
6664         .pdu = select_item_211,
6665         .pdu_len = sizeof(select_item_211),
6666         .qualifier = 0x00,
6667         .alpha_id = "Toolkit Select",
6668         .items = {
6669                 { .id = 1, .text = "Item 1" },
6670                 { .id = 2, .text = "Item 2" },
6671                 { .id = 3, .text = "Item 3" },
6672         },
6673         .next_act = {
6674                 .list = { STK_COMMAND_TYPE_SEND_SMS,
6675                                 STK_COMMAND_TYPE_SETUP_CALL,
6676                                 STK_COMMAND_TYPE_PROVIDE_LOCAL_INFO},
6677                 .len = 3
6678         }
6679 };
6680
6681 static struct select_item_test select_item_data_311 = {
6682         .pdu = select_item_311,
6683         .pdu_len = sizeof(select_item_311),
6684         .qualifier = 0x00,
6685         .alpha_id = "Toolkit Select",
6686         .items = {
6687                 { .id = 1, .text = "Item 1" },
6688                 { .id = 2, .text = "Item 2" },
6689                 { .id = 3, .text = "Item 3" },
6690         },
6691         .item_id = 0x02
6692 };
6693
6694 static struct select_item_test select_item_data_411 = {
6695         .pdu = select_item_411,
6696         .pdu_len = sizeof(select_item_411),
6697         .qualifier = 0x80,
6698         .alpha_id = "Toolkit Select",
6699         .items = {
6700                 { .id = 1, .text = "Item 1" },
6701                 { .id = 2, .text = "Item 2" },
6702                 { .id = 3, .text = "Item 3" },
6703         }
6704 };
6705
6706 static struct select_item_test select_item_data_511 = {
6707         .pdu = select_item_511,
6708         .pdu_len = sizeof(select_item_511),
6709         .qualifier = 0x00,
6710         .alpha_id = "Toolkit Select",
6711         .items = {
6712                 { .id = 1, .text = "Item 1" },
6713                 { .id = 2, .text = "Item 2" },
6714                 { .id = 3, .text = "Item 3" },
6715         },
6716         .icon_id = {
6717                 .qualifier = STK_ICON_QUALIFIER_TYPE_NON_SELF_EXPLANATORY,
6718                 .id = 1
6719         },
6720         .item_icon_id_list = {
6721                 .qualifier = STK_ICON_QUALIFIER_TYPE_NON_SELF_EXPLANATORY,
6722                 .list = { 5, 5, 5 },
6723                 .len = 3
6724         }
6725 };
6726
6727 static struct select_item_test select_item_data_521 = {
6728         .pdu = select_item_521,
6729         .pdu_len = sizeof(select_item_521),
6730         .qualifier = 0x00,
6731         .alpha_id = "Toolkit Select",
6732         .items = {
6733                 { .id = 1, .text = "Item 1" },
6734                 { .id = 2, .text = "Item 2" },
6735                 { .id = 3, .text = "Item 3" },
6736         },
6737         .icon_id = {
6738                 .qualifier = STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY,
6739                 .id = 1
6740         },
6741         .item_icon_id_list = {
6742                 .qualifier = STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY,
6743                 .list = { 5, 5, 5 },
6744                 .len = 3
6745         }
6746 };
6747
6748 static struct select_item_test select_item_data_611 = {
6749         .pdu = select_item_611,
6750         .pdu_len = sizeof(select_item_611),
6751         .qualifier = 0x03,
6752         .alpha_id = "Toolkit Select",
6753         .items = {
6754                 { .id = 1, .text = "Item 1" },
6755                 { .id = 2, .text = "Item 2" },
6756                 { .id = 3, .text = "Item 3" },
6757         }
6758 };
6759
6760 static struct select_item_test select_item_data_621 = {
6761         .pdu = select_item_621,
6762         .pdu_len = sizeof(select_item_621),
6763         .qualifier = 0x01,
6764         .alpha_id = "Toolkit Select",
6765         .items = {
6766                 { .id = 1, .text = "Item 1" },
6767                 { .id = 2, .text = "Item 2" },
6768                 { .id = 3, .text = "Item 3" },
6769         }
6770 };
6771
6772 static struct select_item_test select_item_data_711 = {
6773         .pdu = select_item_711,
6774         .pdu_len = sizeof(select_item_711),
6775         .qualifier = 0x04,
6776         .alpha_id = "Toolkit Select",
6777         .items = {
6778                 { .id = 1, .text = "Item 1" },
6779                 { .id = 2, .text = "Item 2" },
6780         }
6781 };
6782
6783 static struct select_item_test select_item_data_811 = {
6784         .pdu = select_item_811,
6785         .pdu_len = sizeof(select_item_811),
6786         .qualifier = 0x00,
6787         .alpha_id = "<TIME-OUT>",
6788         .items = {
6789                 { .id = 1, .text = "Item 1" },
6790                 { .id = 2, .text = "Item 2" },
6791                 { .id = 3, .text = "Item 3" },
6792         }
6793 };
6794
6795 static struct select_item_test select_item_data_911 = {
6796         .pdu = select_item_911,
6797         .pdu_len = sizeof(select_item_911),
6798         .qualifier = 0x00,
6799         .alpha_id = "Toolkit Select 1",
6800         .items = {
6801                 { .id = 1, .text = "Item 1" },
6802                 { .id = 2, .text = "Item 2" },
6803         },
6804         .text_attr = {
6805                 .len = 4,
6806                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
6807         },
6808         .item_text_attr_list = {
6809                 .len = 8,
6810                 .list = { 0x00, 0x06, 0x00, 0xB4, 0x00, 0x06, 0x00, 0xB4 }
6811         },
6812         .html = "<div style=\"text-align: left;\"><span style=\"color: "
6813                 "#347235;background-color: #FFFF00;\">Toolkit Select 1</span>"
6814                 "</div>",
6815 };
6816
6817 static struct select_item_test select_item_data_912 = {
6818         .pdu = select_item_912,
6819         .pdu_len = sizeof(select_item_912),
6820         .qualifier = 0x00,
6821         .alpha_id = "Toolkit Select 2",
6822         .items = {
6823                 { .id = 1, .text = "Item 3" },
6824                 { .id = 2, .text = "Item 4" },
6825         }
6826 };
6827
6828 static struct select_item_test select_item_data_921 = {
6829         .pdu = select_item_921,
6830         .pdu_len = sizeof(select_item_921),
6831         .qualifier = 0x00,
6832         .alpha_id = "Toolkit Select 1",
6833         .items = {
6834                 { .id = 1, .text = "Item 1" },
6835                 { .id = 2, .text = "Item 2" },
6836         },
6837         .text_attr = {
6838                 .len = 4,
6839                 .attributes = { 0x00, 0x10, 0x01, 0xB4 }
6840         },
6841         .item_text_attr_list = {
6842                 .len = 8,
6843                 .list = { 0x00, 0x06, 0x01, 0xB4, 0x00, 0x06, 0x01, 0xB4 }
6844         },
6845         .html = "<div style=\"text-align: center;\"><span style=\"color: "
6846                 "#347235;background-color: #FFFF00;\">Toolkit Select 1</span>"
6847                 "</div>",
6848 };
6849
6850 static struct select_item_test select_item_data_922 = {
6851         .pdu = select_item_922,
6852         .pdu_len = sizeof(select_item_922),
6853         .qualifier = 0x00,
6854         .alpha_id = "Toolkit Select 2",
6855         .items = {
6856                 { .id = 1, .text = "Item 3" },
6857                 { .id = 2, .text = "Item 4" },
6858         }
6859 };
6860
6861 static struct select_item_test select_item_data_931 = {
6862         .pdu = select_item_931,
6863         .pdu_len = sizeof(select_item_931),
6864         .qualifier = 0x00,
6865         .alpha_id = "Toolkit Select 1",
6866         .items = {
6867                 { .id = 1, .text = "Item 1" },
6868                 { .id = 2, .text = "Item 2" },
6869         },
6870         .text_attr = {
6871                 .len = 4,
6872                 .attributes = { 0x00, 0x10, 0x02, 0xB4 }
6873         },
6874         .item_text_attr_list = {
6875                 .len = 8,
6876                 .list = { 0x00, 0x06, 0x02, 0xB4, 0x00, 0x06, 0x02, 0xB4 }
6877         },
6878         .html = "<div style=\"text-align: right;\"><span style=\"color: "
6879                 "#347235;background-color: #FFFF00;\">Toolkit Select 1</span>"
6880                 "</div>"
6881 };
6882
6883 static struct select_item_test select_item_data_932 = {
6884         .pdu = select_item_932,
6885         .pdu_len = sizeof(select_item_932),
6886         .qualifier = 0x00,
6887         .alpha_id = "Toolkit Select 2",
6888         .items = {
6889                 { .id = 1, .text = "Item 3" },
6890                 { .id = 2, .text = "Item 4" },
6891         }
6892 };
6893
6894 static struct select_item_test select_item_data_941 = {
6895         .pdu = select_item_941,
6896         .pdu_len = sizeof(select_item_941),
6897         .qualifier = 0x00,
6898         .alpha_id = "Toolkit Select 1",
6899         .items = {
6900                 { .id = 1, .text = "Item 1" },
6901                 { .id = 2, .text = "Item 2" },
6902         },
6903         .text_attr = {
6904                 .len = 4,
6905                 .attributes = { 0x00, 0x10, 0x04, 0xB4 }
6906         },
6907         .item_text_attr_list = {
6908                 .len = 8,
6909                 .list = { 0x00, 0x06, 0x04, 0xB4, 0x00, 0x06, 0x04, 0xB4 }
6910         },
6911         .html = "<div style=\"text-align: left;\"><span style=\"font-size: "
6912                 "big;color: #347235;background-color: #FFFF00;\">"
6913                 "Toolkit Select 1</span></div>",
6914 };
6915
6916 static struct select_item_test select_item_data_942 = {
6917         .pdu = select_item_942,
6918         .pdu_len = sizeof(select_item_942),
6919         .qualifier = 0x00,
6920         .alpha_id = "Toolkit Select 2",
6921         .items = {
6922                 { .id = 1, .text = "Item 3" },
6923                 { .id = 2, .text = "Item 4" },
6924         },
6925         .text_attr = {
6926                 .len = 4,
6927                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
6928         },
6929         .item_text_attr_list = {
6930                 .len = 8,
6931                 .list = { 0x00, 0x06, 0x00, 0xB4, 0x00, 0x06, 0x00, 0xB4 }
6932         },
6933         .html = "<div style=\"text-align: left;\"><span style=\"color: "
6934                 "#347235;background-color: #FFFF00;\">Toolkit Select 2</span>"
6935                 "</div>",
6936 };
6937
6938 static struct select_item_test select_item_data_943 = {
6939         .pdu = select_item_943,
6940         .pdu_len = sizeof(select_item_943),
6941         .qualifier = 0x00,
6942         .alpha_id = "Toolkit Select 3",
6943         .items = {
6944                 { .id = 1, .text = "Item 5" },
6945                 { .id = 2, .text = "Item 6" },
6946         }
6947 };
6948
6949 static struct select_item_test select_item_data_951 = {
6950         .pdu = select_item_951,
6951         .pdu_len = sizeof(select_item_951),
6952         .qualifier = 0x00,
6953         .alpha_id = "Toolkit Select 1",
6954         .items = {
6955                 { .id = 1, .text = "Item 1" },
6956                 { .id = 2, .text = "Item 2" },
6957         },
6958         .text_attr = {
6959                 .len = 4,
6960                 .attributes = { 0x00, 0x10, 0x08, 0xB4 }
6961         },
6962         .item_text_attr_list = {
6963                 .len = 8,
6964                 .list = { 0x00, 0x06, 0x08, 0xB4, 0x00, 0x06, 0x08, 0xB4 }
6965         },
6966         .html = "<div style=\"text-align: left;\"><span style=\"font-size: "
6967                 "small;color: #347235;background-color: #FFFF00;\">"
6968                 "Toolkit Select 1</span></div>",
6969 };
6970
6971 static struct select_item_test select_item_data_952 = {
6972         .pdu = select_item_952,
6973         .pdu_len = sizeof(select_item_952),
6974         .qualifier = 0x00,
6975         .alpha_id = "Toolkit Select 2",
6976         .items = {
6977                 { .id = 1, .text = "Item 3" },
6978                 { .id = 2, .text = "Item 4" },
6979         },
6980         .text_attr = {
6981                 .len = 4,
6982                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
6983         },
6984         .item_text_attr_list = {
6985                 .len = 8,
6986                 .list = { 0x00, 0x06, 0x00, 0xB4, 0x00, 0x06, 0x00, 0xB4 }
6987         },
6988         .html = "<div style=\"text-align: left;\"><span style=\"color: "
6989                 "#347235;background-color: #FFFF00;\">Toolkit Select 2</span>"
6990                 "</div>",
6991 };
6992
6993 static struct select_item_test select_item_data_953 = {
6994         .pdu = select_item_953,
6995         .pdu_len = sizeof(select_item_953),
6996         .qualifier = 0x00,
6997         .alpha_id = "Toolkit Select 3",
6998         .items = {
6999                 { .id = 1, .text = "Item 5" },
7000                 { .id = 2, .text = "Item 6" },
7001         }
7002 };
7003
7004 static struct select_item_test select_item_data_961 = {
7005         .pdu = select_item_961,
7006         .pdu_len = sizeof(select_item_961),
7007         .qualifier = 0x00,
7008         .alpha_id = "Toolkit Select 1",
7009         .items = {
7010                 { .id = 1, .text = "Item 1" },
7011                 { .id = 2, .text = "Item 2" },
7012         },
7013         .text_attr = {
7014                 .len = 4,
7015                 .attributes = { 0x00, 0x10, 0x10, 0xB4 }
7016         },
7017         .item_text_attr_list = {
7018                 .len = 8,
7019                 .list = { 0x00, 0x06, 0x10, 0xB4, 0x00, 0x06, 0x10, 0xB4 }
7020         },
7021         .html = "<div style=\"text-align: left;\"><span style=\"font-weight: "
7022                 "bold;color: #347235;background-color: #FFFF00;\">"
7023                 "Toolkit Select 1</span></div>",
7024 };
7025
7026 static struct select_item_test select_item_data_962 = {
7027         .pdu = select_item_962,
7028         .pdu_len = sizeof(select_item_962),
7029         .qualifier = 0x00,
7030         .alpha_id = "Toolkit Select 2",
7031         .items = {
7032                 { .id = 1, .text = "Item 3" },
7033                 { .id = 2, .text = "Item 4" },
7034         },
7035         .text_attr = {
7036                 .len = 4,
7037                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
7038         },
7039         .item_text_attr_list = {
7040                 .len = 8,
7041                 .list = { 0x00, 0x06, 0x00, 0xB4, 0x00, 0x06, 0x00, 0xB4 }
7042         },
7043         .html = "<div style=\"text-align: left;\"><span style=\"color: "
7044                 "#347235;background-color: #FFFF00;\">Toolkit Select 2</span>"
7045                 "</div>",
7046 };
7047
7048 static struct select_item_test select_item_data_963 = {
7049         .pdu = select_item_963,
7050         .pdu_len = sizeof(select_item_963),
7051         .qualifier = 0x00,
7052         .alpha_id = "Toolkit Select 3",
7053         .items = {
7054                 { .id = 1, .text = "Item 5" },
7055                 { .id = 2, .text = "Item 6" },
7056         }
7057 };
7058
7059 static struct select_item_test select_item_data_971 = {
7060         .pdu = select_item_971,
7061         .pdu_len = sizeof(select_item_971),
7062         .qualifier = 0x00,
7063         .alpha_id = "Toolkit Select 1",
7064         .items = {
7065                 { .id = 1, .text = "Item 1" },
7066                 { .id = 2, .text = "Item 2" },
7067         },
7068         .text_attr = {
7069                 .len = 4,
7070                 .attributes = { 0x00, 0x10, 0x20, 0xB4 }
7071         },
7072         .item_text_attr_list = {
7073                 .len = 8,
7074                 .list = { 0x00, 0x06, 0x20, 0xB4, 0x00, 0x06, 0x20, 0xB4 }
7075         },
7076         .html = "<div style=\"text-align: left;\"><span style=\"font-style: "
7077                 "italic;color: #347235;background-color: #FFFF00;\">"
7078                 "Toolkit Select 1</span></div>"
7079 };
7080
7081 static struct select_item_test select_item_data_972 = {
7082         .pdu = select_item_972,
7083         .pdu_len = sizeof(select_item_972),
7084         .qualifier = 0x00,
7085         .alpha_id = "Toolkit Select 2",
7086         .items = {
7087                 { .id = 1, .text = "Item 3" },
7088                 { .id = 2, .text = "Item 4" },
7089         },
7090         .text_attr = {
7091                 .len = 4,
7092                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
7093         },
7094         .item_text_attr_list = {
7095                 .len = 8,
7096                 .list = { 0x00, 0x06, 0x00, 0xB4, 0x00, 0x06, 0x00, 0xB4 }
7097         },
7098         .html = "<div style=\"text-align: left;\"><span style=\"color: "
7099                 "#347235;background-color: #FFFF00;\">Toolkit Select 2</span>"
7100                 "</div>",
7101 };
7102
7103 static struct select_item_test select_item_data_973 = {
7104         .pdu = select_item_973,
7105         .pdu_len = sizeof(select_item_973),
7106         .qualifier = 0x00,
7107         .alpha_id = "Toolkit Select 3",
7108         .items = {
7109                 { .id = 1, .text = "Item 5" },
7110                 { .id = 2, .text = "Item 6" },
7111         }
7112 };
7113
7114 static struct select_item_test select_item_data_981 = {
7115         .pdu = select_item_981,
7116         .pdu_len = sizeof(select_item_981),
7117         .qualifier = 0x00,
7118         .alpha_id = "Toolkit Select 1",
7119         .items = {
7120                 { .id = 1, .text = "Item 1" },
7121                 { .id = 2, .text = "Item 2" },
7122         },
7123         .text_attr = {
7124                 .len = 4,
7125                 .attributes = { 0x00, 0x10, 0x40, 0xB4 }
7126         },
7127         .item_text_attr_list = {
7128                 .len = 8,
7129                 .list = { 0x00, 0x06, 0x40, 0xB4, 0x00, 0x06, 0x40, 0xB4 }
7130         },
7131         .html = "<div style=\"text-align: left;\"><span "
7132                 "style=\"text-decoration: underline;color: #347235;"
7133                 "background-color: #FFFF00;\">Toolkit Select 1</span></div>",
7134 };
7135
7136 static struct select_item_test select_item_data_982 = {
7137         .pdu = select_item_982,
7138         .pdu_len = sizeof(select_item_982),
7139         .qualifier = 0x00,
7140         .alpha_id = "Toolkit Select 2",
7141         .items = {
7142                 { .id = 1, .text = "Item 3" },
7143                 { .id = 2, .text = "Item 4" },
7144         },
7145         .text_attr = {
7146                 .len = 4,
7147                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
7148         },
7149         .item_text_attr_list = {
7150                 .len = 8,
7151                 .list = { 0x00, 0x06, 0x00, 0xB4, 0x00, 0x06, 0x00, 0xB4 }
7152         },
7153         .html = "<div style=\"text-align: left;\"><span style=\"color: "
7154                 "#347235;background-color: #FFFF00;\">Toolkit Select 2</span>"
7155                 "</div>",
7156 };
7157
7158 static struct select_item_test select_item_data_983 = {
7159         .pdu = select_item_983,
7160         .pdu_len = sizeof(select_item_983),
7161         .qualifier = 0x00,
7162         .alpha_id = "Toolkit Select 3",
7163         .items = {
7164                 { .id = 1, .text = "Item 5" },
7165                 { .id = 2, .text = "Item 6" },
7166         }
7167 };
7168
7169 static struct select_item_test select_item_data_991 = {
7170         .pdu = select_item_991,
7171         .pdu_len = sizeof(select_item_991),
7172         .qualifier = 0x00,
7173         .alpha_id = "Toolkit Select 1",
7174         .items = {
7175                 { .id = 1, .text = "Item 1" },
7176                 { .id = 2, .text = "Item 2" },
7177         },
7178         .text_attr = {
7179                 .len = 4,
7180                 .attributes = { 0x00, 0x10, 0x80, 0xB4 }
7181         },
7182         .item_text_attr_list = {
7183                 .len = 8,
7184                 .list = { 0x00, 0x06, 0x80, 0xB4, 0x00, 0x06, 0x80, 0xB4 }
7185         },
7186         .html = "<div style=\"text-align: left;\"><span "
7187                 "style=\"text-decoration: line-through;color: #347235;"
7188                 "background-color: #FFFF00;\">Toolkit Select 1</span></div>",
7189 };
7190
7191 static struct select_item_test select_item_data_992 = {
7192         .pdu = select_item_992,
7193         .pdu_len = sizeof(select_item_992),
7194         .qualifier = 0x00,
7195         .alpha_id = "Toolkit Select 2",
7196         .items = {
7197                 { .id = 1, .text = "Item 3" },
7198                 { .id = 2, .text = "Item 4" },
7199         },
7200         .text_attr = {
7201                 .len = 4,
7202                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
7203         },
7204         .item_text_attr_list = {
7205                 .len = 8,
7206                 .list = { 0x00, 0x06, 0x00, 0xB4, 0x00, 0x06, 0x00, 0xB4 }
7207         },
7208         .html = "<div style=\"text-align: left;\"><span style=\"color: "
7209                 "#347235;background-color: #FFFF00;\">Toolkit Select 2</span>"
7210                 "</div>",
7211 };
7212
7213 static struct select_item_test select_item_data_993 = {
7214         .pdu = select_item_993,
7215         .pdu_len = sizeof(select_item_993),
7216         .qualifier = 0x00,
7217         .alpha_id = "Toolkit Select 3",
7218         .items = {
7219                 { .id = 1, .text = "Item 5" },
7220                 { .id = 2, .text = "Item 6" },
7221         }
7222 };
7223
7224 static struct select_item_test select_item_data_9101 = {
7225         .pdu = select_item_9101,
7226         .pdu_len = sizeof(select_item_9101),
7227         .qualifier = 0x00,
7228         .alpha_id = "Toolkit Select 1",
7229         .items = {
7230                 { .id = 1, .text = "Item 1" },
7231                 { .id = 2, .text = "Item 2" },
7232         },
7233         .text_attr = {
7234                 .len = 4,
7235                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
7236         },
7237         .item_text_attr_list = {
7238                 .len = 8,
7239                 .list = { 0x00, 0x06, 0x00, 0xB4, 0x00, 0x06, 0x00, 0xB4 }
7240         },
7241         .html = "<div style=\"text-align: left;\"><span style=\"color: "
7242                 "#347235;background-color: #FFFF00;\">Toolkit Select 1</span>"
7243                 "</div>",
7244 };
7245
7246 static struct select_item_test select_item_data_9102 = {
7247         .pdu = select_item_9102,
7248         .pdu_len = sizeof(select_item_9102),
7249         .qualifier = 0x00,
7250         .alpha_id = "Toolkit Select 2",
7251         .items = {
7252                 { .id = 1, .text = "Item 3" },
7253                 { .id = 2, .text = "Item 4" },
7254         }
7255 };
7256
7257 static struct select_item_test select_item_data_1011 = {
7258         .pdu = select_item_1011,
7259         .pdu_len = sizeof(select_item_1011),
7260         .qualifier = 0x00,
7261         .alpha_id = "ЗДРАВСТВУЙТЕ",
7262         .items = {
7263                 { .id = 1, .text = "ЗДРАВСТВУЙТЕ1" },
7264                 { .id = 2, .text = "ЗДРАВСТВУЙТЕ2" },
7265                 { .id = 3, .text = "ЗДРАВСТВУЙТЕ3" },
7266         }
7267 };
7268
7269 static struct select_item_test select_item_data_1021 = {
7270         .pdu = select_item_1021,
7271         .pdu_len = sizeof(select_item_1021),
7272         .qualifier = 0x00,
7273         .alpha_id = "ЗДРАВСТВУЙТЕ",
7274         .items = {
7275                 { .id = 1, .text = "ЗДРАВСТВУЙТЕ1" },
7276                 { .id = 2, .text = "ЗДРАВСТВУЙТЕ2" },
7277                 { .id = 3, .text = "ЗДРАВСТВУЙТЕ3" },
7278         }
7279 };
7280
7281 static struct select_item_test select_item_data_1031 = {
7282         .pdu = select_item_1031,
7283         .pdu_len = sizeof(select_item_1031),
7284         .qualifier = 0x00,
7285         .alpha_id = "ЗДРАВСТВУЙТЕ",
7286         .items = {
7287                 { .id = 1, .text = "ЗДРАВСТВУЙТЕ1" },
7288                 { .id = 2, .text = "ЗДРАВСТВУЙТЕ2" },
7289                 { .id = 3, .text = "ЗДРАВСТВУЙТЕ3" },
7290         }
7291 };
7292
7293 static struct select_item_test select_item_data_1111 = {
7294         .pdu = select_item_1111,
7295         .pdu_len = sizeof(select_item_1111),
7296         .qualifier = 0x00,
7297         .alpha_id = "工具箱选择",
7298         .items = {
7299                 { .id = 1, .text = "项目一" },
7300                 { .id = 2, .text = "项目二" },
7301                 { .id = 3, .text = "项目三" },
7302                 { .id = 4, .text = "项目四" },
7303         }
7304 };
7305
7306 static struct select_item_test select_item_data_1211 = {
7307         .pdu = select_item_1211,
7308         .pdu_len = sizeof(select_item_1211),
7309         .qualifier = 0x00,
7310         .alpha_id = "80ル0",
7311         .items = {
7312                 { .id = 1, .text = "80ル1" },
7313                 { .id = 2, .text = "80ル2" },
7314                 { .id = 3, .text = "80ル3" },
7315         }
7316 };
7317
7318 static struct select_item_test select_item_data_1221 = {
7319         .pdu = select_item_1221,
7320         .pdu_len = sizeof(select_item_1221),
7321         .qualifier = 0x00,
7322         .alpha_id = "81ル0",
7323         .items = {
7324                 { .id = 1, .text = "81ル1" },
7325                 { .id = 2, .text = "81ル2" },
7326                 { .id = 3, .text = "81ル3" },
7327         }
7328 };
7329
7330 static struct select_item_test select_item_data_1231 = {
7331         .pdu = select_item_1231,
7332         .pdu_len = sizeof(select_item_1231),
7333         .qualifier = 0x00,
7334         .alpha_id = "82ル0",
7335         .items = {
7336                 { .id = 1, .text = "82ル1" },
7337                 { .id = 2, .text = "82ル2" },
7338                 { .id = 3, .text = "82ル3" },
7339         }
7340 };
7341
7342 static void test_select_item(gconstpointer data)
7343 {
7344         const struct select_item_test *test = data;
7345         struct stk_command *command;
7346
7347         command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
7348
7349         g_assert(command);
7350         g_assert(command->status == STK_PARSE_RESULT_OK);
7351
7352         g_assert(command->number == 1);
7353         g_assert(command->type == STK_COMMAND_TYPE_SELECT_ITEM);
7354         g_assert(command->qualifier == test->qualifier);
7355
7356         g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
7357         g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_TERMINAL);
7358
7359         check_alpha_id(command->select_item.alpha_id, test->alpha_id);
7360         check_items(command->select_item.items, test->items);
7361         check_items_next_action_indicator(&command->select_item.next_act,
7362                                                 &test->next_act);
7363         check_item_id(command->select_item.item_id, test->item_id);
7364         check_icon_id(&command->select_item.icon_id, &test->icon_id);
7365         check_item_icon_id_list(&command->select_item.item_icon_id_list,
7366                                         &test->item_icon_id_list);
7367         check_text_attr(&command->select_item.text_attr, &test->text_attr);
7368         check_item_text_attribute_list(
7369                                 &command->select_item.item_text_attr_list,
7370                                 &test->item_text_attr_list);
7371         check_text_attr_html(&command->select_item.text_attr,
7372                                 command->select_item.alpha_id, test->html);
7373         check_frame_id(&command->select_item.frame_id, &test->frame_id);
7374
7375         stk_command_free(command);
7376 }
7377
7378 struct send_sms_test {
7379         const unsigned char *pdu;
7380         unsigned int pdu_len;
7381         unsigned char qualifier;
7382         char *alpha_id;
7383         struct sms_test gsm_sms;
7384         struct stk_common_byte_array cdma_sms;
7385         struct stk_icon_id icon_id;
7386         struct stk_text_attribute text_attr;
7387         struct stk_frame_id frame_id;
7388 };
7389
7390 /* 3GPP TS 31.124 Section 27.22.4.10.1.4.2 */
7391 static unsigned char send_sms_111[] = { 0xD0, 0x37, 0x81, 0x03, 0x01, 0x13,
7392                                                 0x00, 0x82, 0x02, 0x81, 0x83,
7393                                                 0x85, 0x07, 0x53, 0x65, 0x6E,
7394                                                 0x64, 0x20, 0x53, 0x4D, 0x86,
7395                                                 0x09, 0x91, 0x11, 0x22, 0x33,
7396                                                 0x44, 0x55, 0x66, 0x77, 0xF8,
7397                                                 0x8B, 0x18, 0x01, 0x00, 0x09,
7398                                                 0x91, 0x10, 0x32, 0x54, 0x76,
7399                                                 0xF8, 0x40, 0xF4, 0x0C, 0x54,
7400                                                 0x65, 0x73, 0x74, 0x20, 0x4D,
7401                                                 0x65, 0x73, 0x73, 0x61, 0x67,
7402                                                 0x65 };
7403
7404 static unsigned char send_sms_121[] = { 0xD0, 0x32, 0x81, 0x03, 0x01, 0x13,
7405                                                 0x01, 0x82, 0x02, 0x81, 0x83,
7406                                                 0x85, 0x07, 0x53, 0x65, 0x6E,
7407                                                 0x64, 0x20, 0x53, 0x4D, 0x86,
7408                                                 0x09, 0x91, 0x11, 0x22, 0x33,
7409                                                 0x44, 0x55, 0x66, 0x77, 0xF8,
7410                                                 0x8B, 0x13, 0x01, 0x00, 0x09,
7411                                                 0x91, 0x10, 0x32, 0x54, 0x76,
7412                                                 0xF8, 0x40, 0xF4, 0x07, 0x53,
7413                                                 0x65, 0x6E, 0x64, 0x20, 0x53,
7414                                                 0x4D };
7415
7416 static unsigned char send_sms_131[] = { 0xD0, 0x3D, 0x81, 0x03, 0x01, 0x13,
7417                                                 0x00, 0x82, 0x02, 0x81, 0x83,
7418                                                 0x85, 0x0D, 0x53, 0x68, 0x6F,
7419                                                 0x72, 0x74, 0x20, 0x4D, 0x65,
7420                                                 0x73, 0x73, 0x61, 0x67, 0x65,
7421                                                 0x86, 0x09, 0x91, 0x11, 0x22,
7422                                                 0x33, 0x44, 0x55, 0x66, 0x77,
7423                                                 0xF8, 0x8B, 0x18, 0x01, 0x00,
7424                                                 0x09, 0x91, 0x10, 0x32, 0x54,
7425                                                 0x76, 0xF8, 0x40, 0xF0, 0x0D,
7426                                                 0x53, 0xF4, 0x5B, 0x4E, 0x07,
7427                                                 0x35, 0xCB, 0xF3, 0x79, 0xF8,
7428                                                 0x5C, 0x06 };
7429
7430 static unsigned char send_sms_141[] = { 0xD0, 0x81, 0xFD, 0x81, 0x03, 0x01,
7431                                                 0x13, 0x01, 0x82, 0x02, 0x81,
7432                                                 0x83, 0x85, 0x38, 0x54, 0x68,
7433                                                 0x65, 0x20, 0x61, 0x64, 0x64,
7434                                                 0x72, 0x65, 0x73, 0x73, 0x20,
7435                                                 0x64, 0x61, 0x74, 0x61, 0x20,
7436                                                 0x6F, 0x62, 0x6A, 0x65, 0x63,
7437                                                 0x74, 0x20, 0x68, 0x6F, 0x6C,
7438                                                 0x64, 0x73, 0x20, 0x74, 0x68,
7439                                                 0x65, 0x20, 0x52, 0x50, 0x11,
7440                                                 0x44, 0x65, 0x73, 0x74, 0x69,
7441                                                 0x6E, 0x61, 0x74, 0x69, 0x6F,
7442                                                 0x6E, 0x11, 0x41, 0x64, 0x64,
7443                                                 0x72, 0x65, 0x73, 0x73, 0x86,
7444                                                 0x09, 0x91, 0x11, 0x22, 0x33,
7445                                                 0x44, 0x55, 0x66, 0x77, 0xF8,
7446                                                 0x8B, 0x81, 0xAC, 0x01, 0x00,
7447                                                 0x09, 0x91, 0x10, 0x32, 0x54,
7448                                                 0x76, 0xF8, 0x40, 0xF4, 0xA0,
7449                                                 0x54, 0x77, 0x6F, 0x20, 0x74,
7450                                                 0x79, 0x70, 0x65, 0x73, 0x20,
7451                                                 0x61, 0x72, 0x65, 0x20, 0x64,
7452                                                 0x65, 0x66, 0x69, 0x6E, 0x65,
7453                                                 0x64, 0x3A, 0x20, 0x2D, 0x20,
7454                                                 0x41, 0x20, 0x73, 0x68, 0x6F,
7455                                                 0x72, 0x74, 0x20, 0x6D, 0x65,
7456                                                 0x73, 0x73, 0x61, 0x67, 0x65,
7457                                                 0x20, 0x74, 0x6F, 0x20, 0x62,
7458                                                 0x65, 0x20, 0x73, 0x65, 0x6E,
7459                                                 0x74, 0x20, 0x74, 0x6F, 0x20,
7460                                                 0x74, 0x68, 0x65, 0x20, 0x6E,
7461                                                 0x65, 0x74, 0x77, 0x6F, 0x72,
7462                                                 0x6B, 0x20, 0x69, 0x6E, 0x20,
7463                                                 0x61, 0x6E, 0x20, 0x53, 0x4D,
7464                                                 0x53, 0x2D, 0x53, 0x55, 0x42,
7465                                                 0x4D, 0x49, 0x54, 0x20, 0x6D,
7466                                                 0x65, 0x73, 0x73, 0x61, 0x67,
7467                                                 0x65, 0x2C, 0x20, 0x6F, 0x72,
7468                                                 0x20, 0x61, 0x6E, 0x20, 0x53,
7469                                                 0x4D, 0x53, 0x2D, 0x43, 0x4F,
7470                                                 0x4D, 0x4D, 0x41, 0x4E, 0x44,
7471                                                 0x20, 0x6D, 0x65, 0x73, 0x73,
7472                                                 0x61, 0x67, 0x65, 0x2C, 0x20,
7473                                                 0x77, 0x68, 0x65, 0x72, 0x65,
7474                                                 0x20, 0x74, 0x68, 0x65, 0x20,
7475                                                 0x75, 0x73, 0x65, 0x72, 0x20,
7476                                                 0x64, 0x61, 0x74, 0x61, 0x20,
7477                                                 0x63, 0x61, 0x6E, 0x20, 0x62,
7478                                                 0x65, 0x20, 0x70, 0x61, 0x73,
7479                                                 0x73, 0x65, 0x64, 0x20, 0x74,
7480                                                 0x72, 0x61, 0x6E, 0x73, 0x70 };
7481
7482 static unsigned char send_sms_151[] = { 0xD0, 0x81, 0xE9, 0x81, 0x03, 0x01,
7483                                                 0x13, 0x00, 0x82, 0x02, 0x81,
7484                                                 0x83, 0x85, 0x38, 0x54, 0x68,
7485                                                 0x65, 0x20, 0x61, 0x64, 0x64,
7486                                                 0x72, 0x65, 0x73, 0x73, 0x20,
7487                                                 0x64, 0x61, 0x74, 0x61, 0x20,
7488                                                 0x6F, 0x62, 0x6A, 0x65, 0x63,
7489                                                 0x74, 0x20, 0x68, 0x6F, 0x6C,
7490                                                 0x64, 0x73, 0x20, 0x74, 0x68,
7491                                                 0x65, 0x20, 0x52, 0x50, 0x20,
7492                                                 0x44, 0x65, 0x73, 0x74, 0x69,
7493                                                 0x6E, 0x61, 0x74, 0x69, 0x6F,
7494                                                 0x6E, 0x20, 0x41, 0x64, 0x64,
7495                                                 0x72, 0x65, 0x73, 0x73, 0x86,
7496                                                 0x09, 0x91, 0x11, 0x22, 0x33,
7497                                                 0x44, 0x55, 0x66, 0x77, 0xF8,
7498                                                 0x8B, 0x81, 0x98, 0x01, 0x00,
7499                                                 0x09, 0x91, 0x10, 0x32, 0x54,
7500                                                 0x76, 0xF8, 0x40, 0xF0, 0xA0,
7501                                                 0xD4, 0xFB, 0x1B, 0x44, 0xCF,
7502                                                 0xC3, 0xCB, 0x73, 0x50, 0x58,
7503                                                 0x5E, 0x06, 0x91, 0xCB, 0xE6,
7504                                                 0xB4, 0xBB, 0x4C, 0xD6, 0x81,
7505                                                 0x5A, 0xA0, 0x20, 0x68, 0x8E,
7506                                                 0x7E, 0xCB, 0xE9, 0xA0, 0x76,
7507                                                 0x79, 0x3E, 0x0F, 0x9F, 0xCB,
7508                                                 0x20, 0xFA, 0x1B, 0x24, 0x2E,
7509                                                 0x83, 0xE6, 0x65, 0x37, 0x1D,
7510                                                 0x44, 0x7F, 0x83, 0xE8, 0xE8,
7511                                                 0x32, 0xC8, 0x5D, 0xA6, 0xDF,
7512                                                 0xDF, 0xF2, 0x35, 0x28, 0xED,
7513                                                 0x06, 0x85, 0xDD, 0xA0, 0x69,
7514                                                 0x73, 0xDA, 0x9A, 0x56, 0x85,
7515                                                 0xCD, 0x24, 0x15, 0xD4, 0x2E,
7516                                                 0xCF, 0xE7, 0xE1, 0x73, 0x99,
7517                                                 0x05, 0x7A, 0xCB, 0x41, 0x61,
7518                                                 0x37, 0x68, 0xDA, 0x9C, 0xB6,
7519                                                 0x86, 0xCF, 0x66, 0x33, 0xE8,
7520                                                 0x24, 0x82, 0xDA, 0xE5, 0xF9,
7521                                                 0x3C, 0x7C, 0x2E, 0xB3, 0x40,
7522                                                 0x77, 0x74, 0x59, 0x5E, 0x06,
7523                                                 0xD1, 0xD1, 0x65, 0x50, 0x7D,
7524                                                 0x5E, 0x96, 0x83, 0xC8, 0x61,
7525                                                 0x7A, 0x18, 0x34, 0x0E, 0xBB,
7526                                                 0x41, 0xE2, 0x32, 0x08, 0x1E,
7527                                                 0x9E, 0xCF, 0xCB, 0x64, 0x10,
7528                                                 0x5D, 0x1E, 0x76, 0xCF, 0xE1 };
7529
7530 static unsigned char send_sms_161[] = { 0xD0, 0x81, 0xFD, 0x81, 0x03, 0x01,
7531                                                 0x13, 0x00, 0x82, 0x02, 0x81,
7532                                                 0x83, 0x85, 0x81, 0xE6, 0x54,
7533                                                 0x77, 0x6F, 0x20, 0x74, 0x79,
7534                                                 0x70, 0x65, 0x73, 0x20, 0x61,
7535                                                 0x72, 0x65, 0x20, 0x64, 0x65,
7536                                                 0x66, 0x69, 0x6E, 0x65, 0x64,
7537                                                 0x3A, 0x20, 0x2D, 0x20, 0x41,
7538                                                 0x20, 0x73, 0x68, 0x6F, 0x72,
7539                                                 0x74, 0x20, 0x6D, 0x65, 0x73,
7540                                                 0x73, 0x61, 0x67, 0x65, 0x20,
7541                                                 0x74, 0x6F, 0x20, 0x62, 0x65,
7542                                                 0x20, 0x73, 0x65, 0x6E, 0x74,
7543                                                 0x20, 0x74, 0x6F, 0x20, 0x74,
7544                                                 0x68, 0x65, 0x20, 0x6E, 0x65,
7545                                                 0x74, 0x77, 0x6F, 0x72, 0x6B,
7546                                                 0x20, 0x69, 0x6E, 0x20, 0x61,
7547                                                 0x6E, 0x20, 0x53, 0x4D, 0x53,
7548                                                 0x2D, 0x53, 0x55, 0x42, 0x4D,
7549                                                 0x49, 0x54, 0x20, 0x6D, 0x65,
7550                                                 0x73, 0x73, 0x61, 0x67, 0x65,
7551                                                 0x2C, 0x20, 0x6F, 0x72, 0x20,
7552                                                 0x61, 0x6E, 0x20, 0x53, 0x4D,
7553                                                 0x53, 0x2D, 0x43, 0x4F, 0x4D,
7554                                                 0x4D, 0x41, 0x4E, 0x44, 0x20,
7555                                                 0x6D, 0x65, 0x73, 0x73, 0x61,
7556                                                 0x67, 0x65, 0x2C, 0x20, 0x77,
7557                                                 0x68, 0x65, 0x72, 0x65, 0x20,
7558                                                 0x74, 0x68, 0x65, 0x20, 0x75,
7559                                                 0x73, 0x65, 0x72, 0x20, 0x64,
7560                                                 0x61, 0x74, 0x61, 0x20, 0x63,
7561                                                 0x61, 0x6E, 0x20, 0x62, 0x65,
7562                                                 0x20, 0x70, 0x61, 0x73, 0x73,
7563                                                 0x65, 0x64, 0x20, 0x74, 0x72,
7564                                                 0x61, 0x6E, 0x73, 0x70, 0x61,
7565                                                 0x72, 0x65, 0x6E, 0x74, 0x6C,
7566                                                 0x79, 0x3B, 0x20, 0x2D, 0x20,
7567                                                 0x41, 0x20, 0x73, 0x68, 0x6F,
7568                                                 0x72, 0x74, 0x20, 0x6D, 0x65,
7569                                                 0x73, 0x73, 0x61, 0x67, 0x65,
7570                                                 0x20, 0x74, 0x6F, 0x20, 0x62,
7571                                                 0x65, 0x20, 0x73, 0x65, 0x6E,
7572                                                 0x74, 0x20, 0x74, 0x6F, 0x20,
7573                                                 0x74, 0x68, 0x65, 0x20, 0x6E,
7574                                                 0x65, 0x74, 0x77, 0x6F, 0x72,
7575                                                 0x6B, 0x20, 0x69, 0x6E, 0x20,
7576                                                 0x61, 0x6E, 0x20, 0x53, 0x4D,
7577                                                 0x53, 0x2D, 0x53, 0x55, 0x42,
7578                                                 0x4D, 0x49, 0x54, 0x20, 0x8B,
7579                                                 0x09, 0x01, 0x00, 0x02, 0x91,
7580                                                 0x10, 0x40, 0xF0, 0x01, 0x20 };
7581
7582 static unsigned char send_sms_171[] = { 0xD0, 0x30, 0x81, 0x03, 0x01, 0x13,
7583                                                 0x00, 0x82, 0x02, 0x81, 0x83,
7584                                                 0x85, 0x00, 0x86, 0x09, 0x91,
7585                                                 0x11, 0x22, 0x33, 0x44, 0x55,
7586                                                 0x66, 0x77, 0xF8, 0x8B, 0x18,
7587                                                 0x01, 0x00, 0x09, 0x91, 0x10,
7588                                                 0x32, 0x54, 0x76, 0xF8, 0x40,
7589                                                 0xF4, 0x0C, 0x54, 0x65, 0x73,
7590                                                 0x74, 0x20, 0x4D, 0x65, 0x73,
7591                                                 0x73, 0x61, 0x67, 0x65 };
7592
7593 static unsigned char send_sms_181[] = { 0xD0, 0x2E, 0x81, 0x03, 0x01, 0x13,
7594                                                 0x00, 0x82, 0x02, 0x81, 0x83,
7595                                                 0x86, 0x09, 0x91, 0x11, 0x22,
7596                                                 0x33, 0x44, 0x55, 0x66, 0x77,
7597                                                 0xF8, 0x8B, 0x18, 0x01, 0x00,
7598                                                 0x09, 0x91, 0x10, 0x32, 0x54,
7599                                                 0x76, 0xF8, 0x40, 0xF4, 0x0C,
7600                                                 0x54, 0x65, 0x73, 0x74, 0x20,
7601                                                 0x4D, 0x65, 0x73, 0x73, 0x61,
7602                                                 0x67, 0x65 };
7603
7604 static unsigned char send_sms_211[] = { 0xD0, 0x55, 0x81, 0x03, 0x01, 0x13,
7605                                                 0x00, 0x82, 0x02, 0x81, 0x83,
7606                                                 0x85, 0x19, 0x80, 0x04, 0x17,
7607                                                 0x04, 0x14, 0x04, 0x20, 0x04,
7608                                                 0x10, 0x04, 0x12, 0x04, 0x21,
7609                                                 0x04, 0x22, 0x04, 0x12, 0x04,
7610                                                 0x23, 0x04, 0x19, 0x04, 0x22,
7611                                                 0x04, 0x15, 0x86, 0x09, 0x91,
7612                                                 0x11, 0x22, 0x33, 0x44, 0x55,
7613                                                 0x66, 0x77, 0xF8, 0x8B, 0x24,
7614                                                 0x01, 0x00, 0x09, 0x91, 0x10,
7615                                                 0x32, 0x54, 0x76, 0xF8, 0x40,
7616                                                 0x08, 0x18, 0x04, 0x17, 0x04,
7617                                                 0x14, 0x04, 0x20, 0x04, 0x10,
7618                                                 0x04, 0x12, 0x04, 0x21, 0x04,
7619                                                 0x22, 0x04, 0x12, 0x04, 0x23,
7620                                                 0x04, 0x19, 0x04, 0x22, 0x04,
7621                                                 0x15 };
7622
7623 static unsigned char send_sms_212[] = { 0xD0, 0x4B, 0x81, 0x03, 0x01, 0x13,
7624                                                 0x00, 0x82, 0x02, 0x81, 0x83,
7625                                                 0x85, 0x0F, 0x81, 0x0C, 0x08,
7626                                                 0x97, 0x94, 0xA0, 0x90, 0x92,
7627                                                 0xA1, 0xA2, 0x92, 0xA3, 0x99,
7628                                                 0xA2, 0x95, 0x86, 0x09, 0x91,
7629                                                 0x11, 0x22, 0x33, 0x44, 0x55,
7630                                                 0x66, 0x77, 0xF8, 0x8B, 0x24,
7631                                                 0x01, 0x00, 0x09, 0x91, 0x10,
7632                                                 0x32, 0x54, 0x76, 0xF8, 0x40,
7633                                                 0x08, 0x18, 0x04, 0x17, 0x04,
7634                                                 0x14, 0x04, 0x20, 0x04, 0x10,
7635                                                 0x04, 0x12, 0x04, 0x21, 0x04,
7636                                                 0x22, 0x04, 0x12, 0x04, 0x23,
7637                                                 0x04, 0x19, 0x04, 0x22, 0x04,
7638                                                 0x15 };
7639
7640 static unsigned char send_sms_213[] = { 0xD0, 0x4C, 0x81, 0x03, 0x01, 0x13,
7641                                                 0x00, 0x82, 0x02, 0x81, 0x83,
7642                                                 0x85, 0x10, 0x82, 0x0C, 0x04,
7643                                                 0x10, 0x87, 0x84, 0x90, 0x80,
7644                                                 0x82, 0x91, 0x92, 0x82, 0x93,
7645                                                 0x89, 0x92, 0x85, 0x86, 0x09,
7646                                                 0x91, 0x11, 0x22, 0x33, 0x44,
7647                                                 0x55, 0x66, 0x77, 0xF8, 0x8B,
7648                                                 0x24, 0x01, 0x00, 0x09, 0x91,
7649                                                 0x10, 0x32, 0x54, 0x76, 0xF8,
7650                                                 0x40, 0x08, 0x18, 0x04, 0x17,
7651                                                 0x04, 0x14, 0x04, 0x20, 0x04,
7652                                                 0x10, 0x04, 0x12, 0x04, 0x21,
7653                                                 0x04, 0x22, 0x04, 0x12, 0x04,
7654                                                 0x23, 0x04, 0x19, 0x04, 0x22,
7655                                                 0x04, 0x15 };
7656
7657 static unsigned char send_sms_311[] = { 0xD0, 0x3B, 0x81, 0x03, 0x01, 0x13,
7658                                                 0x00, 0x82, 0x02, 0x81, 0x83,
7659                                                 0x85, 0x07, 0x4E, 0x4F, 0x20,
7660                                                 0x49, 0x43, 0x4F, 0x4E, 0x86,
7661                                                 0x09, 0x91, 0x11, 0x22, 0x33,
7662                                                 0x44, 0x55, 0x66, 0x77, 0xF8,
7663                                                 0x8B, 0x18, 0x01, 0x00, 0x09,
7664                                                 0x91, 0x10, 0x32, 0x54, 0x76,
7665                                                 0xF8, 0x40, 0xF4, 0x0C, 0x54,
7666                                                 0x65, 0x73, 0x74, 0x20, 0x4D,
7667                                                 0x65, 0x73, 0x73, 0x61, 0x67,
7668                                                 0x65, 0x9E, 0x02, 0x00, 0x01 };
7669
7670 static unsigned char send_sms_321[] = { 0xD0, 0x3B, 0x81, 0x03, 0x01, 0x13,
7671                                                 0x00, 0x82, 0x02, 0x81, 0x83,
7672                                                 0x85, 0x07, 0x53, 0x65, 0x6E,
7673                                                 0x64, 0x20, 0x53, 0x4D, 0x86,
7674                                                 0x09, 0x91, 0x11, 0x22, 0x33,
7675                                                 0x44, 0x55, 0x66, 0x77, 0xF8,
7676                                                 0x8B, 0x18, 0x01, 0x00, 0x09,
7677                                                 0x91, 0x10, 0x32, 0x54, 0x76,
7678                                                 0xF8, 0x40, 0xF4, 0x0C, 0x54,
7679                                                 0x65, 0x73, 0x74, 0x20, 0x4D,
7680                                                 0x65, 0x73, 0x73, 0x61, 0x67,
7681                                                 0x65, 0x1E, 0x02, 0x01, 0x01 };
7682
7683 static unsigned char send_sms_411[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x13,
7684                                                 0x00, 0x82, 0x02, 0x81, 0x83,
7685                                                 0x85, 0x10, 0x54, 0x65, 0x78,
7686                                                 0x74, 0x20, 0x41, 0x74, 0x74,
7687                                                 0x72, 0x69, 0x62, 0x75, 0x74,
7688                                                 0x65, 0x20, 0x31, 0x8B, 0x09,
7689                                                 0x01, 0x00, 0x02, 0x91, 0x10,
7690                                                 0x40, 0xF0, 0x01, 0x20, 0xD0,
7691                                                 0x04, 0x00, 0x10, 0x00, 0xB4 };
7692
7693 static unsigned char send_sms_412[] = { 0xD0, 0x26, 0x81, 0x03, 0x01, 0x13,
7694                                                 0x00, 0x82, 0x02, 0x81, 0x83,
7695                                                 0x85, 0x10, 0x54, 0x65, 0x78,
7696                                                 0x74, 0x20, 0x41, 0x74, 0x74,
7697                                                 0x72, 0x69, 0x62, 0x75, 0x74,
7698                                                 0x65, 0x20, 0x32, 0x8B, 0x09,
7699                                                 0x01, 0x00, 0x02, 0x91, 0x10,
7700                                                 0x40, 0xF0, 0x01, 0x20 };
7701
7702 static unsigned char send_sms_421[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x13,
7703                                                 0x00, 0x82, 0x02, 0x81, 0x83,
7704                                                 0x85, 0x10, 0x54, 0x65, 0x78,
7705                                                 0x74, 0x20, 0x41, 0x74, 0x74,
7706                                                 0x72, 0x69, 0x62, 0x75, 0x74,
7707                                                 0x65, 0x20, 0x31, 0x8B, 0x09,
7708                                                 0x01, 0x00, 0x02, 0x91, 0x10,
7709                                                 0x40, 0xF0, 0x01, 0x20, 0xD0,
7710                                                 0x04, 0x00, 0x10, 0x01, 0xB4 };
7711
7712 static unsigned char send_sms_422[] = { 0xD0, 0x26, 0x81, 0x03, 0x01, 0x13,
7713                                                 0x00, 0x82, 0x02, 0x81, 0x83,
7714                                                 0x85, 0x10, 0x54, 0x65, 0x78,
7715                                                 0x74, 0x20, 0x41, 0x74, 0x74,
7716                                                 0x72, 0x69, 0x62, 0x75, 0x74,
7717                                                 0x65, 0x20, 0x32, 0x8B, 0x09,
7718                                                 0x01, 0x00, 0x02, 0x91, 0x10,
7719                                                 0x40, 0xF0, 0x01, 0x20 };
7720
7721 static unsigned char send_sms_431[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x13,
7722                                                 0x00, 0x82, 0x02, 0x81, 0x83,
7723                                                 0x85, 0x10, 0x54, 0x65, 0x78,
7724                                                 0x74, 0x20, 0x41, 0x74, 0x74,
7725                                                 0x72, 0x69, 0x62, 0x75, 0x74,
7726                                                 0x65, 0x20, 0x31, 0x8B, 0x09,
7727                                                 0x01, 0x00, 0x02, 0x91, 0x10,
7728                                                 0x40, 0xF0, 0x01, 0x20, 0xD0,
7729                                                 0x04, 0x00, 0x10, 0x02, 0xB4 };
7730
7731 static unsigned char send_sms_432[] = { 0xD0, 0x26, 0x81, 0x03, 0x01, 0x13,
7732                                                 0x00, 0x82, 0x02, 0x81, 0x83,
7733                                                 0x85, 0x10, 0x54, 0x65, 0x78,
7734                                                 0x74, 0x20, 0x41, 0x74, 0x74,
7735                                                 0x72, 0x69, 0x62, 0x75, 0x74,
7736                                                 0x65, 0x20, 0x32, 0x8B, 0x09,
7737                                                 0x01, 0x00, 0x02, 0x91, 0x10,
7738                                                 0x40, 0xF0, 0x01, 0x20 };
7739
7740 static unsigned char send_sms_441[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x13,
7741                                                 0x00, 0x82, 0x02, 0x81, 0x83,
7742                                                 0x85, 0x10, 0x54, 0x65, 0x78,
7743                                                 0x74, 0x20, 0x41, 0x74, 0x74,
7744                                                 0x72, 0x69, 0x62, 0x75, 0x74,
7745                                                 0x65, 0x20, 0x31, 0x8B, 0x09,
7746                                                 0x01, 0x00, 0x02, 0x91, 0x10,
7747                                                 0x40, 0xF0, 0x01, 0x20, 0xD0,
7748                                                 0x04, 0x00, 0x10, 0x04, 0xB4 };
7749
7750 static unsigned char send_sms_442[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x13,
7751                                                 0x00, 0x82, 0x02, 0x81, 0x83,
7752                                                 0x85, 0x10, 0x54, 0x65, 0x78,
7753                                                 0x74, 0x20, 0x41, 0x74, 0x74,
7754                                                 0x72, 0x69, 0x62, 0x75, 0x74,
7755                                                 0x65, 0x20, 0x32, 0x8B, 0x09,
7756                                                 0x01, 0x00, 0x02, 0x91, 0x10,
7757                                                 0x40, 0xF0, 0x01, 0x20, 0xD0,
7758                                                 0x04, 0x00, 0x10, 0x00, 0xB4 };
7759
7760 static unsigned char send_sms_443[] = { 0xD0, 0x26, 0x81, 0x03, 0x01, 0x13,
7761                                                 0x00, 0x82, 0x02, 0x81, 0x83,
7762                                                 0x85, 0x10, 0x54, 0x65, 0x78,
7763                                                 0x74, 0x20, 0x41, 0x74, 0x74,
7764                                                 0x72, 0x69, 0x62, 0x75, 0x74,
7765                                                 0x65, 0x20, 0x33, 0x8B, 0x09,
7766                                                 0x01, 0x00, 0x02, 0x91, 0x10,
7767                                                 0x40, 0xF0, 0x01, 0x20 };
7768
7769 static unsigned char send_sms_451[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x13,
7770                                                 0x00, 0x82, 0x02, 0x81, 0x83,
7771                                                 0x85, 0x10, 0x54, 0x65, 0x78,
7772                                                 0x74, 0x20, 0x41, 0x74, 0x74,
7773                                                 0x72, 0x69, 0x62, 0x75, 0x74,
7774                                                 0x65, 0x20, 0x31, 0x8B, 0x09,
7775                                                 0x01, 0x00, 0x02, 0x91, 0x10,
7776                                                 0x40, 0xF0, 0x01, 0x20, 0xD0,
7777                                                 0x04, 0x00, 0x10, 0x08, 0xB4 };
7778
7779 static unsigned char send_sms_452[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x13,
7780                                                 0x00, 0x82, 0x02, 0x81, 0x83,
7781                                                 0x85, 0x10, 0x54, 0x65, 0x78,
7782                                                 0x74, 0x20, 0x41, 0x74, 0x74,
7783                                                 0x72, 0x69, 0x62, 0x75, 0x74,
7784                                                 0x65, 0x20, 0x32, 0x8B, 0x09,
7785                                                 0x01, 0x00, 0x02, 0x91, 0x10,
7786                                                 0x40, 0xF0, 0x01, 0x20, 0xD0,
7787                                                 0x04, 0x00, 0x10, 0x00, 0xB4 };
7788
7789 static unsigned char send_sms_453[] = { 0xD0, 0x26, 0x81, 0x03, 0x01, 0x13,
7790                                                 0x00, 0x82, 0x02, 0x81, 0x83,
7791                                                 0x85, 0x10, 0x54, 0x65, 0x78,
7792                                                 0x74, 0x20, 0x41, 0x74, 0x74,
7793                                                 0x72, 0x69, 0x62, 0x75, 0x74,
7794                                                 0x65, 0x20, 0x33, 0x8B, 0x09,
7795                                                 0x01, 0x00, 0x02, 0x91, 0x10,
7796                                                 0x40, 0xF0, 0x01, 0x20 };
7797
7798 static unsigned char send_sms_461[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x13,
7799                                                 0x00, 0x82, 0x02, 0x81, 0x83,
7800                                                 0x85, 0x10, 0x54, 0x65, 0x78,
7801                                                 0x74, 0x20, 0x41, 0x74, 0x74,
7802                                                 0x72, 0x69, 0x62, 0x75, 0x74,
7803                                                 0x65, 0x20, 0x31, 0x8B, 0x09,
7804                                                 0x01, 0x00, 0x02, 0x91, 0x10,
7805                                                 0x40, 0xF0, 0x01, 0x20, 0xD0,
7806                                                 0x04, 0x00, 0x10, 0x10, 0xB4 };
7807
7808 static unsigned char send_sms_462[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x13,
7809                                                 0x00, 0x82, 0x02, 0x81, 0x83,
7810                                                 0x85, 0x10, 0x54, 0x65, 0x78,
7811                                                 0x74, 0x20, 0x41, 0x74, 0x74,
7812                                                 0x72, 0x69, 0x62, 0x75, 0x74,
7813                                                 0x65, 0x20, 0x32, 0x8B, 0x09,
7814                                                 0x01, 0x00, 0x02, 0x91, 0x10,
7815                                                 0x40, 0xF0, 0x01, 0x20, 0xD0,
7816                                                 0x04, 0x00, 0x10, 0x00, 0xB4 };
7817
7818 static unsigned char send_sms_463[] = { 0xD0, 0x26, 0x81, 0x03, 0x01, 0x13,
7819                                                 0x00, 0x82, 0x02, 0x81, 0x83,
7820                                                 0x85, 0x10, 0x54, 0x65, 0x78,
7821                                                 0x74, 0x20, 0x41, 0x74, 0x74,
7822                                                 0x72, 0x69, 0x62, 0x75, 0x74,
7823                                                 0x65, 0x20, 0x33, 0x8B, 0x09,
7824                                                 0x01, 0x00, 0x02, 0x91, 0x10,
7825                                                 0x40, 0xF0, 0x01, 0x20 };
7826
7827 static unsigned char send_sms_471[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x13,
7828                                                 0x00, 0x82, 0x02, 0x81, 0x83,
7829                                                 0x85, 0x10, 0x54, 0x65, 0x78,
7830                                                 0x74, 0x20, 0x41, 0x74, 0x74,
7831                                                 0x72, 0x69, 0x62, 0x75, 0x74,
7832                                                 0x65, 0x20, 0x31, 0x8B, 0x09,
7833                                                 0x01, 0x00, 0x02, 0x91, 0x10,
7834                                                 0x40, 0xF0, 0x01, 0x20, 0xD0,
7835                                                 0x04, 0x00, 0x10, 0x20, 0xB4 };
7836
7837 static unsigned char send_sms_472[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x13,
7838                                                 0x00, 0x82, 0x02, 0x81, 0x83,
7839                                                 0x85, 0x10, 0x54, 0x65, 0x78,
7840                                                 0x74, 0x20, 0x41, 0x74, 0x74,
7841                                                 0x72, 0x69, 0x62, 0x75, 0x74,
7842                                                 0x65, 0x20, 0x32, 0x8B, 0x09,
7843                                                 0x01, 0x00, 0x02, 0x91, 0x10,
7844                                                 0x40, 0xF0, 0x01, 0x20, 0xD0,
7845                                                 0x04, 0x00, 0x10, 0x00, 0xB4 };
7846
7847 static unsigned char send_sms_473[] = { 0xD0, 0x26, 0x81, 0x03, 0x01, 0x13,
7848                                                 0x00, 0x82, 0x02, 0x81, 0x83,
7849                                                 0x85, 0x10, 0x54, 0x65, 0x78,
7850                                                 0x74, 0x20, 0x41, 0x74, 0x74,
7851                                                 0x72, 0x69, 0x62, 0x75, 0x74,
7852                                                 0x65, 0x20, 0x33, 0x8B, 0x09,
7853                                                 0x01, 0x00, 0x02, 0x91, 0x10,
7854                                                 0x40, 0xF0, 0x01, 0x20 };
7855
7856 static unsigned char send_sms_481[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x13,
7857                                                 0x00, 0x82, 0x02, 0x81, 0x83,
7858                                                 0x85, 0x10, 0x54, 0x65, 0x78,
7859                                                 0x74, 0x20, 0x41, 0x74, 0x74,
7860                                                 0x72, 0x69, 0x62, 0x75, 0x74,
7861                                                 0x65, 0x20, 0x31, 0x8B, 0x09,
7862                                                 0x01, 0x00, 0x02, 0x91, 0x10,
7863                                                 0x40, 0xF0, 0x01, 0x20, 0xD0,
7864                                                 0x04, 0x00, 0x10, 0x40, 0xB4 };
7865
7866 static unsigned char send_sms_482[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x13,
7867                                                 0x00, 0x82, 0x02, 0x81, 0x83,
7868                                                 0x85, 0x10, 0x54, 0x65, 0x78,
7869                                                 0x74, 0x20, 0x41, 0x74, 0x74,
7870                                                 0x72, 0x69, 0x62, 0x75, 0x74,
7871                                                 0x65, 0x20, 0x32, 0x8B, 0x09,
7872                                                 0x01, 0x00, 0x02, 0x91, 0x10,
7873                                                 0x40, 0xF0, 0x01, 0x20, 0xD0,
7874                                                 0x04, 0x00, 0x10, 0x00, 0xB4 };
7875
7876 static unsigned char send_sms_483[] = { 0xD0, 0x26, 0x81, 0x03, 0x01, 0x13,
7877                                                 0x00, 0x82, 0x02, 0x81, 0x83,
7878                                                 0x85, 0x10, 0x54, 0x65, 0x78,
7879                                                 0x74, 0x20, 0x41, 0x74, 0x74,
7880                                                 0x72, 0x69, 0x62, 0x75, 0x74,
7881                                                 0x65, 0x20, 0x33, 0x8B, 0x09,
7882                                                 0x01, 0x00, 0x02, 0x91, 0x10,
7883                                                 0x40, 0xF0, 0x01, 0x20 };
7884
7885 static unsigned char send_sms_491[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x13,
7886                                                 0x00, 0x82, 0x02, 0x81, 0x83,
7887                                                 0x85, 0x10, 0x54, 0x65, 0x78,
7888                                                 0x74, 0x20, 0x41, 0x74, 0x74,
7889                                                 0x72, 0x69, 0x62, 0x75, 0x74,
7890                                                 0x65, 0x20, 0x31, 0x8B, 0x09,
7891                                                 0x01, 0x00, 0x02, 0x91, 0x10,
7892                                                 0x40, 0xF0, 0x01, 0x20, 0xD0,
7893                                                 0x04, 0x00, 0x10, 0x80, 0xB4 };
7894
7895 static unsigned char send_sms_492[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x13,
7896                                                 0x00, 0x82, 0x02, 0x81, 0x83,
7897                                                 0x85, 0x10, 0x54, 0x65, 0x78,
7898                                                 0x74, 0x20, 0x41, 0x74, 0x74,
7899                                                 0x72, 0x69, 0x62, 0x75, 0x74,
7900                                                 0x65, 0x20, 0x32, 0x8B, 0x09,
7901                                                 0x01, 0x00, 0x02, 0x91, 0x10,
7902                                                 0x40, 0xF0, 0x01, 0x20, 0xD0,
7903                                                 0x04, 0x00, 0x10, 0x00, 0xB4 };
7904
7905 static unsigned char send_sms_493[] = { 0xD0, 0x26, 0x81, 0x03, 0x01, 0x13,
7906                                                 0x00, 0x82, 0x02, 0x81, 0x83,
7907                                                 0x85, 0x10, 0x54, 0x65, 0x78,
7908                                                 0x74, 0x20, 0x41, 0x74, 0x74,
7909                                                 0x72, 0x69, 0x62, 0x75, 0x74,
7910                                                 0x65, 0x20, 0x33, 0x8B, 0x09,
7911                                                 0x01, 0x00, 0x02, 0x91, 0x10,
7912                                                 0x40, 0xF0, 0x01, 0x20 };
7913
7914 static unsigned char send_sms_4101[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x13,
7915                                                 0x00, 0x82, 0x02, 0x81, 0x83,
7916                                                 0x85, 0x10, 0x54, 0x65, 0x78,
7917                                                 0x74, 0x20, 0x41, 0x74, 0x74,
7918                                                 0x72, 0x69, 0x62, 0x75, 0x74,
7919                                                 0x65, 0x20, 0x31, 0x8B, 0x09,
7920                                                 0x01, 0x00, 0x02, 0x91, 0x10,
7921                                                 0x40, 0xF0, 0x01, 0x20, 0xD0,
7922                                                 0x04, 0x00, 0x10, 0x00, 0xB4 };
7923
7924 static unsigned char send_sms_4102[] = { 0xD0, 0x26, 0x81, 0x03, 0x01, 0x13,
7925                                                 0x00, 0x82, 0x02, 0x81, 0x83,
7926                                                 0x85, 0x10, 0x54, 0x65, 0x78,
7927                                                 0x74, 0x20, 0x41, 0x74, 0x74,
7928                                                 0x72, 0x69, 0x62, 0x75, 0x74,
7929                                                 0x65, 0x20, 0x32, 0x8B, 0x09,
7930                                                 0x01, 0x00, 0x02, 0x91, 0x10,
7931                                                 0x40, 0xF0, 0x01, 0x20 };
7932
7933 static unsigned char send_sms_511[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x13,
7934                                                 0x00, 0x82, 0x02, 0x81, 0x83,
7935                                                 0x85, 0x05, 0x80, 0x4E, 0x2D,
7936                                                 0x4E, 0x00, 0x86, 0x09, 0x91,
7937                                                 0x11, 0x22, 0x33, 0x44, 0x55,
7938                                                 0x66, 0x77, 0xF8, 0x8B, 0x10,
7939                                                 0x01, 0x00, 0x09, 0x91, 0x10,
7940                                                 0x32, 0x54, 0x76, 0xF8, 0x40,
7941                                                 0x08, 0x04, 0x4E, 0x2D, 0x4E,
7942                                                 0x00 };
7943
7944 static unsigned char send_sms_512[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x13,
7945                                                 0x00, 0x82, 0x02, 0x81, 0x83,
7946                                                 0x85, 0x05, 0x81, 0x02, 0x9C,
7947                                                 0xAD, 0x80, 0x86, 0x09, 0x91,
7948                                                 0x11, 0x22, 0x33, 0x44, 0x55,
7949                                                 0x66, 0x77, 0xF8, 0x8B, 0x10,
7950                                                 0x01, 0x00, 0x09, 0x91, 0x10,
7951                                                 0x32, 0x54, 0x76, 0xF8, 0x40,
7952                                                 0x08, 0x04, 0x4E, 0x2D, 0x4E,
7953                                                 0x00 };
7954
7955 static unsigned char send_sms_513[] = { 0xD0, 0x2E, 0x81, 0x03, 0x01, 0x13,
7956                                                 0x00, 0x82, 0x02, 0x81, 0x83,
7957                                                 0x85, 0x06, 0x82, 0x02, 0x4E,
7958                                                 0x00, 0xAD, 0x80, 0x86, 0x09,
7959                                                 0x91, 0x11, 0x22, 0x33, 0x44,
7960                                                 0x55, 0x66, 0x77, 0xF8, 0x8B,
7961                                                 0x10, 0x01, 0x00, 0x09, 0x91,
7962                                                 0x10, 0x32, 0x54, 0x76, 0xF8,
7963                                                 0x40, 0x08, 0x04, 0x4E, 0x2D,
7964                                                 0x4E, 0x00 };
7965
7966 static unsigned char send_sms_611[] = { 0xD0, 0x35, 0x81, 0x03, 0x01, 0x13,
7967                                                 0x00, 0x82, 0x02, 0x81, 0x83,
7968                                                 0x85, 0x09, 0x80, 0x00, 0x38,
7969                                                 0x00, 0x30, 0x30, 0xEB, 0x00,
7970                                                 0x30, 0x86, 0x09, 0x91, 0x11,
7971                                                 0x22, 0x33, 0x44, 0x55, 0x66,
7972                                                 0x77, 0xF8, 0x8B, 0x14, 0x01,
7973                                                 0x00, 0x09, 0x91, 0x10, 0x32,
7974                                                 0x54, 0x76, 0xF8, 0x40, 0x08,
7975                                                 0x08, 0x00, 0x38, 0x00, 0x30,
7976                                                 0x30, 0xEB, 0x00, 0x31 };
7977
7978 static unsigned char send_sms_612[] = { 0xD0, 0x33, 0x81, 0x03, 0x01, 0x13,
7979                                                 0x00, 0x82, 0x02, 0x81, 0x83,
7980                                                 0x85, 0x07, 0x81, 0x04, 0x61,
7981                                                 0x38, 0x31, 0xEB, 0x31, 0x86,
7982                                                 0x09, 0x91, 0x11, 0x22, 0x33,
7983                                                 0x44, 0x55, 0x66, 0x77, 0xF8,
7984                                                 0x8B, 0x14, 0x01, 0x00, 0x09,
7985                                                 0x91, 0x10, 0x32, 0x54, 0x76,
7986                                                 0xF8, 0x40, 0x08, 0x08, 0x00,
7987                                                 0x38, 0x00, 0x30, 0x30, 0xEB,
7988                                                 0x00, 0x32 };
7989
7990 static unsigned char send_sms_613[] = { 0xD0, 0x34, 0x81, 0x03, 0x01, 0x13,
7991                                                 0x00, 0x82, 0x02, 0x81, 0x83,
7992                                                 0x85, 0x08, 0x82, 0x04, 0x30,
7993                                                 0xA0, 0x38, 0x32, 0xCB, 0x32,
7994                                                 0x86, 0x09, 0x91, 0x11, 0x22,
7995                                                 0x33, 0x44, 0x55, 0x66, 0x77,
7996                                                 0xF8, 0x8B, 0x14, 0x01, 0x00,
7997                                                 0x09, 0x91, 0x10, 0x32, 0x54,
7998                                                 0x76, 0xF8, 0x40, 0x08, 0x08,
7999                                                 0x00, 0x38, 0x00, 0x30, 0x30,
8000                                                 0xEB, 0x00, 0x33 };
8001
8002 static struct send_sms_test send_sms_data_111 = {
8003         .pdu = send_sms_111,
8004         .pdu_len = sizeof(send_sms_111),
8005         .qualifier = 0x00,
8006         .alpha_id = "Send SM",
8007         .gsm_sms = {
8008                 {
8009                         .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8010                         .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8011                         .address = "112233445566778",
8012                 },
8013                 SMS_TYPE_SUBMIT,
8014                 {.submit = {
8015                         .mr = 0x00,
8016                         .daddr = {
8017                                 .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8018                                 .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8019                                 .address = "012345678",
8020                         },
8021                         .pid = 0x40,
8022                         .dcs = 0xF4,
8023                         .udl = 12,
8024                         .ud = "Test Message"
8025                 } }
8026         }
8027 };
8028
8029 static struct send_sms_test send_sms_data_121 = {
8030         .pdu = send_sms_121,
8031         .pdu_len = sizeof(send_sms_121),
8032         .qualifier = 0x01,
8033         .alpha_id = "Send SM",
8034         .gsm_sms = {
8035                 {
8036                         .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8037                         .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8038                         .address = "112233445566778",
8039                 },
8040                 SMS_TYPE_SUBMIT,
8041                 {.submit = {
8042                         .mr = 0x00,
8043                         .daddr = {
8044                                 .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8045                                 .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8046                                 .address = "012345678",
8047                         },
8048                         .pid = 0x40,
8049                         .dcs = 0xF0,
8050                         .udl = 7,
8051                         .ud = "Send SM"
8052                 } }
8053         }
8054 };
8055
8056 static struct send_sms_test send_sms_data_131 = {
8057         .pdu = send_sms_131,
8058         .pdu_len = sizeof(send_sms_131),
8059         .qualifier = 0x00,
8060         .alpha_id = "Short Message",
8061         .gsm_sms = {
8062                 {
8063                         .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8064                         .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8065                         .address = "112233445566778",
8066                 },
8067                 SMS_TYPE_SUBMIT,
8068                 {.submit = {
8069                         .mr = 0x00,
8070                         .daddr = {
8071                                 .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8072                                 .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8073                                 .address = "012345678",
8074                         },
8075                         .pid = 0x40,
8076                         .dcs = 0xF0,
8077                         .udl = 13,
8078                         .ud = "Short Message"
8079                 } }
8080         },
8081 };
8082
8083 static struct send_sms_test send_sms_data_141 = {
8084         .pdu = send_sms_141,
8085         .pdu_len = sizeof(send_sms_141),
8086         .qualifier = 0x01,
8087         .alpha_id = "The address data object holds the RP_Destination_Address",
8088         .gsm_sms = {
8089                 {
8090                         .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8091                         .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8092                         .address = "112233445566778",
8093                 },
8094                 SMS_TYPE_SUBMIT,
8095                 {.submit = {
8096                         .mr = 0x00,
8097                         .daddr = {
8098                                 .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8099                                 .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8100                                 .address = "012345678",
8101                         },
8102                         .pid = 0x40,
8103                         .dcs = 0xF0,
8104                         .udl = 160,
8105                         .ud = "Two types are defined: - A short message to be "
8106                                 "sent to the network in an SMS-SUBMIT message, "
8107                                 "or an SMS-COMMAND message, where the user "
8108                                 "data can be passed transp"
8109                 } }
8110         }
8111 };
8112
8113 static struct send_sms_test send_sms_data_151 = {
8114         .pdu = send_sms_151,
8115         .pdu_len = sizeof(send_sms_151),
8116         .qualifier = 0x00,
8117         .alpha_id = "The address data object holds the RP Destination Address",
8118         .gsm_sms = {
8119                 {
8120                         .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8121                         .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8122                         .address = "112233445566778",
8123                 },
8124                 SMS_TYPE_SUBMIT,
8125                 {.submit = {
8126                         .mr = 0x00,
8127                         .daddr = {
8128                                 .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8129                                 .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8130                                 .address = "012345678",
8131                         },
8132                         .pid = 0x40,
8133                         .dcs = 0xF0,
8134                         .udl = 160,
8135                         .ud = "Two types are defined: - A short message to be "
8136                                 "sent to the network in an SMS-SUBMIT message, "
8137                                 "or an SMS-COMMAND message, where the user "
8138                                 "data can be passed transp"
8139                 } }
8140         }
8141 };
8142
8143 /* There should be a space after alpha_id */
8144 static struct send_sms_test send_sms_data_161 = {
8145         .pdu = send_sms_161,
8146         .pdu_len = sizeof(send_sms_161),
8147         .qualifier = 0x00,
8148         .alpha_id = "Two types are defined: - A short message to be sent to "
8149                         "the network in an SMS-SUBMIT message, or an "
8150                         "SMS-COMMAND message, where the user data can be "
8151                         "passed transparently; - A short message to be sent "
8152                         "to the network in an SMS-SUBMIT ",
8153         .gsm_sms = {
8154                 {}, SMS_TYPE_SUBMIT,
8155                 {.submit = {
8156                         .mr = 0x00,
8157                         .daddr = {
8158                                 .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8159                                 .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8160                                 .address = "01",
8161                         },
8162                         .pid = 0x40,
8163                         .dcs = 0xF0,
8164                         .udl = 1,
8165                         .ud = " "
8166                 } }
8167         }
8168 };
8169
8170 static struct send_sms_test send_sms_data_171 = {
8171         .pdu = send_sms_171,
8172         .pdu_len = sizeof(send_sms_171),
8173         .qualifier = 0x00,
8174         .alpha_id = "",
8175         .gsm_sms = {
8176                 {
8177                         .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8178                         .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8179                         .address = "112233445566778",
8180                 },
8181                 SMS_TYPE_SUBMIT,
8182                 {.submit = {
8183                         .mr = 0x00,
8184                         .daddr = {
8185                                 .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8186                                 .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8187                                 .address = "012345678",
8188                         },
8189                         .pid = 0x40,
8190                         .dcs = 0xF4,
8191                         .udl = 12,
8192                         .ud = "Test Message"
8193                 } }
8194         }
8195 };
8196
8197 static struct send_sms_test send_sms_data_181 = {
8198         .pdu = send_sms_181,
8199         .pdu_len = sizeof(send_sms_181),
8200         .qualifier = 0x00,
8201         .gsm_sms = {
8202                 {
8203                         .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8204                         .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8205                         .address = "112233445566778",
8206                 },
8207                 SMS_TYPE_SUBMIT,
8208                 {.submit = {
8209                         .mr = 0x00,
8210                         .daddr = {
8211                                 .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8212                                 .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8213                                 .address = "012345678",
8214                         },
8215                         .pid = 0x40,
8216                         .dcs = 0xF4,
8217                         .udl = 12,
8218                         .ud = "Test Message"
8219                 } }
8220         }
8221 };
8222
8223 static struct send_sms_test send_sms_data_211 = {
8224         .pdu = send_sms_211,
8225         .pdu_len = sizeof(send_sms_211),
8226         .qualifier = 0x00,
8227         .alpha_id = "ЗДРАВСТВУЙТЕ",
8228         .gsm_sms = {
8229                 {
8230                         .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8231                         .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8232                         .address = "112233445566778",
8233                 },
8234                 SMS_TYPE_SUBMIT,
8235                 {.submit = {
8236                         .mr = 0x00,
8237                         .daddr = {
8238                                 .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8239                                 .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8240                                 .address = "012345678",
8241                         },
8242                         .pid = 0x40,
8243                         .dcs = 0x08,
8244                         .udl = 24,
8245                         .ud = "ЗДРАВСТВУЙТЕ"
8246                 } }
8247         }
8248 };
8249
8250 static struct send_sms_test send_sms_data_212 = {
8251         .pdu = send_sms_212,
8252         .pdu_len = sizeof(send_sms_212),
8253         .qualifier = 0x00,
8254         .alpha_id = "ЗДРАВСТВУЙТЕ",
8255         .gsm_sms = {
8256                 {
8257                         .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8258                         .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8259                         .address = "112233445566778",
8260                 },
8261                 SMS_TYPE_SUBMIT,
8262                 {.submit = {
8263                         .mr = 0x00,
8264                         .daddr = {
8265                                 .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8266                                 .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8267                                 .address = "012345678",
8268                         },
8269                         .pid = 0x40,
8270                         .dcs = 0x08,
8271                         .udl = 24,
8272                         .ud = "ЗДРАВСТВУЙТЕ"
8273                 } }
8274         }
8275 };
8276
8277 static struct send_sms_test send_sms_data_213 = {
8278         .pdu = send_sms_213,
8279         .pdu_len = sizeof(send_sms_213),
8280         .qualifier = 0x00,
8281         .alpha_id = "ЗДРАВСТВУЙТЕ",
8282         .gsm_sms = {
8283                 {
8284                         .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8285                         .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8286                         .address = "112233445566778",
8287                 },
8288                 SMS_TYPE_SUBMIT,
8289                 {.submit = {
8290                         .mr = 0x00,
8291                         .daddr = {
8292                                 .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8293                                 .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8294                                 .address = "012345678",
8295                         },
8296                         .pid = 0x40,
8297                         .dcs = 0x08,
8298                         .udl = 24,
8299                         .ud = "ЗДРАВСТВУЙТЕ"
8300                 } }
8301         }
8302 };
8303
8304 static struct send_sms_test send_sms_data_311 = {
8305         .pdu = send_sms_311,
8306         .pdu_len = sizeof(send_sms_311),
8307         .qualifier = 0x00,
8308         .alpha_id = "NO ICON",
8309         .gsm_sms = {
8310                 {
8311                         .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8312                         .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8313                         .address = "112233445566778",
8314                 },
8315                 SMS_TYPE_SUBMIT,
8316                 {.submit = {
8317                         .mr = 0x00,
8318                         .daddr = {
8319                                 .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8320                                 .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8321                                 .address = "012345678",
8322                         },
8323                         .pid = 0x40,
8324                         .dcs = 0xF4,
8325                         .udl = 12,
8326                         .ud = "Test Message"
8327                 } }
8328         },
8329         .icon_id = {
8330                 .qualifier = STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY,
8331                 .id = 0x01
8332         }
8333 };
8334
8335 static struct send_sms_test send_sms_data_321 = {
8336         .pdu = send_sms_321,
8337         .pdu_len = sizeof(send_sms_321),
8338         .qualifier = 0x00,
8339         .alpha_id = "Send SM",
8340         .gsm_sms = {
8341                 {
8342                         .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8343                         .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8344                         .address = "112233445566778",
8345                 },
8346                 SMS_TYPE_SUBMIT,
8347                 {.submit = {
8348                         .mr = 0x00,
8349                         .daddr = {
8350                                 .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8351                                 .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8352                                 .address = "012345678",
8353                         },
8354                         .pid = 0x40,
8355                         .dcs = 0xF4,
8356                         .udl = 12,
8357                         .ud = "Test Message"
8358                 } }
8359         },
8360         .icon_id = {
8361                 .qualifier = STK_ICON_QUALIFIER_TYPE_NON_SELF_EXPLANATORY,
8362                 .id = 0x01
8363         }
8364 };
8365
8366 static struct send_sms_test send_sms_data_411 = {
8367         .pdu = send_sms_411,
8368         .pdu_len = sizeof(send_sms_411),
8369         .qualifier = 0x00,
8370         .alpha_id = "Text Attribute 1",
8371         .gsm_sms = {
8372                 {}, SMS_TYPE_SUBMIT,
8373                 {.submit = {
8374                         .mr = 0x00,
8375                         .daddr = {
8376                                 .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8377                                 .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8378                                 .address = "01",
8379                         },
8380                         .pid = 0x40,
8381                         .dcs = 0xF0,
8382                         .udl = 1,
8383                         .ud = " "
8384                 } }
8385         },
8386         .text_attr = {
8387                 .len = 4,
8388                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
8389         }
8390 };
8391
8392 static struct send_sms_test send_sms_data_412 = {
8393         .pdu = send_sms_412,
8394         .pdu_len = sizeof(send_sms_412),
8395         .qualifier = 0x00,
8396         .alpha_id = "Text Attribute 2",
8397         .gsm_sms = {
8398                 {}, SMS_TYPE_SUBMIT,
8399                 {.submit = {
8400                         .mr = 0x00,
8401                         .daddr = {
8402                                 .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8403                                 .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8404                                 .address = "01",
8405                         },
8406                         .pid = 0x40,
8407                         .dcs = 0xF0,
8408                         .udl = 1,
8409                         .ud = " "
8410                 } }
8411         }
8412 };
8413
8414 static struct send_sms_test send_sms_data_421 = {
8415         .pdu = send_sms_421,
8416         .pdu_len = sizeof(send_sms_421),
8417         .qualifier = 0x00,
8418         .alpha_id = "Text Attribute 1",
8419         .gsm_sms = {
8420                 {}, SMS_TYPE_SUBMIT,
8421                 {.submit = {
8422                         .mr = 0x00,
8423                         .daddr = {
8424                                 .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8425                                 .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8426                                 .address = "01",
8427                         },
8428                         .pid = 0x40,
8429                         .dcs = 0xF0,
8430                         .udl = 1,
8431                         .ud = " "
8432                 } }
8433         },
8434         .text_attr = {
8435                 .len = 4,
8436                 .attributes = { 0x00, 0x10, 0x01, 0xB4 }
8437         }
8438 };
8439
8440 static struct send_sms_test send_sms_data_422 = {
8441         .pdu = send_sms_422,
8442         .pdu_len = sizeof(send_sms_422),
8443         .qualifier = 0x00,
8444         .alpha_id = "Text Attribute 2",
8445         .gsm_sms = {
8446                 {}, SMS_TYPE_SUBMIT,
8447                 {.submit = {
8448                         .mr = 0x00,
8449                         .daddr = {
8450                                 .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8451                                 .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8452                                 .address = "01",
8453                         },
8454                         .pid = 0x40,
8455                         .dcs = 0xF0,
8456                         .udl = 1,
8457                         .ud = " "
8458                 } }
8459         }
8460 };
8461
8462 static struct send_sms_test send_sms_data_431 = {
8463         .pdu = send_sms_431,
8464         .pdu_len = sizeof(send_sms_431),
8465         .qualifier = 0x00,
8466         .alpha_id = "Text Attribute 1",
8467         .gsm_sms = {
8468                 {}, SMS_TYPE_SUBMIT,
8469                 {.submit = {
8470                         .mr = 0x00,
8471                         .daddr = {
8472                                 .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8473                                 .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8474                                 .address = "01",
8475                         },
8476                         .pid = 0x40,
8477                         .dcs = 0xF0,
8478                         .udl = 1,
8479                         .ud = " "
8480                 } }
8481         },
8482         .text_attr = {
8483                 .len = 4,
8484                 .attributes = { 0x00, 0x10, 0x02, 0xB4 }
8485         }
8486 };
8487
8488 static struct send_sms_test send_sms_data_432 = {
8489         .pdu = send_sms_432,
8490         .pdu_len = sizeof(send_sms_432),
8491         .qualifier = 0x00,
8492         .alpha_id = "Text Attribute 2",
8493         .gsm_sms = {
8494                 {}, SMS_TYPE_SUBMIT,
8495                 {.submit = {
8496                         .mr = 0x00,
8497                         .daddr = {
8498                                 .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8499                                 .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8500                                 .address = "01",
8501                         },
8502                         .pid = 0x40,
8503                         .dcs = 0xF0,
8504                         .udl = 1,
8505                         .ud = " "
8506                 } }
8507         }
8508 };
8509
8510 static struct send_sms_test send_sms_data_441 = {
8511         .pdu = send_sms_441,
8512         .pdu_len = sizeof(send_sms_441),
8513         .qualifier = 0x00,
8514         .alpha_id = "Text Attribute 1",
8515         .gsm_sms = {
8516                 {}, SMS_TYPE_SUBMIT,
8517                 {.submit = {
8518                         .mr = 0x00,
8519                         .daddr = {
8520                                 .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8521                                 .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8522                                 .address = "01",
8523                         },
8524                         .pid = 0x40,
8525                         .dcs = 0xF0,
8526                         .udl = 1,
8527                         .ud = " "
8528                 } }
8529         },
8530         .text_attr = {
8531                 .len = 4,
8532                 .attributes = { 0x00, 0x10, 0x04, 0xB4 }
8533         }
8534 };
8535
8536 static struct send_sms_test send_sms_data_442 = {
8537         .pdu = send_sms_442,
8538         .pdu_len = sizeof(send_sms_442),
8539         .qualifier = 0x00,
8540         .alpha_id = "Text Attribute 2",
8541         .gsm_sms = {
8542                 {}, SMS_TYPE_SUBMIT,
8543                 {.submit = {
8544                         .mr = 0x00,
8545                         .daddr = {
8546                                 .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8547                                 .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8548                                 .address = "01",
8549                         },
8550                         .pid = 0x40,
8551                         .dcs = 0xF0,
8552                         .udl = 1,
8553                         .ud = " "
8554                 } }
8555         },
8556         .text_attr = {
8557                 .len = 4,
8558                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
8559         }
8560 };
8561
8562 static struct send_sms_test send_sms_data_443 = {
8563         .pdu = send_sms_443,
8564         .pdu_len = sizeof(send_sms_443),
8565         .qualifier = 0x00,
8566         .alpha_id = "Text Attribute 3",
8567         .gsm_sms = {
8568                 {}, SMS_TYPE_SUBMIT,
8569                 {.submit = {
8570                         .mr = 0x00,
8571                         .daddr = {
8572                                 .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8573                                 .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8574                                 .address = "01",
8575                         },
8576                         .pid = 0x40,
8577                         .dcs = 0xF0,
8578                         .udl = 1,
8579                         .ud = " "
8580                 } }
8581         }
8582 };
8583
8584 static struct send_sms_test send_sms_data_451 = {
8585         .pdu = send_sms_451,
8586         .pdu_len = sizeof(send_sms_451),
8587         .qualifier = 0x00,
8588         .alpha_id = "Text Attribute 1",
8589         .gsm_sms = {
8590                 {}, SMS_TYPE_SUBMIT,
8591                 {.submit = {
8592                         .mr = 0x00,
8593                         .daddr = {
8594                                 .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8595                                 .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8596                                 .address = "01",
8597                         },
8598                         .pid = 0x40,
8599                         .dcs = 0xF0,
8600                         .udl = 1,
8601                         .ud = " "
8602                 } }
8603         },
8604         .text_attr = {
8605                 .len = 4,
8606                 .attributes = { 0x00, 0x10, 0x08, 0xB4 }
8607         }
8608 };
8609
8610 static struct send_sms_test send_sms_data_452 = {
8611         .pdu = send_sms_452,
8612         .pdu_len = sizeof(send_sms_452),
8613         .qualifier = 0x00,
8614         .alpha_id = "Text Attribute 2",
8615         .gsm_sms = {
8616                 {}, SMS_TYPE_SUBMIT,
8617                 {.submit = {
8618                         .mr = 0x00,
8619                         .daddr = {
8620                                 .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8621                                 .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8622                                 .address = "01",
8623                         },
8624                         .pid = 0x40,
8625                         .dcs = 0xF0,
8626                         .udl = 1,
8627                         .ud = " "
8628                 } }
8629         },
8630         .text_attr = {
8631                 .len = 4,
8632                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
8633         }
8634 };
8635
8636 static struct send_sms_test send_sms_data_453 = {
8637         .pdu = send_sms_453,
8638         .pdu_len = sizeof(send_sms_453),
8639         .qualifier = 0x00,
8640         .alpha_id = "Text Attribute 3",
8641         .gsm_sms = {
8642                 {}, SMS_TYPE_SUBMIT,
8643                 {.submit = {
8644                         .mr = 0x00,
8645                         .daddr = {
8646                                 .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8647                                 .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8648                                 .address = "01",
8649                         },
8650                         .pid = 0x40,
8651                         .dcs = 0xF0,
8652                         .udl = 1,
8653                         .ud = " "
8654                 } }
8655         }
8656 };
8657
8658 static struct send_sms_test send_sms_data_461 = {
8659         .pdu = send_sms_461,
8660         .pdu_len = sizeof(send_sms_461),
8661         .qualifier = 0x00,
8662         .alpha_id = "Text Attribute 1",
8663         .gsm_sms = {
8664                 {}, SMS_TYPE_SUBMIT,
8665                 {.submit = {
8666                         .mr = 0x00,
8667                         .daddr = {
8668                                 .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8669                                 .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8670                                 .address = "01",
8671                         },
8672                         .pid = 0x40,
8673                         .dcs = 0xF0,
8674                         .udl = 1,
8675                         .ud = " "
8676                 } }
8677         },
8678         .text_attr = {
8679                 .len = 4,
8680                 .attributes = { 0x00, 0x10, 0x10, 0xB4 }
8681         }
8682 };
8683
8684 static struct send_sms_test send_sms_data_462 = {
8685         .pdu = send_sms_462,
8686         .pdu_len = sizeof(send_sms_462),
8687         .qualifier = 0x00,
8688         .alpha_id = "Text Attribute 2",
8689         .gsm_sms = {
8690                 {}, SMS_TYPE_SUBMIT,
8691                 {.submit = {
8692                         .mr = 0x00,
8693                         .daddr = {
8694                                 .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8695                                 .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8696                                 .address = "01",
8697                         },
8698                         .pid = 0x40,
8699                         .dcs = 0xF0,
8700                         .udl = 1,
8701                         .ud = " "
8702                 } }
8703         },
8704         .text_attr = {
8705                 .len = 4,
8706                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
8707         }
8708 };
8709
8710 static struct send_sms_test send_sms_data_463 = {
8711         .pdu = send_sms_463,
8712         .pdu_len = sizeof(send_sms_463),
8713         .qualifier = 0x00,
8714         .alpha_id = "Text Attribute 3",
8715         .gsm_sms = {
8716                 {}, SMS_TYPE_SUBMIT,
8717                 {.submit = {
8718                         .mr = 0x00,
8719                         .daddr = {
8720                                 .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8721                                 .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8722                                 .address = "01",
8723                         },
8724                         .pid = 0x40,
8725                         .dcs = 0xF0,
8726                         .udl = 1,
8727                         .ud = " "
8728                 } }
8729         }
8730 };
8731
8732 static struct send_sms_test send_sms_data_471 = {
8733         .pdu = send_sms_471,
8734         .pdu_len = sizeof(send_sms_471),
8735         .qualifier = 0x00,
8736         .alpha_id = "Text Attribute 1",
8737         .gsm_sms = {
8738                 {}, SMS_TYPE_SUBMIT,
8739                 {.submit = {
8740                         .mr = 0x00,
8741                         .daddr = {
8742                                 .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8743                                 .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8744                                 .address = "01",
8745                         },
8746                         .pid = 0x40,
8747                         .dcs = 0xF0,
8748                         .udl = 1,
8749                         .ud = " "
8750                 } }
8751         },
8752         .text_attr = {
8753                 .len = 4,
8754                 .attributes = { 0x00, 0x10, 0x20, 0xB4 }
8755         }
8756 };
8757
8758 static struct send_sms_test send_sms_data_472 = {
8759         .pdu = send_sms_472,
8760         .pdu_len = sizeof(send_sms_472),
8761         .qualifier = 0x00,
8762         .alpha_id = "Text Attribute 2",
8763         .gsm_sms = {
8764                 {}, SMS_TYPE_SUBMIT,
8765                 {.submit = {
8766                         .mr = 0x00,
8767                         .daddr = {
8768                                 .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8769                                 .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8770                                 .address = "01",
8771                         },
8772                         .pid = 0x40,
8773                         .dcs = 0xF0,
8774                         .udl = 1,
8775                         .ud = " "
8776                 } }
8777         },
8778         .text_attr = {
8779                 .len = 4,
8780                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
8781         }
8782 };
8783
8784 static struct send_sms_test send_sms_data_473 = {
8785         .pdu = send_sms_473,
8786         .pdu_len = sizeof(send_sms_473),
8787         .qualifier = 0x00,
8788         .alpha_id = "Text Attribute 3",
8789         .gsm_sms = {
8790                 {}, SMS_TYPE_SUBMIT,
8791                 {.submit = {
8792                         .mr = 0x00,
8793                         .daddr = {
8794                                 .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8795                                 .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8796                                 .address = "01",
8797                         },
8798                         .pid = 0x40,
8799                         .dcs = 0xF0,
8800                         .udl = 1,
8801                         .ud = " "
8802                 } }
8803         }
8804 };
8805
8806 static struct send_sms_test send_sms_data_481 = {
8807         .pdu = send_sms_481,
8808         .pdu_len = sizeof(send_sms_481),
8809         .qualifier = 0x00,
8810         .alpha_id = "Text Attribute 1",
8811         .gsm_sms = {
8812                 {}, SMS_TYPE_SUBMIT,
8813                 {.submit = {
8814                         .mr = 0x00,
8815                         .daddr = {
8816                                 .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8817                                 .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8818                                 .address = "01",
8819                         },
8820                         .pid = 0x40,
8821                         .dcs = 0xF0,
8822                         .udl = 1,
8823                         .ud = " "
8824                 } }
8825         },
8826         .text_attr = {
8827                 .len = 4,
8828                 .attributes = { 0x00, 0x10, 0x40, 0xB4 }
8829         }
8830 };
8831
8832 static struct send_sms_test send_sms_data_482 = {
8833         .pdu = send_sms_482,
8834         .pdu_len = sizeof(send_sms_482),
8835         .qualifier = 0x00,
8836         .alpha_id = "Text Attribute 2",
8837         .gsm_sms = {
8838                 {}, SMS_TYPE_SUBMIT,
8839                 {.submit = {
8840                         .mr = 0x00,
8841                         .daddr = {
8842                                 .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8843                                 .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8844                                 .address = "01",
8845                         },
8846                         .pid = 0x40,
8847                         .dcs = 0xF0,
8848                         .udl = 1,
8849                         .ud = " "
8850                 } }
8851         },
8852         .text_attr = {
8853                 .len = 4,
8854                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
8855         }
8856 };
8857
8858 static struct send_sms_test send_sms_data_483 = {
8859         .pdu = send_sms_483,
8860         .pdu_len = sizeof(send_sms_483),
8861         .qualifier = 0x00,
8862         .alpha_id = "Text Attribute 3",
8863         .gsm_sms = {
8864                 {}, SMS_TYPE_SUBMIT,
8865                 {.submit = {
8866                         .mr = 0x00,
8867                         .daddr = {
8868                                 .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8869                                 .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8870                                 .address = "01",
8871                         },
8872                         .pid = 0x40,
8873                         .dcs = 0xF0,
8874                         .udl = 1,
8875                         .ud = " "
8876                 } }
8877         }
8878 };
8879
8880 static struct send_sms_test send_sms_data_491 = {
8881         .pdu = send_sms_491,
8882         .pdu_len = sizeof(send_sms_491),
8883         .qualifier = 0x00,
8884         .alpha_id = "Text Attribute 1",
8885         .gsm_sms = {
8886                 {}, SMS_TYPE_SUBMIT,
8887                 {.submit = {
8888                         .mr = 0x00,
8889                         .daddr = {
8890                                 .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8891                                 .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8892                                 .address = "01",
8893                         },
8894                         .pid = 0x40,
8895                         .dcs = 0xF0,
8896                         .udl = 1,
8897                         .ud = " "
8898                 } }
8899         },
8900         .text_attr = {
8901                 .len = 4,
8902                 .attributes = { 0x00, 0x10, 0x80, 0xB4 }
8903         }
8904 };
8905
8906 static struct send_sms_test send_sms_data_492 = {
8907         .pdu = send_sms_492,
8908         .pdu_len = sizeof(send_sms_492),
8909         .qualifier = 0x00,
8910         .alpha_id = "Text Attribute 2",
8911         .gsm_sms = {
8912                 {}, SMS_TYPE_SUBMIT,
8913                 {.submit = {
8914                         .mr = 0x00,
8915                         .daddr = {
8916                                 .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8917                                 .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8918                                 .address = "01",
8919                         },
8920                         .pid = 0x40,
8921                         .dcs = 0xF0,
8922                         .udl = 1,
8923                         .ud = " "
8924                 } }
8925         },
8926         .text_attr = {
8927                 .len = 4,
8928                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
8929         }
8930 };
8931
8932 static struct send_sms_test send_sms_data_493 = {
8933         .pdu = send_sms_493,
8934         .pdu_len = sizeof(send_sms_493),
8935         .qualifier = 0x00,
8936         .alpha_id = "Text Attribute 3",
8937         .gsm_sms = {
8938                 {}, SMS_TYPE_SUBMIT,
8939                 {.submit = {
8940                         .mr = 0x00,
8941                         .daddr = {
8942                                 .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8943                                 .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8944                                 .address = "01",
8945                         },
8946                         .pid = 0x40,
8947                         .dcs = 0xF0,
8948                         .udl = 1,
8949                         .ud = " "
8950                 } }
8951         }
8952 };
8953
8954 static struct send_sms_test send_sms_data_4101 = {
8955         .pdu = send_sms_4101,
8956         .pdu_len = sizeof(send_sms_4101),
8957         .qualifier = 0x00,
8958         .alpha_id = "Text Attribute 1",
8959         .gsm_sms = {
8960                 {}, SMS_TYPE_SUBMIT,
8961                 {.submit = {
8962                         .mr = 0x00,
8963                         .daddr = {
8964                                 .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8965                                 .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8966                                 .address = "01",
8967                         },
8968                         .pid = 0x40,
8969                         .dcs = 0xF0,
8970                         .udl = 1,
8971                         .ud = " "
8972                 } }
8973         },
8974         .text_attr = {
8975                 .len = 4,
8976                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
8977         }
8978 };
8979
8980 static struct send_sms_test send_sms_data_4102 = {
8981         .pdu = send_sms_4102,
8982         .pdu_len = sizeof(send_sms_4102),
8983         .qualifier = 0x00,
8984         .alpha_id = "Text Attribute 2",
8985         .gsm_sms = {
8986                 {}, SMS_TYPE_SUBMIT,
8987                 {.submit = {
8988                         .mr = 0x00,
8989                         .daddr = {
8990                                 .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
8991                                 .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
8992                                 .address = "01",
8993                         },
8994                         .pid = 0x40,
8995                         .dcs = 0xF0,
8996                         .udl = 1,
8997                         .ud = " "
8998                 } }
8999         }
9000 };
9001
9002 /* The TP-UDL should be 4, instead of 24 */
9003 static struct send_sms_test send_sms_data_511 = {
9004         .pdu = send_sms_511,
9005         .pdu_len = sizeof(send_sms_511),
9006         .qualifier = 0x00,
9007         .alpha_id = "中一",
9008         .gsm_sms = {
9009                 {
9010                         .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
9011                         .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
9012                         .address = "112233445566778",
9013                 },
9014                 SMS_TYPE_SUBMIT,
9015                 {.submit = {
9016                         .mr = 0x00,
9017                         .daddr = {
9018                                 .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
9019                                 .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
9020                                 .address = "012345678",
9021                         },
9022                         .pid = 0x40,
9023                         .dcs = 0x08,
9024                         .udl = 4,
9025                         .ud = "中一"
9026                 } }
9027         }
9028 };
9029
9030 /* The TP-UDL should be 4, instead of 24 */
9031 static struct send_sms_test send_sms_data_512 = {
9032         .pdu = send_sms_512,
9033         .pdu_len = sizeof(send_sms_512),
9034         .qualifier = 0x00,
9035         .alpha_id = "中一",
9036         .gsm_sms = {
9037                 {
9038                         .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
9039                         .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
9040                         .address = "112233445566778",
9041                 },
9042                 SMS_TYPE_SUBMIT,
9043                 {.submit = {
9044                         .mr = 0x00,
9045                         .daddr = {
9046                                 .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
9047                                 .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
9048                                 .address = "012345678",
9049                         },
9050                         .pid = 0x40,
9051                         .dcs = 0x08,
9052                         .udl = 4,
9053                         .ud = "中一"
9054                 } }
9055         }
9056 };
9057
9058 /* The TP-UDL should be 4, instead of 24 */
9059 static struct send_sms_test send_sms_data_513 = {
9060         .pdu = send_sms_513,
9061         .pdu_len = sizeof(send_sms_513),
9062         .qualifier = 0x00,
9063         .alpha_id = "中一",
9064         .gsm_sms = {
9065                 {
9066                         .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
9067                         .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
9068                         .address = "112233445566778",
9069                 },
9070                 SMS_TYPE_SUBMIT,
9071                 {.submit = {
9072                         .mr = 0x00,
9073                         .daddr = {
9074                                 .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
9075                                 .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
9076                                 .address = "012345678",
9077                         },
9078                         .pid = 0x40,
9079                         .dcs = 0x08,
9080                         .udl = 4,
9081                         .ud = "中一"
9082                 } }
9083         }
9084 };
9085
9086 static struct send_sms_test send_sms_data_611 = {
9087         .pdu = send_sms_611,
9088         .pdu_len = sizeof(send_sms_611),
9089         .qualifier = 0x00,
9090         .alpha_id = "80ル0",
9091         .gsm_sms = {
9092                 {
9093                         .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
9094                         .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
9095                         .address = "112233445566778",
9096                 },
9097                 SMS_TYPE_SUBMIT,
9098                 {.submit = {
9099                         .mr = 0x00,
9100                         .daddr = {
9101                                 .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
9102                                 .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
9103                                 .address = "012345678",
9104                         },
9105                         .pid = 0x40,
9106                         .dcs = 0x08,
9107                         .udl = 8,
9108                         .ud = "80ル1"
9109                 } }
9110         }
9111 };
9112
9113 static struct send_sms_test send_sms_data_612 = {
9114         .pdu = send_sms_612,
9115         .pdu_len = sizeof(send_sms_612),
9116         .qualifier = 0x00,
9117         .alpha_id = "81ル1",
9118         .gsm_sms = {
9119                 {
9120                         .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
9121                         .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
9122                         .address = "112233445566778",
9123                 },
9124                 SMS_TYPE_SUBMIT,
9125                 {.submit = {
9126                         .mr = 0x00,
9127                         .daddr = {
9128                                 .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
9129                                 .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
9130                                 .address = "012345678",
9131                         },
9132                         .pid = 0x40,
9133                         .dcs = 0x08,
9134                         .udl = 8,
9135                         .ud = "80ル2"
9136                 } }
9137         }
9138 };
9139
9140 static struct send_sms_test send_sms_data_613 = {
9141         .pdu = send_sms_613,
9142         .pdu_len = sizeof(send_sms_613),
9143         .qualifier = 0x00,
9144         .alpha_id = "82ル2",
9145         .gsm_sms = {
9146                 {
9147                         .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
9148                         .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
9149                         .address = "112233445566778",
9150                 },
9151                 SMS_TYPE_SUBMIT,
9152                 {.submit = {
9153                         .mr = 0x00,
9154                         .daddr = {
9155                                 .number_type = SMS_NUMBER_TYPE_INTERNATIONAL,
9156                                 .numbering_plan = SMS_NUMBERING_PLAN_ISDN,
9157                                 .address = "012345678",
9158                         },
9159                         .pid = 0x40,
9160                         .dcs = 0x08,
9161                         .udl = 8,
9162                         .ud = "80ル3"
9163                 } }
9164         }
9165 };
9166
9167 static void test_send_sms(gconstpointer data)
9168 {
9169         const struct send_sms_test *test = data;
9170         struct stk_command *command;
9171
9172         command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
9173
9174         g_assert(command);
9175         g_assert(command->status == STK_PARSE_RESULT_OK);
9176
9177         g_assert(command->number == 1);
9178         g_assert(command->type == STK_COMMAND_TYPE_SEND_SMS);
9179         g_assert(command->qualifier == test->qualifier);
9180
9181         g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
9182         g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_NETWORK);
9183
9184         check_alpha_id(command->send_sms.alpha_id, test->alpha_id);
9185         check_gsm_sms(&command->send_sms.gsm_sms, &test->gsm_sms);
9186         check_cdma_sms_tpdu(&command->send_sms.cdma_sms, &test->cdma_sms);
9187         check_icon_id(&command->send_sms.icon_id, &test->icon_id);
9188         check_text_attr(&command->send_sms.text_attr, &test->text_attr);
9189         check_frame_id(&command->send_sms.frame_id, &test->frame_id);
9190
9191         stk_command_free(command);
9192 }
9193
9194 struct send_ss_test {
9195         const unsigned char *pdu;
9196         unsigned int pdu_len;
9197         unsigned char qualifier;
9198         char *alpha_id;
9199         struct stk_ss ss;
9200         struct stk_icon_id icon_id;
9201         struct stk_text_attribute text_attr;
9202         struct stk_frame_id frame_id;
9203 };
9204
9205 static unsigned char send_ss_111[] = { 0xD0, 0x29, 0x81, 0x03, 0x01, 0x11,
9206                                                 0x00, 0x82, 0x02, 0x81, 0x83,
9207                                                 0x85, 0x0C, 0x43, 0x61, 0x6C,
9208                                                 0x6C, 0x20, 0x46, 0x6F, 0x72,
9209                                                 0x77, 0x61, 0x72, 0x64, 0x89,
9210                                                 0x10, 0x91, 0xAA, 0x12, 0x0A,
9211                                                 0x21, 0x43, 0x65, 0x87, 0x09,
9212                                                 0x21, 0x43, 0x65, 0x87, 0xA9,
9213                                                 0x01, 0xFB };
9214
9215 static unsigned char send_ss_141[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x11,
9216                                                 0x00, 0x82, 0x02, 0x81, 0x83,
9217                                                 0x85, 0x0C, 0x43, 0x61, 0x6C,
9218                                                 0x6C, 0x20, 0x46, 0x6F, 0x72,
9219                                                 0x77, 0x61, 0x72, 0x64, 0x89,
9220                                                 0x14, 0x91, 0xAA, 0x12, 0x0A,
9221                                                 0x21, 0x43, 0x65, 0x87, 0x09,
9222                                                 0x21, 0x43, 0x65, 0x87, 0x09,
9223                                                 0x21, 0x43, 0x65, 0xA7, 0x11,
9224                                                 0xFB };
9225
9226 static unsigned char send_ss_151[] = { 0xD0, 0x81, 0xFD, 0x81, 0x03, 0x01,
9227                                                 0x11, 0x00, 0x82, 0x02, 0x81,
9228                                                 0x83, 0x85, 0x81, 0xEB, 0x45,
9229                                                 0x76, 0x65, 0x6E, 0x20, 0x69,
9230                                                 0x66, 0x20, 0x74, 0x68, 0x65,
9231                                                 0x20, 0x46, 0x69, 0x78, 0x65,
9232                                                 0x64, 0x20, 0x44, 0x69, 0x61,
9233                                                 0x6C, 0x6C, 0x69, 0x6E, 0x67,
9234                                                 0x20, 0x4E, 0x75, 0x6D, 0x62,
9235                                                 0x65, 0x72, 0x20, 0x73, 0x65,
9236                                                 0x72, 0x76, 0x69, 0x63, 0x65,
9237                                                 0x20, 0x69, 0x73, 0x20, 0x65,
9238                                                 0x6E, 0x61, 0x62, 0x6C, 0x65,
9239                                                 0x64, 0x2C, 0x20, 0x74, 0x68,
9240                                                 0x65, 0x20, 0x73, 0x75, 0x70,
9241                                                 0x70, 0x6C, 0x65, 0x6D, 0x65,
9242                                                 0x6E, 0x74, 0x61, 0x72, 0x79,
9243                                                 0x20, 0x73, 0x65, 0x72, 0x76,
9244                                                 0x69, 0x63, 0x65, 0x20, 0x63,
9245                                                 0x6F, 0x6E, 0x74, 0x72, 0x6F,
9246                                                 0x6C, 0x20, 0x73, 0x74, 0x72,
9247                                                 0x69, 0x6E, 0x67, 0x20, 0x69,
9248                                                 0x6E, 0x63, 0x6C, 0x75, 0x64,
9249                                                 0x65, 0x64, 0x20, 0x69, 0x6E,
9250                                                 0x20, 0x74, 0x68, 0x65, 0x20,
9251                                                 0x53, 0x45, 0x4E, 0x44, 0x20,
9252                                                 0x53, 0x53, 0x20, 0x70, 0x72,
9253                                                 0x6F, 0x61, 0x63, 0x74, 0x69,
9254                                                 0x76, 0x65, 0x20, 0x63, 0x6F,
9255                                                 0x6D, 0x6D, 0x61, 0x6E, 0x64,
9256                                                 0x20, 0x73, 0x68, 0x61, 0x6C,
9257                                                 0x6C, 0x20, 0x6E, 0x6F, 0x74,
9258                                                 0x20, 0x62, 0x65, 0x20, 0x63,
9259                                                 0x68, 0x65, 0x63, 0x6B, 0x65,
9260                                                 0x64, 0x20, 0x61, 0x67, 0x61,
9261                                                 0x69, 0x6E, 0x73, 0x74, 0x20,
9262                                                 0x74, 0x68, 0x6F, 0x73, 0x65,
9263                                                 0x20, 0x6F, 0x66, 0x20, 0x74,
9264                                                 0x68, 0x65, 0x20, 0x46, 0x44,
9265                                                 0x4E, 0x20, 0x6C, 0x69, 0x73,
9266                                                 0x74, 0x2E, 0x20, 0x55, 0x70,
9267                                                 0x6F, 0x6E, 0x20, 0x72, 0x65,
9268                                                 0x63, 0x65, 0x69, 0x76, 0x69,
9269                                                 0x6E, 0x67, 0x20, 0x74, 0x68,
9270                                                 0x69, 0x73, 0x20, 0x63, 0x6F,
9271                                                 0x6D, 0x6D, 0x61, 0x6E, 0x64,
9272                                                 0x2C, 0x20, 0x74, 0x68, 0x65,
9273                                                 0x20, 0x4D, 0x45, 0x20, 0x73,
9274                                                 0x68, 0x61, 0x6C, 0x6C, 0x20,
9275                                                 0x64, 0x65, 0x63, 0x69, 0x89,
9276                                                 0x04, 0xFF, 0xBA, 0x13, 0xFB };
9277
9278 static unsigned char send_ss_161[] = { 0xD0, 0x1D, 0x81, 0x03, 0x01, 0x11,
9279                                                 0x00, 0x82, 0x02, 0x81, 0x83,
9280                                                 0x85, 0x00, 0x89, 0x10, 0x91,
9281                                                 0xAA, 0x12, 0x0A, 0x21, 0x43,
9282                                                 0x65, 0x87, 0x09, 0x21, 0x43,
9283                                                 0x65, 0x87, 0xA9, 0x01, 0xFB };
9284
9285 static unsigned char send_ss_211[] = { 0xD0, 0x2B, 0x81, 0x03, 0x01, 0x11,
9286                                                 0x00, 0x82, 0x02, 0x81, 0x83,
9287                                                 0x85, 0x0A, 0x42, 0x61, 0x73,
9288                                                 0x69, 0x63, 0x20, 0x49, 0x63,
9289                                                 0x6F, 0x6E, 0x89, 0x10, 0x91,
9290                                                 0xAA, 0x12, 0x0A, 0x21, 0x43,
9291                                                 0x65, 0x87, 0x09, 0x21, 0x43,
9292                                                 0x65, 0x87, 0xA9, 0x01, 0xFB,
9293                                                 0x9E, 0x02, 0x00, 0x01 };
9294
9295 static unsigned char send_ss_221[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x11,
9296                                                 0x00, 0x82, 0x02, 0x81, 0x83,
9297                                                 0x85, 0x0B, 0x43, 0x6F, 0x6C,
9298                                                 0x6F, 0x75, 0x72, 0x20, 0x49,
9299                                                 0x63, 0x6F, 0x6E, 0x89, 0x10,
9300                                                 0x91, 0xAA, 0x12, 0x0A, 0x21,
9301                                                 0x43, 0x65, 0x87, 0x09, 0x21,
9302                                                 0x43, 0x65, 0x87, 0xA9, 0x01,
9303                                                 0xFB, 0x9E, 0x02, 0x00, 0x02 };
9304
9305 static unsigned char send_ss_231[] = { 0xD0, 0x2B, 0x81, 0x03, 0x01, 0x11,
9306                                                 0x00, 0x82, 0x02, 0x81, 0x83,
9307                                                 0x85, 0x0A, 0x42, 0x61, 0x73,
9308                                                 0x69, 0x63, 0x20, 0x49, 0x63,
9309                                                 0x6F, 0x6E, 0x89, 0x10, 0x91,
9310                                                 0xAA, 0x12, 0x0A, 0x21, 0x43,
9311                                                 0x65, 0x87, 0x09, 0x21, 0x43,
9312                                                 0x65, 0x87, 0xA9, 0x01, 0xFB,
9313                                                 0x9E, 0x02, 0x01, 0x01 };
9314
9315 static unsigned char send_ss_241[] = { 0xD0, 0x1D, 0x81, 0x03, 0x01, 0x11,
9316                                                 0x00, 0x82, 0x02, 0x81, 0x83,
9317                                                 0x89, 0x0E, 0x91, 0xAA, 0x12,
9318                                                 0x0A, 0x21, 0x43, 0x65, 0x87,
9319                                                 0x09, 0x21, 0x43, 0x65, 0x87,
9320                                                 0xB9, 0x9E, 0x02, 0x01, 0x01 };
9321
9322 static unsigned char send_ss_311[] = { 0xD0, 0x36, 0x81, 0x03, 0x01, 0x11,
9323                                                 0x00, 0x82, 0x02, 0x81, 0x83,
9324                                                 0x85, 0x19, 0x80, 0x04, 0x17,
9325                                                 0x04, 0x14, 0x04, 0x20, 0x04,
9326                                                 0x10, 0x04, 0x12, 0x04, 0x21,
9327                                                 0x04, 0x22, 0x04, 0x12, 0x04,
9328                                                 0x23, 0x04, 0x19, 0x04, 0x22,
9329                                                 0x04, 0x15, 0x89, 0x10, 0x91,
9330                                                 0xAA, 0x12, 0x0A, 0x21, 0x43,
9331                                                 0x65, 0x87, 0x09, 0x21, 0x43,
9332                                                 0x65, 0x87, 0xA9, 0x01, 0xFB };
9333
9334 static unsigned char send_ss_411[] = { 0xD0, 0x33, 0x81, 0x03, 0x01, 0x11,
9335                                                 0x00, 0x82, 0x02, 0x81, 0x83,
9336                                                 0x85, 0x10, 0x54, 0x65, 0x78,
9337                                                 0x74, 0x20, 0x41, 0x74, 0x74,
9338                                                 0x72, 0x69, 0x62, 0x75, 0x74,
9339                                                 0x65, 0x20, 0x31, 0x89, 0x10,
9340                                                 0x91, 0xAA, 0x12, 0x0A, 0x21,
9341                                                 0x43, 0x65, 0x87, 0x09, 0x21,
9342                                                 0x43, 0x65, 0x87, 0xA9, 0x01,
9343                                                 0xFB, 0xD0, 0x04, 0x00, 0x10,
9344                                                 0x00, 0xB4 };
9345
9346 static unsigned char send_ss_412[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x11,
9347                                                 0x00, 0x82, 0x02, 0x81, 0x83,
9348                                                 0x85, 0x10, 0x54, 0x65, 0x78,
9349                                                 0x74, 0x20, 0x41, 0x74, 0x74,
9350                                                 0x72, 0x69, 0x62, 0x75, 0x74,
9351                                                 0x65, 0x20, 0x32, 0x89, 0x10,
9352                                                 0x91, 0xAA, 0x12, 0x0A, 0x21,
9353                                                 0x43, 0x65, 0x87, 0x09, 0x21,
9354                                                 0x43, 0x65, 0x87, 0xA9, 0x01,
9355                                                 0xFB };
9356
9357 static unsigned char send_ss_421[] = { 0xD0, 0x33, 0x81, 0x03, 0x01, 0x11,
9358                                                 0x00, 0x82, 0x02, 0x81, 0x83,
9359                                                 0x85, 0x10, 0x54, 0x65, 0x78,
9360                                                 0x74, 0x20, 0x41, 0x74, 0x74,
9361                                                 0x72, 0x69, 0x62, 0x75, 0x74,
9362                                                 0x65, 0x20, 0x31, 0x89, 0x10,
9363                                                 0x91, 0xAA, 0x12, 0x0A, 0x21,
9364                                                 0x43, 0x65, 0x87, 0x09, 0x21,
9365                                                 0x43, 0x65, 0x87, 0xA9, 0x01,
9366                                                 0xFB, 0xD0, 0x04, 0x00, 0x10,
9367                                                 0x01, 0xB4 };
9368
9369 static unsigned char send_ss_422[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x11,
9370                                                 0x00, 0x82, 0x02, 0x81, 0x83,
9371                                                 0x85, 0x10, 0x54, 0x65, 0x78,
9372                                                 0x74, 0x20, 0x41, 0x74, 0x74,
9373                                                 0x72, 0x69, 0x62, 0x75, 0x74,
9374                                                 0x65, 0x20, 0x32, 0x89, 0x10,
9375                                                 0x91, 0xAA, 0x12, 0x0A, 0x21,
9376                                                 0x43, 0x65, 0x87, 0x09, 0x21,
9377                                                 0x43, 0x65, 0x87, 0xA9, 0x01,
9378                                                 0xFB };
9379
9380 static unsigned char send_ss_431[] = { 0xD0, 0x33, 0x81, 0x03, 0x01, 0x11,
9381                                                 0x00, 0x82, 0x02, 0x81, 0x83,
9382                                                 0x85, 0x10, 0x54, 0x65, 0x78,
9383                                                 0x74, 0x20, 0x41, 0x74, 0x74,
9384                                                 0x72, 0x69, 0x62, 0x75, 0x74,
9385                                                 0x65, 0x20, 0x31, 0x89, 0x10,
9386                                                 0x91, 0xAA, 0x12, 0x0A, 0x21,
9387                                                 0x43, 0x65, 0x87, 0x09, 0x21,
9388                                                 0x43, 0x65, 0x87, 0xA9, 0x01,
9389                                                 0xFB, 0xD0, 0x04, 0x00, 0x10,
9390                                                 0x02, 0xB4 };
9391
9392 static unsigned char send_ss_432[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x11,
9393                                                 0x00, 0x82, 0x02, 0x81, 0x83,
9394                                                 0x85, 0x10, 0x54, 0x65, 0x78,
9395                                                 0x74, 0x20, 0x41, 0x74, 0x74,
9396                                                 0x72, 0x69, 0x62, 0x75, 0x74,
9397                                                 0x65, 0x20, 0x32, 0x89, 0x10,
9398                                                 0x91, 0xAA, 0x12, 0x0A, 0x21,
9399                                                 0x43, 0x65, 0x87, 0x09, 0x21,
9400                                                 0x43, 0x65, 0x87, 0xA9, 0x01,
9401                                                 0xFB };
9402
9403 static unsigned char send_ss_441[] = { 0xD0, 0x33, 0x81, 0x03, 0x01, 0x11,
9404                                                 0x00, 0x82, 0x02, 0x81, 0x83,
9405                                                 0x85, 0x10, 0x54, 0x65, 0x78,
9406                                                 0x74, 0x20, 0x41, 0x74, 0x74,
9407                                                 0x72, 0x69, 0x62, 0x75, 0x74,
9408                                                 0x65, 0x20, 0x31, 0x89, 0x10,
9409                                                 0x91, 0xAA, 0x12, 0x0A, 0x21,
9410                                                 0x43, 0x65, 0x87, 0x09, 0x21,
9411                                                 0x43, 0x65, 0x87, 0xA9, 0x01,
9412                                                 0xFB, 0xD0, 0x04, 0x00, 0x10,
9413                                                 0x04, 0xB4 };
9414
9415 static unsigned char send_ss_442[] = { 0xD0, 0x33, 0x81, 0x03, 0x01, 0x11,
9416                                                 0x00, 0x82, 0x02, 0x81, 0x83,
9417                                                 0x85, 0x10, 0x54, 0x65, 0x78,
9418                                                 0x74, 0x20, 0x41, 0x74, 0x74,
9419                                                 0x72, 0x69, 0x62, 0x75, 0x74,
9420                                                 0x65, 0x20, 0x32, 0x89, 0x10,
9421                                                 0x91, 0xAA, 0x12, 0x0A, 0x21,
9422                                                 0x43, 0x65, 0x87, 0x09, 0x21,
9423                                                 0x43, 0x65, 0x87, 0xA9, 0x01,
9424                                                 0xFB, 0xD0, 0x04, 0x00, 0x10,
9425                                                 0x00, 0xB4 };
9426
9427 static unsigned char send_ss_443[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x11,
9428                                                 0x00, 0x82, 0x02, 0x81, 0x83,
9429                                                 0x85, 0x10, 0x54, 0x65, 0x78,
9430                                                 0x74, 0x20, 0x41, 0x74, 0x74,
9431                                                 0x72, 0x69, 0x62, 0x75, 0x74,
9432                                                 0x65, 0x20, 0x33, 0x89, 0x10,
9433                                                 0x91, 0xAA, 0x12, 0x0A, 0x21,
9434                                                 0x43, 0x65, 0x87, 0x09, 0x21,
9435                                                 0x43, 0x65, 0x87, 0xA9, 0x01,
9436                                                 0xFB };
9437
9438 static unsigned char send_ss_451[] = { 0xD0, 0x33, 0x81, 0x03, 0x01, 0x11,
9439                                                 0x00, 0x82, 0x02, 0x81, 0x83,
9440                                                 0x85, 0x10, 0x54, 0x65, 0x78,
9441                                                 0x74, 0x20, 0x41, 0x74, 0x74,
9442                                                 0x72, 0x69, 0x62, 0x75, 0x74,
9443                                                 0x65, 0x20, 0x31, 0x89, 0x10,
9444                                                 0x91, 0xAA, 0x12, 0x0A, 0x21,
9445                                                 0x43, 0x65, 0x87, 0x09, 0x21,
9446                                                 0x43, 0x65, 0x87, 0xA9, 0x01,
9447                                                 0xFB, 0xD0, 0x04, 0x00, 0x10,
9448                                                 0x08, 0xB4 };
9449
9450 static unsigned char send_ss_452[] = { 0xD0, 0x33, 0x81, 0x03, 0x01, 0x11,
9451                                                 0x00, 0x82, 0x02, 0x81, 0x83,
9452                                                 0x85, 0x10, 0x54, 0x65, 0x78,
9453                                                 0x74, 0x20, 0x41, 0x74, 0x74,
9454                                                 0x72, 0x69, 0x62, 0x75, 0x74,
9455                                                 0x65, 0x20, 0x32, 0x89, 0x10,
9456                                                 0x91, 0xAA, 0x12, 0x0A, 0x21,
9457                                                 0x43, 0x65, 0x87, 0x09, 0x21,
9458                                                 0x43, 0x65, 0x87, 0xA9, 0x01,
9459                                                 0xFB, 0xD0, 0x04, 0x00, 0x10,
9460                                                 0x00, 0xB4 };
9461
9462 static unsigned char send_ss_453[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x11,
9463                                                 0x00, 0x82, 0x02, 0x81, 0x83,
9464                                                 0x85, 0x10, 0x54, 0x65, 0x78,
9465                                                 0x74, 0x20, 0x41, 0x74, 0x74,
9466                                                 0x72, 0x69, 0x62, 0x75, 0x74,
9467                                                 0x65, 0x20, 0x33, 0x89, 0x10,
9468                                                 0x91, 0xAA, 0x12, 0x0A, 0x21,
9469                                                 0x43, 0x65, 0x87, 0x09, 0x21,
9470                                                 0x43, 0x65, 0x87, 0xA9, 0x01,
9471                                                 0xFB };
9472
9473 static unsigned char send_ss_461[] = { 0xD0, 0x33, 0x81, 0x03, 0x01, 0x11,
9474                                                 0x00, 0x82, 0x02, 0x81, 0x83,
9475                                                 0x85, 0x10, 0x54, 0x65, 0x78,
9476                                                 0x74, 0x20, 0x41, 0x74, 0x74,
9477                                                 0x72, 0x69, 0x62, 0x75, 0x74,
9478                                                 0x65, 0x20, 0x31, 0x89, 0x10,
9479                                                 0x91, 0xAA, 0x12, 0x0A, 0x21,
9480                                                 0x43, 0x65, 0x87, 0x09, 0x21,
9481                                                 0x43, 0x65, 0x87, 0xA9, 0x01,
9482                                                 0xFB, 0xD0, 0x04, 0x00, 0x10,
9483                                                 0x10, 0xB4 };
9484
9485 static unsigned char send_ss_462[] = { 0xD0, 0x33, 0x81, 0x03, 0x01, 0x11,
9486                                                 0x00, 0x82, 0x02, 0x81, 0x83,
9487                                                 0x85, 0x10, 0x54, 0x65, 0x78,
9488                                                 0x74, 0x20, 0x41, 0x74, 0x74,
9489                                                 0x72, 0x69, 0x62, 0x75, 0x74,
9490                                                 0x65, 0x20, 0x32, 0x89, 0x10,
9491                                                 0x91, 0xAA, 0x12, 0x0A, 0x21,
9492                                                 0x43, 0x65, 0x87, 0x09, 0x21,
9493                                                 0x43, 0x65, 0x87, 0xA9, 0x01,
9494                                                 0xFB, 0xD0, 0x04, 0x00, 0x10,
9495                                                 0x00, 0xB4 };
9496
9497 static unsigned char send_ss_463[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x11,
9498                                                 0x00, 0x82, 0x02, 0x81, 0x83,
9499                                                 0x85, 0x10, 0x54, 0x65, 0x78,
9500                                                 0x74, 0x20, 0x41, 0x74, 0x74,
9501                                                 0x72, 0x69, 0x62, 0x75, 0x74,
9502                                                 0x65, 0x20, 0x33, 0x89, 0x10,
9503                                                 0x91, 0xAA, 0x12, 0x0A, 0x21,
9504                                                 0x43, 0x65, 0x87, 0x09, 0x21,
9505                                                 0x43, 0x65, 0x87, 0xA9, 0x01,
9506                                                 0xFB };
9507
9508 static unsigned char send_ss_471[] = { 0xD0, 0x33, 0x81, 0x03, 0x01, 0x11,
9509                                                 0x00, 0x82, 0x02, 0x81, 0x83,
9510                                                 0x85, 0x10, 0x54, 0x65, 0x78,
9511                                                 0x74, 0x20, 0x41, 0x74, 0x74,
9512                                                 0x72, 0x69, 0x62, 0x75, 0x74,
9513                                                 0x65, 0x20, 0x31, 0x89, 0x10,
9514                                                 0x91, 0xAA, 0x12, 0x0A, 0x21,
9515                                                 0x43, 0x65, 0x87, 0x09, 0x21,
9516                                                 0x43, 0x65, 0x87, 0xA9, 0x01,
9517                                                 0xFB, 0xD0, 0x04, 0x00, 0x10,
9518                                                 0x20, 0xB4 };
9519
9520 static unsigned char send_ss_472[] = { 0xD0, 0x33, 0x81, 0x03, 0x01, 0x11,
9521                                                 0x00, 0x82, 0x02, 0x81, 0x83,
9522                                                 0x85, 0x10, 0x54, 0x65, 0x78,
9523                                                 0x74, 0x20, 0x41, 0x74, 0x74,
9524                                                 0x72, 0x69, 0x62, 0x75, 0x74,
9525                                                 0x65, 0x20, 0x32, 0x89, 0x10,
9526                                                 0x91, 0xAA, 0x12, 0x0A, 0x21,
9527                                                 0x43, 0x65, 0x87, 0x09, 0x21,
9528                                                 0x43, 0x65, 0x87, 0xA9, 0x01,
9529                                                 0xFB, 0xD0, 0x04, 0x00, 0x10,
9530                                                 0x00, 0xB4 };
9531
9532 static unsigned char send_ss_473[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x11,
9533                                                 0x00, 0x82, 0x02, 0x81, 0x83,
9534                                                 0x85, 0x10, 0x54, 0x65, 0x78,
9535                                                 0x74, 0x20, 0x41, 0x74, 0x74,
9536                                                 0x72, 0x69, 0x62, 0x75, 0x74,
9537                                                 0x65, 0x20, 0x33, 0x89, 0x10,
9538                                                 0x91, 0xAA, 0x12, 0x0A, 0x21,
9539                                                 0x43, 0x65, 0x87, 0x09, 0x21,
9540                                                 0x43, 0x65, 0x87, 0xA9, 0x01,
9541                                                 0xFB };
9542
9543 static unsigned char send_ss_481[] = { 0xD0, 0x33, 0x81, 0x03, 0x01, 0x11,
9544                                                 0x00, 0x82, 0x02, 0x81, 0x83,
9545                                                 0x85, 0x10, 0x54, 0x65, 0x78,
9546                                                 0x74, 0x20, 0x41, 0x74, 0x74,
9547                                                 0x72, 0x69, 0x62, 0x75, 0x74,
9548                                                 0x65, 0x20, 0x31, 0x89, 0x10,
9549                                                 0x91, 0xAA, 0x12, 0x0A, 0x21,
9550                                                 0x43, 0x65, 0x87, 0x09, 0x21,
9551                                                 0x43, 0x65, 0x87, 0xA9, 0x01,
9552                                                 0xFB, 0xD0, 0x04, 0x00, 0x10,
9553                                                 0x40, 0xB4 };
9554
9555 static unsigned char send_ss_482[] = { 0xD0, 0x33, 0x81, 0x03, 0x01, 0x11,
9556                                                 0x00, 0x82, 0x02, 0x81, 0x83,
9557                                                 0x85, 0x10, 0x54, 0x65, 0x78,
9558                                                 0x74, 0x20, 0x41, 0x74, 0x74,
9559                                                 0x72, 0x69, 0x62, 0x75, 0x74,
9560                                                 0x65, 0x20, 0x32, 0x89, 0x10,
9561                                                 0x91, 0xAA, 0x12, 0x0A, 0x21,
9562                                                 0x43, 0x65, 0x87, 0x09, 0x21,
9563                                                 0x43, 0x65, 0x87, 0xA9, 0x01,
9564                                                 0xFB, 0xD0, 0x04, 0x00, 0x10,
9565                                                 0x00, 0xB4 };
9566
9567 static unsigned char send_ss_483[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x11,
9568                                                 0x00, 0x82, 0x02, 0x81, 0x83,
9569                                                 0x85, 0x10, 0x54, 0x65, 0x78,
9570                                                 0x74, 0x20, 0x41, 0x74, 0x74,
9571                                                 0x72, 0x69, 0x62, 0x75, 0x74,
9572                                                 0x65, 0x20, 0x33, 0x89, 0x10,
9573                                                 0x91, 0xAA, 0x12, 0x0A, 0x21,
9574                                                 0x43, 0x65, 0x87, 0x09, 0x21,
9575                                                 0x43, 0x65, 0x87, 0xA9, 0x01,
9576                                                 0xFB };
9577
9578 static unsigned char send_ss_491[] = { 0xD0, 0x33, 0x81, 0x03, 0x01, 0x11,
9579                                                 0x00, 0x82, 0x02, 0x81, 0x83,
9580                                                 0x85, 0x10, 0x54, 0x65, 0x78,
9581                                                 0x74, 0x20, 0x41, 0x74, 0x74,
9582                                                 0x72, 0x69, 0x62, 0x75, 0x74,
9583                                                 0x65, 0x20, 0x31, 0x89, 0x10,
9584                                                 0x91, 0xAA, 0x12, 0x0A, 0x21,
9585                                                 0x43, 0x65, 0x87, 0x09, 0x21,
9586                                                 0x43, 0x65, 0x87, 0xA9, 0x01,
9587                                                 0xFB, 0xD0, 0x04, 0x00, 0x10,
9588                                                 0x80, 0xB4 };
9589
9590 static unsigned char send_ss_492[] = { 0xD0, 0x33, 0x81, 0x03, 0x01, 0x11,
9591                                                 0x00, 0x82, 0x02, 0x81, 0x83,
9592                                                 0x85, 0x10, 0x54, 0x65, 0x78,
9593                                                 0x74, 0x20, 0x41, 0x74, 0x74,
9594                                                 0x72, 0x69, 0x62, 0x75, 0x74,
9595                                                 0x65, 0x20, 0x32, 0x89, 0x10,
9596                                                 0x91, 0xAA, 0x12, 0x0A, 0x21,
9597                                                 0x43, 0x65, 0x87, 0x09, 0x21,
9598                                                 0x43, 0x65, 0x87, 0xA9, 0x01,
9599                                                 0xFB, 0xD0, 0x04, 0x00, 0x10,
9600                                                 0x00, 0xB4 };
9601
9602 static unsigned char send_ss_493[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x11,
9603                                                 0x00, 0x82, 0x02, 0x81, 0x83,
9604                                                 0x85, 0x10, 0x54, 0x65, 0x78,
9605                                                 0x74, 0x20, 0x41, 0x74, 0x74,
9606                                                 0x72, 0x69, 0x62, 0x75, 0x74,
9607                                                 0x65, 0x20, 0x33, 0x89, 0x10,
9608                                                 0x91, 0xAA, 0x12, 0x0A, 0x21,
9609                                                 0x43, 0x65, 0x87, 0x09, 0x21,
9610                                                 0x43, 0x65, 0x87, 0xA9, 0x01,
9611                                                 0xFB };
9612
9613 static unsigned char send_ss_4101[] = { 0xD0, 0x33, 0x81, 0x03, 0x01, 0x11,
9614                                                 0x00, 0x82, 0x02, 0x81, 0x83,
9615                                                 0x85, 0x10, 0x54, 0x65, 0x78,
9616                                                 0x74, 0x20, 0x41, 0x74, 0x74,
9617                                                 0x72, 0x69, 0x62, 0x75, 0x74,
9618                                                 0x65, 0x20, 0x31, 0x89, 0x10,
9619                                                 0x91, 0xAA, 0x12, 0x0A, 0x21,
9620                                                 0x43, 0x65, 0x87, 0x09, 0x21,
9621                                                 0x43, 0x65, 0x87, 0xA9, 0x01,
9622                                                 0xFB, 0xD0, 0x04, 0x00, 0x10,
9623                                                 0x00, 0xB4 };
9624
9625 static unsigned char send_ss_4102[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x11,
9626                                                 0x00, 0x82, 0x02, 0x81, 0x83,
9627                                                 0x85, 0x10, 0x54, 0x65, 0x78,
9628                                                 0x74, 0x20, 0x41, 0x74, 0x74,
9629                                                 0x72, 0x69, 0x62, 0x75, 0x74,
9630                                                 0x65, 0x20, 0x32, 0x89, 0x10,
9631                                                 0x91, 0xAA, 0x12, 0x0A, 0x21,
9632                                                 0x43, 0x65, 0x87, 0x09, 0x21,
9633                                                 0x43, 0x65, 0x87, 0xA9, 0x01,
9634                                                 0xFB };
9635
9636 static unsigned char send_ss_511[] = { 0xD0, 0x22, 0x81, 0x03, 0x01, 0x11,
9637                                                 0x00, 0x82, 0x02, 0x81, 0x83,
9638                                                 0x85, 0x05, 0x80, 0x4F, 0x60,
9639                                                 0x59, 0x7D, 0x89, 0x10, 0x91,
9640                                                 0xAA, 0x12, 0x0A, 0x21, 0x43,
9641                                                 0x65, 0x87, 0x09, 0x21, 0x43,
9642                                                 0x65, 0x87, 0xA9, 0x01, 0xFB };
9643
9644 static unsigned char send_ss_611[] = { 0xD0, 0x20, 0x81, 0x03, 0x01, 0x11,
9645                                                 0x00, 0x82, 0x02, 0x81, 0x83,
9646                                                 0x85, 0x03, 0x80, 0x30, 0xEB,
9647                                                 0x89, 0x10, 0x91, 0xAA, 0x12,
9648                                                 0x0A, 0x21, 0x43, 0x65, 0x87,
9649                                                 0x09, 0x21, 0x43, 0x65, 0x87,
9650                                                 0xA9, 0x01, 0xFB };
9651
9652 static struct send_ss_test send_ss_data_111 = {
9653         .pdu = send_ss_111,
9654         .pdu_len = sizeof(send_ss_111),
9655         .qualifier = 0x00,
9656         .alpha_id = "Call Forward",
9657         .ss = {
9658                 .ton_npi = 0x91,
9659                 .ss = "**21*01234567890123456789*10#"
9660         }
9661 };
9662
9663 static struct send_ss_test send_ss_data_141 = {
9664         .pdu = send_ss_141,
9665         .pdu_len = sizeof(send_ss_141),
9666         .qualifier = 0x00,
9667         .alpha_id = "Call Forward",
9668         .ss = {
9669                 .ton_npi = 0x91,
9670                 .ss = "**21*0123456789012345678901234567*11#"
9671         }
9672 };
9673
9674 static struct send_ss_test send_ss_data_151 = {
9675         .pdu = send_ss_151,
9676         .pdu_len = sizeof(send_ss_151),
9677         .qualifier = 0x00,
9678         .alpha_id = "Even if the Fixed Dialling Number service is enabled, the "
9679                 "supplementary service control string included in the SEND SS "
9680                 "proactive command shall not be checked against those of the "
9681                 "FDN list. Upon receiving this command, the ME shall deci",
9682         .ss = {
9683                 .ton_npi = 0xFF,
9684                 .ss = "*#31#"
9685         }
9686 };
9687
9688 static struct send_ss_test send_ss_data_161 = {
9689         .pdu = send_ss_161,
9690         .pdu_len = sizeof(send_ss_161),
9691         .qualifier = 0x00,
9692         .alpha_id = "",
9693         .ss = {
9694                 .ton_npi = 0x91,
9695                 .ss = "**21*01234567890123456789*10#"
9696         }
9697 };
9698
9699 static struct send_ss_test send_ss_data_211 = {
9700         .pdu = send_ss_211,
9701         .pdu_len = sizeof(send_ss_211),
9702         .qualifier = 0x00,
9703         .alpha_id = "Basic Icon",
9704         .ss = {
9705                 .ton_npi = 0x91,
9706                 .ss = "**21*01234567890123456789*10#"
9707         },
9708         .icon_id = {
9709                 .qualifier = STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY,
9710                 .id = 0x01
9711         }
9712 };
9713
9714 static struct send_ss_test send_ss_data_221 = {
9715         .pdu = send_ss_221,
9716         .pdu_len = sizeof(send_ss_221),
9717         .qualifier = 0x00,
9718         .alpha_id = "Colour Icon",
9719         .ss = {
9720                 .ton_npi = 0x91,
9721                 .ss = "**21*01234567890123456789*10#"
9722         },
9723         .icon_id = {
9724                 .qualifier = STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY,
9725                 .id = 0x02
9726         }
9727 };
9728
9729 static struct send_ss_test send_ss_data_231 = {
9730         .pdu = send_ss_231,
9731         .pdu_len = sizeof(send_ss_231),
9732         .qualifier = 0x00,
9733         .alpha_id = "Basic Icon",
9734         .ss = {
9735                 .ton_npi = 0x91,
9736                 .ss = "**21*01234567890123456789*10#"
9737         },
9738         .icon_id = {
9739                 .qualifier = STK_ICON_QUALIFIER_TYPE_NON_SELF_EXPLANATORY,
9740                 .id = 0x01
9741         }
9742 };
9743
9744 static struct send_ss_test send_ss_data_241 = {
9745         .pdu = send_ss_241,
9746         .pdu_len = sizeof(send_ss_241),
9747         .qualifier = 0x00,
9748         .ss = {
9749                 .ton_npi = 0x91,
9750                 .ss = "**21*01234567890123456789#"
9751         },
9752         .icon_id = {
9753                 .qualifier = STK_ICON_QUALIFIER_TYPE_NON_SELF_EXPLANATORY,
9754                 .id = 0x01
9755         }
9756 };
9757
9758 static struct send_ss_test send_ss_data_311 = {
9759         .pdu = send_ss_311,
9760         .pdu_len = sizeof(send_ss_311),
9761         .qualifier = 0x00,
9762         .alpha_id = "ЗДРАВСТВУЙТЕ",
9763         .ss = {
9764                 .ton_npi = 0x91,
9765                 .ss = "**21*01234567890123456789*10#"
9766         }
9767 };
9768
9769 static struct send_ss_test send_ss_data_411 = {
9770         .pdu = send_ss_411,
9771         .pdu_len = sizeof(send_ss_411),
9772         .qualifier = 0x00,
9773         .alpha_id = "Text Attribute 1",
9774         .ss = {
9775                 .ton_npi = 0x91,
9776                 .ss = "**21*01234567890123456789*10#"
9777         },
9778         .text_attr = {
9779                 .len = 4,
9780                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
9781         }
9782 };
9783
9784 static struct send_ss_test send_ss_data_412 = {
9785         .pdu = send_ss_412,
9786         .pdu_len = sizeof(send_ss_412),
9787         .qualifier = 0x00,
9788         .alpha_id = "Text Attribute 2",
9789         .ss = {
9790                 .ton_npi = 0x91,
9791                 .ss = "**21*01234567890123456789*10#"
9792         }
9793 };
9794
9795 static struct send_ss_test send_ss_data_421 = {
9796         .pdu = send_ss_421,
9797         .pdu_len = sizeof(send_ss_421),
9798         .qualifier = 0x00,
9799         .alpha_id = "Text Attribute 1",
9800         .ss = {
9801                 .ton_npi = 0x91,
9802                 .ss = "**21*01234567890123456789*10#"
9803         },
9804         .text_attr = {
9805                 .len = 4,
9806                 .attributes = { 0x00, 0x10, 0x01, 0xB4 }
9807         }
9808 };
9809
9810 static struct send_ss_test send_ss_data_422 = {
9811         .pdu = send_ss_422,
9812         .pdu_len = sizeof(send_ss_422),
9813         .qualifier = 0x00,
9814         .alpha_id = "Text Attribute 2",
9815         .ss = {
9816                 .ton_npi = 0x91,
9817                 .ss = "**21*01234567890123456789*10#"
9818         }
9819 };
9820
9821 static struct send_ss_test send_ss_data_431 = {
9822         .pdu = send_ss_431,
9823         .pdu_len = sizeof(send_ss_431),
9824         .qualifier = 0x00,
9825         .alpha_id = "Text Attribute 1",
9826         .ss = {
9827                 .ton_npi = 0x91,
9828                 .ss = "**21*01234567890123456789*10#"
9829         },
9830         .text_attr = {
9831                 .len = 4,
9832                 .attributes = { 0x00, 0x10, 0x02, 0xB4 }
9833         }
9834 };
9835
9836 static struct send_ss_test send_ss_data_432 = {
9837         .pdu = send_ss_432,
9838         .pdu_len = sizeof(send_ss_432),
9839         .qualifier = 0x00,
9840         .alpha_id = "Text Attribute 2",
9841         .ss = {
9842                 .ton_npi = 0x91,
9843                 .ss = "**21*01234567890123456789*10#"
9844         }
9845 };
9846
9847 static struct send_ss_test send_ss_data_441 = {
9848         .pdu = send_ss_441,
9849         .pdu_len = sizeof(send_ss_441),
9850         .qualifier = 0x00,
9851         .alpha_id = "Text Attribute 1",
9852         .ss = {
9853                 .ton_npi = 0x91,
9854                 .ss = "**21*01234567890123456789*10#"
9855         },
9856         .text_attr = {
9857                 .len = 4,
9858                 .attributes = { 0x00, 0x10, 0x04, 0xB4 }
9859         }
9860 };
9861
9862 static struct send_ss_test send_ss_data_442 = {
9863         .pdu = send_ss_442,
9864         .pdu_len = sizeof(send_ss_442),
9865         .qualifier = 0x00,
9866         .alpha_id = "Text Attribute 2",
9867         .ss = {
9868                 .ton_npi = 0x91,
9869                 .ss = "**21*01234567890123456789*10#"
9870         },
9871         .text_attr = {
9872                 .len = 4,
9873                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
9874         }
9875 };
9876
9877 static struct send_ss_test send_ss_data_443 = {
9878         .pdu = send_ss_443,
9879         .pdu_len = sizeof(send_ss_443),
9880         .qualifier = 0x00,
9881         .alpha_id = "Text Attribute 3",
9882         .ss = {
9883                 .ton_npi = 0x91,
9884                 .ss = "**21*01234567890123456789*10#"
9885         }
9886 };
9887
9888 static struct send_ss_test send_ss_data_451 = {
9889         .pdu = send_ss_451,
9890         .pdu_len = sizeof(send_ss_451),
9891         .qualifier = 0x00,
9892         .alpha_id = "Text Attribute 1",
9893         .ss = {
9894                 .ton_npi = 0x91,
9895                 .ss = "**21*01234567890123456789*10#"
9896         },
9897         .text_attr = {
9898                 .len = 4,
9899                 .attributes = { 0x00, 0x10, 0x08, 0xB4 }
9900         }
9901 };
9902
9903 static struct send_ss_test send_ss_data_452 = {
9904         .pdu = send_ss_452,
9905         .pdu_len = sizeof(send_ss_452),
9906         .qualifier = 0x00,
9907         .alpha_id = "Text Attribute 2",
9908         .ss = {
9909                 .ton_npi = 0x91,
9910                 .ss = "**21*01234567890123456789*10#"
9911         },
9912         .text_attr = {
9913                 .len = 4,
9914                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
9915         }
9916 };
9917
9918 static struct send_ss_test send_ss_data_453 = {
9919         .pdu = send_ss_453,
9920         .pdu_len = sizeof(send_ss_453),
9921         .qualifier = 0x00,
9922         .alpha_id = "Text Attribute 3",
9923         .ss = {
9924                 .ton_npi = 0x91,
9925                 .ss = "**21*01234567890123456789*10#"
9926         }
9927 };
9928
9929 static struct send_ss_test send_ss_data_461 = {
9930         .pdu = send_ss_461,
9931         .pdu_len = sizeof(send_ss_461),
9932         .qualifier = 0x00,
9933         .alpha_id = "Text Attribute 1",
9934         .ss = {
9935                 .ton_npi = 0x91,
9936                 .ss = "**21*01234567890123456789*10#"
9937         },
9938         .text_attr = {
9939                 .len = 4,
9940                 .attributes = { 0x00, 0x10, 0x10, 0xB4 }
9941         }
9942 };
9943
9944 static struct send_ss_test send_ss_data_462 = {
9945         .pdu = send_ss_462,
9946         .pdu_len = sizeof(send_ss_462),
9947         .qualifier = 0x00,
9948         .alpha_id = "Text Attribute 2",
9949         .ss = {
9950                 .ton_npi = 0x91,
9951                 .ss = "**21*01234567890123456789*10#"
9952         },
9953         .text_attr = {
9954                 .len = 4,
9955                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
9956         }
9957 };
9958
9959 static struct send_ss_test send_ss_data_463 = {
9960         .pdu = send_ss_463,
9961         .pdu_len = sizeof(send_ss_463),
9962         .qualifier = 0x00,
9963         .alpha_id = "Text Attribute 3",
9964         .ss = {
9965                 .ton_npi = 0x91,
9966                 .ss = "**21*01234567890123456789*10#"
9967         }
9968 };
9969
9970 static struct send_ss_test send_ss_data_471 = {
9971         .pdu = send_ss_471,
9972         .pdu_len = sizeof(send_ss_471),
9973         .qualifier = 0x00,
9974         .alpha_id = "Text Attribute 1",
9975         .ss = {
9976                 .ton_npi = 0x91,
9977                 .ss = "**21*01234567890123456789*10#"
9978         },
9979         .text_attr = {
9980                 .len = 4,
9981                 .attributes = { 0x00, 0x10, 0x20, 0xB4 }
9982         }
9983 };
9984
9985 static struct send_ss_test send_ss_data_472 = {
9986         .pdu = send_ss_472,
9987         .pdu_len = sizeof(send_ss_472),
9988         .qualifier = 0x00,
9989         .alpha_id = "Text Attribute 2",
9990         .ss = {
9991                 .ton_npi = 0x91,
9992                 .ss = "**21*01234567890123456789*10#"
9993         },
9994         .text_attr = {
9995                 .len = 4,
9996                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
9997         }
9998 };
9999
10000 static struct send_ss_test send_ss_data_473 = {
10001         .pdu = send_ss_473,
10002         .pdu_len = sizeof(send_ss_473),
10003         .qualifier = 0x00,
10004         .alpha_id = "Text Attribute 3",
10005         .ss = {
10006                 .ton_npi = 0x91,
10007                 .ss = "**21*01234567890123456789*10#"
10008         }
10009 };
10010
10011 static struct send_ss_test send_ss_data_481 = {
10012         .pdu = send_ss_481,
10013         .pdu_len = sizeof(send_ss_481),
10014         .qualifier = 0x00,
10015         .alpha_id = "Text Attribute 1",
10016         .ss = {
10017                 .ton_npi = 0x91,
10018                 .ss = "**21*01234567890123456789*10#"
10019         },
10020         .text_attr = {
10021                 .len = 4,
10022                 .attributes = { 0x00, 0x10, 0x40, 0xB4 }
10023         }
10024 };
10025
10026 static struct send_ss_test send_ss_data_482 = {
10027         .pdu = send_ss_482,
10028         .pdu_len = sizeof(send_ss_482),
10029         .qualifier = 0x00,
10030         .alpha_id = "Text Attribute 2",
10031         .ss = {
10032                 .ton_npi = 0x91,
10033                 .ss = "**21*01234567890123456789*10#"
10034         },
10035         .text_attr = {
10036                 .len = 4,
10037                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
10038         }
10039 };
10040
10041 static struct send_ss_test send_ss_data_483 = {
10042         .pdu = send_ss_483,
10043         .pdu_len = sizeof(send_ss_483),
10044         .qualifier = 0x00,
10045         .alpha_id = "Text Attribute 3",
10046         .ss = {
10047                 .ton_npi = 0x91,
10048                 .ss = "**21*01234567890123456789*10#"
10049         }
10050 };
10051
10052 static struct send_ss_test send_ss_data_491 = {
10053         .pdu = send_ss_491,
10054         .pdu_len = sizeof(send_ss_491),
10055         .qualifier = 0x00,
10056         .alpha_id = "Text Attribute 1",
10057         .ss = {
10058                 .ton_npi = 0x91,
10059                 .ss = "**21*01234567890123456789*10#"
10060         },
10061         .text_attr = {
10062                 .len = 4,
10063                 .attributes = { 0x00, 0x10, 0x80, 0xB4 }
10064         }
10065 };
10066
10067 static struct send_ss_test send_ss_data_492 = {
10068         .pdu = send_ss_492,
10069         .pdu_len = sizeof(send_ss_492),
10070         .qualifier = 0x00,
10071         .alpha_id = "Text Attribute 2",
10072         .ss = {
10073                 .ton_npi = 0x91,
10074                 .ss = "**21*01234567890123456789*10#"
10075         },
10076         .text_attr = {
10077                 .len = 4,
10078                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
10079         }
10080 };
10081
10082 static struct send_ss_test send_ss_data_493 = {
10083         .pdu = send_ss_493,
10084         .pdu_len = sizeof(send_ss_493),
10085         .qualifier = 0x00,
10086         .alpha_id = "Text Attribute 3",
10087         .ss = {
10088                 .ton_npi = 0x91,
10089                 .ss = "**21*01234567890123456789*10#"
10090         }
10091 };
10092
10093 static struct send_ss_test send_ss_data_4101 = {
10094         .pdu = send_ss_4101,
10095         .pdu_len = sizeof(send_ss_4101),
10096         .qualifier = 0x00,
10097         .alpha_id = "Text Attribute 1",
10098         .ss = {
10099                 .ton_npi = 0x91,
10100                 .ss = "**21*01234567890123456789*10#"
10101         },
10102         .text_attr = {
10103                 .len = 4,
10104                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
10105         }
10106 };
10107
10108 static struct send_ss_test send_ss_data_4102 = {
10109         .pdu = send_ss_4102,
10110         .pdu_len = sizeof(send_ss_4102),
10111         .qualifier = 0x00,
10112         .alpha_id = "Text Attribute 2",
10113         .ss = {
10114                 .ton_npi = 0x91,
10115                 .ss = "**21*01234567890123456789*10#"
10116         }
10117 };
10118
10119 static struct send_ss_test send_ss_data_511 = {
10120         .pdu = send_ss_511,
10121         .pdu_len = sizeof(send_ss_511),
10122         .qualifier = 0x00,
10123         .alpha_id = "你好",
10124         .ss = {
10125                 .ton_npi = 0x91,
10126                 .ss = "**21*01234567890123456789*10#"
10127         }
10128 };
10129
10130 static struct send_ss_test send_ss_data_611 = {
10131         .pdu = send_ss_611,
10132         .pdu_len = sizeof(send_ss_611),
10133         .qualifier = 0x00,
10134         .alpha_id = "ル",
10135         .ss = {
10136                 .ton_npi = 0x91,
10137                 .ss = "**21*01234567890123456789*10#"
10138         }
10139 };
10140
10141 static void test_send_ss(gconstpointer data)
10142 {
10143         const struct send_ss_test *test = data;
10144         struct stk_command *command;
10145
10146         command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
10147
10148         g_assert(command);
10149         g_assert(command->status == STK_PARSE_RESULT_OK);
10150
10151         g_assert(command->number == 1);
10152         g_assert(command->type == STK_COMMAND_TYPE_SEND_SS);
10153         g_assert(command->qualifier == test->qualifier);
10154
10155         g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
10156         g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_NETWORK);
10157
10158         check_alpha_id(command->send_ss.alpha_id, test->alpha_id);
10159         check_ss(&command->send_ss.ss, &test->ss);
10160         check_icon_id(&command->send_ss.icon_id, &test->icon_id);
10161         check_text_attr(&command->send_ss.text_attr, &test->text_attr);
10162         check_frame_id(&command->send_ss.frame_id, &test->frame_id);
10163
10164         stk_command_free(command);
10165 }
10166
10167 struct send_ussd_test {
10168         const unsigned char *pdu;
10169         unsigned int pdu_len;
10170         unsigned char qualifier;
10171         char *alpha_id;
10172         char *ussd;
10173         struct stk_icon_id icon_id;
10174         struct stk_text_attribute text_attr;
10175         struct stk_frame_id frame_id;
10176 };
10177
10178 static unsigned char send_ussd_111[] = { 0xD0, 0x50, 0x81, 0x03, 0x01, 0x12,
10179                                                 0x00, 0x82, 0x02, 0x81, 0x83,
10180                                                 0x85, 0x0A, 0x37, 0x2D, 0x62,
10181                                                 0x69, 0x74, 0x20, 0x55, 0x53,
10182                                                 0x53, 0x44, 0x8A, 0x39, 0xF0,
10183                                                 0x41, 0xE1, 0x90, 0x58, 0x34,
10184                                                 0x1E, 0x91, 0x49, 0xE5, 0x92,
10185                                                 0xD9, 0x74, 0x3E, 0xA1, 0x51,
10186                                                 0xE9, 0x94, 0x5A, 0xB5, 0x5E,
10187                                                 0xB1, 0x59, 0x6D, 0x2B, 0x2C,
10188                                                 0x1E, 0x93, 0xCB, 0xE6, 0x33,
10189                                                 0x3A, 0xAD, 0x5E, 0xB3, 0xDB,
10190                                                 0xEE, 0x37, 0x3C, 0x2E, 0x9F,
10191                                                 0xD3, 0xEB, 0xF6, 0x3B, 0x3E,
10192                                                 0xAF, 0x6F, 0xC5, 0x64, 0x33,
10193                                                 0x5A, 0xCD, 0x76, 0xC3, 0xE5,
10194                                                 0x60 };
10195
10196 static unsigned char send_ussd_121[] = { 0xD0, 0x58, 0x81, 0x03, 0x01, 0x12,
10197                                                 0x00, 0x82, 0x02, 0x81, 0x83,
10198                                                 0x85, 0x0A, 0x38, 0x2D, 0x62,
10199                                                 0x69, 0x74, 0x20, 0x55, 0x53,
10200                                                 0x53, 0x44, 0x8A, 0x41, 0x44,
10201                                                 0x41, 0x42, 0x43, 0x44, 0x45,
10202                                                 0x46, 0x47, 0x48, 0x49, 0x4A,
10203                                                 0x4B, 0x4C, 0x4D, 0x4E, 0x4F,
10204                                                 0x50, 0x51, 0x52, 0x53, 0x54,
10205                                                 0x55, 0x56, 0x57, 0x58, 0x59,
10206                                                 0x5A, 0x2D, 0x61, 0x62, 0x63,
10207                                                 0x64, 0x65, 0x66, 0x67, 0x68,
10208                                                 0x69, 0x6A, 0x6B, 0x6C, 0x6D,
10209                                                 0x6E, 0x6F, 0x70, 0x71, 0x72,
10210                                                 0x73, 0x74, 0x75, 0x76, 0x77,
10211                                                 0x78, 0x79, 0x7A, 0x2D, 0x31,
10212                                                 0x32, 0x33, 0x34, 0x35, 0x36,
10213                                                 0x37, 0x38, 0x39, 0x30 };
10214
10215 static unsigned char send_ussd_131[] = { 0xD0, 0x2F, 0x81, 0x03, 0x01, 0x12,
10216                                                 0x00, 0x82, 0x02, 0x81, 0x83,
10217                                                 0x85, 0x09, 0x55, 0x43, 0x53,
10218                                                 0x32, 0x20, 0x55, 0x53, 0x53,
10219                                                 0x44, 0x8A, 0x19, 0x48, 0x04,
10220                                                 0x17, 0x04, 0x14, 0x04, 0x20,
10221                                                 0x04, 0x10, 0x04, 0x12, 0x04,
10222                                                 0x21, 0x04, 0x22, 0x04, 0x12,
10223                                                 0x04, 0x23, 0x04, 0x19, 0x04,
10224                                                 0x22, 0x04, 0x15 };
10225
10226 static unsigned char send_ussd_161[] = { 0xD0, 0x81, 0xFD, 0x81, 0x03, 0x01,
10227                                                 0x12, 0x00, 0x82, 0x02, 0x81,
10228                                                 0x83, 0x85, 0x81, 0xB6, 0x6F,
10229                                                 0x6E, 0x63, 0x65, 0x20, 0x61,
10230                                                 0x20, 0x52, 0x45, 0x4C, 0x45,
10231                                                 0x41, 0x53, 0x45, 0x20, 0x43,
10232                                                 0x4F, 0x4D, 0x50, 0x4C, 0x45,
10233                                                 0x54, 0x45, 0x20, 0x6D, 0x65,
10234                                                 0x73, 0x73, 0x61, 0x67, 0x65,
10235                                                 0x20, 0x63, 0x6F, 0x6E, 0x74,
10236                                                 0x61, 0x69, 0x6E, 0x69, 0x6E,
10237                                                 0x67, 0x20, 0x74, 0x68, 0x65,
10238                                                 0x20, 0x55, 0x53, 0x53, 0x44,
10239                                                 0x20, 0x52, 0x65, 0x74, 0x75,
10240                                                 0x72, 0x6E, 0x20, 0x52, 0x65,
10241                                                 0x73, 0x75, 0x6C, 0x74, 0x20,
10242                                                 0x6D, 0x65, 0x73, 0x73, 0x61,
10243                                                 0x67, 0x65, 0x20, 0x6E, 0x6F,
10244                                                 0x74, 0x20, 0x63, 0x6F, 0x6E,
10245                                                 0x74, 0x61, 0x69, 0x6E, 0x69,
10246                                                 0x6E, 0x67, 0x20, 0x61, 0x6E,
10247                                                 0x20, 0x65, 0x72, 0x72, 0x6F,
10248                                                 0x72, 0x20, 0x68, 0x61, 0x73,
10249                                                 0x20, 0x62, 0x65, 0x65, 0x6E,
10250                                                 0x20, 0x72, 0x65, 0x63, 0x65,
10251                                                 0x69, 0x76, 0x65, 0x64, 0x20,
10252                                                 0x66, 0x72, 0x6F, 0x6D, 0x20,
10253                                                 0x74, 0x68, 0x65, 0x20, 0x6E,
10254                                                 0x65, 0x74, 0x77, 0x6F, 0x72,
10255                                                 0x6B, 0x2C, 0x20, 0x74, 0x68,
10256                                                 0x65, 0x20, 0x4D, 0x45, 0x20,
10257                                                 0x73, 0x68, 0x61, 0x6C, 0x6C,
10258                                                 0x20, 0x69, 0x6E, 0x66, 0x6F,
10259                                                 0x72, 0x6D, 0x20, 0x74, 0x68,
10260                                                 0x65, 0x20, 0x53, 0x49, 0x4D,
10261                                                 0x20, 0x74, 0x68, 0x61, 0x74,
10262                                                 0x20, 0x74, 0x68, 0x65, 0x20,
10263                                                 0x63, 0x6F, 0x6D, 0x6D, 0x61,
10264                                                 0x6E, 0x64, 0x20, 0x68, 0x61,
10265                                                 0x73, 0x8A, 0x39, 0xF0, 0x41,
10266                                                 0xE1, 0x90, 0x58, 0x34, 0x1E,
10267                                                 0x91, 0x49, 0xE5, 0x92, 0xD9,
10268                                                 0x74, 0x3E, 0xA1, 0x51, 0xE9,
10269                                                 0x94, 0x5A, 0xB5, 0x5E, 0xB1,
10270                                                 0x59, 0x6D, 0x2B, 0x2C, 0x1E,
10271                                                 0x93, 0xCB, 0xE6, 0x33, 0x3A,
10272                                                 0xAD, 0x5E, 0xB3, 0xDB, 0xEE,
10273                                                 0x37, 0x3C, 0x2E, 0x9F, 0xD3,
10274                                                 0xEB, 0xF6, 0x3B, 0x3E, 0xAF,
10275                                                 0x6F, 0xC5, 0x64, 0x33, 0x5A,
10276                                                 0xCD, 0x76, 0xC3, 0xE5, 0x60 };
10277
10278 static unsigned char send_ussd_171[] = { 0xD0, 0x44, 0x81, 0x03, 0x01, 0x12,
10279                                                 0x00, 0x82, 0x02, 0x81, 0x83,
10280                                                 0x8A, 0x39, 0xF0, 0x41, 0xE1,
10281                                                 0x90, 0x58, 0x34, 0x1E, 0x91,
10282                                                 0x49, 0xE5, 0x92, 0xD9, 0x74,
10283                                                 0x3E, 0xA1, 0x51, 0xE9, 0x94,
10284                                                 0x5A, 0xB5, 0x5E, 0xB1, 0x59,
10285                                                 0x6D, 0x2B, 0x2C, 0x1E, 0x93,
10286                                                 0xCB, 0xE6, 0x33, 0x3A, 0xAD,
10287                                                 0x5E, 0xB3, 0xDB, 0xEE, 0x37,
10288                                                 0x3C, 0x2E, 0x9F, 0xD3, 0xEB,
10289                                                 0xF6, 0x3B, 0x3E, 0xAF, 0x6F,
10290                                                 0xC5, 0x64, 0x33, 0x5A, 0xCD,
10291                                                 0x76, 0xC3, 0xE5, 0x60 };
10292
10293 static unsigned char send_ussd_181[] = { 0xD0, 0x46, 0x81, 0x03, 0x01, 0x12,
10294                                                 0x00, 0x82, 0x02, 0x81, 0x83,
10295                                                 0x85, 0x00, 0x8A, 0x39, 0xF0,
10296                                                 0x41, 0xE1, 0x90, 0x58, 0x34,
10297                                                 0x1E, 0x91, 0x49, 0xE5, 0x92,
10298                                                 0xD9, 0x74, 0x3E, 0xA1, 0x51,
10299                                                 0xE9, 0x94, 0x5A, 0xB5, 0x5E,
10300                                                 0xB1, 0x59, 0x6D, 0x2B, 0x2C,
10301                                                 0x1E, 0x93, 0xCB, 0xE6, 0x33,
10302                                                 0x3A, 0xAD, 0x5E, 0xB3, 0xDB,
10303                                                 0xEE, 0x37, 0x3C, 0x2E, 0x9F,
10304                                                 0xD3, 0xEB, 0xF6, 0x3B, 0x3E,
10305                                                 0xAF, 0x6F, 0xC5, 0x64, 0x33,
10306                                                 0x5A, 0xCD, 0x76, 0xC3, 0xE5,
10307                                                 0x60 };
10308
10309 static unsigned char send_ussd_211[] = { 0xD0, 0x54, 0x81, 0x03, 0x01, 0x12,
10310                                                 0x00, 0x82, 0x02, 0x81, 0x83,
10311                                                 0x85, 0x0A, 0x42, 0x61, 0x73,
10312                                                 0x69, 0x63, 0x20, 0x49, 0x63,
10313                                                 0x6F, 0x6E, 0x8A, 0x39, 0xF0,
10314                                                 0x41, 0xE1, 0x90, 0x58, 0x34,
10315                                                 0x1E, 0x91, 0x49, 0xE5, 0x92,
10316                                                 0xD9, 0x74, 0x3E, 0xA1, 0x51,
10317                                                 0xE9, 0x94, 0x5A, 0xB5, 0x5E,
10318                                                 0xB1, 0x59, 0x6D, 0x2B, 0x2C,
10319                                                 0x1E, 0x93, 0xCB, 0xE6, 0x33,
10320                                                 0x3A, 0xAD, 0x5E, 0xB3, 0xDB,
10321                                                 0xEE, 0x37, 0x3C, 0x2E, 0x9F,
10322                                                 0xD3, 0xEB, 0xF6, 0x3B, 0x3E,
10323                                                 0xAF, 0x6F, 0xC5, 0x64, 0x33,
10324                                                 0x5A, 0xCD, 0x76, 0xC3, 0xE5,
10325                                                 0x60, 0x9E, 0x02, 0x00, 0x01 };
10326
10327 static unsigned char send_ussd_221[] = { 0xD0, 0x54, 0x81, 0x03, 0x01, 0x12,
10328                                                 0x00, 0x82, 0x02, 0x81, 0x83,
10329                                                 0x85, 0x0A, 0x43, 0x6F, 0x6C,
10330                                                 0x6F, 0x72, 0x20, 0x49, 0x63,
10331                                                 0x6F, 0x6E, 0x8A, 0x39, 0xF0,
10332                                                 0x41, 0xE1, 0x90, 0x58, 0x34,
10333                                                 0x1E, 0x91, 0x49, 0xE5, 0x92,
10334                                                 0xD9, 0x74, 0x3E, 0xA1, 0x51,
10335                                                 0xE9, 0x94, 0x5A, 0xB5, 0x5E,
10336                                                 0xB1, 0x59, 0x6D, 0x2B, 0x2C,
10337                                                 0x1E, 0x93, 0xCB, 0xE6, 0x33,
10338                                                 0x3A, 0xAD, 0x5E, 0xB3, 0xDB,
10339                                                 0xEE, 0x37, 0x3C, 0x2E, 0x9F,
10340                                                 0xD3, 0xEB, 0xF6, 0x3B, 0x3E,
10341                                                 0xAF, 0x6F, 0xC5, 0x64, 0x33,
10342                                                 0x5A, 0xCD, 0x76, 0xC3, 0xE5,
10343                                                 0x60, 0x9E, 0x02, 0x00, 0x02 };
10344
10345 static unsigned char send_ussd_231[] = { 0xD0, 0x54, 0x81, 0x03, 0x01, 0x12,
10346                                                 0x00, 0x82, 0x02, 0x81, 0x83,
10347                                                 0x85, 0x0A, 0x42, 0x61, 0x73,
10348                                                 0x69, 0x63, 0x20, 0x49, 0x63,
10349                                                 0x6F, 0x6E, 0x8A, 0x39, 0xF0,
10350                                                 0x41, 0xE1, 0x90, 0x58, 0x34,
10351                                                 0x1E, 0x91, 0x49, 0xE5, 0x92,
10352                                                 0xD9, 0x74, 0x3E, 0xA1, 0x51,
10353                                                 0xE9, 0x94, 0x5A, 0xB5, 0x5E,
10354                                                 0xB1, 0x59, 0x6D, 0x2B, 0x2C,
10355                                                 0x1E, 0x93, 0xCB, 0xE6, 0x33,
10356                                                 0x3A, 0xAD, 0x5E, 0xB3, 0xDB,
10357                                                 0xEE, 0x37, 0x3C, 0x2E, 0x9F,
10358                                                 0xD3, 0xEB, 0xF6, 0x3B, 0x3E,
10359                                                 0xAF, 0x6F, 0xC5, 0x64, 0x33,
10360                                                 0x5A, 0xCD, 0x76, 0xC3, 0xE5,
10361                                                 0x60, 0x9E, 0x02, 0x01, 0x01 };
10362
10363 static unsigned char send_ussd_241[] = { 0xD0, 0x48, 0x81, 0x03, 0x01, 0x12,
10364                                                 0x00, 0x82, 0x02, 0x81, 0x83,
10365                                                 0x8A, 0x39, 0xF0, 0x41, 0xE1,
10366                                                 0x90, 0x58, 0x34, 0x1E, 0x91,
10367                                                 0x49, 0xE5, 0x92, 0xD9, 0x74,
10368                                                 0x3E, 0xA1, 0x51, 0xE9, 0x94,
10369                                                 0x5A, 0xB5, 0x5E, 0xB1, 0x59,
10370                                                 0x6D, 0x2B, 0x2C, 0x1E, 0x93,
10371                                                 0xCB, 0xE6, 0x33, 0x3A, 0xAD,
10372                                                 0x5E, 0xB3, 0xDB, 0xEE, 0x37,
10373                                                 0x3C, 0x2E, 0x9F, 0xD3, 0xEB,
10374                                                 0xF6, 0x3B, 0x3E, 0xAF, 0x6F,
10375                                                 0xC5, 0x64, 0x33, 0x5A, 0xCD,
10376                                                 0x76, 0xC3, 0xE5, 0x60, 0x9E,
10377                                                 0x02, 0x01, 0x01 };
10378
10379 static unsigned char send_ussd_311[] = { 0xD0, 0x5F, 0x81, 0x03, 0x01, 0x12,
10380                                                 0x00, 0x82, 0x02, 0x81, 0x83,
10381                                                 0x85, 0x19, 0x80, 0x04, 0x17,
10382                                                 0x04, 0x14, 0x04, 0x20, 0x04,
10383                                                 0x10, 0x04, 0x12, 0x04, 0x21,
10384                                                 0x04, 0x22, 0x04, 0x12, 0x04,
10385                                                 0x23, 0x04, 0x19, 0x04, 0x22,
10386                                                 0x04, 0x15, 0x8A, 0x39, 0xF0,
10387                                                 0x41, 0xE1, 0x90, 0x58, 0x34,
10388                                                 0x1E, 0x91, 0x49, 0xE5, 0x92,
10389                                                 0xD9, 0x74, 0x3E, 0xA1, 0x51,
10390                                                 0xE9, 0x94, 0x5A, 0xB5, 0x5E,
10391                                                 0xB1, 0x59, 0x6D, 0x2B, 0x2C,
10392                                                 0x1E, 0x93, 0xCB, 0xE6, 0x33,
10393                                                 0x3A, 0xAD, 0x5E, 0xB3, 0xDB,
10394                                                 0xEE, 0x37, 0x3C, 0x2E, 0x9F,
10395                                                 0xD3, 0xEB, 0xF6, 0x3B, 0x3E,
10396                                                 0xAF, 0x6F, 0xC5, 0x64, 0x33,
10397                                                 0x5A, 0xCD, 0x76, 0xC3, 0xE5,
10398                                                 0x60 };
10399
10400 static unsigned char send_ussd_411[] = { 0xD0, 0x5C, 0x81, 0x03, 0x01, 0x12,
10401                                                 0x00, 0x82, 0x02, 0x81, 0x83,
10402                                                 0x85, 0x10, 0x54, 0x65, 0x78,
10403                                                 0x74, 0x20, 0x41, 0x74, 0x74,
10404                                                 0x72, 0x69, 0x62, 0x75, 0x74,
10405                                                 0x65, 0x20, 0x31, 0x8A, 0x39,
10406                                                 0xF0, 0x41, 0xE1, 0x90, 0x58,
10407                                                 0x34, 0x1E, 0x91, 0x49, 0xE5,
10408                                                 0x92, 0xD9, 0x74, 0x3E, 0xA1,
10409                                                 0x51, 0xE9, 0x94, 0x5A, 0xB5,
10410                                                 0x5E, 0xB1, 0x59, 0x6D, 0x2B,
10411                                                 0x2C, 0x1E, 0x93, 0xCB, 0xE6,
10412                                                 0x33, 0x3A, 0xAD, 0x5E, 0xB3,
10413                                                 0xDB, 0xEE, 0x37, 0x3C, 0x2E,
10414                                                 0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
10415                                                 0x3E, 0xAF, 0x6F, 0xC5, 0x64,
10416                                                 0x33, 0x5A, 0xCD, 0x76, 0xC3,
10417                                                 0xE5, 0x60, 0xD0, 0x04, 0x00,
10418                                                 0x10, 0x00, 0xB4 };
10419
10420 static unsigned char send_ussd_412[] = { 0xD0, 0x56, 0x81, 0x03, 0x01, 0x12,
10421                                                 0x00, 0x82, 0x02, 0x81, 0x83,
10422                                                 0x85, 0x10, 0x54, 0x65, 0x78,
10423                                                 0x74, 0x20, 0x41, 0x74, 0x74,
10424                                                 0x72, 0x69, 0x62, 0x75, 0x74,
10425                                                 0x65, 0x20, 0x32, 0x8A, 0x39,
10426                                                 0xF0, 0x41, 0xE1, 0x90, 0x58,
10427                                                 0x34, 0x1E, 0x91, 0x49, 0xE5,
10428                                                 0x92, 0xD9, 0x74, 0x3E, 0xA1,
10429                                                 0x51, 0xE9, 0x94, 0x5A, 0xB5,
10430                                                 0x5E, 0xB1, 0x59, 0x6D, 0x2B,
10431                                                 0x2C, 0x1E, 0x93, 0xCB, 0xE6,
10432                                                 0x33, 0x3A, 0xAD, 0x5E, 0xB3,
10433                                                 0xDB, 0xEE, 0x37, 0x3C, 0x2E,
10434                                                 0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
10435                                                 0x3E, 0xAF, 0x6F, 0xC5, 0x64,
10436                                                 0x33, 0x5A, 0xCD, 0x76, 0xC3,
10437                                                 0xE5, 0x60 };
10438
10439 static unsigned char send_ussd_421[] = { 0xD0, 0x5C, 0x81, 0x03, 0x01, 0x12,
10440                                                 0x00, 0x82, 0x02, 0x81, 0x83,
10441                                                 0x85, 0x10, 0x54, 0x65, 0x78,
10442                                                 0x74, 0x20, 0x41, 0x74, 0x74,
10443                                                 0x72, 0x69, 0x62, 0x75, 0x74,
10444                                                 0x65, 0x20, 0x31, 0x8A, 0x39,
10445                                                 0xF0, 0x41, 0xE1, 0x90, 0x58,
10446                                                 0x34, 0x1E, 0x91, 0x49, 0xE5,
10447                                                 0x92, 0xD9, 0x74, 0x3E, 0xA1,
10448                                                 0x51, 0xE9, 0x94, 0x5A, 0xB5,
10449                                                 0x5E, 0xB1, 0x59, 0x6D, 0x2B,
10450                                                 0x2C, 0x1E, 0x93, 0xCB, 0xE6,
10451                                                 0x33, 0x3A, 0xAD, 0x5E, 0xB3,
10452                                                 0xDB, 0xEE, 0x37, 0x3C, 0x2E,
10453                                                 0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
10454                                                 0x3E, 0xAF, 0x6F, 0xC5, 0x64,
10455                                                 0x33, 0x5A, 0xCD, 0x76, 0xC3,
10456                                                 0xE5, 0x60, 0xD0, 0x04, 0x00,
10457                                                 0x10, 0x01, 0xB4 };
10458
10459 static unsigned char send_ussd_422[] = { 0xD0, 0x56, 0x81, 0x03, 0x01, 0x12,
10460                                                 0x00, 0x82, 0x02, 0x81, 0x83,
10461                                                 0x85, 0x10, 0x54, 0x65, 0x78,
10462                                                 0x74, 0x20, 0x41, 0x74, 0x74,
10463                                                 0x72, 0x69, 0x62, 0x75, 0x74,
10464                                                 0x65, 0x20, 0x32, 0x8A, 0x39,
10465                                                 0xF0, 0x41, 0xE1, 0x90, 0x58,
10466                                                 0x34, 0x1E, 0x91, 0x49, 0xE5,
10467                                                 0x92, 0xD9, 0x74, 0x3E, 0xA1,
10468                                                 0x51, 0xE9, 0x94, 0x5A, 0xB5,
10469                                                 0x5E, 0xB1, 0x59, 0x6D, 0x2B,
10470                                                 0x2C, 0x1E, 0x93, 0xCB, 0xE6,
10471                                                 0x33, 0x3A, 0xAD, 0x5E, 0xB3,
10472                                                 0xDB, 0xEE, 0x37, 0x3C, 0x2E,
10473                                                 0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
10474                                                 0x3E, 0xAF, 0x6F, 0xC5, 0x64,
10475                                                 0x33, 0x5A, 0xCD, 0x76, 0xC3,
10476                                                 0xE5, 0x60 };
10477
10478 static unsigned char send_ussd_431[] = { 0xD0, 0x5C, 0x81, 0x03, 0x01, 0x12,
10479                                                 0x00, 0x82, 0x02, 0x81, 0x83,
10480                                                 0x85, 0x10, 0x54, 0x65, 0x78,
10481                                                 0x74, 0x20, 0x41, 0x74, 0x74,
10482                                                 0x72, 0x69, 0x62, 0x75, 0x74,
10483                                                 0x65, 0x20, 0x31, 0x8A, 0x39,
10484                                                 0xF0, 0x41, 0xE1, 0x90, 0x58,
10485                                                 0x34, 0x1E, 0x91, 0x49, 0xE5,
10486                                                 0x92, 0xD9, 0x74, 0x3E, 0xA1,
10487                                                 0x51, 0xE9, 0x94, 0x5A, 0xB5,
10488                                                 0x5E, 0xB1, 0x59, 0x6D, 0x2B,
10489                                                 0x2C, 0x1E, 0x93, 0xCB, 0xE6,
10490                                                 0x33, 0x3A, 0xAD, 0x5E, 0xB3,
10491                                                 0xDB, 0xEE, 0x37, 0x3C, 0x2E,
10492                                                 0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
10493                                                 0x3E, 0xAF, 0x6F, 0xC5, 0x64,
10494                                                 0x33, 0x5A, 0xCD, 0x76, 0xC3,
10495                                                 0xE5, 0x60, 0xD0, 0x04, 0x00,
10496                                                 0x10, 0x02, 0xB4 };
10497
10498 static unsigned char send_ussd_432[] = { 0xD0, 0x56, 0x81, 0x03, 0x01, 0x12,
10499                                                 0x00, 0x82, 0x02, 0x81, 0x83,
10500                                                 0x85, 0x10, 0x54, 0x65, 0x78,
10501                                                 0x74, 0x20, 0x41, 0x74, 0x74,
10502                                                 0x72, 0x69, 0x62, 0x75, 0x74,
10503                                                 0x65, 0x20, 0x32, 0x8A, 0x39,
10504                                                 0xF0, 0x41, 0xE1, 0x90, 0x58,
10505                                                 0x34, 0x1E, 0x91, 0x49, 0xE5,
10506                                                 0x92, 0xD9, 0x74, 0x3E, 0xA1,
10507                                                 0x51, 0xE9, 0x94, 0x5A, 0xB5,
10508                                                 0x5E, 0xB1, 0x59, 0x6D, 0x2B,
10509                                                 0x2C, 0x1E, 0x93, 0xCB, 0xE6,
10510                                                 0x33, 0x3A, 0xAD, 0x5E, 0xB3,
10511                                                 0xDB, 0xEE, 0x37, 0x3C, 0x2E,
10512                                                 0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
10513                                                 0x3E, 0xAF, 0x6F, 0xC5, 0x64,
10514                                                 0x33, 0x5A, 0xCD, 0x76, 0xC3,
10515                                                 0xE5, 0x60 };
10516
10517 static unsigned char send_ussd_441[] = { 0xD0, 0x5C, 0x81, 0x03, 0x01, 0x12,
10518                                                 0x00, 0x82, 0x02, 0x81, 0x83,
10519                                                 0x85, 0x10, 0x54, 0x65, 0x78,
10520                                                 0x74, 0x20, 0x41, 0x74, 0x74,
10521                                                 0x72, 0x69, 0x62, 0x75, 0x74,
10522                                                 0x65, 0x20, 0x31, 0x8A, 0x39,
10523                                                 0xF0, 0x41, 0xE1, 0x90, 0x58,
10524                                                 0x34, 0x1E, 0x91, 0x49, 0xE5,
10525                                                 0x92, 0xD9, 0x74, 0x3E, 0xA1,
10526                                                 0x51, 0xE9, 0x94, 0x5A, 0xB5,
10527                                                 0x5E, 0xB1, 0x59, 0x6D, 0x2B,
10528                                                 0x2C, 0x1E, 0x93, 0xCB, 0xE6,
10529                                                 0x33, 0x3A, 0xAD, 0x5E, 0xB3,
10530                                                 0xDB, 0xEE, 0x37, 0x3C, 0x2E,
10531                                                 0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
10532                                                 0x3E, 0xAF, 0x6F, 0xC5, 0x64,
10533                                                 0x33, 0x5A, 0xCD, 0x76, 0xC3,
10534                                                 0xE5, 0x60, 0xD0, 0x04, 0x00,
10535                                                 0x10, 0x04, 0xB4 };
10536
10537 static unsigned char send_ussd_442[] = { 0xD0, 0x5C, 0x81, 0x03, 0x01, 0x12,
10538                                                 0x00, 0x82, 0x02, 0x81, 0x83,
10539                                                 0x85, 0x10, 0x54, 0x65, 0x78,
10540                                                 0x74, 0x20, 0x41, 0x74, 0x74,
10541                                                 0x72, 0x69, 0x62, 0x75, 0x74,
10542                                                 0x65, 0x20, 0x32, 0x8A, 0x39,
10543                                                 0xF0, 0x41, 0xE1, 0x90, 0x58,
10544                                                 0x34, 0x1E, 0x91, 0x49, 0xE5,
10545                                                 0x92, 0xD9, 0x74, 0x3E, 0xA1,
10546                                                 0x51, 0xE9, 0x94, 0x5A, 0xB5,
10547                                                 0x5E, 0xB1, 0x59, 0x6D, 0x2B,
10548                                                 0x2C, 0x1E, 0x93, 0xCB, 0xE6,
10549                                                 0x33, 0x3A, 0xAD, 0x5E, 0xB3,
10550                                                 0xDB, 0xEE, 0x37, 0x3C, 0x2E,
10551                                                 0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
10552                                                 0x3E, 0xAF, 0x6F, 0xC5, 0x64,
10553                                                 0x33, 0x5A, 0xCD, 0x76, 0xC3,
10554                                                 0xE5, 0x60, 0xD0, 0x04, 0x00,
10555                                                 0x10, 0x00, 0xB4 };
10556
10557 static unsigned char send_ussd_443[] = { 0xD0, 0x56, 0x81, 0x03, 0x01, 0x12,
10558                                                 0x00, 0x82, 0x02, 0x81, 0x83,
10559                                                 0x85, 0x10, 0x54, 0x65, 0x78,
10560                                                 0x74, 0x20, 0x41, 0x74, 0x74,
10561                                                 0x72, 0x69, 0x62, 0x75, 0x74,
10562                                                 0x65, 0x20, 0x33, 0x8A, 0x39,
10563                                                 0xF0, 0x41, 0xE1, 0x90, 0x58,
10564                                                 0x34, 0x1E, 0x91, 0x49, 0xE5,
10565                                                 0x92, 0xD9, 0x74, 0x3E, 0xA1,
10566                                                 0x51, 0xE9, 0x94, 0x5A, 0xB5,
10567                                                 0x5E, 0xB1, 0x59, 0x6D, 0x2B,
10568                                                 0x2C, 0x1E, 0x93, 0xCB, 0xE6,
10569                                                 0x33, 0x3A, 0xAD, 0x5E, 0xB3,
10570                                                 0xDB, 0xEE, 0x37, 0x3C, 0x2E,
10571                                                 0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
10572                                                 0x3E, 0xAF, 0x6F, 0xC5, 0x64,
10573                                                 0x33, 0x5A, 0xCD, 0x76, 0xC3,
10574                                                 0xE5, 0x60 };
10575
10576 static unsigned char send_ussd_451[] = { 0xD0, 0x5C, 0x81, 0x03, 0x01, 0x12,
10577                                                 0x00, 0x82, 0x02, 0x81, 0x83,
10578                                                 0x85, 0x10, 0x54, 0x65, 0x78,
10579                                                 0x74, 0x20, 0x41, 0x74, 0x74,
10580                                                 0x72, 0x69, 0x62, 0x75, 0x74,
10581                                                 0x65, 0x20, 0x31, 0x8A, 0x39,
10582                                                 0xF0, 0x41, 0xE1, 0x90, 0x58,
10583                                                 0x34, 0x1E, 0x91, 0x49, 0xE5,
10584                                                 0x92, 0xD9, 0x74, 0x3E, 0xA1,
10585                                                 0x51, 0xE9, 0x94, 0x5A, 0xB5,
10586                                                 0x5E, 0xB1, 0x59, 0x6D, 0x2B,
10587                                                 0x2C, 0x1E, 0x93, 0xCB, 0xE6,
10588                                                 0x33, 0x3A, 0xAD, 0x5E, 0xB3,
10589                                                 0xDB, 0xEE, 0x37, 0x3C, 0x2E,
10590                                                 0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
10591                                                 0x3E, 0xAF, 0x6F, 0xC5, 0x64,
10592                                                 0x33, 0x5A, 0xCD, 0x76, 0xC3,
10593                                                 0xE5, 0x60, 0xD0, 0x04, 0x00,
10594                                                 0x10, 0x08, 0xB4 };
10595
10596 static unsigned char send_ussd_452[] = { 0xD0, 0x5C, 0x81, 0x03, 0x01, 0x12,
10597                                                 0x00, 0x82, 0x02, 0x81, 0x83,
10598                                                 0x85, 0x10, 0x54, 0x65, 0x78,
10599                                                 0x74, 0x20, 0x41, 0x74, 0x74,
10600                                                 0x72, 0x69, 0x62, 0x75, 0x74,
10601                                                 0x65, 0x20, 0x32, 0x8A, 0x39,
10602                                                 0xF0, 0x41, 0xE1, 0x90, 0x58,
10603                                                 0x34, 0x1E, 0x91, 0x49, 0xE5,
10604                                                 0x92, 0xD9, 0x74, 0x3E, 0xA1,
10605                                                 0x51, 0xE9, 0x94, 0x5A, 0xB5,
10606                                                 0x5E, 0xB1, 0x59, 0x6D, 0x2B,
10607                                                 0x2C, 0x1E, 0x93, 0xCB, 0xE6,
10608                                                 0x33, 0x3A, 0xAD, 0x5E, 0xB3,
10609                                                 0xDB, 0xEE, 0x37, 0x3C, 0x2E,
10610                                                 0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
10611                                                 0x3E, 0xAF, 0x6F, 0xC5, 0x64,
10612                                                 0x33, 0x5A, 0xCD, 0x76, 0xC3,
10613                                                 0xE5, 0x60, 0xD0, 0x04, 0x00,
10614                                                 0x10, 0x00, 0xB4 };
10615
10616 static unsigned char send_ussd_453[] = { 0xD0, 0x56, 0x81, 0x03, 0x01, 0x12,
10617                                                 0x00, 0x82, 0x02, 0x81, 0x83,
10618                                                 0x85, 0x10, 0x54, 0x65, 0x78,
10619                                                 0x74, 0x20, 0x41, 0x74, 0x74,
10620                                                 0x72, 0x69, 0x62, 0x75, 0x74,
10621                                                 0x65, 0x20, 0x33, 0x8A, 0x39,
10622                                                 0xF0, 0x41, 0xE1, 0x90, 0x58,
10623                                                 0x34, 0x1E, 0x91, 0x49, 0xE5,
10624                                                 0x92, 0xD9, 0x74, 0x3E, 0xA1,
10625                                                 0x51, 0xE9, 0x94, 0x5A, 0xB5,
10626                                                 0x5E, 0xB1, 0x59, 0x6D, 0x2B,
10627                                                 0x2C, 0x1E, 0x93, 0xCB, 0xE6,
10628                                                 0x33, 0x3A, 0xAD, 0x5E, 0xB3,
10629                                                 0xDB, 0xEE, 0x37, 0x3C, 0x2E,
10630                                                 0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
10631                                                 0x3E, 0xAF, 0x6F, 0xC5, 0x64,
10632                                                 0x33, 0x5A, 0xCD, 0x76, 0xC3,
10633                                                 0xE5, 0x60 };
10634
10635 static unsigned char send_ussd_461[] = { 0xD0, 0x5C, 0x81, 0x03, 0x01, 0x12,
10636                                                 0x00, 0x82, 0x02, 0x81, 0x83,
10637                                                 0x85, 0x10, 0x54, 0x65, 0x78,
10638                                                 0x74, 0x20, 0x41, 0x74, 0x74,
10639                                                 0x72, 0x69, 0x62, 0x75, 0x74,
10640                                                 0x65, 0x20, 0x31, 0x8A, 0x39,
10641                                                 0xF0, 0x41, 0xE1, 0x90, 0x58,
10642                                                 0x34, 0x1E, 0x91, 0x49, 0xE5,
10643                                                 0x92, 0xD9, 0x74, 0x3E, 0xA1,
10644                                                 0x51, 0xE9, 0x94, 0x5A, 0xB5,
10645                                                 0x5E, 0xB1, 0x59, 0x6D, 0x2B,
10646                                                 0x2C, 0x1E, 0x93, 0xCB, 0xE6,
10647                                                 0x33, 0x3A, 0xAD, 0x5E, 0xB3,
10648                                                 0xDB, 0xEE, 0x37, 0x3C, 0x2E,
10649                                                 0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
10650                                                 0x3E, 0xAF, 0x6F, 0xC5, 0x64,
10651                                                 0x33, 0x5A, 0xCD, 0x76, 0xC3,
10652                                                 0xE5, 0x60, 0xD0, 0x04, 0x00,
10653                                                 0x10, 0x10, 0xB4 };
10654
10655 static unsigned char send_ussd_462[] = { 0xD0, 0x5C, 0x81, 0x03, 0x01, 0x12,
10656                                                 0x00, 0x82, 0x02, 0x81, 0x83,
10657                                                 0x85, 0x10, 0x54, 0x65, 0x78,
10658                                                 0x74, 0x20, 0x41, 0x74, 0x74,
10659                                                 0x72, 0x69, 0x62, 0x75, 0x74,
10660                                                 0x65, 0x20, 0x32, 0x8A, 0x39,
10661                                                 0xF0, 0x41, 0xE1, 0x90, 0x58,
10662                                                 0x34, 0x1E, 0x91, 0x49, 0xE5,
10663                                                 0x92, 0xD9, 0x74, 0x3E, 0xA1,
10664                                                 0x51, 0xE9, 0x94, 0x5A, 0xB5,
10665                                                 0x5E, 0xB1, 0x59, 0x6D, 0x2B,
10666                                                 0x2C, 0x1E, 0x93, 0xCB, 0xE6,
10667                                                 0x33, 0x3A, 0xAD, 0x5E, 0xB3,
10668                                                 0xDB, 0xEE, 0x37, 0x3C, 0x2E,
10669                                                 0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
10670                                                 0x3E, 0xAF, 0x6F, 0xC5, 0x64,
10671                                                 0x33, 0x5A, 0xCD, 0x76, 0xC3,
10672                                                 0xE5, 0x60, 0xD0, 0x04, 0x00,
10673                                                 0x10, 0x00, 0xB4 };
10674
10675 static unsigned char send_ussd_463[] = { 0xD0, 0x56, 0x81, 0x03, 0x01, 0x12,
10676                                                 0x00, 0x82, 0x02, 0x81, 0x83,
10677                                                 0x85, 0x10, 0x54, 0x65, 0x78,
10678                                                 0x74, 0x20, 0x41, 0x74, 0x74,
10679                                                 0x72, 0x69, 0x62, 0x75, 0x74,
10680                                                 0x65, 0x20, 0x33, 0x8A, 0x39,
10681                                                 0xF0, 0x41, 0xE1, 0x90, 0x58,
10682                                                 0x34, 0x1E, 0x91, 0x49, 0xE5,
10683                                                 0x92, 0xD9, 0x74, 0x3E, 0xA1,
10684                                                 0x51, 0xE9, 0x94, 0x5A, 0xB5,
10685                                                 0x5E, 0xB1, 0x59, 0x6D, 0x2B,
10686                                                 0x2C, 0x1E, 0x93, 0xCB, 0xE6,
10687                                                 0x33, 0x3A, 0xAD, 0x5E, 0xB3,
10688                                                 0xDB, 0xEE, 0x37, 0x3C, 0x2E,
10689                                                 0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
10690                                                 0x3E, 0xAF, 0x6F, 0xC5, 0x64,
10691                                                 0x33, 0x5A, 0xCD, 0x76, 0xC3,
10692                                                 0xE5, 0x60 };
10693
10694 static unsigned char send_ussd_471[] = { 0xD0, 0x5C, 0x81, 0x03, 0x01, 0x12,
10695                                                 0x00, 0x82, 0x02, 0x81, 0x83,
10696                                                 0x85, 0x10, 0x54, 0x65, 0x78,
10697                                                 0x74, 0x20, 0x41, 0x74, 0x74,
10698                                                 0x72, 0x69, 0x62, 0x75, 0x74,
10699                                                 0x65, 0x20, 0x31, 0x8A, 0x39,
10700                                                 0xF0, 0x41, 0xE1, 0x90, 0x58,
10701                                                 0x34, 0x1E, 0x91, 0x49, 0xE5,
10702                                                 0x92, 0xD9, 0x74, 0x3E, 0xA1,
10703                                                 0x51, 0xE9, 0x94, 0x5A, 0xB5,
10704                                                 0x5E, 0xB1, 0x59, 0x6D, 0x2B,
10705                                                 0x2C, 0x1E, 0x93, 0xCB, 0xE6,
10706                                                 0x33, 0x3A, 0xAD, 0x5E, 0xB3,
10707                                                 0xDB, 0xEE, 0x37, 0x3C, 0x2E,
10708                                                 0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
10709                                                 0x3E, 0xAF, 0x6F, 0xC5, 0x64,
10710                                                 0x33, 0x5A, 0xCD, 0x76, 0xC3,
10711                                                 0xE5, 0x60, 0xD0, 0x04, 0x00,
10712                                                 0x10, 0x20, 0xB4 };
10713
10714 static unsigned char send_ussd_472[] = { 0xD0, 0x5C, 0x81, 0x03, 0x01, 0x12,
10715                                                 0x00, 0x82, 0x02, 0x81, 0x83,
10716                                                 0x85, 0x10, 0x54, 0x65, 0x78,
10717                                                 0x74, 0x20, 0x41, 0x74, 0x74,
10718                                                 0x72, 0x69, 0x62, 0x75, 0x74,
10719                                                 0x65, 0x20, 0x32, 0x8A, 0x39,
10720                                                 0xF0, 0x41, 0xE1, 0x90, 0x58,
10721                                                 0x34, 0x1E, 0x91, 0x49, 0xE5,
10722                                                 0x92, 0xD9, 0x74, 0x3E, 0xA1,
10723                                                 0x51, 0xE9, 0x94, 0x5A, 0xB5,
10724                                                 0x5E, 0xB1, 0x59, 0x6D, 0x2B,
10725                                                 0x2C, 0x1E, 0x93, 0xCB, 0xE6,
10726                                                 0x33, 0x3A, 0xAD, 0x5E, 0xB3,
10727                                                 0xDB, 0xEE, 0x37, 0x3C, 0x2E,
10728                                                 0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
10729                                                 0x3E, 0xAF, 0x6F, 0xC5, 0x64,
10730                                                 0x33, 0x5A, 0xCD, 0x76, 0xC3,
10731                                                 0xE5, 0x60, 0xD0, 0x04, 0x00,
10732                                                 0x10, 0x00, 0xB4 };
10733
10734 static unsigned char send_ussd_473[] = { 0xD0, 0x56, 0x81, 0x03, 0x01, 0x12,
10735                                                 0x00, 0x82, 0x02, 0x81, 0x83,
10736                                                 0x85, 0x10, 0x54, 0x65, 0x78,
10737                                                 0x74, 0x20, 0x41, 0x74, 0x74,
10738                                                 0x72, 0x69, 0x62, 0x75, 0x74,
10739                                                 0x65, 0x20, 0x33, 0x8A, 0x39,
10740                                                 0xF0, 0x41, 0xE1, 0x90, 0x58,
10741                                                 0x34, 0x1E, 0x91, 0x49, 0xE5,
10742                                                 0x92, 0xD9, 0x74, 0x3E, 0xA1,
10743                                                 0x51, 0xE9, 0x94, 0x5A, 0xB5,
10744                                                 0x5E, 0xB1, 0x59, 0x6D, 0x2B,
10745                                                 0x2C, 0x1E, 0x93, 0xCB, 0xE6,
10746                                                 0x33, 0x3A, 0xAD, 0x5E, 0xB3,
10747                                                 0xDB, 0xEE, 0x37, 0x3C, 0x2E,
10748                                                 0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
10749                                                 0x3E, 0xAF, 0x6F, 0xC5, 0x64,
10750                                                 0x33, 0x5A, 0xCD, 0x76, 0xC3,
10751                                                 0xE5, 0x60 };
10752
10753 static unsigned char send_ussd_481[] = { 0xD0, 0x5C, 0x81, 0x03, 0x01, 0x12,
10754                                                 0x00, 0x82, 0x02, 0x81, 0x83,
10755                                                 0x85, 0x10, 0x54, 0x65, 0x78,
10756                                                 0x74, 0x20, 0x41, 0x74, 0x74,
10757                                                 0x72, 0x69, 0x62, 0x75, 0x74,
10758                                                 0x65, 0x20, 0x31, 0x8A, 0x39,
10759                                                 0xF0, 0x41, 0xE1, 0x90, 0x58,
10760                                                 0x34, 0x1E, 0x91, 0x49, 0xE5,
10761                                                 0x92, 0xD9, 0x74, 0x3E, 0xA1,
10762                                                 0x51, 0xE9, 0x94, 0x5A, 0xB5,
10763                                                 0x5E, 0xB1, 0x59, 0x6D, 0x2B,
10764                                                 0x2C, 0x1E, 0x93, 0xCB, 0xE6,
10765                                                 0x33, 0x3A, 0xAD, 0x5E, 0xB3,
10766                                                 0xDB, 0xEE, 0x37, 0x3C, 0x2E,
10767                                                 0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
10768                                                 0x3E, 0xAF, 0x6F, 0xC5, 0x64,
10769                                                 0x33, 0x5A, 0xCD, 0x76, 0xC3,
10770                                                 0xE5, 0x60, 0xD0, 0x04, 0x00,
10771                                                 0x10, 0x40, 0xB4 };
10772
10773 static unsigned char send_ussd_482[] = { 0xD0, 0x5C, 0x81, 0x03, 0x01, 0x12,
10774                                                 0x00, 0x82, 0x02, 0x81, 0x83,
10775                                                 0x85, 0x10, 0x54, 0x65, 0x78,
10776                                                 0x74, 0x20, 0x41, 0x74, 0x74,
10777                                                 0x72, 0x69, 0x62, 0x75, 0x74,
10778                                                 0x65, 0x20, 0x32, 0x8A, 0x39,
10779                                                 0xF0, 0x41, 0xE1, 0x90, 0x58,
10780                                                 0x34, 0x1E, 0x91, 0x49, 0xE5,
10781                                                 0x92, 0xD9, 0x74, 0x3E, 0xA1,
10782                                                 0x51, 0xE9, 0x94, 0x5A, 0xB5,
10783                                                 0x5E, 0xB1, 0x59, 0x6D, 0x2B,
10784                                                 0x2C, 0x1E, 0x93, 0xCB, 0xE6,
10785                                                 0x33, 0x3A, 0xAD, 0x5E, 0xB3,
10786                                                 0xDB, 0xEE, 0x37, 0x3C, 0x2E,
10787                                                 0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
10788                                                 0x3E, 0xAF, 0x6F, 0xC5, 0x64,
10789                                                 0x33, 0x5A, 0xCD, 0x76, 0xC3,
10790                                                 0xE5, 0x60, 0xD0, 0x04, 0x00,
10791                                                 0x10, 0x00, 0xB4 };
10792
10793 static unsigned char send_ussd_483[] = { 0xD0, 0x56, 0x81, 0x03, 0x01, 0x12,
10794                                                 0x00, 0x82, 0x02, 0x81, 0x83,
10795                                                 0x85, 0x10, 0x54, 0x65, 0x78,
10796                                                 0x74, 0x20, 0x41, 0x74, 0x74,
10797                                                 0x72, 0x69, 0x62, 0x75, 0x74,
10798                                                 0x65, 0x20, 0x33, 0x8A, 0x39,
10799                                                 0xF0, 0x41, 0xE1, 0x90, 0x58,
10800                                                 0x34, 0x1E, 0x91, 0x49, 0xE5,
10801                                                 0x92, 0xD9, 0x74, 0x3E, 0xA1,
10802                                                 0x51, 0xE9, 0x94, 0x5A, 0xB5,
10803                                                 0x5E, 0xB1, 0x59, 0x6D, 0x2B,
10804                                                 0x2C, 0x1E, 0x93, 0xCB, 0xE6,
10805                                                 0x33, 0x3A, 0xAD, 0x5E, 0xB3,
10806                                                 0xDB, 0xEE, 0x37, 0x3C, 0x2E,
10807                                                 0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
10808                                                 0x3E, 0xAF, 0x6F, 0xC5, 0x64,
10809                                                 0x33, 0x5A, 0xCD, 0x76, 0xC3,
10810                                                 0xE5, 0x60 };
10811
10812 static unsigned char send_ussd_491[] = { 0xD0, 0x5C, 0x81, 0x03, 0x01, 0x12,
10813                                                 0x00, 0x82, 0x02, 0x81, 0x83,
10814                                                 0x85, 0x10, 0x54, 0x65, 0x78,
10815                                                 0x74, 0x20, 0x41, 0x74, 0x74,
10816                                                 0x72, 0x69, 0x62, 0x75, 0x74,
10817                                                 0x65, 0x20, 0x31, 0x8A, 0x39,
10818                                                 0xF0, 0x41, 0xE1, 0x90, 0x58,
10819                                                 0x34, 0x1E, 0x91, 0x49, 0xE5,
10820                                                 0x92, 0xD9, 0x74, 0x3E, 0xA1,
10821                                                 0x51, 0xE9, 0x94, 0x5A, 0xB5,
10822                                                 0x5E, 0xB1, 0x59, 0x6D, 0x2B,
10823                                                 0x2C, 0x1E, 0x93, 0xCB, 0xE6,
10824                                                 0x33, 0x3A, 0xAD, 0x5E, 0xB3,
10825                                                 0xDB, 0xEE, 0x37, 0x3C, 0x2E,
10826                                                 0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
10827                                                 0x3E, 0xAF, 0x6F, 0xC5, 0x64,
10828                                                 0x33, 0x5A, 0xCD, 0x76, 0xC3,
10829                                                 0xE5, 0x60, 0xD0, 0x04, 0x00,
10830                                                 0x10, 0x80, 0xB4 };
10831
10832 static unsigned char send_ussd_492[] = { 0xD0, 0x5C, 0x81, 0x03, 0x01, 0x12,
10833                                                 0x00, 0x82, 0x02, 0x81, 0x83,
10834                                                 0x85, 0x10, 0x54, 0x65, 0x78,
10835                                                 0x74, 0x20, 0x41, 0x74, 0x74,
10836                                                 0x72, 0x69, 0x62, 0x75, 0x74,
10837                                                 0x65, 0x20, 0x32, 0x8A, 0x39,
10838                                                 0xF0, 0x41, 0xE1, 0x90, 0x58,
10839                                                 0x34, 0x1E, 0x91, 0x49, 0xE5,
10840                                                 0x92, 0xD9, 0x74, 0x3E, 0xA1,
10841                                                 0x51, 0xE9, 0x94, 0x5A, 0xB5,
10842                                                 0x5E, 0xB1, 0x59, 0x6D, 0x2B,
10843                                                 0x2C, 0x1E, 0x93, 0xCB, 0xE6,
10844                                                 0x33, 0x3A, 0xAD, 0x5E, 0xB3,
10845                                                 0xDB, 0xEE, 0x37, 0x3C, 0x2E,
10846                                                 0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
10847                                                 0x3E, 0xAF, 0x6F, 0xC5, 0x64,
10848                                                 0x33, 0x5A, 0xCD, 0x76, 0xC3,
10849                                                 0xE5, 0x60, 0xD0, 0x04, 0x00,
10850                                                 0x10, 0x00, 0xB4 };
10851
10852 static unsigned char send_ussd_493[] = { 0xD0, 0x56, 0x81, 0x03, 0x01, 0x12,
10853                                                 0x00, 0x82, 0x02, 0x81, 0x83,
10854                                                 0x85, 0x10, 0x54, 0x65, 0x78,
10855                                                 0x74, 0x20, 0x41, 0x74, 0x74,
10856                                                 0x72, 0x69, 0x62, 0x75, 0x74,
10857                                                 0x65, 0x20, 0x33, 0x8A, 0x39,
10858                                                 0xF0, 0x41, 0xE1, 0x90, 0x58,
10859                                                 0x34, 0x1E, 0x91, 0x49, 0xE5,
10860                                                 0x92, 0xD9, 0x74, 0x3E, 0xA1,
10861                                                 0x51, 0xE9, 0x94, 0x5A, 0xB5,
10862                                                 0x5E, 0xB1, 0x59, 0x6D, 0x2B,
10863                                                 0x2C, 0x1E, 0x93, 0xCB, 0xE6,
10864                                                 0x33, 0x3A, 0xAD, 0x5E, 0xB3,
10865                                                 0xDB, 0xEE, 0x37, 0x3C, 0x2E,
10866                                                 0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
10867                                                 0x3E, 0xAF, 0x6F, 0xC5, 0x64,
10868                                                 0x33, 0x5A, 0xCD, 0x76, 0xC3,
10869                                                 0xE5, 0x60 };
10870
10871 static unsigned char send_ussd_4101[] = { 0xD0, 0x5C, 0x81, 0x03, 0x01, 0x12,
10872                                                 0x00, 0x82, 0x02, 0x81, 0x83,
10873                                                 0x85, 0x10, 0x54, 0x65, 0x78,
10874                                                 0x74, 0x20, 0x41, 0x74, 0x74,
10875                                                 0x72, 0x69, 0x62, 0x75, 0x74,
10876                                                 0x65, 0x20, 0x31, 0x8A, 0x39,
10877                                                 0xF0, 0x41, 0xE1, 0x90, 0x58,
10878                                                 0x34, 0x1E, 0x91, 0x49, 0xE5,
10879                                                 0x92, 0xD9, 0x74, 0x3E, 0xA1,
10880                                                 0x51, 0xE9, 0x94, 0x5A, 0xB5,
10881                                                 0x5E, 0xB1, 0x59, 0x6D, 0x2B,
10882                                                 0x2C, 0x1E, 0x93, 0xCB, 0xE6,
10883                                                 0x33, 0x3A, 0xAD, 0x5E, 0xB3,
10884                                                 0xDB, 0xEE, 0x37, 0x3C, 0x2E,
10885                                                 0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
10886                                                 0x3E, 0xAF, 0x6F, 0xC5, 0x64,
10887                                                 0x33, 0x5A, 0xCD, 0x76, 0xC3,
10888                                                 0xE5, 0x60, 0xD0, 0x04, 0x00,
10889                                                 0x10, 0x00, 0xB4 };
10890
10891 static unsigned char send_ussd_4102[] = { 0xD0, 0x56, 0x81, 0x03, 0x01, 0x12,
10892                                                 0x00, 0x82, 0x02, 0x81, 0x83,
10893                                                 0x85, 0x10, 0x54, 0x65, 0x78,
10894                                                 0x74, 0x20, 0x41, 0x74, 0x74,
10895                                                 0x72, 0x69, 0x62, 0x75, 0x74,
10896                                                 0x65, 0x20, 0x32, 0x8A, 0x39,
10897                                                 0xF0, 0x41, 0xE1, 0x90, 0x58,
10898                                                 0x34, 0x1E, 0x91, 0x49, 0xE5,
10899                                                 0x92, 0xD9, 0x74, 0x3E, 0xA1,
10900                                                 0x51, 0xE9, 0x94, 0x5A, 0xB5,
10901                                                 0x5E, 0xB1, 0x59, 0x6D, 0x2B,
10902                                                 0x2C, 0x1E, 0x93, 0xCB, 0xE6,
10903                                                 0x33, 0x3A, 0xAD, 0x5E, 0xB3,
10904                                                 0xDB, 0xEE, 0x37, 0x3C, 0x2E,
10905                                                 0x9F, 0xD3, 0xEB, 0xF6, 0x3B,
10906                                                 0x3E, 0xAF, 0x6F, 0xC5, 0x64,
10907                                                 0x33, 0x5A, 0xCD, 0x76, 0xC3,
10908                                                 0xE5, 0x60 };
10909
10910 static unsigned char send_ussd_511[] = { 0xD0, 0x4B, 0x81, 0x03, 0x01, 0x12,
10911                                                 0x00, 0x82, 0x02, 0x81, 0x83,
10912                                                 0x85, 0x05, 0x80, 0x4F, 0x60,
10913                                                 0x59, 0x7D, 0x8A, 0x39, 0xF0,
10914                                                 0x41, 0xE1, 0x90, 0x58, 0x34,
10915                                                 0x1E, 0x91, 0x49, 0xE5, 0x92,
10916                                                 0xD9, 0x74, 0x3E, 0xA1, 0x51,
10917                                                 0xE9, 0x94, 0x5A, 0xB5, 0x5E,
10918                                                 0xB1, 0x59, 0x6D, 0x2B, 0x2C,
10919                                                 0x1E, 0x93, 0xCB, 0xE6, 0x33,
10920                                                 0x3A, 0xAD, 0x5E, 0xB3, 0xDB,
10921                                                 0xEE, 0x37, 0x3C, 0x2E, 0x9F,
10922                                                 0xD3, 0xEB, 0xF6, 0x3B, 0x3E,
10923                                                 0xAF, 0x6F, 0xC5, 0x64, 0x33,
10924                                                 0x5A, 0xCD, 0x76, 0xC3, 0xE5,
10925                                                 0x60 };
10926
10927 static unsigned char send_ussd_611[] = { 0xD0, 0x49, 0x81, 0x03, 0x01, 0x12,
10928                                                 0x00, 0x82, 0x02, 0x81, 0x83,
10929                                                 0x85, 0x03, 0x80, 0x30, 0xEB,
10930                                                 0x8A, 0x39, 0xF0, 0x41, 0xE1,
10931                                                 0x90, 0x58, 0x34, 0x1E, 0x91,
10932                                                 0x49, 0xE5, 0x92, 0xD9, 0x74,
10933                                                 0x3E, 0xA1, 0x51, 0xE9, 0x94,
10934                                                 0x5A, 0xB5, 0x5E, 0xB1, 0x59,
10935                                                 0x6D, 0x2B, 0x2C, 0x1E, 0x93,
10936                                                 0xCB, 0xE6, 0x33, 0x3A, 0xAD,
10937                                                 0x5E, 0xB3, 0xDB, 0xEE, 0x37,
10938                                                 0x3C, 0x2E, 0x9F, 0xD3, 0xEB,
10939                                                 0xF6, 0x3B, 0x3E, 0xAF, 0x6F,
10940                                                 0xC5, 0x64, 0x33, 0x5A, 0xCD,
10941                                                 0x76, 0xC3, 0xE5, 0x60 };
10942
10943 static struct send_ussd_test send_ussd_data_111 = {
10944         .pdu = send_ussd_111,
10945         .pdu_len = sizeof(send_ussd_111),
10946         .qualifier = 0x00,
10947         .alpha_id = "7-bit USSD",
10948         .ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
10949                 "1234567890"
10950 };
10951
10952 static struct send_ussd_test send_ussd_data_121 = {
10953         .pdu = send_ussd_121,
10954         .pdu_len = sizeof(send_ussd_121),
10955         .qualifier = 0x00,
10956         .alpha_id = "8-bit USSD",
10957         .ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
10958                 "1234567890"
10959 };
10960
10961 static struct send_ussd_test send_ussd_data_131 = {
10962         .pdu = send_ussd_131,
10963         .pdu_len = sizeof(send_ussd_131),
10964         .qualifier = 0x00,
10965         .alpha_id = "UCS2 USSD",
10966         .ussd = "ЗДРАВСТВУЙТЕ"
10967 };
10968
10969 static struct send_ussd_test send_ussd_data_161 = {
10970         .pdu = send_ussd_161,
10971         .pdu_len = sizeof(send_ussd_161),
10972         .qualifier = 0x00,
10973         .alpha_id = "once a RELEASE COMPLETE message containing the USSD "
10974                 "Return Result message not containing an error has been "
10975                 "received from the network, the ME shall inform the SIM "
10976                 "that the command has",
10977         .ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
10978                 "1234567890"
10979 };
10980
10981 static struct send_ussd_test send_ussd_data_171 = {
10982         .pdu = send_ussd_171,
10983         .pdu_len = sizeof(send_ussd_171),
10984         .qualifier = 0x00,
10985         .ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
10986                 "1234567890"
10987 };
10988
10989 static struct send_ussd_test send_ussd_data_181 = {
10990         .pdu = send_ussd_181,
10991         .pdu_len = sizeof(send_ussd_181),
10992         .qualifier = 0x00,
10993         .alpha_id = "",
10994         .ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
10995                 "1234567890"
10996 };
10997
10998 static struct send_ussd_test send_ussd_data_211 = {
10999         .pdu = send_ussd_211,
11000         .pdu_len = sizeof(send_ussd_211),
11001         .qualifier = 0x00,
11002         .alpha_id = "Basic Icon",
11003         .ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
11004                 "1234567890",
11005         .icon_id = {
11006                 .qualifier = STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY,
11007                 .id = 0x01
11008         }
11009 };
11010
11011 static struct send_ussd_test send_ussd_data_221 = {
11012         .pdu = send_ussd_221,
11013         .pdu_len = sizeof(send_ussd_221),
11014         .qualifier = 0x00,
11015         .alpha_id = "Color Icon",
11016         .ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
11017                 "1234567890",
11018         .icon_id = {
11019                 .qualifier = STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY,
11020                 .id = 0x02
11021         }
11022 };
11023
11024 static struct send_ussd_test send_ussd_data_231 = {
11025         .pdu = send_ussd_231,
11026         .pdu_len = sizeof(send_ussd_231),
11027         .qualifier = 0x00,
11028         .alpha_id = "Basic Icon",
11029         .ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
11030                 "1234567890",
11031         .icon_id = {
11032                 .qualifier = STK_ICON_QUALIFIER_TYPE_NON_SELF_EXPLANATORY,
11033                 .id = 0x01
11034         }
11035 };
11036
11037 static struct send_ussd_test send_ussd_data_241 = {
11038         .pdu = send_ussd_241,
11039         .pdu_len = sizeof(send_ussd_241),
11040         .qualifier = 0x00,
11041         .ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
11042                 "1234567890",
11043         .icon_id = {
11044                 .qualifier = STK_ICON_QUALIFIER_TYPE_NON_SELF_EXPLANATORY,
11045                 .id = 0x01
11046         }
11047 };
11048
11049 /* The ussd is not complete in spec */
11050 static struct send_ussd_test send_ussd_data_311 = {
11051         .pdu = send_ussd_311,
11052         .pdu_len = sizeof(send_ussd_311),
11053         .qualifier = 0x00,
11054         .alpha_id = "ЗДРАВСТВУЙТЕ",
11055         .ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
11056                 "1234567890"
11057 };
11058
11059 static struct send_ussd_test send_ussd_data_411 = {
11060         .pdu = send_ussd_411,
11061         .pdu_len = sizeof(send_ussd_411),
11062         .qualifier = 0x00,
11063         .alpha_id = "Text Attribute 1",
11064         .ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
11065                 "1234567890",
11066         .text_attr = {
11067                 .len = 4,
11068                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
11069         }
11070 };
11071
11072 static struct send_ussd_test send_ussd_data_412 = {
11073         .pdu = send_ussd_412,
11074         .pdu_len = sizeof(send_ussd_412),
11075         .qualifier = 0x00,
11076         .alpha_id = "Text Attribute 2",
11077         .ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
11078                 "1234567890"
11079 };
11080
11081 static struct send_ussd_test send_ussd_data_421 = {
11082         .pdu = send_ussd_421,
11083         .pdu_len = sizeof(send_ussd_421),
11084         .qualifier = 0x00,
11085         .alpha_id = "Text Attribute 1",
11086         .ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
11087                 "1234567890",
11088         .text_attr = {
11089                 .len = 4,
11090                 .attributes = { 0x00, 0x10, 0x01, 0xB4 }
11091         }
11092 };
11093
11094 static struct send_ussd_test send_ussd_data_422 = {
11095         .pdu = send_ussd_422,
11096         .pdu_len = sizeof(send_ussd_422),
11097         .qualifier = 0x00,
11098         .alpha_id = "Text Attribute 2",
11099         .ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
11100                 "1234567890"
11101 };
11102
11103 static struct send_ussd_test send_ussd_data_431 = {
11104         .pdu = send_ussd_431,
11105         .pdu_len = sizeof(send_ussd_431),
11106         .qualifier = 0x00,
11107         .alpha_id = "Text Attribute 1",
11108         .ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
11109                 "1234567890",
11110         .text_attr = {
11111                 .len = 4,
11112                 .attributes = { 0x00, 0x10, 0x02, 0xB4 }
11113         }
11114 };
11115
11116 static struct send_ussd_test send_ussd_data_432 = {
11117         .pdu = send_ussd_432,
11118         .pdu_len = sizeof(send_ussd_432),
11119         .qualifier = 0x00,
11120         .alpha_id = "Text Attribute 2",
11121         .ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
11122                 "1234567890"
11123 };
11124
11125 static struct send_ussd_test send_ussd_data_441 = {
11126         .pdu = send_ussd_441,
11127         .pdu_len = sizeof(send_ussd_441),
11128         .qualifier = 0x00,
11129         .alpha_id = "Text Attribute 1",
11130         .ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
11131                 "1234567890",
11132         .text_attr = {
11133                 .len = 4,
11134                 .attributes = { 0x00, 0x10, 0x04, 0xB4 }
11135         }
11136 };
11137
11138 static struct send_ussd_test send_ussd_data_442 = {
11139         .pdu = send_ussd_442,
11140         .pdu_len = sizeof(send_ussd_442),
11141         .qualifier = 0x00,
11142         .alpha_id = "Text Attribute 2",
11143         .ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
11144                 "1234567890",
11145         .text_attr = {
11146                 .len = 4,
11147                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
11148         }
11149 };
11150
11151 static struct send_ussd_test send_ussd_data_443 = {
11152         .pdu = send_ussd_443,
11153         .pdu_len = sizeof(send_ussd_443),
11154         .qualifier = 0x00,
11155         .alpha_id = "Text Attribute 3",
11156         .ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
11157                 "1234567890"
11158 };
11159
11160 static struct send_ussd_test send_ussd_data_451 = {
11161         .pdu = send_ussd_451,
11162         .pdu_len = sizeof(send_ussd_451),
11163         .qualifier = 0x00,
11164         .alpha_id = "Text Attribute 1",
11165         .ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
11166                 "1234567890",
11167         .text_attr = {
11168                 .len = 4,
11169                 .attributes = { 0x00, 0x10, 0x08, 0xB4 }
11170         }
11171 };
11172
11173 static struct send_ussd_test send_ussd_data_452 = {
11174         .pdu = send_ussd_452,
11175         .pdu_len = sizeof(send_ussd_452),
11176         .qualifier = 0x00,
11177         .alpha_id = "Text Attribute 2",
11178         .ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
11179                 "1234567890",
11180         .text_attr = {
11181                 .len = 4,
11182                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
11183         }
11184 };
11185
11186 static struct send_ussd_test send_ussd_data_453 = {
11187         .pdu = send_ussd_453,
11188         .pdu_len = sizeof(send_ussd_453),
11189         .qualifier = 0x00,
11190         .alpha_id = "Text Attribute 3",
11191         .ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
11192                 "1234567890"
11193 };
11194
11195 static struct send_ussd_test send_ussd_data_461 = {
11196         .pdu = send_ussd_461,
11197         .pdu_len = sizeof(send_ussd_461),
11198         .qualifier = 0x00,
11199         .alpha_id = "Text Attribute 1",
11200         .ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
11201                 "1234567890",
11202         .text_attr = {
11203                 .len = 4,
11204                 .attributes = { 0x00, 0x10, 0x10, 0xB4 }
11205         }
11206 };
11207
11208 static struct send_ussd_test send_ussd_data_462 = {
11209         .pdu = send_ussd_462,
11210         .pdu_len = sizeof(send_ussd_462),
11211         .qualifier = 0x00,
11212         .alpha_id = "Text Attribute 2",
11213         .ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
11214                 "1234567890",
11215         .text_attr = {
11216                 .len = 4,
11217                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
11218         }
11219 };
11220
11221 static struct send_ussd_test send_ussd_data_463 = {
11222         .pdu = send_ussd_463,
11223         .pdu_len = sizeof(send_ussd_463),
11224         .qualifier = 0x00,
11225         .alpha_id = "Text Attribute 3",
11226         .ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
11227                 "1234567890"
11228 };
11229
11230 static struct send_ussd_test send_ussd_data_471 = {
11231         .pdu = send_ussd_471,
11232         .pdu_len = sizeof(send_ussd_471),
11233         .qualifier = 0x00,
11234         .alpha_id = "Text Attribute 1",
11235         .ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
11236                 "1234567890",
11237         .text_attr = {
11238                 .len = 4,
11239                 .attributes = { 0x00, 0x10, 0x20, 0xB4 }
11240         }
11241 };
11242
11243 static struct send_ussd_test send_ussd_data_472 = {
11244         .pdu = send_ussd_472,
11245         .pdu_len = sizeof(send_ussd_472),
11246         .qualifier = 0x00,
11247         .alpha_id = "Text Attribute 2",
11248         .ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
11249                 "1234567890",
11250         .text_attr = {
11251                 .len = 4,
11252                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
11253         }
11254 };
11255
11256 static struct send_ussd_test send_ussd_data_473 = {
11257         .pdu = send_ussd_473,
11258         .pdu_len = sizeof(send_ussd_473),
11259         .qualifier = 0x00,
11260         .alpha_id = "Text Attribute 3",
11261         .ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
11262                 "1234567890"
11263 };
11264
11265 static struct send_ussd_test send_ussd_data_481 = {
11266         .pdu = send_ussd_481,
11267         .pdu_len = sizeof(send_ussd_481),
11268         .qualifier = 0x00,
11269         .alpha_id = "Text Attribute 1",
11270         .ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
11271                 "1234567890",
11272         .text_attr = {
11273                 .len = 4,
11274                 .attributes = { 0x00, 0x10, 0x40, 0xB4 }
11275         }
11276 };
11277
11278 static struct send_ussd_test send_ussd_data_482 = {
11279         .pdu = send_ussd_482,
11280         .pdu_len = sizeof(send_ussd_482),
11281         .qualifier = 0x00,
11282         .alpha_id = "Text Attribute 2",
11283         .ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
11284                 "1234567890",
11285         .text_attr = {
11286                 .len = 4,
11287                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
11288         }
11289 };
11290
11291 static struct send_ussd_test send_ussd_data_483 = {
11292         .pdu = send_ussd_483,
11293         .pdu_len = sizeof(send_ussd_483),
11294         .qualifier = 0x00,
11295         .alpha_id = "Text Attribute 3",
11296         .ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
11297                 "1234567890"
11298 };
11299
11300 static struct send_ussd_test send_ussd_data_491 = {
11301         .pdu = send_ussd_491,
11302         .pdu_len = sizeof(send_ussd_491),
11303         .qualifier = 0x00,
11304         .alpha_id = "Text Attribute 1",
11305         .ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
11306                 "1234567890",
11307         .text_attr = {
11308                 .len = 4,
11309                 .attributes = { 0x00, 0x10, 0x80, 0xB4 }
11310         }
11311 };
11312
11313 static struct send_ussd_test send_ussd_data_492 = {
11314         .pdu = send_ussd_492,
11315         .pdu_len = sizeof(send_ussd_492),
11316         .qualifier = 0x00,
11317         .alpha_id = "Text Attribute 2",
11318         .ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
11319                 "1234567890",
11320         .text_attr = {
11321                 .len = 4,
11322                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
11323         }
11324 };
11325
11326 static struct send_ussd_test send_ussd_data_493 = {
11327         .pdu = send_ussd_493,
11328         .pdu_len = sizeof(send_ussd_493),
11329         .qualifier = 0x00,
11330         .alpha_id = "Text Attribute 3",
11331         .ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
11332                 "1234567890"
11333 };
11334
11335 static struct send_ussd_test send_ussd_data_4101 = {
11336         .pdu = send_ussd_4101,
11337         .pdu_len = sizeof(send_ussd_4101),
11338         .qualifier = 0x00,
11339         .alpha_id = "Text Attribute 1",
11340         .ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
11341                 "1234567890",
11342         .text_attr = {
11343                 .len = 4,
11344                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
11345         }
11346 };
11347
11348 static struct send_ussd_test send_ussd_data_4102 = {
11349         .pdu = send_ussd_4102,
11350         .pdu_len = sizeof(send_ussd_4102),
11351         .qualifier = 0x00,
11352         .alpha_id = "Text Attribute 2",
11353         .ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
11354                 "1234567890"
11355 };
11356
11357 static struct send_ussd_test send_ussd_data_511 = {
11358         .pdu = send_ussd_511,
11359         .pdu_len = sizeof(send_ussd_511),
11360         .qualifier = 0x00,
11361         .alpha_id = "你好",
11362         .ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
11363                 "1234567890"
11364 };
11365
11366 static struct send_ussd_test send_ussd_data_611 = {
11367         .pdu = send_ussd_611,
11368         .pdu_len = sizeof(send_ussd_611),
11369         .qualifier = 0x00,
11370         .alpha_id = "ル",
11371         .ussd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-"
11372                 "1234567890"
11373 };
11374
11375 static void test_send_ussd(gconstpointer data)
11376 {
11377         const struct send_ussd_test *test = data;
11378         struct stk_command *command;
11379
11380         command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
11381
11382         g_assert(command);
11383         g_assert(command->status == STK_PARSE_RESULT_OK);
11384
11385         g_assert(command->number == 1);
11386         g_assert(command->type == STK_COMMAND_TYPE_SEND_USSD);
11387         g_assert(command->qualifier == test->qualifier);
11388
11389         g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
11390         g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_NETWORK);
11391
11392         check_alpha_id(command->send_ussd.alpha_id, test->alpha_id);
11393         check_ussd(&command->send_ussd.ussd_string, test->ussd);
11394         check_icon_id(&command->send_ussd.icon_id, &test->icon_id);
11395         check_text_attr(&command->send_ussd.text_attr, &test->text_attr);
11396         check_frame_id(&command->send_ussd.frame_id, &test->frame_id);
11397
11398         stk_command_free(command);
11399 }
11400
11401 struct setup_call_test {
11402         const unsigned char *pdu;
11403         unsigned int pdu_len;
11404         unsigned char qualifier;
11405         char *alpha_id_usr_cfm;
11406         struct stk_address addr;
11407         struct stk_ccp ccp;
11408         struct stk_subaddress subaddr;
11409         struct stk_duration duration;
11410         struct stk_icon_id icon_id_usr_cfm;
11411         char *alpha_id_call_setup;
11412         struct stk_icon_id icon_id_call_setup;
11413         struct stk_text_attribute text_attr_usr_cfm;
11414         struct stk_text_attribute text_attr_call_setup;
11415         struct stk_frame_id frame_id;
11416 };
11417
11418 static unsigned char setup_call_111[] = { 0xD0, 0x1E, 0x81, 0x03, 0x01, 0x10,
11419                                                 0x00, 0x82, 0x02, 0x81, 0x83,
11420                                                 0x85, 0x08, 0x4E, 0x6F, 0x74,
11421                                                 0x20, 0x62, 0x75, 0x73, 0x79,
11422                                                 0x86, 0x09, 0x91, 0x10, 0x32,
11423                                                 0x04, 0x21, 0x43, 0x65, 0x1C,
11424                                                 0x2C };
11425
11426 static unsigned char setup_call_141[] = { 0xD0, 0x1D, 0x81, 0x03, 0x01, 0x10,
11427                                                 0x02, 0x82, 0x02, 0x81, 0x83,
11428                                                 0x85, 0x07, 0x4F, 0x6E, 0x20,
11429                                                 0x68, 0x6F, 0x6C, 0x64, 0x86,
11430                                                 0x09, 0x91, 0x10, 0x32, 0x04,
11431                                                 0x21, 0x43, 0x65, 0x1C, 0x2C };
11432
11433 static unsigned char setup_call_151[] = { 0xD0, 0x20, 0x81, 0x03, 0x01, 0x10,
11434                                                 0x04, 0x82, 0x02, 0x81, 0x83,
11435                                                 0x85, 0x0A, 0x44, 0x69, 0x73,
11436                                                 0x63, 0x6F, 0x6E, 0x6E, 0x65,
11437                                                 0x63, 0x74, 0x86, 0x09, 0x91,
11438                                                 0x10, 0x32, 0x04, 0x21, 0x43,
11439                                                 0x65, 0x1C, 0x2C };
11440
11441 static unsigned char setup_call_181[] = { 0xD0, 0x2B, 0x81, 0x03, 0x01, 0x10,
11442                                                 0x00, 0x82, 0x02, 0x81, 0x83,
11443                                                 0x85, 0x11, 0x43, 0x61, 0x70,
11444                                                 0x61, 0x62, 0x69, 0x6C, 0x69,
11445                                                 0x74, 0x79, 0x20, 0x63, 0x6F,
11446                                                 0x6E, 0x66, 0x69, 0x67, 0x86,
11447                                                 0x09, 0x91, 0x10, 0x32, 0x04,
11448                                                 0x21, 0x43, 0x65, 0x1C, 0x2C,
11449                                                 0x87, 0x02, 0x01, 0xA0 };
11450
11451 static unsigned char setup_call_191[] = { 0xD0, 0x1C, 0x81, 0x03, 0x01, 0x10,
11452                                                 0x01, 0x82, 0x02, 0x81, 0x83,
11453                                                 0x86, 0x11, 0x91, 0x10, 0x32,
11454                                                 0x54, 0x76, 0x98, 0x10, 0x32,
11455                                                 0x54, 0x76, 0x98, 0x10, 0x32,
11456                                                 0x54, 0x76, 0x98, 0x10 };
11457
11458 static unsigned char setup_call_1101[] = { 0xD0, 0x81, 0xFD, 0x81, 0x03, 0x01,
11459                                                 0x10, 0x01, 0x82, 0x02, 0x81,
11460                                                 0x83, 0x85, 0x81, 0xED, 0x54,
11461                                                 0x68, 0x72, 0x65, 0x65, 0x20,
11462                                                 0x74, 0x79, 0x70, 0x65, 0x73,
11463                                                 0x20, 0x61, 0x72, 0x65, 0x20,
11464                                                 0x64, 0x65, 0x66, 0x69, 0x6E,
11465                                                 0x65, 0x64, 0x3A, 0x20, 0x2D,
11466                                                 0x20, 0x73, 0x65, 0x74, 0x20,
11467                                                 0x75, 0x70, 0x20, 0x61, 0x20,
11468                                                 0x63, 0x61, 0x6C, 0x6C, 0x2C,
11469                                                 0x20, 0x62, 0x75, 0x74, 0x20,
11470                                                 0x6F, 0x6E, 0x6C, 0x79, 0x20,
11471                                                 0x69, 0x66, 0x20, 0x6E, 0x6F,
11472                                                 0x74, 0x20, 0x63, 0x75, 0x72,
11473                                                 0x72, 0x65, 0x6E, 0x74, 0x6C,
11474                                                 0x79, 0x20, 0x62, 0x75, 0x73,
11475                                                 0x79, 0x20, 0x6F, 0x6E, 0x20,
11476                                                 0x61, 0x6E, 0x6F, 0x74, 0x68,
11477                                                 0x65, 0x72, 0x20, 0x63, 0x61,
11478                                                 0x6C, 0x6C, 0x3B, 0x20, 0x2D,
11479                                                 0x20, 0x73, 0x65, 0x74, 0x20,
11480                                                 0x75, 0x70, 0x20, 0x61, 0x20,
11481                                                 0x63, 0x61, 0x6C, 0x6C, 0x2C,
11482                                                 0x20, 0x70, 0x75, 0x74, 0x74,
11483                                                 0x69, 0x6E, 0x67, 0x20, 0x61,
11484                                                 0x6C, 0x6C, 0x20, 0x6F, 0x74,
11485                                                 0x68, 0x65, 0x72, 0x20, 0x63,
11486                                                 0x61, 0x6C, 0x6C, 0x73, 0x20,
11487                                                 0x28, 0x69, 0x66, 0x20, 0x61,
11488                                                 0x6E, 0x79, 0x29, 0x20, 0x6F,
11489                                                 0x6E, 0x20, 0x68, 0x6F, 0x6C,
11490                                                 0x64, 0x3B, 0x20, 0x2D, 0x20,
11491                                                 0x73, 0x65, 0x74, 0x20, 0x75,
11492                                                 0x70, 0x20, 0x61, 0x20, 0x63,
11493                                                 0x61, 0x6C, 0x6C, 0x2C, 0x20,
11494                                                 0x64, 0x69, 0x73, 0x63, 0x6F,
11495                                                 0x6E, 0x6E, 0x65, 0x63, 0x74,
11496                                                 0x69, 0x6E, 0x67, 0x20, 0x61,
11497                                                 0x6C, 0x6C, 0x20, 0x6F, 0x74,
11498                                                 0x68, 0x65, 0x72, 0x20, 0x63,
11499                                                 0x61, 0x6C, 0x6C, 0x73, 0x20,
11500                                                 0x28, 0x69, 0x66, 0x20, 0x61,
11501                                                 0x6E, 0x79, 0x29, 0x20, 0x66,
11502                                                 0x69, 0x72, 0x73, 0x74, 0x2E,
11503                                                 0x20, 0x46, 0x6F, 0x72, 0x20,
11504                                                 0x65, 0x61, 0x63, 0x68, 0x20,
11505                                                 0x6F, 0x66, 0x20, 0x74, 0x68,
11506                                                 0x65, 0x73, 0x65, 0x20, 0x74,
11507                                                 0x79, 0x70, 0x65, 0x73, 0x2C,
11508                                                 0x20, 0x86, 0x02, 0x91, 0x10 };
11509
11510 static unsigned char setup_call_1111[] = { 0xD0, 0x2B, 0x81, 0x03, 0x01, 0x10,
11511                                                 0x00, 0x82, 0x02, 0x81, 0x83,
11512                                                 0x85, 0x0C, 0x43, 0x61, 0x6C,
11513                                                 0x6C, 0x65, 0x64, 0x20, 0x70,
11514                                                 0x61, 0x72, 0x74, 0x79, 0x86,
11515                                                 0x09, 0x91, 0x10, 0x32, 0x04,
11516                                                 0x21, 0x43, 0x65, 0x1C, 0x2C,
11517                                                 0x88, 0x07, 0x80, 0x50, 0x95,
11518                                                 0x95, 0x95, 0x95, 0x95 };
11519
11520 static unsigned char setup_call_1121[] = { 0xD0, 0x22, 0x81, 0x03, 0x01, 0x10,
11521                                                 0x01, 0x82, 0x02, 0x81, 0x83,
11522                                                 0x85, 0x08, 0x44, 0x75, 0x72,
11523                                                 0x61, 0x74, 0x69, 0x6F, 0x6E,
11524                                                 0x86, 0x09, 0x91, 0x10, 0x32,
11525                                                 0x04, 0x21, 0x43, 0x65, 0x1C,
11526                                                 0x2C, 0x84, 0x02, 0x01, 0x0A };
11527
11528 static unsigned char setup_call_211[] = { 0xD0, 0x28, 0x81, 0x03, 0x01, 0x10,
11529                                                 0x00, 0x82, 0x02, 0x81, 0x83,
11530                                                 0x85, 0x0C, 0x43, 0x4F, 0x4E,
11531                                                 0x46, 0x49, 0x52, 0x4D, 0x41,
11532                                                 0x54, 0x49, 0x4F, 0x4E, 0x86,
11533                                                 0x09, 0x91, 0x10, 0x32, 0x04,
11534                                                 0x21, 0x43, 0x65, 0x1C, 0x2C,
11535                                                 0x85, 0x04, 0x43, 0x41, 0x4C,
11536                                                 0x4C };
11537
11538 static unsigned char setup_call_311[] = { 0xD0, 0x30, 0x81, 0x03, 0x01, 0x10,
11539                                                 0x00, 0x82, 0x02, 0x81, 0x83,
11540                                                 0x85, 0x16, 0x53, 0x65, 0x74,
11541                                                 0x20, 0x75, 0x70, 0x20, 0x63,
11542                                                 0x61, 0x6C, 0x6C, 0x20, 0x49,
11543                                                 0x63, 0x6F, 0x6E, 0x20, 0x33,
11544                                                 0x2E, 0x31, 0x2E, 0x31, 0x86,
11545                                                 0x09, 0x91, 0x10, 0x32, 0x04,
11546                                                 0x21, 0x43, 0x65, 0x1C, 0x2C,
11547                                                 0x9E, 0x02, 0x01, 0x01 };
11548
11549 static unsigned char setup_call_321[] = { 0xD0, 0x30, 0x81, 0x03, 0x01, 0x10,
11550                                                 0x00, 0x82, 0x02, 0x81, 0x83,
11551                                                 0x85, 0x16, 0x53, 0x65, 0x74,
11552                                                 0x20, 0x75, 0x70, 0x20, 0x63,
11553                                                 0x61, 0x6C, 0x6C, 0x20, 0x49,
11554                                                 0x63, 0x6F, 0x6E, 0x20, 0x33,
11555                                                 0x2E, 0x32, 0x2E, 0x31, 0x86,
11556                                                 0x09, 0x91, 0x10, 0x32, 0x04,
11557                                                 0x21, 0x43, 0x65, 0x1C, 0x2C,
11558                                                 0x9E, 0x02, 0x00, 0x01 };
11559
11560 static unsigned char setup_call_331[] = { 0xD0, 0x30, 0x81, 0x03, 0x01, 0x10,
11561                                                 0x00, 0x82, 0x02, 0x81, 0x83,
11562                                                 0x85, 0x16, 0x53, 0x65, 0x74,
11563                                                 0x20, 0x75, 0x70, 0x20, 0x63,
11564                                                 0x61, 0x6C, 0x6C, 0x20, 0x49,
11565                                                 0x63, 0x6F, 0x6E, 0x20, 0x33,
11566                                                 0x2E, 0x33, 0x2E, 0x31, 0x86,
11567                                                 0x09, 0x91, 0x10, 0x32, 0x04,
11568                                                 0x21, 0x43, 0x65, 0x1C, 0x2C,
11569                                                 0x9E, 0x02, 0x01, 0x02 };
11570
11571 static unsigned char setup_call_341[] = { 0xD0, 0x4C, 0x81, 0x03, 0x01, 0x10,
11572                                                 0x00, 0x82, 0x02, 0x81, 0x83,
11573                                                 0x85, 0x16, 0x53, 0x65, 0x74,
11574                                                 0x20, 0x75, 0x70, 0x20, 0x63,
11575                                                 0x61, 0x6C, 0x6C, 0x20, 0x49,
11576                                                 0x63, 0x6F, 0x6E, 0x20, 0x33,
11577                                                 0x2E, 0x34, 0x2E, 0x31, 0x86,
11578                                                 0x09, 0x91, 0x10, 0x32, 0x04,
11579                                                 0x21, 0x43, 0x65, 0x1C, 0x2C,
11580                                                 0x9E, 0x02, 0x00, 0x01, 0x85,
11581                                                 0x16, 0x53, 0x65, 0x74, 0x20,
11582                                                 0x75, 0x70, 0x20, 0x63, 0x61,
11583                                                 0x6C, 0x6C, 0x20, 0x49, 0x63,
11584                                                 0x6F, 0x6E, 0x20, 0x33, 0x2E,
11585                                                 0x34, 0x2E, 0x32, 0x9E, 0x02,
11586                                                 0x00, 0x01 };
11587
11588 static unsigned char setup_call_411[] = { 0xD0, 0x38, 0x81, 0x03, 0x01, 0x10,
11589                                                 0x00, 0x82, 0x02, 0x81, 0x83,
11590                                                 0x85, 0x0E, 0x43, 0x4F, 0x4E,
11591                                                 0x46, 0x49, 0x52, 0x4D, 0x41,
11592                                                 0x54, 0x49, 0x4F, 0x4E, 0x20,
11593                                                 0x31, 0x86, 0x09, 0x91, 0x10,
11594                                                 0x32, 0x04, 0x21, 0x43, 0x65,
11595                                                 0x1C, 0x2C, 0x85, 0x06, 0x43,
11596                                                 0x41, 0x4C, 0x4C, 0x20, 0x31,
11597                                                 0xD0, 0x04, 0x00, 0x0E, 0x00,
11598                                                 0xB4, 0xD0, 0x04, 0x00, 0x06,
11599                                                 0x00, 0xB4 };
11600
11601 static unsigned char setup_call_412[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x10,
11602                                                 0x00, 0x82, 0x02, 0x81, 0x83,
11603                                                 0x85, 0x0E, 0x43, 0x4F, 0x4E,
11604                                                 0x46, 0x49, 0x52, 0x4D, 0x41,
11605                                                 0x54, 0x49, 0x4F, 0x4E, 0x20,
11606                                                 0x32, 0x86, 0x09, 0x91, 0x10,
11607                                                 0x32, 0x04, 0x21, 0x43, 0x65,
11608                                                 0x1C, 0x2C, 0x85, 0x06, 0x43,
11609                                                 0x41, 0x4C, 0x4C, 0x20, 0x32 };
11610
11611 static unsigned char setup_call_421[] = { 0xD0, 0x38, 0x81, 0x03, 0x01, 0x10,
11612                                                 0x00, 0x82, 0x02, 0x81, 0x83,
11613                                                 0x85, 0x0E, 0x43, 0x4F, 0x4E,
11614                                                 0x46, 0x49, 0x52, 0x4D, 0x41,
11615                                                 0x54, 0x49, 0x4F, 0x4E, 0x20,
11616                                                 0x31, 0x86, 0x09, 0x91, 0x10,
11617                                                 0x32, 0x04, 0x21, 0x43, 0x65,
11618                                                 0x1C, 0x2C, 0x85, 0x06, 0x43,
11619                                                 0x41, 0x4C, 0x4C, 0x20, 0x31,
11620                                                 0xD0, 0x04, 0x00, 0x0E, 0x01,
11621                                                 0xB4, 0xD0, 0x04, 0x00, 0x06,
11622                                                 0x01, 0xB4 };
11623
11624 static unsigned char setup_call_422[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x10,
11625                                                 0x00, 0x82, 0x02, 0x81, 0x83,
11626                                                 0x85, 0x0E, 0x43, 0x4F, 0x4E,
11627                                                 0x46, 0x49, 0x52, 0x4D, 0x41,
11628                                                 0x54, 0x49, 0x4F, 0x4E, 0x20,
11629                                                 0x32, 0x86, 0x09, 0x91, 0x10,
11630                                                 0x32, 0x04, 0x21, 0x43, 0x65,
11631                                                 0x1C, 0x2C, 0x85, 0x06, 0x43,
11632                                                 0x41, 0x4C, 0x4C, 0x20, 0x32 };
11633
11634 static unsigned char setup_call_431[] = { 0xD0, 0x38, 0x81, 0x03, 0x01, 0x10,
11635                                                 0x00, 0x82, 0x02, 0x81, 0x83,
11636                                                 0x85, 0x0E, 0x43, 0x4F, 0x4E,
11637                                                 0x46, 0x49, 0x52, 0x4D, 0x41,
11638                                                 0x54, 0x49, 0x4F, 0x4E, 0x20,
11639                                                 0x31, 0x86, 0x09, 0x91, 0x10,
11640                                                 0x32, 0x04, 0x21, 0x43, 0x65,
11641                                                 0x1C, 0x2C, 0x85, 0x06, 0x43,
11642                                                 0x41, 0x4C, 0x4C, 0x20, 0x31,
11643                                                 0xD0, 0x04, 0x00, 0x0E, 0x02,
11644                                                 0xB4, 0xD0, 0x04, 0x00, 0x06,
11645                                                 0x02, 0xB4 };
11646
11647 static unsigned char setup_call_432[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x10,
11648                                                 0x00, 0x82, 0x02, 0x81, 0x83,
11649                                                 0x85, 0x0E, 0x43, 0x4F, 0x4E,
11650                                                 0x46, 0x49, 0x52, 0x4D, 0x41,
11651                                                 0x54, 0x49, 0x4F, 0x4E, 0x20,
11652                                                 0x32, 0x86, 0x09, 0x91, 0x10,
11653                                                 0x32, 0x04, 0x21, 0x43, 0x65,
11654                                                 0x1C, 0x2C, 0x85, 0x06, 0x43,
11655                                                 0x41, 0x4C, 0x4C, 0x20, 0x32 };
11656
11657 static unsigned char setup_call_441[] = { 0xD0, 0x38, 0x81, 0x03, 0x01, 0x10,
11658                                                 0x00, 0x82, 0x02, 0x81, 0x83,
11659                                                 0x85, 0x0E, 0x43, 0x4F, 0x4E,
11660                                                 0x46, 0x49, 0x52, 0x4D, 0x41,
11661                                                 0x54, 0x49, 0x4F, 0x4E, 0x20,
11662                                                 0x31, 0x86, 0x09, 0x91, 0x10,
11663                                                 0x32, 0x04, 0x21, 0x43, 0x65,
11664                                                 0x1C, 0x2C, 0x85, 0x06, 0x43,
11665                                                 0x41, 0x4C, 0x4C, 0x20, 0x31,
11666                                                 0xD0, 0x04, 0x00, 0x0E, 0x04,
11667                                                 0xB4, 0xD0, 0x04, 0x00, 0x06,
11668                                                 0x04, 0xB4 };
11669
11670 static unsigned char setup_call_442[] = { 0xD0, 0x38, 0x81, 0x03, 0x01, 0x10,
11671                                                 0x00, 0x82, 0x02, 0x81, 0x83,
11672                                                 0x85, 0x0E, 0x43, 0x4F, 0x4E,
11673                                                 0x46, 0x49, 0x52, 0x4D, 0x41,
11674                                                 0x54, 0x49, 0x4F, 0x4E, 0x20,
11675                                                 0x32, 0x86, 0x09, 0x91, 0x10,
11676                                                 0x32, 0x04, 0x21, 0x43, 0x65,
11677                                                 0x1C, 0x2C, 0x85, 0x06, 0x43,
11678                                                 0x41, 0x4C, 0x4C, 0x20, 0x32,
11679                                                 0xD0, 0x04, 0x00, 0x0E, 0x00,
11680                                                 0xB4, 0xD0, 0x04, 0x00, 0x06,
11681                                                 0x00, 0xB4 };
11682
11683 static unsigned char setup_call_443[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x10,
11684                                                 0x00, 0x82, 0x02, 0x81, 0x83,
11685                                                 0x85, 0x0E, 0x43, 0x4F, 0x4E,
11686                                                 0x46, 0x49, 0x52, 0x4D, 0x41,
11687                                                 0x54, 0x49, 0x4F, 0x4E, 0x20,
11688                                                 0x33, 0x86, 0x09, 0x91, 0x10,
11689                                                 0x32, 0x04, 0x21, 0x43, 0x65,
11690                                                 0x1C, 0x2C, 0x85, 0x06, 0x43,
11691                                                 0x41, 0x4C, 0x4C, 0x20, 0x33 };
11692
11693 static unsigned char setup_call_451[] = { 0xD0, 0x38, 0x81, 0x03, 0x01, 0x10,
11694                                                 0x00, 0x82, 0x02, 0x81, 0x83,
11695                                                 0x85, 0x0E, 0x43, 0x4F, 0x4E,
11696                                                 0x46, 0x49, 0x52, 0x4D, 0x41,
11697                                                 0x54, 0x49, 0x4F, 0x4E, 0x20,
11698                                                 0x31, 0x86, 0x09, 0x91, 0x10,
11699                                                 0x32, 0x04, 0x21, 0x43, 0x65,
11700                                                 0x1C, 0x2C, 0x85, 0x06, 0x43,
11701                                                 0x41, 0x4C, 0x4C, 0x20, 0x31,
11702                                                 0xD0, 0x04, 0x00, 0x0E, 0x08,
11703                                                 0xB4, 0xD0, 0x04, 0x00, 0x06,
11704                                                 0x08, 0xB4 };
11705
11706 static unsigned char setup_call_452[] = { 0xD0, 0x38, 0x81, 0x03, 0x01, 0x10,
11707                                                 0x00, 0x82, 0x02, 0x81, 0x83,
11708                                                 0x85, 0x0E, 0x43, 0x4F, 0x4E,
11709                                                 0x46, 0x49, 0x52, 0x4D, 0x41,
11710                                                 0x54, 0x49, 0x4F, 0x4E, 0x20,
11711                                                 0x32, 0x86, 0x09, 0x91, 0x10,
11712                                                 0x32, 0x04, 0x21, 0x43, 0x65,
11713                                                 0x1C, 0x2C, 0x85, 0x06, 0x43,
11714                                                 0x41, 0x4C, 0x4C, 0x20, 0x32,
11715                                                 0xD0, 0x04, 0x00, 0x0E, 0x00,
11716                                                 0xB4, 0xD0, 0x04, 0x00, 0x06,
11717                                                 0x00, 0xB4 };
11718
11719 static unsigned char setup_call_453[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x10,
11720                                                 0x00, 0x82, 0x02, 0x81, 0x83,
11721                                                 0x85, 0x0E, 0x43, 0x4F, 0x4E,
11722                                                 0x46, 0x49, 0x52, 0x4D, 0x41,
11723                                                 0x54, 0x49, 0x4F, 0x4E, 0x20,
11724                                                 0x33, 0x86, 0x09, 0x91, 0x10,
11725                                                 0x32, 0x04, 0x21, 0x43, 0x65,
11726                                                 0x1C, 0x2C, 0x85, 0x06, 0x43,
11727                                                 0x41, 0x4C, 0x4C, 0x20, 0x33 };
11728
11729 static unsigned char setup_call_461[] = { 0xD0, 0x38, 0x81, 0x03, 0x01, 0x10,
11730                                                 0x00, 0x82, 0x02, 0x81, 0x83,
11731                                                 0x85, 0x0E, 0x43, 0x4F, 0x4E,
11732                                                 0x46, 0x49, 0x52, 0x4D, 0x41,
11733                                                 0x54, 0x49, 0x4F, 0x4E, 0x20,
11734                                                 0x31, 0x86, 0x09, 0x91, 0x10,
11735                                                 0x32, 0x04, 0x21, 0x43, 0x65,
11736                                                 0x1C, 0x2C, 0x85, 0x06, 0x43,
11737                                                 0x41, 0x4C, 0x4C, 0x20, 0x31,
11738                                                 0xD0, 0x04, 0x00, 0x0E, 0x10,
11739                                                 0xB4, 0xD0, 0x04, 0x00, 0x06,
11740                                                 0x10, 0xB4 };
11741
11742 static unsigned char setup_call_462[] = { 0xD0, 0x38, 0x81, 0x03, 0x01, 0x10,
11743                                                 0x00, 0x82, 0x02, 0x81, 0x83,
11744                                                 0x85, 0x0E, 0x43, 0x4F, 0x4E,
11745                                                 0x46, 0x49, 0x52, 0x4D, 0x41,
11746                                                 0x54, 0x49, 0x4F, 0x4E, 0x20,
11747                                                 0x32, 0x86, 0x09, 0x91, 0x10,
11748                                                 0x32, 0x04, 0x21, 0x43, 0x65,
11749                                                 0x1C, 0x2C, 0x85, 0x06, 0x43,
11750                                                 0x41, 0x4C, 0x4C, 0x20, 0x32,
11751                                                 0xD0, 0x04, 0x00, 0x0E, 0x00,
11752                                                 0xB4, 0xD0, 0x04, 0x00, 0x06,
11753                                                 0x00, 0xB4 };
11754
11755 static unsigned char setup_call_463[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x10,
11756                                                 0x00, 0x82, 0x02, 0x81, 0x83,
11757                                                 0x85, 0x0E, 0x43, 0x4F, 0x4E,
11758                                                 0x46, 0x49, 0x52, 0x4D, 0x41,
11759                                                 0x54, 0x49, 0x4F, 0x4E, 0x20,
11760                                                 0x33, 0x86, 0x09, 0x91, 0x10,
11761                                                 0x32, 0x04, 0x21, 0x43, 0x65,
11762                                                 0x1C, 0x2C, 0x85, 0x06, 0x43,
11763                                                 0x41, 0x4C, 0x4C, 0x20, 0x33 };
11764
11765 static unsigned char setup_call_471[] = { 0xD0, 0x38, 0x81, 0x03, 0x01, 0x10,
11766                                                 0x00, 0x82, 0x02, 0x81, 0x83,
11767                                                 0x85, 0x0E, 0x43, 0x4F, 0x4E,
11768                                                 0x46, 0x49, 0x52, 0x4D, 0x41,
11769                                                 0x54, 0x49, 0x4F, 0x4E, 0x20,
11770                                                 0x31, 0x86, 0x09, 0x91, 0x10,
11771                                                 0x32, 0x04, 0x21, 0x43, 0x65,
11772                                                 0x1C, 0x2C, 0x85, 0x06, 0x43,
11773                                                 0x41, 0x4C, 0x4C, 0x20, 0x31,
11774                                                 0xD0, 0x04, 0x00, 0x0E, 0x20,
11775                                                 0xB4, 0xD0, 0x04, 0x00, 0x06,
11776                                                 0x20, 0xB4 };
11777
11778 static unsigned char setup_call_472[] = { 0xD0, 0x38, 0x81, 0x03, 0x01, 0x10,
11779                                                 0x00, 0x82, 0x02, 0x81, 0x83,
11780                                                 0x85, 0x0E, 0x43, 0x4F, 0x4E,
11781                                                 0x46, 0x49, 0x52, 0x4D, 0x41,
11782                                                 0x54, 0x49, 0x4F, 0x4E, 0x20,
11783                                                 0x32, 0x86, 0x09, 0x91, 0x10,
11784                                                 0x32, 0x04, 0x21, 0x43, 0x65,
11785                                                 0x1C, 0x2C, 0x85, 0x06, 0x43,
11786                                                 0x41, 0x4C, 0x4C, 0x20, 0x32,
11787                                                 0xD0, 0x04, 0x00, 0x0E, 0x00,
11788                                                 0xB4, 0xD0, 0x04, 0x00, 0x06,
11789                                                 0x00, 0xB4 };
11790
11791 static unsigned char setup_call_473[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x10,
11792                                                 0x00, 0x82, 0x02, 0x81, 0x83,
11793                                                 0x85, 0x0E, 0x43, 0x4F, 0x4E,
11794                                                 0x46, 0x49, 0x52, 0x4D, 0x41,
11795                                                 0x54, 0x49, 0x4F, 0x4E, 0x20,
11796                                                 0x33, 0x86, 0x09, 0x91, 0x10,
11797                                                 0x32, 0x04, 0x21, 0x43, 0x65,
11798                                                 0x1C, 0x2C, 0x85, 0x06, 0x43,
11799                                                 0x41, 0x4C, 0x4C, 0x20, 0x33 };
11800
11801 static unsigned char setup_call_481[] = { 0xD0, 0x38, 0x81, 0x03, 0x01, 0x10,
11802                                                 0x00, 0x82, 0x02, 0x81, 0x83,
11803                                                 0x85, 0x0E, 0x43, 0x4F, 0x4E,
11804                                                 0x46, 0x49, 0x52, 0x4D, 0x41,
11805                                                 0x54, 0x49, 0x4F, 0x4E, 0x20,
11806                                                 0x31, 0x86, 0x09, 0x91, 0x10,
11807                                                 0x32, 0x04, 0x21, 0x43, 0x65,
11808                                                 0x1C, 0x2C, 0x85, 0x06, 0x43,
11809                                                 0x41, 0x4C, 0x4C, 0x20, 0x31,
11810                                                 0xD0, 0x04, 0x00, 0x0E, 0x40,
11811                                                 0xB4, 0xD0, 0x04, 0x00, 0x06,
11812                                                 0x40, 0xB4 };
11813
11814 static unsigned char setup_call_482[] = { 0xD0, 0x38, 0x81, 0x03, 0x01, 0x10,
11815                                                 0x00, 0x82, 0x02, 0x81, 0x83,
11816                                                 0x85, 0x0E, 0x43, 0x4F, 0x4E,
11817                                                 0x46, 0x49, 0x52, 0x4D, 0x41,
11818                                                 0x54, 0x49, 0x4F, 0x4E, 0x20,
11819                                                 0x32, 0x86, 0x09, 0x91, 0x10,
11820                                                 0x32, 0x04, 0x21, 0x43, 0x65,
11821                                                 0x1C, 0x2C, 0x85, 0x06, 0x43,
11822                                                 0x41, 0x4C, 0x4C, 0x20, 0x32,
11823                                                 0xD0, 0x04, 0x00, 0x0E, 0x00,
11824                                                 0xB4, 0xD0, 0x04, 0x00, 0x06,
11825                                                 0x00, 0xB4 };
11826
11827 static unsigned char setup_call_483[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x10,
11828                                                 0x00, 0x82, 0x02, 0x81, 0x83,
11829                                                 0x85, 0x0E, 0x43, 0x4F, 0x4E,
11830                                                 0x46, 0x49, 0x52, 0x4D, 0x41,
11831                                                 0x54, 0x49, 0x4F, 0x4E, 0x20,
11832                                                 0x33, 0x86, 0x09, 0x91, 0x10,
11833                                                 0x32, 0x04, 0x21, 0x43, 0x65,
11834                                                 0x1C, 0x2C, 0x85, 0x06, 0x43,
11835                                                 0x41, 0x4C, 0x4C, 0x20, 0x33 };
11836
11837 static unsigned char setup_call_491[] = { 0xD0, 0x38, 0x81, 0x03, 0x01, 0x10,
11838                                                 0x00, 0x82, 0x02, 0x81, 0x83,
11839                                                 0x85, 0x0E, 0x43, 0x4F, 0x4E,
11840                                                 0x46, 0x49, 0x52, 0x4D, 0x41,
11841                                                 0x54, 0x49, 0x4F, 0x4E, 0x20,
11842                                                 0x31, 0x86, 0x09, 0x91, 0x10,
11843                                                 0x32, 0x04, 0x21, 0x43, 0x65,
11844                                                 0x1C, 0x2C, 0x85, 0x06, 0x43,
11845                                                 0x41, 0x4C, 0x4C, 0x20, 0x31,
11846                                                 0xD0, 0x04, 0x00, 0x0E, 0x80,
11847                                                 0xB4, 0xD0, 0x04, 0x00, 0x06,
11848                                                 0x80, 0xB4 };
11849
11850 static unsigned char setup_call_492[] = { 0xD0, 0x38, 0x81, 0x03, 0x01, 0x10,
11851                                                 0x00, 0x82, 0x02, 0x81, 0x83,
11852                                                 0x85, 0x0E, 0x43, 0x4F, 0x4E,
11853                                                 0x46, 0x49, 0x52, 0x4D, 0x41,
11854                                                 0x54, 0x49, 0x4F, 0x4E, 0x20,
11855                                                 0x32, 0x86, 0x09, 0x91, 0x10,
11856                                                 0x32, 0x04, 0x21, 0x43, 0x65,
11857                                                 0x1C, 0x2C, 0x85, 0x06, 0x43,
11858                                                 0x41, 0x4C, 0x4C, 0x20, 0x32,
11859                                                 0xD0, 0x04, 0x00, 0x0E, 0x00,
11860                                                 0xB4, 0xD0, 0x04, 0x00, 0x06,
11861                                                 0x00, 0xB4 };
11862
11863 static unsigned char setup_call_493[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x10,
11864                                                 0x00, 0x82, 0x02, 0x81, 0x83,
11865                                                 0x85, 0x0E, 0x43, 0x4F, 0x4E,
11866                                                 0x46, 0x49, 0x52, 0x4D, 0x41,
11867                                                 0x54, 0x49, 0x4F, 0x4E, 0x20,
11868                                                 0x33, 0x86, 0x09, 0x91, 0x10,
11869                                                 0x32, 0x04, 0x21, 0x43, 0x65,
11870                                                 0x1C, 0x2C, 0x85, 0x06, 0x43,
11871                                                 0x41, 0x4C, 0x4C, 0x20, 0x33 };
11872
11873 static unsigned char setup_call_4101[] = { 0xD0, 0x38, 0x81, 0x03, 0x01, 0x10,
11874                                                 0x00, 0x82, 0x02, 0x81, 0x83,
11875                                                 0x85, 0x0E, 0x43, 0x4F, 0x4E,
11876                                                 0x46, 0x49, 0x52, 0x4D, 0x41,
11877                                                 0x54, 0x49, 0x4F, 0x4E, 0x20,
11878                                                 0x31, 0x86, 0x09, 0x91, 0x10,
11879                                                 0x32, 0x04, 0x21, 0x43, 0x65,
11880                                                 0x1C, 0x2C, 0x85, 0x06, 0x43,
11881                                                 0x41, 0x4C, 0x4C, 0x20, 0x31,
11882                                                 0xD0, 0x04, 0x00, 0x0E, 0x00,
11883                                                 0xB4, 0xD0, 0x04, 0x00, 0x06,
11884                                                 0x00, 0x4B };
11885
11886 static unsigned char setup_call_4102[] = { 0xD0, 0x2C, 0x81, 0x03, 0x01, 0x10,
11887                                                 0x00, 0x82, 0x02, 0x81, 0x83,
11888                                                 0x85, 0x0E, 0x43, 0x4F, 0x4E,
11889                                                 0x46, 0x49, 0x52, 0x4D, 0x41,
11890                                                 0x54, 0x49, 0x4F, 0x4E, 0x20,
11891                                                 0x32, 0x86, 0x09, 0x91, 0x10,
11892                                                 0x32, 0x04, 0x21, 0x43, 0x65,
11893                                                 0x1C, 0x2C, 0x85, 0x06, 0x43,
11894                                                 0x41, 0x4C, 0x4C, 0x20, 0x32 };
11895
11896 static unsigned char setup_call_511[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01, 0x10,
11897                                                 0x00, 0x82, 0x02, 0x81, 0x83,
11898                                                 0x85, 0x19, 0x80, 0x04, 0x17,
11899                                                 0x04, 0x14, 0x04, 0x20, 0x04,
11900                                                 0x10, 0x04, 0x12, 0x04, 0x21,
11901                                                 0x04, 0x22, 0x04, 0x12, 0x04,
11902                                                 0x23, 0x04, 0x19, 0x04, 0x22,
11903                                                 0x04, 0x15, 0x86, 0x07, 0x91,
11904                                                 0x10, 0x32, 0x04, 0x21, 0x43,
11905                                                 0x65 };
11906
11907 static unsigned char setup_call_521[] = { 0xD0, 0x4C, 0x81, 0x03, 0x01, 0x10,
11908                                                 0x00, 0x82, 0x02, 0x81, 0x83,
11909                                                 0x85, 0x1B, 0x80, 0x04, 0x17,
11910                                                 0x04, 0x14, 0x04, 0x20, 0x04,
11911                                                 0x10, 0x04, 0x12, 0x04, 0x21,
11912                                                 0x04, 0x22, 0x04, 0x12, 0x04,
11913                                                 0x23, 0x04, 0x19, 0x04, 0x22,
11914                                                 0x04, 0x15, 0x00, 0x31, 0x86,
11915                                                 0x07, 0x91, 0x10, 0x32, 0x04,
11916                                                 0x21, 0x43, 0x65, 0x85, 0x1B,
11917                                                 0x80, 0x04, 0x17, 0x04, 0x14,
11918                                                 0x04, 0x20, 0x04, 0x10, 0x04,
11919                                                 0x12, 0x04, 0x21, 0x04, 0x22,
11920                                                 0x04, 0x12, 0x04, 0x23, 0x04,
11921                                                 0x19, 0x04, 0x22, 0x04, 0x15,
11922                                                 0x00, 0x32 };
11923
11924 static unsigned char setup_call_611[] = { 0xD0, 0x19, 0x81, 0x03, 0x01, 0x10,
11925                                                 0x00, 0x82, 0x02, 0x81, 0x83,
11926                                                 0x85, 0x05, 0x80, 0x4E, 0x0D,
11927                                                 0x5F, 0xD9, 0x86, 0x07, 0x91,
11928                                                 0x10, 0x32, 0x04, 0x21, 0x43,
11929                                                 0x65 };
11930
11931 static unsigned char setup_call_621[] = { 0xD0, 0x22, 0x81, 0x03, 0x01, 0x10,
11932                                                 0x00, 0x82, 0x02, 0x81, 0x83,
11933                                                 0x85, 0x05, 0x80, 0x78, 0x6E,
11934                                                 0x5B, 0x9A, 0x86, 0x07, 0x91,
11935                                                 0x10, 0x32, 0x04, 0x21, 0x43,
11936                                                 0x65, 0x85, 0x07, 0x80, 0x62,
11937                                                 0x53, 0x75, 0x35, 0x8B, 0xDD };
11938
11939 static unsigned char setup_call_711[] = { 0xD0, 0x17, 0x81, 0x03, 0x01, 0x10,
11940                                                 0x00, 0x82, 0x02, 0x81, 0x83,
11941                                                 0x85, 0x03, 0x80, 0x30, 0xEB,
11942                                                 0x86, 0x07, 0x91, 0x10, 0x32,
11943                                                 0x04, 0x21, 0x43, 0x65 };
11944
11945 static unsigned char setup_call_721[] = { 0xD0, 0x20, 0x81, 0x03, 0x01, 0x10,
11946                                                 0x00, 0x82, 0x02, 0x81, 0x83,
11947                                                 0x85, 0x05, 0x80, 0x30, 0xEB,
11948                                                 0x00, 0x31, 0x86, 0x07, 0x91,
11949                                                 0x10, 0x32, 0x04, 0x21, 0x43,
11950                                                 0x65, 0x85, 0x05, 0x80, 0x30,
11951                                                 0xEB, 0x00, 0x32 };
11952
11953 static struct setup_call_test setup_call_data_111 = {
11954         .pdu = setup_call_111,
11955         .pdu_len = sizeof(setup_call_111),
11956         .qualifier = 0x00,
11957         .alpha_id_usr_cfm = "Not busy",
11958         .addr = {
11959                 .ton_npi = 0x91,
11960                 .number = "012340123456c1c2"
11961         }
11962 };
11963
11964 static struct setup_call_test setup_call_data_141 = {
11965         .pdu = setup_call_141,
11966         .pdu_len = sizeof(setup_call_141),
11967         .qualifier = 0x02,
11968         .alpha_id_usr_cfm = "On hold",
11969         .addr = {
11970                 .ton_npi = 0x91,
11971                 .number = "012340123456c1c2"
11972         }
11973 };
11974
11975 static struct setup_call_test setup_call_data_151 = {
11976         .pdu = setup_call_151,
11977         .pdu_len = sizeof(setup_call_151),
11978         .qualifier = 0x04,
11979         .alpha_id_usr_cfm = "Disconnect",
11980         .addr = {
11981                 .ton_npi = 0x91,
11982                 .number = "012340123456c1c2"
11983         }
11984 };
11985
11986 static struct setup_call_test setup_call_data_181 = {
11987         .pdu = setup_call_181,
11988         .pdu_len = sizeof(setup_call_181),
11989         .qualifier = 0x00,
11990         .alpha_id_usr_cfm = "Capability config",
11991         .addr = {
11992                 .ton_npi = 0x91,
11993                 .number = "012340123456c1c2"
11994         },
11995         .ccp = {
11996                 .len = 0x02,
11997                 .ccp = { 0x01, 0xA0 }
11998         }
11999 };
12000
12001 static struct setup_call_test setup_call_data_191 = {
12002         .pdu = setup_call_191,
12003         .pdu_len = sizeof(setup_call_191),
12004         .qualifier = 0x01,
12005         .addr = {
12006                 .ton_npi = 0x91,
12007                 .number = "01234567890123456789012345678901"
12008         }
12009 };
12010
12011 static struct setup_call_test setup_call_data_1101 = {
12012         .pdu = setup_call_1101,
12013         .pdu_len = sizeof(setup_call_1101),
12014         .qualifier = 0x01,
12015         .alpha_id_usr_cfm = "Three types are defined: - set up a call, but "
12016                         "only if not currently busy on another call; - set "
12017                         "up a call, putting all other calls (if any) on hold; "
12018                         "- set up a call, disconnecting all other calls (if "
12019                         "any) first. For each of these types, ",
12020         .addr = {
12021                 .ton_npi = 0x91,
12022                 .number = "01"
12023         }
12024 };
12025
12026 static struct setup_call_test setup_call_data_1111 = {
12027         .pdu = setup_call_1111,
12028         .pdu_len = sizeof(setup_call_1111),
12029         .qualifier = 0x00,
12030         .alpha_id_usr_cfm = "Called party",
12031         .addr = {
12032                 .ton_npi = 0x91,
12033                 .number = "012340123456c1c2"
12034         },
12035         .subaddr = {
12036                 .len = 0x07,
12037                 .subaddr = { 0x80, 0x50, 0x95, 0x95, 0x95, 0x95, 0x95 }
12038         }
12039 };
12040
12041 static struct setup_call_test setup_call_data_1121 = {
12042         .pdu = setup_call_1121,
12043         .pdu_len = sizeof(setup_call_1121),
12044         .qualifier = 0x01,
12045         .alpha_id_usr_cfm = "Duration",
12046         .addr = {
12047                 .ton_npi = 0x91,
12048                 .number = "012340123456c1c2"
12049         },
12050         .duration = {
12051                 .unit = STK_DURATION_TYPE_SECONDS,
12052                 .interval = 10,
12053         }
12054 };
12055
12056 static struct setup_call_test setup_call_data_211 = {
12057         .pdu = setup_call_211,
12058         .pdu_len = sizeof(setup_call_211),
12059         .qualifier = 0x00,
12060         .alpha_id_usr_cfm = "CONFIRMATION",
12061         .addr = {
12062                 .ton_npi = 0x91,
12063                 .number = "012340123456c1c2"
12064         },
12065         .alpha_id_call_setup = "CALL"
12066 };
12067
12068 static struct setup_call_test setup_call_data_311 = {
12069         .pdu = setup_call_311,
12070         .pdu_len = sizeof(setup_call_311),
12071         .qualifier = 0x00,
12072         .alpha_id_usr_cfm = "Set up call Icon 3.1.1",
12073         .addr = {
12074                 .ton_npi = 0x91,
12075                 .number = "012340123456c1c2"
12076         },
12077         .icon_id_usr_cfm = {
12078                 .qualifier = STK_ICON_QUALIFIER_TYPE_NON_SELF_EXPLANATORY,
12079                 .id = 0x01
12080         }
12081 };
12082
12083 static struct setup_call_test setup_call_data_321 = {
12084         .pdu = setup_call_321,
12085         .pdu_len = sizeof(setup_call_321),
12086         .qualifier = 0x00,
12087         .alpha_id_usr_cfm = "Set up call Icon 3.2.1",
12088         .addr = {
12089                 .ton_npi = 0x91,
12090                 .number = "012340123456c1c2"
12091         },
12092         .icon_id_usr_cfm = {
12093                 .qualifier = STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY,
12094                 .id = 0x01
12095         }
12096 };
12097
12098 static struct setup_call_test setup_call_data_331 = {
12099         .pdu = setup_call_331,
12100         .pdu_len = sizeof(setup_call_331),
12101         .qualifier = 0x00,
12102         .alpha_id_usr_cfm = "Set up call Icon 3.3.1",
12103         .addr = {
12104                 .ton_npi = 0x91,
12105                 .number = "012340123456c1c2"
12106         },
12107         .icon_id_usr_cfm = {
12108                 .qualifier = STK_ICON_QUALIFIER_TYPE_NON_SELF_EXPLANATORY,
12109                 .id = 0x02
12110         }
12111 };
12112
12113 static struct setup_call_test setup_call_data_341 = {
12114         .pdu = setup_call_341,
12115         .pdu_len = sizeof(setup_call_341),
12116         .qualifier = 0x00,
12117         .alpha_id_usr_cfm = "Set up call Icon 3.4.1",
12118         .addr = {
12119                 .ton_npi = 0x91,
12120                 .number = "012340123456c1c2"
12121         },
12122         .icon_id_usr_cfm = {
12123                 .qualifier = STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY,
12124                 .id = 0x01
12125         },
12126         .alpha_id_call_setup = "Set up call Icon 3.4.2",
12127         .icon_id_call_setup = {
12128                 .qualifier = STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY,
12129                 .id = 0x01
12130         }
12131 };
12132
12133 static struct setup_call_test setup_call_data_411 = {
12134         .pdu = setup_call_411,
12135         .pdu_len = sizeof(setup_call_411),
12136         .qualifier = 0x00,
12137         .alpha_id_usr_cfm = "CONFIRMATION 1",
12138         .addr = {
12139                 .ton_npi = 0x91,
12140                 .number = "012340123456c1c2"
12141         },
12142         .alpha_id_call_setup = "CALL 1",
12143         .text_attr_usr_cfm = {
12144                 .len = 4,
12145                 .attributes = { 0x00, 0x0E, 0x00, 0xB4 }
12146         },
12147         .text_attr_call_setup = {
12148                 .len = 4,
12149                 .attributes = { 0x00, 0x06, 0x00, 0xB4 }
12150         }
12151 };
12152
12153 static struct setup_call_test setup_call_data_412 = {
12154         .pdu = setup_call_412,
12155         .pdu_len = sizeof(setup_call_412),
12156         .qualifier = 0x00,
12157         .alpha_id_usr_cfm = "CONFIRMATION 2",
12158         .addr = {
12159                 .ton_npi = 0x91,
12160                 .number = "012340123456c1c2"
12161         },
12162         .alpha_id_call_setup = "CALL 2"
12163 };
12164
12165 static struct setup_call_test setup_call_data_421 = {
12166         .pdu = setup_call_421,
12167         .pdu_len = sizeof(setup_call_421),
12168         .qualifier = 0x00,
12169         .alpha_id_usr_cfm = "CONFIRMATION 1",
12170         .addr = {
12171                 .ton_npi = 0x91,
12172                 .number = "012340123456c1c2"
12173         },
12174         .alpha_id_call_setup = "CALL 1",
12175         .text_attr_usr_cfm = {
12176                 .len = 4,
12177                 .attributes = { 0x00, 0x0E, 0x01, 0xB4 }
12178         },
12179         .text_attr_call_setup = {
12180                 .len = 4,
12181                 .attributes = { 0x00, 0x06, 0x01, 0xB4 }
12182         }
12183 };
12184
12185 static struct setup_call_test setup_call_data_422 = {
12186         .pdu = setup_call_422,
12187         .pdu_len = sizeof(setup_call_422),
12188         .qualifier = 0x00,
12189         .alpha_id_usr_cfm = "CONFIRMATION 2",
12190         .addr = {
12191                 .ton_npi = 0x91,
12192                 .number = "012340123456c1c2"
12193         },
12194         .alpha_id_call_setup = "CALL 2"
12195 };
12196
12197 static struct setup_call_test setup_call_data_431 = {
12198         .pdu = setup_call_431,
12199         .pdu_len = sizeof(setup_call_431),
12200         .qualifier = 0x00,
12201         .alpha_id_usr_cfm = "CONFIRMATION 1",
12202         .addr = {
12203                 .ton_npi = 0x91,
12204                 .number = "012340123456c1c2"
12205         },
12206         .alpha_id_call_setup = "CALL 1",
12207         .text_attr_usr_cfm = {
12208                 .len = 4,
12209                 .attributes = { 0x00, 0x0E, 0x02, 0xB4 }
12210         },
12211         .text_attr_call_setup = {
12212                 .len = 4,
12213                 .attributes = { 0x00, 0x06, 0x02, 0xB4 }
12214         }
12215 };
12216
12217 static struct setup_call_test setup_call_data_432 = {
12218         .pdu = setup_call_432,
12219         .pdu_len = sizeof(setup_call_432),
12220         .qualifier = 0x00,
12221         .alpha_id_usr_cfm = "CONFIRMATION 2",
12222         .addr = {
12223                 .ton_npi = 0x91,
12224                 .number = "012340123456c1c2"
12225         },
12226         .alpha_id_call_setup = "CALL 2"
12227 };
12228
12229 static struct setup_call_test setup_call_data_441 = {
12230         .pdu = setup_call_441,
12231         .pdu_len = sizeof(setup_call_441),
12232         .qualifier = 0x00,
12233         .alpha_id_usr_cfm = "CONFIRMATION 1",
12234         .addr = {
12235                 .ton_npi = 0x91,
12236                 .number = "012340123456c1c2"
12237         },
12238         .alpha_id_call_setup = "CALL 1",
12239         .text_attr_usr_cfm = {
12240                 .len = 4,
12241                 .attributes = { 0x00, 0x0E, 0x04, 0xB4 }
12242         },
12243         .text_attr_call_setup = {
12244                 .len = 4,
12245                 .attributes = { 0x00, 0x06, 0x04, 0xB4 }
12246         }
12247 };
12248
12249 static struct setup_call_test setup_call_data_442 = {
12250         .pdu = setup_call_442,
12251         .pdu_len = sizeof(setup_call_442),
12252         .qualifier = 0x00,
12253         .alpha_id_usr_cfm = "CONFIRMATION 2",
12254         .addr = {
12255                 .ton_npi = 0x91,
12256                 .number = "012340123456c1c2"
12257         },
12258         .alpha_id_call_setup = "CALL 2",
12259         .text_attr_usr_cfm = {
12260                 .len = 4,
12261                 .attributes = { 0x00, 0x0E, 0x00, 0xB4 }
12262         },
12263         .text_attr_call_setup = {
12264                 .len = 4,
12265                 .attributes = { 0x00, 0x06, 0x00, 0xB4 }
12266         }
12267 };
12268
12269 static struct setup_call_test setup_call_data_443 = {
12270         .pdu = setup_call_443,
12271         .pdu_len = sizeof(setup_call_443),
12272         .qualifier = 0x00,
12273         .alpha_id_usr_cfm = "CONFIRMATION 3",
12274         .addr = {
12275                 .ton_npi = 0x91,
12276                 .number = "012340123456c1c2"
12277         },
12278         .alpha_id_call_setup = "CALL 3"
12279 };
12280
12281 static struct setup_call_test setup_call_data_451 = {
12282         .pdu = setup_call_451,
12283         .pdu_len = sizeof(setup_call_451),
12284         .qualifier = 0x00,
12285         .alpha_id_usr_cfm = "CONFIRMATION 1",
12286         .addr = {
12287                 .ton_npi = 0x91,
12288                 .number = "012340123456c1c2"
12289         },
12290         .alpha_id_call_setup = "CALL 1",
12291         .text_attr_usr_cfm = {
12292                 .len = 4,
12293                 .attributes = { 0x00, 0x0E, 0x08, 0xB4 }
12294         },
12295         .text_attr_call_setup = {
12296                 .len = 4,
12297                 .attributes = { 0x00, 0x06, 0x08, 0xB4 }
12298         }
12299 };
12300
12301 static struct setup_call_test setup_call_data_452 = {
12302         .pdu = setup_call_452,
12303         .pdu_len = sizeof(setup_call_452),
12304         .qualifier = 0x00,
12305         .alpha_id_usr_cfm = "CONFIRMATION 2",
12306         .addr = {
12307                 .ton_npi = 0x91,
12308                 .number = "012340123456c1c2"
12309         },
12310         .alpha_id_call_setup = "CALL 2",
12311         .text_attr_usr_cfm = {
12312                 .len = 4,
12313                 .attributes = { 0x00, 0x0E, 0x00, 0xB4 }
12314         },
12315         .text_attr_call_setup = {
12316                 .len = 4,
12317                 .attributes = { 0x00, 0x06, 0x00, 0xB4 }
12318         }
12319 };
12320
12321 static struct setup_call_test setup_call_data_453 = {
12322         .pdu = setup_call_453,
12323         .pdu_len = sizeof(setup_call_453),
12324         .qualifier = 0x00,
12325         .alpha_id_usr_cfm = "CONFIRMATION 3",
12326         .addr = {
12327                 .ton_npi = 0x91,
12328                 .number = "012340123456c1c2"
12329         },
12330         .alpha_id_call_setup = "CALL 3"
12331 };
12332
12333 static struct setup_call_test setup_call_data_461 = {
12334         .pdu = setup_call_461,
12335         .pdu_len = sizeof(setup_call_461),
12336         .qualifier = 0x00,
12337         .alpha_id_usr_cfm = "CONFIRMATION 1",
12338         .addr = {
12339                 .ton_npi = 0x91,
12340                 .number = "012340123456c1c2"
12341         },
12342         .alpha_id_call_setup = "CALL 1",
12343         .text_attr_usr_cfm = {
12344                 .len = 4,
12345                 .attributes = { 0x00, 0x0E, 0x10, 0xB4 }
12346         },
12347         .text_attr_call_setup = {
12348                 .len = 4,
12349                 .attributes = { 0x00, 0x06, 0x10, 0xB4 }
12350         }
12351 };
12352
12353 static struct setup_call_test setup_call_data_462 = {
12354         .pdu = setup_call_462,
12355         .pdu_len = sizeof(setup_call_462),
12356         .qualifier = 0x00,
12357         .alpha_id_usr_cfm = "CONFIRMATION 2",
12358         .addr = {
12359                 .ton_npi = 0x91,
12360                 .number = "012340123456c1c2"
12361         },
12362         .alpha_id_call_setup = "CALL 2",
12363         .text_attr_usr_cfm = {
12364                 .len = 4,
12365                 .attributes = { 0x00, 0x0E, 0x00, 0xB4 }
12366         },
12367         .text_attr_call_setup = {
12368                 .len = 4,
12369                 .attributes = { 0x00, 0x06, 0x00, 0xB4 }
12370         }
12371 };
12372
12373 static struct setup_call_test setup_call_data_463 = {
12374         .pdu = setup_call_463,
12375         .pdu_len = sizeof(setup_call_463),
12376         .qualifier = 0x00,
12377         .alpha_id_usr_cfm = "CONFIRMATION 3",
12378         .addr = {
12379                 .ton_npi = 0x91,
12380                 .number = "012340123456c1c2"
12381         },
12382         .alpha_id_call_setup = "CALL 3"
12383 };
12384
12385 static struct setup_call_test setup_call_data_471 = {
12386         .pdu = setup_call_471,
12387         .pdu_len = sizeof(setup_call_471),
12388         .qualifier = 0x00,
12389         .alpha_id_usr_cfm = "CONFIRMATION 1",
12390         .addr = {
12391                 .ton_npi = 0x91,
12392                 .number = "012340123456c1c2"
12393         },
12394         .alpha_id_call_setup = "CALL 1",
12395         .text_attr_usr_cfm = {
12396                 .len = 4,
12397                 .attributes = { 0x00, 0x0E, 0x20, 0xB4 }
12398         },
12399         .text_attr_call_setup = {
12400                 .len = 4,
12401                 .attributes = { 0x00, 0x06, 0x20, 0xB4 }
12402         }
12403 };
12404
12405 static struct setup_call_test setup_call_data_472 = {
12406         .pdu = setup_call_472,
12407         .pdu_len = sizeof(setup_call_472),
12408         .qualifier = 0x00,
12409         .alpha_id_usr_cfm = "CONFIRMATION 2",
12410         .addr = {
12411                 .ton_npi = 0x91,
12412                 .number = "012340123456c1c2"
12413         },
12414         .alpha_id_call_setup = "CALL 2",
12415         .text_attr_usr_cfm = {
12416                 .len = 4,
12417                 .attributes = { 0x00, 0x0E, 0x00, 0xB4 }
12418         },
12419         .text_attr_call_setup = {
12420                 .len = 4,
12421                 .attributes = { 0x00, 0x06, 0x00, 0xB4 }
12422         }
12423 };
12424
12425 static struct setup_call_test setup_call_data_473 = {
12426         .pdu = setup_call_473,
12427         .pdu_len = sizeof(setup_call_473),
12428         .qualifier = 0x00,
12429         .alpha_id_usr_cfm = "CONFIRMATION 3",
12430         .addr = {
12431                 .ton_npi = 0x91,
12432                 .number = "012340123456c1c2"
12433         },
12434         .alpha_id_call_setup = "CALL 3"
12435 };
12436
12437 static struct setup_call_test setup_call_data_481 = {
12438         .pdu = setup_call_481,
12439         .pdu_len = sizeof(setup_call_481),
12440         .qualifier = 0x00,
12441         .alpha_id_usr_cfm = "CONFIRMATION 1",
12442         .addr = {
12443                 .ton_npi = 0x91,
12444                 .number = "012340123456c1c2"
12445         },
12446         .alpha_id_call_setup = "CALL 1",
12447         .text_attr_usr_cfm = {
12448                 .len = 4,
12449                 .attributes = { 0x00, 0x0E, 0x40, 0xB4 }
12450         },
12451         .text_attr_call_setup = {
12452                 .len = 4,
12453                 .attributes = { 0x00, 0x06, 0x40, 0xB4 }
12454         }
12455 };
12456
12457 static struct setup_call_test setup_call_data_482 = {
12458         .pdu = setup_call_482,
12459         .pdu_len = sizeof(setup_call_482),
12460         .qualifier = 0x00,
12461         .alpha_id_usr_cfm = "CONFIRMATION 2",
12462         .addr = {
12463                 .ton_npi = 0x91,
12464                 .number = "012340123456c1c2"
12465         },
12466         .alpha_id_call_setup = "CALL 2",
12467         .text_attr_usr_cfm = {
12468                 .len = 4,
12469                 .attributes = { 0x00, 0x0E, 0x00, 0xB4 }
12470         },
12471         .text_attr_call_setup = {
12472                 .len = 4,
12473                 .attributes = { 0x00, 0x06, 0x00, 0xB4 }
12474         }
12475 };
12476
12477 static struct setup_call_test setup_call_data_483 = {
12478         .pdu = setup_call_483,
12479         .pdu_len = sizeof(setup_call_483),
12480         .qualifier = 0x00,
12481         .alpha_id_usr_cfm = "CONFIRMATION 3",
12482         .addr = {
12483                 .ton_npi = 0x91,
12484                 .number = "012340123456c1c2"
12485         },
12486         .alpha_id_call_setup = "CALL 3"
12487 };
12488
12489 static struct setup_call_test setup_call_data_491 = {
12490         .pdu = setup_call_491,
12491         .pdu_len = sizeof(setup_call_491),
12492         .qualifier = 0x00,
12493         .alpha_id_usr_cfm = "CONFIRMATION 1",
12494         .addr = {
12495                 .ton_npi = 0x91,
12496                 .number = "012340123456c1c2"
12497         },
12498         .alpha_id_call_setup = "CALL 1",
12499         .text_attr_usr_cfm = {
12500                 .len = 4,
12501                 .attributes = { 0x00, 0x0E, 0x80, 0xB4 }
12502         },
12503         .text_attr_call_setup = {
12504                 .len = 4,
12505                 .attributes = { 0x00, 0x06, 0x80, 0xB4 }
12506         }
12507 };
12508
12509 static struct setup_call_test setup_call_data_492 = {
12510         .pdu = setup_call_492,
12511         .pdu_len = sizeof(setup_call_492),
12512         .qualifier = 0x00,
12513         .alpha_id_usr_cfm = "CONFIRMATION 2",
12514         .addr = {
12515                 .ton_npi = 0x91,
12516                 .number = "012340123456c1c2"
12517         },
12518         .alpha_id_call_setup = "CALL 2",
12519         .text_attr_usr_cfm = {
12520                 .len = 4,
12521                 .attributes = { 0x00, 0x0E, 0x00, 0xB4 }
12522         },
12523         .text_attr_call_setup = {
12524                 .len = 4,
12525                 .attributes = { 0x00, 0x06, 0x00, 0xB4 }
12526         }
12527 };
12528
12529 static struct setup_call_test setup_call_data_493 = {
12530         .pdu = setup_call_493,
12531         .pdu_len = sizeof(setup_call_493),
12532         .qualifier = 0x00,
12533         .alpha_id_usr_cfm = "CONFIRMATION 3",
12534         .addr = {
12535                 .ton_npi = 0x91,
12536                 .number = "012340123456c1c2"
12537         },
12538         .alpha_id_call_setup = "CALL 3"
12539 };
12540
12541 static struct setup_call_test setup_call_data_4101 = {
12542         .pdu = setup_call_4101,
12543         .pdu_len = sizeof(setup_call_4101),
12544         .qualifier = 0x00,
12545         .alpha_id_usr_cfm = "CONFIRMATION 1",
12546         .addr = {
12547                 .ton_npi = 0x91,
12548                 .number = "012340123456c1c2"
12549         },
12550         .alpha_id_call_setup = "CALL 1",
12551         .text_attr_usr_cfm = {
12552                 .len = 4,
12553                 .attributes = { 0x00, 0x0E, 0x00, 0xB4 }
12554         },
12555         .text_attr_call_setup = {
12556                 .len = 4,
12557                 .attributes = { 0x00, 0x06, 0x00, 0x4B }
12558         }
12559 };
12560
12561 static struct setup_call_test setup_call_data_4102 = {
12562         .pdu = setup_call_4102,
12563         .pdu_len = sizeof(setup_call_4102),
12564         .qualifier = 0x00,
12565         .alpha_id_usr_cfm = "CONFIRMATION 2",
12566         .addr = {
12567                 .ton_npi = 0x91,
12568                 .number = "012340123456c1c2"
12569         },
12570         .alpha_id_call_setup = "CALL 2"
12571 };
12572
12573 static struct setup_call_test setup_call_data_511 = {
12574         .pdu = setup_call_511,
12575         .pdu_len = sizeof(setup_call_511),
12576         .qualifier = 0x00,
12577         .alpha_id_usr_cfm = "ЗДРАВСТВУЙТЕ",
12578         .addr = {
12579                 .ton_npi = 0x91,
12580                 .number = "012340123456"
12581         }
12582 };
12583
12584 static struct setup_call_test setup_call_data_521 = {
12585         .pdu = setup_call_521,
12586         .pdu_len = sizeof(setup_call_521),
12587         .qualifier = 0x00,
12588         .alpha_id_usr_cfm = "ЗДРАВСТВУЙТЕ1",
12589         .addr = {
12590                 .ton_npi = 0x91,
12591                 .number = "012340123456"
12592         },
12593         .alpha_id_call_setup = "ЗДРАВСТВУЙТЕ2"
12594 };
12595
12596 static struct setup_call_test setup_call_data_611 = {
12597         .pdu = setup_call_611,
12598         .pdu_len = sizeof(setup_call_611),
12599         .qualifier = 0x00,
12600         .alpha_id_usr_cfm = "不忙",
12601         .addr = {
12602                 .ton_npi = 0x91,
12603                 .number = "012340123456"
12604         }
12605 };
12606
12607 static struct setup_call_test setup_call_data_621 = {
12608         .pdu = setup_call_621,
12609         .pdu_len = sizeof(setup_call_621),
12610         .qualifier = 0x00,
12611         .alpha_id_usr_cfm = "确定",
12612         .addr = {
12613                 .ton_npi = 0x91,
12614                 .number = "012340123456"
12615         },
12616         .alpha_id_call_setup = "打电话"
12617 };
12618
12619 static struct setup_call_test setup_call_data_711 = {
12620         .pdu = setup_call_711,
12621         .pdu_len = sizeof(setup_call_711),
12622         .qualifier = 0x00,
12623         .alpha_id_usr_cfm = "ル",
12624         .addr = {
12625                 .ton_npi = 0x91,
12626                 .number = "012340123456"
12627         }
12628 };
12629
12630 static struct setup_call_test setup_call_data_721 = {
12631         .pdu = setup_call_721,
12632         .pdu_len = sizeof(setup_call_721),
12633         .qualifier = 0x00,
12634         .alpha_id_usr_cfm = "ル1",
12635         .addr = {
12636                 .ton_npi = 0x91,
12637                 .number = "012340123456"
12638         },
12639         .alpha_id_call_setup = "ル2"
12640 };
12641
12642 static void test_setup_call(gconstpointer data)
12643 {
12644         const struct setup_call_test *test = data;
12645         struct stk_command *command;
12646
12647         command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
12648
12649         g_assert(command);
12650         g_assert(command->status == STK_PARSE_RESULT_OK);
12651
12652         g_assert(command->number == 1);
12653         g_assert(command->type == STK_COMMAND_TYPE_SETUP_CALL);
12654         g_assert(command->qualifier == test->qualifier);
12655
12656         g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
12657         g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_NETWORK);
12658
12659         check_alpha_id(command->setup_call.alpha_id_usr_cfm,
12660                                         test->alpha_id_usr_cfm);
12661         check_address(&command->setup_call.addr, &test->addr);
12662         check_ccp(&command->setup_call.ccp, &test->ccp);
12663         check_subaddress(&command->setup_call.subaddr, &test->subaddr);
12664         check_duration(&command->setup_call.duration, &test->duration);
12665         check_icon_id(&command->setup_call.icon_id_usr_cfm,
12666                                         &test->icon_id_usr_cfm);
12667         check_alpha_id(command->setup_call.alpha_id_call_setup,
12668                                         test->alpha_id_call_setup);
12669         check_icon_id(&command->setup_call.icon_id_call_setup,
12670                                         &test->icon_id_call_setup);
12671         check_text_attr(&command->setup_call.text_attr_usr_cfm,
12672                                         &test->text_attr_usr_cfm);
12673         check_text_attr(&command->setup_call.text_attr_call_setup,
12674                                         &test->text_attr_call_setup);
12675         check_frame_id(&command->setup_call.frame_id, &test->frame_id);
12676
12677         stk_command_free(command);
12678 }
12679
12680 struct refresh_test {
12681         const unsigned char *pdu;
12682         unsigned int pdu_len;
12683         unsigned char qualifier;
12684         struct stk_file file_list[MAX_ITEM];
12685         struct stk_aid aid;
12686         char *alpha_id;
12687         struct stk_icon_id icon_id;
12688         struct stk_text_attribute text_attr;
12689         struct stk_frame_id frame_id;
12690 };
12691
12692 static unsigned char refresh_121[] = { 0xD0, 0x10, 0x81, 0x03, 0x01, 0x01,
12693                                                 0x01, 0x82, 0x02, 0x81, 0x82,
12694                                                 0x92, 0x05, 0x01, 0x3F, 0x00,
12695                                                 0x2F, 0xE2 };
12696
12697 static unsigned char refresh_151[] = { 0xD0, 0x09, 0x81, 0x03, 0x01, 0x01,
12698                                                 0x04, 0x82, 0x02, 0x81, 0x82 };
12699
12700 static struct refresh_test refresh_data_121 = {
12701         .pdu = refresh_121,
12702         .pdu_len = sizeof(refresh_121),
12703         .qualifier = 0x01,
12704         .file_list = {{
12705                 .len = 4,
12706                 .file = { 0x3F, 0x00, 0x2F, 0xE2 }
12707         }}
12708 };
12709
12710 static struct refresh_test refresh_data_151 = {
12711         .pdu = refresh_151,
12712         .pdu_len = sizeof(refresh_151),
12713         .qualifier = 0x04
12714 };
12715
12716 /* Defined in TS 102.384 Section 27.22.4.7 */
12717 static void test_refresh(gconstpointer data)
12718 {
12719         const struct refresh_test *test = data;
12720         struct stk_command *command;
12721
12722         command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
12723
12724         g_assert(command);
12725         g_assert(command->status == STK_PARSE_RESULT_OK);
12726
12727         g_assert(command->number == 1);
12728         g_assert(command->type == STK_COMMAND_TYPE_REFRESH);
12729         g_assert(command->qualifier == test->qualifier);
12730
12731         g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
12732         g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_TERMINAL);
12733
12734         check_file_list(command->refresh.file_list, test->file_list);
12735         check_aid(&command->refresh.aid, &test->aid);
12736         check_alpha_id(command->refresh.alpha_id, test->alpha_id);
12737         check_icon_id(&command->refresh.icon_id, &test->icon_id);
12738         check_text_attr(&command->refresh.text_attr, &test->text_attr);
12739         check_frame_id(&command->refresh.frame_id, &test->frame_id);
12740
12741         stk_command_free(command);
12742 }
12743
12744 struct polling_off_test {
12745         const unsigned char *pdu;
12746         unsigned int pdu_len;
12747         unsigned char qualifier;
12748 };
12749
12750 static unsigned char polling_off_112[] = { 0xD0, 0x09, 0x81, 0x03, 0x01, 0x04,
12751                                                 0x00, 0x82, 0x02, 0x81, 0x82 };
12752
12753 static struct polling_off_test polling_off_data_112 = {
12754         .pdu = polling_off_112,
12755         .pdu_len = sizeof(polling_off_112),
12756         .qualifier = 0x00,
12757 };
12758
12759 static void test_polling_off(gconstpointer data)
12760 {
12761         const struct polling_off_test *test = data;
12762         struct stk_command *command;
12763
12764         command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
12765
12766         g_assert(command);
12767         g_assert(command->status == STK_PARSE_RESULT_OK);
12768
12769         g_assert(command->number == 1);
12770         g_assert(command->type == STK_COMMAND_TYPE_POLLING_OFF);
12771         g_assert(command->qualifier == test->qualifier);
12772
12773         g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
12774         g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_TERMINAL);
12775
12776         stk_command_free(command);
12777 }
12778
12779 struct provide_local_info_test {
12780         const unsigned char *pdu;
12781         unsigned int pdu_len;
12782         unsigned char qualifier;
12783 };
12784
12785 static unsigned char provide_local_info_121[] = { 0xD0, 0x09, 0x81, 0x03, 0x01,
12786                                                 0x26, 0x01, 0x82, 0x02, 0x81,
12787                                                 0x82 };
12788
12789 static unsigned char provide_local_info_141[] = { 0xD0, 0x09, 0x81, 0x03, 0x01,
12790                                                 0x26, 0x03, 0x82, 0x02, 0x81,
12791                                                 0x82 };
12792
12793 static unsigned char provide_local_info_151[] = { 0xD0, 0x09, 0x81, 0x03, 0x01,
12794                                                 0x26, 0x04, 0x82, 0x02, 0x81,
12795                                                 0x82 };
12796
12797 static unsigned char provide_local_info_181[] = { 0xD0, 0x09, 0x81, 0x03, 0x01,
12798                                                 0x26, 0x07, 0x82, 0x02, 0x81,
12799                                                 0x82 };
12800
12801 static unsigned char provide_local_info_191[] = { 0xD0, 0x09, 0x81, 0x03, 0x01,
12802                                                 0x26, 0x08, 0x82, 0x02, 0x81,
12803                                                 0x82 };
12804
12805 static unsigned char provide_local_info_1111[] = { 0xD0, 0x09, 0x81, 0x03, 0x01,
12806                                                 0x26, 0x0A, 0x82, 0x02, 0x81,
12807                                                 0x82 };
12808
12809 static struct provide_local_info_test provide_local_info_data_121 = {
12810         .pdu = provide_local_info_121,
12811         .pdu_len = sizeof(provide_local_info_121),
12812         .qualifier = 0x01
12813 };
12814
12815 static struct provide_local_info_test provide_local_info_data_141 = {
12816         .pdu = provide_local_info_141,
12817         .pdu_len = sizeof(provide_local_info_141),
12818         .qualifier = 0x03
12819 };
12820
12821 static struct provide_local_info_test provide_local_info_data_151 = {
12822         .pdu = provide_local_info_151,
12823         .pdu_len = sizeof(provide_local_info_151),
12824         .qualifier = 0x04
12825 };
12826
12827 static struct provide_local_info_test provide_local_info_data_181 = {
12828         .pdu = provide_local_info_181,
12829         .pdu_len = sizeof(provide_local_info_181),
12830         .qualifier = 0x07
12831 };
12832
12833 static struct provide_local_info_test provide_local_info_data_191 = {
12834         .pdu = provide_local_info_191,
12835         .pdu_len = sizeof(provide_local_info_191),
12836         .qualifier = 0x08
12837 };
12838
12839 static struct provide_local_info_test provide_local_info_data_1111 = {
12840         .pdu = provide_local_info_1111,
12841         .pdu_len = sizeof(provide_local_info_1111),
12842         .qualifier = 0x0A
12843 };
12844
12845 static void test_provide_local_info(gconstpointer data)
12846 {
12847         const struct provide_local_info_test *test = data;
12848         struct stk_command *command;
12849
12850         command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
12851
12852         g_assert(command);
12853         g_assert(command->status == STK_PARSE_RESULT_OK);
12854
12855         g_assert(command->number == 1);
12856         g_assert(command->type == STK_COMMAND_TYPE_PROVIDE_LOCAL_INFO);
12857         g_assert(command->qualifier == test->qualifier);
12858
12859         g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
12860         g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_TERMINAL);
12861
12862         stk_command_free(command);
12863 }
12864
12865 struct setup_event_list_test {
12866         const unsigned char *pdu;
12867         unsigned int pdu_len;
12868         unsigned char qualifier;
12869         struct stk_event_list event_list;
12870 };
12871
12872 static unsigned char setup_event_list_111[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01,
12873                                                 0x05, 0x00, 0x82, 0x02, 0x81,
12874                                                 0x82, 0x99, 0x01, 0x04 };
12875
12876 static unsigned char setup_event_list_121[] = { 0xD0, 0x0D, 0x81, 0x03, 0x01,
12877                                                 0x05, 0x00, 0x82, 0x02, 0x81,
12878                                                 0x82, 0x99, 0x02, 0x05, 0x07 };
12879
12880 static unsigned char setup_event_list_122[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01,
12881                                                 0x05, 0x00, 0x82, 0x02, 0x81,
12882                                                 0x82, 0x99, 0x01, 0x07 };
12883
12884 static unsigned char setup_event_list_131[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01,
12885                                                 0x05, 0x00, 0x82, 0x02, 0x81,
12886                                                 0x82, 0x99, 0x01, 0x07 };
12887
12888 static unsigned char setup_event_list_132[] = { 0xD0, 0x0B, 0x81, 0x03, 0x01,
12889                                                 0x05, 0x00, 0x82, 0x02, 0x81,
12890                                                 0x82, 0x99, 0x00 };
12891
12892 static unsigned char setup_event_list_141[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01,
12893                                                 0x05, 0x00, 0x82, 0x02, 0x81,
12894                                                 0x82, 0x99, 0x01, 0x07 };
12895
12896 static struct setup_event_list_test setup_event_list_data_111 = {
12897         .pdu = setup_event_list_111,
12898         .pdu_len = sizeof(setup_event_list_111),
12899         .qualifier = 0x00,
12900         .event_list = {
12901                 .len = 1,
12902                 .list = { STK_EVENT_TYPE_USER_ACTIVITY }
12903         }
12904 };
12905
12906 static struct setup_event_list_test setup_event_list_data_121 = {
12907         .pdu = setup_event_list_121,
12908         .pdu_len = sizeof(setup_event_list_121),
12909         .qualifier = 0x00,
12910         .event_list = {
12911                 .len = 2,
12912                 .list = { STK_EVENT_TYPE_IDLE_SCREEN_AVAILABLE,
12913                                 STK_EVENT_TYPE_LANGUAGE_SELECTION }
12914         }
12915 };
12916
12917 static struct setup_event_list_test setup_event_list_data_122 = {
12918         .pdu = setup_event_list_122,
12919         .pdu_len = sizeof(setup_event_list_122),
12920         .qualifier = 0x00,
12921         .event_list = {
12922                 .len = 1,
12923                 .list = { STK_EVENT_TYPE_LANGUAGE_SELECTION }
12924         }
12925 };
12926
12927 static struct setup_event_list_test setup_event_list_data_131 = {
12928         .pdu = setup_event_list_131,
12929         .pdu_len = sizeof(setup_event_list_131),
12930         .qualifier = 0x00,
12931         .event_list = {
12932                 .len = 1,
12933                 .list = { STK_EVENT_TYPE_LANGUAGE_SELECTION }
12934         }
12935 };
12936
12937 static struct setup_event_list_test setup_event_list_data_132 = {
12938         .pdu = setup_event_list_132,
12939         .pdu_len = sizeof(setup_event_list_132),
12940         .qualifier = 0x00
12941 };
12942
12943 static struct setup_event_list_test setup_event_list_data_141 = {
12944         .pdu = setup_event_list_141,
12945         .pdu_len = sizeof(setup_event_list_141),
12946         .qualifier = 0x00,
12947         .event_list = {
12948                 .len = 1,
12949                 .list = { STK_EVENT_TYPE_LANGUAGE_SELECTION }
12950         }
12951 };
12952
12953 static void test_setup_event_list(gconstpointer data)
12954 {
12955         const struct setup_event_list_test *test = data;
12956         struct stk_command *command;
12957
12958         command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
12959
12960         g_assert(command);
12961         g_assert(command->status == STK_PARSE_RESULT_OK);
12962
12963         g_assert(command->number == 1);
12964         g_assert(command->type == STK_COMMAND_TYPE_SETUP_EVENT_LIST);
12965         g_assert(command->qualifier == test->qualifier);
12966
12967         g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
12968         g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_TERMINAL);
12969
12970         check_event_list(&command->setup_event_list.event_list,
12971                                                 &test->event_list);
12972
12973         stk_command_free(command);
12974 }
12975
12976 struct perform_card_apdu_test {
12977         const unsigned char *pdu;
12978         unsigned int pdu_len;
12979         unsigned char qualifier;
12980         unsigned char dst;
12981         struct stk_c_apdu c_apdu;
12982 };
12983
12984 static unsigned char perform_card_apdu_111[] = { 0xD0, 0x12, 0x81, 0x03, 0x01,
12985                                                 0x30, 0x00, 0x82, 0x02, 0x81,
12986                                                 0x11, 0xA2, 0x07, 0xA0, 0xA4,
12987                                                 0x00, 0x00, 0x02, 0x3F, 0x00 };
12988
12989 static unsigned char perform_card_apdu_112[] = { 0xD0, 0x10, 0x81, 0x03, 0x01,
12990                                                 0x30, 0x00, 0x82, 0x02, 0x81,
12991                                                 0x11, 0xA2, 0x05, 0xA0, 0xC0,
12992                                                 0x00, 0x00, 0x1B };
12993
12994 static unsigned char perform_card_apdu_121[] = { 0xD0, 0x12, 0x81, 0x03, 0x01,
12995                                                 0x30, 0x00, 0x82, 0x02, 0x81,
12996                                                 0x11, 0xA2, 0x07, 0xA0, 0xA4,
12997                                                 0x00, 0x00, 0x02, 0x7F, 0x20 };
12998
12999 static unsigned char perform_card_apdu_122[] = { 0xD0, 0x12, 0x81, 0x03, 0x01,
13000                                                 0x30, 0x00, 0x82, 0x02, 0x81,
13001                                                 0x11, 0xA2, 0x07, 0xA0, 0xA4,
13002                                                 0x00, 0x00, 0x02, 0x6F, 0x30 };
13003
13004 static unsigned char perform_card_apdu_123[] = { 0xD0, 0x28, 0x81, 0x03, 0x01,
13005                                                 0x30, 0x00, 0x82, 0x02, 0x81,
13006                                                 0x11, 0xA2, 0x1D, 0xA0, 0xD6,
13007                                                 0x00, 0x00, 0x18, 0x00, 0x01,
13008                                                 0x02, 0x03, 0x04, 0x05, 0x06,
13009                                                 0x07, 0x08, 0x09, 0x0A, 0x0B,
13010                                                 0x0C, 0x0D, 0x0E, 0x0F, 0x10,
13011                                                 0x11, 0x12, 0x13, 0x14, 0x15,
13012                                                 0x16, 0x17 };
13013
13014 static unsigned char perform_card_apdu_124[] = { 0xD0, 0x10, 0x81, 0x03, 0x01,
13015                                                 0x30, 0x00, 0x82, 0x02, 0x81,
13016                                                 0x11, 0xA2, 0x05, 0xA0, 0xB0,
13017                                                 0x00, 0x00, 0x18 };
13018
13019 static unsigned char perform_card_apdu_125[] = { 0xD0, 0x28, 0x81, 0x03, 0x01,
13020                                                 0x30, 0x00, 0x82, 0x02, 0x81,
13021                                                 0x11, 0xA2, 0x1D, 0xA0, 0xD6,
13022                                                 0x00, 0x00, 0x18, 0xFF, 0xFF,
13023                                                 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
13024                                                 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
13025                                                 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
13026                                                 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
13027                                                 0xFF, 0xFF };
13028
13029 static unsigned char perform_card_apdu_151[] = { 0xD0, 0x12, 0x81, 0x03, 0x01,
13030                                                 0x30, 0x00, 0x82, 0x02, 0x81,
13031                                                 0x17, 0xA2, 0x07, 0xA0, 0xA4,
13032                                                 0x00, 0x00, 0x02, 0x3F, 0x00 };
13033
13034 static unsigned char perform_card_apdu_211[] = { 0xD0, 0x12, 0x81, 0x03, 0x01,
13035                                                 0x30, 0x00, 0x82, 0x02, 0x81,
13036                                                 0x11, 0xA2, 0x07, 0xA0, 0xA4,
13037                                                 0x00, 0x00, 0x02, 0x3F, 0x00 };
13038
13039 static struct perform_card_apdu_test perform_card_apdu_data_111 = {
13040         .pdu = perform_card_apdu_111,
13041         .pdu_len = sizeof(perform_card_apdu_111),
13042         .qualifier = 0x00,
13043         .dst = STK_DEVICE_IDENTITY_TYPE_CARD_READER_1,
13044         .c_apdu = {
13045                 .cla = 0xA0,
13046                 .ins = STK_INS_SELECT,
13047                 .p1 = 0x00,
13048                 .p2 = 0x00,
13049                 .lc = 0x02,
13050                 .data = { 0x3F, 0x00 }
13051         }
13052 };
13053
13054 static struct perform_card_apdu_test perform_card_apdu_data_112 = {
13055         .pdu = perform_card_apdu_112,
13056         .pdu_len = sizeof(perform_card_apdu_112),
13057         .qualifier = 0x00,
13058         .dst = STK_DEVICE_IDENTITY_TYPE_CARD_READER_1,
13059         .c_apdu = {
13060                 .cla = 0xA0,
13061                 .ins = STK_INS_GET_RESPONSE,
13062                 .p1 = 0x00,
13063                 .p2 = 0x00,
13064                 .has_le = 1,
13065                 .le = 0x1B
13066         }
13067 };
13068
13069 static struct perform_card_apdu_test perform_card_apdu_data_121 = {
13070         .pdu = perform_card_apdu_121,
13071         .pdu_len = sizeof(perform_card_apdu_121),
13072         .qualifier = 0x00,
13073         .dst = STK_DEVICE_IDENTITY_TYPE_CARD_READER_1,
13074         .c_apdu = {
13075                 .cla = 0xA0,
13076                 .ins = STK_INS_SELECT,
13077                 .p1 = 0x00,
13078                 .p2 = 0x00,
13079                 .lc = 0x02,
13080                 .data = { 0x7F, 0x20 }
13081         }
13082 };
13083
13084 static struct perform_card_apdu_test perform_card_apdu_data_122 = {
13085         .pdu = perform_card_apdu_122,
13086         .pdu_len = sizeof(perform_card_apdu_122),
13087         .qualifier = 0x00,
13088         .dst = STK_DEVICE_IDENTITY_TYPE_CARD_READER_1,
13089         .c_apdu = {
13090                 .cla = 0xA0,
13091                 .ins = STK_INS_SELECT,
13092                 .p1 = 0x00,
13093                 .p2 = 0x00,
13094                 .lc = 0x02,
13095                 .data = { 0x6F, 0x30 }
13096         }
13097 };
13098
13099 /* Byte 14 of Data is not correct in spec. */
13100 static struct perform_card_apdu_test perform_card_apdu_data_123 = {
13101         .pdu = perform_card_apdu_123,
13102         .pdu_len = sizeof(perform_card_apdu_123),
13103         .qualifier = 0x00,
13104         .dst = STK_DEVICE_IDENTITY_TYPE_CARD_READER_1,
13105         .c_apdu = {
13106                 .cla = 0xA0,
13107                 .ins = STK_INS_UPDATE_BINARY_D6,
13108                 .p1 = 0x00,
13109                 .p2 = 0x00,
13110                 .lc = 0x18,
13111                 .data = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
13112                                 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10,
13113                                 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17 }
13114         }
13115 };
13116
13117 static struct perform_card_apdu_test perform_card_apdu_data_124 = {
13118         .pdu = perform_card_apdu_124,
13119         .pdu_len = sizeof(perform_card_apdu_124),
13120         .qualifier = 0x00,
13121         .dst = STK_DEVICE_IDENTITY_TYPE_CARD_READER_1,
13122         .c_apdu = {
13123                 .cla = 0xA0,
13124                 .ins = STK_INS_READ_BINARY_B0,
13125                 .p1 = 0x00,
13126                 .p2 = 0x00,
13127                 .has_le = 1,
13128                 .le = 0x18
13129         }
13130 };
13131
13132 static struct perform_card_apdu_test perform_card_apdu_data_125 = {
13133         .pdu = perform_card_apdu_125,
13134         .pdu_len = sizeof(perform_card_apdu_125),
13135         .qualifier = 0x00,
13136         .dst = STK_DEVICE_IDENTITY_TYPE_CARD_READER_1,
13137         .c_apdu = {
13138                 .cla = 0xA0,
13139                 .ins = STK_INS_UPDATE_BINARY_D6,
13140                 .p1 = 0x00,
13141                 .p2 = 0x00,
13142                 .lc = 0x18,
13143                 .data = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
13144                                 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
13145                                 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }
13146         }
13147 };
13148
13149 static struct perform_card_apdu_test perform_card_apdu_data_151 = {
13150         .pdu = perform_card_apdu_151,
13151         .pdu_len = sizeof(perform_card_apdu_151),
13152         .qualifier = 0x00,
13153         .dst = STK_DEVICE_IDENTITY_TYPE_CARD_READER_7,
13154         .c_apdu = {
13155                 .cla = 0xA0,
13156                 .ins = STK_INS_SELECT,
13157                 .p1 = 0x00,
13158                 .p2 = 0x00,
13159                 .lc = 0x02,
13160                 .data = { 0x3F, 0x00 }
13161         }
13162 };
13163
13164 static struct perform_card_apdu_test perform_card_apdu_data_211 = {
13165         .pdu = perform_card_apdu_211,
13166         .pdu_len = sizeof(perform_card_apdu_211),
13167         .qualifier = 0x00,
13168         .dst = STK_DEVICE_IDENTITY_TYPE_CARD_READER_1,
13169         .c_apdu = {
13170                 .cla = 0xA0,
13171                 .ins = STK_INS_SELECT,
13172                 .p1 = 0x00,
13173                 .p2 = 0x00,
13174                 .lc = 0x02,
13175                 .data = { 0x3F, 0x00 }
13176         }
13177 };
13178
13179 static void test_perform_card_apdu(gconstpointer data)
13180 {
13181         const struct perform_card_apdu_test *test = data;
13182         struct stk_command *command;
13183
13184         command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
13185
13186         g_assert(command);
13187         g_assert(command->status == STK_PARSE_RESULT_OK);
13188
13189         g_assert(command->number == 1);
13190         g_assert(command->type == STK_COMMAND_TYPE_PERFORM_CARD_APDU);
13191         g_assert(command->qualifier == test->qualifier);
13192
13193         g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
13194         g_assert(command->dst == test->dst);
13195
13196         check_c_apdu(&command->perform_card_apdu.c_apdu, &test->c_apdu);
13197
13198         stk_command_free(command);
13199 }
13200
13201 struct get_reader_status_test {
13202         const unsigned char *pdu;
13203         unsigned int pdu_len;
13204         unsigned char qualifier;
13205 };
13206
13207 static unsigned char get_reader_status_111[] = { 0xD0, 0x09, 0x81, 0x03, 0x01,
13208                                                 0x33, 0x00, 0x82, 0x02, 0x81,
13209                                                 0x82 };
13210
13211 static struct get_reader_status_test get_reader_status_data_111 = {
13212         .pdu = get_reader_status_111,
13213         .pdu_len = sizeof(get_reader_status_111),
13214         .qualifier = STK_QUALIFIER_TYPE_CARD_READER_STATUS,
13215 };
13216
13217 static void test_get_reader_status(gconstpointer data)
13218 {
13219         const struct get_reader_status_test *test = data;
13220         struct stk_command *command;
13221
13222         command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
13223
13224         g_assert(command);
13225         g_assert(command->status == STK_PARSE_RESULT_OK);
13226
13227         g_assert(command->number == 1);
13228         g_assert(command->type == STK_COMMAND_TYPE_GET_READER_STATUS);
13229         g_assert(command->qualifier == test->qualifier);
13230
13231         g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
13232
13233         if (command->qualifier == STK_QUALIFIER_TYPE_CARD_READER_STATUS)
13234                 g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_TERMINAL);
13235         else
13236                 g_assert(command->dst <
13237                                 STK_DEVICE_IDENTITY_TYPE_CARD_READER_0 ||
13238                         command->dst >
13239                                 STK_DEVICE_IDENTITY_TYPE_CARD_READER_7);
13240
13241         stk_command_free(command);
13242 }
13243
13244 struct timer_mgmt_test {
13245         const unsigned char *pdu;
13246         unsigned int pdu_len;
13247         unsigned char qualifier;
13248         unsigned char timer_id;
13249         struct stk_timer_value timer_value;
13250 };
13251
13252 static unsigned char timer_mgmt_111[] = { 0xD0, 0x11, 0x81, 0x03, 0x01, 0x27,
13253                                                 0x00, 0x82, 0x02, 0x81, 0x82,
13254                                                 0xA4, 0x01, 0x01, 0xA5, 0x03,
13255                                                 0x00, 0x50, 0x00 };
13256
13257 static unsigned char timer_mgmt_112[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01, 0x27,
13258                                                 0x02, 0x82, 0x02, 0x81, 0x82,
13259                                                 0xA4, 0x01, 0x01 };
13260
13261 static unsigned char timer_mgmt_113[] = { 0xD0, 0x11, 0x81, 0x03, 0x01, 0x27,
13262                                                 0x00, 0x82, 0x02, 0x81, 0x82,
13263                                                 0xA4, 0x01, 0x01, 0xA5, 0x03,
13264                                                 0x00, 0x10, 0x03 };
13265
13266 static unsigned char timer_mgmt_114[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01, 0x27,
13267                                                 0x01, 0x82, 0x02, 0x81, 0x82,
13268                                                 0xA4, 0x01, 0x01 };
13269
13270 static unsigned char timer_mgmt_121[] = { 0xD0, 0x11, 0x81, 0x03, 0x01, 0x27,
13271                                                 0x00, 0x82, 0x02, 0x81, 0x82,
13272                                                 0xA4, 0x01, 0x02, 0xA5, 0x03,
13273                                                 0x32, 0x95, 0x95 };
13274
13275 static unsigned char timer_mgmt_122[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01, 0x27,
13276                                                 0x02, 0x82, 0x02, 0x81, 0x82,
13277                                                 0xA4, 0x01, 0x02 };
13278
13279 static unsigned char timer_mgmt_123[] = { 0xD0, 0x11, 0x81, 0x03, 0x01, 0x27,
13280                                                 0x00, 0x82, 0x02, 0x81, 0x82,
13281                                                 0xA4, 0x01, 0x02, 0xA5, 0x03,
13282                                                 0x00, 0x10, 0x01 };
13283
13284 static unsigned char timer_mgmt_124[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01, 0x27,
13285                                                 0x01, 0x82, 0x02, 0x81, 0x82,
13286                                                 0xA4, 0x01, 0x02 };
13287
13288 static unsigned char timer_mgmt_131[] = { 0xD0, 0x11, 0x81, 0x03, 0x01, 0x27,
13289                                                 0x00, 0x82, 0x02, 0x81, 0x82,
13290                                                 0xA4, 0x01, 0x08, 0xA5, 0x03,
13291                                                 0x00, 0x02, 0x00 };
13292
13293 static unsigned char timer_mgmt_132[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01, 0x27,
13294                                                 0x02, 0x82, 0x02, 0x81, 0x82,
13295                                                 0xA4, 0x01, 0x08 };
13296
13297 static unsigned char timer_mgmt_133[] = { 0xD0, 0x11, 0x81, 0x03, 0x01, 0x27,
13298                                                 0x00, 0x82, 0x02, 0x81, 0x82,
13299                                                 0xA4, 0x01, 0x08, 0xA5, 0x03,
13300                                                 0x10, 0x00, 0x00 };
13301
13302 static unsigned char timer_mgmt_134[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01, 0x27,
13303                                                 0x01, 0x82, 0x02, 0x81, 0x82,
13304                                                 0xA4, 0x01, 0x08 };
13305
13306 static unsigned char timer_mgmt_141[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01, 0x27,
13307                                                 0x02, 0x82, 0x02, 0x81, 0x82,
13308                                                 0xA4, 0x01, 0x01 };
13309
13310 static unsigned char timer_mgmt_142[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01, 0x27,
13311                                                 0x02, 0x82, 0x02, 0x81, 0x82,
13312                                                 0xA4, 0x01, 0x02 };
13313
13314 static unsigned char timer_mgmt_143[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01, 0x27,
13315                                                 0x02, 0x82, 0x02, 0x81, 0x82,
13316                                                 0xA4, 0x01, 0x03 };
13317
13318 static unsigned char timer_mgmt_144[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01, 0x27,
13319                                                 0x02, 0x82, 0x02, 0x81, 0x82,
13320                                                 0xA4, 0x01, 0x04 };
13321
13322 static unsigned char timer_mgmt_145[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01, 0x27,
13323                                                 0x02, 0x82, 0x02, 0x81, 0x82,
13324                                                 0xA4, 0x01, 0x05 };
13325
13326 static unsigned char timer_mgmt_146[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01, 0x27,
13327                                                 0x02, 0x82, 0x02, 0x81, 0x82,
13328                                                 0xA4, 0x01, 0x06 };
13329
13330 static unsigned char timer_mgmt_147[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01, 0x27,
13331                                                 0x02, 0x82, 0x02, 0x81, 0x82,
13332                                                 0xA4, 0x01, 0x07 };
13333
13334 static unsigned char timer_mgmt_148[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01, 0x27,
13335                                                 0x02, 0x82, 0x02, 0x81, 0x82,
13336                                                 0xA4, 0x01, 0x08 };
13337
13338 static unsigned char timer_mgmt_151[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01, 0x27,
13339                                                 0x01, 0x82, 0x02, 0x81, 0x82,
13340                                                 0xA4, 0x01, 0x01 };
13341
13342 static unsigned char timer_mgmt_152[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01, 0x27,
13343                                                 0x01, 0x82, 0x02, 0x81, 0x82,
13344                                                 0xA4, 0x01, 0x02 };
13345
13346 static unsigned char timer_mgmt_153[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01, 0x27,
13347                                                 0x01, 0x82, 0x02, 0x81, 0x82,
13348                                                 0xA4, 0x01, 0x03 };
13349
13350 static unsigned char timer_mgmt_154[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01, 0x27,
13351                                                 0x01, 0x82, 0x02, 0x81, 0x82,
13352                                                 0xA4, 0x01, 0x04 };
13353
13354 static unsigned char timer_mgmt_155[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01, 0x27,
13355                                                 0x01, 0x82, 0x02, 0x81, 0x82,
13356                                                 0xA4, 0x01, 0x05 };
13357
13358 static unsigned char timer_mgmt_156[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01, 0x27,
13359                                                 0x01, 0x82, 0x02, 0x81, 0x82,
13360                                                 0xA4, 0x01, 0x06 };
13361
13362 static unsigned char timer_mgmt_157[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01, 0x27,
13363                                                 0x01, 0x82, 0x02, 0x81, 0x82,
13364                                                 0xA4, 0x01, 0x07 };
13365
13366 static unsigned char timer_mgmt_158[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01, 0x27,
13367                                                 0x01, 0x82, 0x02, 0x81, 0x82,
13368                                                 0xA4, 0x01, 0x08 };
13369
13370 static unsigned char timer_mgmt_161[] = { 0xD0, 0x11, 0x81, 0x03, 0x01, 0x27,
13371                                                 0x00, 0x82, 0x02, 0x81, 0x82,
13372                                                 0xA4, 0x01, 0x01, 0xA5, 0x03,
13373                                                 0x00, 0x00, 0x50 };
13374
13375 static unsigned char timer_mgmt_162[] = { 0xD0, 0x11, 0x81, 0x03, 0x01, 0x27,
13376                                                 0x00, 0x82, 0x02, 0x81, 0x82,
13377                                                 0xA4, 0x01, 0x02, 0xA5, 0x03,
13378                                                 0x00, 0x00, 0x50 };
13379
13380 static unsigned char timer_mgmt_163[] = { 0xD0, 0x11, 0x81, 0x03, 0x01, 0x27,
13381                                                 0x00, 0x82, 0x02, 0x81, 0x82,
13382                                                 0xA4, 0x01, 0x03, 0xA5, 0x03,
13383                                                 0x00, 0x00, 0x50 };
13384
13385 static unsigned char timer_mgmt_164[] = { 0xD0, 0x11, 0x81, 0x03, 0x01, 0x27,
13386                                                 0x00, 0x82, 0x02, 0x81, 0x82,
13387                                                 0xA4, 0x01, 0x04, 0xA5, 0x03,
13388                                                 0x00, 0x00, 0x50 };
13389
13390 static unsigned char timer_mgmt_165[] = { 0xD0, 0x11, 0x81, 0x03, 0x01, 0x27,
13391                                                 0x00, 0x82, 0x02, 0x81, 0x82,
13392                                                 0xA4, 0x01, 0x05, 0xA5, 0x03,
13393                                                 0x00, 0x00, 0x50 };
13394
13395 static unsigned char timer_mgmt_166[] = { 0xD0, 0x11, 0x81, 0x03, 0x01, 0x27,
13396                                                 0x00, 0x82, 0x02, 0x81, 0x82,
13397                                                 0xA4, 0x01, 0x06, 0xA5, 0x03,
13398                                                 0x00, 0x00, 0x50 };
13399
13400 static unsigned char timer_mgmt_167[] = { 0xD0, 0x11, 0x81, 0x03, 0x01, 0x27,
13401                                                 0x00, 0x82, 0x02, 0x81, 0x82,
13402                                                 0xA4, 0x01, 0x07, 0xA5, 0x03,
13403                                                 0x00, 0x00, 0x50 };
13404
13405 static unsigned char timer_mgmt_168[] = { 0xD0, 0x11, 0x81, 0x03, 0x01, 0x27,
13406                                                 0x00, 0x82, 0x02, 0x81, 0x82,
13407                                                 0xA4, 0x01, 0x08, 0xA5, 0x03,
13408                                                 0x00, 0x00, 0x50 };
13409
13410 static unsigned char timer_mgmt_211[] = { 0xD0, 0x11, 0x81, 0x03, 0x01, 0x27,
13411                                                 0x00, 0x82, 0x02, 0x81, 0x82,
13412                                                 0xA4, 0x01, 0x01, 0xA5, 0x03,
13413                                                 0x00, 0x00, 0x01 };
13414
13415 static unsigned char timer_mgmt_221[] = { 0xD0, 0x11, 0x81, 0x03, 0x01, 0x27,
13416                                                 0x00, 0x82, 0x02, 0x81, 0x82,
13417                                                 0xA4, 0x01, 0x01, 0xA5, 0x03,
13418                                                 0x00, 0x00, 0x03 };
13419
13420 static struct timer_mgmt_test timer_mgmt_data_111 = {
13421         .pdu = timer_mgmt_111,
13422         .pdu_len = sizeof(timer_mgmt_111),
13423         .qualifier = 0x00,
13424         .timer_id = 1,
13425         .timer_value = {
13426                 .minute = 5
13427         }
13428 };
13429
13430 static struct timer_mgmt_test timer_mgmt_data_112 = {
13431         .pdu = timer_mgmt_112,
13432         .pdu_len = sizeof(timer_mgmt_112),
13433         .qualifier = 0x02,
13434         .timer_id = 1
13435 };
13436
13437 static struct timer_mgmt_test timer_mgmt_data_113 = {
13438         .pdu = timer_mgmt_113,
13439         .pdu_len = sizeof(timer_mgmt_113),
13440         .qualifier = 0x00,
13441         .timer_id = 1,
13442         .timer_value = {
13443                 .minute = 1,
13444                 .second = 30
13445         }
13446 };
13447
13448 static struct timer_mgmt_test timer_mgmt_data_114 = {
13449         .pdu = timer_mgmt_114,
13450         .pdu_len = sizeof(timer_mgmt_114),
13451         .qualifier = 0x01,
13452         .timer_id = 1
13453 };
13454
13455 static struct timer_mgmt_test timer_mgmt_data_121 = {
13456         .pdu = timer_mgmt_121,
13457         .pdu_len = sizeof(timer_mgmt_121),
13458         .qualifier = 0x00,
13459         .timer_id = 2,
13460         .timer_value = {
13461                 .hour = 23,
13462                 .minute = 59,
13463                 .second = 59
13464         }
13465 };
13466
13467 static struct timer_mgmt_test timer_mgmt_data_122 = {
13468         .pdu = timer_mgmt_122,
13469         .pdu_len = sizeof(timer_mgmt_122),
13470         .qualifier = 0x02,
13471         .timer_id = 2
13472 };
13473
13474 static struct timer_mgmt_test timer_mgmt_data_123 = {
13475         .pdu = timer_mgmt_123,
13476         .pdu_len = sizeof(timer_mgmt_123),
13477         .qualifier = 0x00,
13478         .timer_id = 2,
13479         .timer_value = {
13480                 .minute = 1,
13481                 .second = 10
13482         }
13483 };
13484
13485 static struct timer_mgmt_test timer_mgmt_data_124 = {
13486         .pdu = timer_mgmt_124,
13487         .pdu_len = sizeof(timer_mgmt_124),
13488         .qualifier = 0x01,
13489         .timer_id = 2
13490 };
13491
13492 static struct timer_mgmt_test timer_mgmt_data_131 = {
13493         .pdu = timer_mgmt_131,
13494         .pdu_len = sizeof(timer_mgmt_131),
13495         .qualifier = 0x00,
13496         .timer_id = 8,
13497         .timer_value = {
13498                 .minute = 20
13499         }
13500 };
13501
13502 static struct timer_mgmt_test timer_mgmt_data_132 = {
13503         .pdu = timer_mgmt_132,
13504         .pdu_len = sizeof(timer_mgmt_132),
13505         .qualifier = 0x02,
13506         .timer_id = 8
13507 };
13508
13509 static struct timer_mgmt_test timer_mgmt_data_133 = {
13510         .pdu = timer_mgmt_133,
13511         .pdu_len = sizeof(timer_mgmt_133),
13512         .qualifier = 0x00,
13513         .timer_id = 8,
13514         .timer_value = {
13515                 .hour = 1
13516         }
13517 };
13518
13519 static struct timer_mgmt_test timer_mgmt_data_134 = {
13520         .pdu = timer_mgmt_134,
13521         .pdu_len = sizeof(timer_mgmt_134),
13522         .qualifier = 0x01,
13523         .timer_id = 8
13524 };
13525
13526 static struct timer_mgmt_test timer_mgmt_data_141 = {
13527         .pdu = timer_mgmt_141,
13528         .pdu_len = sizeof(timer_mgmt_141),
13529         .qualifier = 0x02,
13530         .timer_id = 1
13531 };
13532
13533 static struct timer_mgmt_test timer_mgmt_data_142 = {
13534         .pdu = timer_mgmt_142,
13535         .pdu_len = sizeof(timer_mgmt_142),
13536         .qualifier = 0x02,
13537         .timer_id = 2
13538 };
13539
13540 static struct timer_mgmt_test timer_mgmt_data_143 = {
13541         .pdu = timer_mgmt_143,
13542         .pdu_len = sizeof(timer_mgmt_143),
13543         .qualifier = 0x02,
13544         .timer_id = 3
13545 };
13546
13547 static struct timer_mgmt_test timer_mgmt_data_144 = {
13548         .pdu = timer_mgmt_144,
13549         .pdu_len = sizeof(timer_mgmt_144),
13550         .qualifier = 0x02,
13551         .timer_id = 4
13552 };
13553
13554 static struct timer_mgmt_test timer_mgmt_data_145 = {
13555         .pdu = timer_mgmt_145,
13556         .pdu_len = sizeof(timer_mgmt_145),
13557         .qualifier = 0x02,
13558         .timer_id = 5
13559 };
13560
13561 static struct timer_mgmt_test timer_mgmt_data_146 = {
13562         .pdu = timer_mgmt_146,
13563         .pdu_len = sizeof(timer_mgmt_146),
13564         .qualifier = 0x02,
13565         .timer_id = 6
13566 };
13567
13568 static struct timer_mgmt_test timer_mgmt_data_147 = {
13569         .pdu = timer_mgmt_147,
13570         .pdu_len = sizeof(timer_mgmt_147),
13571         .qualifier = 0x02,
13572         .timer_id = 7
13573 };
13574
13575 static struct timer_mgmt_test timer_mgmt_data_148 = {
13576         .pdu = timer_mgmt_148,
13577         .pdu_len = sizeof(timer_mgmt_148),
13578         .qualifier = 0x02,
13579         .timer_id = 8
13580 };
13581
13582 static struct timer_mgmt_test timer_mgmt_data_151 = {
13583         .pdu = timer_mgmt_151,
13584         .pdu_len = sizeof(timer_mgmt_151),
13585         .qualifier = 0x01,
13586         .timer_id = 1
13587 };
13588
13589 static struct timer_mgmt_test timer_mgmt_data_152 = {
13590         .pdu = timer_mgmt_152,
13591         .pdu_len = sizeof(timer_mgmt_152),
13592         .qualifier = 0x01,
13593         .timer_id = 2
13594 };
13595
13596 static struct timer_mgmt_test timer_mgmt_data_153 = {
13597         .pdu = timer_mgmt_153,
13598         .pdu_len = sizeof(timer_mgmt_153),
13599         .qualifier = 0x01,
13600         .timer_id = 3
13601 };
13602
13603 static struct timer_mgmt_test timer_mgmt_data_154 = {
13604         .pdu = timer_mgmt_154,
13605         .pdu_len = sizeof(timer_mgmt_154),
13606         .qualifier = 0x01,
13607         .timer_id = 4
13608 };
13609
13610 static struct timer_mgmt_test timer_mgmt_data_155 = {
13611         .pdu = timer_mgmt_155,
13612         .pdu_len = sizeof(timer_mgmt_155),
13613         .qualifier = 0x01,
13614         .timer_id = 5
13615 };
13616
13617 static struct timer_mgmt_test timer_mgmt_data_156 = {
13618         .pdu = timer_mgmt_156,
13619         .pdu_len = sizeof(timer_mgmt_156),
13620         .qualifier = 0x01,
13621         .timer_id = 6
13622 };
13623
13624 static struct timer_mgmt_test timer_mgmt_data_157 = {
13625         .pdu = timer_mgmt_157,
13626         .pdu_len = sizeof(timer_mgmt_157),
13627         .qualifier = 0x01,
13628         .timer_id = 7
13629 };
13630
13631 static struct timer_mgmt_test timer_mgmt_data_158 = {
13632         .pdu = timer_mgmt_158,
13633         .pdu_len = sizeof(timer_mgmt_158),
13634         .qualifier = 0x01,
13635         .timer_id = 8
13636 };
13637
13638 static struct timer_mgmt_test timer_mgmt_data_161 = {
13639         .pdu = timer_mgmt_161,
13640         .pdu_len = sizeof(timer_mgmt_161),
13641         .qualifier = 0x00,
13642         .timer_id = 1,
13643         .timer_value = {
13644                 .second = 5
13645         }
13646 };
13647
13648 static struct timer_mgmt_test timer_mgmt_data_162 = {
13649         .pdu = timer_mgmt_162,
13650         .pdu_len = sizeof(timer_mgmt_162),
13651         .qualifier = 0x00,
13652         .timer_id = 2,
13653         .timer_value = {
13654                 .second = 5
13655         }
13656 };
13657
13658 static struct timer_mgmt_test timer_mgmt_data_163 = {
13659         .pdu = timer_mgmt_163,
13660         .pdu_len = sizeof(timer_mgmt_163),
13661         .qualifier = 0x00,
13662         .timer_id = 3,
13663         .timer_value = {
13664                 .second = 5
13665         }
13666 };
13667
13668 static struct timer_mgmt_test timer_mgmt_data_164 = {
13669         .pdu = timer_mgmt_164,
13670         .pdu_len = sizeof(timer_mgmt_164),
13671         .qualifier = 0x00,
13672         .timer_id = 4,
13673         .timer_value = {
13674                 .second = 5
13675         }
13676 };
13677
13678 static struct timer_mgmt_test timer_mgmt_data_165 = {
13679         .pdu = timer_mgmt_165,
13680         .pdu_len = sizeof(timer_mgmt_165),
13681         .qualifier = 0x00,
13682         .timer_id = 5,
13683         .timer_value = {
13684                 .second = 5
13685         }
13686 };
13687
13688 static struct timer_mgmt_test timer_mgmt_data_166 = {
13689         .pdu = timer_mgmt_166,
13690         .pdu_len = sizeof(timer_mgmt_166),
13691         .qualifier = 0x00,
13692         .timer_id = 6,
13693         .timer_value = {
13694                 .second = 5
13695         }
13696 };
13697
13698 static struct timer_mgmt_test timer_mgmt_data_167 = {
13699         .pdu = timer_mgmt_167,
13700         .pdu_len = sizeof(timer_mgmt_167),
13701         .qualifier = 0x00,
13702         .timer_id = 7,
13703         .timer_value = {
13704                 .second = 5
13705         }
13706 };
13707
13708 static struct timer_mgmt_test timer_mgmt_data_168 = {
13709         .pdu = timer_mgmt_168,
13710         .pdu_len = sizeof(timer_mgmt_168),
13711         .qualifier = 0x00,
13712         .timer_id = 8,
13713         .timer_value = {
13714                 .second = 5
13715         }
13716 };
13717
13718 static struct timer_mgmt_test timer_mgmt_data_211 = {
13719         .pdu = timer_mgmt_211,
13720         .pdu_len = sizeof(timer_mgmt_211),
13721         .qualifier = 0x00,
13722         .timer_id = 1,
13723         .timer_value = {
13724                 .second = 10
13725         }
13726 };
13727
13728 static struct timer_mgmt_test timer_mgmt_data_221 = {
13729         .pdu = timer_mgmt_221,
13730         .pdu_len = sizeof(timer_mgmt_221),
13731         .qualifier = 0x00,
13732         .timer_id = 1,
13733         .timer_value = {
13734                 .second = 30
13735         }
13736 };
13737
13738 static void test_timer_mgmt(gconstpointer data)
13739 {
13740         const struct timer_mgmt_test *test = data;
13741         struct stk_command *command;
13742
13743         command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
13744
13745         g_assert(command);
13746         g_assert(command->status == STK_PARSE_RESULT_OK);
13747
13748         g_assert(command->number == 1);
13749         g_assert(command->type == STK_COMMAND_TYPE_TIMER_MANAGEMENT);
13750         g_assert(command->qualifier == test->qualifier);
13751
13752         g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
13753         g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_TERMINAL);
13754
13755         check_timer_id(command->timer_mgmt.timer_id, test->timer_id);
13756         check_timer_value(&command->timer_mgmt.timer_value, &test->timer_value);
13757
13758         stk_command_free(command);
13759 }
13760
13761 struct setup_idle_mode_text_test {
13762         const unsigned char *pdu;
13763         unsigned int pdu_len;
13764         unsigned char qualifier;
13765         char *text;
13766         struct stk_icon_id icon_id;
13767         struct stk_text_attribute text_attr;
13768         struct stk_frame_id frame_id;
13769         char *html;
13770         enum stk_command_parse_result status;
13771 };
13772
13773 static unsigned char setup_idle_mode_text_111[] = { 0xD0, 0x1A, 0x81, 0x03,
13774                                                 0x01, 0x28, 0x00, 0x82, 0x02,
13775                                                 0x81, 0x82, 0x8D, 0x0F, 0x04,
13776                                                 0x49, 0x64, 0x6C, 0x65, 0x20,
13777                                                 0x4D, 0x6F, 0x64, 0x65, 0x20,
13778                                                 0x54, 0x65, 0x78, 0x74 };
13779
13780 static unsigned char setup_idle_mode_text_121[] = { 0xD0, 0x18, 0x81, 0x03,
13781                                                 0x01, 0x28, 0x00, 0x82, 0x02,
13782                                                 0x81, 0x82, 0x8D, 0x0D, 0x04,
13783                                                 0x54, 0x6F, 0x6F, 0x6C, 0x6B,
13784                                                 0x69, 0x74, 0x20, 0x54, 0x65,
13785                                                 0x73, 0x74 };
13786
13787 static unsigned char setup_idle_mode_text_131[] = { 0xD0, 0x0B, 0x81, 0x03,
13788                                                 0x01, 0x28, 0x00, 0x82, 0x02,
13789                                                 0x81, 0x82, 0x8D, 0x00 };
13790
13791 static unsigned char setup_idle_mode_text_171[] = { 0xD0, 0x81, 0xFD, 0x81,
13792                                                 0x03, 0x01, 0x28, 0x00, 0x82,
13793                                                 0x02, 0x81, 0x82, 0x8D, 0x81,
13794                                                 0xF1, 0x00, 0x54, 0x74, 0x19,
13795                                                 0x34, 0x4D, 0x36, 0x41, 0x73,
13796                                                 0x74, 0x98, 0xCD, 0x06, 0xCD,
13797                                                 0xEB, 0x70, 0x38, 0x3B, 0x0F,
13798                                                 0x0A, 0x83, 0xE8, 0x65, 0x3C,
13799                                                 0x1D, 0x34, 0xA7, 0xCB, 0xD3,
13800                                                 0xEE, 0x33, 0x0B, 0x74, 0x47,
13801                                                 0xA7, 0xC7, 0x68, 0xD0, 0x1C,
13802                                                 0x1D, 0x66, 0xB3, 0x41, 0xE2,
13803                                                 0x32, 0x88, 0x9C, 0x9E, 0xC3,
13804                                                 0xD9, 0xE1, 0x7C, 0x99, 0x0C,
13805                                                 0x12, 0xE7, 0x41, 0x74, 0x74,
13806                                                 0x19, 0xD4, 0x2C, 0x82, 0xC2,
13807                                                 0x73, 0x50, 0xD8, 0x0D, 0x4A,
13808                                                 0x93, 0xD9, 0x65, 0x50, 0xFB,
13809                                                 0x4D, 0x2E, 0x83, 0xE8, 0x65,
13810                                                 0x3C, 0x1D, 0x94, 0x36, 0x83,
13811                                                 0xE8, 0xE8, 0x32, 0xA8, 0x59,
13812                                                 0x04, 0xA5, 0xE7, 0xA0, 0xB0,
13813                                                 0x98, 0x5D, 0x06, 0xD1, 0xDF,
13814                                                 0x20, 0xF2, 0x1B, 0x94, 0xA6,
13815                                                 0xBB, 0xA8, 0xE8, 0x32, 0x08,
13816                                                 0x2E, 0x2F, 0xCF, 0xCB, 0x6E,
13817                                                 0x7A, 0x98, 0x9E, 0x7E, 0xBB,
13818                                                 0x41, 0x73, 0x7A, 0x9E, 0x5D,
13819                                                 0x06, 0xA5, 0xE7, 0x20, 0x76,
13820                                                 0xD9, 0x4C, 0x07, 0x85, 0xE7,
13821                                                 0xA0, 0xB0, 0x1B, 0x94, 0x6E,
13822                                                 0xC3, 0xD9, 0xE5, 0x76, 0xD9,
13823                                                 0x4D, 0x0F, 0xD3, 0xD3, 0x6F,
13824                                                 0x37, 0x88, 0x5C, 0x1E, 0xA7,
13825                                                 0xE7, 0xE9, 0xB7, 0x1B, 0x44,
13826                                                 0x7F, 0x83, 0xE8, 0xE8, 0x32,
13827                                                 0xA8, 0x59, 0x04, 0xB5, 0xC3,
13828                                                 0xEE, 0xBA, 0x39, 0x3C, 0xA6,
13829                                                 0xD7, 0xE5, 0x65, 0xB9, 0x0B,
13830                                                 0x44, 0x45, 0x97, 0x41, 0x69,
13831                                                 0x32, 0xBB, 0x0C, 0x6A, 0xBF,
13832                                                 0xC9, 0x65, 0x10, 0xBD, 0x8C,
13833                                                 0xA7, 0x83, 0xE6, 0xE8, 0x30,
13834                                                 0x9B, 0x0D, 0x12, 0x97, 0x41,
13835                                                 0xE4, 0xF4, 0x1C, 0xCE, 0x0E,
13836                                                 0xE7, 0xCB, 0x64, 0x50, 0xDA,
13837                                                 0x0D, 0x0A, 0x83, 0xDA, 0x61,
13838                                                 0xB7, 0xBB, 0x2C, 0x07, 0xD1,
13839                                                 0xD1, 0x61, 0x3A, 0xA8, 0xEC,
13840                                                 0x9E, 0xD7, 0xE5, 0xE5, 0x39,
13841                                                 0x88, 0x8E, 0x0E, 0xD3, 0x41,
13842                                                 0xEE, 0x32 };
13843
13844 static unsigned char setup_idle_mode_text_211[] = { 0xD0, 0x19, 0x81, 0x03,
13845                                                 0x01, 0x28, 0x00, 0x82, 0x02,
13846                                                 0x81, 0x82, 0x8D, 0x0A, 0x04,
13847                                                 0x49, 0x64, 0x6C, 0x65, 0x20,
13848                                                 0x74, 0x65, 0x78, 0x74, 0x9E,
13849                                                 0x02, 0x00, 0x01 };
13850
13851 static unsigned char setup_idle_mode_text_221[] = { 0xD0, 0x19, 0x81, 0x03,
13852                                                 0x01, 0x28, 0x00, 0x82, 0x02,
13853                                                 0x81, 0x82, 0x8D, 0x0A, 0x04,
13854                                                 0x49, 0x64, 0x6C, 0x65, 0x20,
13855                                                 0x74, 0x65, 0x78, 0x74, 0x9E,
13856                                                 0x02, 0x01, 0x01 };
13857
13858 static unsigned char setup_idle_mode_text_231[] = { 0xD0, 0x19, 0x81, 0x03,
13859                                                 0x01, 0x28, 0x00, 0x82, 0x02,
13860                                                 0x81, 0x82, 0x8D, 0x0A, 0x04,
13861                                                 0x49, 0x64, 0x6C, 0x65, 0x20,
13862                                                 0x74, 0x65, 0x78, 0x74, 0x9E,
13863                                                 0x02, 0x00, 0x02 };
13864
13865 static unsigned char setup_idle_mode_text_241[] = { 0xD0, 0x0F, 0x81, 0x03,
13866                                                 0x01, 0x28, 0x00, 0x82, 0x02,
13867                                                 0x81, 0x82, 0x8D, 0x00, 0x9E,
13868                                                 0x02, 0x01, 0x01 };
13869
13870 static unsigned char setup_idle_mode_text_311[] = { 0xD0, 0x24, 0x81, 0x03,
13871                                                 0x01, 0x28, 0x00, 0x82, 0x02,
13872                                                 0x81, 0x82, 0x8D, 0x19, 0x08,
13873                                                 0x04, 0x17, 0x04, 0x14, 0x04,
13874                                                 0x20, 0x04, 0x10, 0x04, 0x12,
13875                                                 0x04, 0x21, 0x04, 0x22, 0x04,
13876                                                 0x12, 0x04, 0x23, 0x04, 0x19,
13877                                                 0x04, 0x22, 0x04, 0x15 };
13878
13879 static unsigned char setup_idle_mode_text_411[] = { 0xD0, 0x22, 0x81, 0x03,
13880                                                 0x01, 0x28, 0x00, 0x82, 0x02,
13881                                                 0x81, 0x82, 0x8D, 0x11, 0x04,
13882                                                 0x49, 0x64, 0x6C, 0x65, 0x20,
13883                                                 0x4D, 0x6F, 0x64, 0x65, 0x20,
13884                                                 0x54, 0x65, 0x78, 0x74, 0x20,
13885                                                 0x31, 0xD0, 0x04, 0x00, 0x10,
13886                                                 0x00, 0xB4 };
13887
13888 static unsigned char setup_idle_mode_text_412[] = { 0xD0, 0x1C, 0x81, 0x03,
13889                                                 0x01, 0x28, 0x00, 0x82, 0x02,
13890                                                 0x81, 0x82, 0x8D, 0x11, 0x04,
13891                                                 0x49, 0x64, 0x6C, 0x65, 0x20,
13892                                                 0x4D, 0x6F, 0x64, 0x65, 0x20,
13893                                                 0x54, 0x65, 0x78, 0x74, 0x20,
13894                                                 0x32 };
13895
13896 static unsigned char setup_idle_mode_text_421[] = { 0xD0, 0x22, 0x81, 0x03,
13897                                                 0x01, 0x28, 0x00, 0x82, 0x02,
13898                                                 0x81, 0x82, 0x8D, 0x11, 0x04,
13899                                                 0x49, 0x64, 0x6C, 0x65, 0x20,
13900                                                 0x4D, 0x6F, 0x64, 0x65, 0x20,
13901                                                 0x54, 0x65, 0x78, 0x74, 0x20,
13902                                                 0x31, 0xD0, 0x04, 0x00, 0x10,
13903                                                 0x01, 0xB4 };
13904
13905 static unsigned char setup_idle_mode_text_422[] = { 0xD0, 0x1C, 0x81, 0x03,
13906                                                 0x01, 0x28, 0x00, 0x82, 0x02,
13907                                                 0x81, 0x82, 0x8D, 0x11, 0x04,
13908                                                 0x49, 0x64, 0x6C, 0x65, 0x20,
13909                                                 0x4D, 0x6F, 0x64, 0x65, 0x20,
13910                                                 0x54, 0x65, 0x78, 0x74, 0x20,
13911                                                 0x32 };
13912
13913 static unsigned char setup_idle_mode_text_431[] = { 0xD0, 0x22, 0x81, 0x03,
13914                                                 0x01, 0x28, 0x00, 0x82, 0x02,
13915                                                 0x81, 0x82, 0x8D, 0x11, 0x04,
13916                                                 0x49, 0x64, 0x6C, 0x65, 0x20,
13917                                                 0x4D, 0x6F, 0x64, 0x65, 0x20,
13918                                                 0x54, 0x65, 0x78, 0x74, 0x20,
13919                                                 0x31, 0xD0, 0x04, 0x00, 0x10,
13920                                                 0x02, 0xB4 };
13921
13922 static unsigned char setup_idle_mode_text_432[] = { 0xD0, 0x1C, 0x81, 0x03,
13923                                                 0x01, 0x28, 0x00, 0x82, 0x02,
13924                                                 0x81, 0x82, 0x8D, 0x11, 0x04,
13925                                                 0x49, 0x64, 0x6C, 0x65, 0x20,
13926                                                 0x4D, 0x6F, 0x64, 0x65, 0x20,
13927                                                 0x54, 0x65, 0x78, 0x74, 0x20,
13928                                                 0x32 };
13929
13930 static unsigned char setup_idle_mode_text_441[] = { 0xD0, 0x22, 0x81, 0x03,
13931                                                 0x01, 0x28, 0x00, 0x82, 0x02,
13932                                                 0x81, 0x82, 0x8D, 0x11, 0x04,
13933                                                 0x49, 0x64, 0x6C, 0x65, 0x20,
13934                                                 0x4D, 0x6F, 0x64, 0x65, 0x20,
13935                                                 0x54, 0x65, 0x78, 0x74, 0x20,
13936                                                 0x31, 0xD0, 0x04, 0x00, 0x10,
13937                                                 0x04, 0xB4 };
13938
13939 static unsigned char setup_idle_mode_text_442[] = { 0xD0, 0x22, 0x81, 0x03,
13940                                                 0x01, 0x28, 0x00, 0x82, 0x02,
13941                                                 0x81, 0x82, 0x8D, 0x11, 0x04,
13942                                                 0x49, 0x64, 0x6C, 0x65, 0x20,
13943                                                 0x4D, 0x6F, 0x64, 0x65, 0x20,
13944                                                 0x54, 0x65, 0x78, 0x74, 0x20,
13945                                                 0x32, 0xD0, 0x04, 0x00, 0x10,
13946                                                 0x00, 0xB4 };
13947
13948 static unsigned char setup_idle_mode_text_443[] = { 0xD0, 0x1C, 0x81, 0x03,
13949                                                 0x01, 0x28, 0x00, 0x82, 0x02,
13950                                                 0x81, 0x82, 0x8D, 0x11, 0x04,
13951                                                 0x49, 0x64, 0x6C, 0x65, 0x20,
13952                                                 0x4D, 0x6F, 0x64, 0x65, 0x20,
13953                                                 0x54, 0x65, 0x78, 0x74, 0x20,
13954                                                 0x33 };
13955
13956 static unsigned char setup_idle_mode_text_451[] = { 0xD0, 0x22, 0x81, 0x03,
13957                                                 0x01, 0x28, 0x00, 0x82, 0x02,
13958                                                 0x81, 0x82, 0x8D, 0x11, 0x04,
13959                                                 0x49, 0x64, 0x6C, 0x65, 0x20,
13960                                                 0x4D, 0x6F, 0x64, 0x65, 0x20,
13961                                                 0x54, 0x65, 0x78, 0x74, 0x20,
13962                                                 0x31, 0xD0, 0x04, 0x00, 0x10,
13963                                                 0x08, 0xB4 };
13964
13965 static unsigned char setup_idle_mode_text_452[] = { 0xD0, 0x22, 0x81, 0x03,
13966                                                 0x01, 0x28, 0x00, 0x82, 0x02,
13967                                                 0x81, 0x82, 0x8D, 0x11, 0x04,
13968                                                 0x49, 0x64, 0x6C, 0x65, 0x20,
13969                                                 0x4D, 0x6F, 0x64, 0x65, 0x20,
13970                                                 0x54, 0x65, 0x78, 0x74, 0x20,
13971                                                 0x32, 0xD0, 0x04, 0x00, 0x10,
13972                                                 0x00, 0xB4 };
13973
13974 static unsigned char setup_idle_mode_text_453[] = { 0xD0, 0x1C, 0x81, 0x03,
13975                                                 0x01, 0x28, 0x00, 0x82, 0x02,
13976                                                 0x81, 0x82, 0x8D, 0x11, 0x04,
13977                                                 0x49, 0x64, 0x6C, 0x65, 0x20,
13978                                                 0x4D, 0x6F, 0x64, 0x65, 0x20,
13979                                                 0x54, 0x65, 0x78, 0x74, 0x20,
13980                                                 0x33 };
13981
13982 static unsigned char setup_idle_mode_text_461[] = { 0xD0, 0x22, 0x81, 0x03,
13983                                                 0x01, 0x28, 0x00, 0x82, 0x02,
13984                                                 0x81, 0x82, 0x8D, 0x11, 0x04,
13985                                                 0x49, 0x64, 0x6C, 0x65, 0x20,
13986                                                 0x4D, 0x6F, 0x64, 0x65, 0x20,
13987                                                 0x54, 0x65, 0x78, 0x74, 0x20,
13988                                                 0x31, 0xD0, 0x04, 0x00, 0x10,
13989                                                 0x10, 0xB4 };
13990
13991 static unsigned char setup_idle_mode_text_462[] = { 0xD0, 0x22, 0x81, 0x03,
13992                                                 0x01, 0x28, 0x00, 0x82, 0x02,
13993                                                 0x81, 0x82, 0x8D, 0x11, 0x04,
13994                                                 0x49, 0x64, 0x6C, 0x65, 0x20,
13995                                                 0x4D, 0x6F, 0x64, 0x65, 0x20,
13996                                                 0x54, 0x65, 0x78, 0x74, 0x20,
13997                                                 0x32, 0xD0, 0x04, 0x00, 0x10,
13998                                                 0x00, 0xB4 };
13999
14000 static unsigned char setup_idle_mode_text_463[] = { 0xD0, 0x1C, 0x81, 0x03,
14001                                                 0x01, 0x28, 0x00, 0x82, 0x02,
14002                                                 0x81, 0x82, 0x8D, 0x11, 0x04,
14003                                                 0x49, 0x64, 0x6C, 0x65, 0x20,
14004                                                 0x4D, 0x6F, 0x64, 0x65, 0x20,
14005                                                 0x54, 0x65, 0x78, 0x74, 0x20,
14006                                                 0x33 };
14007
14008 static unsigned char setup_idle_mode_text_471[] = { 0xD0, 0x22, 0x81, 0x03,
14009                                                 0x01, 0x28, 0x00, 0x82, 0x02,
14010                                                 0x81, 0x82, 0x8D, 0x11, 0x04,
14011                                                 0x49, 0x64, 0x6C, 0x65, 0x20,
14012                                                 0x4D, 0x6F, 0x64, 0x65, 0x20,
14013                                                 0x54, 0x65, 0x78, 0x74, 0x20,
14014                                                 0x31, 0xD0, 0x04, 0x00, 0x10,
14015                                                 0x20, 0xB4 };
14016
14017 static unsigned char setup_idle_mode_text_472[] = { 0xD0, 0x22, 0x81, 0x03,
14018                                                 0x01, 0x28, 0x00, 0x82, 0x02,
14019                                                 0x81, 0x82, 0x8D, 0x11, 0x04,
14020                                                 0x49, 0x64, 0x6C, 0x65, 0x20,
14021                                                 0x4D, 0x6F, 0x64, 0x65, 0x20,
14022                                                 0x54, 0x65, 0x78, 0x74, 0x20,
14023                                                 0x32, 0xD0, 0x04, 0x00, 0x10,
14024                                                 0x00, 0xB4 };
14025
14026 static unsigned char setup_idle_mode_text_473[] = { 0xD0, 0x1C, 0x81, 0x03,
14027                                                 0x01, 0x28, 0x00, 0x82, 0x02,
14028                                                 0x81, 0x82, 0x8D, 0x11, 0x04,
14029                                                 0x49, 0x64, 0x6C, 0x65, 0x20,
14030                                                 0x4D, 0x6F, 0x64, 0x65, 0x20,
14031                                                 0x54, 0x65, 0x78, 0x74, 0x20,
14032                                                 0x33 };
14033
14034 static unsigned char setup_idle_mode_text_481[] = { 0xD0, 0x22, 0x81, 0x03,
14035                                                 0x01, 0x28, 0x00, 0x82, 0x02,
14036                                                 0x81, 0x82, 0x8D, 0x11, 0x04,
14037                                                 0x49, 0x64, 0x6C, 0x65, 0x20,
14038                                                 0x4D, 0x6F, 0x64, 0x65, 0x20,
14039                                                 0x54, 0x65, 0x78, 0x74, 0x20,
14040                                                 0x31, 0xD0, 0x04, 0x00, 0x10,
14041                                                 0x40, 0xB4 };
14042
14043 static unsigned char setup_idle_mode_text_482[] = { 0xD0, 0x22, 0x81, 0x03,
14044                                                 0x01, 0x28, 0x00, 0x82, 0x02,
14045                                                 0x81, 0x82, 0x8D, 0x11, 0x04,
14046                                                 0x49, 0x64, 0x6C, 0x65, 0x20,
14047                                                 0x4D, 0x6F, 0x64, 0x65, 0x20,
14048                                                 0x54, 0x65, 0x78, 0x74, 0x20,
14049                                                 0x32, 0xD0, 0x04, 0x00, 0x10,
14050                                                 0x00, 0xB4 };
14051
14052 static unsigned char setup_idle_mode_text_483[] = { 0xD0, 0x1C, 0x81, 0x03,
14053                                                 0x01, 0x28, 0x00, 0x82, 0x02,
14054                                                 0x81, 0x82, 0x8D, 0x11, 0x04,
14055                                                 0x49, 0x64, 0x6C, 0x65, 0x20,
14056                                                 0x4D, 0x6F, 0x64, 0x65, 0x20,
14057                                                 0x54, 0x65, 0x78, 0x74, 0x20,
14058                                                 0x33 };
14059
14060 static unsigned char setup_idle_mode_text_491[] = { 0xD0, 0x22, 0x81, 0x03,
14061                                                 0x01, 0x28, 0x00, 0x82, 0x02,
14062                                                 0x81, 0x82, 0x8D, 0x11, 0x04,
14063                                                 0x49, 0x64, 0x6C, 0x65, 0x20,
14064                                                 0x4D, 0x6F, 0x64, 0x65, 0x20,
14065                                                 0x54, 0x65, 0x78, 0x74, 0x20,
14066                                                 0x31, 0xD0, 0x04, 0x00, 0x10,
14067                                                 0x80, 0xB4 };
14068
14069 static unsigned char setup_idle_mode_text_492[] = { 0xD0, 0x22, 0x81, 0x03,
14070                                                 0x01, 0x28, 0x00, 0x82, 0x02,
14071                                                 0x81, 0x82, 0x8D, 0x11, 0x04,
14072                                                 0x49, 0x64, 0x6C, 0x65, 0x20,
14073                                                 0x4D, 0x6F, 0x64, 0x65, 0x20,
14074                                                 0x54, 0x65, 0x78, 0x74, 0x20,
14075                                                 0x32, 0xD0, 0x04, 0x00, 0x10,
14076                                                 0x00, 0xB4 };
14077
14078 static unsigned char setup_idle_mode_text_493[] = { 0xD0, 0x1C, 0x81, 0x03,
14079                                                 0x01, 0x28, 0x00, 0x82, 0x02,
14080                                                 0x81, 0x82, 0x8D, 0x11, 0x04,
14081                                                 0x49, 0x64, 0x6C, 0x65, 0x20,
14082                                                 0x4D, 0x6F, 0x64, 0x65, 0x20,
14083                                                 0x54, 0x65, 0x78, 0x74, 0x20,
14084                                                 0x33 };
14085
14086 static unsigned char setup_idle_mode_text_4101[] = { 0xD0, 0x22, 0x81, 0x03,
14087                                                 0x01, 0x28, 0x00, 0x82, 0x02,
14088                                                 0x81, 0x82, 0x8D, 0x11, 0x04,
14089                                                 0x49, 0x64, 0x6C, 0x65, 0x20,
14090                                                 0x4D, 0x6F, 0x64, 0x65, 0x20,
14091                                                 0x54, 0x65, 0x78, 0x74, 0x20,
14092                                                 0x31, 0xD0, 0x04, 0x00, 0x10,
14093                                                 0x00, 0xB4 };
14094
14095 static unsigned char setup_idle_mode_text_4102[] = { 0xD0, 0x1C, 0x81, 0x03,
14096                                                 0x01, 0x28, 0x00, 0x82, 0x02,
14097                                                 0x81, 0x82, 0x8D, 0x11, 0x04,
14098                                                 0x49, 0x64, 0x6C, 0x65, 0x20,
14099                                                 0x4D, 0x6F, 0x64, 0x65, 0x20,
14100                                                 0x54, 0x65, 0x78, 0x74, 0x20,
14101                                                 0x32 };
14102
14103 static unsigned char setup_idle_mode_text_511[] = { 0xD0, 0x10, 0x81, 0x03,
14104                                                 0x01, 0x28, 0x00, 0x82, 0x02,
14105                                                 0x81, 0x82, 0x8D, 0x05, 0x08,
14106                                                 0x4F, 0x60, 0x59, 0x7D };
14107
14108 static unsigned char setup_idle_mode_text_611[] = { 0xD0, 0x14, 0x81, 0x03,
14109                                                 0x01, 0x28, 0x00, 0x82, 0x02,
14110                                                 0x81, 0x82, 0x8D, 0x09, 0x08,
14111                                                 0x00, 0x38, 0x00, 0x30, 0x30,
14112                                                 0xEB, 0x00, 0x30 };
14113
14114 static struct setup_idle_mode_text_test setup_idle_mode_text_data_111 = {
14115         .pdu = setup_idle_mode_text_111,
14116         .pdu_len = sizeof(setup_idle_mode_text_111),
14117         .qualifier = 0x00,
14118         .text = "Idle Mode Text"
14119 };
14120
14121 static struct setup_idle_mode_text_test setup_idle_mode_text_data_121 = {
14122         .pdu = setup_idle_mode_text_121,
14123         .pdu_len = sizeof(setup_idle_mode_text_121),
14124         .qualifier = 0x00,
14125         .text = "Toolkit Test"
14126 };
14127
14128 static struct setup_idle_mode_text_test setup_idle_mode_text_data_131 = {
14129         .pdu = setup_idle_mode_text_131,
14130         .pdu_len = sizeof(setup_idle_mode_text_131),
14131         .qualifier = 0x00,
14132         .text = ""
14133 };
14134
14135 static struct setup_idle_mode_text_test setup_idle_mode_text_data_171 = {
14136         .pdu = setup_idle_mode_text_171,
14137         .pdu_len = sizeof(setup_idle_mode_text_171),
14138         .qualifier = 0x00,
14139         .text = "The SIM shall supply a text string, which shall be displayed "
14140                 "by the ME as an idle mode text if the ME is able to do it."
14141                 "The presentation style is left as an implementation decision "
14142                 "to the ME manufacturer. The idle mode text shall be displayed "
14143                 "in a manner that ensures that ne"
14144 };
14145
14146 static struct setup_idle_mode_text_test setup_idle_mode_text_data_211 = {
14147         .pdu = setup_idle_mode_text_211,
14148         .pdu_len = sizeof(setup_idle_mode_text_211),
14149         .qualifier = 0x00,
14150         .text = "Idle text",
14151         .icon_id = {
14152                 .qualifier = STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY,
14153                 .id = 0x01
14154         }
14155 };
14156
14157 static struct setup_idle_mode_text_test setup_idle_mode_text_data_221 = {
14158         .pdu = setup_idle_mode_text_221,
14159         .pdu_len = sizeof(setup_idle_mode_text_221),
14160         .qualifier = 0x00,
14161         .text = "Idle text",
14162         .icon_id = {
14163                 .qualifier = STK_ICON_QUALIFIER_TYPE_NON_SELF_EXPLANATORY,
14164                 .id = 0x01
14165         }
14166 };
14167
14168 static struct setup_idle_mode_text_test setup_idle_mode_text_data_231 = {
14169         .pdu = setup_idle_mode_text_231,
14170         .pdu_len = sizeof(setup_idle_mode_text_231),
14171         .qualifier = 0x00,
14172         .text = "Idle text",
14173         .icon_id = {
14174                 .qualifier = STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY,
14175                 .id = 0x02
14176         }
14177 };
14178
14179 static struct setup_idle_mode_text_test setup_idle_mode_text_data_241 = {
14180         .pdu = setup_idle_mode_text_241,
14181         .pdu_len = sizeof(setup_idle_mode_text_241),
14182         .qualifier = 0x00,
14183         .text = "",
14184         .icon_id = {
14185                 .qualifier = STK_ICON_QUALIFIER_TYPE_NON_SELF_EXPLANATORY,
14186                 .id = 0x01
14187         },
14188         .status = STK_PARSE_RESULT_DATA_NOT_UNDERSTOOD
14189 };
14190
14191 static struct setup_idle_mode_text_test setup_idle_mode_text_data_311 = {
14192         .pdu = setup_idle_mode_text_311,
14193         .pdu_len = sizeof(setup_idle_mode_text_311),
14194         .qualifier = 0x00,
14195         .text = "ЗДРАВСТВУЙТЕ"
14196 };
14197
14198 static struct setup_idle_mode_text_test setup_idle_mode_text_data_411 = {
14199         .pdu = setup_idle_mode_text_411,
14200         .pdu_len = sizeof(setup_idle_mode_text_411),
14201         .qualifier = 0x00,
14202         .text = "Idle Mode Text 1",
14203         .text_attr = {
14204                 .len = 4,
14205                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
14206         },
14207         .html = "<div style=\"text-align: left;\"><span style=\"color: "
14208                 "#347235;background-color: #FFFF00;\">Idle Mode Text 1</span>"
14209                 "</div>",
14210 };
14211
14212 static struct setup_idle_mode_text_test setup_idle_mode_text_data_412 = {
14213         .pdu = setup_idle_mode_text_412,
14214         .pdu_len = sizeof(setup_idle_mode_text_412),
14215         .qualifier = 0x00,
14216         .text = "Idle Mode Text 2"
14217 };
14218
14219 static struct setup_idle_mode_text_test setup_idle_mode_text_data_421 = {
14220         .pdu = setup_idle_mode_text_421,
14221         .pdu_len = sizeof(setup_idle_mode_text_421),
14222         .qualifier = 0x00,
14223         .text = "Idle Mode Text 1",
14224         .text_attr = {
14225                 .len = 4,
14226                 .attributes = { 0x00, 0x10, 0x01, 0xB4 }
14227         },
14228         .html = "<div style=\"text-align: center;\"><span style=\"color: "
14229                 "#347235;background-color: #FFFF00;\">Idle Mode Text 1</span>"
14230                 "</div>",
14231 };
14232
14233 static struct setup_idle_mode_text_test setup_idle_mode_text_data_422 = {
14234         .pdu = setup_idle_mode_text_422,
14235         .pdu_len = sizeof(setup_idle_mode_text_422),
14236         .qualifier = 0x00,
14237         .text = "Idle Mode Text 2"
14238 };
14239
14240 static struct setup_idle_mode_text_test setup_idle_mode_text_data_431 = {
14241         .pdu = setup_idle_mode_text_431,
14242         .pdu_len = sizeof(setup_idle_mode_text_431),
14243         .qualifier = 0x00,
14244         .text = "Idle Mode Text 1",
14245         .text_attr = {
14246                 .len = 4,
14247                 .attributes = { 0x00, 0x10, 0x02, 0xB4 }
14248         },
14249         .html = "<div style=\"text-align: right;\"><span style=\"color: "
14250                 "#347235;background-color: #FFFF00;\">Idle Mode Text 1</span>"
14251                 "</div>",
14252 };
14253
14254 static struct setup_idle_mode_text_test setup_idle_mode_text_data_432 = {
14255         .pdu = setup_idle_mode_text_432,
14256         .pdu_len = sizeof(setup_idle_mode_text_432),
14257         .qualifier = 0x00,
14258         .text = "Idle Mode Text 2"
14259 };
14260
14261 static struct setup_idle_mode_text_test setup_idle_mode_text_data_441 = {
14262         .pdu = setup_idle_mode_text_441,
14263         .pdu_len = sizeof(setup_idle_mode_text_441),
14264         .qualifier = 0x00,
14265         .text = "Idle Mode Text 1",
14266         .text_attr = {
14267                 .len = 4,
14268                 .attributes = { 0x00, 0x10, 0x04, 0xB4 }
14269         },
14270         .html = "<div style=\"text-align: left;\"><span style=\"font-size: "
14271                 "big;color: #347235;background-color: #FFFF00;\">"
14272                 "Idle Mode Text 1</span></div>",
14273 };
14274
14275 static struct setup_idle_mode_text_test setup_idle_mode_text_data_442 = {
14276         .pdu = setup_idle_mode_text_442,
14277         .pdu_len = sizeof(setup_idle_mode_text_442),
14278         .qualifier = 0x00,
14279         .text = "Idle Mode Text 2",
14280         .text_attr = {
14281                 .len = 4,
14282                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
14283         },
14284         .html = "<div style=\"text-align: left;\"><span style=\"color: "
14285                 "#347235;background-color: #FFFF00;\">Idle Mode Text 2</span>"
14286                 "</div>",
14287 };
14288
14289 static struct setup_idle_mode_text_test setup_idle_mode_text_data_443 = {
14290         .pdu = setup_idle_mode_text_443,
14291         .pdu_len = sizeof(setup_idle_mode_text_443),
14292         .qualifier = 0x00,
14293         .text = "Idle Mode Text 3"
14294 };
14295
14296 static struct setup_idle_mode_text_test setup_idle_mode_text_data_451 = {
14297         .pdu = setup_idle_mode_text_451,
14298         .pdu_len = sizeof(setup_idle_mode_text_451),
14299         .qualifier = 0x00,
14300         .text = "Idle Mode Text 1",
14301         .text_attr = {
14302                 .len = 4,
14303                 .attributes = { 0x00, 0x10, 0x08, 0xB4 }
14304         },
14305         .html = "<div style=\"text-align: left;\"><span style=\"font-size: "
14306                 "small;color: #347235;background-color: #FFFF00;\">"
14307                 "Idle Mode Text 1</span></div>",
14308 };
14309
14310 static struct setup_idle_mode_text_test setup_idle_mode_text_data_452 = {
14311         .pdu = setup_idle_mode_text_452,
14312         .pdu_len = sizeof(setup_idle_mode_text_452),
14313         .qualifier = 0x00,
14314         .text = "Idle Mode Text 2",
14315         .text_attr = {
14316                 .len = 4,
14317                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
14318         },
14319         .html = "<div style=\"text-align: left;\"><span style=\"color: "
14320                 "#347235;background-color: #FFFF00;\">Idle Mode Text 2</span>"
14321                 "</div>",
14322 };
14323
14324 static struct setup_idle_mode_text_test setup_idle_mode_text_data_453 = {
14325         .pdu = setup_idle_mode_text_453,
14326         .pdu_len = sizeof(setup_idle_mode_text_453),
14327         .qualifier = 0x00,
14328         .text = "Idle Mode Text 3"
14329 };
14330
14331 static struct setup_idle_mode_text_test setup_idle_mode_text_data_461 = {
14332         .pdu = setup_idle_mode_text_461,
14333         .pdu_len = sizeof(setup_idle_mode_text_461),
14334         .qualifier = 0x00,
14335         .text = "Idle Mode Text 1",
14336         .text_attr = {
14337                 .len = 4,
14338                 .attributes = { 0x00, 0x10, 0x10, 0xB4 }
14339         },
14340         .html = "<div style=\"text-align: left;\"><span style=\"font-weight: "
14341                 "bold;color: #347235;background-color: #FFFF00;\">"
14342                 "Idle Mode Text 1</span></div>",
14343 };
14344
14345 static struct setup_idle_mode_text_test setup_idle_mode_text_data_462 = {
14346         .pdu = setup_idle_mode_text_462,
14347         .pdu_len = sizeof(setup_idle_mode_text_462),
14348         .qualifier = 0x00,
14349         .text = "Idle Mode Text 2",
14350         .text_attr = {
14351                 .len = 4,
14352                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
14353         },
14354         .html = "<div style=\"text-align: left;\"><span style=\"color: "
14355                 "#347235;background-color: #FFFF00;\">Idle Mode Text 2</span>"
14356                 "</div>",
14357 };
14358
14359 static struct setup_idle_mode_text_test setup_idle_mode_text_data_463 = {
14360         .pdu = setup_idle_mode_text_463,
14361         .pdu_len = sizeof(setup_idle_mode_text_463),
14362         .qualifier = 0x00,
14363         .text = "Idle Mode Text 3"
14364 };
14365
14366 static struct setup_idle_mode_text_test setup_idle_mode_text_data_471 = {
14367         .pdu = setup_idle_mode_text_471,
14368         .pdu_len = sizeof(setup_idle_mode_text_471),
14369         .qualifier = 0x00,
14370         .text = "Idle Mode Text 1",
14371         .text_attr = {
14372                 .len = 4,
14373                 .attributes = { 0x00, 0x10, 0x20, 0xB4 }
14374         },
14375         .html = "<div style=\"text-align: left;\"><span style=\"font-style: "
14376                 "italic;color: #347235;background-color: #FFFF00;\">"
14377                 "Idle Mode Text 1</span></div>",
14378 };
14379
14380 static struct setup_idle_mode_text_test setup_idle_mode_text_data_472 = {
14381         .pdu = setup_idle_mode_text_472,
14382         .pdu_len = sizeof(setup_idle_mode_text_472),
14383         .qualifier = 0x00,
14384         .text = "Idle Mode Text 2",
14385         .text_attr = {
14386                 .len = 4,
14387                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
14388         },
14389         .html = "<div style=\"text-align: left;\"><span style=\"color: "
14390                 "#347235;background-color: #FFFF00;\">Idle Mode Text 2</span>"
14391                 "</div>",
14392 };
14393
14394 static struct setup_idle_mode_text_test setup_idle_mode_text_data_473 = {
14395         .pdu = setup_idle_mode_text_473,
14396         .pdu_len = sizeof(setup_idle_mode_text_473),
14397         .qualifier = 0x00,
14398         .text = "Idle Mode Text 3"
14399 };
14400
14401 static struct setup_idle_mode_text_test setup_idle_mode_text_data_481 = {
14402         .pdu = setup_idle_mode_text_481,
14403         .pdu_len = sizeof(setup_idle_mode_text_481),
14404         .qualifier = 0x00,
14405         .text = "Idle Mode Text 1",
14406         .text_attr = {
14407                 .len = 4,
14408                 .attributes = { 0x00, 0x10, 0x40, 0xB4 }
14409         },
14410         .html = "<div style=\"text-align: left;\"><span "
14411                 "style=\"text-decoration: underline;color: #347235;"
14412                 "background-color: #FFFF00;\">Idle Mode Text 1</span></div>",
14413 };
14414
14415 static struct setup_idle_mode_text_test setup_idle_mode_text_data_482 = {
14416         .pdu = setup_idle_mode_text_482,
14417         .pdu_len = sizeof(setup_idle_mode_text_482),
14418         .qualifier = 0x00,
14419         .text = "Idle Mode Text 2",
14420         .text_attr = {
14421                 .len = 4,
14422                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
14423         },
14424         .html = "<div style=\"text-align: left;\"><span style=\"color: "
14425                 "#347235;background-color: #FFFF00;\">Idle Mode Text 2</span>"
14426                 "</div>",
14427 };
14428
14429 static struct setup_idle_mode_text_test setup_idle_mode_text_data_483 = {
14430         .pdu = setup_idle_mode_text_483,
14431         .pdu_len = sizeof(setup_idle_mode_text_483),
14432         .qualifier = 0x00,
14433         .text = "Idle Mode Text 3"
14434 };
14435
14436 static struct setup_idle_mode_text_test setup_idle_mode_text_data_491 = {
14437         .pdu = setup_idle_mode_text_491,
14438         .pdu_len = sizeof(setup_idle_mode_text_491),
14439         .qualifier = 0x00,
14440         .text = "Idle Mode Text 1",
14441         .text_attr = {
14442                 .len = 4,
14443                 .attributes = { 0x00, 0x10, 0x80, 0xB4 }
14444         },
14445         .html = "<div style=\"text-align: left;\"><span "
14446                 "style=\"text-decoration: line-through;color: "
14447                 "#347235;background-color: #FFFF00;\">Idle Mode Text 1</span>"
14448                 "</div>",
14449 };
14450
14451 static struct setup_idle_mode_text_test setup_idle_mode_text_data_492 = {
14452         .pdu = setup_idle_mode_text_492,
14453         .pdu_len = sizeof(setup_idle_mode_text_492),
14454         .qualifier = 0x00,
14455         .text = "Idle Mode Text 2",
14456         .text_attr = {
14457                 .len = 4,
14458                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
14459         },
14460         .html = "<div style=\"text-align: left;\"><span style=\"color: "
14461                 "#347235;background-color: #FFFF00;\">Idle Mode Text 2</span>"
14462                 "</div>",
14463 };
14464
14465 static struct setup_idle_mode_text_test setup_idle_mode_text_data_493 = {
14466         .pdu = setup_idle_mode_text_493,
14467         .pdu_len = sizeof(setup_idle_mode_text_493),
14468         .qualifier = 0x00,
14469         .text = "Idle Mode Text 3"
14470 };
14471
14472 static struct setup_idle_mode_text_test setup_idle_mode_text_data_4101 = {
14473         .pdu = setup_idle_mode_text_4101,
14474         .pdu_len = sizeof(setup_idle_mode_text_4101),
14475         .qualifier = 0x00,
14476         .text = "Idle Mode Text 1",
14477         .text_attr = {
14478                 .len = 4,
14479                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
14480         },
14481         .html = "<div style=\"text-align: left;\"><span style=\"color: "
14482                 "#347235;background-color: #FFFF00;\">Idle Mode Text 1</span>"
14483                 "</div>",
14484 };
14485
14486 static struct setup_idle_mode_text_test setup_idle_mode_text_data_4102 = {
14487         .pdu = setup_idle_mode_text_4102,
14488         .pdu_len = sizeof(setup_idle_mode_text_4102),
14489         .qualifier = 0x00,
14490         .text = "Idle Mode Text 2"
14491 };
14492
14493 static struct setup_idle_mode_text_test setup_idle_mode_text_data_511 = {
14494         .pdu = setup_idle_mode_text_511,
14495         .pdu_len = sizeof(setup_idle_mode_text_511),
14496         .qualifier = 0x00,
14497         .text = "你好"
14498 };
14499
14500 static struct setup_idle_mode_text_test setup_idle_mode_text_data_611 = {
14501         .pdu = setup_idle_mode_text_611,
14502         .pdu_len = sizeof(setup_idle_mode_text_611),
14503         .qualifier = 0x00,
14504         .text = "80ル0"
14505 };
14506
14507 static void test_setup_idle_mode_text(gconstpointer data)
14508 {
14509         const struct setup_idle_mode_text_test *test = data;
14510         struct stk_command *command;
14511
14512         command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
14513
14514         g_assert(command);
14515         g_assert(command->status == test->status);
14516
14517         g_assert(command->number == 1);
14518         g_assert(command->type == STK_COMMAND_TYPE_SETUP_IDLE_MODE_TEXT);
14519         g_assert(command->qualifier == test->qualifier);
14520
14521         g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
14522         g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_TERMINAL);
14523
14524         check_text(command->setup_idle_mode_text.text, test->text);
14525         check_icon_id(&command->setup_idle_mode_text.icon_id, &test->icon_id);
14526         check_text_attr(&command->setup_idle_mode_text.text_attr,
14527                                                         &test->text_attr);
14528         check_text_attr_html(&command->setup_idle_mode_text.text_attr,
14529                                 command->setup_idle_mode_text.text, test->html);
14530         check_frame_id(&command->setup_idle_mode_text.frame_id,
14531                                                         &test->frame_id);
14532
14533         stk_command_free(command);
14534 }
14535
14536 struct run_at_command_test {
14537         const unsigned char *pdu;
14538         unsigned int pdu_len;
14539         unsigned char qualifier;
14540         char *alpha_id;
14541         char *at_command;
14542         struct stk_icon_id icon_id;
14543         struct stk_text_attribute text_attr;
14544         struct stk_frame_id frame_id;
14545         enum stk_command_parse_result status;
14546 };
14547
14548 static unsigned char run_at_command_111[] = { 0xD0, 0x12, 0x81, 0x03, 0x01,
14549                                                 0x34, 0x00, 0x82, 0x02, 0x81,
14550                                                 0x82, 0xA8, 0x07, 0x41, 0x54,
14551                                                 0x2B, 0x43, 0x47, 0x4D, 0x49 };
14552
14553 static unsigned char run_at_command_121[] = { 0xD0, 0x14, 0x81, 0x03, 0x01,
14554                                                 0x34, 0x00, 0x82, 0x02, 0x81,
14555                                                 0x82, 0x85, 0x00, 0xA8, 0x07,
14556                                                 0x41, 0x54, 0x2B, 0x43, 0x47,
14557                                                 0x4D, 0x49 };
14558
14559 static unsigned char run_at_command_131[] = { 0xD0, 0x22, 0x81, 0x03, 0x01,
14560                                                 0x34, 0x00, 0x82, 0x02, 0x81,
14561                                                 0x82, 0x85, 0x0E, 0x52, 0x75,
14562                                                 0x6E, 0x20, 0x41, 0x54, 0x20,
14563                                                 0x43, 0x6F, 0x6D, 0x6D, 0x61,
14564                                                 0x6E, 0x64, 0xA8, 0x07, 0x41,
14565                                                 0x54, 0x2B, 0x43, 0x47, 0x4D,
14566                                                 0x49 };
14567
14568 static unsigned char run_at_command_211[] = { 0xD0, 0x22, 0x81, 0x03, 0x01,
14569                                                 0x34, 0x00, 0x82, 0x02, 0x81,
14570                                                 0x82, 0x85, 0x0A, 0x42, 0x61,
14571                                                 0x73, 0x69, 0x63, 0x20, 0x49,
14572                                                 0x63, 0x6F, 0x6E, 0xA8, 0x07,
14573                                                 0x41, 0x54, 0x2B, 0x43, 0x47,
14574                                                 0x4D, 0x49, 0x9E, 0x02, 0x00,
14575                                                 0x01 };
14576
14577 /* The 12th byte should be 0x85, instead of 0xA8 */
14578 static unsigned char run_at_command_221[] = { 0xD0, 0x23, 0x81, 0x03, 0x01,
14579                                                 0x34, 0x00, 0x82, 0x02, 0x81,
14580                                                 0x82, 0x85, 0x0B, 0x43, 0x6F,
14581                                                 0x6C, 0x6F, 0x75, 0x72, 0x20,
14582                                                 0x49, 0x63, 0x6F, 0x6E, 0xA8,
14583                                                 0x07, 0x41, 0x54, 0x2B, 0x43,
14584                                                 0x47, 0x4D, 0x49, 0x9E, 0x02,
14585                                                 0x00, 0x02 };
14586
14587 static unsigned char run_at_command_231[] = { 0xD0, 0x22, 0x81, 0x03, 0x01,
14588                                                 0x34, 0x00, 0x82, 0x02, 0x81,
14589                                                 0x82, 0x85, 0x0A, 0x42, 0x61,
14590                                                 0x73, 0x69, 0x63, 0x20, 0x49,
14591                                                 0x63, 0x6F, 0x6E, 0xA8, 0x07,
14592                                                 0x41, 0x54, 0x2B, 0x43, 0x47,
14593                                                 0x4D, 0x49, 0x9E, 0x02, 0x01,
14594                                                 0x01 };
14595
14596 static unsigned char run_at_command_241[] = { 0xD0, 0x23, 0x81, 0x03, 0x01,
14597                                                 0x34, 0x00, 0x82, 0x02, 0x81,
14598                                                 0x82, 0x85, 0x0B, 0x43, 0x6F,
14599                                                 0x6C, 0x6F, 0x75, 0x72, 0x20,
14600                                                 0x49, 0x63, 0x6F, 0x6E, 0xA8,
14601                                                 0x07, 0x41, 0x54, 0x2B, 0x43,
14602                                                 0x47, 0x4D, 0x49, 0x9E, 0x02,
14603                                                 0x01, 0x02 };
14604
14605 static unsigned char run_at_command_251[] = { 0xD0, 0x16, 0x81, 0x03, 0x01,
14606                                                 0x34, 0x00, 0x82, 0x02, 0x81,
14607                                                 0x82, 0xA8, 0x07, 0x41, 0x54,
14608                                                 0x2B, 0x43, 0x47, 0x4D, 0x49,
14609                                                 0x9E, 0x02, 0x01, 0x01 };
14610
14611 static unsigned char run_at_command_311[] = { 0xD0, 0x2A, 0x81, 0x03, 0x01,
14612                                                 0x34, 0x00, 0x82, 0x02, 0x81,
14613                                                 0x82, 0x85, 0x10, 0x52, 0x75,
14614                                                 0x6E, 0x20, 0x41, 0x54, 0x20,
14615                                                 0x43, 0x6F, 0x6D, 0x6D, 0x61,
14616                                                 0x6E, 0x64, 0x20, 0x31, 0xA8,
14617                                                 0x07, 0x41, 0x54, 0x2B, 0x43,
14618                                                 0x47, 0x4D, 0x49, 0xD0, 0x04,
14619                                                 0x00, 0x10, 0x00, 0xB4 };
14620
14621 static unsigned char run_at_command_312[] = { 0xD0, 0x24, 0x81, 0x03, 0x01,
14622                                                 0x34, 0x00, 0x82, 0x02, 0x81,
14623                                                 0x82, 0x85, 0x10, 0x52, 0x75,
14624                                                 0x6E, 0x20, 0x41, 0x54, 0x20,
14625                                                 0x43, 0x6F, 0x6D, 0x6D, 0x61,
14626                                                 0x6E, 0x64, 0x20, 0x32, 0xA8,
14627                                                 0x07, 0x41, 0x54, 0x2B, 0x43,
14628                                                 0x47, 0x4D, 0x49 };
14629
14630 static unsigned char run_at_command_321[] = { 0xD0, 0x2A, 0x81, 0x03, 0x01,
14631                                                 0x34, 0x00, 0x82, 0x02, 0x81,
14632                                                 0x82, 0x85, 0x10, 0x52, 0x75,
14633                                                 0x6E, 0x20, 0x41, 0x54, 0x20,
14634                                                 0x43, 0x6F, 0x6D, 0x6D, 0x61,
14635                                                 0x6E, 0x64, 0x20, 0x31, 0xA8,
14636                                                 0x07, 0x41, 0x54, 0x2B, 0x43,
14637                                                 0x47, 0x4D, 0x49, 0xD0, 0x04,
14638                                                 0x00, 0x10, 0x01, 0xB4 };
14639
14640 static unsigned char run_at_command_322[] = { 0xD0, 0x24, 0x81, 0x03, 0x01,
14641                                                 0x34, 0x00, 0x82, 0x02, 0x81,
14642                                                 0x82, 0x85, 0x10, 0x52, 0x75,
14643                                                 0x6E, 0x20, 0x41, 0x54, 0x20,
14644                                                 0x43, 0x6F, 0x6D, 0x6D, 0x61,
14645                                                 0x6E, 0x64, 0x20, 0x32, 0xA8,
14646                                                 0x07, 0x41, 0x54, 0x2B, 0x43,
14647                                                 0x47, 0x4D, 0x49 };
14648
14649 static unsigned char run_at_command_331[] = { 0xD0, 0x2A, 0x81, 0x03, 0x01,
14650                                                 0x34, 0x00, 0x82, 0x02, 0x81,
14651                                                 0x82, 0x85, 0x10, 0x52, 0x75,
14652                                                 0x6E, 0x20, 0x41, 0x54, 0x20,
14653                                                 0x43, 0x6F, 0x6D, 0x6D, 0x61,
14654                                                 0x6E, 0x64, 0x20, 0x31, 0xA8,
14655                                                 0x07, 0x41, 0x54, 0x2B, 0x43,
14656                                                 0x47, 0x4D, 0x49, 0xD0, 0x04,
14657                                                 0x00, 0x10, 0x02, 0xB4 };
14658
14659 static unsigned char run_at_command_332[] = { 0xD0, 0x24, 0x81, 0x03, 0x01,
14660                                                 0x34, 0x00, 0x82, 0x02, 0x81,
14661                                                 0x82, 0x85, 0x10, 0x52, 0x75,
14662                                                 0x6E, 0x20, 0x41, 0x54, 0x20,
14663                                                 0x43, 0x6F, 0x6D, 0x6D, 0x61,
14664                                                 0x6E, 0x64, 0x20, 0x32, 0xA8,
14665                                                 0x07, 0x41, 0x54, 0x2B, 0x43,
14666                                                 0x47, 0x4D, 0x49 };
14667
14668 static unsigned char run_at_command_341[] = { 0xD0, 0x2A, 0x81, 0x03, 0x01,
14669                                                 0x34, 0x00, 0x82, 0x02, 0x81,
14670                                                 0x82, 0x85, 0x10, 0x52, 0x75,
14671                                                 0x6E, 0x20, 0x41, 0x54, 0x20,
14672                                                 0x43, 0x6F, 0x6D, 0x6D, 0x61,
14673                                                 0x6E, 0x64, 0x20, 0x31, 0xA8,
14674                                                 0x07, 0x41, 0x54, 0x2B, 0x43,
14675                                                 0x47, 0x4D, 0x49, 0xD0, 0x04,
14676                                                 0x00, 0x10, 0x04, 0xB4 };
14677
14678 static unsigned char run_at_command_342[] = { 0xD0, 0x2A, 0x81, 0x03, 0x01,
14679                                                 0x34, 0x00, 0x82, 0x02, 0x81,
14680                                                 0x82, 0x85, 0x10, 0x52, 0x75,
14681                                                 0x6E, 0x20, 0x41, 0x54, 0x20,
14682                                                 0x43, 0x6F, 0x6D, 0x6D, 0x61,
14683                                                 0x6E, 0x64, 0x20, 0x32, 0xA8,
14684                                                 0x07, 0x41, 0x54, 0x2B, 0x43,
14685                                                 0x47, 0x4D, 0x49, 0xD0, 0x04,
14686                                                 0x00, 0x10, 0x00, 0xB4 };
14687
14688 static unsigned char run_at_command_343[] = { 0xD0, 0x24, 0x81, 0x03, 0x01,
14689                                                 0x34, 0x00, 0x82, 0x02, 0x81,
14690                                                 0x82, 0x85, 0x10, 0x52, 0x75,
14691                                                 0x6E, 0x20, 0x41, 0x54, 0x20,
14692                                                 0x43, 0x6F, 0x6D, 0x6D, 0x61,
14693                                                 0x6E, 0x64, 0x20, 0x33, 0xA8,
14694                                                 0x07, 0x41, 0x54, 0x2B, 0x43,
14695                                                 0x47, 0x4D, 0x49 };
14696
14697 static unsigned char run_at_command_351[] = { 0xD0, 0x2A, 0x81, 0x03, 0x01,
14698                                                 0x34, 0x00, 0x82, 0x02, 0x81,
14699                                                 0x82, 0x85, 0x10, 0x52, 0x75,
14700                                                 0x6E, 0x20, 0x41, 0x54, 0x20,
14701                                                 0x43, 0x6F, 0x6D, 0x6D, 0x61,
14702                                                 0x6E, 0x64, 0x20, 0x31, 0xA8,
14703                                                 0x07, 0x41, 0x54, 0x2B, 0x43,
14704                                                 0x47, 0x4D, 0x49, 0xD0, 0x04,
14705                                                 0x00, 0x10, 0x08, 0xB4 };
14706
14707 static unsigned char run_at_command_352[] = { 0xD0, 0x2A, 0x81, 0x03, 0x01,
14708                                                 0x34, 0x00, 0x82, 0x02, 0x81,
14709                                                 0x82, 0x85, 0x10, 0x52, 0x75,
14710                                                 0x6E, 0x20, 0x41, 0x54, 0x20,
14711                                                 0x43, 0x6F, 0x6D, 0x6D, 0x61,
14712                                                 0x6E, 0x64, 0x20, 0x32, 0xA8,
14713                                                 0x07, 0x41, 0x54, 0x2B, 0x43,
14714                                                 0x47, 0x4D, 0x49, 0xD0, 0x04,
14715                                                 0x00, 0x10, 0x00, 0xB4 };
14716
14717 static unsigned char run_at_command_353[] = { 0xD0, 0x24, 0x81, 0x03, 0x01,
14718                                                 0x34, 0x00, 0x82, 0x02, 0x81,
14719                                                 0x82, 0x85, 0x10, 0x52, 0x75,
14720                                                 0x6E, 0x20, 0x41, 0x54, 0x20,
14721                                                 0x43, 0x6F, 0x6D, 0x6D, 0x61,
14722                                                 0x6E, 0x64, 0x20, 0x33, 0xA8,
14723                                                 0x07, 0x41, 0x54, 0x2B, 0x43,
14724                                                 0x47, 0x4D, 0x49 };
14725
14726 static unsigned char run_at_command_361[] = { 0xD0, 0x2A, 0x81, 0x03, 0x01,
14727                                                 0x34, 0x00, 0x82, 0x02, 0x81,
14728                                                 0x82, 0x85, 0x10, 0x52, 0x75,
14729                                                 0x6E, 0x20, 0x41, 0x54, 0x20,
14730                                                 0x43, 0x6F, 0x6D, 0x6D, 0x61,
14731                                                 0x6E, 0x64, 0x20, 0x31, 0xA8,
14732                                                 0x07, 0x41, 0x54, 0x2B, 0x43,
14733                                                 0x47, 0x4D, 0x49, 0xD0, 0x04,
14734                                                 0x00, 0x10, 0x10, 0xB4 };
14735
14736 static unsigned char run_at_command_362[] = { 0xD0, 0x2A, 0x81, 0x03, 0x01,
14737                                                 0x34, 0x00, 0x82, 0x02, 0x81,
14738                                                 0x82, 0x85, 0x10, 0x52, 0x75,
14739                                                 0x6E, 0x20, 0x41, 0x54, 0x20,
14740                                                 0x43, 0x6F, 0x6D, 0x6D, 0x61,
14741                                                 0x6E, 0x64, 0x20, 0x32, 0xA8,
14742                                                 0x07, 0x41, 0x54, 0x2B, 0x43,
14743                                                 0x47, 0x4D, 0x49, 0xD0, 0x04,
14744                                                 0x00, 0x10, 0x00, 0xB4 };
14745
14746 static unsigned char run_at_command_363[] = { 0xD0, 0x24, 0x81, 0x03, 0x01,
14747                                                 0x34, 0x00, 0x82, 0x02, 0x81,
14748                                                 0x82, 0x85, 0x10, 0x52, 0x75,
14749                                                 0x6E, 0x20, 0x41, 0x54, 0x20,
14750                                                 0x43, 0x6F, 0x6D, 0x6D, 0x61,
14751                                                 0x6E, 0x64, 0x20, 0x33, 0xA8,
14752                                                 0x07, 0x41, 0x54, 0x2B, 0x43,
14753                                                 0x47, 0x4D, 0x49 };
14754
14755 static unsigned char run_at_command_371[] = { 0xD0, 0x2A, 0x81, 0x03, 0x01,
14756                                                 0x34, 0x00, 0x82, 0x02, 0x81,
14757                                                 0x82, 0x85, 0x10, 0x52, 0x75,
14758                                                 0x6E, 0x20, 0x41, 0x54, 0x20,
14759                                                 0x43, 0x6F, 0x6D, 0x6D, 0x61,
14760                                                 0x6E, 0x64, 0x20, 0x31, 0xA8,
14761                                                 0x07, 0x41, 0x54, 0x2B, 0x43,
14762                                                 0x47, 0x4D, 0x49, 0xD0, 0x04,
14763                                                 0x00, 0x10, 0x20, 0xB4 };
14764
14765 static unsigned char run_at_command_372[] = { 0xD0, 0x2A, 0x81, 0x03, 0x01,
14766                                                 0x34, 0x00, 0x82, 0x02, 0x81,
14767                                                 0x82, 0x85, 0x10, 0x52, 0x75,
14768                                                 0x6E, 0x20, 0x41, 0x54, 0x20,
14769                                                 0x43, 0x6F, 0x6D, 0x6D, 0x61,
14770                                                 0x6E, 0x64, 0x20, 0x32, 0xA8,
14771                                                 0x07, 0x41, 0x54, 0x2B, 0x43,
14772                                                 0x47, 0x4D, 0x49, 0xD0, 0x04,
14773                                                 0x00, 0x10, 0x00, 0xB4 };
14774
14775 static unsigned char run_at_command_373[] = { 0xD0, 0x24, 0x81, 0x03, 0x01,
14776                                                 0x34, 0x00, 0x82, 0x02, 0x81,
14777                                                 0x82, 0x85, 0x10, 0x52, 0x75,
14778                                                 0x6E, 0x20, 0x41, 0x54, 0x20,
14779                                                 0x43, 0x6F, 0x6D, 0x6D, 0x61,
14780                                                 0x6E, 0x64, 0x20, 0x33, 0xA8,
14781                                                 0x07, 0x41, 0x54, 0x2B, 0x43,
14782                                                 0x47, 0x4D, 0x49 };
14783
14784 static unsigned char run_at_command_381[] = { 0xD0, 0x2A, 0x81, 0x03, 0x01,
14785                                                 0x34, 0x00, 0x82, 0x02, 0x81,
14786                                                 0x82, 0x85, 0x10, 0x52, 0x75,
14787                                                 0x6E, 0x20, 0x41, 0x54, 0x20,
14788                                                 0x43, 0x6F, 0x6D, 0x6D, 0x61,
14789                                                 0x6E, 0x64, 0x20, 0x31, 0xA8,
14790                                                 0x07, 0x41, 0x54, 0x2B, 0x43,
14791                                                 0x47, 0x4D, 0x49, 0xD0, 0x04,
14792                                                 0x00, 0x10, 0x40, 0xB4 };
14793
14794 static unsigned char run_at_command_382[] = { 0xD0, 0x2A, 0x81, 0x03, 0x01,
14795                                                 0x34, 0x00, 0x82, 0x02, 0x81,
14796                                                 0x82, 0x85, 0x10, 0x52, 0x75,
14797                                                 0x6E, 0x20, 0x41, 0x54, 0x20,
14798                                                 0x43, 0x6F, 0x6D, 0x6D, 0x61,
14799                                                 0x6E, 0x64, 0x20, 0x32, 0xA8,
14800                                                 0x07, 0x41, 0x54, 0x2B, 0x43,
14801                                                 0x47, 0x4D, 0x49, 0xD0, 0x04,
14802                                                 0x00, 0x10, 0x00, 0xB4 };
14803
14804 static unsigned char run_at_command_383[] = { 0xD0, 0x24, 0x81, 0x03, 0x01,
14805                                                 0x34, 0x00, 0x82, 0x02, 0x81,
14806                                                 0x82, 0x85, 0x10, 0x52, 0x75,
14807                                                 0x6E, 0x20, 0x41, 0x54, 0x20,
14808                                                 0x43, 0x6F, 0x6D, 0x6D, 0x61,
14809                                                 0x6E, 0x64, 0x20, 0x33, 0xA8,
14810                                                 0x07, 0x41, 0x54, 0x2B, 0x43,
14811                                                 0x47, 0x4D, 0x49 };
14812
14813 static unsigned char run_at_command_391[] = { 0xD0, 0x2A, 0x81, 0x03, 0x01,
14814                                                 0x34, 0x00, 0x82, 0x02, 0x81,
14815                                                 0x82, 0x85, 0x10, 0x52, 0x75,
14816                                                 0x6E, 0x20, 0x41, 0x54, 0x20,
14817                                                 0x43, 0x6F, 0x6D, 0x6D, 0x61,
14818                                                 0x6E, 0x64, 0x20, 0x31, 0xA8,
14819                                                 0x07, 0x41, 0x54, 0x2B, 0x43,
14820                                                 0x47, 0x4D, 0x49, 0xD0, 0x04,
14821                                                 0x00, 0x10, 0x80, 0xB4 };
14822
14823 static unsigned char run_at_command_392[] = { 0xD0, 0x2A, 0x81, 0x03, 0x01,
14824                                                 0x34, 0x00, 0x82, 0x02, 0x81,
14825                                                 0x82, 0x85, 0x10, 0x52, 0x75,
14826                                                 0x6E, 0x20, 0x41, 0x54, 0x20,
14827                                                 0x43, 0x6F, 0x6D, 0x6D, 0x61,
14828                                                 0x6E, 0x64, 0x20, 0x32, 0xA8,
14829                                                 0x07, 0x41, 0x54, 0x2B, 0x43,
14830                                                 0x47, 0x4D, 0x49, 0xD0, 0x04,
14831                                                 0x00, 0x10, 0x00, 0xB4 };
14832
14833 static unsigned char run_at_command_393[] = { 0xD0, 0x24, 0x81, 0x03, 0x01,
14834                                                 0x34, 0x00, 0x82, 0x02, 0x81,
14835                                                 0x82, 0x85, 0x10, 0x52, 0x75,
14836                                                 0x6E, 0x20, 0x41, 0x54, 0x20,
14837                                                 0x43, 0x6F, 0x6D, 0x6D, 0x61,
14838                                                 0x6E, 0x64, 0x20, 0x33, 0xA8,
14839                                                 0x07, 0x41, 0x54, 0x2B, 0x43,
14840                                                 0x47, 0x4D, 0x49 };
14841
14842 static unsigned char run_at_command_3101[] = { 0xD0, 0x2A, 0x81, 0x03, 0x01,
14843                                                 0x34, 0x00, 0x82, 0x02, 0x81,
14844                                                 0x82, 0x85, 0x10, 0x52, 0x75,
14845                                                 0x6E, 0x20, 0x41, 0x54, 0x20,
14846                                                 0x43, 0x6F, 0x6D, 0x6D, 0x61,
14847                                                 0x6E, 0x64, 0x20, 0x31, 0xA8,
14848                                                 0x07, 0x41, 0x54, 0x2B, 0x43,
14849                                                 0x47, 0x4D, 0x49, 0xD0, 0x04,
14850                                                 0x00, 0x10, 0x00, 0xB4 };
14851
14852 static unsigned char run_at_command_3102[] = { 0xD0, 0x24, 0x81, 0x03, 0x01,
14853                                                 0x34, 0x00, 0x82, 0x02, 0x81,
14854                                                 0x82, 0x85, 0x10, 0x52, 0x75,
14855                                                 0x6E, 0x20, 0x41, 0x54, 0x20,
14856                                                 0x43, 0x6F, 0x6D, 0x6D, 0x61,
14857                                                 0x6E, 0x64, 0x20, 0x32, 0xA8,
14858                                                 0x07, 0x41, 0x54, 0x2B, 0x43,
14859                                                 0x47, 0x4D, 0x49 };
14860
14861 /* The 2nd byte (total size) should be 0x2D, instead of 0x21 */
14862 static unsigned char run_at_command_411[] = { 0xD0, 0x2D, 0x81, 0x03, 0x01,
14863                                                 0x34, 0x00, 0x82, 0x02, 0x81,
14864                                                 0x82, 0x85, 0x19, 0x80, 0x04,
14865                                                 0x17, 0x04, 0x14, 0x04, 0x20,
14866                                                 0x04, 0x10, 0x04, 0x12, 0x04,
14867                                                 0x21, 0x04, 0x22, 0x04, 0x12,
14868                                                 0x04, 0x23, 0x04, 0x19, 0x04,
14869                                                 0x22, 0x04, 0x15, 0xA8, 0x07,
14870                                                 0x41, 0x54, 0x2B, 0x43, 0x47,
14871                                                 0x4D, 0x49 };
14872
14873 static unsigned char run_at_command_511[] = { 0xD0, 0x19, 0x81, 0x03, 0x01,
14874                                                 0x34, 0x00, 0x82, 0x02, 0x81,
14875                                                 0x82, 0x85, 0x05, 0x80, 0x4F,
14876                                                 0x60, 0x59, 0x7D, 0xA8, 0x07,
14877                                                 0x41, 0x54, 0x2B, 0x43, 0x47,
14878                                                 0x4D, 0x49 };
14879
14880 static unsigned char run_at_command_611[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01,
14881                                                 0x34, 0x00, 0x82, 0x02, 0x81,
14882                                                 0x82, 0x85, 0x07, 0x80, 0x00,
14883                                                 0x38, 0x00, 0x30, 0x30, 0xEB,
14884                                                 0xA8, 0x07, 0x41, 0x54, 0x2B,
14885                                                 0x43, 0x47, 0x4D, 0x49 };
14886
14887 static struct run_at_command_test run_at_command_data_111 = {
14888         .pdu = run_at_command_111,
14889         .pdu_len = sizeof(run_at_command_111),
14890         .qualifier = 0x00,
14891         .at_command = "AT+CGMI"
14892 };
14893
14894 static struct run_at_command_test run_at_command_data_121 = {
14895         .pdu = run_at_command_121,
14896         .pdu_len = sizeof(run_at_command_121),
14897         .qualifier = 0x00,
14898         .alpha_id = "",
14899         .at_command = "AT+CGMI"
14900 };
14901
14902 static struct run_at_command_test run_at_command_data_131 = {
14903         .pdu = run_at_command_131,
14904         .pdu_len = sizeof(run_at_command_131),
14905         .qualifier = 0x00,
14906         .alpha_id = "Run AT Command",
14907         .at_command = "AT+CGMI"
14908 };
14909
14910 static struct run_at_command_test run_at_command_data_211 = {
14911         .pdu = run_at_command_211,
14912         .pdu_len = sizeof(run_at_command_211),
14913         .qualifier = 0x00,
14914         .alpha_id = "Basic Icon",
14915         .at_command = "AT+CGMI",
14916         .icon_id = {
14917                 .qualifier = STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY,
14918                 .id = 0x01
14919         }
14920 };
14921
14922 static struct run_at_command_test run_at_command_data_221 = {
14923         .pdu = run_at_command_221,
14924         .pdu_len = sizeof(run_at_command_221),
14925         .qualifier = 0x00,
14926         .alpha_id = "Colour Icon",
14927         .at_command = "AT+CGMI",
14928         .icon_id = {
14929                 .qualifier = STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY,
14930                 .id = 0x02
14931         }
14932 };
14933
14934 static struct run_at_command_test run_at_command_data_231 = {
14935         .pdu = run_at_command_231,
14936         .pdu_len = sizeof(run_at_command_231),
14937         .qualifier = 0x00,
14938         .alpha_id = "Basic Icon",
14939         .at_command = "AT+CGMI",
14940         .icon_id = {
14941                 .qualifier = STK_ICON_QUALIFIER_TYPE_NON_SELF_EXPLANATORY,
14942                 .id = 0x01
14943         }
14944 };
14945
14946 /* The qualifier of icon_id should be non self-explanatory */
14947 static struct run_at_command_test run_at_command_data_241 = {
14948         .pdu = run_at_command_241,
14949         .pdu_len = sizeof(run_at_command_241),
14950         .qualifier = 0x00,
14951         .alpha_id = "Colour Icon",
14952         .at_command = "AT+CGMI",
14953         .icon_id = {
14954                 .qualifier = STK_ICON_QUALIFIER_TYPE_NON_SELF_EXPLANATORY,
14955                 .id = 0x02
14956         }
14957 };
14958
14959 static struct run_at_command_test run_at_command_data_251 = {
14960         .pdu = run_at_command_251,
14961         .pdu_len = sizeof(run_at_command_251),
14962         .qualifier = 0x00,
14963         .at_command = "AT+CGMI",
14964         .icon_id = {
14965                 .qualifier = STK_ICON_QUALIFIER_TYPE_NON_SELF_EXPLANATORY,
14966                 .id = 0x01
14967         },
14968         .status = STK_PARSE_RESULT_DATA_NOT_UNDERSTOOD
14969 };
14970
14971 static struct run_at_command_test run_at_command_data_311 = {
14972         .pdu = run_at_command_311,
14973         .pdu_len = sizeof(run_at_command_311),
14974         .qualifier = 0x00,
14975         .alpha_id = "Run AT Command 1",
14976         .at_command = "AT+CGMI",
14977         .text_attr = {
14978                 .len = 4,
14979                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
14980         }
14981 };
14982
14983 static struct run_at_command_test run_at_command_data_312 = {
14984         .pdu = run_at_command_312,
14985         .pdu_len = sizeof(run_at_command_312),
14986         .qualifier = 0x00,
14987         .alpha_id = "Run AT Command 2",
14988         .at_command = "AT+CGMI"
14989 };
14990
14991 static struct run_at_command_test run_at_command_data_321 = {
14992         .pdu = run_at_command_321,
14993         .pdu_len = sizeof(run_at_command_321),
14994         .qualifier = 0x00,
14995         .alpha_id = "Run AT Command 1",
14996         .at_command = "AT+CGMI",
14997         .text_attr = {
14998                 .len = 4,
14999                 .attributes = { 0x00, 0x10, 0x01, 0xB4 }
15000         }
15001 };
15002
15003 static struct run_at_command_test run_at_command_data_322 = {
15004         .pdu = run_at_command_322,
15005         .pdu_len = sizeof(run_at_command_322),
15006         .qualifier = 0x00,
15007         .alpha_id = "Run AT Command 2",
15008         .at_command = "AT+CGMI"
15009 };
15010
15011 static struct run_at_command_test run_at_command_data_331 = {
15012         .pdu = run_at_command_331,
15013         .pdu_len = sizeof(run_at_command_331),
15014         .qualifier = 0x00,
15015         .alpha_id = "Run AT Command 1",
15016         .at_command = "AT+CGMI",
15017         .text_attr = {
15018                 .len = 4,
15019                 .attributes = { 0x00, 0x10, 0x02, 0xB4 }
15020         }
15021 };
15022
15023 static struct run_at_command_test run_at_command_data_332 = {
15024         .pdu = run_at_command_332,
15025         .pdu_len = sizeof(run_at_command_332),
15026         .qualifier = 0x00,
15027         .alpha_id = "Run AT Command 2",
15028         .at_command = "AT+CGMI"
15029 };
15030
15031 static struct run_at_command_test run_at_command_data_341 = {
15032         .pdu = run_at_command_341,
15033         .pdu_len = sizeof(run_at_command_341),
15034         .qualifier = 0x00,
15035         .alpha_id = "Run AT Command 1",
15036         .at_command = "AT+CGMI",
15037         .text_attr = {
15038                 .len = 4,
15039                 .attributes = { 0x00, 0x10, 0x04, 0xB4 }
15040         }
15041 };
15042
15043 static struct run_at_command_test run_at_command_data_342 = {
15044         .pdu = run_at_command_342,
15045         .pdu_len = sizeof(run_at_command_342),
15046         .qualifier = 0x00,
15047         .alpha_id = "Run AT Command 2",
15048         .at_command = "AT+CGMI",
15049         .text_attr = {
15050                 .len = 4,
15051                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
15052         }
15053 };
15054
15055 static struct run_at_command_test run_at_command_data_343 = {
15056         .pdu = run_at_command_343,
15057         .pdu_len = sizeof(run_at_command_343),
15058         .qualifier = 0x00,
15059         .alpha_id = "Run AT Command 3",
15060         .at_command = "AT+CGMI"
15061 };
15062
15063 static struct run_at_command_test run_at_command_data_351 = {
15064         .pdu = run_at_command_351,
15065         .pdu_len = sizeof(run_at_command_351),
15066         .qualifier = 0x00,
15067         .alpha_id = "Run AT Command 1",
15068         .at_command = "AT+CGMI",
15069         .text_attr = {
15070                 .len = 4,
15071                 .attributes = { 0x00, 0x10, 0x08, 0xB4 }
15072         }
15073 };
15074
15075 static struct run_at_command_test run_at_command_data_352 = {
15076         .pdu = run_at_command_352,
15077         .pdu_len = sizeof(run_at_command_352),
15078         .qualifier = 0x00,
15079         .alpha_id = "Run AT Command 2",
15080         .at_command = "AT+CGMI",
15081         .text_attr = {
15082                 .len = 4,
15083                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
15084         }
15085 };
15086
15087 static struct run_at_command_test run_at_command_data_353 = {
15088         .pdu = run_at_command_353,
15089         .pdu_len = sizeof(run_at_command_353),
15090         .qualifier = 0x00,
15091         .alpha_id = "Run AT Command 3",
15092         .at_command = "AT+CGMI"
15093 };
15094
15095 static struct run_at_command_test run_at_command_data_361 = {
15096         .pdu = run_at_command_361,
15097         .pdu_len = sizeof(run_at_command_361),
15098         .qualifier = 0x00,
15099         .alpha_id = "Run AT Command 1",
15100         .at_command = "AT+CGMI",
15101         .text_attr = {
15102                 .len = 4,
15103                 .attributes = { 0x00, 0x10, 0x10, 0xB4 }
15104         }
15105 };
15106
15107 static struct run_at_command_test run_at_command_data_362 = {
15108         .pdu = run_at_command_362,
15109         .pdu_len = sizeof(run_at_command_362),
15110         .qualifier = 0x00,
15111         .alpha_id = "Run AT Command 2",
15112         .at_command = "AT+CGMI",
15113         .text_attr = {
15114                 .len = 4,
15115                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
15116         }
15117 };
15118
15119 static struct run_at_command_test run_at_command_data_363 = {
15120         .pdu = run_at_command_363,
15121         .pdu_len = sizeof(run_at_command_363),
15122         .qualifier = 0x00,
15123         .alpha_id = "Run AT Command 3",
15124         .at_command = "AT+CGMI"
15125 };
15126
15127 static struct run_at_command_test run_at_command_data_371 = {
15128         .pdu = run_at_command_371,
15129         .pdu_len = sizeof(run_at_command_371),
15130         .qualifier = 0x00,
15131         .alpha_id = "Run AT Command 1",
15132         .at_command = "AT+CGMI",
15133         .text_attr = {
15134                 .len = 4,
15135                 .attributes = { 0x00, 0x10, 0x20, 0xB4 }
15136         }
15137 };
15138
15139 static struct run_at_command_test run_at_command_data_372 = {
15140         .pdu = run_at_command_372,
15141         .pdu_len = sizeof(run_at_command_372),
15142         .qualifier = 0x00,
15143         .alpha_id = "Run AT Command 2",
15144         .at_command = "AT+CGMI",
15145         .text_attr = {
15146                 .len = 4,
15147                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
15148         }
15149 };
15150
15151 static struct run_at_command_test run_at_command_data_373 = {
15152         .pdu = run_at_command_373,
15153         .pdu_len = sizeof(run_at_command_373),
15154         .qualifier = 0x00,
15155         .alpha_id = "Run AT Command 3",
15156         .at_command = "AT+CGMI"
15157 };
15158
15159 static struct run_at_command_test run_at_command_data_381 = {
15160         .pdu = run_at_command_381,
15161         .pdu_len = sizeof(run_at_command_381),
15162         .qualifier = 0x00,
15163         .alpha_id = "Run AT Command 1",
15164         .at_command = "AT+CGMI",
15165         .text_attr = {
15166                 .len = 4,
15167                 .attributes = { 0x00, 0x10, 0x40, 0xB4 }
15168         }
15169 };
15170
15171 static struct run_at_command_test run_at_command_data_382 = {
15172         .pdu = run_at_command_382,
15173         .pdu_len = sizeof(run_at_command_382),
15174         .qualifier = 0x00,
15175         .alpha_id = "Run AT Command 2",
15176         .at_command = "AT+CGMI",
15177         .text_attr = {
15178                 .len = 4,
15179                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
15180         }
15181 };
15182
15183 static struct run_at_command_test run_at_command_data_383 = {
15184         .pdu = run_at_command_383,
15185         .pdu_len = sizeof(run_at_command_383),
15186         .qualifier = 0x00,
15187         .alpha_id = "Run AT Command 3",
15188         .at_command = "AT+CGMI"
15189 };
15190
15191 static struct run_at_command_test run_at_command_data_391 = {
15192         .pdu = run_at_command_391,
15193         .pdu_len = sizeof(run_at_command_391),
15194         .qualifier = 0x00,
15195         .alpha_id = "Run AT Command 1",
15196         .at_command = "AT+CGMI",
15197         .text_attr = {
15198                 .len = 4,
15199                 .attributes = { 0x00, 0x10, 0x80, 0xB4 }
15200         }
15201 };
15202
15203 static struct run_at_command_test run_at_command_data_392 = {
15204         .pdu = run_at_command_392,
15205         .pdu_len = sizeof(run_at_command_392),
15206         .qualifier = 0x00,
15207         .alpha_id = "Run AT Command 2",
15208         .at_command = "AT+CGMI",
15209         .text_attr = {
15210                 .len = 4,
15211                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
15212         }
15213 };
15214
15215 static struct run_at_command_test run_at_command_data_393 = {
15216         .pdu = run_at_command_393,
15217         .pdu_len = sizeof(run_at_command_393),
15218         .qualifier = 0x00,
15219         .alpha_id = "Run AT Command 3",
15220         .at_command = "AT+CGMI"
15221 };
15222
15223 static struct run_at_command_test run_at_command_data_3101 = {
15224         .pdu = run_at_command_3101,
15225         .pdu_len = sizeof(run_at_command_3101),
15226         .qualifier = 0x00,
15227         .alpha_id = "Run AT Command 1",
15228         .at_command = "AT+CGMI",
15229         .text_attr = {
15230                 .len = 4,
15231                 .attributes = { 0x00, 0x10, 0x00, 0xB4 }
15232         }
15233 };
15234
15235 static struct run_at_command_test run_at_command_data_3102 = {
15236         .pdu = run_at_command_3102,
15237         .pdu_len = sizeof(run_at_command_3102),
15238         .qualifier = 0x00,
15239         .alpha_id = "Run AT Command 2",
15240         .at_command = "AT+CGMI"
15241 };
15242
15243 static struct run_at_command_test run_at_command_data_411 = {
15244         .pdu = run_at_command_411,
15245         .pdu_len = sizeof(run_at_command_411),
15246         .qualifier = 0x00,
15247         .alpha_id = "ЗДРАВСТВУЙТЕ",
15248         .at_command = "AT+CGMI"
15249 };
15250
15251 static struct run_at_command_test run_at_command_data_511 = {
15252         .pdu = run_at_command_511,
15253         .pdu_len = sizeof(run_at_command_511),
15254         .qualifier = 0x00,
15255         .alpha_id = "你好",
15256         .at_command = "AT+CGMI"
15257 };
15258
15259 static struct run_at_command_test run_at_command_data_611 = {
15260         .pdu = run_at_command_611,
15261         .pdu_len = sizeof(run_at_command_611),
15262         .qualifier = 0x00,
15263         .alpha_id = "80ル",
15264         .at_command = "AT+CGMI"
15265 };
15266
15267 static void test_run_at_command(gconstpointer data)
15268 {
15269         const struct run_at_command_test *test = data;
15270         struct stk_command *command;
15271
15272         command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
15273
15274         g_assert(command);
15275         g_assert(command->status == test->status);
15276
15277         g_assert(command->number == 1);
15278         g_assert(command->type == STK_COMMAND_TYPE_RUN_AT_COMMAND);
15279         g_assert(command->qualifier == test->qualifier);
15280
15281         g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
15282         g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_TERMINAL);
15283
15284         check_alpha_id(command->run_at_command.alpha_id, test->alpha_id);
15285         check_at_command(command->run_at_command.at_command, test->at_command);
15286         check_icon_id(&command->run_at_command.icon_id, &test->icon_id);
15287         check_text_attr(&command->run_at_command.text_attr, &test->text_attr);
15288         check_frame_id(&command->run_at_command.frame_id, &test->frame_id);
15289
15290         stk_command_free(command);
15291 }
15292
15293 struct send_dtmf_test {
15294         const unsigned char *pdu;
15295         unsigned int pdu_len;
15296         unsigned char qualifier;
15297         char *alpha_id;
15298         char *dtmf;
15299         struct stk_icon_id icon_id;
15300         struct stk_text_attribute text_attr;
15301         struct stk_frame_id frame_id;
15302 };
15303
15304 static unsigned char send_dtmf_111[] = { 0xD0, 0x0D, 0x81, 0x03, 0x01, 0x14,
15305                                                 0x00, 0x82, 0x02, 0x81, 0x83,
15306                                                 0xAC, 0x02, 0xC1, 0xF2 };
15307
15308 static unsigned char send_dtmf_121[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x14,
15309                                                 0x00, 0x82, 0x02, 0x81, 0x83,
15310                                                 0x85, 0x09, 0x53, 0x65, 0x6E,
15311                                                 0x64, 0x20, 0x44, 0x54, 0x4D,
15312                                                 0x46, 0xAC, 0x05, 0x21, 0x43,
15313                                                 0x65, 0x87, 0x09 };
15314
15315 static unsigned char send_dtmf_131[] = { 0xD0, 0x13, 0x81, 0x03, 0x01, 0x14,
15316                                                 0x00, 0x82, 0x02, 0x81, 0x83,
15317                                                 0x85, 0x00, 0xAC, 0x06, 0xC1,
15318                                                 0xCC, 0xCC, 0xCC, 0xCC, 0x2C };
15319
15320 static unsigned char send_dtmf_211[] = { 0xD0, 0x1D, 0x81, 0x03, 0x01, 0x14,
15321                                                 0x00, 0x82, 0x02, 0x81, 0x83,
15322                                                 0x85, 0x0A, 0x42, 0x61, 0x73,
15323                                                 0x69, 0x63, 0x20, 0x49, 0x63,
15324                                                 0x6F, 0x6E, 0xAC, 0x02, 0xC1,
15325                                                 0xF2, 0x9E, 0x02, 0x00, 0x01 };
15326
15327 static unsigned char send_dtmf_221[] = { 0xD0, 0x1E, 0x81, 0x03, 0x01, 0x14,
15328                                                 0x00, 0x82, 0x02, 0x81, 0x83,
15329                                                 0x85, 0x0B, 0x43, 0x6F, 0x6C,
15330                                                 0x6F, 0x75, 0x72, 0x20, 0x49,
15331                                                 0x63, 0x6F, 0x6E, 0xAC, 0x02,
15332                                                 0xC1, 0xF2, 0x9E, 0x02, 0x00,
15333                                                 0x02 };
15334
15335 static unsigned char send_dtmf_231[] = { 0xD0, 0x1C, 0x81, 0x03, 0x01, 0x14,
15336                                                 0x00, 0x82, 0x02, 0x81, 0x83,
15337                                                 0x85, 0x09, 0x53, 0x65, 0x6E,
15338                                                 0x64, 0x20, 0x44, 0x54, 0x4D,
15339                                                 0x46, 0xAC, 0x02, 0xC1, 0xF2,
15340                                                 0x9E, 0x02, 0x01, 0x01 };
15341
15342 static unsigned char send_dtmf_311[] = { 0xD0, 0x28, 0x81, 0x03, 0x01, 0x14,
15343                                                 0x00, 0x82, 0x02, 0x81, 0x83,
15344                                                 0x85, 0x19, 0x80, 0x04, 0x17,
15345                                                 0x04, 0x14, 0x04, 0x20, 0x04,
15346                                                 0x10, 0x04, 0x12, 0x04, 0x21,
15347                                                 0x04, 0x22, 0x04, 0x12, 0x04,
15348                                                 0x23, 0x04, 0x19, 0x04, 0x22,
15349                                                 0x04, 0x15, 0xAC, 0x02, 0xC1,
15350                                                 0xF2 };
15351
15352 static unsigned char send_dtmf_411[] = { 0xD0, 0x23, 0x81, 0x03, 0x01, 0x14,
15353                                                 0x00, 0x82, 0x02, 0x81, 0x83,
15354                                                 0x85, 0x0B, 0x53, 0x65, 0x6E,
15355                                                 0x64, 0x20, 0x44, 0x54, 0x4D,
15356                                                 0x46, 0x20, 0x31, 0xAC, 0x05,
15357                                                 0x21, 0x43, 0x65, 0x87, 0x09,
15358                                                 0xD0, 0x04, 0x00, 0x0B, 0x00,
15359                                                 0xB4 };
15360
15361 static unsigned char send_dtmf_412[] = { 0xD0, 0x1D, 0x81, 0x03, 0x01, 0x14,
15362                                                 0x00, 0x82, 0x02, 0x81, 0x83,
15363                                                 0x85, 0x0B, 0x53, 0x65, 0x6E,
15364                                                 0x64, 0x20, 0x44, 0x54, 0x4D,
15365                                                 0x46, 0x20, 0x32, 0xAC, 0x05,
15366                                                 0x21, 0x43, 0x65, 0x87, 0x09 };
15367
15368 static unsigned char send_dtmf_421[] = { 0xD0, 0x23, 0x81, 0x03, 0x01, 0x14,
15369                                                 0x00, 0x82, 0x02, 0x81, 0x83,
15370                                                 0x85, 0x0B, 0x53, 0x65, 0x6E,
15371                                                 0x64, 0x20, 0x44, 0x54, 0x4D,
15372                                                 0x46, 0x20, 0x31, 0xAC, 0x05,
15373                                                 0x21, 0x43, 0x65, 0x87, 0x09,
15374                                                 0xD0, 0x04, 0x00, 0x0B, 0x01,
15375                                                 0xB4 };
15376
15377 static unsigned char send_dtmf_422[] = { 0xD0, 0x1D, 0x81, 0x03, 0x01, 0x14,
15378                                                 0x00, 0x82, 0x02, 0x81, 0x83,
15379                                                 0x85, 0x0B, 0x53, 0x65, 0x6E,
15380                                                 0x64, 0x20, 0x44, 0x54, 0x4D,
15381                                                 0x46, 0x20, 0x32, 0xAC, 0x05,
15382                                                 0x21, 0x43, 0x65, 0x87, 0x09 };
15383
15384 static unsigned char send_dtmf_431[] = { 0xD0, 0x23, 0x81, 0x03, 0x01, 0x14,
15385                                                 0x00, 0x82, 0x02, 0x81, 0x83,
15386                                                 0x85, 0x0B, 0x53, 0x65, 0x6E,
15387                                                 0x64, 0x20, 0x44, 0x54, 0x4D,
15388                                                 0x46, 0x20, 0x31, 0xAC, 0x05,
15389                                                 0x21, 0x43, 0x65, 0x87, 0x09,
15390                                                 0xD0, 0x04, 0x00, 0xB0, 0x02,
15391                                                 0xB4 };
15392
15393 static unsigned char send_dtmf_432[] = { 0xD0, 0x1D, 0x81, 0x03, 0x01, 0x14,
15394                                                 0x00, 0x82, 0x02, 0x81, 0x83,
15395                                                 0x85, 0x0B, 0x53, 0x65, 0x6E,
15396                                                 0x64, 0x20, 0x44, 0x54, 0x4D,
15397                                                 0x46, 0x20, 0x32, 0xAC, 0x05,
15398                                                 0x21, 0x43, 0x65, 0x87, 0x09 };
15399
15400 static unsigned char send_dtmf_441[] = { 0xD0, 0x23, 0x81, 0x03, 0x01, 0x14,
15401                                                 0x00, 0x82, 0x02, 0x81, 0x83,
15402                                                 0x85, 0x0B, 0x53, 0x65, 0x6E,
15403                                                 0x64, 0x20, 0x44, 0x54, 0x4D,
15404                                                 0x46, 0x20, 0x31, 0xAC, 0x05,
15405                                                 0x21, 0x43, 0x65, 0x87, 0x09,
15406                                                 0xD0, 0x04, 0x00, 0x0B, 0x04,
15407                                                 0xB4 };
15408
15409 static unsigned char send_dtmf_442[] = { 0xD0, 0x23, 0x81, 0x03, 0x01, 0x14,
15410                                                 0x00, 0x82, 0x02, 0x81, 0x83,
15411                                                 0x85, 0x0B, 0x53, 0x65, 0x6E,
15412                                                 0x64, 0x20, 0x44, 0x54, 0x4D,
15413                                                 0x46, 0x20, 0x32, 0xAC, 0x05,
15414                                                 0x21, 0x43, 0x65, 0x87, 0x09,
15415                                                 0xD0, 0x04, 0x00, 0x0B, 0x00,
15416                                                 0xB4 };
15417
15418 static unsigned char send_dtmf_443[] = { 0xD0, 0x1D, 0x81, 0x03, 0x01, 0x14,
15419                                                 0x00, 0x82, 0x02, 0x81, 0x83,
15420                                                 0x85, 0x0B, 0x53, 0x65, 0x6E,
15421                                                 0x64, 0x20, 0x44, 0x54, 0x4D,
15422                                                 0x46, 0x20, 0x33, 0xAC, 0x05,
15423                                                 0x21, 0x43, 0x65, 0x87, 0x09 };
15424
15425 static unsigned char send_dtmf_451[] = { 0xD0, 0x23, 0x81, 0x03, 0x01, 0x14,
15426                                                 0x00, 0x82, 0x02, 0x81, 0x83,
15427                                                 0x85, 0x0B, 0x53, 0x65, 0x6E,
15428                                                 0x64, 0x20, 0x44, 0x54, 0x4D,
15429                                                 0x46, 0x20, 0x31, 0xAC, 0x05,
15430                                                 0x21, 0x43, 0x65, 0x87, 0x09,
15431                                                 0xD0, 0x04, 0x00, 0x0B, 0x08,
15432                                                 0xB4 };
15433
15434 static unsigned char send_dtmf_452[] = { 0xD0, 0x23, 0x81, 0x03, 0x01, 0x14,
15435                                                 0x00, 0x82, 0x02, 0x81, 0x83,
15436                                                 0x85, 0x0B, 0x53, 0x65, 0x6E,
15437                                                 0x64, 0x20, 0x44, 0x54, 0x4D,
15438                                                 0x46, 0x20, 0x32, 0xAC, 0x05,
15439                                                 0x21, 0x43, 0x65, 0x87, 0x09,
15440                                                 0xD0, 0x04, 0x00, 0x0B, 0x00,
15441                                                 0xB4 };
15442
15443 static unsigned char send_dtmf_453[] = { 0xD0, 0x1D, 0x81, 0x03, 0x01, 0x14,
15444                                                 0x00, 0x82, 0x02, 0x81, 0x83,
15445                                                 0x85, 0x0B, 0x53, 0x65, 0x6E,
15446                                                 0x64, 0x20, 0x44, 0x54, 0x4D,
15447                                                 0x46, 0x20, 0x33, 0xAC, 0x05,
15448                                                 0x21, 0x43, 0x65, 0x87, 0x09 };
15449
15450 /* The last 0x00 in spec should be removed. */
15451 static unsigned char send_dtmf_461[] = { 0xD0, 0x23, 0x81, 0x03, 0x01, 0x14,
15452                                                 0x00, 0x82, 0x02, 0x81, 0x83,
15453                                                 0x85, 0x0B, 0x53, 0x65, 0x6E,
15454                                                 0x64, 0x20, 0x44, 0x54, 0x4D,
15455                                                 0x46, 0x20, 0x31, 0xAC, 0x05,
15456                                                 0x21, 0x43, 0x65, 0x87, 0x09,
15457                                                 0xD0, 0x04, 0x00, 0x0B, 0x10,
15458                                                 0xB4 };
15459
15460 static unsigned char send_dtmf_462[] = { 0xD0, 0x23, 0x81, 0x03, 0x01, 0x14,
15461                                                 0x00, 0x82, 0x02, 0x81, 0x83,
15462                                                 0x85, 0x0B, 0x53, 0x65, 0x6E,
15463                                                 0x64, 0x20, 0x44, 0x54, 0x4D,
15464                                                 0x46, 0x20, 0x32, 0xAC, 0x05,
15465                                                 0x21, 0x43, 0x65, 0x87, 0x09,
15466                                                 0xD0, 0x04, 0x00, 0x0B, 0x00,
15467                                                 0xB4 };
15468
15469 static unsigned char send_dtmf_463[] = { 0xD0, 0x1D, 0x81, 0x03, 0x01, 0x14,
15470                                                 0x00, 0x82, 0x02, 0x81, 0x83,
15471                                                 0x85, 0x0B, 0x53, 0x65, 0x6E,
15472                                                 0x64, 0x20, 0x44, 0x54, 0x4D,
15473                                                 0x46, 0x20, 0x33, 0xAC, 0x05,
15474                                                 0x21, 0x43, 0x65, 0x87, 0x09 };
15475
15476 static unsigned char send_dtmf_471[] = { 0xD0, 0x23, 0x81, 0x03, 0x01, 0x14,
15477                                                 0x00, 0x82, 0x02, 0x81, 0x83,
15478                                                 0x85, 0x0B, 0x53, 0x65, 0x6E,
15479                                                 0x64, 0x20, 0x44, 0x54, 0x4D,
15480                                                 0x46, 0x20, 0x31, 0xAC, 0x05,
15481                                                 0x21, 0x43, 0x65, 0x87, 0x09,
15482                                                 0xD0, 0x04, 0x00, 0x0B, 0x20,
15483                                                 0xB4 };
15484
15485 static unsigned char send_dtmf_472[] = { 0xD0, 0x23, 0x81, 0x03, 0x01, 0x14,
15486                                                 0x00, 0x82, 0x02, 0x81, 0x83,
15487                                                 0x85, 0x0B, 0x53, 0x65, 0x6E,
15488                                                 0x64, 0x20, 0x44, 0x54, 0x4D,
15489                                                 0x46, 0x20, 0x32, 0xAC, 0x05,
15490                                                 0x21, 0x43, 0x65, 0x87, 0x09,
15491                                                 0xD0, 0x04, 0x00, 0x0B, 0x00,
15492                                                 0xB4 };
15493
15494 static unsigned char send_dtmf_473[] = { 0xD0, 0x1D, 0x81, 0x03, 0x01, 0x14,
15495                                                 0x00, 0x82, 0x02, 0x81, 0x83,
15496                                                 0x85, 0x0B, 0x53, 0x65, 0x6E,
15497                                                 0x64, 0x20, 0x44, 0x54, 0x4D,
15498                                                 0x46, 0x20, 0x33, 0xAC, 0x05,
15499                                                 0x21, 0x43, 0x65, 0x87, 0x09 };
15500
15501 static unsigned char send_dtmf_481[] = { 0xD0, 0x23, 0x81, 0x03, 0x01, 0x14,
15502                                                 0x00, 0x82, 0x02, 0x81, 0x83,
15503                                                 0x85, 0x0B, 0x53, 0x65, 0x6E,
15504                                                 0x64, 0x20, 0x44, 0x54, 0x4D,
15505                                                 0x46, 0x20, 0x31, 0xAC, 0x05,
15506                                                 0x21, 0x43, 0x65, 0x87, 0x09,
15507                                                 0xD0, 0x04, 0x00, 0x0B, 0x40,
15508                                                 0xB4 };
15509
15510 static unsigned char send_dtmf_482[] = { 0xD0, 0x23, 0x81, 0x03, 0x01, 0x14,
15511                                                 0x00, 0x82, 0x02, 0x81, 0x83,
15512                                                 0x85, 0x0B, 0x53, 0x65, 0x6E,
15513                                                 0x64, 0x20, 0x44, 0x54, 0x4D,
15514                                                 0x46, 0x20, 0x32, 0xAC, 0x05,
15515                                                 0x21, 0x43, 0x65, 0x87, 0x09,
15516                                                 0xD0, 0x04, 0x00, 0x0B, 0x00,
15517                                                 0xB4 };
15518
15519 static unsigned char send_dtmf_483[] = { 0xD0, 0x1D, 0x81, 0x03, 0x01, 0x14,
15520                                                 0x00, 0x82, 0x02, 0x81, 0x83,
15521                                                 0x85, 0x0B, 0x53, 0x65, 0x6E,
15522                                                 0x64, 0x20, 0x44, 0x54, 0x4D,
15523                                                 0x46, 0x20, 0x33, 0xAC, 0x05,
15524                                                 0x21, 0x43, 0x65, 0x87, 0x09 };
15525
15526 /* The second to the last should be 0x80 */
15527 static unsigned char send_dtmf_491[] = { 0xD0, 0x23, 0x81, 0x03, 0x01, 0x14,
15528                                                 0x00, 0x82, 0x02, 0x81, 0x83,
15529                                                 0x85, 0x0B, 0x53, 0x65, 0x6E,
15530                                                 0x64, 0x20, 0x44, 0x54, 0x4D,
15531                                                 0x46, 0x20, 0x31, 0xAC, 0x05,
15532                                                 0x21, 0x43, 0x65, 0x87, 0x09,
15533                                                 0xD0, 0x04, 0x00, 0x0B, 0x80,
15534                                                 0xB4 };
15535
15536 static unsigned char send_dtmf_492[] = { 0xD0, 0x23, 0x81, 0x03, 0x01, 0x14,
15537                                                 0x00, 0x82, 0x02, 0x81, 0x83,
15538                                                 0x85, 0x0B, 0x53, 0x65, 0x6E,
15539                                                 0x64, 0x20, 0x44, 0x54, 0x4D,
15540                                                 0x46, 0x20, 0x32, 0xAC, 0x05,
15541                                                 0x21, 0x43, 0x65, 0x87, 0x09,
15542                                                 0xD0, 0x04, 0x00, 0x0B, 0x00,
15543                                                 0xB4 };
15544
15545 static unsigned char send_dtmf_493[] = { 0xD0, 0x1D, 0x81, 0x03, 0x01, 0x14,
15546                                                 0x00, 0x82, 0x02, 0x81, 0x83,
15547                                                 0x85, 0x0B, 0x53, 0x65, 0x6E,
15548                                                 0x64, 0x20, 0x44, 0x54, 0x4D,
15549                                                 0x46, 0x20, 0x33, 0xAC, 0x05,
15550                                                 0x21, 0x43, 0x65, 0x87, 0x09 };
15551
15552 static unsigned char send_dtmf_4101[] = { 0xD0, 0x23, 0x81, 0x03, 0x01, 0x14,
15553                                                 0x00, 0x82, 0x02, 0x81, 0x83,
15554                                                 0x85, 0x0B, 0x53, 0x65, 0x6E,
15555                                                 0x64, 0x20, 0x44, 0x54, 0x4D,
15556                                                 0x46, 0x20, 0x31, 0xAC, 0x05,
15557                                                 0x21, 0x43, 0x65, 0x87, 0x09,
15558                                                 0xD0, 0x04, 0x00, 0x0B, 0x00,
15559                                                 0xB4 };
15560
15561 static unsigned char send_dtmf_4102[] = { 0xD0, 0x1D, 0x81, 0x03, 0x01, 0x14,
15562                                                 0x00, 0x82, 0x02, 0x81, 0x83,
15563                                                 0x85, 0x0B, 0x53, 0x65, 0x6E,
15564                                                 0x64, 0x20, 0x44, 0x54, 0x4D,
15565                                                 0x46, 0x20, 0x32, 0xAC, 0x05,
15566                                                 0x21, 0x43, 0x65, 0x87, 0x09 };
15567
15568 static unsigned char send_dtmf_511[] = { 0xD0, 0x14, 0x81, 0x03, 0x01, 0x14,
15569                                                 0x00, 0x82, 0x02, 0x81, 0x83,
15570                                                 0x85, 0x05, 0x80, 0x4F, 0x60,
15571                                                 0x59, 0x7D, 0xAC, 0x02, 0xC1,
15572                                                 0xF2 };
15573
15574 static unsigned char send_dtmf_611[] = { 0xD0, 0x12, 0x81, 0x03, 0x01, 0x14,
15575                                                 0x00, 0x82, 0x02, 0x81, 0x83,
15576                                                 0x85, 0x03, 0x80, 0x30, 0xEB,
15577                                                 0xAC, 0x02, 0xC1, 0xF2 };
15578
15579 static struct send_dtmf_test send_dtmf_data_111 = {
15580         .pdu = send_dtmf_111,
15581         .pdu_len = sizeof(send_dtmf_111),
15582         .qualifier = 0x00,
15583         .dtmf = "1c2"
15584 };
15585
15586 static struct send_dtmf_test send_dtmf_data_121 = {
15587         .pdu = send_dtmf_121,
15588         .pdu_len = sizeof(send_dtmf_121),
15589         .qualifier = 0x00,
15590         .alpha_id = "Send DTMF",
15591         .dtmf = "1234567890"
15592 };
15593
15594 static struct send_dtmf_test send_dtmf_data_131 = {
15595         .pdu = send_dtmf_131,
15596         .pdu_len = sizeof(send_dtmf_131),
15597         .qualifier = 0x00,
15598         .alpha_id = "",
15599         .dtmf = "1cccccccccc2"
15600 };
15601
15602 static struct send_dtmf_test send_dtmf_data_211 = {
15603         .pdu = send_dtmf_211,
15604         .pdu_len = sizeof(send_dtmf_211),
15605         .qualifier = 0x00,
15606         .alpha_id = "Basic Icon",
15607         .dtmf = "1c2",
15608         .icon_id = {
15609                 .qualifier = STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY,
15610                 .id = 0x01
15611         }
15612 };
15613
15614 static struct send_dtmf_test send_dtmf_data_221 = {
15615         .pdu = send_dtmf_221,
15616         .pdu_len = sizeof(send_dtmf_221),
15617         .qualifier = 0x00,
15618         .alpha_id = "Colour Icon",
15619         .dtmf = "1c2",
15620         .icon_id = {
15621                 .qualifier = STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY,
15622                 .id = 0x02
15623         }
15624 };
15625
15626 static struct send_dtmf_test send_dtmf_data_231 = {
15627         .pdu = send_dtmf_231,
15628         .pdu_len = sizeof(send_dtmf_231),
15629         .qualifier = 0x00,
15630         .alpha_id = "Send DTMF",
15631         .dtmf = "1c2",
15632         .icon_id = {
15633                 .qualifier = STK_ICON_QUALIFIER_TYPE_NON_SELF_EXPLANATORY,
15634                 .id = 0x01
15635         }
15636 };
15637
15638 static struct send_dtmf_test send_dtmf_data_311 = {
15639         .pdu = send_dtmf_311,
15640         .pdu_len = sizeof(send_dtmf_311),
15641         .qualifier = 0x00,
15642         .alpha_id = "ЗДРАВСТВУЙТЕ",
15643         .dtmf = "1c2"
15644 };
15645
15646 static struct send_dtmf_test send_dtmf_data_411 = {
15647         .pdu = send_dtmf_411,
15648         .pdu_len = sizeof(send_dtmf_411),
15649         .qualifier = 0x00,
15650         .alpha_id = "Send DTMF 1",
15651         .dtmf = "1234567890",
15652         .text_attr = {
15653                 .len = 4,
15654                 .attributes = { 0x00, 0x0B, 0x00, 0xB4 }
15655         }
15656 };
15657
15658 static struct send_dtmf_test send_dtmf_data_412 = {
15659         .pdu = send_dtmf_412,
15660         .pdu_len = sizeof(send_dtmf_412),
15661         .qualifier = 0x00,
15662         .alpha_id = "Send DTMF 2",
15663         .dtmf = "1234567890"
15664 };
15665
15666 static struct send_dtmf_test send_dtmf_data_421 = {
15667         .pdu = send_dtmf_421,
15668         .pdu_len = sizeof(send_dtmf_421),
15669         .qualifier = 0x00,
15670         .alpha_id = "Send DTMF 1",
15671         .dtmf = "1234567890",
15672         .text_attr = {
15673                 .len = 4,
15674                 .attributes = { 0x00, 0x0B, 0x01, 0xB4 }
15675         }
15676 };
15677
15678 static struct send_dtmf_test send_dtmf_data_422 = {
15679         .pdu = send_dtmf_422,
15680         .pdu_len = sizeof(send_dtmf_422),
15681         .qualifier = 0x00,
15682         .alpha_id = "Send DTMF 2",
15683         .dtmf = "1234567890"
15684 };
15685
15686 static struct send_dtmf_test send_dtmf_data_431 = {
15687         .pdu = send_dtmf_431,
15688         .pdu_len = sizeof(send_dtmf_431),
15689         .qualifier = 0x00,
15690         .alpha_id = "Send DTMF 1",
15691         .dtmf = "1234567890",
15692         .text_attr = {
15693                 .len = 4,
15694                 .attributes = { 0x00, 0xB0, 0x02, 0xB4 }
15695         }
15696 };
15697
15698 static struct send_dtmf_test send_dtmf_data_432 = {
15699         .pdu = send_dtmf_432,
15700         .pdu_len = sizeof(send_dtmf_432),
15701         .qualifier = 0x00,
15702         .alpha_id = "Send DTMF 2",
15703         .dtmf = "1234567890"
15704 };
15705
15706 static struct send_dtmf_test send_dtmf_data_441 = {
15707         .pdu = send_dtmf_441,
15708         .pdu_len = sizeof(send_dtmf_441),
15709         .qualifier = 0x00,
15710         .alpha_id = "Send DTMF 1",
15711         .dtmf = "1234567890",
15712         .text_attr = {
15713                 .len = 4,
15714                 .attributes = { 0x00, 0x0B, 0x04, 0xB4 }
15715         }
15716 };
15717
15718 static struct send_dtmf_test send_dtmf_data_442 = {
15719         .pdu = send_dtmf_442,
15720         .pdu_len = sizeof(send_dtmf_442),
15721         .qualifier = 0x00,
15722         .alpha_id = "Send DTMF 2",
15723         .dtmf = "1234567890",
15724         .text_attr = {
15725                 .len = 4,
15726                 .attributes = { 0x00, 0x0B, 0x00, 0xB4 }
15727         }
15728 };
15729
15730 static struct send_dtmf_test send_dtmf_data_443 = {
15731         .pdu = send_dtmf_443,
15732         .pdu_len = sizeof(send_dtmf_443),
15733         .qualifier = 0x00,
15734         .alpha_id = "Send DTMF 3",
15735         .dtmf = "1234567890"
15736 };
15737
15738 static struct send_dtmf_test send_dtmf_data_451 = {
15739         .pdu = send_dtmf_451,
15740         .pdu_len = sizeof(send_dtmf_451),
15741         .qualifier = 0x00,
15742         .alpha_id = "Send DTMF 1",
15743         .dtmf = "1234567890",
15744         .text_attr = {
15745                 .len = 4,
15746                 .attributes = { 0x00, 0x0B, 0x08, 0xB4 }
15747         }
15748 };
15749
15750 static struct send_dtmf_test send_dtmf_data_452 = {
15751         .pdu = send_dtmf_452,
15752         .pdu_len = sizeof(send_dtmf_452),
15753         .qualifier = 0x00,
15754         .alpha_id = "Send DTMF 2",
15755         .dtmf = "1234567890",
15756         .text_attr = {
15757                 .len = 4,
15758                 .attributes = { 0x00, 0x0B, 0x00, 0xB4 }
15759         }
15760 };
15761
15762 static struct send_dtmf_test send_dtmf_data_453 = {
15763         .pdu = send_dtmf_453,
15764         .pdu_len = sizeof(send_dtmf_453),
15765         .qualifier = 0x00,
15766         .alpha_id = "Send DTMF 3",
15767         .dtmf = "1234567890"
15768 };
15769
15770 static struct send_dtmf_test send_dtmf_data_461 = {
15771         .pdu = send_dtmf_461,
15772         .pdu_len = sizeof(send_dtmf_461),
15773         .qualifier = 0x00,
15774         .alpha_id = "Send DTMF 1",
15775         .dtmf = "1234567890",
15776         .text_attr = {
15777                 .len = 4,
15778                 .attributes = { 0x00, 0x0B, 0x10, 0xB4 }
15779         }
15780 };
15781
15782 static struct send_dtmf_test send_dtmf_data_462 = {
15783         .pdu = send_dtmf_462,
15784         .pdu_len = sizeof(send_dtmf_462),
15785         .qualifier = 0x00,
15786         .alpha_id = "Send DTMF 2",
15787         .dtmf = "1234567890",
15788         .text_attr = {
15789                 .len = 4,
15790                 .attributes = { 0x00, 0x0B, 0x00, 0xB4 }
15791         }
15792 };
15793
15794 static struct send_dtmf_test send_dtmf_data_463 = {
15795         .pdu = send_dtmf_463,
15796         .pdu_len = sizeof(send_dtmf_463),
15797         .qualifier = 0x00,
15798         .alpha_id = "Send DTMF 3",
15799         .dtmf = "1234567890"
15800 };
15801
15802 static struct send_dtmf_test send_dtmf_data_471 = {
15803         .pdu = send_dtmf_471,
15804         .pdu_len = sizeof(send_dtmf_471),
15805         .qualifier = 0x00,
15806         .alpha_id = "Send DTMF 1",
15807         .dtmf = "1234567890",
15808         .text_attr = {
15809                 .len = 4,
15810                 .attributes = { 0x00, 0x0B, 0x20, 0xB4 }
15811         }
15812 };
15813
15814 static struct send_dtmf_test send_dtmf_data_472 = {
15815         .pdu = send_dtmf_472,
15816         .pdu_len = sizeof(send_dtmf_472),
15817         .qualifier = 0x00,
15818         .alpha_id = "Send DTMF 2",
15819         .dtmf = "1234567890",
15820         .text_attr = {
15821                 .len = 4,
15822                 .attributes = { 0x00, 0x0B, 0x00, 0xB4 }
15823         }
15824 };
15825
15826 static struct send_dtmf_test send_dtmf_data_473 = {
15827         .pdu = send_dtmf_473,
15828         .pdu_len = sizeof(send_dtmf_473),
15829         .qualifier = 0x00,
15830         .alpha_id = "Send DTMF 3",
15831         .dtmf = "1234567890"
15832 };
15833
15834 static struct send_dtmf_test send_dtmf_data_481 = {
15835         .pdu = send_dtmf_481,
15836         .pdu_len = sizeof(send_dtmf_481),
15837         .qualifier = 0x00,
15838         .alpha_id = "Send DTMF 1",
15839         .dtmf = "1234567890",
15840         .text_attr = {
15841                 .len = 4,
15842                 .attributes = { 0x00, 0x0B, 0x40, 0xB4 }
15843         }
15844 };
15845
15846 static struct send_dtmf_test send_dtmf_data_482 = {
15847         .pdu = send_dtmf_482,
15848         .pdu_len = sizeof(send_dtmf_482),
15849         .qualifier = 0x00,
15850         .alpha_id = "Send DTMF 2",
15851         .dtmf = "1234567890",
15852         .text_attr = {
15853                 .len = 4,
15854                 .attributes = { 0x00, 0x0B, 0x00, 0xB4 }
15855         }
15856 };
15857
15858 static struct send_dtmf_test send_dtmf_data_483 = {
15859         .pdu = send_dtmf_483,
15860         .pdu_len = sizeof(send_dtmf_483),
15861         .qualifier = 0x00,
15862         .alpha_id = "Send DTMF 3",
15863         .dtmf = "1234567890"
15864 };
15865
15866 static struct send_dtmf_test send_dtmf_data_491 = {
15867         .pdu = send_dtmf_491,
15868         .pdu_len = sizeof(send_dtmf_491),
15869         .qualifier = 0x00,
15870         .alpha_id = "Send DTMF 1",
15871         .dtmf = "1234567890",
15872         .text_attr = {
15873                 .len = 4,
15874                 .attributes = { 0x00, 0x0B, 0x80, 0xB4 }
15875         }
15876 };
15877
15878 static struct send_dtmf_test send_dtmf_data_492 = {
15879         .pdu = send_dtmf_492,
15880         .pdu_len = sizeof(send_dtmf_492),
15881         .qualifier = 0x00,
15882         .alpha_id = "Send DTMF 2",
15883         .dtmf = "1234567890",
15884         .text_attr = {
15885                 .len = 4,
15886                 .attributes = { 0x00, 0x0B, 0x00, 0xB4 }
15887         }
15888 };
15889
15890 static struct send_dtmf_test send_dtmf_data_493 = {
15891         .pdu = send_dtmf_493,
15892         .pdu_len = sizeof(send_dtmf_493),
15893         .qualifier = 0x00,
15894         .alpha_id = "Send DTMF 3",
15895         .dtmf = "1234567890"
15896 };
15897
15898 static struct send_dtmf_test send_dtmf_data_4101 = {
15899         .pdu = send_dtmf_4101,
15900         .pdu_len = sizeof(send_dtmf_4101),
15901         .qualifier = 0x00,
15902         .alpha_id = "Send DTMF 1",
15903         .dtmf = "1234567890",
15904         .text_attr = {
15905                 .len = 4,
15906                 .attributes = { 0x00, 0x0B, 0x00, 0xB4 }
15907         }
15908 };
15909
15910 static struct send_dtmf_test send_dtmf_data_4102 = {
15911         .pdu = send_dtmf_4102,
15912         .pdu_len = sizeof(send_dtmf_4102),
15913         .qualifier = 0x00,
15914         .alpha_id = "Send DTMF 2",
15915         .dtmf = "1234567890"
15916 };
15917
15918 static struct send_dtmf_test send_dtmf_data_511 = {
15919         .pdu = send_dtmf_511,
15920         .pdu_len = sizeof(send_dtmf_511),
15921         .qualifier = 0x00,
15922         .alpha_id = "你好",
15923         .dtmf = "1c2"
15924 };
15925
15926 static struct send_dtmf_test send_dtmf_data_611 = {
15927         .pdu = send_dtmf_611,
15928         .pdu_len = sizeof(send_dtmf_611),
15929         .qualifier = 0x00,
15930         .alpha_id = "ル",
15931         .dtmf = "1c2"
15932 };
15933
15934 static void test_send_dtmf(gconstpointer data)
15935 {
15936         const struct send_dtmf_test *test = data;
15937         struct stk_command *command;
15938
15939         command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
15940
15941         g_assert(command);
15942         g_assert(command->status == STK_PARSE_RESULT_OK);
15943
15944         g_assert(command->number == 1);
15945         g_assert(command->type == STK_COMMAND_TYPE_SEND_DTMF);
15946         g_assert(command->qualifier == test->qualifier);
15947
15948         g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
15949         g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_NETWORK);
15950
15951         check_alpha_id(command->send_dtmf.alpha_id, test->alpha_id);
15952         check_dtmf_string(command->send_dtmf.dtmf, test->dtmf);
15953         check_icon_id(&command->send_dtmf.icon_id, &test->icon_id);
15954         check_text_attr(&command->send_dtmf.text_attr, &test->text_attr);
15955         check_frame_id(&command->send_dtmf.frame_id, &test->frame_id);
15956
15957         stk_command_free(command);
15958 }
15959
15960 struct language_notification_test {
15961         const unsigned char *pdu;
15962         unsigned int pdu_len;
15963         unsigned char qualifier;
15964         char language[3];
15965 };
15966
15967 static unsigned char language_notification_111[] = { 0xD0, 0x0D, 0x81, 0x03,
15968                                                 0x01, 0x35, 0x01, 0x82, 0x02,
15969                                                 0x81, 0x82, 0xAD, 0x02, 0x73,
15970                                                 0x65 };
15971
15972 static unsigned char language_notification_121[] = { 0xD0, 0x09, 0x81, 0x03,
15973                                                 0x01, 0x35, 0x00, 0x82, 0x02,
15974                                                 0x81, 0x82 };
15975
15976 static struct language_notification_test language_notification_data_111 = {
15977         .pdu = language_notification_111,
15978         .pdu_len = sizeof(language_notification_111),
15979         .qualifier = 0x01,
15980         .language = "se"
15981 };
15982
15983 static struct language_notification_test language_notification_data_121 = {
15984         .pdu = language_notification_121,
15985         .pdu_len = sizeof(language_notification_121),
15986         .qualifier = 0x00
15987 };
15988
15989 static void test_language_notification(gconstpointer data)
15990 {
15991         const struct language_notification_test *test = data;
15992         struct stk_command *command;
15993
15994         command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
15995
15996         g_assert(command);
15997         g_assert(command->status == STK_PARSE_RESULT_OK);
15998
15999         g_assert(command->number == 1);
16000         g_assert(command->type == STK_COMMAND_TYPE_LANGUAGE_NOTIFICATION);
16001         g_assert(command->qualifier == test->qualifier);
16002
16003         g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
16004         g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_TERMINAL);
16005
16006         check_language(command->language_notification.language, test->language);
16007
16008         stk_command_free(command);
16009 }
16010
16011 struct launch_browser_test {
16012         const unsigned char *pdu;
16013         unsigned int pdu_len;
16014         unsigned char qualifier;
16015         unsigned char browser_id;
16016         char *url;
16017         struct stk_common_byte_array bearer;
16018         struct stk_file prov_file_refs[MAX_ITEM];
16019         char *text_gateway_proxy_id;
16020         char *alpha_id;
16021         struct stk_icon_id icon_id;
16022         struct stk_text_attribute text_attr;
16023         struct stk_frame_id frame_id;
16024         struct stk_common_byte_array network_name;
16025         char *text_usr;
16026         char *text_passwd;
16027 };
16028
16029 static unsigned char launch_browser_111[] = { 0xD0, 0x18, 0x81, 0x03, 0x01,
16030                                                 0x15, 0x00, 0x82, 0x02, 0x81,
16031                                                 0x82, 0x31, 0x00, 0x05, 0x0B,
16032                                                 0x44, 0x65, 0x66, 0x61, 0x75,
16033                                                 0x6C, 0x74, 0x20, 0x55, 0x52,
16034                                                 0x4C };
16035
16036 static unsigned char launch_browser_121[] = { 0xD0, 0x1F, 0x81, 0x03, 0x01,
16037                                                 0x15, 0x00, 0x82, 0x02, 0x81,
16038                                                 0x82, 0x31, 0x12, 0x68, 0x74,
16039                                                 0x74, 0x70, 0x3A, 0x2F, 0x2F,
16040                                                 0x78, 0x78, 0x78, 0x2E, 0x79,
16041                                                 0x79, 0x79, 0x2E, 0x7A, 0x7A,
16042                                                 0x7A, 0x05, 0x00 };
16043
16044 static unsigned char launch_browser_131[] = { 0xD0, 0x0E, 0x81, 0x03, 0x01,
16045                                                 0x15, 0x00, 0x82, 0x02, 0x81,
16046                                                 0x82, 0x30, 0x01, 0x00, 0x31,
16047                                                 0x00 };
16048
16049 static unsigned char launch_browser_141[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
16050                                                 0x15, 0x00, 0x82, 0x02, 0x81,
16051                                                 0x82, 0x31, 0x00, 0x32, 0x01,
16052                                                 0x03, 0x0D, 0x10, 0x04, 0x61,
16053                                                 0x62, 0x63, 0x2E, 0x64, 0x65,
16054                                                 0x66, 0x2E, 0x67, 0x68, 0x69,
16055                                                 0x2E, 0x6A, 0x6B, 0x6C };
16056
16057 static unsigned char launch_browser_211[] = { 0xD0, 0x18, 0x81, 0x03, 0x01,
16058                                                 0x15, 0x02, 0x82, 0x02, 0x81,
16059                                                 0x82, 0x31, 0x00, 0x05, 0x0B,
16060                                                 0x44, 0x65, 0x66, 0x61, 0x75,
16061                                                 0x6C, 0x74, 0x20, 0x55, 0x52,
16062                                                 0x4C };
16063
16064 static unsigned char launch_browser_221[] = { 0xD0, 0x18, 0x81, 0x03, 0x01,
16065                                                 0x15, 0x03, 0x82, 0x02, 0x81,
16066                                                 0x82, 0x31, 0x00, 0x05, 0x0B,
16067                                                 0x44, 0x65, 0x66, 0x61, 0x75,
16068                                                 0x6C, 0x74, 0x20, 0x55, 0x52,
16069                                                 0x4C };
16070
16071 static unsigned char launch_browser_231[] = { 0xD0, 0x0B, 0x81, 0x03, 0x01,
16072                                                 0x15, 0x00, 0x82, 0x02, 0x81,
16073                                                 0x82, 0x31, 0x00 };
16074
16075 static unsigned char launch_browser_311[] = { 0xD0, 0x26, 0x81, 0x03, 0x01,
16076                                                 0x15, 0x02, 0x82, 0x02, 0x81,
16077                                                 0x82, 0x31, 0x00, 0x05, 0x19,
16078                                                 0x80, 0x04, 0x17, 0x04, 0x14,
16079                                                 0x04, 0x20, 0x04, 0x10, 0x04,
16080                                                 0x12, 0x04, 0x21, 0x04, 0x22,
16081                                                 0x04, 0x12, 0x04, 0x23, 0x04,
16082                                                 0x19, 0x04, 0x22, 0x04, 0x15 };
16083
16084 static unsigned char launch_browser_411[] = { 0xD0, 0x21, 0x81, 0x03, 0x01,
16085                                                 0x15, 0x02, 0x82, 0x02, 0x81,
16086                                                 0x82, 0x31, 0x00, 0x05, 0x10,
16087                                                 0x4E, 0x6F, 0x74, 0x20, 0x73,
16088                                                 0x65, 0x6C, 0x66, 0x20, 0x65,
16089                                                 0x78, 0x70, 0x6C, 0x61, 0x6E,
16090                                                 0x2E, 0x1E, 0x02, 0x01, 0x01 };
16091
16092 static unsigned char launch_browser_421[] = { 0xD0, 0x1D, 0x81, 0x03, 0x01,
16093                                                 0x15, 0x02, 0x82, 0x02, 0x81,
16094                                                 0x82, 0x31, 0x00, 0x05, 0x0C,
16095                                                 0x53, 0x65, 0x6C, 0x66, 0x20,
16096                                                 0x65, 0x78, 0x70, 0x6C, 0x61,
16097                                                 0x6E, 0x2E, 0x1E, 0x02, 0x00,
16098                                                 0x01 };
16099
16100 static unsigned char launch_browser_511[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
16101                                                 0x15, 0x00, 0x82, 0x02, 0x81,
16102                                                 0x82, 0x31, 0x00, 0x05, 0x0D,
16103                                                 0x44, 0x65, 0x66, 0x61, 0x75,
16104                                                 0x6C, 0x74, 0x20, 0x55, 0x52,
16105                                                 0x4C, 0x20, 0x31, 0xD0, 0x04,
16106                                                 0x00, 0x0D, 0x00, 0xB4 };
16107
16108 static unsigned char launch_browser_512[] = { 0xD0, 0x1A, 0x81, 0x03, 0x01,
16109                                                 0x15, 0x00, 0x82, 0x02, 0x81,
16110                                                 0x82, 0x31, 0x00, 0x05, 0x0D,
16111                                                 0x44, 0x65, 0x66, 0x61, 0x75,
16112                                                 0x6C, 0x74, 0x20, 0x55, 0x52,
16113                                                 0x4C, 0x20, 0x32 };
16114
16115 static unsigned char launch_browser_521[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
16116                                                 0x15, 0x00, 0x82, 0x02, 0x81,
16117                                                 0x82, 0x31, 0x00, 0x05, 0x0D,
16118                                                 0x44, 0x65, 0x66, 0x61, 0x75,
16119                                                 0x6C, 0x74, 0x20, 0x55, 0x52,
16120                                                 0x4C, 0x20, 0x31, 0xD0, 0x04,
16121                                                 0x00, 0x0D, 0x01, 0xB4 };
16122
16123 static unsigned char launch_browser_522[] = { 0xD0, 0x1A, 0x81, 0x03, 0x01,
16124                                                 0x15, 0x00, 0x82, 0x02, 0x81,
16125                                                 0x82, 0x31, 0x00, 0x05, 0x0D,
16126                                                 0x44, 0x65, 0x66, 0x61, 0x75,
16127                                                 0x6C, 0x74, 0x20, 0x55, 0x52,
16128                                                 0x4C, 0x20, 0x32 };
16129
16130 static unsigned char launch_browser_531[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
16131                                                 0x15, 0x00, 0x82, 0x02, 0x81,
16132                                                 0x82, 0x31, 0x00, 0x05, 0x0D,
16133                                                 0x44, 0x65, 0x66, 0x61, 0x75,
16134                                                 0x6C, 0x74, 0x20, 0x55, 0x52,
16135                                                 0x4C, 0x20, 0x31, 0xD0, 0x04,
16136                                                 0x00, 0x0D, 0x02, 0xB4 };
16137
16138 static unsigned char launch_browser_532[] = { 0xD0, 0x1A, 0x81, 0x03, 0x01,
16139                                                 0x15, 0x00, 0x82, 0x02, 0x81,
16140                                                 0x82, 0x31, 0x00, 0x05, 0x0D,
16141                                                 0x44, 0x65, 0x66, 0x61, 0x75,
16142                                                 0x6C, 0x74, 0x20, 0x55, 0x52,
16143                                                 0x4C, 0x20, 0x32 };
16144
16145 static unsigned char launch_browser_541[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
16146                                                 0x15, 0x00, 0x82, 0x02, 0x81,
16147                                                 0x82, 0x31, 0x00, 0x05, 0x0D,
16148                                                 0x44, 0x65, 0x66, 0x61, 0x75,
16149                                                 0x6C, 0x74, 0x20, 0x55, 0x52,
16150                                                 0x4C, 0x20, 0x31, 0xD0, 0x04,
16151                                                 0x00, 0x0D, 0x04, 0xB4 };
16152
16153 static unsigned char launch_browser_542[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
16154                                                 0x15, 0x00, 0x82, 0x02, 0x81,
16155                                                 0x82, 0x31, 0x00, 0x05, 0x0D,
16156                                                 0x44, 0x65, 0x66, 0x61, 0x75,
16157                                                 0x6C, 0x74, 0x20, 0x55, 0x52,
16158                                                 0x4C, 0x20, 0x32, 0xD0, 0x04,
16159                                                 0x00, 0x0D, 0x00, 0xB4 };
16160
16161 static unsigned char launch_browser_543[] = { 0xD0, 0x1A, 0x81, 0x03, 0x01,
16162                                                 0x15, 0x00, 0x82, 0x02, 0x81,
16163                                                 0x82, 0x31, 0x00, 0x05, 0x0D,
16164                                                 0x44, 0x65, 0x66, 0x61, 0x75,
16165                                                 0x6C, 0x74, 0x20, 0x55, 0x52,
16166                                                 0x4C, 0x20, 0x33 };
16167
16168 static unsigned char launch_browser_551[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
16169                                                 0x15, 0x00, 0x82, 0x02, 0x81,
16170                                                 0x82, 0x31, 0x00, 0x05, 0x0D,
16171                                                 0x44, 0x65, 0x66, 0x61, 0x75,
16172                                                 0x6C, 0x74, 0x20, 0x55, 0x52,
16173                                                 0x4C, 0x20, 0x31, 0xD0, 0x04,
16174                                                 0x00, 0x0D, 0x08, 0xB4 };
16175
16176 static unsigned char launch_browser_552[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
16177                                                 0x15, 0x00, 0x82, 0x02, 0x81,
16178                                                 0x82, 0x31, 0x00, 0x05, 0x0D,
16179                                                 0x44, 0x65, 0x66, 0x61, 0x75,
16180                                                 0x6C, 0x74, 0x20, 0x55, 0x52,
16181                                                 0x4C, 0x20, 0x32, 0xD0, 0x04,
16182                                                 0x00, 0x0D, 0x00, 0xB4 };
16183
16184 static unsigned char launch_browser_553[] = { 0xD0, 0x1A, 0x81, 0x03, 0x01,
16185                                                 0x15, 0x00, 0x82, 0x02, 0x81,
16186                                                 0x82, 0x31, 0x00, 0x05, 0x0D,
16187                                                 0x44, 0x65, 0x66, 0x61, 0x75,
16188                                                 0x6C, 0x74, 0x20, 0x55, 0x52,
16189                                                 0x4C, 0x20, 0x33 };
16190
16191 static unsigned char launch_browser_561[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
16192                                                 0x15, 0x00, 0x82, 0x02, 0x81,
16193                                                 0x82, 0x31, 0x00, 0x05, 0x0D,
16194                                                 0x44, 0x65, 0x66, 0x61, 0x75,
16195                                                 0x6C, 0x74, 0x20, 0x55, 0x52,
16196                                                 0x4C, 0x20, 0x31, 0xD0, 0x04,
16197                                                 0x00, 0x0D, 0x10, 0xB4 };
16198
16199 static unsigned char launch_browser_562[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
16200                                                 0x15, 0x00, 0x82, 0x02, 0x81,
16201                                                 0x82, 0x31, 0x00, 0x05, 0x0D,
16202                                                 0x44, 0x65, 0x66, 0x61, 0x75,
16203                                                 0x6C, 0x74, 0x20, 0x55, 0x52,
16204                                                 0x4C, 0x20, 0x32, 0xD0, 0x04,
16205                                                 0x00, 0x0D, 0x00, 0xB4 };
16206
16207 static unsigned char launch_browser_563[] = { 0xD0, 0x1A, 0x81, 0x03, 0x01,
16208                                                 0x15, 0x00, 0x82, 0x02, 0x81,
16209                                                 0x82, 0x31, 0x00, 0x05, 0x0D,
16210                                                 0x44, 0x65, 0x66, 0x61, 0x75,
16211                                                 0x6C, 0x74, 0x20, 0x55, 0x52,
16212                                                 0x4C, 0x20, 0x33 };
16213
16214 static unsigned char launch_browser_571[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
16215                                                 0x15, 0x00, 0x82, 0x02, 0x81,
16216                                                 0x82, 0x31, 0x00, 0x05, 0x0D,
16217                                                 0x44, 0x65, 0x66, 0x61, 0x75,
16218                                                 0x6C, 0x74, 0x20, 0x55, 0x52,
16219                                                 0x4C, 0x20, 0x31, 0xD0, 0x04,
16220                                                 0x00, 0x0D, 0x20, 0xB4 };
16221
16222 static unsigned char launch_browser_572[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
16223                                                 0x15, 0x00, 0x82, 0x02, 0x81,
16224                                                 0x82, 0x31, 0x00, 0x05, 0x0D,
16225                                                 0x44, 0x65, 0x66, 0x61, 0x75,
16226                                                 0x6C, 0x74, 0x20, 0x55, 0x52,
16227                                                 0x4C, 0x20, 0x32, 0xD0, 0x04,
16228                                                 0x00, 0x0D, 0x00, 0xB4 };
16229
16230 static unsigned char launch_browser_573[] = { 0xD0, 0x1A, 0x81, 0x03, 0x01,
16231                                                 0x15, 0x00, 0x82, 0x02, 0x81,
16232                                                 0x82, 0x31, 0x00, 0x05, 0x0D,
16233                                                 0x44, 0x65, 0x66, 0x61, 0x75,
16234                                                 0x6C, 0x74, 0x20, 0x55, 0x52,
16235                                                 0x4C, 0x20, 0x33 };
16236
16237 static unsigned char launch_browser_581[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
16238                                                 0x15, 0x00, 0x82, 0x02, 0x81,
16239                                                 0x82, 0x31, 0x00, 0x05, 0x0D,
16240                                                 0x44, 0x65, 0x66, 0x61, 0x75,
16241                                                 0x6C, 0x74, 0x20, 0x55, 0x52,
16242                                                 0x4C, 0x20, 0x31, 0xD0, 0x04,
16243                                                 0x00, 0x0D, 0x40, 0xB4 };
16244
16245 static unsigned char launch_browser_582[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
16246                                                 0x15, 0x00, 0x82, 0x02, 0x81,
16247                                                 0x82, 0x31, 0x00, 0x05, 0x0D,
16248                                                 0x44, 0x65, 0x66, 0x61, 0x75,
16249                                                 0x6C, 0x74, 0x20, 0x55, 0x52,
16250                                                 0x4C, 0x20, 0x32, 0xD0, 0x04,
16251                                                 0x00, 0x0D, 0x00, 0xB4 };
16252
16253 static unsigned char launch_browser_583[] = { 0xD0, 0x1A, 0x81, 0x03, 0x01,
16254                                                 0x15, 0x00, 0x82, 0x02, 0x81,
16255                                                 0x82, 0x31, 0x00, 0x05, 0x0D,
16256                                                 0x44, 0x65, 0x66, 0x61, 0x75,
16257                                                 0x6C, 0x74, 0x20, 0x55, 0x52,
16258                                                 0x4C, 0x20, 0x33 };
16259
16260 static unsigned char launch_browser_591[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
16261                                                 0x15, 0x00, 0x82, 0x02, 0x81,
16262                                                 0x82, 0x31, 0x00, 0x05, 0x0D,
16263                                                 0x44, 0x65, 0x66, 0x61, 0x75,
16264                                                 0x6C, 0x74, 0x20, 0x55, 0x52,
16265                                                 0x4C, 0x20, 0x31, 0xD0, 0x04,
16266                                                 0x00, 0x0D, 0x80, 0xB4 };
16267
16268 static unsigned char launch_browser_592[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
16269                                                 0x15, 0x00, 0x82, 0x02, 0x81,
16270                                                 0x82, 0x31, 0x00, 0x05, 0x0D,
16271                                                 0x44, 0x65, 0x66, 0x61, 0x75,
16272                                                 0x6C, 0x74, 0x20, 0x55, 0x52,
16273                                                 0x4C, 0x20, 0x32, 0xD0, 0x04,
16274                                                 0x00, 0x0D, 0x00, 0xB4 };
16275
16276 static unsigned char launch_browser_593[] = { 0xD0, 0x1A, 0x81, 0x03, 0x01,
16277                                                 0x15, 0x00, 0x82, 0x02, 0x81,
16278                                                 0x82, 0x31, 0x00, 0x05, 0x0D,
16279                                                 0x44, 0x65, 0x66, 0x61, 0x75,
16280                                                 0x6C, 0x74, 0x20, 0x55, 0x52,
16281                                                 0x4C, 0x20, 0x33 };
16282
16283 static unsigned char launch_browser_5101[] = { 0xD0, 0x20, 0x81, 0x03, 0x01,
16284                                                 0x15, 0x00, 0x82, 0x02, 0x81,
16285                                                 0x82, 0x31, 0x00, 0x05, 0x0D,
16286                                                 0x44, 0x65, 0x66, 0x61, 0x75,
16287                                                 0x6C, 0x74, 0x20, 0x55, 0x52,
16288                                                 0x4C, 0x20, 0x31, 0xD0, 0x04,
16289                                                 0x00, 0x0D, 0x00, 0xB4 };
16290
16291 static unsigned char launch_browser_5102[] = { 0xD0, 0x1A, 0x81, 0x03, 0x01,
16292                                                 0x15, 0x00, 0x82, 0x02, 0x81,
16293                                                 0x82, 0x31, 0x00, 0x05, 0x0D,
16294                                                 0x44, 0x65, 0x66, 0x61, 0x75,
16295                                                 0x6C, 0x74, 0x20, 0x55, 0x52,
16296                                                 0x4C, 0x20, 0x32 };
16297
16298 static unsigned char launch_browser_611[] = { 0xD0, 0x12, 0x81, 0x03, 0x01,
16299                                                 0x15, 0x02, 0x82, 0x02, 0x81,
16300                                                 0x82, 0x31, 0x00, 0x05, 0x05,
16301                                                 0x80, 0x4F, 0x60, 0x59, 0x7D };
16302
16303 static unsigned char launch_browser_711[] = { 0xD0, 0x10, 0x81, 0x03, 0x01,
16304                                                 0x15, 0x02, 0x82, 0x02, 0x81,
16305                                                 0x82, 0x31, 0x00, 0x05, 0x03,
16306                                                 0x80, 0x30, 0xEB };
16307
16308 static struct launch_browser_test launch_browser_data_111 = {
16309         .pdu = launch_browser_111,
16310         .pdu_len = sizeof(launch_browser_111),
16311         .qualifier = 0x00,
16312         .alpha_id = "Default URL"
16313 };
16314
16315 static struct launch_browser_test launch_browser_data_121 = {
16316         .pdu = launch_browser_121,
16317         .pdu_len = sizeof(launch_browser_121),
16318         .qualifier = 0x00,
16319         .alpha_id = "",
16320         .url = "http://xxx.yyy.zzz"
16321 };
16322
16323 static struct launch_browser_test launch_browser_data_131 = {
16324         .pdu = launch_browser_131,
16325         .pdu_len = sizeof(launch_browser_131),
16326         .qualifier = 0x00
16327 };
16328
16329 static struct launch_browser_test launch_browser_data_141 = {
16330         .pdu = launch_browser_141,
16331         .pdu_len = sizeof(launch_browser_141),
16332         .qualifier = 0x00,
16333         .bearer = {
16334                 .len = 1,
16335                 .array = (unsigned char *) "\x03"
16336         },
16337         .text_gateway_proxy_id = "abc.def.ghi.jkl"
16338 };
16339
16340 static struct launch_browser_test launch_browser_data_211 = {
16341         .pdu = launch_browser_211,
16342         .pdu_len = sizeof(launch_browser_211),
16343         .qualifier = 0x02,
16344         .alpha_id = "Default URL"
16345 };
16346
16347 static struct launch_browser_test launch_browser_data_221 = {
16348         .pdu = launch_browser_221,
16349         .pdu_len = sizeof(launch_browser_221),
16350         .qualifier = 0x03,
16351         .alpha_id = "Default URL"
16352 };
16353
16354 static struct launch_browser_test launch_browser_data_231 = {
16355         .pdu = launch_browser_231,
16356         .pdu_len = sizeof(launch_browser_231),
16357         .qualifier = 0x00
16358 };
16359
16360 static struct launch_browser_test launch_browser_data_311 = {
16361         .pdu = launch_browser_311,
16362         .pdu_len = sizeof(launch_browser_311),
16363         .qualifier = 0x02,
16364         .alpha_id = "ЗДРАВСТВУЙТЕ"
16365 };
16366
16367 static struct launch_browser_test launch_browser_data_411 = {
16368         .pdu = launch_browser_411,
16369         .pdu_len = sizeof(launch_browser_411),
16370         .qualifier = 0x02,
16371         .alpha_id = "Not self explan.",
16372         .icon_id = {
16373                 .qualifier = STK_ICON_QUALIFIER_TYPE_NON_SELF_EXPLANATORY,
16374                 .id = 0x01
16375         }
16376 };
16377
16378 static struct launch_browser_test launch_browser_data_421 = {
16379         .pdu = launch_browser_421,
16380         .pdu_len = sizeof(launch_browser_421),
16381         .qualifier = 0x02,
16382         .alpha_id = "Self explan.",
16383         .icon_id = {
16384                 .qualifier = STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY,
16385                 .id = 0x01
16386         }
16387 };
16388
16389 static struct launch_browser_test launch_browser_data_511 = {
16390         .pdu = launch_browser_511,
16391         .pdu_len = sizeof(launch_browser_511),
16392         .qualifier = 0x00,
16393         .alpha_id = "Default URL 1",
16394         .text_attr = {
16395                 .len = 4,
16396                 .attributes = { 0x00, 0x0D, 0x00, 0xB4 }
16397         }
16398 };
16399
16400 static struct launch_browser_test launch_browser_data_512 = {
16401         .pdu = launch_browser_512,
16402         .pdu_len = sizeof(launch_browser_512),
16403         .qualifier = 0x00,
16404         .alpha_id = "Default URL 2"
16405 };
16406
16407 static struct launch_browser_test launch_browser_data_521 = {
16408         .pdu = launch_browser_521,
16409         .pdu_len = sizeof(launch_browser_521),
16410         .qualifier = 0x00,
16411         .alpha_id = "Default URL 1",
16412         .text_attr = {
16413                 .len = 4,
16414                 .attributes = { 0x00, 0x0D, 0x01, 0xB4 }
16415         }
16416 };
16417
16418 static struct launch_browser_test launch_browser_data_522 = {
16419         .pdu = launch_browser_522,
16420         .pdu_len = sizeof(launch_browser_522),
16421         .qualifier = 0x00,
16422         .alpha_id = "Default URL 2"
16423 };
16424
16425 static struct launch_browser_test launch_browser_data_531 = {
16426         .pdu = launch_browser_531,
16427         .pdu_len = sizeof(launch_browser_531),
16428         .qualifier = 0x00,
16429         .alpha_id = "Default URL 1",
16430         .text_attr = {
16431                 .len = 4,
16432                 .attributes = { 0x00, 0x0D, 0x02, 0xB4 }
16433         }
16434 };
16435
16436 static struct launch_browser_test launch_browser_data_532 = {
16437         .pdu = launch_browser_532,
16438         .pdu_len = sizeof(launch_browser_532),
16439         .qualifier = 0x00,
16440         .alpha_id = "Default URL 2"
16441 };
16442
16443 static struct launch_browser_test launch_browser_data_541 = {
16444         .pdu = launch_browser_541,
16445         .pdu_len = sizeof(launch_browser_541),
16446         .qualifier = 0x00,
16447         .alpha_id = "Default URL 1",
16448         .text_attr = {
16449                 .len = 4,
16450                 .attributes = { 0x00, 0x0D, 0x04, 0xB4 }
16451         }
16452 };
16453
16454 static struct launch_browser_test launch_browser_data_542 = {
16455         .pdu = launch_browser_542,
16456         .pdu_len = sizeof(launch_browser_542),
16457         .qualifier = 0x00,
16458         .alpha_id = "Default URL 2",
16459         .text_attr = {
16460                 .len = 4,
16461                 .attributes = { 0x00, 0x0D, 0x00, 0xB4 }
16462         }
16463 };
16464
16465 static struct launch_browser_test launch_browser_data_543 = {
16466         .pdu = launch_browser_543,
16467         .pdu_len = sizeof(launch_browser_543),
16468         .qualifier = 0x00,
16469         .alpha_id = "Default URL 3"
16470 };
16471
16472 static struct launch_browser_test launch_browser_data_551 = {
16473         .pdu = launch_browser_551,
16474         .pdu_len = sizeof(launch_browser_551),
16475         .qualifier = 0x00,
16476         .alpha_id = "Default URL 1",
16477         .text_attr = {
16478                 .len = 4,
16479                 .attributes = { 0x00, 0x0D, 0x08, 0xB4 }
16480         }
16481 };
16482
16483 static struct launch_browser_test launch_browser_data_552 = {
16484         .pdu = launch_browser_552,
16485         .pdu_len = sizeof(launch_browser_552),
16486         .qualifier = 0x00,
16487         .alpha_id = "Default URL 2",
16488         .text_attr = {
16489                 .len = 4,
16490                 .attributes = { 0x00, 0x0D, 0x00, 0xB4 }
16491         }
16492 };
16493
16494 static struct launch_browser_test launch_browser_data_553 = {
16495         .pdu = launch_browser_553,
16496         .pdu_len = sizeof(launch_browser_553),
16497         .qualifier = 0x00,
16498         .alpha_id = "Default URL 3"
16499 };
16500
16501 static struct launch_browser_test launch_browser_data_561 = {
16502         .pdu = launch_browser_561,
16503         .pdu_len = sizeof(launch_browser_561),
16504         .qualifier = 0x00,
16505         .alpha_id = "Default URL 1",
16506         .text_attr = {
16507                 .len = 4,
16508                 .attributes = { 0x00, 0x0D, 0x10, 0xB4 }
16509         }
16510 };
16511
16512 static struct launch_browser_test launch_browser_data_562 = {
16513         .pdu = launch_browser_562,
16514         .pdu_len = sizeof(launch_browser_562),
16515         .qualifier = 0x00,
16516         .alpha_id = "Default URL 2",
16517         .text_attr = {
16518                 .len = 4,
16519                 .attributes = { 0x00, 0x0D, 0x00, 0xB4 }
16520         }
16521 };
16522
16523 static struct launch_browser_test launch_browser_data_563 = {
16524         .pdu = launch_browser_563,
16525         .pdu_len = sizeof(launch_browser_563),
16526         .qualifier = 0x00,
16527         .alpha_id = "Default URL 3"
16528 };
16529
16530 static struct launch_browser_test launch_browser_data_571 = {
16531         .pdu = launch_browser_571,
16532         .pdu_len = sizeof(launch_browser_571),
16533         .qualifier = 0x00,
16534         .alpha_id = "Default URL 1",
16535         .text_attr = {
16536                 .len = 4,
16537                 .attributes = { 0x00, 0x0D, 0x20, 0xB4 }
16538         }
16539 };
16540
16541 static struct launch_browser_test launch_browser_data_572 = {
16542         .pdu = launch_browser_572,
16543         .pdu_len = sizeof(launch_browser_572),
16544         .qualifier = 0x00,
16545         .alpha_id = "Default URL 2",
16546         .text_attr = {
16547                 .len = 4,
16548                 .attributes = { 0x00, 0x0D, 0x00, 0xB4 }
16549         }
16550 };
16551
16552 static struct launch_browser_test launch_browser_data_573 = {
16553         .pdu = launch_browser_573,
16554         .pdu_len = sizeof(launch_browser_573),
16555         .qualifier = 0x00,
16556         .alpha_id = "Default URL 3"
16557 };
16558
16559 static struct launch_browser_test launch_browser_data_581 = {
16560         .pdu = launch_browser_581,
16561         .pdu_len = sizeof(launch_browser_581),
16562         .qualifier = 0x00,
16563         .alpha_id = "Default URL 1",
16564         .text_attr = {
16565                 .len = 4,
16566                 .attributes = { 0x00, 0x0D, 0x40, 0xB4 }
16567         }
16568 };
16569
16570 static struct launch_browser_test launch_browser_data_582 = {
16571         .pdu = launch_browser_582,
16572         .pdu_len = sizeof(launch_browser_582),
16573         .qualifier = 0x00,
16574         .alpha_id = "Default URL 2",
16575         .text_attr = {
16576                 .len = 4,
16577                 .attributes = { 0x00, 0x0D, 0x00, 0xB4 }
16578         }
16579 };
16580
16581 static struct launch_browser_test launch_browser_data_583 = {
16582         .pdu = launch_browser_583,
16583         .pdu_len = sizeof(launch_browser_583),
16584         .qualifier = 0x00,
16585         .alpha_id = "Default URL 3"
16586 };
16587
16588 static struct launch_browser_test launch_browser_data_591 = {
16589         .pdu = launch_browser_591,
16590         .pdu_len = sizeof(launch_browser_591),
16591         .qualifier = 0x00,
16592         .alpha_id = "Default URL 1",
16593         .text_attr = {
16594                 .len = 4,
16595                 .attributes = { 0x00, 0x0D, 0x80, 0xB4 }
16596         }
16597 };
16598
16599 static struct launch_browser_test launch_browser_data_592 = {
16600         .pdu = launch_browser_592,
16601         .pdu_len = sizeof(launch_browser_592),
16602         .qualifier = 0x00,
16603         .alpha_id = "Default URL 2",
16604         .text_attr = {
16605                 .len = 4,
16606                 .attributes = { 0x00, 0x0D, 0x00, 0xB4 }
16607         }
16608 };
16609
16610 static struct launch_browser_test launch_browser_data_593 = {
16611         .pdu = launch_browser_593,
16612         .pdu_len = sizeof(launch_browser_593),
16613         .qualifier = 0x00,
16614         .alpha_id = "Default URL 3"
16615 };
16616
16617 static struct launch_browser_test launch_browser_data_5101 = {
16618         .pdu = launch_browser_5101,
16619         .pdu_len = sizeof(launch_browser_5101),
16620         .qualifier = 0x00,
16621         .alpha_id = "Default URL 1",
16622         .text_attr = {
16623                 .len = 4,
16624                 .attributes = { 0x00, 0x0D, 0x00, 0xB4 }
16625         }
16626 };
16627
16628 static struct launch_browser_test launch_browser_data_5102 = {
16629         .pdu = launch_browser_5102,
16630         .pdu_len = sizeof(launch_browser_5102),
16631         .qualifier = 0x00,
16632         .alpha_id = "Default URL 2"
16633 };
16634
16635 static struct launch_browser_test launch_browser_data_611 = {
16636         .pdu = launch_browser_611,
16637         .pdu_len = sizeof(launch_browser_611),
16638         .qualifier = 0x02,
16639         .alpha_id = "你好"
16640 };
16641
16642 static struct launch_browser_test launch_browser_data_711 = {
16643         .pdu = launch_browser_711,
16644         .pdu_len = sizeof(launch_browser_711),
16645         .qualifier = 0x02,
16646         .alpha_id = "ル"
16647 };
16648
16649 static void test_launch_browser(gconstpointer data)
16650 {
16651         const struct launch_browser_test *test = data;
16652         struct stk_command *command;
16653
16654         command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
16655
16656         g_assert(command);
16657         g_assert(command->status == STK_PARSE_RESULT_OK);
16658
16659         g_assert(command->number == 1);
16660         g_assert(command->type == STK_COMMAND_TYPE_LAUNCH_BROWSER);
16661         g_assert(command->qualifier == test->qualifier);
16662
16663         g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
16664         g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_TERMINAL);
16665
16666         check_browser_id(command->launch_browser.browser_id, test->browser_id);
16667         check_url(command->launch_browser.url, test->url);
16668         check_bearer(&command->launch_browser.bearer, &test->bearer);
16669         check_provisioning_file_references(
16670                 command->launch_browser.prov_file_refs, test->prov_file_refs);
16671         check_text(command->launch_browser.text_gateway_proxy_id,
16672                                                 test->text_gateway_proxy_id);
16673         check_alpha_id(command->launch_browser.alpha_id, test->alpha_id);
16674         check_icon_id(&command->launch_browser.icon_id, &test->icon_id);
16675         check_text_attr(&command->launch_browser.text_attr, &test->text_attr);
16676         check_frame_id(&command->launch_browser.frame_id, &test->frame_id);
16677         check_text(command->launch_browser.text_usr, test->text_usr);
16678         check_text(command->launch_browser.text_passwd, test->text_passwd);
16679
16680         stk_command_free(command);
16681 }
16682
16683 struct open_channel_test {
16684         const unsigned char *pdu;
16685         unsigned int pdu_len;
16686         unsigned char qualifier;
16687         char *alpha_id;
16688         struct stk_icon_id icon_id;
16689         struct stk_bearer_description bearer_desc;
16690         unsigned short buf_size;
16691         char *apn;
16692         struct stk_other_address local_addr;
16693         char *text_usr;
16694         char *text_passwd;
16695         struct stk_uicc_te_interface uti;
16696         struct stk_other_address data_dest_addr;
16697         struct stk_text_attribute text_attr;
16698         struct stk_frame_id frame_id;
16699 };
16700
16701 static unsigned char open_channel_211[] = { 0xD0, 0x36, 0x81, 0x03, 0x01, 0x40,
16702                                                 0x01, 0x82, 0x02, 0x81, 0x82,
16703                                                 0x35, 0x07, 0x02, 0x03, 0x04,
16704                                                 0x03, 0x04, 0x1F, 0x02, 0x39,
16705                                                 0x02, 0x05, 0x78, 0x0D, 0x08,
16706                                                 0xF4, 0x55, 0x73, 0x65, 0x72,
16707                                                 0x4C, 0x6F, 0x67, 0x0D, 0x08,
16708                                                 0xF4, 0x55, 0x73, 0x65, 0x72,
16709                                                 0x50, 0x77, 0x64, 0x3C, 0x03,
16710                                                 0x01, 0xAD, 0x9C, 0x3E, 0x05,
16711                                                 0x21, 0x01, 0x01, 0x01, 0x01 };
16712
16713 static unsigned char open_channel_221[] = { 0xD0, 0x42, 0x81, 0x03, 0x01, 0x40,
16714                                                 0x01, 0x82, 0x02, 0x81, 0x82,
16715                                                 0x35, 0x07, 0x02, 0x03, 0x04,
16716                                                 0x03, 0x04, 0x1F, 0x02, 0x39,
16717                                                 0x02, 0x05, 0x78, 0x47, 0x0A,
16718                                                 0x06, 0x54, 0x65, 0x73, 0x74,
16719                                                 0x47, 0x70, 0x02, 0x72, 0x73,
16720                                                 0x0D, 0x08, 0xF4, 0x55, 0x73,
16721                                                 0x65, 0x72, 0x4C, 0x6F, 0x67,
16722                                                 0x0D, 0x08, 0xF4, 0x55, 0x73,
16723                                                 0x65, 0x72, 0x50, 0x77, 0x64,
16724                                                 0x3C, 0x03, 0x01, 0xAD, 0x9C,
16725                                                 0x3E, 0x05, 0x21, 0x01, 0x01,
16726                                                 0x01, 0x01 };
16727
16728 static unsigned char open_channel_231[] = { 0xD0, 0x4B, 0x81, 0x03, 0x01, 0x40,
16729                                                 0x01, 0x82, 0x02, 0x81, 0x82,
16730                                                 0x05, 0x07, 0x4F, 0x70, 0x65,
16731                                                 0x6E, 0x20, 0x49, 0x44, 0x35,
16732                                                 0x07, 0x02, 0x03, 0x04, 0x03,
16733                                                 0x04, 0x1F, 0x02, 0x39, 0x02,
16734                                                 0x05, 0x78, 0x47, 0x0A, 0x06,
16735                                                 0x54, 0x65, 0x73, 0x74, 0x47,
16736                                                 0x70, 0x02, 0x72, 0x73, 0x0D,
16737                                                 0x08, 0xF4, 0x55, 0x73, 0x65,
16738                                                 0x72, 0x4C, 0x6F, 0x67, 0x0D,
16739                                                 0x08, 0xF4, 0x55, 0x73, 0x65,
16740                                                 0x72, 0x50, 0x77, 0x64, 0x3C,
16741                                                 0x03, 0x01, 0xAD, 0x9C, 0x3E,
16742                                                 0x05, 0x21, 0x01, 0x01, 0x01,
16743                                                 0x01 };
16744
16745 static unsigned char open_channel_241[] = { 0xD0, 0x44, 0x81, 0x03, 0x01, 0x40,
16746                                                 0x01, 0x82, 0x02, 0x81, 0x82,
16747                                                 0x05, 0x00, 0x35, 0x07, 0x02,
16748                                                 0x03, 0x04, 0x03, 0x04, 0x1F,
16749                                                 0x02, 0x39, 0x02, 0x05, 0x78,
16750                                                 0x47, 0x0A, 0x06, 0x54, 0x65,
16751                                                 0x73, 0x74, 0x47, 0x70, 0x02,
16752                                                 0x72, 0x73, 0x0D, 0x08, 0xF4,
16753                                                 0x55, 0x73, 0x65, 0x72, 0x4C,
16754                                                 0x6F, 0x67, 0x0D, 0x08, 0xF4,
16755                                                 0x55, 0x73, 0x65, 0x72, 0x50,
16756                                                 0x77, 0x64, 0x3C, 0x03, 0x01,
16757                                                 0xAD, 0x9C, 0x3E, 0x05, 0x21,
16758                                                 0x01, 0x01, 0x01, 0x01 };
16759
16760 static unsigned char open_channel_511[] = { 0xD0, 0x53, 0x81, 0x03, 0x01, 0x40,
16761                                                 0x01, 0x82, 0x02, 0x81, 0x82,
16762                                                 0x05, 0x09, 0x4F, 0x70, 0x65,
16763                                                 0x6E, 0x20, 0x49, 0x44, 0x20,
16764                                                 0x31, 0x35, 0x07, 0x02, 0x03,
16765                                                 0x04, 0x03, 0x04, 0x1F, 0x02,
16766                                                 0x39, 0x02, 0x05, 0x78, 0x47,
16767                                                 0x0A, 0x06, 0x54, 0x65, 0x73,
16768                                                 0x74, 0x47, 0x70, 0x02, 0x72,
16769                                                 0x73, 0x0D, 0x08, 0xF4, 0x55,
16770                                                 0x73, 0x65, 0x72, 0x4C, 0x6F,
16771                                                 0x67, 0x0D, 0x08, 0xF4, 0x55,
16772                                                 0x73, 0x65, 0x72, 0x50, 0x77,
16773                                                 0x64, 0x3C, 0x03, 0x01, 0xAD,
16774                                                 0x9C, 0x3E, 0x05, 0x21, 0x01,
16775                                                 0x01, 0x01, 0x01, 0xD0, 0x04,
16776                                                 0x00, 0x09, 0x00, 0xB4 };
16777
16778 static struct open_channel_test open_channel_data_211 = {
16779         /*
16780          * OPEN CHANNEL, immediate link establishment, GPRS, no local address
16781          * no alpha identifier, no network access name
16782          */
16783         .pdu = open_channel_211,
16784         .pdu_len = sizeof(open_channel_211),
16785         .qualifier = STK_OPEN_CHANNEL_FLAG_IMMEDIATE,
16786         .bearer_desc = {
16787                         .type = STK_BEARER_TYPE_GPRS_UTRAN,
16788                         .gprs = {
16789                                 .precedence = 3,
16790                                 .delay = 4,
16791                                 .reliability = 3,
16792                                 .peak = 4,
16793                                 .mean = 31,
16794                                 .pdp_type = 2,
16795                         },
16796         },
16797         .buf_size = 1400,
16798         .text_usr = "UserLog",
16799         .text_passwd = "UserPwd",
16800         .uti = {
16801                 .protocol = STK_TRANSPORT_PROTOCOL_UDP_CLIENT_REMOTE,
16802                 .port = 44444,
16803         },
16804         .data_dest_addr = {
16805                         .type = STK_ADDRESS_IPV4,
16806                         .addr = {
16807                                 .ipv4 = 0x01010101,
16808                         },
16809         },
16810 };
16811
16812 static struct open_channel_test open_channel_data_221 = {
16813         /*
16814          * OPEN CHANNEL, immediate link establishment GPRS,
16815          * no alpha identifier, with network access name
16816          */
16817         .pdu = open_channel_221,
16818         .pdu_len = sizeof(open_channel_221),
16819         .qualifier = STK_OPEN_CHANNEL_FLAG_IMMEDIATE,
16820         .bearer_desc = {
16821                         .type = STK_BEARER_TYPE_GPRS_UTRAN,
16822                         .gprs = {
16823                                 .precedence = 3,
16824                                 .delay = 4,
16825                                 .reliability = 3,
16826                                 .peak = 4,
16827                                 .mean = 31,
16828                                 .pdp_type = 2,
16829                         },
16830         },
16831         .buf_size = 1400,
16832         .apn = "TestGp.rs",
16833         .text_usr = "UserLog",
16834         .text_passwd = "UserPwd",
16835         .uti = {
16836                 .protocol = STK_TRANSPORT_PROTOCOL_UDP_CLIENT_REMOTE,
16837                 .port = 44444,
16838         },
16839         .data_dest_addr = {
16840                         .type = STK_ADDRESS_IPV4,
16841                         .addr = {
16842                                 .ipv4 = 0x01010101,
16843                         },
16844         },
16845 };
16846
16847 static struct open_channel_test open_channel_data_231 = {
16848         /*
16849          * OPEN CHANNEL, immediate link establishment, GPRS
16850          * with alpha identifier
16851          */
16852         .pdu = open_channel_231,
16853         .pdu_len = sizeof(open_channel_231),
16854         .qualifier = STK_OPEN_CHANNEL_FLAG_IMMEDIATE,
16855         .alpha_id = "Open ID",
16856         .bearer_desc = {
16857                         .type = STK_BEARER_TYPE_GPRS_UTRAN,
16858                         .gprs = {
16859                                 .precedence = 3,
16860                                 .delay = 4,
16861                                 .reliability = 3,
16862                                 .peak = 4,
16863                                 .mean = 31,
16864                                 .pdp_type = 2,
16865                         },
16866         },
16867         .buf_size = 1400,
16868         .apn = "TestGp.rs",
16869         .text_usr = "UserLog",
16870         .text_passwd = "UserPwd",
16871         .uti = {
16872                 .protocol = STK_TRANSPORT_PROTOCOL_UDP_CLIENT_REMOTE,
16873                 .port = 44444,
16874         },
16875         .data_dest_addr = {
16876                         .type = STK_ADDRESS_IPV4,
16877                         .addr = {
16878                                 .ipv4 = 0x01010101,
16879                         },
16880         },
16881 };
16882
16883 static struct open_channel_test open_channel_data_241 = {
16884         /*
16885          * OPEN CHANNEL, immediate link establishment, GPRS,
16886          * with null alpha identifier
16887          */
16888         .pdu = open_channel_241,
16889         .pdu_len = sizeof(open_channel_241),
16890         .qualifier = STK_OPEN_CHANNEL_FLAG_IMMEDIATE,
16891         .alpha_id = "",
16892         .bearer_desc = {
16893                         .type = STK_BEARER_TYPE_GPRS_UTRAN,
16894                         .gprs = {
16895                                 .precedence = 3,
16896                                 .delay = 4,
16897                                 .reliability = 3,
16898                                 .peak = 4,
16899                                 .mean = 31,
16900                                 .pdp_type = 2,
16901                         },
16902         },
16903         .buf_size = 1400,
16904         .apn = "TestGp.rs",
16905         .text_usr = "UserLog",
16906         .text_passwd = "UserPwd",
16907         .uti = {
16908                 .protocol = STK_TRANSPORT_PROTOCOL_UDP_CLIENT_REMOTE,
16909                 .port = 44444,
16910         },
16911         .data_dest_addr = {
16912                         .type = STK_ADDRESS_IPV4,
16913                         .addr = {
16914                                 .ipv4 = 0x01010101,
16915                         },
16916         },
16917 };
16918
16919 static struct open_channel_test open_channel_data_511 = {
16920         /*
16921          * OPEN CHANNEL, immediate link establishment, GPRS
16922          * Text Attribute – Left Alignment
16923          */
16924         .pdu = open_channel_511,
16925         .pdu_len = sizeof(open_channel_511),
16926         .qualifier = STK_OPEN_CHANNEL_FLAG_IMMEDIATE,
16927         .alpha_id = "Open ID 1",
16928         .bearer_desc = {
16929                         .type = STK_BEARER_TYPE_GPRS_UTRAN,
16930                         .gprs = {
16931                                 .precedence = 3,
16932                                 .delay = 4,
16933                                 .reliability = 3,
16934                                 .peak = 4,
16935                                 .mean = 31,
16936                                 .pdp_type = 2,
16937                         },
16938         },
16939         .buf_size = 1400,
16940         .apn = "TestGp.rs",
16941         .text_usr = "UserLog",
16942         .text_passwd = "UserPwd",
16943         .uti = {
16944                 .protocol = STK_TRANSPORT_PROTOCOL_UDP_CLIENT_REMOTE,
16945                 .port = 44444,
16946         },
16947         .data_dest_addr = {
16948                         .type = STK_ADDRESS_IPV4,
16949                         .addr = {
16950                                 .ipv4 = 0x01010101,
16951                         },
16952         },
16953         .text_attr = {
16954                         .len = 4,
16955                         .attributes = { 0x00, 0x09, 0x00, 0xB4 }
16956         },
16957 };
16958
16959 static void test_open_channel(gconstpointer data)
16960 {
16961         const struct open_channel_test *test = data;
16962         struct stk_command *command;
16963
16964         command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
16965
16966         g_assert(command);
16967         g_assert(command->status == STK_PARSE_RESULT_OK);
16968
16969         g_assert(command->number == 1);
16970         g_assert(command->type == STK_COMMAND_TYPE_OPEN_CHANNEL);
16971         g_assert(command->qualifier == test->qualifier);
16972
16973         g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
16974         g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_TERMINAL);
16975
16976         check_alpha_id(command->open_channel.alpha_id, test->alpha_id);
16977         check_icon_id(&command->open_channel.icon_id, &test->icon_id);
16978         check_bearer_desc(&command->open_channel.bearer_desc,
16979                                         &test->bearer_desc);
16980         g_assert(command->open_channel.buf_size == test->buf_size);
16981         check_network_access_name(command->open_channel.apn, test->apn);
16982         check_other_address(&command->open_channel.local_addr,
16983                                         &test->local_addr);
16984         check_text(command->open_channel.text_usr, test->text_usr);
16985         check_text(command->open_channel.text_passwd, test->text_passwd);
16986         check_uicc_te_interface(&command->open_channel.uti, &test->uti);
16987         check_other_address(&command->open_channel.data_dest_addr,
16988                                         &test->data_dest_addr);
16989         check_text_attr(&command->open_channel.text_attr, &test->text_attr);
16990         check_frame_id(&command->open_channel.frame_id, &test->frame_id);
16991
16992         stk_command_free(command);
16993 }
16994
16995 struct close_channel_test {
16996         const unsigned char *pdu;
16997         unsigned int pdu_len;
16998         unsigned char qualifier;
16999         enum stk_device_identity_type dst;
17000         char *alpha_id;
17001         struct stk_icon_id icon_id;
17002         struct stk_text_attribute text_attr;
17003         struct stk_frame_id frame_id;
17004 };
17005
17006 static unsigned char close_channel_111[] = { 0xD0, 0x09, 0x81, 0x03, 0x01, 0x41,
17007                                                 0x00, 0x82, 0x02, 0x81, 0x21 };
17008
17009 static struct close_channel_test close_channel_data_111 = {
17010         .pdu = close_channel_111,
17011         .pdu_len = sizeof(close_channel_111),
17012         .qualifier = 0x00,
17013         .dst = STK_DEVICE_IDENTITY_TYPE_CHANNEL_1,
17014 };
17015
17016 static unsigned char close_channel_211[] = { 0xD0, 0x1B, 0x81, 0x03, 0x01, 0x41,
17017                                                 0x00, 0x82, 0x02, 0x81, 0x21,
17018                                                 0x85, 0x0A, 0x43, 0x6C, 0x6F,
17019                                                 0x73, 0x65, 0x20, 0x49, 0x44,
17020                                                 0x20, 0x31, 0xD0, 0x04, 0x00,
17021                                                 0x0A, 0x00, 0xB4,
17022  };
17023
17024 static struct close_channel_test close_channel_data_211 = {
17025         .pdu = close_channel_211,
17026         .pdu_len = sizeof(close_channel_211),
17027         .qualifier = 0x00,
17028         .dst = STK_DEVICE_IDENTITY_TYPE_CHANNEL_1,
17029         .alpha_id = "Close ID 1",
17030         .text_attr = {
17031                 .len = 4,
17032                 .attributes = { 0x00, 0x0A, 0x00, 0xB4 }
17033         },
17034 };
17035
17036 static void test_close_channel(gconstpointer data)
17037 {
17038         const struct close_channel_test *test = data;
17039         struct stk_command *command;
17040
17041         command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
17042
17043         g_assert(command);
17044         g_assert(command->status == STK_PARSE_RESULT_OK);
17045
17046         g_assert(command->number == 1);
17047         g_assert(command->type == STK_COMMAND_TYPE_CLOSE_CHANNEL);
17048         g_assert(command->qualifier == test->qualifier);
17049
17050         g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
17051         g_assert(command->dst == test->dst);
17052
17053         check_alpha_id(command->close_channel.alpha_id, test->alpha_id);
17054         check_icon_id(&command->close_channel.icon_id, &test->icon_id);
17055         check_text_attr(&command->close_channel.text_attr, &test->text_attr);
17056         check_frame_id(&command->close_channel.frame_id, &test->frame_id);
17057
17058         stk_command_free(command);
17059 }
17060
17061 struct receive_data_test {
17062         const unsigned char *pdu;
17063         unsigned int pdu_len;
17064         unsigned char qualifier;
17065         enum stk_device_identity_type dst;
17066         char *alpha_id;
17067         struct stk_icon_id icon_id;
17068         unsigned char data_len;
17069         struct stk_text_attribute text_attr;
17070         struct stk_frame_id frame_id;
17071 };
17072
17073 static unsigned char receive_data_111[] = { 0xD0, 0x0C, 0x81, 0x03, 0x01, 0x42,
17074                                                 0x00, 0x82, 0x02, 0x81, 0x21,
17075                                                 0xB7, 0x01, 0xC8 };
17076
17077 static struct receive_data_test receive_data_data_111 = {
17078         .pdu = receive_data_111,
17079         .pdu_len = sizeof(receive_data_111),
17080         .qualifier = 0x00,
17081         .dst = STK_DEVICE_IDENTITY_TYPE_CHANNEL_1,
17082         .data_len = 200,
17083 };
17084
17085 static unsigned char receive_data_211[] = { 0xD0, 0x22, 0x81, 0x03, 0x01, 0x42,
17086                                                 0x00, 0x82, 0x02, 0x81, 0x21,
17087                                                 0x85, 0x0E, 0x52, 0x65, 0x63,
17088                                                 0x65, 0x69, 0x76, 0x65, 0x20,
17089                                                 0x44, 0x61, 0x74, 0x61, 0x20,
17090                                                 0x31, 0xB7, 0x01, 0xC8, 0xD0,
17091                                                 0x04, 0x00, 0x0E, 0x00, 0xB4 };
17092
17093 static struct receive_data_test receive_data_data_211 = {
17094         .pdu = receive_data_211,
17095         .pdu_len = sizeof(receive_data_211),
17096         .qualifier = 0x00,
17097         .dst = STK_DEVICE_IDENTITY_TYPE_CHANNEL_1,
17098         .data_len = 200,
17099         .alpha_id = "Receive Data 1",
17100         .text_attr = {
17101                 .len = 4,
17102                 .attributes = { 0x00, 0x0E, 0x00, 0xB4 }
17103         },
17104 };
17105
17106
17107 static void test_receive_data(gconstpointer data)
17108 {
17109         const struct receive_data_test *test = data;
17110         struct stk_command *command;
17111
17112         command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
17113
17114         g_assert(command);
17115         g_assert(command->status == STK_PARSE_RESULT_OK);
17116
17117         g_assert(command->number == 1);
17118         g_assert(command->type == STK_COMMAND_TYPE_RECEIVE_DATA);
17119         g_assert(command->qualifier == test->qualifier);
17120
17121         g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
17122         g_assert(command->dst == test->dst);
17123
17124         check_alpha_id(command->receive_data.alpha_id, test->alpha_id);
17125         check_icon_id(&command->receive_data.icon_id, &test->icon_id);
17126         check_common_byte(command->receive_data.data_len, test->data_len);
17127         check_text_attr(&command->receive_data.text_attr, &test->text_attr);
17128         check_frame_id(&command->receive_data.frame_id, &test->frame_id);
17129
17130         stk_command_free(command);
17131 }
17132
17133 struct send_data_test {
17134         const unsigned char *pdu;
17135         unsigned int pdu_len;
17136         unsigned char qualifier;
17137         enum stk_device_identity_type dst;
17138         char *alpha_id;
17139         struct stk_icon_id icon_id;
17140         struct stk_common_byte_array data;
17141         struct stk_text_attribute text_attr;
17142         struct stk_frame_id frame_id;
17143 };
17144
17145 static unsigned char send_data_111[] = { 0xD0, 0x13, 0x81, 0x03, 0x01, 0x43,
17146                                                 0x01, 0x82, 0x02, 0x81, 0x21,
17147                                                 0xB6, 0x08, 0x00, 0x01, 0x02,
17148                                                 0x03, 0x04, 0x05, 0x06, 0x07 };
17149
17150 static struct send_data_test send_data_data_111 = {
17151         .pdu = send_data_111,
17152         .pdu_len = sizeof(send_data_111),
17153         .qualifier = STK_SEND_DATA_IMMEDIATELY,
17154         .dst = STK_DEVICE_IDENTITY_TYPE_CHANNEL_1,
17155         .data = {
17156                 .array = (unsigned char[8]) {
17157                                 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07
17158                 },
17159                 .len = 8,
17160         },
17161 };
17162
17163 static unsigned char send_data_121[] = {
17164                                 0xD0, 0x81, 0xD4, 0x81, 0x03, 0x01, 0x43, 0x00,
17165                                 0x82, 0x02, 0x81, 0x21, 0xB6, 0x81, 0xC8, 0x00,
17166                                 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
17167                                 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
17168                                 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
17169                                 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20,
17170                                 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28,
17171                                 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30,
17172                                 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38,
17173                                 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40,
17174                                 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,
17175                                 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50,
17176                                 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
17177                                 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60,
17178                                 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
17179                                 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70,
17180                                 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
17181                                 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80,
17182                                 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88,
17183                                 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90,
17184                                 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,
17185                                 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0,
17186                                 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8,
17187                                 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0,
17188                                 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8,
17189                                 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0,
17190                                 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7 };
17191
17192 static struct send_data_test send_data_data_121 = {
17193         .pdu = send_data_121,
17194         .pdu_len = sizeof(send_data_121),
17195         .qualifier = STK_SEND_DATA_STORE_DATA,
17196         .dst = STK_DEVICE_IDENTITY_TYPE_CHANNEL_1,
17197         .data = {
17198                 .array = (unsigned char[200]) {
17199                                 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
17200                                 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
17201                                 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
17202                                 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
17203                                 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
17204                                 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
17205                                 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
17206                                 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
17207                                 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
17208                                 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
17209                                 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
17210                                 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
17211                                 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
17212                                 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
17213                                 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
17214                                 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
17215                                 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
17216                                 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
17217                                 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
17218                                 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
17219                                 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
17220                                 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
17221                                 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
17222                                 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
17223                                 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
17224                 },
17225                 .len = 200,
17226         },
17227 };
17228 static unsigned char send_data_211[] = {
17229                                 0xD0, 0x26, 0x81, 0x03, 0x01, 0x43, 0x01, 0x82,
17230                                 0x02, 0x81, 0x21, 0x85, 0x0B, 0x53, 0x65, 0x6E,
17231                                 0x64, 0x20, 0x44, 0x61, 0x74, 0x61, 0x20, 0x31,
17232                                 0xB6, 0x08, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
17233                                 0x06, 0x07, 0xD0, 0x04, 0x00, 0x0B, 0x00, 0xB4,
17234  };
17235
17236 static struct send_data_test send_data_data_211 = {
17237         .pdu = send_data_211,
17238         .pdu_len = sizeof(send_data_211),
17239         .qualifier = STK_SEND_DATA_IMMEDIATELY,
17240         .dst = STK_DEVICE_IDENTITY_TYPE_CHANNEL_1,
17241         .alpha_id = "Send Data 1",
17242         .data = {
17243                 .array = (unsigned char[8]) {
17244                                 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07
17245                 },
17246                 .len = 8,
17247         },
17248         .text_attr = {
17249                 .len = 4,
17250                 .attributes = { 0x00, 0x0B, 0x00, 0xB4 }
17251         },
17252 };
17253
17254 static void test_send_data(gconstpointer data)
17255 {
17256         const struct send_data_test *test = data;
17257         struct stk_command *command;
17258
17259         command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
17260
17261         g_assert(command);
17262         g_assert(command->status == STK_PARSE_RESULT_OK);
17263
17264         g_assert(command->number == 1);
17265         g_assert(command->type == STK_COMMAND_TYPE_SEND_DATA);
17266         g_assert(command->qualifier == test->qualifier);
17267
17268         g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
17269         g_assert(command->dst == test->dst);
17270
17271         check_alpha_id(command->send_data.alpha_id, test->alpha_id);
17272         check_icon_id(&command->send_data.icon_id, &test->icon_id);
17273         check_channel_data(&command->send_data.data, &test->data);
17274         check_text_attr(&command->send_data.text_attr, &test->text_attr);
17275         check_frame_id(&command->send_data.frame_id, &test->frame_id);
17276
17277         stk_command_free(command);
17278 }
17279
17280 struct get_channel_status_test {
17281         const unsigned char *pdu;
17282         unsigned int pdu_len;
17283         unsigned char qualifier;
17284 };
17285
17286 static unsigned char get_channel_status_111[] = { 0xD0, 0x09, 0x81, 0x03, 0x01,
17287                                                         0x44, 0x00, 0x82, 0x02,
17288                                                         0x81, 0x82 };
17289
17290 static struct get_channel_status_test get_channel_status_data_111 = {
17291         .pdu = get_channel_status_111,
17292         .pdu_len = sizeof(get_channel_status_111),
17293         .qualifier = 0x00,
17294 };
17295
17296 static void test_get_channel_status(gconstpointer data)
17297 {
17298         const struct get_channel_status_test *test = data;
17299         struct stk_command *command;
17300
17301         command = stk_command_new_from_pdu(test->pdu, test->pdu_len);
17302
17303         g_assert(command);
17304         g_assert(command->status == STK_PARSE_RESULT_OK);
17305
17306         g_assert(command->number == 1);
17307         g_assert(command->type == STK_COMMAND_TYPE_GET_CHANNEL_STATUS);
17308         g_assert(command->qualifier == test->qualifier);
17309
17310         g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
17311         g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_TERMINAL);
17312
17313         stk_command_free(command);
17314 }
17315
17316 struct terminal_response_test {
17317         const unsigned char *pdu;
17318         unsigned int pdu_len;
17319         struct stk_response response;
17320 };
17321
17322 static void test_terminal_response_encoding(gconstpointer data)
17323 {
17324         const struct terminal_response_test *test = data;
17325         const unsigned char *pdu;
17326         unsigned int pdu_len;
17327
17328         pdu = stk_pdu_from_response(&test->response, &pdu_len);
17329
17330         if (test->pdu)
17331                 g_assert(pdu);
17332         else
17333                 g_assert(pdu == NULL);
17334
17335         g_assert(pdu_len == test->pdu_len);
17336         g_assert(memcmp(pdu, test->pdu, pdu_len) == 0);
17337 }
17338
17339 static const struct terminal_response_test display_text_response_data_111 = {
17340         .pdu = display_text_response_111,
17341         .pdu_len = sizeof(display_text_response_111),
17342         .response = {
17343                 .number = 1,
17344                 .type = STK_COMMAND_TYPE_DISPLAY_TEXT,
17345                 .qualifier = 0x80, /* Wait for user to clear */
17346                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
17347                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
17348                 .result = {
17349                         .type = STK_RESULT_TYPE_SUCCESS,
17350                 },
17351         },
17352 };
17353
17354 static const struct terminal_response_test display_text_response_data_121 = {
17355         .pdu = display_text_response_121,
17356         .pdu_len = sizeof(display_text_response_121),
17357         .response = {
17358                 .number = 1,
17359                 .type = STK_COMMAND_TYPE_DISPLAY_TEXT,
17360                 .qualifier = 0x80, /* Wait for user to clear */
17361                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
17362                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
17363                 .result = {
17364                         .type = STK_RESULT_TYPE_TERMINAL_BUSY,
17365                         .additional_len = 1, /* Screen is busy */
17366                         .additional = (unsigned char *) "\1",
17367                 },
17368         },
17369 };
17370
17371 static const struct terminal_response_test display_text_response_data_131 = {
17372         .pdu = display_text_response_131,
17373         .pdu_len = sizeof(display_text_response_131),
17374         .response = {
17375                 .number = 1,
17376                 .type = STK_COMMAND_TYPE_DISPLAY_TEXT,
17377                 .qualifier = 0x81, /* Wait for user to clear, High priority */
17378                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
17379                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
17380                 .result = {
17381                         .type = STK_RESULT_TYPE_SUCCESS,
17382                 },
17383         },
17384 };
17385
17386 static const struct terminal_response_test display_text_response_data_151 = {
17387         .pdu = display_text_response_151,
17388         .pdu_len = sizeof(display_text_response_151),
17389         .response = {
17390                 .number = 1,
17391                 .type = STK_COMMAND_TYPE_DISPLAY_TEXT,
17392                 .qualifier = 0x00,
17393                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
17394                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
17395                 .result = {
17396                         .type = STK_RESULT_TYPE_SUCCESS,
17397                 },
17398         },
17399 };
17400
17401 static const struct terminal_response_test display_text_response_data_171 = {
17402         .pdu = display_text_response_171,
17403         .pdu_len = sizeof(display_text_response_171),
17404         .response = {
17405                 .number = 1,
17406                 .type = STK_COMMAND_TYPE_DISPLAY_TEXT,
17407                 .qualifier = 0x80, /* Wait for user to clear */
17408                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
17409                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
17410                 .result = {
17411                         .type = STK_RESULT_TYPE_GO_BACK,
17412                 },
17413         },
17414 };
17415
17416 static const struct terminal_response_test display_text_response_data_181 = {
17417         .pdu = display_text_response_181,
17418         .pdu_len = sizeof(display_text_response_181),
17419         .response = {
17420                 .number = 1,
17421                 .type = STK_COMMAND_TYPE_DISPLAY_TEXT,
17422                 .qualifier = 0x80, /* Wait for user to clear */
17423                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
17424                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
17425                 .result = {
17426                         .type = STK_RESULT_TYPE_USER_TERMINATED,
17427                 },
17428         },
17429 };
17430
17431 static const struct terminal_response_test display_text_response_data_191 = {
17432         .pdu = display_text_response_191,
17433         .pdu_len = sizeof(display_text_response_191),
17434         .response = {
17435                 .number = 1,
17436                 .type = STK_COMMAND_TYPE_DISPLAY_TEXT,
17437                 .qualifier = 0x80, /* Wait for user to clear */
17438                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
17439                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
17440                 .result = {
17441                         .type = STK_RESULT_TYPE_DATA_NOT_UNDERSTOOD,
17442                 },
17443         },
17444 };
17445
17446 static const struct terminal_response_test display_text_response_data_211 = {
17447         .pdu = display_text_response_211,
17448         .pdu_len = sizeof(display_text_response_211),
17449         .response = {
17450                 .number = 1,
17451                 .type = STK_COMMAND_TYPE_DISPLAY_TEXT,
17452                 .qualifier = 0x80, /* Wait for user to clear */
17453                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
17454                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
17455                 .result = {
17456                         .type = STK_RESULT_TYPE_NO_RESPONSE,
17457                 },
17458         },
17459 };
17460
17461 static const struct terminal_response_test display_text_response_data_511b = {
17462         .pdu = display_text_response_511b,
17463         .pdu_len = sizeof(display_text_response_511b),
17464         .response = {
17465                 .number = 1,
17466                 .type = STK_COMMAND_TYPE_DISPLAY_TEXT,
17467                 .qualifier = 0x80, /* Wait for user to clear */
17468                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
17469                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
17470                 .result = {
17471                         .type = STK_RESULT_TYPE_NO_ICON,
17472                 },
17473         },
17474 };
17475
17476 static const struct terminal_response_test get_inkey_response_data_111 = {
17477         .pdu = get_inkey_response_111,
17478         .pdu_len = sizeof(get_inkey_response_111),
17479         .response = {
17480                 .number = 1,
17481                 .type = STK_COMMAND_TYPE_GET_INKEY,
17482                 .qualifier = 0x00,
17483                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
17484                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
17485                 .result = {
17486                         .type = STK_RESULT_TYPE_SUCCESS,
17487                 },
17488                 { .get_inkey = {
17489                         .text = {
17490                                 .text = "+",
17491                         },
17492                 }},
17493         },
17494 };
17495
17496 static const struct terminal_response_test get_inkey_response_data_121 = {
17497         .pdu = get_inkey_response_121,
17498         .pdu_len = sizeof(get_inkey_response_121),
17499         .response = {
17500                 .number = 1,
17501                 .type = STK_COMMAND_TYPE_GET_INKEY,
17502                 .qualifier = 0x00,
17503                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
17504                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
17505                 .result = {
17506                         .type = STK_RESULT_TYPE_SUCCESS,
17507                 },
17508                 { .get_inkey = {
17509                         .text = {
17510                                 .text = "0",
17511                         },
17512                 }},
17513         },
17514 };
17515
17516 static const struct terminal_response_test get_inkey_response_data_131 = {
17517         .pdu = get_inkey_response_131,
17518         .pdu_len = sizeof(get_inkey_response_131),
17519         .response = {
17520                 .number = 1,
17521                 .type = STK_COMMAND_TYPE_GET_INKEY,
17522                 .qualifier = 0x00,
17523                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
17524                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
17525                 .result = {
17526                         .type = STK_RESULT_TYPE_GO_BACK,
17527                 },
17528         },
17529 };
17530
17531 static const struct terminal_response_test get_inkey_response_data_141 = {
17532         .pdu = get_inkey_response_141,
17533         .pdu_len = sizeof(get_inkey_response_141),
17534         .response = {
17535                 .number = 1,
17536                 .type = STK_COMMAND_TYPE_GET_INKEY,
17537                 .qualifier = 0x00,
17538                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
17539                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
17540                 .result = {
17541                         .type = STK_RESULT_TYPE_USER_TERMINATED,
17542                 },
17543         },
17544 };
17545
17546 static const struct terminal_response_test get_inkey_response_data_151 = {
17547         .pdu = get_inkey_response_151,
17548         .pdu_len = sizeof(get_inkey_response_151),
17549         .response = {
17550                 .number = 1,
17551                 .type = STK_COMMAND_TYPE_GET_INKEY,
17552                 .qualifier = 0x01, /* SMS alphabet */
17553                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
17554                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
17555                 .result = {
17556                         .type = STK_RESULT_TYPE_SUCCESS,
17557                 },
17558                 { .get_inkey = {
17559                         .text = {
17560                                 .text = "q",
17561                         },
17562                 }},
17563         },
17564 };
17565
17566 static const struct terminal_response_test get_inkey_response_data_161 = {
17567         .pdu = get_inkey_response_161,
17568         .pdu_len = sizeof(get_inkey_response_161),
17569         .response = {
17570                 .number = 1,
17571                 .type = STK_COMMAND_TYPE_GET_INKEY,
17572                 .qualifier = 0x01, /* SMS alphabet */
17573                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
17574                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
17575                 .result = {
17576                         .type = STK_RESULT_TYPE_SUCCESS,
17577                 },
17578                 { .get_inkey = {
17579                         .text = {
17580                                 .text = "x",
17581                         },
17582                 }},
17583         },
17584 };
17585
17586 static const struct terminal_response_test get_inkey_response_data_211 = {
17587         .pdu = get_inkey_response_211,
17588         .pdu_len = sizeof(get_inkey_response_211),
17589         .response = {
17590                 .number = 1,
17591                 .type = STK_COMMAND_TYPE_GET_INKEY,
17592                 .qualifier = 0x00,
17593                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
17594                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
17595                 .result = {
17596                         .type = STK_RESULT_TYPE_NO_RESPONSE,
17597                 },
17598         },
17599 };
17600
17601 static const struct terminal_response_test get_inkey_response_data_411 = {
17602         .pdu = get_inkey_response_411,
17603         .pdu_len = sizeof(get_inkey_response_411),
17604         .response = {
17605                 .number = 1,
17606                 .type = STK_COMMAND_TYPE_GET_INKEY,
17607                 .qualifier = 0x03, /* UCS2 alphabet */
17608                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
17609                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
17610                 .result = {
17611                         .type = STK_RESULT_TYPE_SUCCESS,
17612                 },
17613                 { .get_inkey = {
17614                         .text = {
17615                                 .text = "Д",
17616                         },
17617                 }},
17618         },
17619 };
17620
17621 static const struct terminal_response_test get_inkey_response_data_511 = {
17622         .pdu = get_inkey_response_511,
17623         .pdu_len = sizeof(get_inkey_response_511),
17624         .response = {
17625                 .number = 1,
17626                 .type = STK_COMMAND_TYPE_GET_INKEY,
17627                 .qualifier = 0x04, /* Yes/No response */
17628                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
17629                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
17630                 .result = {
17631                         .type = STK_RESULT_TYPE_SUCCESS,
17632                 },
17633                 { .get_inkey = {
17634                         .text = {
17635                                 .text = "Yes",
17636                                 .yesno = TRUE,
17637                         },
17638                 }},
17639         },
17640 };
17641
17642 static const struct terminal_response_test get_inkey_response_data_512 = {
17643         .pdu = get_inkey_response_512,
17644         .pdu_len = sizeof(get_inkey_response_512),
17645         .response = {
17646                 .number = 1,
17647                 .type = STK_COMMAND_TYPE_GET_INKEY,
17648                 .qualifier = 0x04, /* Yes/No response */
17649                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
17650                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
17651                 .result = {
17652                         .type = STK_RESULT_TYPE_SUCCESS,
17653                 },
17654                 { .get_inkey = {
17655                         .text = {
17656                                 .text = NULL,
17657                                 .yesno = TRUE,
17658                         },
17659                 }},
17660         },
17661 };
17662
17663 static const unsigned char get_inkey_response_611b[] = {
17664         0x81, 0x03, 0x01, 0x22, 0x00, 0x82, 0x02, 0x82,
17665         0x81, 0x83, 0x01, 0x04, 0x8d, 0x02, 0x04, 0x2b,
17666 };
17667
17668 static const struct terminal_response_test get_inkey_response_data_611b = {
17669         .pdu = get_inkey_response_611b,
17670         .pdu_len = sizeof(get_inkey_response_611b),
17671         .response = {
17672                 .number = 1,
17673                 .type = STK_COMMAND_TYPE_GET_INKEY,
17674                 .qualifier = 0x00,
17675                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
17676                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
17677                 .result = {
17678                         .type = STK_RESULT_TYPE_NO_ICON,
17679                 },
17680                 { .get_inkey = {
17681                         .text = {
17682                                 .text = "+",
17683                         },
17684                 }},
17685         },
17686 };
17687
17688 static const unsigned char get_inkey_response_711[] = {
17689         0x81, 0x03, 0x01, 0x22, 0x80, 0x82, 0x02, 0x82,
17690         0x81, 0x83, 0x01, 0x13,
17691 };
17692
17693 static const struct terminal_response_test get_inkey_response_data_711 = {
17694         .pdu = get_inkey_response_711,
17695         .pdu_len = sizeof(get_inkey_response_711),
17696         .response = {
17697                 .number = 1,
17698                 .type = STK_COMMAND_TYPE_GET_INKEY,
17699                 .qualifier = 0x80, /* Help information available */
17700                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
17701                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
17702                 .result = {
17703                         .type = STK_RESULT_TYPE_HELP_REQUESTED,
17704                 },
17705         },
17706 };
17707
17708 static const unsigned char get_inkey_response_712[] = {
17709         0x81, 0x03, 0x01, 0x22, 0x80, 0x82, 0x02, 0x82,
17710         0x81, 0x83, 0x01, 0x00, 0x8d, 0x02, 0x04, 0x2b,
17711 };
17712
17713 static const struct terminal_response_test get_inkey_response_data_712 = {
17714         .pdu = get_inkey_response_712,
17715         .pdu_len = sizeof(get_inkey_response_712),
17716         .response = {
17717                 .number = 1,
17718                 .type = STK_COMMAND_TYPE_GET_INKEY,
17719                 .qualifier = 0x80, /* Help information available */
17720                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
17721                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
17722                 .result = {
17723                         .type = STK_RESULT_TYPE_SUCCESS,
17724                 },
17725                 { .get_inkey = {
17726                         .text = {
17727                                 .text = "+",
17728                         },
17729                 }},
17730         },
17731 };
17732
17733 static const unsigned char get_inkey_response_811[] = {
17734         0x81, 0x03, 0x01, 0x22, 0x00, 0x82, 0x02, 0x82,
17735         0x81, 0x83, 0x01, 0x12, 0x04, 0x02, 0x01, 0x11,
17736 };
17737
17738 static const struct terminal_response_test get_inkey_response_data_811 = {
17739         .pdu = get_inkey_response_811,
17740         .pdu_len = sizeof(get_inkey_response_811),
17741         .response = {
17742                 .number = 1,
17743                 .type = STK_COMMAND_TYPE_GET_INKEY,
17744                 .qualifier = 0x00,
17745                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
17746                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
17747                 .result = {
17748                         .type = STK_RESULT_TYPE_NO_RESPONSE,
17749                 },
17750                 { .get_inkey = {
17751                         .duration = {
17752                                 .unit = STK_DURATION_TYPE_SECONDS,
17753                                 .interval = 17,
17754                         },
17755                 }},
17756         },
17757 };
17758
17759 static const unsigned char get_inkey_response_912[] = {
17760         0x81, 0x03, 0x01, 0x22, 0x00, 0x82, 0x02, 0x82,
17761         0x81, 0x83, 0x01, 0x00, 0x8d, 0x02, 0x04, 0x23,
17762 };
17763
17764 static const struct terminal_response_test get_inkey_response_data_912 = {
17765         .pdu = get_inkey_response_912,
17766         .pdu_len = sizeof(get_inkey_response_912),
17767         .response = {
17768                 .number = 1,
17769                 .type = STK_COMMAND_TYPE_GET_INKEY,
17770                 .qualifier = 0x00,
17771                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
17772                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
17773                 .result = {
17774                         .type = STK_RESULT_TYPE_SUCCESS,
17775                 },
17776                 { .get_inkey = {
17777                         .text = {
17778                                 .text = "#",
17779                         },
17780                 }},
17781         },
17782 };
17783
17784 static const unsigned char get_inkey_response_1111[] = {
17785         0x81, 0x03, 0x01, 0x22, 0x03, 0x82, 0x02, 0x82,
17786         0x81, 0x83, 0x01, 0x00, 0x8d, 0x03, 0x08, 0x59,
17787         0x7d,
17788 };
17789
17790 static const struct terminal_response_test get_inkey_response_data_1111 = {
17791         .pdu = get_inkey_response_1111,
17792         .pdu_len = sizeof(get_inkey_response_1111),
17793         .response = {
17794                 .number = 1,
17795                 .type = STK_COMMAND_TYPE_GET_INKEY,
17796                 .qualifier = 0x03, /* UCS2 alphabet */
17797                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
17798                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
17799                 .result = {
17800                         .type = STK_RESULT_TYPE_SUCCESS,
17801                 },
17802                 { .get_inkey = {
17803                         .text = {
17804                                 .text = "好",
17805                         },
17806                 }},
17807         },
17808 };
17809
17810 static const unsigned char get_inkey_response_1311[] = {
17811         0x81, 0x03, 0x01, 0x22, 0x03, 0x82, 0x02, 0x82,
17812         0x81, 0x83, 0x01, 0x00, 0x8d, 0x03, 0x08, 0x30,
17813         0xeb,
17814 };
17815
17816 static const struct terminal_response_test get_inkey_response_data_1311 = {
17817         .pdu = get_inkey_response_1311,
17818         .pdu_len = sizeof(get_inkey_response_1311),
17819         .response = {
17820                 .number = 1,
17821                 .type = STK_COMMAND_TYPE_GET_INKEY,
17822                 .qualifier = 0x03, /* UCS2 alphabet */
17823                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
17824                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
17825                 .result = {
17826                         .type = STK_RESULT_TYPE_SUCCESS,
17827                 },
17828                 { .get_inkey = {
17829                         .text = {
17830                                 .text = "ル",
17831                         },
17832                 }},
17833         },
17834 };
17835
17836 static const unsigned char get_input_response_111[] = {
17837         0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x82,
17838         0x81, 0x83, 0x01, 0x00, 0x8d, 0x06, 0x04, 0x31,
17839         0x32, 0x33, 0x34, 0x35,
17840 };
17841
17842 static const struct terminal_response_test get_input_response_data_111 = {
17843         .pdu = get_input_response_111,
17844         .pdu_len = sizeof(get_input_response_111),
17845         .response = {
17846                 .number = 1,
17847                 .type = STK_COMMAND_TYPE_GET_INPUT,
17848                 .qualifier = 0x00,
17849                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
17850                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
17851                 .result = {
17852                         .type = STK_RESULT_TYPE_SUCCESS,
17853                 },
17854                 { .get_input = {
17855                         .text = {
17856                                 .text = "12345",
17857                         },
17858                 }},
17859         },
17860 };
17861
17862 static const unsigned char get_input_response_121[] = {
17863         0x81, 0x03, 0x01, 0x23, 0x08, 0x82, 0x02, 0x82,
17864         0x81, 0x83, 0x01, 0x00, 0x8d, 0x06, 0x00, 0xb6,
17865         0x9b, 0x6a, 0xb4, 0x02,
17866 };
17867
17868 static const struct terminal_response_test get_input_response_data_121 = {
17869         .pdu = get_input_response_121,
17870         .pdu_len = sizeof(get_input_response_121),
17871         .response = {
17872                 .number = 1,
17873                 .type = STK_COMMAND_TYPE_GET_INPUT,
17874                 .qualifier = 0x08, /* Input is packed */
17875                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
17876                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
17877                 .result = {
17878                         .type = STK_RESULT_TYPE_SUCCESS,
17879                 },
17880                 { .get_input = {
17881                         .text = {
17882                                 .text = "67*#+",
17883                                 .packed = TRUE,
17884                         },
17885                 }},
17886         },
17887 };
17888
17889 static const unsigned char get_input_response_131[] = {
17890         0x81, 0x03, 0x01, 0x23, 0x01, 0x82, 0x02, 0x82,
17891         0x81, 0x83, 0x01, 0x00, 0x8d, 0x06, 0x04, 0x41,
17892         0x62, 0x43, 0x64, 0x45,
17893 };
17894
17895 static const struct terminal_response_test get_input_response_data_131 = {
17896         .pdu = get_input_response_131,
17897         .pdu_len = sizeof(get_input_response_131),
17898         .response = {
17899                 .number = 1,
17900                 .type = STK_COMMAND_TYPE_GET_INPUT,
17901                 .qualifier = 0x01, /* Allow all SMS characters */
17902                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
17903                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
17904                 .result = {
17905                         .type = STK_RESULT_TYPE_SUCCESS,
17906                 },
17907                 { .get_input = {
17908                         .text = {
17909                                 .text = "AbCdE",
17910                         },
17911                 }},
17912         },
17913 };
17914
17915 static const unsigned char get_input_response_141[] = {
17916         0x81, 0x03, 0x01, 0x23, 0x04, 0x82, 0x02, 0x82,
17917         0x81, 0x83, 0x01, 0x00, 0x8d, 0x08, 0x04, 0x32,
17918         0x33, 0x34, 0x35, 0x36, 0x37, 0x38,
17919 };
17920
17921 static const struct terminal_response_test get_input_response_data_141 = {
17922         .pdu = get_input_response_141,
17923         .pdu_len = sizeof(get_input_response_141),
17924         .response = {
17925                 .number = 1,
17926                 .type = STK_COMMAND_TYPE_GET_INPUT,
17927                 .qualifier = 0x04, /* Hide text */
17928                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
17929                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
17930                 .result = {
17931                         .type = STK_RESULT_TYPE_SUCCESS,
17932                 },
17933                 { .get_input = {
17934                         .text = {
17935                                 .text = "2345678",
17936                         },
17937                 }},
17938         },
17939 };
17940
17941 static const unsigned char get_input_response_151[] = {
17942         0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x82,
17943         0x81, 0x83, 0x01, 0x00, 0x8d, 0x15, 0x04, 0x31,
17944         0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
17945         0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
17946         0x38, 0x39, 0x30,
17947 };
17948
17949 static const struct terminal_response_test get_input_response_data_151 = {
17950         .pdu = get_input_response_151,
17951         .pdu_len = sizeof(get_input_response_151),
17952         .response = {
17953                 .number = 1,
17954                 .type = STK_COMMAND_TYPE_GET_INPUT,
17955                 .qualifier = 0x00,
17956                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
17957                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
17958                 .result = {
17959                         .type = STK_RESULT_TYPE_SUCCESS,
17960                 },
17961                 { .get_input = {
17962                         .text = {
17963                                 .text = "12345678901234567890",
17964                         },
17965                 }},
17966         },
17967 };
17968
17969 static const unsigned char get_input_response_161[] = {
17970         0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x82,
17971         0x81, 0x83, 0x01, 0x11,
17972 };
17973
17974 static const struct terminal_response_test get_input_response_data_161 = {
17975         .pdu = get_input_response_161,
17976         .pdu_len = sizeof(get_input_response_161),
17977         .response = {
17978                 .number = 1,
17979                 .type = STK_COMMAND_TYPE_GET_INPUT,
17980                 .qualifier = 0x00,
17981                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
17982                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
17983                 .result = {
17984                         .type = STK_RESULT_TYPE_GO_BACK,
17985                 },
17986         },
17987 };
17988
17989 static const unsigned char get_input_response_171[] = {
17990         0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x82,
17991         0x81, 0x83, 0x01, 0x10,
17992 };
17993
17994 static const struct terminal_response_test get_input_response_data_171 = {
17995         .pdu = get_input_response_171,
17996         .pdu_len = sizeof(get_input_response_171),
17997         .response = {
17998                 .number = 1,
17999                 .type = STK_COMMAND_TYPE_GET_INPUT,
18000                 .qualifier = 0x00,
18001                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
18002                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
18003                 .result = {
18004                         .type = STK_RESULT_TYPE_USER_TERMINATED,
18005                 },
18006         },
18007 };
18008
18009 static const unsigned char get_input_response_181[] = {
18010         0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x82,
18011         0x81, 0x83, 0x01, 0x00, 0x8d, 0x81, 0xa1, 0x04,
18012         0x2a, 0x2a, 0x2a, 0x31, 0x31, 0x31, 0x31, 0x31,
18013         0x31, 0x31, 0x31, 0x31, 0x31, 0x23, 0x23, 0x23,
18014         0x2a, 0x2a, 0x2a, 0x32, 0x32, 0x32, 0x32, 0x32,
18015         0x32, 0x32, 0x32, 0x32, 0x32, 0x23, 0x23, 0x23,
18016         0x2a, 0x2a, 0x2a, 0x33, 0x33, 0x33, 0x33, 0x33,
18017         0x33, 0x33, 0x33, 0x33, 0x33, 0x23, 0x23, 0x23,
18018         0x2a, 0x2a, 0x2a, 0x34, 0x34, 0x34, 0x34, 0x34,
18019         0x34, 0x34, 0x34, 0x34, 0x34, 0x23, 0x23, 0x23,
18020         0x2a, 0x2a, 0x2a, 0x35, 0x35, 0x35, 0x35, 0x35,
18021         0x35, 0x35, 0x35, 0x35, 0x35, 0x23, 0x23, 0x23,
18022         0x2a, 0x2a, 0x2a, 0x36, 0x36, 0x36, 0x36, 0x36,
18023         0x36, 0x36, 0x36, 0x36, 0x36, 0x23, 0x23, 0x23,
18024         0x2a, 0x2a, 0x2a, 0x37, 0x37, 0x37, 0x37, 0x37,
18025         0x37, 0x37, 0x37, 0x37, 0x37, 0x23, 0x23, 0x23,
18026         0x2a, 0x2a, 0x2a, 0x38, 0x38, 0x38, 0x38, 0x38,
18027         0x38, 0x38, 0x38, 0x38, 0x38, 0x23, 0x23, 0x23,
18028         0x2a, 0x2a, 0x2a, 0x39, 0x39, 0x39, 0x39, 0x39,
18029         0x39, 0x39, 0x39, 0x39, 0x39, 0x23, 0x23, 0x23,
18030         0x2a, 0x2a, 0x2a, 0x30, 0x30, 0x30, 0x30, 0x30,
18031         0x30, 0x30, 0x30, 0x30, 0x30, 0x23, 0x23, 0x23,
18032 };
18033
18034 static const struct terminal_response_test get_input_response_data_181 = {
18035         .pdu = get_input_response_181,
18036         .pdu_len = sizeof(get_input_response_181),
18037         .response = {
18038                 .number = 1,
18039                 .type = STK_COMMAND_TYPE_GET_INPUT,
18040                 .qualifier = 0x00,
18041                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
18042                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
18043                 .result = {
18044                         .type = STK_RESULT_TYPE_SUCCESS,
18045                 },
18046                 { .get_input = {
18047                         .text = {
18048                                 .text = "***1111111111###***2222222222###"
18049                                         "***3333333333###***4444444444###"
18050                                         "***5555555555###***6666666666###"
18051                                         "***7777777777###***8888888888###"
18052                                         "***9999999999###***0000000000###",
18053                         },
18054                 }},
18055         },
18056 };
18057
18058 static const unsigned char get_input_response_191a[] = {
18059         0x81, 0x03, 0x01, 0x23, 0x01, 0x82, 0x02, 0x82,
18060         0x81, 0x83, 0x01, 0x00, 0x8d, 0x01, 0x04,
18061 };
18062
18063 static const unsigned char get_input_response_191b[] = {
18064         0x81, 0x03, 0x01, 0x23, 0x01, 0x82, 0x02, 0x82,
18065         0x81, 0x83, 0x01, 0x00, 0x8d, 0x00,
18066 };
18067
18068 static const struct terminal_response_test get_input_response_data_191 = {
18069         /* Either get_input_response_191a or get_input_response_191b is ok */
18070         .pdu = get_input_response_191a,
18071         .pdu_len = sizeof(get_input_response_191a),
18072         .response = {
18073                 .number = 1,
18074                 .type = STK_COMMAND_TYPE_GET_INPUT,
18075                 .qualifier = 0x01, /* Allow all SMS characters */
18076                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
18077                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
18078                 .result = {
18079                         .type = STK_RESULT_TYPE_SUCCESS,
18080                 },
18081                 { .get_input = {
18082                         .text = {
18083                                 .text = "",
18084                         },
18085                 }},
18086         },
18087 };
18088
18089 static const unsigned char get_input_response_211[] = {
18090         0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x82,
18091         0x81, 0x83, 0x01, 0x12,
18092 };
18093
18094 static const struct terminal_response_test get_input_response_data_211 = {
18095         .pdu = get_input_response_211,
18096         .pdu_len = sizeof(get_input_response_211),
18097         .response = {
18098                 .number = 1,
18099                 .type = STK_COMMAND_TYPE_GET_INPUT,
18100                 .qualifier = 0x00,
18101                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
18102                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
18103                 .result = {
18104                         .type = STK_RESULT_TYPE_NO_RESPONSE,
18105                 },
18106         },
18107 };
18108
18109 static const unsigned char get_input_response_311[] = {
18110         0x81, 0x03, 0x01, 0x23, 0x01, 0x82, 0x02, 0x82,
18111         0x81, 0x83, 0x01, 0x00, 0x8d, 0x06, 0x04, 0x48,
18112         0x45, 0x4c, 0x4c, 0x4f,
18113 };
18114
18115 static const struct terminal_response_test get_input_response_data_311 = {
18116         .pdu = get_input_response_311,
18117         .pdu_len = sizeof(get_input_response_311),
18118         .response = {
18119                 .number = 1,
18120                 .type = STK_COMMAND_TYPE_GET_INPUT,
18121                 .qualifier = 0x01, /* Allow all SMS characters */
18122                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
18123                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
18124                 .result = {
18125                         .type = STK_RESULT_TYPE_SUCCESS,
18126                 },
18127                 { .get_input = {
18128                         .text = {
18129                                 .text = "HELLO",
18130                         },
18131                 }},
18132         },
18133 };
18134
18135 static const unsigned char get_input_response_411[] = {
18136         0x81, 0x03, 0x01, 0x23, 0x03, 0x82, 0x02, 0x82,
18137         0x81, 0x83, 0x01, 0x00, 0x8d, 0x19, 0x08, 0x04,
18138         0x17, 0x04, 0x14, 0x04, 0x20, 0x04, 0x10, 0x04,
18139         0x12, 0x04, 0x21, 0x04, 0x22, 0x04, 0x12, 0x04,
18140         0x23, 0x04, 0x19, 0x04, 0x22, 0x04, 0x15,
18141 };
18142
18143 static const struct terminal_response_test get_input_response_data_411 = {
18144         .pdu = get_input_response_411,
18145         .pdu_len = sizeof(get_input_response_411),
18146         .response = {
18147                 .number = 1,
18148                 .type = STK_COMMAND_TYPE_GET_INPUT,
18149                 .qualifier = 0x03, /* Allow all UCS2 characters */
18150                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
18151                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
18152                 .result = {
18153                         .type = STK_RESULT_TYPE_SUCCESS,
18154                 },
18155                 { .get_input = {
18156                         .text = {
18157                                 .text = "ЗДРАВСТВУЙТЕ",
18158                         },
18159                 }},
18160         },
18161 };
18162
18163 static const unsigned char get_input_response_421[] = {
18164         0x81, 0x03, 0x01, 0x23, 0x03, 0x82, 0x02, 0x82,
18165         0x81, 0x83, 0x01, 0x00, 0x8d, 0x81, 0x8d, 0x08,
18166         0x04, 0x17, 0x04, 0x14, 0x04, 0x20, 0x04, 0x10,
18167         0x04, 0x12, 0x04, 0x21, 0x04, 0x22, 0x04, 0x12,
18168         0x04, 0x23, 0x04, 0x19, 0x04, 0x22, 0x04, 0x15,
18169         0x04, 0x17, 0x04, 0x14, 0x04, 0x20, 0x04, 0x10,
18170         0x04, 0x12, 0x04, 0x21, 0x04, 0x22, 0x04, 0x12,
18171         0x04, 0x23, 0x04, 0x19, 0x04, 0x22, 0x04, 0x15,
18172         0x04, 0x17, 0x04, 0x14, 0x04, 0x20, 0x04, 0x10,
18173         0x04, 0x12, 0x04, 0x21, 0x04, 0x22, 0x04, 0x12,
18174         0x04, 0x23, 0x04, 0x19, 0x04, 0x22, 0x04, 0x15,
18175         0x04, 0x17, 0x04, 0x14, 0x04, 0x20, 0x04, 0x10,
18176         0x04, 0x12, 0x04, 0x21, 0x04, 0x22, 0x04, 0x12,
18177         0x04, 0x23, 0x04, 0x19, 0x04, 0x22, 0x04, 0x15,
18178         0x04, 0x17, 0x04, 0x14, 0x04, 0x20, 0x04, 0x10,
18179         0x04, 0x12, 0x04, 0x21, 0x04, 0x22, 0x04, 0x12,
18180         0x04, 0x23, 0x04, 0x19, 0x04, 0x22, 0x04, 0x15,
18181         0x04, 0x17, 0x04, 0x14, 0x04, 0x20, 0x04, 0x10,
18182         0x04, 0x12, 0x04, 0x21, 0x04, 0x22, 0x04, 0x12,
18183         0x04, 0x23, 0x04, 0x19,
18184 };
18185
18186 static const struct terminal_response_test get_input_response_data_421 = {
18187         .pdu = get_input_response_421,
18188         .pdu_len = sizeof(get_input_response_421),
18189         .response = {
18190                 .number = 1,
18191                 .type = STK_COMMAND_TYPE_GET_INPUT,
18192                 .qualifier = 0x03, /* Allow all UCS2 characters */
18193                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
18194                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
18195                 .result = {
18196                         .type = STK_RESULT_TYPE_SUCCESS,
18197                 },
18198                 { .get_input = {
18199                         .text = {
18200                                 .text = "ЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕ"
18201                                         "ЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕ"
18202                                         "ЗДРАВСТВУЙТЕЗДРАВСТВУЙ",
18203                         },
18204                 }},
18205         },
18206 };
18207
18208 static const unsigned char get_input_response_611a[] = {
18209         0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x82,
18210         0x81, 0x83, 0x01, 0x00, 0x8d, 0x02, 0x04, 0x2b,
18211 };
18212
18213 static const struct terminal_response_test get_input_response_data_611a = {
18214         .pdu = get_input_response_611a,
18215         .pdu_len = sizeof(get_input_response_611a),
18216         .response = {
18217                 .number = 1,
18218                 .type = STK_COMMAND_TYPE_GET_INPUT,
18219                 .qualifier = 0x00,
18220                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
18221                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
18222                 .result = {
18223                         .type = STK_RESULT_TYPE_SUCCESS,
18224                 },
18225                 { .get_input = {
18226                         .text = {
18227                                 .text = "+",
18228                         },
18229                 }},
18230         },
18231 };
18232
18233 static const unsigned char get_input_response_611b[] = {
18234         0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x82,
18235         0x81, 0x83, 0x01, 0x04, 0x8d, 0x02, 0x04, 0x2b,
18236 };
18237
18238 static const struct terminal_response_test get_input_response_data_611b = {
18239         .pdu = get_input_response_611b,
18240         .pdu_len = sizeof(get_input_response_611b),
18241         .response = {
18242                 .number = 1,
18243                 .type = STK_COMMAND_TYPE_GET_INPUT,
18244                 .qualifier = 0x00,
18245                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
18246                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
18247                 .result = {
18248                         .type = STK_RESULT_TYPE_NO_ICON,
18249                 },
18250                 { .get_input = {
18251                         .text = {
18252                                 .text = "+",
18253                         },
18254                 }},
18255         },
18256 };
18257
18258 static const unsigned char get_input_response_711[] = {
18259         0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x82,
18260         0x81, 0x83, 0x01, 0x13,
18261 };
18262
18263 static const struct terminal_response_test get_input_response_data_711 = {
18264         .pdu = get_input_response_711,
18265         .pdu_len = sizeof(get_input_response_711),
18266         .response = {
18267                 .number = 1,
18268                 .type = STK_COMMAND_TYPE_GET_INPUT,
18269                 .qualifier = 0x00,
18270                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
18271                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
18272                 .result = {
18273                         .type = STK_RESULT_TYPE_HELP_REQUESTED,
18274                 },
18275         },
18276 };
18277
18278 static const unsigned char get_input_response_812[] = {
18279         0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x82,
18280         0x81, 0x83, 0x01, 0x00, 0x8d, 0x06, 0x04, 0x32,
18281         0x32, 0x32, 0x32, 0x32,
18282 };
18283
18284 static const struct terminal_response_test get_input_response_data_812 = {
18285         .pdu = get_input_response_812,
18286         .pdu_len = sizeof(get_input_response_812),
18287         .response = {
18288                 .number = 1,
18289                 .type = STK_COMMAND_TYPE_GET_INPUT,
18290                 .qualifier = 0x00,
18291                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
18292                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
18293                 .result = {
18294                         .type = STK_RESULT_TYPE_SUCCESS,
18295                 },
18296                 { .get_input = {
18297                         .text = {
18298                                 .text = "22222",
18299                         },
18300                 }},
18301         },
18302 };
18303
18304 static const unsigned char get_input_response_843[] = {
18305         0x81, 0x03, 0x01, 0x23, 0x00, 0x82, 0x02, 0x82,
18306         0x81, 0x83, 0x01, 0x00, 0x8d, 0x06, 0x04, 0x33,
18307         0x33, 0x33, 0x33, 0x33,
18308 };
18309
18310 static const struct terminal_response_test get_input_response_data_843 = {
18311         .pdu = get_input_response_843,
18312         .pdu_len = sizeof(get_input_response_843),
18313         .response = {
18314                 .number = 1,
18315                 .type = STK_COMMAND_TYPE_GET_INPUT,
18316                 .qualifier = 0x00,
18317                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
18318                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
18319                 .result = {
18320                         .type = STK_RESULT_TYPE_SUCCESS,
18321                 },
18322                 { .get_input = {
18323                         .text = {
18324                                 .text = "33333",
18325                         },
18326                 }},
18327         },
18328 };
18329
18330 static const unsigned char get_input_response_1011[] = {
18331         0x81, 0x03, 0x01, 0x23, 0x03, 0x82, 0x02, 0x82,
18332         0x81, 0x83, 0x01, 0x00, 0x8d, 0x05, 0x08, 0x4f,
18333         0x60, 0x59, 0x7d,
18334 };
18335
18336 static const struct terminal_response_test get_input_response_data_1011 = {
18337         .pdu = get_input_response_1011,
18338         .pdu_len = sizeof(get_input_response_1011),
18339         .response = {
18340                 .number = 1,
18341                 .type = STK_COMMAND_TYPE_GET_INPUT,
18342                 .qualifier = 0x03, /* Allow all UCS2 characters */
18343                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
18344                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
18345                 .result = {
18346                         .type = STK_RESULT_TYPE_SUCCESS,
18347                 },
18348                 { .get_input = {
18349                         .text = {
18350                                 .text = "你好",
18351                         },
18352                 }},
18353         },
18354 };
18355
18356 static const unsigned char get_input_response_1021[] = {
18357         0x81, 0x03, 0x01, 0x23, 0x03, 0x82, 0x02, 0x82,
18358         0x81, 0x83, 0x01, 0x00, 0x8d, 0x81, 0x8d, 0x08,
18359         0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
18360         0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
18361         0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
18362         0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
18363         0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
18364         0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
18365         0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
18366         0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
18367         0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
18368         0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
18369         0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
18370         0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
18371         0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
18372         0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
18373         0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
18374         0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
18375         0x4f, 0x60, 0x59, 0x7d, 0x4f, 0x60, 0x59, 0x7d,
18376         0x4f, 0x60, 0x59, 0x7d,
18377 };
18378
18379 static const struct terminal_response_test get_input_response_data_1021 = {
18380         .pdu = get_input_response_1021,
18381         .pdu_len = sizeof(get_input_response_1021),
18382         .response = {
18383                 .number = 1,
18384                 .type = STK_COMMAND_TYPE_GET_INPUT,
18385                 .qualifier = 0x03, /* Allow all UCS2 characters */
18386                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
18387                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
18388                 .result = {
18389                         .type = STK_RESULT_TYPE_SUCCESS,
18390                 },
18391                 { .get_input = {
18392                         .text = {
18393                                 .text = "你好你好你好你好你好你好"
18394                                         "你好你好你好你好你好你好"
18395                                         "你好你好你好你好你好你好"
18396                                         "你好你好你好你好你好你好"
18397                                         "你好你好你好你好你好你好"
18398                                         "你好你好你好你好你好",
18399                         },
18400                 }},
18401         },
18402 };
18403
18404 static const unsigned char get_input_response_1211[] = {
18405         0x81, 0x03, 0x01, 0x23, 0x03, 0x82, 0x02, 0x82,
18406         0x81, 0x83, 0x01, 0x00, 0x8d, 0x05, 0x08, 0x30,
18407         0xeb, 0x30, 0xeb,
18408 };
18409
18410 static const struct terminal_response_test get_input_response_data_1211 = {
18411         .pdu = get_input_response_1211,
18412         .pdu_len = sizeof(get_input_response_1211),
18413         .response = {
18414                 .number = 1,
18415                 .type = STK_COMMAND_TYPE_GET_INPUT,
18416                 .qualifier = 0x03, /* Allow all UCS2 characters */
18417                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
18418                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
18419                 .result = {
18420                         .type = STK_RESULT_TYPE_SUCCESS,
18421                 },
18422                 { .get_input = {
18423                         .text = {
18424                                 .text = "ルル",
18425                         },
18426                 }},
18427         },
18428 };
18429
18430 static const unsigned char get_input_response_1221[] = {
18431         0x81, 0x03, 0x01, 0x23, 0x03, 0x82, 0x02, 0x82,
18432         0x81, 0x83, 0x01, 0x00, 0x8d, 0x81, 0x8d, 0x08,
18433         0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
18434         0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
18435         0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
18436         0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
18437         0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
18438         0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
18439         0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
18440         0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
18441         0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
18442         0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
18443         0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
18444         0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
18445         0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
18446         0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
18447         0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
18448         0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
18449         0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb, 0x30, 0xeb,
18450         0x30, 0xeb, 0x30, 0xeb,
18451 };
18452
18453 static const struct terminal_response_test get_input_response_data_1221 = {
18454         .pdu = get_input_response_1221,
18455         .pdu_len = sizeof(get_input_response_1221),
18456         .response = {
18457                 .number = 1,
18458                 .type = STK_COMMAND_TYPE_GET_INPUT,
18459                 .qualifier = 0x03, /* Allow all UCS2 characters */
18460                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
18461                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
18462                 .result = {
18463                         .type = STK_RESULT_TYPE_SUCCESS,
18464                 },
18465                 { .get_input = {
18466                         .text = {
18467                                 .text = "ルルルルルルルルルルルル"
18468                                         "ルルルルルルルルルルルル"
18469                                         "ルルルルルルルルルルルル"
18470                                         "ルルルルルルルルルルルル"
18471                                         "ルルルルルルルルルルルル"
18472                                         "ルルルルルルルルルル",
18473                         },
18474                 }},
18475         },
18476 };
18477
18478 static const unsigned char more_time_response_111[] = {
18479         0x81, 0x03, 0x01, 0x02, 0x00, 0x82, 0x02, 0x82,
18480         0x81, 0x83, 0x01, 0x00,
18481 };
18482
18483 static const struct terminal_response_test more_time_response_data_111 = {
18484         .pdu = more_time_response_111,
18485         .pdu_len = sizeof(more_time_response_111),
18486         .response = {
18487                 .number = 1,
18488                 .type = STK_COMMAND_TYPE_MORE_TIME,
18489                 .qualifier = 0x00,
18490                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
18491                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
18492                 .result = {
18493                         .type = STK_RESULT_TYPE_SUCCESS,
18494                 },
18495         },
18496 };
18497
18498 static const unsigned char send_sms_response_111[] = {
18499         0x81, 0x03, 0x01, 0x13, 0x00, 0x82, 0x02, 0x82,
18500         0x81, 0x83, 0x01, 0x00,
18501 };
18502
18503 static const struct terminal_response_test send_sms_response_data_111 = {
18504         .pdu = send_sms_response_111,
18505         .pdu_len = sizeof(send_sms_response_111),
18506         .response = {
18507                 .number = 1,
18508                 .type = STK_COMMAND_TYPE_SEND_SMS,
18509                 .qualifier = 0x00,
18510                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
18511                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
18512                 .result = {
18513                         .type = STK_RESULT_TYPE_SUCCESS,
18514                 },
18515         },
18516 };
18517
18518 static const unsigned char send_sms_response_121[] = {
18519         0x81, 0x03, 0x01, 0x13, 0x01, 0x82, 0x02, 0x82,
18520         0x81, 0x83, 0x01, 0x00,
18521 };
18522
18523 static const struct terminal_response_test send_sms_response_data_121 = {
18524         .pdu = send_sms_response_121,
18525         .pdu_len = sizeof(send_sms_response_121),
18526         .response = {
18527                 .number = 1,
18528                 .type = STK_COMMAND_TYPE_SEND_SMS,
18529                 .qualifier = 0x01, /* Packing required */
18530                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
18531                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
18532                 .result = {
18533                         .type = STK_RESULT_TYPE_SUCCESS,
18534                 },
18535         },
18536 };
18537
18538 static const unsigned char send_sms_response_311b[] = {
18539         0x81, 0x03, 0x01, 0x13, 0x00, 0x82, 0x02, 0x82,
18540         0x81, 0x83, 0x01, 0x04,
18541 };
18542
18543 static const struct terminal_response_test send_sms_response_data_311b = {
18544         .pdu = send_sms_response_311b,
18545         .pdu_len = sizeof(send_sms_response_311b),
18546         .response = {
18547                 .number = 1,
18548                 .type = STK_COMMAND_TYPE_SEND_SMS,
18549                 .qualifier = 0x00,
18550                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
18551                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
18552                 .result = {
18553                         .type = STK_RESULT_TYPE_NO_ICON,
18554                 },
18555         },
18556 };
18557
18558 static const unsigned char play_tone_response_111[] = {
18559         0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x82,
18560         0x81, 0x83, 0x01, 0x00,
18561 };
18562
18563 static const struct terminal_response_test play_tone_response_data_111 = {
18564         .pdu = play_tone_response_111,
18565         .pdu_len = sizeof(play_tone_response_111),
18566         .response = {
18567                 .number = 1,
18568                 .type = STK_COMMAND_TYPE_PLAY_TONE,
18569                 .qualifier = 0x00,
18570                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
18571                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
18572                 .result = {
18573                         .type = STK_RESULT_TYPE_SUCCESS,
18574                 },
18575         },
18576 };
18577
18578 static const unsigned char play_tone_response_119b[] = {
18579         0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x82,
18580         0x81, 0x83, 0x01, 0x30,
18581 };
18582
18583 static const struct terminal_response_test play_tone_response_data_119b = {
18584         .pdu = play_tone_response_119b,
18585         .pdu_len = sizeof(play_tone_response_119b),
18586         .response = {
18587                 .number = 1,
18588                 .type = STK_COMMAND_TYPE_PLAY_TONE,
18589                 .qualifier = 0x00,
18590                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
18591                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
18592                 .result = {
18593                         .type = STK_RESULT_TYPE_NOT_CAPABLE,
18594                 },
18595         },
18596 };
18597
18598 static const unsigned char play_tone_response_1114[] = {
18599         0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x82,
18600         0x81, 0x83, 0x01, 0x10,
18601 };
18602
18603 static const struct terminal_response_test play_tone_response_data_1114 = {
18604         .pdu = play_tone_response_1114,
18605         .pdu_len = sizeof(play_tone_response_1114),
18606         .response = {
18607                 .number = 1,
18608                 .type = STK_COMMAND_TYPE_PLAY_TONE,
18609                 .qualifier = 0x00,
18610                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
18611                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
18612                 .result = {
18613                         .type = STK_RESULT_TYPE_USER_TERMINATED,
18614                 },
18615         },
18616 };
18617
18618 static const unsigned char play_tone_response_311b[] = {
18619         0x81, 0x03, 0x01, 0x20, 0x00, 0x82, 0x02, 0x82,
18620         0x81, 0x83, 0x01, 0x04,
18621 };
18622
18623 static const struct terminal_response_test play_tone_response_data_311b = {
18624         .pdu = play_tone_response_311b,
18625         .pdu_len = sizeof(play_tone_response_311b),
18626         .response = {
18627                 .number = 1,
18628                 .type = STK_COMMAND_TYPE_PLAY_TONE,
18629                 .qualifier = 0x00,
18630                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
18631                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
18632                 .result = {
18633                         .type = STK_RESULT_TYPE_NO_ICON,
18634                 },
18635         },
18636 };
18637
18638 /* TS 102 384 */
18639 static const unsigned char poll_interval_response_111[] = {
18640         0x81, 0x03, 0x01, 0x03, 0x00, 0x82, 0x02, 0x82,
18641         0x81, 0x83, 0x01, 0x00, 0x84, 0x02, 0x01, 0x14,
18642 };
18643
18644 static const struct terminal_response_test poll_interval_response_data_111 = {
18645         .pdu = poll_interval_response_111,
18646         .pdu_len = sizeof(poll_interval_response_111),
18647         .response = {
18648                 .number = 1,
18649                 .type = STK_COMMAND_TYPE_POLL_INTERVAL,
18650                 .qualifier = 0x00,
18651                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
18652                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
18653                 .result = {
18654                         .type = STK_RESULT_TYPE_SUCCESS,
18655                 },
18656                 { .poll_interval = {
18657                         .max_interval = {
18658                                 .unit = STK_DURATION_TYPE_SECONDS,
18659                                 .interval = 20,
18660                         },
18661                 }},
18662         },
18663 };
18664
18665 /* 3GPP TS 31.124 */
18666 static const unsigned char poll_interval_response_111a[] = {
18667         0x81, 0x03, 0x01, 0x03, 0x00, 0x82, 0x02, 0x82,
18668         0x81, 0x83, 0x01, 0x00, 0x84, 0x02, 0x00, 0x01,
18669 };
18670
18671 static const unsigned char poll_interval_response_111b[] = {
18672         0x81, 0x03, 0x01, 0x03, 0x00, 0x82, 0x02, 0x82,
18673         0x81, 0x83, 0x01, 0x00, 0x84, 0x02, 0x01, 0x3c,
18674 };
18675
18676 static const struct terminal_response_test poll_interval_response_data_111a = {
18677         /* Either poll_interval_response_111a or b is ok */
18678         .pdu = poll_interval_response_111a,
18679         .pdu_len = sizeof(poll_interval_response_111a),
18680         .response = {
18681                 .number = 1,
18682                 .type = STK_COMMAND_TYPE_POLL_INTERVAL,
18683                 .qualifier = 0x00,
18684                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
18685                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
18686                 .result = {
18687                         .type = STK_RESULT_TYPE_SUCCESS,
18688                 },
18689                 { .poll_interval = {
18690                         .max_interval = {
18691                                 .unit = STK_DURATION_TYPE_MINUTES,
18692                                 .interval = 1,
18693                         },
18694                 }},
18695         },
18696 };
18697
18698 static const unsigned char refresh_response_111a[] = {
18699         0x81, 0x03, 0x01, 0x01, 0x03, 0x82, 0x02, 0x82,
18700         0x81, 0x83, 0x01, 0x00,
18701 };
18702
18703 static const struct terminal_response_test refresh_response_data_111a = {
18704         .pdu = refresh_response_111a,
18705         .pdu_len = sizeof(refresh_response_111a),
18706         .response = {
18707                 .number = 1,
18708                 .type = STK_COMMAND_TYPE_REFRESH,
18709                 .qualifier = 0x03, /* USIM Initialization */
18710                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
18711                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
18712                 .result = {
18713                         .type = STK_RESULT_TYPE_SUCCESS,
18714                 },
18715         },
18716 };
18717
18718 static const unsigned char refresh_response_111b[] = {
18719         0x81, 0x03, 0x01, 0x01, 0x03, 0x82, 0x02, 0x82,
18720         0x81, 0x83, 0x01, 0x03,
18721 };
18722
18723 static const struct terminal_response_test refresh_response_data_111b = {
18724         .pdu = refresh_response_111b,
18725         .pdu_len = sizeof(refresh_response_111b),
18726         .response = {
18727                 .number = 1,
18728                 .type = STK_COMMAND_TYPE_REFRESH,
18729                 .qualifier = 0x03, /* USIM Initialization */
18730                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
18731                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
18732                 .result = {
18733                         .type = STK_RESULT_TYPE_REFRESH_WITH_EFS,
18734                 },
18735         },
18736 };
18737
18738 static const unsigned char refresh_response_121a[] = {
18739         0x81, 0x03, 0x01, 0x01, 0x01, 0x82, 0x02, 0x82,
18740         0x81, 0x83, 0x01, 0x00,
18741 };
18742
18743 static const struct terminal_response_test refresh_response_data_121a = {
18744         .pdu = refresh_response_121a,
18745         .pdu_len = sizeof(refresh_response_121a),
18746         .response = {
18747                 .number = 1,
18748                 .type = STK_COMMAND_TYPE_REFRESH,
18749                 .qualifier = 0x01, /* File Change Notification */
18750                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
18751                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
18752                 .result = {
18753                         .type = STK_RESULT_TYPE_SUCCESS,
18754                 },
18755         },
18756 };
18757
18758 static const unsigned char refresh_response_121b[] = {
18759         0x81, 0x03, 0x01, 0x01, 0x01, 0x82, 0x02, 0x82,
18760         0x81, 0x83, 0x01, 0x03,
18761 };
18762
18763 static const struct terminal_response_test refresh_response_data_121b = {
18764         .pdu = refresh_response_121b,
18765         .pdu_len = sizeof(refresh_response_121b),
18766         .response = {
18767                 .number = 1,
18768                 .type = STK_COMMAND_TYPE_REFRESH,
18769                 .qualifier = 0x01, /* File Change Notification */
18770                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
18771                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
18772                 .result = {
18773                         .type = STK_RESULT_TYPE_REFRESH_WITH_EFS,
18774                 },
18775         },
18776 };
18777
18778 static const unsigned char refresh_response_131a[] = {
18779         0x81, 0x03, 0x01, 0x01, 0x02, 0x82, 0x02, 0x82,
18780         0x81, 0x83, 0x01, 0x00,
18781 };
18782
18783 static const struct terminal_response_test refresh_response_data_131a = {
18784         .pdu = refresh_response_131a,
18785         .pdu_len = sizeof(refresh_response_131a),
18786         .response = {
18787                 .number = 1,
18788                 .type = STK_COMMAND_TYPE_REFRESH,
18789                 .qualifier = 0x02, /* USIM Initialization & File Change */
18790                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
18791                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
18792                 .result = {
18793                         .type = STK_RESULT_TYPE_SUCCESS,
18794                 },
18795         },
18796 };
18797
18798 static const unsigned char refresh_response_131b[] = {
18799         0x81, 0x03, 0x01, 0x01, 0x02, 0x82, 0x02, 0x82,
18800         0x81, 0x83, 0x01, 0x03,
18801 };
18802
18803 static const struct terminal_response_test refresh_response_data_131b = {
18804         .pdu = refresh_response_131b,
18805         .pdu_len = sizeof(refresh_response_131b),
18806         .response = {
18807                 .number = 1,
18808                 .type = STK_COMMAND_TYPE_REFRESH,
18809                 .qualifier = 0x02, /* USIM Initialization & File Change */
18810                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
18811                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
18812                 .result = {
18813                         .type = STK_RESULT_TYPE_REFRESH_WITH_EFS,
18814                 },
18815         },
18816 };
18817
18818 static const unsigned char refresh_response_141a[] = {
18819         0x81, 0x03, 0x01, 0x01, 0x00, 0x82, 0x02, 0x82,
18820         0x81, 0x83, 0x01, 0x00,
18821 };
18822
18823 static const struct terminal_response_test refresh_response_data_141a = {
18824         .pdu = refresh_response_141a,
18825         .pdu_len = sizeof(refresh_response_141a),
18826         .response = {
18827                 .number = 1,
18828                 .type = STK_COMMAND_TYPE_REFRESH,
18829                 .qualifier = 0x00, /* USIM Initialization & Full File Change */
18830                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
18831                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
18832                 .result = {
18833                         .type = STK_RESULT_TYPE_SUCCESS,
18834                 },
18835         },
18836 };
18837
18838 static const unsigned char refresh_response_141b[] = {
18839         0x81, 0x03, 0x01, 0x01, 0x00, 0x82, 0x02, 0x82,
18840         0x81, 0x83, 0x01, 0x03,
18841 };
18842
18843 static const struct terminal_response_test refresh_response_data_141b = {
18844         .pdu = refresh_response_141b,
18845         .pdu_len = sizeof(refresh_response_141b),
18846         .response = {
18847                 .number = 1,
18848                 .type = STK_COMMAND_TYPE_REFRESH,
18849                 .qualifier = 0x00, /* USIM Initialization & Full File Change */
18850                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
18851                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
18852                 .result = {
18853                         .type = STK_RESULT_TYPE_REFRESH_WITH_EFS,
18854                 },
18855         },
18856 };
18857
18858 static const unsigned char refresh_response_171[] = {
18859         0x81, 0x03, 0x01, 0x01, 0x05, 0x82, 0x02, 0x82,
18860         0x81, 0x83, 0x01, 0x00,
18861 };
18862
18863 static const struct terminal_response_test refresh_response_data_171 = {
18864         .pdu = refresh_response_171,
18865         .pdu_len = sizeof(refresh_response_171),
18866         .response = {
18867                 .number = 1,
18868                 .type = STK_COMMAND_TYPE_REFRESH,
18869                 .qualifier = 0x05, /* USIM Application Reset */
18870                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
18871                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
18872                 .result = {
18873                         .type = STK_RESULT_TYPE_SUCCESS,
18874                 },
18875         },
18876 };
18877
18878 static const unsigned char refresh_response_241a[] = {
18879         0x81, 0x03, 0x01, 0x01, 0x06, 0x82, 0x02, 0x82,
18880         0x81, 0x83, 0x02, 0x20, 0x02,
18881 };
18882
18883 static const struct terminal_response_test refresh_response_data_241a = {
18884         .pdu = refresh_response_241a,
18885         .pdu_len = sizeof(refresh_response_241a),
18886         .response = {
18887                 .number = 1,
18888                 .type = STK_COMMAND_TYPE_REFRESH,
18889                 .qualifier = 0x06, /* 3G Session Reset */
18890                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
18891                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
18892                 .result = {
18893                         .type = STK_RESULT_TYPE_TERMINAL_BUSY,
18894                         .additional_len = 1, /* ME currently busy on call */
18895                         .additional = (unsigned char *) "\2",
18896                 },
18897         },
18898 };
18899
18900 static const unsigned char refresh_response_241b[] = {
18901         0x81, 0x03, 0x01, 0x01, 0x06, 0x82, 0x02, 0x82,
18902         0x81, 0x83, 0x02, 0x20, 0x01,
18903 };
18904
18905 static const struct terminal_response_test refresh_response_data_241b = {
18906         .pdu = refresh_response_241b,
18907         .pdu_len = sizeof(refresh_response_241b),
18908         .response = {
18909                 .number = 1,
18910                 .type = STK_COMMAND_TYPE_REFRESH,
18911                 .qualifier = 0x06, /* 3G Session Reset */
18912                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
18913                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
18914                 .result = {
18915                         .type = STK_RESULT_TYPE_TERMINAL_BUSY,
18916                         .additional_len = 1, /* Screen is busy */
18917                         .additional = (unsigned char *) "\1",
18918                 },
18919         },
18920 };
18921
18922 static const unsigned char refresh_response_311[] = {
18923         0x81, 0x03, 0x01, 0x01, 0x07, 0x82, 0x02, 0x82,
18924         0x81, 0x83, 0x01, 0x20,
18925 };
18926
18927 static const struct terminal_response_test refresh_response_data_311 = {
18928         .pdu = refresh_response_311,
18929         .pdu_len = sizeof(refresh_response_311),
18930         .response = {
18931                 .number = 1,
18932                 .type = STK_COMMAND_TYPE_REFRESH,
18933                 .qualifier = 0x07, /* Steering of roaming */
18934                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
18935                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
18936                 .result = {
18937                         .type = STK_RESULT_TYPE_TERMINAL_BUSY,
18938                 },
18939         },
18940 };
18941
18942 static const unsigned char refresh_response_312[] = {
18943         0x81, 0x03, 0x01, 0x01, 0x07, 0x82, 0x02, 0x82,
18944         0x81, 0x83, 0x01, 0x00,
18945 };
18946
18947 static const struct terminal_response_test refresh_response_data_312 = {
18948         .pdu = refresh_response_312,
18949         .pdu_len = sizeof(refresh_response_312),
18950         .response = {
18951                 .number = 1,
18952                 .type = STK_COMMAND_TYPE_REFRESH,
18953                 .qualifier = 0x07, /* Steering of roaming */
18954                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
18955                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
18956                 .result = {
18957                         .type = STK_RESULT_TYPE_SUCCESS,
18958                 },
18959         },
18960 };
18961
18962 static const unsigned char set_up_menu_response_111[] = {
18963         0x81, 0x03, 0x01, 0x25, 0x00, 0x82, 0x02, 0x82,
18964         0x81, 0x83, 0x01, 0x00,
18965 };
18966
18967 static const struct terminal_response_test set_up_menu_response_data_111 = {
18968         .pdu = set_up_menu_response_111,
18969         .pdu_len = sizeof(set_up_menu_response_111),
18970         .response = {
18971                 .number = 1,
18972                 .type = STK_COMMAND_TYPE_SETUP_MENU,
18973                 .qualifier = 0x00,
18974                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
18975                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
18976                 .result = {
18977                         .type = STK_RESULT_TYPE_SUCCESS,
18978                 },
18979         },
18980 };
18981
18982 static const unsigned char set_up_menu_response_411b[] = {
18983         0x81, 0x03, 0x01, 0x25, 0x00, 0x82, 0x02, 0x82,
18984         0x81, 0x83, 0x01, 0x04,
18985 };
18986
18987 static const struct terminal_response_test set_up_menu_response_data_411b = {
18988         .pdu = set_up_menu_response_411b,
18989         .pdu_len = sizeof(set_up_menu_response_411b),
18990         .response = {
18991                 .number = 1,
18992                 .type = STK_COMMAND_TYPE_SETUP_MENU,
18993                 .qualifier = 0x00,
18994                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
18995                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
18996                 .result = {
18997                         .type = STK_RESULT_TYPE_NO_ICON,
18998                 },
18999         },
19000 };
19001
19002 static const unsigned char set_up_menu_response_511[] = {
19003         0x81, 0x03, 0x01, 0x25, 0x01, 0x82, 0x02, 0x82,
19004         0x81, 0x83, 0x01, 0x00,
19005 };
19006
19007 static const struct terminal_response_test set_up_menu_response_data_511 = {
19008         .pdu = set_up_menu_response_511,
19009         .pdu_len = sizeof(set_up_menu_response_511),
19010         .response = {
19011                 .number = 1,
19012                 .type = STK_COMMAND_TYPE_SETUP_MENU,
19013                 .qualifier = 0x01, /* Soft key selection preferred */
19014                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
19015                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
19016                 .result = {
19017                         .type = STK_RESULT_TYPE_SUCCESS,
19018                 },
19019         },
19020 };
19021
19022 static const unsigned char select_item_response_111[] = {
19023         0x81, 0x03, 0x01, 0x24, 0x00, 0x82, 0x02, 0x82,
19024         0x81, 0x83, 0x01, 0x00, 0x90, 0x01, 0x02,
19025 };
19026
19027 static const struct terminal_response_test select_item_response_data_111 = {
19028         .pdu = select_item_response_111,
19029         .pdu_len = sizeof(select_item_response_111),
19030         .response = {
19031                 .number = 1,
19032                 .type = STK_COMMAND_TYPE_SELECT_ITEM,
19033                 .qualifier = 0x00,
19034                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
19035                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
19036                 .result = {
19037                         .type = STK_RESULT_TYPE_SUCCESS,
19038                 },
19039                 { .select_item = {
19040                         .item_id = 2,
19041                 }},
19042         },
19043 };
19044
19045 static const unsigned char select_item_response_121[] = {
19046         0x81, 0x03, 0x01, 0x24, 0x00, 0x82, 0x02, 0x82,
19047         0x81, 0x83, 0x01, 0x00, 0x90, 0x01, 0x3d,
19048 };
19049
19050 static const struct terminal_response_test select_item_response_data_121 = {
19051         .pdu = select_item_response_121,
19052         .pdu_len = sizeof(select_item_response_121),
19053         .response = {
19054                 .number = 1,
19055                 .type = STK_COMMAND_TYPE_SELECT_ITEM,
19056                 .qualifier = 0x00,
19057                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
19058                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
19059                 .result = {
19060                         .type = STK_RESULT_TYPE_SUCCESS,
19061                 },
19062                 { .select_item = {
19063                         .item_id = 61,
19064                 }},
19065         },
19066 };
19067
19068 static const unsigned char select_item_response_131[] = {
19069         0x81, 0x03, 0x01, 0x24, 0x00, 0x82, 0x02, 0x82,
19070         0x81, 0x83, 0x01, 0x00, 0x90, 0x01, 0xfb,
19071 };
19072
19073 static const struct terminal_response_test select_item_response_data_131 = {
19074         .pdu = select_item_response_131,
19075         .pdu_len = sizeof(select_item_response_131),
19076         .response = {
19077                 .number = 1,
19078                 .type = STK_COMMAND_TYPE_SELECT_ITEM,
19079                 .qualifier = 0x00,
19080                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
19081                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
19082                 .result = {
19083                         .type = STK_RESULT_TYPE_SUCCESS,
19084                 },
19085                 { .select_item = {
19086                         .item_id = 251,
19087                 }},
19088         },
19089 };
19090
19091 static const unsigned char select_item_response_141[] = {
19092         0x81, 0x03, 0x01, 0x24, 0x00, 0x82, 0x02, 0x82,
19093         0x81, 0x83, 0x01, 0x11,
19094 };
19095
19096 static const struct terminal_response_test select_item_response_data_141 = {
19097         /* The response can be select_item_response_141 or it can optionally
19098          * have an ITEM_ID data object appended with any id (90 01 XX).  */
19099         .pdu = select_item_response_141,
19100         .pdu_len = sizeof(select_item_response_141),
19101         .response = {
19102                 .number = 1,
19103                 .type = STK_COMMAND_TYPE_SELECT_ITEM,
19104                 .qualifier = 0x00,
19105                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
19106                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
19107                 .result = {
19108                         .type = STK_RESULT_TYPE_GO_BACK,
19109                 },
19110         },
19111 };
19112
19113 static const unsigned char select_item_response_142[] = {
19114         0x81, 0x03, 0x01, 0x24, 0x00, 0x82, 0x02, 0x82,
19115         0x81, 0x83, 0x01, 0x10,
19116 };
19117
19118 static const struct terminal_response_test select_item_response_data_142 = {
19119         /* The response can be select_item_response_142 or it can optionally
19120          * have an ITEM_ID data object appended with any id (90 01 XX).  */
19121         .pdu = select_item_response_142,
19122         .pdu_len = sizeof(select_item_response_142),
19123         .response = {
19124                 .number = 1,
19125                 .type = STK_COMMAND_TYPE_SELECT_ITEM,
19126                 .qualifier = 0x00,
19127                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
19128                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
19129                 .result = {
19130                         .type = STK_RESULT_TYPE_USER_TERMINATED,
19131                 },
19132         },
19133 };
19134
19135 static const unsigned char select_item_response_151[] = {
19136         0x81, 0x03, 0x01, 0x24, 0x00, 0x82, 0x02, 0x82,
19137         0x81, 0x83, 0x01, 0x00, 0x90, 0x01, 0x01,
19138 };
19139
19140 static const struct terminal_response_test select_item_response_data_151 = {
19141         .pdu = select_item_response_151,
19142         .pdu_len = sizeof(select_item_response_151),
19143         .response = {
19144                 .number = 1,
19145                 .type = STK_COMMAND_TYPE_SELECT_ITEM,
19146                 .qualifier = 0x00,
19147                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
19148                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
19149                 .result = {
19150                         .type = STK_RESULT_TYPE_SUCCESS,
19151                 },
19152                 { .select_item = {
19153                         .item_id = 1,
19154                 }},
19155         },
19156 };
19157
19158 static const unsigned char select_item_response_311[] = {
19159         0x81, 0x03, 0x01, 0x24, 0x00, 0x82, 0x02, 0x82,
19160         0x81, 0x83, 0x01, 0x00, 0x90, 0x01, 0x03,
19161 };
19162
19163 static const struct terminal_response_test select_item_response_data_311 = {
19164         .pdu = select_item_response_311,
19165         .pdu_len = sizeof(select_item_response_311),
19166         .response = {
19167                 .number = 1,
19168                 .type = STK_COMMAND_TYPE_SELECT_ITEM,
19169                 .qualifier = 0x00,
19170                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
19171                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
19172                 .result = {
19173                         .type = STK_RESULT_TYPE_SUCCESS,
19174                 },
19175                 { .select_item = {
19176                         .item_id = 3,
19177                 }},
19178         },
19179 };
19180
19181 static const unsigned char select_item_response_411[] = {
19182         0x81, 0x03, 0x01, 0x24, 0x80, 0x82, 0x02, 0x82,
19183         0x81, 0x83, 0x01, 0x13, 0x90, 0x01, 0x01,
19184 };
19185
19186 static const struct terminal_response_test select_item_response_data_411 = {
19187         .pdu = select_item_response_411,
19188         .pdu_len = sizeof(select_item_response_411),
19189         .response = {
19190                 .number = 1,
19191                 .type = STK_COMMAND_TYPE_SELECT_ITEM,
19192                 .qualifier = 0x80, /* Help information available */
19193                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
19194                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
19195                 .result = {
19196                         .type = STK_RESULT_TYPE_HELP_REQUESTED,
19197                 },
19198                 { .select_item = {
19199                         .item_id = 1,
19200                 }},
19201         },
19202 };
19203
19204 static const unsigned char select_item_response_511b[] = {
19205         0x81, 0x03, 0x01, 0x24, 0x00, 0x82, 0x02, 0x82,
19206         0x81, 0x83, 0x01, 0x04, 0x90, 0x01, 0x01,
19207 };
19208
19209 static const struct terminal_response_test select_item_response_data_511b = {
19210         .pdu = select_item_response_511b,
19211         .pdu_len = sizeof(select_item_response_511b),
19212         .response = {
19213                 .number = 1,
19214                 .type = STK_COMMAND_TYPE_SELECT_ITEM,
19215                 .qualifier = 0x00,
19216                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
19217                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
19218                 .result = {
19219                         .type = STK_RESULT_TYPE_NO_ICON,
19220                 },
19221                 { .select_item = {
19222                         .item_id = 1,
19223                 }},
19224         },
19225 };
19226
19227 static const unsigned char select_item_response_611[] = {
19228         0x81, 0x03, 0x01, 0x24, 0x03, 0x82, 0x02, 0x82,
19229         0x81, 0x83, 0x01, 0x00, 0x90, 0x01, 0x01,
19230 };
19231
19232 static const struct terminal_response_test select_item_response_data_611 = {
19233         .pdu = select_item_response_611,
19234         .pdu_len = sizeof(select_item_response_611),
19235         .response = {
19236                 .number = 1,
19237                 .type = STK_COMMAND_TYPE_SELECT_ITEM,
19238                 .qualifier = 0x03, /* Choice of navigation options */
19239                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
19240                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
19241                 .result = {
19242                         .type = STK_RESULT_TYPE_SUCCESS,
19243                 },
19244                 { .select_item = {
19245                         .item_id = 1,
19246                 }},
19247         },
19248 };
19249
19250 static const unsigned char select_item_response_621[] = {
19251         0x81, 0x03, 0x01, 0x24, 0x01, 0x82, 0x02, 0x82,
19252         0x81, 0x83, 0x01, 0x00, 0x90, 0x01, 0x01,
19253 };
19254
19255 static const struct terminal_response_test select_item_response_data_621 = {
19256         .pdu = select_item_response_621,
19257         .pdu_len = sizeof(select_item_response_621),
19258         .response = {
19259                 .number = 1,
19260                 .type = STK_COMMAND_TYPE_SELECT_ITEM,
19261                 .qualifier = 0x01, /* Choice of data values presentation */
19262                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
19263                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
19264                 .result = {
19265                         .type = STK_RESULT_TYPE_SUCCESS,
19266                 },
19267                 { .select_item = {
19268                         .item_id = 1,
19269                 }},
19270         },
19271 };
19272
19273 static const unsigned char select_item_response_711[] = {
19274         0x81, 0x03, 0x01, 0x24, 0x04, 0x82, 0x02, 0x82,
19275         0x81, 0x83, 0x01, 0x00, 0x90, 0x01, 0x01,
19276 };
19277
19278 static const struct terminal_response_test select_item_response_data_711 = {
19279         .pdu = select_item_response_711,
19280         .pdu_len = sizeof(select_item_response_711),
19281         .response = {
19282                 .number = 1,
19283                 .type = STK_COMMAND_TYPE_SELECT_ITEM,
19284                 .qualifier = 0x04, /* Selection using soft keys preferred */
19285                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
19286                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
19287                 .result = {
19288                         .type = STK_RESULT_TYPE_SUCCESS,
19289                 },
19290                 { .select_item = {
19291                         .item_id = 1,
19292                 }},
19293         },
19294 };
19295
19296 static const unsigned char select_item_response_811[] = {
19297         0x81, 0x03, 0x01, 0x24, 0x00, 0x82, 0x02, 0x82,
19298         0x81, 0x83, 0x01, 0x12,
19299 };
19300
19301 static const struct terminal_response_test select_item_response_data_811 = {
19302         .pdu = select_item_response_811,
19303         .pdu_len = sizeof(select_item_response_811),
19304         .response = {
19305                 .number = 1,
19306                 .type = STK_COMMAND_TYPE_SELECT_ITEM,
19307                 .qualifier = 0x00,
19308                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
19309                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
19310                 .result = {
19311                         .type = STK_RESULT_TYPE_NO_RESPONSE,
19312                 },
19313         },
19314 };
19315
19316 static const unsigned char set_up_call_response_111[] = {
19317         0x81, 0x03, 0x01, 0x10, 0x00, 0x82, 0x02, 0x82,
19318         0x81, 0x83, 0x01, 0x00,
19319 };
19320
19321 static const struct terminal_response_test set_up_call_response_data_111 = {
19322         .pdu = set_up_call_response_111,
19323         .pdu_len = sizeof(set_up_call_response_111),
19324         .response = {
19325                 .number = 1,
19326                 .type = STK_COMMAND_TYPE_SETUP_CALL,
19327                 .qualifier = 0x00, /* Only if not busy on another call */
19328                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
19329                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
19330                 .result = {
19331                         .type = STK_RESULT_TYPE_SUCCESS,
19332                 },
19333         },
19334 };
19335
19336 static const unsigned char set_up_call_response_121[] = {
19337         0x81, 0x03, 0x01, 0x10, 0x00, 0x82, 0x02, 0x82,
19338         0x81, 0x83, 0x01, 0x22,
19339 };
19340
19341 static const struct terminal_response_test set_up_call_response_data_121 = {
19342         .pdu = set_up_call_response_121,
19343         .pdu_len = sizeof(set_up_call_response_121),
19344         .response = {
19345                 .number = 1,
19346                 .type = STK_COMMAND_TYPE_SETUP_CALL,
19347                 .qualifier = 0x00, /* Only if not busy on another call */
19348                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
19349                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
19350                 .result = {
19351                         .type = STK_RESULT_TYPE_USER_REJECT,
19352                 },
19353         },
19354 };
19355
19356 static const unsigned char set_up_call_response_141[] = {
19357         0x81, 0x03, 0x01, 0x10, 0x02, 0x82, 0x02, 0x82,
19358         0x81, 0x83, 0x01, 0x00,
19359 };
19360
19361 static const struct terminal_response_test set_up_call_response_data_141 = {
19362         .pdu = set_up_call_response_141,
19363         .pdu_len = sizeof(set_up_call_response_141),
19364         .response = {
19365                 .number = 1,
19366                 .type = STK_COMMAND_TYPE_SETUP_CALL,
19367                 .qualifier = 0x02, /* Put all other calls on hold */
19368                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
19369                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
19370                 .result = {
19371                         .type = STK_RESULT_TYPE_SUCCESS,
19372                 },
19373         },
19374 };
19375
19376 static const unsigned char set_up_call_response_151[] = {
19377         0x81, 0x03, 0x01, 0x10, 0x04, 0x82, 0x02, 0x82,
19378         0x81, 0x83, 0x01, 0x00,
19379 };
19380
19381 static const struct terminal_response_test set_up_call_response_data_151 = {
19382         .pdu = set_up_call_response_151,
19383         .pdu_len = sizeof(set_up_call_response_151),
19384         .response = {
19385                 .number = 1,
19386                 .type = STK_COMMAND_TYPE_SETUP_CALL,
19387                 .qualifier = 0x04, /* Disconnect all other calls */
19388                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
19389                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
19390                 .result = {
19391                         .type = STK_RESULT_TYPE_SUCCESS,
19392                 },
19393         },
19394 };
19395
19396 static const unsigned char set_up_call_response_161[] = {
19397         0x81, 0x03, 0x01, 0x10, 0x00, 0x82, 0x02, 0x82,
19398         0x81, 0x83, 0x02, 0x20, 0x02,
19399 };
19400
19401 static const struct terminal_response_test set_up_call_response_data_161 = {
19402         .pdu = set_up_call_response_161,
19403         .pdu_len = sizeof(set_up_call_response_161),
19404         .response = {
19405                 .number = 1,
19406                 .type = STK_COMMAND_TYPE_SETUP_CALL,
19407                 .qualifier = 0x00, /* Only if not busy on another call */
19408                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
19409                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
19410                 .result = {
19411                         .type = STK_RESULT_TYPE_TERMINAL_BUSY,
19412                         .additional_len = 1, /* ME currently busy on call */
19413                         .additional = (unsigned char[1]) { 0x02 },
19414                 },
19415         },
19416 };
19417
19418 static const unsigned char set_up_call_response_171a[] = {
19419         0x81, 0x03, 0x01, 0x10, 0x02, 0x82, 0x02, 0x82,
19420         0x81, 0x83, 0x02, 0x21, 0x00,
19421 };
19422
19423 static const struct terminal_response_test set_up_call_response_data_171a = {
19424         .pdu = set_up_call_response_171a,
19425         .pdu_len = sizeof(set_up_call_response_171a),
19426         .response = {
19427                 .number = 1,
19428                 .type = STK_COMMAND_TYPE_SETUP_CALL,
19429                 .qualifier = 0x02, /* Put all other calls on hold */
19430                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
19431                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
19432                 .result = {
19433                         .type = STK_RESULT_TYPE_NETWORK_UNAVAILABLE,
19434                         .additional_len = 1, /* No specific cause given */
19435                         .additional = (unsigned char[1]) { 0x00 },
19436                 },
19437         },
19438 };
19439
19440 static const unsigned char set_up_call_response_171b[] = {
19441         0x81, 0x03, 0x01, 0x10, 0x02, 0x82, 0x02, 0x82,
19442         0x81, 0x83, 0x02, 0x21, 0x9d,
19443 };
19444
19445 static const struct terminal_response_test set_up_call_response_data_171b = {
19446         .pdu = set_up_call_response_171b,
19447         .pdu_len = sizeof(set_up_call_response_171b),
19448         .response = {
19449                 .number = 1,
19450                 .type = STK_COMMAND_TYPE_SETUP_CALL,
19451                 .qualifier = 0x02, /* Put all other calls on hold */
19452                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
19453                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
19454                 .result = {
19455                         .type = STK_RESULT_TYPE_NETWORK_UNAVAILABLE,
19456                         .additional_len = 1, /* Facility rejected */
19457                         .additional = (unsigned char[1]) { 0x9d },
19458                 },
19459         },
19460 };
19461
19462 static const unsigned char set_up_call_response_1101[] = {
19463         0x81, 0x03, 0x01, 0x10, 0x01, 0x82, 0x02, 0x82,
19464         0x81, 0x83, 0x01, 0x00,
19465 };
19466
19467 static const struct terminal_response_test set_up_call_response_data_1101 = {
19468         .pdu = set_up_call_response_1101,
19469         .pdu_len = sizeof(set_up_call_response_1101),
19470         .response = {
19471                 .number = 1,
19472                 .type = STK_COMMAND_TYPE_SETUP_CALL,
19473                 .qualifier = 0x01, /* Only if not busy, with redial */
19474                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
19475                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
19476                 .result = {
19477                         .type = STK_RESULT_TYPE_SUCCESS,
19478                 },
19479         },
19480 };
19481
19482 static const unsigned char set_up_call_response_1111b[] = {
19483         0x81, 0x03, 0x01, 0x10, 0x00, 0x82, 0x02, 0x82,
19484         0x81, 0x83, 0x01, 0x30,
19485 };
19486
19487 static const struct terminal_response_test set_up_call_response_data_1111b = {
19488         .pdu = set_up_call_response_1111b,
19489         .pdu_len = sizeof(set_up_call_response_1111b),
19490         .response = {
19491                 .number = 1,
19492                 .type = STK_COMMAND_TYPE_SETUP_CALL,
19493                 .qualifier = 0x00, /* Only if not busy on another call */
19494                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
19495                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
19496                 .result = {
19497                         .type = STK_RESULT_TYPE_NOT_CAPABLE,
19498                 },
19499         },
19500 };
19501
19502 static const unsigned char set_up_call_response_1121[] = {
19503         0x81, 0x03, 0x01, 0x10, 0x01, 0x82, 0x02, 0x82,
19504         0x81, 0x83, 0x02, 0x21, 0x91,
19505 };
19506
19507 static const struct terminal_response_test set_up_call_response_data_1121 = {
19508         .pdu = set_up_call_response_1121,
19509         .pdu_len = sizeof(set_up_call_response_1121),
19510         .response = {
19511                 .number = 1,
19512                 .type = STK_COMMAND_TYPE_SETUP_CALL,
19513                 .qualifier = 0x01, /* Only if not busy, with redial */
19514                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
19515                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
19516                 .result = {
19517                         .type = STK_RESULT_TYPE_NETWORK_UNAVAILABLE,
19518                         .additional_len = 1, /* User busy */
19519                         .additional = (unsigned char[1]) { 0x91 },
19520                 },
19521         },
19522 };
19523
19524 static const unsigned char set_up_call_response_311b[] = {
19525         0x81, 0x03, 0x01, 0x10, 0x00, 0x82, 0x02, 0x82,
19526         0x81, 0x83, 0x01, 0x04,
19527 };
19528
19529 static const struct terminal_response_test set_up_call_response_data_311b = {
19530         .pdu = set_up_call_response_311b,
19531         .pdu_len = sizeof(set_up_call_response_311b),
19532         .response = {
19533                 .number = 1,
19534                 .type = STK_COMMAND_TYPE_SETUP_CALL,
19535                 .qualifier = 0x00, /* Only if not busy on another call */
19536                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
19537                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
19538                 .result = {
19539                         .type = STK_RESULT_TYPE_NO_ICON,
19540                 },
19541         },
19542 };
19543
19544 static const unsigned char polling_off_response_112[] = {
19545         0x81, 0x03, 0x01, 0x04, 0x00, 0x82, 0x02, 0x82,
19546         0x81, 0x83, 0x01, 0x00,
19547 };
19548
19549 static const struct terminal_response_test polling_off_response_data_112 = {
19550         .pdu = polling_off_response_112,
19551         .pdu_len = sizeof(polling_off_response_112),
19552         .response = {
19553                 .number = 1,
19554                 .type = STK_COMMAND_TYPE_POLLING_OFF,
19555                 .qualifier = 0x00,
19556                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
19557                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
19558                 .result = {
19559                         .type = STK_RESULT_TYPE_SUCCESS,
19560                 },
19561         },
19562 };
19563
19564 static const unsigned char provide_local_info_response_111a[] = {
19565         0x81, 0x03, 0x01, 0x26, 0x00, 0x82, 0x02, 0x82,
19566         0x81, 0x83, 0x01, 0x00, 0x93, 0x07, 0x00, 0xf1,
19567         0x10, 0x00, 0x01, 0x00, 0x01,
19568 };
19569
19570 static const struct terminal_response_test
19571                 provide_local_info_response_data_111a = {
19572         .pdu = provide_local_info_response_111a,
19573         .pdu_len = sizeof(provide_local_info_response_111a),
19574         .response = {
19575                 .number = 1,
19576                 .type = STK_COMMAND_TYPE_PROVIDE_LOCAL_INFO,
19577                 .qualifier = 0x00, /* Location information (MCC MNC LAC CI) */
19578                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
19579                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
19580                 .result = {
19581                         .type = STK_RESULT_TYPE_SUCCESS,
19582                 },
19583                 { .provide_local_info = {
19584                         { .location = {
19585                                 .mcc = "001",
19586                                 .mnc = "01",
19587                                 .lac_tac = 0x0001,
19588                                 .has_ci = TRUE,
19589                                 .ci = 0x0001,
19590                         }},
19591                 }},
19592         },
19593 };
19594
19595 static const unsigned char provide_local_info_response_111b[] = {
19596         0x81, 0x03, 0x01, 0x26, 0x00, 0x82, 0x02, 0x82,
19597         0x81, 0x83, 0x01, 0x00, 0x93, 0x07, 0x00, 0x11,
19598         0x10, 0x00, 0x01, 0x00, 0x01,
19599 };
19600
19601 static const struct terminal_response_test
19602                 provide_local_info_response_data_111b = {
19603         .pdu = provide_local_info_response_111b,
19604         .pdu_len = sizeof(provide_local_info_response_111b),
19605         .response = {
19606                 .number = 1,
19607                 .type = STK_COMMAND_TYPE_PROVIDE_LOCAL_INFO,
19608                 .qualifier = 0x00, /* Location information (MCC MNC LAC CI) */
19609                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
19610                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
19611                 .result = {
19612                         .type = STK_RESULT_TYPE_SUCCESS,
19613                 },
19614                 { .provide_local_info = {
19615                         { .location = {
19616                                 .mcc = "001",
19617                                 .mnc = "011",
19618                                 .lac_tac = 0x0001,
19619                                 .has_ci = TRUE,
19620                                 .ci = 0x0001,
19621                         }},
19622                 }},
19623         },
19624 };
19625
19626 static const unsigned char provide_local_info_response_121[] = {
19627         0x81, 0x03, 0x01, 0x26, 0x01, 0x82, 0x02, 0x82,
19628         0x81, 0x83, 0x01, 0x00, 0x94, 0x08, 0x1a, 0x32,
19629         0x54, 0x76, 0x98, 0x10, 0x32, 0x54, /* Typo in TS 102 384? */
19630 };
19631
19632 static const struct terminal_response_test
19633                 provide_local_info_response_data_121 = {
19634         .pdu = provide_local_info_response_121,
19635         .pdu_len = sizeof(provide_local_info_response_121),
19636         .response = {
19637                 .number = 1,
19638                 .type = STK_COMMAND_TYPE_PROVIDE_LOCAL_INFO,
19639                 .qualifier = 0x01, /* IMEI of the Terminal */
19640                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
19641                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
19642                 .result = {
19643                         .type = STK_RESULT_TYPE_SUCCESS,
19644                 },
19645                 { .provide_local_info = {
19646                         { .imei = "123456789012345", }
19647                 }},
19648         },
19649 };
19650
19651 static const unsigned char provide_local_info_response_131[] = {
19652         0x81, 0x03, 0x01, 0x26, 0x02, 0x82, 0x02, 0x82,
19653         0x81, 0x83, 0x01, 0x00, 0x96, 0x10, 0x34, 0x34,
19654         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
19655         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9d, 0x0d,
19656         0x8c, 0x63, 0x58, 0xe2, 0x39, 0x8f, 0x63, 0xf9,
19657         0x06, 0x45, 0x91, 0xa4, 0x90,
19658 };
19659
19660 static const short bcch_channels_131[] = {
19661 };
19662
19663 static const struct terminal_response_test
19664                 provide_local_info_response_data_131 = {
19665         .pdu = provide_local_info_response_131,
19666         .pdu_len = sizeof(provide_local_info_response_131),
19667         .response = {
19668                 .number = 1,
19669                 .type = STK_COMMAND_TYPE_PROVIDE_LOCAL_INFO,
19670                 .qualifier = 0x02, /* Network Measurement Results */
19671                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
19672                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
19673                 .result = {
19674                         .type = STK_RESULT_TYPE_SUCCESS,
19675                 },
19676                 { .provide_local_info = {
19677                         { .nmr = {
19678                                 .nmr = {
19679                                         /* RXLEV-FULL-SERVING-CELL=52, no BA,
19680                                          * no DTX */
19681                                         .array = (unsigned char[16]) {
19682                                                 0x34, 0x34, 0x00, 0x00,
19683                                                 0x00, 0x00, 0x00, 0x00,
19684                                                 0x00, 0x00, 0x00, 0x00,
19685                                                 0x00, 0x00, 0x00, 0x00,
19686                                         },
19687                                         .len = 16,
19688                                 },
19689                                 .bcch_ch_list = {
19690                                         .channels = {
19691                                                 561, 565, 568, 569, 573,
19692                                                 575, 577, 581, 582, 585,
19693                                         },
19694                                         .num = 10,
19695                                         .has_list = TRUE,
19696                                 },
19697                         }},
19698                 }},
19699         },
19700 };
19701
19702 static const unsigned char provide_local_info_response_141[] = {
19703         0x81, 0x03, 0x01, 0x26, 0x03, 0x82, 0x02, 0x82,
19704         0x81, 0x83, 0x01, 0x00, 0xa6, 0x07, 0x20, 0x50,
19705         0x70, 0x41, 0x80, 0x71, 0xff,
19706 };
19707
19708 static const struct terminal_response_test
19709                 provide_local_info_response_data_141 = {
19710         .pdu = provide_local_info_response_141,
19711         .pdu_len = sizeof(provide_local_info_response_141),
19712         .response = {
19713                 .number = 1,
19714                 .type = STK_COMMAND_TYPE_PROVIDE_LOCAL_INFO,
19715                 .qualifier = 0x03, /* Date Time and Time Zone */
19716                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
19717                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
19718                 .result = {
19719                         .type = STK_RESULT_TYPE_SUCCESS,
19720                 },
19721                 { .provide_local_info = {
19722                         { .datetime = {
19723                                 .year = 2, /* 2002 - 1900 - 100 */
19724                                 .month = 5,
19725                                 .day = 7,
19726                                 .hour = 14,
19727                                 .minute = 8,
19728                                 .second = 17,
19729                                 .timezone = 0xff, /* No information */
19730                         }},
19731                 }},
19732         },
19733 };
19734
19735 static const unsigned char provide_local_info_response_151[] = {
19736         0x81, 0x03, 0x01, 0x26, 0x04, 0x82, 0x02, 0x82,
19737         0x81, 0x83, 0x01, 0x00, 0xad, 0x02, 0x65, 0x6e,
19738 };
19739
19740 static const struct terminal_response_test
19741                 provide_local_info_response_data_151 = {
19742         .pdu = provide_local_info_response_151,
19743         .pdu_len = sizeof(provide_local_info_response_151),
19744         .response = {
19745                 .number = 1,
19746                 .type = STK_COMMAND_TYPE_PROVIDE_LOCAL_INFO,
19747                 .qualifier = 0x04, /* Language setting */
19748                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
19749                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
19750                 .result = {
19751                         .type = STK_RESULT_TYPE_SUCCESS,
19752                 },
19753                 { .provide_local_info = {
19754                         { .language = "en", }
19755                 }},
19756         },
19757 };
19758
19759 static const unsigned char provide_local_info_response_161[] = {
19760         0x81, 0x03, 0x01, 0x26, 0x05, 0x82, 0x02, 0x82,
19761         0x81, 0x83, 0x01, 0x00, 0xae, 0x02, 0x00, 0x00,
19762 };
19763
19764 static const struct terminal_response_test
19765                 provide_local_info_response_data_161 = {
19766         .pdu = provide_local_info_response_161,
19767         .pdu_len = sizeof(provide_local_info_response_161),
19768         .response = {
19769                 .number = 1,
19770                 .type = STK_COMMAND_TYPE_PROVIDE_LOCAL_INFO,
19771                 .qualifier = 0x05, /* Timing Advance */
19772                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
19773                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
19774                 .result = {
19775                         .type = STK_RESULT_TYPE_SUCCESS,
19776                 },
19777                 { .provide_local_info = {
19778                         { .tadv = {
19779                                 .status = STK_ME_STATUS_IDLE,
19780                                 .advance = 0,
19781                         }},
19782                 }},
19783         },
19784 };
19785
19786 static const unsigned char provide_local_info_response_171[] = {
19787         0x81, 0x03, 0x01, 0x26, 0x06, 0x82, 0x02, 0x82,
19788         0x81, 0x83, 0x01, 0x00, 0x3f, 0x01, 0x03,
19789 };
19790
19791 static const struct terminal_response_test
19792                 provide_local_info_response_data_171 = {
19793         .pdu = provide_local_info_response_171,
19794         .pdu_len = sizeof(provide_local_info_response_171),
19795         .response = {
19796                 .number = 1,
19797                 .type = STK_COMMAND_TYPE_PROVIDE_LOCAL_INFO,
19798                 .qualifier = 0x06, /* Access technology */
19799                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
19800                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
19801                 .result = {
19802                         .type = STK_RESULT_TYPE_SUCCESS,
19803                 },
19804                 { .provide_local_info = {
19805                         { .access_technology = STK_ACCESS_TECHNOLOGY_UTRAN, }
19806                 }},
19807         },
19808 };
19809
19810 static const unsigned char provide_local_info_response_181[] = {
19811         0x81, 0x03, 0x01, 0x26, 0x07, 0x82, 0x02, 0x82,
19812         0x81, 0x83, 0x01, 0x00, 0xc6, 0x04, 0x01, 0x02,
19813         0x03, 0x04,
19814 };
19815
19816 static const struct terminal_response_test
19817                 provide_local_info_response_data_181 = {
19818         .pdu = provide_local_info_response_181,
19819         .pdu_len = sizeof(provide_local_info_response_181),
19820         .response = {
19821                 .number = 1,
19822                 .type = STK_COMMAND_TYPE_PROVIDE_LOCAL_INFO,
19823                 .qualifier = 0x07, /* ESN of the terminal */
19824                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
19825                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
19826                 .result = {
19827                         .type = STK_RESULT_TYPE_SUCCESS,
19828                 },
19829                 { .provide_local_info = {
19830                         { .esn = 0x01020304, }
19831                 }},
19832         },
19833 };
19834
19835 static const unsigned char provide_local_info_response_191[] = {
19836         0x81, 0x03, 0x01, 0x26, 0x08, 0x82, 0x02, 0x82,
19837         0x81, 0x83, 0x01, 0x00, 0xe2, 0x09, 0x13, 0x32,
19838         0x54, 0x76, 0x98, 0x10, 0x32, 0x54, 0xf6,
19839 };
19840
19841 static const struct terminal_response_test
19842                 provide_local_info_response_data_191 = {
19843         .pdu = provide_local_info_response_191,
19844         .pdu_len = sizeof(provide_local_info_response_191),
19845         .response = {
19846                 .number = 1,
19847                 .type = STK_COMMAND_TYPE_PROVIDE_LOCAL_INFO,
19848                 .qualifier = 0x08, /* IMEISV of the terminal */
19849                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
19850                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
19851                 .result = {
19852                         .type = STK_RESULT_TYPE_SUCCESS,
19853                 },
19854                 { .provide_local_info = {
19855                         { .imeisv = "1234567890123456", }
19856                 }},
19857         },
19858 };
19859
19860 static const unsigned char provide_local_info_response_1111[] = {
19861         0x81, 0x03, 0x01, 0x26, 0x0a, 0x82, 0x02, 0x82,
19862         0x81, 0x83, 0x01, 0x00, 0xe3, 0x01, 0x04,
19863 };
19864
19865 static const struct terminal_response_test
19866                 provide_local_info_response_data_1111 = {
19867         .pdu = provide_local_info_response_1111,
19868         .pdu_len = sizeof(provide_local_info_response_1111),
19869         .response = {
19870                 .number = 1,
19871                 .type = STK_COMMAND_TYPE_PROVIDE_LOCAL_INFO,
19872                 .qualifier = 0x0a, /* Charge state of the battery */
19873                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
19874                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
19875                 .result = {
19876                         .type = STK_RESULT_TYPE_SUCCESS,
19877                 },
19878                 { .provide_local_info = {
19879                         { .battery_charge = STK_BATTERY_FULL, }
19880                 }},
19881         },
19882 };
19883
19884 static const unsigned char provide_local_info_response_1121[] = {
19885         0x81, 0x03, 0x01, 0x26, 0x02, 0x82, 0x02, 0x82,
19886         0x81, 0x83, 0x01, 0x00, 0x96, 0x02, 0x80, 0x00,
19887         /* Intra-frequency UTRAN Measurement report in ASN.1 goes here */
19888         /* "The remaining bytes shall not be verified" */
19889 };
19890
19891 static const struct terminal_response_test
19892                 provide_local_info_response_data_1121 = {
19893         .pdu = provide_local_info_response_1121,
19894         .pdu_len = sizeof(provide_local_info_response_1121),
19895         .response = {
19896                 .number = 1,
19897                 .type = STK_COMMAND_TYPE_PROVIDE_LOCAL_INFO,
19898                 .qualifier = 0x02, /* Network Measurement Results */
19899                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
19900                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
19901                 .result = {
19902                         .type = STK_RESULT_TYPE_SUCCESS,
19903                 },
19904                 { .provide_local_info = {
19905                         { .nmr = {
19906                                 .nmr = {
19907                                         .array = (unsigned char[2])
19908                                                 { 0x80, 0x00 },
19909                                         .len = 2,
19910                                 },
19911                         }},
19912                 }},
19913         },
19914 };
19915
19916 static const unsigned char provide_local_info_response_1131[] = {
19917         0x81, 0x03, 0x01, 0x26, 0x02, 0x82, 0x02, 0x82,
19918         0x81, 0x83, 0x01, 0x00, 0x96, 0x02, 0x80, 0x11,
19919         /* Inter-frequency UTRAN Measurement report in ASN.1 goes here */
19920         /* "The remaining bytes shall not be verified" */
19921 };
19922
19923 static const struct terminal_response_test
19924                 provide_local_info_response_data_1131 = {
19925         .pdu = provide_local_info_response_1131,
19926         .pdu_len = sizeof(provide_local_info_response_1131),
19927         .response = {
19928                 .number = 1,
19929                 .type = STK_COMMAND_TYPE_PROVIDE_LOCAL_INFO,
19930                 .qualifier = 0x02, /* Network Measurement Results */
19931                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
19932                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
19933                 .result = {
19934                         .type = STK_RESULT_TYPE_SUCCESS,
19935                 },
19936                 { .provide_local_info = {
19937                         { .nmr = {
19938                                 .nmr = {
19939                                         .array = (unsigned char[2])
19940                                                 { 0x80, 0x11},
19941                                         .len = 2,
19942                                 },
19943                         }},
19944                 }},
19945         },
19946 };
19947
19948 static const unsigned char provide_local_info_response_1141[] = {
19949         0x81, 0x03, 0x01, 0x26, 0x06, 0x82, 0x02, 0x82,
19950         0x81, 0x83, 0x01, 0x00, 0x3f, 0x01, 0x08,
19951 };
19952
19953 static const struct terminal_response_test
19954                 provide_local_info_response_data_1141 = {
19955         .pdu = provide_local_info_response_1141,
19956         .pdu_len = sizeof(provide_local_info_response_1141),
19957         .response = {
19958                 .number = 1,
19959                 .type = STK_COMMAND_TYPE_PROVIDE_LOCAL_INFO,
19960                 .qualifier = 0x06, /* Access technology */
19961                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
19962                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
19963                 .result = {
19964                         .type = STK_RESULT_TYPE_SUCCESS,
19965                 },
19966                 { .provide_local_info = {
19967                         { .access_technology = STK_ACCESS_TECHNOLOGY_EUTRAN, }
19968                 }},
19969         },
19970 };
19971
19972 static const unsigned char provide_local_info_response_1151[] = {
19973         0x81, 0x03, 0x01, 0x26, 0x02, 0x82, 0x02, 0x82,
19974         0x81, 0x83, 0x01, 0x00, 0x96, 0x02, 0x80, 0x00,
19975         /* Intra-frequency E-UTRAN Measurement report in ASN.1 goes here */
19976         /* "The remaining bytes shall not be verified" */
19977 };
19978
19979 static const struct terminal_response_test
19980                 provide_local_info_response_data_1151 = {
19981         .pdu = provide_local_info_response_1151,
19982         .pdu_len = sizeof(provide_local_info_response_1151),
19983         .response = {
19984                 .number = 1,
19985                 .type = STK_COMMAND_TYPE_PROVIDE_LOCAL_INFO,
19986                 .qualifier = 0x02, /* Network Measurement Results */
19987                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
19988                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
19989                 .result = {
19990                         .type = STK_RESULT_TYPE_SUCCESS,
19991                 },
19992                 { .provide_local_info = {
19993                         { .nmr = {
19994                                 .nmr = {
19995                                         .array = (unsigned char[2])
19996                                                 { 0x80, 0x00},
19997                                         .len = 2,
19998                                 },
19999                         }},
20000                 }},
20001         },
20002 };
20003
20004 static const unsigned char provide_local_info_response_1161[] = {
20005         0x81, 0x03, 0x01, 0x26, 0x02, 0x82, 0x02, 0x82,
20006         0x81, 0x83, 0x01, 0x00, 0x96, 0x02, 0x80, 0x11,
20007         /* Inter-frequency E-UTRAN Measurement report in ASN.1 goes here */
20008         /* "The remaining bytes shall not be verified" */
20009 };
20010
20011 static const struct terminal_response_test
20012                 provide_local_info_response_data_1161 = {
20013         .pdu = provide_local_info_response_1161,
20014         .pdu_len = sizeof(provide_local_info_response_1161),
20015         .response = {
20016                 .number = 1,
20017                 .type = STK_COMMAND_TYPE_PROVIDE_LOCAL_INFO,
20018                 .qualifier = 0x02, /* Network Measurement Results */
20019                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
20020                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
20021                 .result = {
20022                         .type = STK_RESULT_TYPE_SUCCESS,
20023                 },
20024                 { .provide_local_info = {
20025                         { .nmr = {
20026                                 .nmr = {
20027                                         .array = (unsigned char[2])
20028                                                 { 0x80, 0x11},
20029                                         .len = 2,
20030                                 },
20031                         }},
20032                 }},
20033         },
20034 };
20035
20036 static const unsigned char provide_local_info_response_1171[] = {
20037         0x81, 0x03, 0x01, 0x26, 0x00, 0x82, 0x02, 0x82,
20038         0x81, 0x83, 0x01, 0x00, 0x93, 0x09, 0x00, 0xf1,
20039         0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1f,
20040         /* Typo in TS 102 223?  Byte 18 changed to 01 here */
20041 };
20042
20043 static const struct terminal_response_test
20044                 provide_local_info_response_data_1171 = {
20045         .pdu = provide_local_info_response_1171,
20046         .pdu_len = sizeof(provide_local_info_response_1171),
20047         .response = {
20048                 .number = 1,
20049                 .type = STK_COMMAND_TYPE_PROVIDE_LOCAL_INFO,
20050                 .qualifier = 0x00, /* Location information (MCC MNC LAC CI) */
20051                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
20052                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
20053                 .result = {
20054                         .type = STK_RESULT_TYPE_SUCCESS,
20055                 },
20056                 { .provide_local_info = {
20057                         { .location = {
20058                                 .mcc = "001",
20059                                 .mnc = "01",
20060                                 .lac_tac = 0x0001,
20061                                 .has_eutran_ci = TRUE,
20062                                 .eutran_ci = 0x0000001,
20063                         }},
20064                 }},
20065         },
20066 };
20067
20068 static const unsigned char set_up_event_list_response_111[] = {
20069         0x81, 0x03, 0x01, 0x05, 0x00, 0x82, 0x02, 0x82,
20070         0x81, 0x83, 0x01, 0x00,
20071 };
20072
20073 static const struct terminal_response_test
20074                 set_up_event_list_response_data_111 = {
20075         .pdu = set_up_event_list_response_111,
20076         .pdu_len = sizeof(set_up_event_list_response_111),
20077         .response = {
20078                 .number = 1,
20079                 .type = STK_COMMAND_TYPE_SETUP_EVENT_LIST,
20080                 .qualifier = 0x00,
20081                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
20082                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
20083                 .result = {
20084                         .type = STK_RESULT_TYPE_SUCCESS,
20085                 },
20086         },
20087 };
20088
20089 static const unsigned char timer_mgmt_response_111[] = {
20090         0x81, 0x03, 0x01, 0x27, 0x00, 0x82, 0x02, 0x82,
20091         0x81, 0x83, 0x01, 0x00, 0xa4, 0x01, 0x01,
20092 };
20093
20094 static const struct terminal_response_test timer_mgmt_response_data_111 = {
20095         .pdu = timer_mgmt_response_111,
20096         .pdu_len = sizeof(timer_mgmt_response_111),
20097         .response = {
20098                 .number = 1,
20099                 .type = STK_COMMAND_TYPE_TIMER_MANAGEMENT,
20100                 .qualifier = 0x00, /* Start the Timer */
20101                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
20102                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
20103                 .result = {
20104                         .type = STK_RESULT_TYPE_SUCCESS,
20105                 },
20106                 { .timer_mgmt = {
20107                         .id = 1,
20108                 }},
20109         },
20110 };
20111
20112 static const unsigned char timer_mgmt_response_112[] = {
20113         0x81, 0x03, 0x01, 0x27, 0x02, 0x82, 0x02, 0x82,
20114         0x81, 0x83, 0x01, 0x00, 0xa4, 0x01, 0x01, 0xa5,
20115         0x03, 0x00, 0x30, 0x95,
20116 };
20117
20118 static const struct terminal_response_test timer_mgmt_response_data_112 = {
20119         .pdu = timer_mgmt_response_112,
20120         .pdu_len = sizeof(timer_mgmt_response_112),
20121         .response = {
20122                 .number = 1,
20123                 .type = STK_COMMAND_TYPE_TIMER_MANAGEMENT,
20124                 .qualifier = 0x02, /* Get the current value of the Timer */
20125                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
20126                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
20127                 .result = {
20128                         .type = STK_RESULT_TYPE_SUCCESS,
20129                 },
20130                 { .timer_mgmt = {
20131                         .id = 1,
20132                         .value = {
20133                                 .minute = 3,
20134                                 .second = 59,
20135                                 .has_value = TRUE,
20136                         },
20137                 }},
20138         },
20139 };
20140
20141 static const unsigned char timer_mgmt_response_114[] = {
20142         0x81, 0x03, 0x01, 0x27, 0x01, 0x82, 0x02, 0x82,
20143         0x81, 0x83, 0x01, 0x00, 0xa4, 0x01, 0x01, 0xa5,
20144         0x03, 0x00, 0x00, 0x95,
20145 };
20146
20147 static const struct terminal_response_test timer_mgmt_response_data_114 = {
20148         .pdu = timer_mgmt_response_114,
20149         .pdu_len = sizeof(timer_mgmt_response_114),
20150         .response = {
20151                 .number = 1,
20152                 .type = STK_COMMAND_TYPE_TIMER_MANAGEMENT,
20153                 .qualifier = 0x01, /* Deactivate the Timer */
20154                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
20155                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
20156                 .result = {
20157                         .type = STK_RESULT_TYPE_SUCCESS,
20158                 },
20159                 { .timer_mgmt = {
20160                         .id = 1,
20161                         .value = {
20162                                 .second = 59,
20163                                 .has_value = TRUE,
20164                         },
20165                 }},
20166         },
20167 };
20168
20169 static const unsigned char timer_mgmt_response_121[] = {
20170         0x81, 0x03, 0x01, 0x27, 0x00, 0x82, 0x02, 0x82,
20171         0x81, 0x83, 0x01, 0x00, 0xa4, 0x01, 0x02,
20172 };
20173
20174 static const struct terminal_response_test timer_mgmt_response_data_121 = {
20175         .pdu = timer_mgmt_response_121,
20176         .pdu_len = sizeof(timer_mgmt_response_121),
20177         .response = {
20178                 .number = 1,
20179                 .type = STK_COMMAND_TYPE_TIMER_MANAGEMENT,
20180                 .qualifier = 0x00, /* Start the Timer */
20181                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
20182                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
20183                 .result = {
20184                         .type = STK_RESULT_TYPE_SUCCESS,
20185                 },
20186                 { .timer_mgmt = {
20187                         .id = 2,
20188                 }},
20189         },
20190 };
20191
20192 static const unsigned char timer_mgmt_response_122[] = {
20193         0x81, 0x03, 0x01, 0x27, 0x02, 0x82, 0x02, 0x82,
20194         0x81, 0x83, 0x01, 0x00, 0xa4, 0x01, 0x02, 0xa5,
20195         0x03, 0x32, 0x85, 0x85,
20196 };
20197
20198 static const struct terminal_response_test timer_mgmt_response_data_122 = {
20199         .pdu = timer_mgmt_response_122,
20200         .pdu_len = sizeof(timer_mgmt_response_122),
20201         .response = {
20202                 .number = 1,
20203                 .type = STK_COMMAND_TYPE_TIMER_MANAGEMENT,
20204                 .qualifier = 0x02, /* Get the current value of the Timer */
20205                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
20206                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
20207                 .result = {
20208                         .type = STK_RESULT_TYPE_SUCCESS,
20209                 },
20210                 { .timer_mgmt = {
20211                         .id = 2,
20212                         .value = {
20213                                 .hour = 23,
20214                                 .minute = 58,
20215                                 .second = 58,
20216                                 .has_value = TRUE,
20217                         },
20218                 }},
20219         },
20220 };
20221
20222 static const unsigned char timer_mgmt_response_124[] = {
20223         0x81, 0x03, 0x01, 0x27, 0x01, 0x82, 0x02, 0x82,
20224         0x81, 0x83, 0x01, 0x00, 0xa4, 0x01, 0x02, 0xa5,
20225         0x03, 0x00, 0x00, 0x95,
20226 };
20227
20228 static const struct terminal_response_test timer_mgmt_response_data_124 = {
20229         .pdu = timer_mgmt_response_124,
20230         .pdu_len = sizeof(timer_mgmt_response_124),
20231         .response = {
20232                 .number = 1,
20233                 .type = STK_COMMAND_TYPE_TIMER_MANAGEMENT,
20234                 .qualifier = 0x01, /* Deactivate the Timer */
20235                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
20236                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
20237                 .result = {
20238                         .type = STK_RESULT_TYPE_SUCCESS,
20239                 },
20240                 { .timer_mgmt = {
20241                         .id = 2,
20242                         .value = {
20243                                 .second = 59,
20244                                 .has_value = TRUE,
20245                         },
20246                 }},
20247         },
20248 };
20249
20250 static const unsigned char timer_mgmt_response_131[] = {
20251         0x81, 0x03, 0x01, 0x27, 0x00, 0x82, 0x02, 0x82,
20252         0x81, 0x83, 0x01, 0x00, 0xa4, 0x01, 0x08,
20253 };
20254
20255 static const struct terminal_response_test timer_mgmt_response_data_131 = {
20256         .pdu = timer_mgmt_response_131,
20257         .pdu_len = sizeof(timer_mgmt_response_131),
20258         .response = {
20259                 .number = 1,
20260                 .type = STK_COMMAND_TYPE_TIMER_MANAGEMENT,
20261                 .qualifier = 0x00, /* Start the Timer */
20262                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
20263                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
20264                 .result = {
20265                         .type = STK_RESULT_TYPE_SUCCESS,
20266                 },
20267                 { .timer_mgmt = {
20268                         .id = 8,
20269                 }},
20270         },
20271 };
20272
20273 static const unsigned char timer_mgmt_response_132[] = {
20274         0x81, 0x03, 0x01, 0x27, 0x02, 0x82, 0x02, 0x82,
20275         0x81, 0x83, 0x01, 0x00, 0xa4, 0x01, 0x08, 0xa5,
20276         0x03, 0x00, 0x81, 0x95,
20277 };
20278
20279 static const struct terminal_response_test timer_mgmt_response_data_132 = {
20280         .pdu = timer_mgmt_response_132,
20281         .pdu_len = sizeof(timer_mgmt_response_132),
20282         .response = {
20283                 .number = 1,
20284                 .type = STK_COMMAND_TYPE_TIMER_MANAGEMENT,
20285                 .qualifier = 0x02, /* Get the current value of the Timer */
20286                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
20287                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
20288                 .result = {
20289                         .type = STK_RESULT_TYPE_SUCCESS,
20290                 },
20291                 { .timer_mgmt = {
20292                         .id = 8,
20293                         .value = {
20294                                 .minute = 18,
20295                                 .second = 59,
20296                                 .has_value = TRUE,
20297                         },
20298                 }},
20299         },
20300 };
20301
20302 static const unsigned char timer_mgmt_response_134[] = {
20303         0x81, 0x03, 0x01, 0x27, 0x01, 0x82, 0x02, 0x82,
20304         0x81, 0x83, 0x01, 0x00, 0xa4, 0x01, 0x08, 0xa5,
20305         0x03, 0x00, 0x95, 0x92,
20306 };
20307
20308 static const struct terminal_response_test timer_mgmt_response_data_134 = {
20309         .pdu = timer_mgmt_response_134,
20310         .pdu_len = sizeof(timer_mgmt_response_134),
20311         .response = {
20312                 .number = 1,
20313                 .type = STK_COMMAND_TYPE_TIMER_MANAGEMENT,
20314                 .qualifier = 0x01, /* Deactivate the Timer */
20315                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
20316                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
20317                 .result = {
20318                         .type = STK_RESULT_TYPE_SUCCESS,
20319                 },
20320                 { .timer_mgmt = {
20321                         .id = 8,
20322                         .value = {
20323                                 .minute = 59,
20324                                 .second = 29,
20325                                 .has_value = TRUE,
20326                         },
20327                 }},
20328         },
20329 };
20330
20331 static const unsigned char timer_mgmt_response_141a[] = {
20332         0x81, 0x03, 0x01, 0x27, 0x02, 0x82, 0x02, 0x82,
20333         0x81, 0x83, 0x01, 0x24, 0xa4, 0x01, 0x01,
20334 };
20335
20336 static const struct terminal_response_test timer_mgmt_response_data_141a = {
20337         .pdu = timer_mgmt_response_141a,
20338         .pdu_len = sizeof(timer_mgmt_response_141a),
20339         .response = {
20340                 .number = 1,
20341                 .type = STK_COMMAND_TYPE_TIMER_MANAGEMENT,
20342                 .qualifier = 0x02, /* Get the current value of the Timer */
20343                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
20344                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
20345                 .result = {
20346                         .type = STK_RESULT_TYPE_TIMER_CONFLICT,
20347                 },
20348                 { .timer_mgmt = {
20349                         .id = 1,
20350                 }},
20351         },
20352 };
20353
20354 static const unsigned char timer_mgmt_response_141b[] = {
20355         0x81, 0x03, 0x01, 0x27, 0x02, 0x82, 0x02, 0x82,
20356         0x81, 0x83, 0x01, 0x24,
20357 };
20358
20359 static const struct terminal_response_test timer_mgmt_response_data_141b = {
20360         .pdu = timer_mgmt_response_141b,
20361         .pdu_len = sizeof(timer_mgmt_response_141b),
20362         .response = {
20363                 .number = 1,
20364                 .type = STK_COMMAND_TYPE_TIMER_MANAGEMENT,
20365                 .qualifier = 0x02, /* Get the current value of the Timer */
20366                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
20367                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
20368                 .result = {
20369                         .type = STK_RESULT_TYPE_TIMER_CONFLICT,
20370                 },
20371         },
20372 };
20373
20374 static const unsigned char timer_mgmt_response_142a[] = {
20375         0x81, 0x03, 0x01, 0x27, 0x02, 0x82, 0x02, 0x82,
20376         0x81, 0x83, 0x01, 0x24, 0xa4, 0x01, 0x02,
20377 };
20378
20379 static const struct terminal_response_test timer_mgmt_response_data_142a = {
20380         .pdu = timer_mgmt_response_142a,
20381         .pdu_len = sizeof(timer_mgmt_response_142a),
20382         .response = {
20383                 .number = 1,
20384                 .type = STK_COMMAND_TYPE_TIMER_MANAGEMENT,
20385                 .qualifier = 0x02, /* Get the current value of the Timer */
20386                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
20387                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
20388                 .result = {
20389                         .type = STK_RESULT_TYPE_TIMER_CONFLICT,
20390                 },
20391                 { .timer_mgmt = {
20392                         .id = 2,
20393                 }},
20394         },
20395 };
20396
20397 static const unsigned char timer_mgmt_response_143a[] = {
20398         0x81, 0x03, 0x01, 0x27, 0x02, 0x82, 0x02, 0x82,
20399         0x81, 0x83, 0x01, 0x24, 0xa4, 0x01, 0x03,
20400 };
20401
20402 static const struct terminal_response_test timer_mgmt_response_data_143a = {
20403         .pdu = timer_mgmt_response_143a,
20404         .pdu_len = sizeof(timer_mgmt_response_143a),
20405         .response = {
20406                 .number = 1,
20407                 .type = STK_COMMAND_TYPE_TIMER_MANAGEMENT,
20408                 .qualifier = 0x02, /* Get the current value of the Timer */
20409                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
20410                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
20411                 .result = {
20412                         .type = STK_RESULT_TYPE_TIMER_CONFLICT,
20413                 },
20414                 { .timer_mgmt = {
20415                         .id = 3,
20416                 }},
20417         },
20418 };
20419
20420 static const unsigned char timer_mgmt_response_144a[] = {
20421         0x81, 0x03, 0x01, 0x27, 0x02, 0x82, 0x02, 0x82,
20422         0x81, 0x83, 0x01, 0x24, 0xa4, 0x01, 0x04,
20423 };
20424
20425 static const struct terminal_response_test timer_mgmt_response_data_144a = {
20426         .pdu = timer_mgmt_response_144a,
20427         .pdu_len = sizeof(timer_mgmt_response_144a),
20428         .response = {
20429                 .number = 1,
20430                 .type = STK_COMMAND_TYPE_TIMER_MANAGEMENT,
20431                 .qualifier = 0x02, /* Get the current value of the Timer */
20432                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
20433                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
20434                 .result = {
20435                         .type = STK_RESULT_TYPE_TIMER_CONFLICT,
20436                 },
20437                 { .timer_mgmt = {
20438                         .id = 4,
20439                 }},
20440         },
20441 };
20442
20443 static const unsigned char timer_mgmt_response_145a[] = {
20444         0x81, 0x03, 0x01, 0x27, 0x02, 0x82, 0x02, 0x82,
20445         0x81, 0x83, 0x01, 0x24, 0xa4, 0x01, 0x05,
20446 };
20447
20448 static const struct terminal_response_test timer_mgmt_response_data_145a = {
20449         .pdu = timer_mgmt_response_145a,
20450         .pdu_len = sizeof(timer_mgmt_response_145a),
20451         .response = {
20452                 .number = 1,
20453                 .type = STK_COMMAND_TYPE_TIMER_MANAGEMENT,
20454                 .qualifier = 0x02, /* Get the current value of the Timer */
20455                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
20456                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
20457                 .result = {
20458                         .type = STK_RESULT_TYPE_TIMER_CONFLICT,
20459                 },
20460                 { .timer_mgmt = {
20461                         .id = 5,
20462                 }},
20463         },
20464 };
20465
20466 static const unsigned char timer_mgmt_response_146a[] = {
20467         0x81, 0x03, 0x01, 0x27, 0x02, 0x82, 0x02, 0x82,
20468         0x81, 0x83, 0x01, 0x24, 0xa4, 0x01, 0x06,
20469 };
20470
20471 static const struct terminal_response_test timer_mgmt_response_data_146a = {
20472         .pdu = timer_mgmt_response_146a,
20473         .pdu_len = sizeof(timer_mgmt_response_146a),
20474         .response = {
20475                 .number = 1,
20476                 .type = STK_COMMAND_TYPE_TIMER_MANAGEMENT,
20477                 .qualifier = 0x02, /* Get the current value of the Timer */
20478                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
20479                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
20480                 .result = {
20481                         .type = STK_RESULT_TYPE_TIMER_CONFLICT,
20482                 },
20483                 { .timer_mgmt = {
20484                         .id = 6,
20485                 }},
20486         },
20487 };
20488
20489 static const unsigned char timer_mgmt_response_147a[] = {
20490         0x81, 0x03, 0x01, 0x27, 0x02, 0x82, 0x02, 0x82,
20491         0x81, 0x83, 0x01, 0x24, 0xa4, 0x01, 0x07,
20492 };
20493
20494 static const struct terminal_response_test timer_mgmt_response_data_147a = {
20495         .pdu = timer_mgmt_response_147a,
20496         .pdu_len = sizeof(timer_mgmt_response_147a),
20497         .response = {
20498                 .number = 1,
20499                 .type = STK_COMMAND_TYPE_TIMER_MANAGEMENT,
20500                 .qualifier = 0x02, /* Get the current value of the Timer */
20501                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
20502                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
20503                 .result = {
20504                         .type = STK_RESULT_TYPE_TIMER_CONFLICT,
20505                 },
20506                 { .timer_mgmt = {
20507                         .id = 7,
20508                 }},
20509         },
20510 };
20511
20512 static const unsigned char timer_mgmt_response_148a[] = {
20513         0x81, 0x03, 0x01, 0x27, 0x02, 0x82, 0x02, 0x82,
20514         0x81, 0x83, 0x01, 0x24, 0xa4, 0x01, 0x08,
20515 };
20516
20517 static const struct terminal_response_test timer_mgmt_response_data_148a = {
20518         .pdu = timer_mgmt_response_148a,
20519         .pdu_len = sizeof(timer_mgmt_response_148a),
20520         .response = {
20521                 .number = 1,
20522                 .type = STK_COMMAND_TYPE_TIMER_MANAGEMENT,
20523                 .qualifier = 0x02, /* Get the current value of the Timer */
20524                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
20525                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
20526                 .result = {
20527                         .type = STK_RESULT_TYPE_TIMER_CONFLICT,
20528                 },
20529                 { .timer_mgmt = {
20530                         .id = 8,
20531                 }},
20532         },
20533 };
20534
20535 static const unsigned char timer_mgmt_response_151a[] = {
20536         0x81, 0x03, 0x01, 0x27, 0x01, 0x82, 0x02, 0x82,
20537         0x81, 0x83, 0x01, 0x24, 0xa4, 0x01, 0x01,
20538 };
20539
20540 static const struct terminal_response_test timer_mgmt_response_data_151a = {
20541         .pdu = timer_mgmt_response_151a,
20542         .pdu_len = sizeof(timer_mgmt_response_151a),
20543         .response = {
20544                 .number = 1,
20545                 .type = STK_COMMAND_TYPE_TIMER_MANAGEMENT,
20546                 .qualifier = 0x01, /* Deactivate the Timer */
20547                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
20548                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
20549                 .result = {
20550                         .type = STK_RESULT_TYPE_TIMER_CONFLICT,
20551                 },
20552                 { .timer_mgmt = {
20553                         .id = 1,
20554                 }},
20555         },
20556 };
20557
20558 static const unsigned char timer_mgmt_response_151b[] = {
20559         0x81, 0x03, 0x01, 0x27, 0x01, 0x82, 0x02, 0x82,
20560         0x81, 0x83, 0x01, 0x24,
20561 };
20562
20563 static const struct terminal_response_test timer_mgmt_response_data_151b = {
20564         .pdu = timer_mgmt_response_151b,
20565         .pdu_len = sizeof(timer_mgmt_response_151b),
20566         .response = {
20567                 .number = 1,
20568                 .type = STK_COMMAND_TYPE_TIMER_MANAGEMENT,
20569                 .qualifier = 0x01, /* Deactivate the Timer */
20570                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
20571                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
20572                 .result = {
20573                         .type = STK_RESULT_TYPE_TIMER_CONFLICT,
20574                 },
20575         },
20576 };
20577
20578 static const unsigned char timer_mgmt_response_152a[] = {
20579         0x81, 0x03, 0x01, 0x27, 0x01, 0x82, 0x02, 0x82,
20580         0x81, 0x83, 0x01, 0x24, 0xa4, 0x01, 0x02,
20581 };
20582
20583 static const struct terminal_response_test timer_mgmt_response_data_152a = {
20584         .pdu = timer_mgmt_response_152a,
20585         .pdu_len = sizeof(timer_mgmt_response_152a),
20586         .response = {
20587                 .number = 1,
20588                 .type = STK_COMMAND_TYPE_TIMER_MANAGEMENT,
20589                 .qualifier = 0x01, /* Deactivate the Timer */
20590                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
20591                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
20592                 .result = {
20593                         .type = STK_RESULT_TYPE_TIMER_CONFLICT,
20594                 },
20595                 { .timer_mgmt = {
20596                         .id = 2,
20597                 }},
20598         },
20599 };
20600
20601 static const unsigned char timer_mgmt_response_153a[] = {
20602         0x81, 0x03, 0x01, 0x27, 0x01, 0x82, 0x02, 0x82,
20603         0x81, 0x83, 0x01, 0x24, 0xa4, 0x01, 0x03,
20604 };
20605
20606 static const struct terminal_response_test timer_mgmt_response_data_153a = {
20607         .pdu = timer_mgmt_response_153a,
20608         .pdu_len = sizeof(timer_mgmt_response_153a),
20609         .response = {
20610                 .number = 1,
20611                 .type = STK_COMMAND_TYPE_TIMER_MANAGEMENT,
20612                 .qualifier = 0x01, /* Deactivate the Timer */
20613                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
20614                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
20615                 .result = {
20616                         .type = STK_RESULT_TYPE_TIMER_CONFLICT,
20617                 },
20618                 { .timer_mgmt = {
20619                         .id = 3,
20620                 }},
20621         },
20622 };
20623
20624 static const unsigned char timer_mgmt_response_154a[] = {
20625         0x81, 0x03, 0x01, 0x27, 0x01, 0x82, 0x02, 0x82,
20626         0x81, 0x83, 0x01, 0x24, 0xa4, 0x01, 0x04,
20627 };
20628
20629 static const struct terminal_response_test timer_mgmt_response_data_154a = {
20630         .pdu = timer_mgmt_response_154a,
20631         .pdu_len = sizeof(timer_mgmt_response_154a),
20632         .response = {
20633                 .number = 1,
20634                 .type = STK_COMMAND_TYPE_TIMER_MANAGEMENT,
20635                 .qualifier = 0x01, /* Deactivate the Timer */
20636                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
20637                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
20638                 .result = {
20639                         .type = STK_RESULT_TYPE_TIMER_CONFLICT,
20640                 },
20641                 { .timer_mgmt = {
20642                         .id = 4,
20643                 }},
20644         },
20645 };
20646
20647 static const unsigned char timer_mgmt_response_155a[] = {
20648         0x81, 0x03, 0x01, 0x27, 0x01, 0x82, 0x02, 0x82,
20649         0x81, 0x83, 0x01, 0x24, 0xa4, 0x01, 0x05,
20650 };
20651
20652 static const struct terminal_response_test timer_mgmt_response_data_155a = {
20653         .pdu = timer_mgmt_response_155a,
20654         .pdu_len = sizeof(timer_mgmt_response_155a),
20655         .response = {
20656                 .number = 1,
20657                 .type = STK_COMMAND_TYPE_TIMER_MANAGEMENT,
20658                 .qualifier = 0x01, /* Deactivate the Timer */
20659                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
20660                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
20661                 .result = {
20662                         .type = STK_RESULT_TYPE_TIMER_CONFLICT,
20663                 },
20664                 { .timer_mgmt = {
20665                         .id = 5,
20666                 }},
20667         },
20668 };
20669
20670 static const unsigned char timer_mgmt_response_156a[] = {
20671         0x81, 0x03, 0x01, 0x27, 0x01, 0x82, 0x02, 0x82,
20672         0x81, 0x83, 0x01, 0x24, 0xa4, 0x01, 0x06,
20673 };
20674
20675 static const struct terminal_response_test timer_mgmt_response_data_156a = {
20676         .pdu = timer_mgmt_response_156a,
20677         .pdu_len = sizeof(timer_mgmt_response_156a),
20678         .response = {
20679                 .number = 1,
20680                 .type = STK_COMMAND_TYPE_TIMER_MANAGEMENT,
20681                 .qualifier = 0x01, /* Deactivate the Timer */
20682                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
20683                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
20684                 .result = {
20685                         .type = STK_RESULT_TYPE_TIMER_CONFLICT,
20686                 },
20687                 { .timer_mgmt = {
20688                         .id = 6,
20689                 }},
20690         },
20691 };
20692
20693 static const unsigned char timer_mgmt_response_157a[] = {
20694         0x81, 0x03, 0x01, 0x27, 0x01, 0x82, 0x02, 0x82,
20695         0x81, 0x83, 0x01, 0x24, 0xa4, 0x01, 0x07,
20696 };
20697
20698 static const struct terminal_response_test timer_mgmt_response_data_157a = {
20699         .pdu = timer_mgmt_response_157a,
20700         .pdu_len = sizeof(timer_mgmt_response_157a),
20701         .response = {
20702                 .number = 1,
20703                 .type = STK_COMMAND_TYPE_TIMER_MANAGEMENT,
20704                 .qualifier = 0x01, /* Deactivate the Timer */
20705                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
20706                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
20707                 .result = {
20708                         .type = STK_RESULT_TYPE_TIMER_CONFLICT,
20709                 },
20710                 { .timer_mgmt = {
20711                         .id = 7,
20712                 }},
20713         },
20714 };
20715
20716 static const unsigned char timer_mgmt_response_158a[] = {
20717         0x81, 0x03, 0x01, 0x27, 0x01, 0x82, 0x02, 0x82,
20718         0x81, 0x83, 0x01, 0x24, 0xa4, 0x01, 0x08,
20719 };
20720
20721 static const struct terminal_response_test timer_mgmt_response_data_158a = {
20722         .pdu = timer_mgmt_response_158a,
20723         .pdu_len = sizeof(timer_mgmt_response_158a),
20724         .response = {
20725                 .number = 1,
20726                 .type = STK_COMMAND_TYPE_TIMER_MANAGEMENT,
20727                 .qualifier = 0x01, /* Deactivate the Timer */
20728                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
20729                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
20730                 .result = {
20731                         .type = STK_RESULT_TYPE_TIMER_CONFLICT,
20732                 },
20733                 { .timer_mgmt = {
20734                         .id = 8,
20735                 }},
20736         },
20737 };
20738
20739 static const unsigned char timer_mgmt_response_163[] = {
20740         0x81, 0x03, 0x01, 0x27, 0x00, 0x82, 0x02, 0x82,
20741         0x81, 0x83, 0x01, 0x00, 0xa4, 0x01, 0x03,
20742 };
20743
20744 static const struct terminal_response_test timer_mgmt_response_data_163 = {
20745         .pdu = timer_mgmt_response_163,
20746         .pdu_len = sizeof(timer_mgmt_response_163),
20747         .response = {
20748                 .number = 1,
20749                 .type = STK_COMMAND_TYPE_TIMER_MANAGEMENT,
20750                 .qualifier = 0x00, /* Start the Timer */
20751                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
20752                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
20753                 .result = {
20754                         .type = STK_RESULT_TYPE_SUCCESS,
20755                 },
20756                 { .timer_mgmt = {
20757                         .id = 3,
20758                 }},
20759         },
20760 };
20761
20762 static const unsigned char timer_mgmt_response_164[] = {
20763         0x81, 0x03, 0x01, 0x27, 0x00, 0x82, 0x02, 0x82,
20764         0x81, 0x83, 0x01, 0x00, 0xa4, 0x01, 0x04,
20765 };
20766
20767 static const struct terminal_response_test timer_mgmt_response_data_164 = {
20768         .pdu = timer_mgmt_response_164,
20769         .pdu_len = sizeof(timer_mgmt_response_164),
20770         .response = {
20771                 .number = 1,
20772                 .type = STK_COMMAND_TYPE_TIMER_MANAGEMENT,
20773                 .qualifier = 0x00, /* Start the Timer */
20774                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
20775                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
20776                 .result = {
20777                         .type = STK_RESULT_TYPE_SUCCESS,
20778                 },
20779                 { .timer_mgmt = {
20780                         .id = 4,
20781                 }},
20782         },
20783 };
20784
20785 static const unsigned char timer_mgmt_response_165[] = {
20786         0x81, 0x03, 0x01, 0x27, 0x00, 0x82, 0x02, 0x82,
20787         0x81, 0x83, 0x01, 0x00, 0xa4, 0x01, 0x05,
20788 };
20789
20790 static const struct terminal_response_test timer_mgmt_response_data_165 = {
20791         .pdu = timer_mgmt_response_165,
20792         .pdu_len = sizeof(timer_mgmt_response_165),
20793         .response = {
20794                 .number = 1,
20795                 .type = STK_COMMAND_TYPE_TIMER_MANAGEMENT,
20796                 .qualifier = 0x00, /* Start the Timer */
20797                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
20798                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
20799                 .result = {
20800                         .type = STK_RESULT_TYPE_SUCCESS,
20801                 },
20802                 { .timer_mgmt = {
20803                         .id = 5,
20804                 }},
20805         },
20806 };
20807
20808 static const unsigned char timer_mgmt_response_166[] = {
20809         0x81, 0x03, 0x01, 0x27, 0x00, 0x82, 0x02, 0x82,
20810         0x81, 0x83, 0x01, 0x00, 0xa4, 0x01, 0x06,
20811 };
20812
20813 static const struct terminal_response_test timer_mgmt_response_data_166 = {
20814         .pdu = timer_mgmt_response_166,
20815         .pdu_len = sizeof(timer_mgmt_response_166),
20816         .response = {
20817                 .number = 1,
20818                 .type = STK_COMMAND_TYPE_TIMER_MANAGEMENT,
20819                 .qualifier = 0x00, /* Start the Timer */
20820                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
20821                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
20822                 .result = {
20823                         .type = STK_RESULT_TYPE_SUCCESS,
20824                 },
20825                 { .timer_mgmt = {
20826                         .id = 6,
20827                 }},
20828         },
20829 };
20830
20831 static const unsigned char timer_mgmt_response_167[] = {
20832         0x81, 0x03, 0x01, 0x27, 0x00, 0x82, 0x02, 0x82,
20833         0x81, 0x83, 0x01, 0x00, 0xa4, 0x01, 0x07,
20834 };
20835
20836 static const struct terminal_response_test timer_mgmt_response_data_167 = {
20837         .pdu = timer_mgmt_response_167,
20838         .pdu_len = sizeof(timer_mgmt_response_167),
20839         .response = {
20840                 .number = 1,
20841                 .type = STK_COMMAND_TYPE_TIMER_MANAGEMENT,
20842                 .qualifier = 0x00, /* Start the Timer */
20843                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
20844                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
20845                 .result = {
20846                         .type = STK_RESULT_TYPE_SUCCESS,
20847                 },
20848                 { .timer_mgmt = {
20849                         .id = 7,
20850                 }},
20851         },
20852 };
20853
20854 static const unsigned char set_up_idle_mode_text_response_111[] = {
20855         0x81, 0x03, 0x01, 0x28, 0x00, 0x82, 0x02, 0x82,
20856         0x81, 0x83, 0x01, 0x00,
20857 };
20858
20859 static const struct terminal_response_test
20860                 set_up_idle_mode_text_response_data_111 = {
20861         .pdu = set_up_idle_mode_text_response_111,
20862         .pdu_len = sizeof(set_up_idle_mode_text_response_111),
20863         .response = {
20864                 .number = 1,
20865                 .type = STK_COMMAND_TYPE_SETUP_IDLE_MODE_TEXT,
20866                 .qualifier = 0x00,
20867                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
20868                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
20869                 .result = {
20870                         .type = STK_RESULT_TYPE_SUCCESS,
20871                 },
20872         },
20873 };
20874
20875 static const unsigned char set_up_idle_mode_text_response_211b[] = {
20876         0x81, 0x03, 0x01, 0x28, 0x00, 0x82, 0x02, 0x82,
20877         0x81, 0x83, 0x01, 0x04,
20878 };
20879
20880 static const struct terminal_response_test
20881                 set_up_idle_mode_text_response_data_211b = {
20882         .pdu = set_up_idle_mode_text_response_211b,
20883         .pdu_len = sizeof(set_up_idle_mode_text_response_211b),
20884         .response = {
20885                 .number = 1,
20886                 .type = STK_COMMAND_TYPE_SETUP_IDLE_MODE_TEXT,
20887                 .qualifier = 0x00,
20888                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
20889                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
20890                 .result = {
20891                         .type = STK_RESULT_TYPE_NO_ICON,
20892                 },
20893         },
20894 };
20895
20896 static const unsigned char set_up_idle_mode_text_response_241[] = {
20897         0x81, 0x03, 0x01, 0x28, 0x00, 0x82, 0x02, 0x82,
20898         0x81, 0x83, 0x01, 0x32,
20899 };
20900
20901 static const struct terminal_response_test
20902                 set_up_idle_mode_text_response_data_241 = {
20903         .pdu = set_up_idle_mode_text_response_241,
20904         .pdu_len = sizeof(set_up_idle_mode_text_response_241),
20905         .response = {
20906                 .number = 1,
20907                 .type = STK_COMMAND_TYPE_SETUP_IDLE_MODE_TEXT,
20908                 .qualifier = 0x00,
20909                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
20910                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
20911                 .result = {
20912                         .type = STK_RESULT_TYPE_DATA_NOT_UNDERSTOOD,
20913                 },
20914         },
20915 };
20916
20917 static const unsigned char run_at_command_response_111[] = {
20918         0x81, 0x03, 0x01, 0x34, 0x00, 0x82, 0x02, 0x82,
20919         0x81, 0x83, 0x01, 0x00, 0xA9, 0x05, 0x2b, 0x43,
20920         0x47, 0x4d, 0x49,
20921 };
20922
20923 static const struct terminal_response_test run_at_command_response_data_111 = {
20924         .pdu = run_at_command_response_111,
20925         .pdu_len = sizeof(run_at_command_response_111),
20926         .response = {
20927                 .number = 1,
20928                 .type = STK_COMMAND_TYPE_RUN_AT_COMMAND,
20929                 .qualifier = 0x00,
20930                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
20931                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
20932                 .result = {
20933                         .type = STK_RESULT_TYPE_SUCCESS,
20934                 },
20935                 { .run_at_command = {
20936                         .at_response = "+CGMI",
20937                 }},
20938         },
20939 };
20940
20941 static const unsigned char run_at_command_response_211b[] = {
20942         0x81, 0x03, 0x01, 0x34, 0x00, 0x82, 0x02, 0x82,
20943         0x81, 0x83, 0x01, 0x04, 0xA9, 0x05, 0x2b, 0x43,
20944         0x47, 0x4d, 0x49,
20945 };
20946
20947 static const struct terminal_response_test run_at_command_response_data_211b = {
20948         .pdu = run_at_command_response_211b,
20949         .pdu_len = sizeof(run_at_command_response_211b),
20950         .response = {
20951                 .number = 1,
20952                 .type = STK_COMMAND_TYPE_RUN_AT_COMMAND,
20953                 .qualifier = 0x00,
20954                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
20955                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
20956                 .result = {
20957                         .type = STK_RESULT_TYPE_NO_ICON,
20958                 },
20959                 { .run_at_command = {
20960                         .at_response = "+CGMI",
20961                 }},
20962         },
20963 };
20964
20965 static const unsigned char run_at_command_response_251[] = {
20966         0x81, 0x03, 0x01, 0x34, 0x00, 0x82, 0x02, 0x82,
20967         0x81, 0x83, 0x01, 0x32,
20968 };
20969
20970 static const struct terminal_response_test run_at_command_response_data_251 = {
20971         .pdu = run_at_command_response_251,
20972         .pdu_len = sizeof(run_at_command_response_251),
20973         .response = {
20974                 .number = 1,
20975                 .type = STK_COMMAND_TYPE_RUN_AT_COMMAND,
20976                 .qualifier = 0x00,
20977                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
20978                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
20979                 .result = {
20980                         .type = STK_RESULT_TYPE_DATA_NOT_UNDERSTOOD,
20981                 },
20982         },
20983 };
20984
20985 static const unsigned char send_dtmf_response_111[] = {
20986         0x81, 0x03, 0x01, 0x14, 0x00, 0x82, 0x02, 0x82,
20987         0x81, 0x83, 0x01, 0x00,
20988 };
20989
20990 static const struct terminal_response_test send_dtmf_response_data_111 = {
20991         .pdu = send_dtmf_response_111,
20992         .pdu_len = sizeof(send_dtmf_response_111),
20993         .response = {
20994                 .number = 1,
20995                 .type = STK_COMMAND_TYPE_SEND_DTMF,
20996                 .qualifier = 0x00,
20997                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
20998                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
20999                 .result = {
21000                         .type = STK_RESULT_TYPE_SUCCESS,
21001                 },
21002         },
21003 };
21004
21005 static const unsigned char send_dtmf_response_141[] = {
21006         0x81, 0x03, 0x01, 0x14, 0x00, 0x82, 0x02, 0x82,
21007         0x81, 0x83, 0x02, 0x20, 0x07,
21008 };
21009
21010 static const struct terminal_response_test send_dtmf_response_data_141 = {
21011         .pdu = send_dtmf_response_141,
21012         .pdu_len = sizeof(send_dtmf_response_141),
21013         .response = {
21014                 .number = 1,
21015                 .type = STK_COMMAND_TYPE_SEND_DTMF,
21016                 .qualifier = 0x00,
21017                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
21018                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
21019                 .result = {
21020                         .type = STK_RESULT_TYPE_TERMINAL_BUSY,
21021                         .additional_len = 1, /* Not in speech call */
21022                         .additional = (unsigned char[1]) { 0x07 },
21023                 },
21024         },
21025 };
21026
21027 static const unsigned char send_dtmf_response_211b[] = {
21028         0x81, 0x03, 0x01, 0x14, 0x00, 0x82, 0x02, 0x82,
21029         0x81, 0x83, 0x01, 0x04,
21030 };
21031
21032 static const struct terminal_response_test send_dtmf_response_data_211b = {
21033         .pdu = send_dtmf_response_211b,
21034         .pdu_len = sizeof(send_dtmf_response_211b),
21035         .response = {
21036                 .number = 1,
21037                 .type = STK_COMMAND_TYPE_SEND_DTMF,
21038                 .qualifier = 0x00,
21039                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
21040                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
21041                 .result = {
21042                         .type = STK_RESULT_TYPE_NO_ICON,
21043                 },
21044         },
21045 };
21046
21047 static const unsigned char language_notification_response_111[] = {
21048         0x81, 0x03, 0x01, 0x35, 0x01, 0x82, 0x02, 0x82,
21049         0x81, 0x83, 0x01, 0x00,
21050 };
21051
21052 static const struct terminal_response_test
21053                 language_notification_response_data_111 = {
21054         .pdu = language_notification_response_111,
21055         .pdu_len = sizeof(language_notification_response_111),
21056         .response = {
21057                 .number = 1,
21058                 .type = STK_COMMAND_TYPE_LANGUAGE_NOTIFICATION,
21059                 .qualifier = 0x01,
21060                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
21061                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
21062                 .result = {
21063                         .type = STK_RESULT_TYPE_SUCCESS,
21064                 },
21065         },
21066 };
21067
21068 static const unsigned char language_notification_response_121[] = {
21069         0x81, 0x03, 0x01, 0x35, 0x00, 0x82, 0x02, 0x82,
21070         0x81, 0x83, 0x01, 0x00,
21071 };
21072
21073 static const struct terminal_response_test
21074                 language_notification_response_data_121 = {
21075         .pdu = language_notification_response_121,
21076         .pdu_len = sizeof(language_notification_response_121),
21077         .response = {
21078                 .number = 1,
21079                 .type = STK_COMMAND_TYPE_LANGUAGE_NOTIFICATION,
21080                 .qualifier = 0x00,
21081                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
21082                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
21083                 .result = {
21084                         .type = STK_RESULT_TYPE_SUCCESS,
21085                 },
21086         },
21087 };
21088
21089 static const unsigned char launch_browser_response_111[] = {
21090         0x81, 0x03, 0x01, 0x15, 0x00, 0x82, 0x02, 0x82,
21091         0x81, 0x83, 0x01, 0x00,
21092 };
21093
21094 static const struct terminal_response_test launch_browser_response_data_111 = {
21095         .pdu = launch_browser_response_111,
21096         .pdu_len = sizeof(launch_browser_response_111),
21097         .response = {
21098                 .number = 1,
21099                 .type = STK_COMMAND_TYPE_LAUNCH_BROWSER,
21100                 .qualifier = 0x00, /* Launch browser, if not running */
21101                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
21102                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
21103                 .result = {
21104                         .type = STK_RESULT_TYPE_SUCCESS,
21105                 },
21106         },
21107 };
21108
21109 static const unsigned char launch_browser_response_211[] = {
21110         0x81, 0x03, 0x01, 0x15, 0x02, 0x82, 0x02, 0x82,
21111         0x81, 0x83, 0x01, 0x00,
21112 };
21113
21114 static const struct terminal_response_test launch_browser_response_data_211 = {
21115         .pdu = launch_browser_response_211,
21116         .pdu_len = sizeof(launch_browser_response_211),
21117         .response = {
21118                 .number = 1,
21119                 .type = STK_COMMAND_TYPE_LAUNCH_BROWSER,
21120                 .qualifier = 0x02, /* Use the existing browser */
21121                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
21122                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
21123                 .result = {
21124                         .type = STK_RESULT_TYPE_SUCCESS,
21125                 },
21126         },
21127 };
21128
21129 static const unsigned char launch_browser_response_221[] = {
21130         0x81, 0x03, 0x01, 0x15, 0x03, 0x82, 0x02, 0x82,
21131         0x81, 0x83, 0x01, 0x00,
21132 };
21133
21134 static const struct terminal_response_test launch_browser_response_data_221 = {
21135         .pdu = launch_browser_response_221,
21136         .pdu_len = sizeof(launch_browser_response_221),
21137         .response = {
21138                 .number = 1,
21139                 .type = STK_COMMAND_TYPE_LAUNCH_BROWSER,
21140                 .qualifier = 0x03, /* Re-start browser session */
21141                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
21142                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
21143                 .result = {
21144                         .type = STK_RESULT_TYPE_SUCCESS,
21145                 },
21146         },
21147 };
21148
21149 static const unsigned char launch_browser_response_231[] = {
21150         0x81, 0x03, 0x01, 0x15, 0x00, 0x82, 0x02, 0x82,
21151         0x81, 0x83, 0x02, 0x26, 0x02,
21152 };
21153
21154 static const struct terminal_response_test launch_browser_response_data_231 = {
21155         .pdu = launch_browser_response_231,
21156         .pdu_len = sizeof(launch_browser_response_231),
21157         .response = {
21158                 .number = 1,
21159                 .type = STK_COMMAND_TYPE_LAUNCH_BROWSER,
21160                 .qualifier = 0x00, /* Launch browser, if not running */
21161                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
21162                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
21163                 .result = {
21164                         .type = STK_RESULT_TYPE_BROWSER_TEMPORARY,
21165                         .additional_len = 1, /* Browser unavailable */
21166                         .additional = (unsigned char[1]) { 0x02 },
21167                 },
21168         },
21169 };
21170
21171 static const unsigned char launch_browser_response_411b[] = {
21172         0x81, 0x03, 0x01, 0x15, 0x02, 0x82, 0x02, 0x82,
21173         0x81, 0x83, 0x01, 0x04,
21174 };
21175
21176 static const struct terminal_response_test launch_browser_response_data_411b = {
21177         .pdu = launch_browser_response_411b,
21178         .pdu_len = sizeof(launch_browser_response_411b),
21179         .response = {
21180                 .number = 1,
21181                 .type = STK_COMMAND_TYPE_LAUNCH_BROWSER,
21182                 .qualifier = 0x02, /* Use the existing browser */
21183                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
21184                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
21185                 .result = {
21186                         .type = STK_RESULT_TYPE_NO_ICON,
21187                 },
21188         },
21189 };
21190
21191 static const unsigned char open_channel_response_211[] = {
21192                 0x81, 0x03, 0x01, 0x40, 0x01, 0x82, 0x02, 0x82, 0x81, 0x83,
21193                 0x01, 0x00, 0x38, 0x02, 0x81, 0x00, 0x35, 0x07, 0x02, 0x03,
21194                 0x04, 0x03, 0x04, 0x1F, 0x02, 0x39, 0x02, 0x05, 0x78,
21195 };
21196
21197 static const struct terminal_response_test open_channel_response_data_211 = {
21198         .pdu = open_channel_response_211,
21199         .pdu_len = sizeof(open_channel_response_211),
21200         .response = {
21201                 .number = 1,
21202                 .type = STK_COMMAND_TYPE_OPEN_CHANNEL,
21203                 .qualifier = STK_OPEN_CHANNEL_FLAG_IMMEDIATE,
21204                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
21205                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
21206                 .result = {
21207                         .type = STK_RESULT_TYPE_SUCCESS,
21208                 },
21209                 { .open_channel = {
21210                         .channel = {
21211                         .id = 1,
21212                         .status = STK_CHANNEL_PACKET_DATA_SERVICE_ACTIVATED,
21213                         },
21214                         .bearer_desc = {
21215                                         .type = STK_BEARER_TYPE_GPRS_UTRAN,
21216                                         .gprs = {
21217                                                 .precedence = 3,
21218                                                 .delay = 4,
21219                                                 .reliability = 3,
21220                                                 .peak = 4,
21221                                                 .mean = 31,
21222                                                 .pdp_type = 2,
21223                                         },
21224                         },
21225                         .buf_size = 1400,
21226                 } },
21227         },
21228 };
21229
21230 static const unsigned char open_channel_response_271[] = {
21231                 0x81, 0x03, 0x01, 0x40, 0x01, 0x82, 0x02, 0x82, 0x81, 0x83,
21232                 0x01, 0x22, 0x35, 0x07, 0x02, 0x03, 0x04, 0x03, 0x04, 0x1F,
21233                 0x02, 0x39, 0x02, 0x05, 0x78,
21234 };
21235
21236 static const struct terminal_response_test open_channel_response_data_271 = {
21237         .pdu = open_channel_response_271,
21238         .pdu_len = sizeof(open_channel_response_271),
21239         .response = {
21240                 .number = 1,
21241                 .type = STK_COMMAND_TYPE_OPEN_CHANNEL,
21242                 .qualifier = STK_OPEN_CHANNEL_FLAG_IMMEDIATE,
21243                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
21244                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
21245                 .result = {
21246                         .type = STK_RESULT_TYPE_USER_REJECT,
21247                 },
21248                 { .open_channel = {
21249                         .bearer_desc = {
21250                                         .type = STK_BEARER_TYPE_GPRS_UTRAN,
21251                                         .gprs = {
21252                                                 .precedence = 3,
21253                                                 .delay = 4,
21254                                                 .reliability = 3,
21255                                                 .peak = 4,
21256                                                 .mean = 31,
21257                                                 .pdp_type = 2,
21258                                         },
21259                         },
21260                         .buf_size = 1400,
21261                 } },
21262         },
21263 };
21264
21265 static const unsigned char close_channel_response_121[] = {
21266                 0x81, 0x03, 0x01, 0x41, 0x00, 0x82, 0x02, 0x82, 0x81, 0x83,
21267                 0x02, 0x3A, 0x03,
21268 };
21269
21270 static const struct terminal_response_test close_channel_response_data_121 = {
21271         .pdu = close_channel_response_121,
21272         .pdu_len = sizeof(close_channel_response_121),
21273         .response = {
21274                 .number = 1,
21275                 .type = STK_COMMAND_TYPE_CLOSE_CHANNEL,
21276                 .qualifier = 0x00,
21277                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
21278                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
21279                 .result = {
21280                         .type = STK_RESULT_TYPE_BIP_ERROR,
21281                         .additional_len = 1, /* Channel identifier not valid */
21282                         .additional = (unsigned char[1]) { 0x03 },
21283                 },
21284         },
21285 };
21286
21287 static const unsigned char close_channel_response_131[] = {
21288                 0x81, 0x03, 0x01, 0x41, 0x00, 0x82, 0x02, 0x82, 0x81, 0x83,
21289                 0x02, 0x3A, 0x02,
21290 };
21291
21292 static const struct terminal_response_test close_channel_response_data_131 = {
21293         .pdu = close_channel_response_131,
21294         .pdu_len = sizeof(close_channel_response_131),
21295         .response = {
21296                 .number = 1,
21297                 .type = STK_COMMAND_TYPE_CLOSE_CHANNEL,
21298                 .qualifier = 0x00,
21299                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
21300                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
21301                 .result = {
21302                         .type = STK_RESULT_TYPE_BIP_ERROR,
21303                         .additional_len = 1, /* Channel already closed */
21304                         .additional = (unsigned char[1]) { 0x02 },
21305                 },
21306         },
21307 };
21308
21309 static const unsigned char receive_data_response_111[] = {
21310                 0x81, 0x03, 0x01, 0x42, 0x00, 0x82, 0x02, 0x82, 0x81, 0x83,
21311                 0x01, 0x00, 0xB6, 0x81, 0xC8, 0xc8, 0xc9, 0xca, 0xcb, 0xcc,
21312                 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6,
21313                 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xe0,
21314                 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea,
21315                 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4,
21316                 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe,
21317                 0xff, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
21318                 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12,
21319                 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c,
21320                 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26,
21321                 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30,
21322                 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a,
21323                 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44,
21324                 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e,
21325                 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
21326                 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62,
21327                 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c,
21328                 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76,
21329                 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80,
21330                 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a,
21331                 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0xB7, 0x01, 0xFF,
21332 };
21333
21334 static const struct terminal_response_test receive_data_response_data_111 = {
21335         .pdu = receive_data_response_111,
21336         .pdu_len = sizeof(receive_data_response_111),
21337         .response = {
21338                 .number = 1,
21339                 .type = STK_COMMAND_TYPE_RECEIVE_DATA,
21340                 .qualifier = 0x00,
21341                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
21342                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
21343                 .result = {
21344                         .type = STK_RESULT_TYPE_SUCCESS,
21345                 },
21346                 { .receive_data = {
21347                                 .rx_data = {
21348                                         .array = (unsigned char[200]) {
21349                                         0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd,
21350                                         0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3,
21351                                         0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9,
21352                                         0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
21353                                         0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5,
21354                                         0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb,
21355                                         0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1,
21356                                         0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
21357                                         0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd,
21358                                         0xfe, 0xff, 0x00, 0x01, 0x02, 0x03,
21359                                         0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
21360                                         0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
21361                                         0x10, 0x11, 0x12, 0x13, 0x14, 0x15,
21362                                         0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b,
21363                                         0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21,
21364                                         0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
21365                                         0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d,
21366                                         0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33,
21367                                         0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
21368                                         0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
21369                                         0x40, 0x41, 0x42, 0x43, 0x44, 0x45,
21370                                         0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b,
21371                                         0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51,
21372                                         0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
21373                                         0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d,
21374                                         0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63,
21375                                         0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
21376                                         0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
21377                                         0x70, 0x71, 0x72, 0x73, 0x74, 0x75,
21378                                         0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b,
21379                                         0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81,
21380                                         0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
21381                                         0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d,
21382                                         0x8e, 0x8f,
21383                                         },
21384                                         .len = 200,
21385                                 },
21386                                 .rx_remaining = 0xFF,
21387                 } },
21388         },
21389 };
21390
21391 static const unsigned char send_data_response_111[] = {
21392                 0x81, 0x03, 0x01, 0x43, 0x01, 0x82, 0x02, 0x82, 0x81, 0x83,
21393                 0x01, 0x00, 0xB7, 0x01, 0xFF,
21394 };
21395
21396 static const struct terminal_response_test send_data_response_data_111 = {
21397         .pdu = send_data_response_111,
21398         .pdu_len = sizeof(send_data_response_111),
21399         .response = {
21400                 .number = 1,
21401                 .type = STK_COMMAND_TYPE_SEND_DATA,
21402                 .qualifier = STK_SEND_DATA_IMMEDIATELY,
21403                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
21404                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
21405                 .result = {
21406                         .type = STK_RESULT_TYPE_SUCCESS,
21407                 },
21408                 { .send_data = {
21409                                 /* More than 255 bytes of space available */
21410                                 .tx_avail = 0xFF,
21411                 } },
21412         },
21413 };
21414
21415 static const unsigned char send_data_response_121[] = {
21416                 0x81, 0x03, 0x01, 0x43, 0x00, 0x82, 0x02, 0x82, 0x81, 0x83,
21417                 0x01, 0x00, 0xB7, 0x01, 0xFF,
21418 };
21419
21420 static const struct terminal_response_test send_data_response_data_121 = {
21421         .pdu = send_data_response_121,
21422         .pdu_len = sizeof(send_data_response_121),
21423         .response = {
21424                 .number = 1,
21425                 .type = STK_COMMAND_TYPE_SEND_DATA,
21426                 .qualifier = STK_SEND_DATA_STORE_DATA,
21427                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
21428                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
21429                 .result = {
21430                         .type = STK_RESULT_TYPE_SUCCESS,
21431                 },
21432                 { .send_data = {
21433                                 /* More than 255 bytes of space available */
21434                                 .tx_avail = 0xFF,
21435                 } },
21436         },
21437 };
21438
21439 static const unsigned char send_data_response_151[] = {
21440                 0x81, 0x03, 0x01, 0x43, 0x01, 0x82, 0x02, 0x82, 0x81, 0x83,
21441                 0x02, 0x3A, 0x03,
21442 };
21443
21444 static const struct terminal_response_test send_data_response_data_151 = {
21445         .pdu = send_data_response_151,
21446         .pdu_len = sizeof(send_data_response_151),
21447         .response = {
21448                 .number = 1,
21449                 .type = STK_COMMAND_TYPE_SEND_DATA,
21450                 .qualifier = STK_SEND_DATA_IMMEDIATELY,
21451                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
21452                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
21453                 .result = {
21454                         .type = STK_RESULT_TYPE_BIP_ERROR,
21455                         .additional_len = 1, /* Channel identifier not valid */
21456                         .additional = (unsigned char[1]) { 0x03 },
21457                 },
21458         },
21459 };
21460
21461 static const unsigned char get_channel_status_response_111[] = {
21462                 0x81, 0x03, 0x01, 0x44, 0x00, 0x82, 0x02, 0x82, 0x81, 0x83,
21463                 0x01, 0x00, 0xB8, 0x02, 0x00, 0x00,
21464 };
21465
21466 static const struct terminal_response_test
21467                                 get_channel_status_response_data_111 = {
21468         .pdu = get_channel_status_response_111,
21469         .pdu_len = sizeof(get_channel_status_response_111),
21470         .response = {
21471                 .number = 1,
21472                 .type = STK_COMMAND_TYPE_GET_CHANNEL_STATUS,
21473                 .qualifier = 0x00,
21474                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
21475                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
21476                 .result = {
21477                         .type = STK_RESULT_TYPE_SUCCESS,
21478                 },
21479                 { .channel_status = {
21480                         /*
21481                          * No Channel available, link not established or
21482                          * PDP context not activated
21483                          */
21484                         .channel = {
21485                                 .id = 0,
21486                                 .status =
21487                                 STK_CHANNEL_PACKET_DATA_SERVICE_NOT_ACTIVATED,
21488                         }
21489                 } },
21490         },
21491 };
21492
21493 static const unsigned char get_channel_status_response_121[] = {
21494                 0x81, 0x03, 0x01, 0x44, 0x00, 0x82, 0x02, 0x82, 0x81, 0x83,
21495                 0x01, 0x00, 0xB8, 0x02, 0x81, 0x00,
21496 };
21497
21498 static const struct terminal_response_test
21499                                 get_channel_status_response_data_121 = {
21500         .pdu = get_channel_status_response_121,
21501         .pdu_len = sizeof(get_channel_status_response_121),
21502         .response = {
21503                 .number = 1,
21504                 .type = STK_COMMAND_TYPE_GET_CHANNEL_STATUS,
21505                 .qualifier = 0x00,
21506                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
21507                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
21508                 .result = {
21509                         .type = STK_RESULT_TYPE_SUCCESS,
21510                 },
21511                 { .channel_status = {
21512                 /* Channel 1 open, link established or PDP context activated */
21513                         .channel = {
21514                                 .id = 1,
21515                                 .status =
21516                                 STK_CHANNEL_PACKET_DATA_SERVICE_ACTIVATED,
21517                         },
21518                 } },
21519         },
21520 };
21521
21522 static const unsigned char get_channel_status_response_131[] = {
21523                 0x81, 0x03, 0x01, 0x44, 0x00, 0x82, 0x02, 0x82, 0x81, 0x83,
21524                 0x01, 0x00, 0xB8, 0x02, 0x01, 0x05,
21525 };
21526
21527 static const struct terminal_response_test
21528                                 get_channel_status_response_data_131 = {
21529         .pdu = get_channel_status_response_131,
21530         .pdu_len = sizeof(get_channel_status_response_131),
21531         .response = {
21532                 .number = 1,
21533                 .type = STK_COMMAND_TYPE_GET_CHANNEL_STATUS,
21534                 .qualifier = 0x00,
21535                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
21536                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
21537                 .result = {
21538                         .type = STK_RESULT_TYPE_SUCCESS,
21539                 },
21540                 { .channel_status = {
21541                                 /* Channel 1, link dropped */
21542                                 .channel = {
21543                                         .id = 1,
21544                                         .status = STK_CHANNEL_LINK_DROPPED,
21545                                 },
21546                 } },
21547
21548         },
21549 };
21550
21551 struct envelope_test {
21552         const unsigned char *pdu;
21553         unsigned int pdu_len;
21554         struct stk_envelope envelope;
21555 };
21556
21557 static void test_envelope_encoding(gconstpointer data)
21558 {
21559         const struct envelope_test *test = data;
21560         const unsigned char *pdu;
21561         unsigned int pdu_len;
21562
21563         pdu = stk_pdu_from_envelope(&test->envelope, &pdu_len);
21564
21565         if (test->pdu)
21566                 g_assert(pdu);
21567         else
21568                 g_assert(pdu == NULL);
21569
21570         g_assert(pdu_len == test->pdu_len);
21571         g_assert(memcmp(pdu, test->pdu, pdu_len) == 0);
21572 }
21573
21574 static const unsigned char sms_pp_data_download_161[] = {
21575         0xd1, 0x2d, 0x82, 0x02, 0x83, 0x81, 0x06, 0x09,
21576         0x91, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
21577         0xf8, 0x8b, 0x1c, 0x04, 0x04, 0x91, 0x21, 0x43,
21578         0x7f, 0x16, 0x89, 0x10, 0x10, 0x00, 0x00, 0x00,
21579         0x00, 0x0d, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x20,
21580         0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
21581 };
21582
21583 static const struct envelope_test sms_pp_data_download_data_161 = {
21584         .pdu = sms_pp_data_download_161,
21585         .pdu_len = sizeof(sms_pp_data_download_161),
21586         .envelope = {
21587                 .type = STK_ENVELOPE_TYPE_SMS_PP_DOWNLOAD,
21588                 .src = STK_DEVICE_IDENTITY_TYPE_NETWORK,
21589                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
21590                 { .sms_pp_download = {
21591                         .address = {
21592                                 .ton_npi = 0x91, /* Intl, ISDN */
21593                                 .number = "112233445566778",
21594                         },
21595                         .message = {
21596                                 .oaddr = {
21597                                         .number_type =
21598                                                 SMS_NUMBER_TYPE_INTERNATIONAL,
21599                                         .numbering_plan =
21600                                                 SMS_NUMBERING_PLAN_ISDN,
21601                                         .address = "1234",
21602                                 },
21603                                 .pid = SMS_PID_TYPE_USIM_DOWNLOAD,
21604                                 .dcs = 0x16, /* Uncompressed, Class 2, 8-bit */
21605                                 .scts = {
21606                                         .year = 98,
21607                                         .month = 1,
21608                                         .day = 1,
21609                                         .has_timezone = TRUE,
21610                                         .timezone = 0,
21611                                 },
21612                                 .udl = 13,
21613                                 .ud = "Short Message",
21614                         },
21615                 }},
21616         },
21617 };
21618
21619 static const unsigned char sms_pp_data_download_162[] = {
21620         0xd1, 0x2d, 0x82, 0x02, 0x83, 0x81, 0x06, 0x09,
21621         0x91, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
21622         0xf8, 0x8b, 0x1c, 0x04, 0x04, 0x91, 0x21, 0x43,
21623         0x7f, 0xf6, 0x89, 0x10, 0x10, 0x00, 0x00, 0x00,
21624         0x00, 0x0d, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x20,
21625         0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
21626 };
21627
21628 static const struct envelope_test sms_pp_data_download_data_162 = {
21629         .pdu = sms_pp_data_download_162,
21630         .pdu_len = sizeof(sms_pp_data_download_162),
21631         .envelope = {
21632                 .type = STK_ENVELOPE_TYPE_SMS_PP_DOWNLOAD,
21633                 .src = STK_DEVICE_IDENTITY_TYPE_NETWORK,
21634                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
21635                 { .sms_pp_download = {
21636                         .address = {
21637                                 .ton_npi = 0x91, /* Intl, ISDN */
21638                                 .number = "112233445566778",
21639                         },
21640                         .message = {
21641                                 .oaddr = {
21642                                         .number_type =
21643                                                 SMS_NUMBER_TYPE_INTERNATIONAL,
21644                                         .numbering_plan =
21645                                                 SMS_NUMBERING_PLAN_ISDN,
21646                                         .address = "1234",
21647                                 },
21648                                 .pid = SMS_PID_TYPE_USIM_DOWNLOAD,
21649                                 .dcs = 0xf6, /* Data, Class 2, 8-bit */
21650                                 .scts = {
21651                                         .year = 98,
21652                                         .month = 1,
21653                                         .day = 1,
21654                                         .has_timezone = TRUE,
21655                                         .timezone = 0,
21656                                 },
21657                                 .udl = 13,
21658                                 .ud = "Short Message",
21659                         },
21660                 }},
21661         },
21662 };
21663
21664 static const unsigned char sms_pp_data_download_182[] = {
21665         0xd1, 0x3e, 0x82, 0x02, 0x83, 0x81, 0x06, 0x09,
21666         0x91, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
21667         0xf8, 0x8b, 0x2d, 0x44, 0x04, 0x91, 0x21, 0x43,
21668         0x7f, 0xf6, 0x89, 0x10, 0x10, 0x00, 0x00, 0x00,
21669         0x00, 0x1e, 0x02, 0x70, 0x00, 0x00, 0x19, 0x00,
21670         0x0d, 0x00, 0x00, 0x00, 0x00, 0xbf, 0xff, 0x00,
21671         0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0xdc, 0xdc,
21672         0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc,
21673 };
21674
21675 static const struct envelope_test sms_pp_data_download_data_182 = {
21676         .pdu = sms_pp_data_download_182,
21677         .pdu_len = sizeof(sms_pp_data_download_182),
21678         .envelope = {
21679                 .type = STK_ENVELOPE_TYPE_SMS_PP_DOWNLOAD,
21680                 .src = STK_DEVICE_IDENTITY_TYPE_NETWORK,
21681                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
21682                 { .sms_pp_download = {
21683                         .address = {
21684                                 .ton_npi = 0x91, /* Intl, ISDN */
21685                                 .number = "112233445566778",
21686                         },
21687                         .message = {
21688                                 .udhi = TRUE,
21689                                 .oaddr = {
21690                                         .number_type =
21691                                                 SMS_NUMBER_TYPE_INTERNATIONAL,
21692                                         .numbering_plan =
21693                                                 SMS_NUMBERING_PLAN_ISDN,
21694                                         .address = "1234",
21695                                 },
21696                                 .pid = SMS_PID_TYPE_USIM_DOWNLOAD,
21697                                 .dcs = 0xf6, /* Data, Class 2, 8-bit */
21698                                 .scts = {
21699                                         .year = 98,
21700                                         .month = 1,
21701                                         .day = 1,
21702                                         .has_timezone = TRUE,
21703                                         .timezone = 0,
21704                                 },
21705                                 .udl = 30,
21706                                 .ud = {
21707                                         0x02, 0x70, 0x00, 0x00, 0x19, 0x00,
21708                                         0x0d, 0x00, 0x00, 0x00, 0x00, 0xbf,
21709                                         0xff, 0x00, 0x00, 0x00, 0x00, 0x00,
21710                                         0x01, 0x00, 0xdc, 0xdc, 0xdc, 0xdc,
21711                                         0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc,
21712                                 },
21713                         },
21714                 }},
21715         },
21716 };
21717
21718 static const unsigned char cbs_pp_data_download_11[] = {
21719         0xd2, 0x5e, 0x82, 0x02, 0x83, 0x81, 0x8c, 0x58,
21720         0xc0, 0x11, 0x10, 0x01, 0x01, 0x11, 0xc3, 0x32,
21721         0x9b, 0x0d, 0x12, 0xca, 0xdf, 0x61, 0xf2, 0x38,
21722         0x3c, 0xa7, 0x83, 0x40, 0x20, 0x10, 0x08, 0x04,
21723         0x02, 0x81, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02,
21724         0x81, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x81,
21725         0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x81, 0x40,
21726         0x20, 0x10, 0x08, 0x04, 0x02, 0x81, 0x40, 0x20,
21727         0x10, 0x08, 0x04, 0x02, 0x81, 0x40, 0x20, 0x10,
21728         0x08, 0x04, 0x02, 0x81, 0x40, 0x20, 0x10, 0x08,
21729         0x04, 0x02, 0x81, 0x40, 0x20, 0x10, 0x08, 0x04,
21730         0x02, 0x81, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02,
21731 };
21732
21733 static const struct envelope_test cbs_pp_data_download_data_11 = {
21734         .pdu = cbs_pp_data_download_11,
21735         .pdu_len = sizeof(cbs_pp_data_download_11),
21736         .envelope = {
21737                 .type = STK_ENVELOPE_TYPE_CBS_PP_DOWNLOAD,
21738                 .src = STK_DEVICE_IDENTITY_TYPE_NETWORK,
21739                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
21740                 { .cbs_pp_download = {
21741                         .page = {
21742                                 .gs = CBS_GEO_SCOPE_CELL_NORMAL,
21743                                 .message_code = 1,
21744                                 .update_number = 1,
21745                                 .message_identifier = 0x1001,
21746                                 .dcs = CBS_LANGUAGE_ENGLISH, /* GSM 7-bit */
21747                                 .max_pages = 1,
21748                                 .page = 1,
21749                                 .ud = {
21750                                         /* 7-bit "Cell Broadcast " repeated */
21751                                         0xc3, 0x32, 0x9b, 0x0d, 0x12, 0xca,
21752                                         0xdf, 0x61, 0xf2, 0x38, 0x3c, 0xa7,
21753                                         0x83, 0x40, 0x20, 0x10, 0x08, 0x04,
21754                                         0x02, 0x81, 0x40, 0x20, 0x10, 0x08,
21755                                         0x04, 0x02, 0x81, 0x40, 0x20, 0x10,
21756                                         0x08, 0x04, 0x02, 0x81, 0x40, 0x20,
21757                                         0x10, 0x08, 0x04, 0x02, 0x81, 0x40,
21758                                         0x20, 0x10, 0x08, 0x04, 0x02, 0x81,
21759                                         0x40, 0x20, 0x10, 0x08, 0x04, 0x02,
21760                                         0x81, 0x40, 0x20, 0x10, 0x08, 0x04,
21761                                         0x02, 0x81, 0x40, 0x20, 0x10, 0x08,
21762                                         0x04, 0x02, 0x81, 0x40, 0x20, 0x10,
21763                                         0x08, 0x04, 0x02, 0x81, 0x40, 0x20,
21764                                         0x10, 0x08, 0x04, 0x02,
21765                                 },
21766                         },
21767                 }},
21768         },
21769 };
21770
21771 static const unsigned char cbs_pp_data_download_17[] = {
21772         0xd2, 0x5e, 0x82, 0x02, 0x83, 0x81, 0x8c, 0x58,
21773         0xc0, 0x11, 0x10, 0x01, 0x96, 0x11, 0x02, 0x70,
21774         0x00, 0x00, 0x4d, 0x00, 0x0d, 0x00, 0x00, 0x00,
21775         0x00, 0xbf, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,
21776         0x01, 0x00, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc,
21777         0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc,
21778         0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc,
21779         0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc,
21780         0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc,
21781         0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc,
21782         0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc,
21783         0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc,
21784 };
21785
21786 static const struct envelope_test cbs_pp_data_download_data_17 = {
21787         .pdu = cbs_pp_data_download_17,
21788         .pdu_len = sizeof(cbs_pp_data_download_17),
21789         .envelope = {
21790                 .type = STK_ENVELOPE_TYPE_CBS_PP_DOWNLOAD,
21791                 .src = STK_DEVICE_IDENTITY_TYPE_NETWORK,
21792                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
21793                 { .cbs_pp_download = {
21794                         .page = {
21795                                 .gs = CBS_GEO_SCOPE_CELL_NORMAL,
21796                                 .message_code = 1,
21797                                 .update_number = 1,
21798                                 .message_identifier = 0x1001,
21799                                 .dcs = SMS_CLASS_2 | (SMS_CHARSET_8BIT << 2) |
21800                                         (9 << 4), /* UDHI present */
21801                                 .max_pages = 1,
21802                                 .page = 1,
21803                                 .ud = {
21804                                         /* Secured User Header */
21805                                         0x02, 0x70, 0x00, 0x00, 0x4d, 0x00,
21806                                         0x0d, 0x00, 0x00, 0x00, 0x00, 0xbf,
21807                                         0xff, 0x00, 0x00, 0x00, 0x00, 0x00,
21808                                         0x01, 0x00, 0xdc, 0xdc, 0xdc, 0xdc,
21809                                         0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc,
21810                                         0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc,
21811                                         0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc,
21812                                         0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc,
21813                                         0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc,
21814                                         0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc,
21815                                         0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc,
21816                                         0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc,
21817                                         0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc,
21818                                         0xdc, 0xdc, 0xdc, 0xdc,
21819                                 },
21820                         },
21821                 }},
21822         },
21823 };
21824
21825 static const unsigned char menu_selection_111[] = {
21826         0xd3, 0x07, 0x82, 0x02, 0x01, 0x81, 0x90, 0x01,
21827         0x02,
21828 };
21829
21830 static const struct envelope_test menu_selection_data_111 = {
21831         .pdu = menu_selection_111,
21832         .pdu_len = sizeof(menu_selection_111),
21833         .envelope = {
21834                 .type = STK_ENVELOPE_TYPE_MENU_SELECTION,
21835                 .src = STK_DEVICE_IDENTITY_TYPE_KEYPAD,
21836                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
21837                 { .menu_selection = {
21838                         .item_id = 0x2,
21839                 }},
21840         },
21841 };
21842
21843 static const unsigned char menu_selection_112[] = {
21844         0xd3, 0x07, 0x82, 0x02, 0x01, 0x81, 0x90, 0x01,
21845         0x12,
21846 };
21847
21848 static const struct envelope_test menu_selection_data_112 = {
21849         .pdu = menu_selection_112,
21850         .pdu_len = sizeof(menu_selection_112),
21851         .envelope = {
21852                 .type = STK_ENVELOPE_TYPE_MENU_SELECTION,
21853                 .src = STK_DEVICE_IDENTITY_TYPE_KEYPAD,
21854                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
21855                 { .menu_selection = {
21856                         .item_id = 0x12,
21857                 }},
21858         },
21859 };
21860
21861 static const unsigned char menu_selection_121[] = {
21862         0xd3, 0x07, 0x82, 0x02, 0x01, 0x81, 0x90, 0x01,
21863         0x3d,
21864 };
21865
21866 static const struct envelope_test menu_selection_data_121 = {
21867         .pdu = menu_selection_121,
21868         .pdu_len = sizeof(menu_selection_121),
21869         .envelope = {
21870                 .type = STK_ENVELOPE_TYPE_MENU_SELECTION,
21871                 .src = STK_DEVICE_IDENTITY_TYPE_KEYPAD,
21872                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
21873                 { .menu_selection = {
21874                         .item_id = 0x3d,
21875                 }},
21876         },
21877 };
21878
21879 static const unsigned char menu_selection_122[] = {
21880         0xd3, 0x07, 0x82, 0x02, 0x01, 0x81, 0x90, 0x01,
21881         0xfb,
21882 };
21883
21884 static const struct envelope_test menu_selection_data_122 = {
21885         .pdu = menu_selection_122,
21886         .pdu_len = sizeof(menu_selection_122),
21887         .envelope = {
21888                 .type = STK_ENVELOPE_TYPE_MENU_SELECTION,
21889                 .src = STK_DEVICE_IDENTITY_TYPE_KEYPAD,
21890                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
21891                 { .menu_selection = {
21892                         .item_id = 0xfb,
21893                 }},
21894         },
21895 };
21896
21897 static const unsigned char menu_selection_123[] = {
21898         0xd3, 0x07, 0x82, 0x02, 0x01, 0x81, 0x90, 0x01,
21899         0x01,
21900 };
21901
21902 static const struct envelope_test menu_selection_data_123 = {
21903         .pdu = menu_selection_123,
21904         .pdu_len = sizeof(menu_selection_123),
21905         .envelope = {
21906                 .type = STK_ENVELOPE_TYPE_MENU_SELECTION,
21907                 .src = STK_DEVICE_IDENTITY_TYPE_KEYPAD,
21908                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
21909                 { .menu_selection = {
21910                         .item_id = 0x1,
21911                 }},
21912         },
21913 };
21914
21915 static const unsigned char menu_selection_211[] = {
21916         0xd3, 0x09, 0x82, 0x02, 0x01, 0x81, 0x90, 0x01,
21917         0x02, 0x15, 0x00,
21918 };
21919
21920 static const struct envelope_test menu_selection_data_211 = {
21921         .pdu = menu_selection_211,
21922         .pdu_len = sizeof(menu_selection_211),
21923         .envelope = {
21924                 .type = STK_ENVELOPE_TYPE_MENU_SELECTION,
21925                 .src = STK_DEVICE_IDENTITY_TYPE_KEYPAD,
21926                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
21927                 { .menu_selection = {
21928                         .item_id = 0x2,
21929                         .help_request = TRUE,
21930                 }},
21931         },
21932 };
21933
21934 static const unsigned char menu_selection_612[] = {
21935         0xd3, 0x07, 0x82, 0x02, 0x01, 0x81, 0x90, 0x01,
21936         0x05,
21937 };
21938
21939 static const struct envelope_test menu_selection_data_612 = {
21940         .pdu = menu_selection_612,
21941         .pdu_len = sizeof(menu_selection_612),
21942         .envelope = {
21943                 .type = STK_ENVELOPE_TYPE_MENU_SELECTION,
21944                 .src = STK_DEVICE_IDENTITY_TYPE_KEYPAD,
21945                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
21946                 { .menu_selection = {
21947                         .item_id = 0x5,
21948                 }},
21949         },
21950 };
21951
21952 static const unsigned char menu_selection_641[] = {
21953         0xd3, 0x07, 0x82, 0x02, 0x01, 0x81, 0x90, 0x01,
21954         0x08,
21955 };
21956
21957 static const struct envelope_test menu_selection_data_641 = {
21958         .pdu = menu_selection_641,
21959         .pdu_len = sizeof(menu_selection_641),
21960         .envelope = {
21961                 .type = STK_ENVELOPE_TYPE_MENU_SELECTION,
21962                 .src = STK_DEVICE_IDENTITY_TYPE_KEYPAD,
21963                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
21964                 { .menu_selection = {
21965                         .item_id = 0x8,
21966                 }},
21967         },
21968 };
21969
21970 static const unsigned char call_control_111a[] = {
21971         0xd4, 0x25, 0x82, 0x02, 0x82, 0x81, 0x86, 0x0b,
21972         0x91, 0x10, 0x32, 0x54, 0x76, 0x98, 0x10, 0x32,
21973         0x54, 0x76, 0x98, 0x07, 0x07, 0x06, 0x60, 0x04,
21974         0x02, 0x00, 0x05, 0x81, 0x13, 0x09, 0x00, 0xf1,
21975         0x10, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
21976 };
21977
21978 static const struct envelope_test call_control_data_111a = {
21979         .pdu = call_control_111a,
21980         .pdu_len = sizeof(call_control_111a),
21981         .envelope = {
21982                 .type = STK_ENVELOPE_TYPE_CALL_CONTROL,
21983                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
21984                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
21985                 { .call_control = {
21986                         .type = STK_CC_TYPE_CALL_SETUP,
21987                         { .address = {
21988                                 .ton_npi = 0x91, /* Intl, ISDN */
21989                                 .number = "01234567890123456789",
21990                         }},
21991                         .ccp1 = {
21992                                 .ccp = {
21993                                         0x60, 0x04, 0x02, 0x00, 0x05, 0x81,
21994                                 },
21995                                 .len = 6,
21996                         },
21997                         .location = {
21998                                 .mcc = "001",
21999                                 .mnc = "01",
22000                                 .lac_tac = 0x0001,
22001                                 .has_ci = TRUE,
22002                                 .ci = 0x0001,
22003                                 .has_ext_ci = TRUE,
22004                                 .ext_ci = 0x0001,
22005                         },
22006                 }},
22007         },
22008 };
22009
22010 static const unsigned char call_control_111b[] = {
22011         0xd4, 0x23, 0x82, 0x02, 0x82, 0x81, 0x86, 0x0b,
22012         0x91, 0x10, 0x32, 0x54, 0x76, 0x98, 0x10, 0x32,
22013         0x54, 0x76, 0x98, 0x07, 0x07, 0x06, 0x60, 0x04,
22014         0x02, 0x00, 0x05, 0x81, 0x13, 0x07, 0x00, 0x11,
22015         0x10, 0x00, 0x01, 0x00, 0x01,
22016 };
22017
22018 static const struct envelope_test call_control_data_111b = {
22019         .pdu = call_control_111b,
22020         .pdu_len = sizeof(call_control_111b),
22021         .envelope = {
22022                 .type = STK_ENVELOPE_TYPE_CALL_CONTROL,
22023                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
22024                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
22025                 { .call_control = {
22026                         .type = STK_CC_TYPE_CALL_SETUP,
22027                         { .address = {
22028                                 .ton_npi = 0x91, /* Intl, ISDN */
22029                                 .number = "01234567890123456789",
22030                         }},
22031                         .ccp1 = {
22032                                 .ccp = {
22033                                         0x60, 0x04, 0x02, 0x00, 0x05, 0x81,
22034                                 },
22035                                 .len = 6,
22036                         },
22037                         .location = {
22038                                 .mcc = "001",
22039                                 .mnc = "011",
22040                                 .lac_tac = 0x0001,
22041                                 .has_ci = TRUE,
22042                                 .ci = 0x0001,
22043                         },
22044                 }},
22045         },
22046 };
22047
22048 static const unsigned char call_control_131a[] = {
22049         0xd4, 0x18, 0x82, 0x02, 0x82, 0x81, 0x86, 0x07,
22050         0x91, 0x10, 0x32, 0x04, 0x21, 0x43, 0x65, 0x13,
22051         0x09, 0x00, 0xf1, 0x10, 0x00, 0x01, 0x00, 0x01,
22052         0x00, 0x01,
22053         /*
22054          * Byte 3 changed to 0x82 and byte 7 changed to 0x86 (Comprehension
22055          * Required should be set according to TS 102 223 7.3.1.6)
22056          */
22057 };
22058
22059 static const struct envelope_test call_control_data_131a = {
22060         .pdu = call_control_131a,
22061         .pdu_len = sizeof(call_control_131a),
22062         .envelope = {
22063                 .type = STK_ENVELOPE_TYPE_CALL_CONTROL,
22064                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
22065                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
22066                 { .call_control = {
22067                         .type = STK_CC_TYPE_CALL_SETUP,
22068                         { .address = {
22069                                 .ton_npi = 0x91, /* Intl, ISDN */
22070                                 .number = "012340123456",
22071                         }},
22072                         .location = {
22073                                 .mcc = "001",
22074                                 .mnc = "01",
22075                                 .lac_tac = 0x0001,
22076                                 .has_ci = TRUE,
22077                                 .ci = 0x0001,
22078                                 .has_ext_ci = TRUE,
22079                                 .ext_ci = 0x0001,
22080                         },
22081                 }},
22082         },
22083 };
22084
22085 static const unsigned char call_control_131b[] = {
22086         0xd4, 0x16, 0x82, 0x02, 0x82, 0x81, 0x86, 0x07,
22087         0x91, 0x10, 0x32, 0x04, 0x21, 0x43, 0x65, 0x13,
22088         0x07, 0x00, 0x11, 0x10, 0x00, 0x01, 0x00, 0x01,
22089         /*
22090          * Byte 3 changed to 0x82 and byte 7 changed to 0x86 (Comprehension
22091          * Required should be set according to TS 102 223 7.3.1.6)
22092          */
22093 };
22094
22095 static const struct envelope_test call_control_data_131b = {
22096         .pdu = call_control_131b,
22097         .pdu_len = sizeof(call_control_131b),
22098         .envelope = {
22099                 .type = STK_ENVELOPE_TYPE_CALL_CONTROL,
22100                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
22101                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
22102                 { .call_control = {
22103                         .type = STK_CC_TYPE_CALL_SETUP,
22104                         { .address = {
22105                                 .ton_npi = 0x91, /* Intl, ISDN */
22106                                 .number = "012340123456",
22107                         }},
22108                         .location = {
22109                                 .mcc = "001",
22110                                 .mnc = "011",
22111                                 .lac_tac = 0x0001,
22112                                 .has_ci = TRUE,
22113                                 .ci = 0x0001,
22114                         },
22115                 }},
22116         },
22117 };
22118
22119 static const unsigned char mo_short_message_control_111a[] = {
22120         0xd5, 0x22, 0x02, 0x02, 0x82, 0x81, 0x06, 0x09,
22121         0x91, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
22122         0xf8, 0x06, 0x06, 0x91, 0x10, 0x32, 0x54, 0x76,
22123         0xf8, 0x13, 0x09, 0x00, 0xf1, 0x10, 0x00, 0x01,
22124         0x00, 0x01, 0x00, 0x01,
22125 };
22126
22127 static const struct envelope_test mo_short_message_control_data_111a = {
22128         .pdu = mo_short_message_control_111a,
22129         .pdu_len = sizeof(mo_short_message_control_111a),
22130         .envelope = {
22131                 .type = STK_ENVELOPE_TYPE_MO_SMS_CONTROL,
22132                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
22133                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
22134                 { .sms_mo_control = {
22135                         .sc_address = {
22136                                 .ton_npi = 0x91, /* Intl, ISDN */
22137                                 .number = "112233445566778",
22138                         },
22139                         .dest_address = {
22140                                 .ton_npi = 0x91, /* Intl, ISDN */
22141                                 .number = "012345678",
22142                         },
22143                         .location = {
22144                                 .mcc = "001",
22145                                 .mnc = "01",
22146                                 .lac_tac = 0x0001,
22147                                 .has_ci = TRUE,
22148                                 .ci = 0x0001,
22149                                 .has_ext_ci = TRUE,
22150                                 .ext_ci = 0x0001,
22151                         },
22152                 }},
22153         },
22154 };
22155
22156 static const unsigned char mo_short_message_control_111b[] = {
22157         0xd5, 0x20, 0x02, 0x02, 0x82, 0x81, 0x06, 0x09,
22158         0x91, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
22159         0xf8, 0x06, 0x06, 0x91, 0x10, 0x32, 0x54, 0x76,
22160         0xf8, 0x13, 0x07, 0x00, 0x11, 0x10, 0x00, 0x01,
22161         0x00, 0x01,
22162 };
22163
22164 static const struct envelope_test mo_short_message_control_data_111b = {
22165         .pdu = mo_short_message_control_111b,
22166         .pdu_len = sizeof(mo_short_message_control_111b),
22167         .envelope = {
22168                 .type = STK_ENVELOPE_TYPE_MO_SMS_CONTROL,
22169                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
22170                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
22171                 { .sms_mo_control = {
22172                         .sc_address = {
22173                                 .ton_npi = 0x91, /* Intl, ISDN */
22174                                 .number = "112233445566778",
22175                         },
22176                         .dest_address = {
22177                                 .ton_npi = 0x91, /* Intl, ISDN */
22178                                 .number = "012345678",
22179                         },
22180                         .location = {
22181                                 .mcc = "001",
22182                                 .mnc = "011",
22183                                 .lac_tac = 0x0001,
22184                                 .has_ci = TRUE,
22185                                 .ci = 0x0001,
22186                         },
22187                 }},
22188         },
22189 };
22190
22191 static const unsigned char event_download_mt_call_111[] = {
22192         0xd6, 0x0a, 0x99, 0x01, 0x00, 0x82, 0x02, 0x83,
22193         0x81, 0x9c, 0x01, 0x00,
22194         /*
22195          * Byte 3 changed to 0x99 and byte 10 to 0x9c (Comprehension
22196          * Required should be set according to TS 102 223 7.5.1.2)
22197          */
22198 };
22199
22200 static const struct envelope_test event_download_mt_call_data_111 = {
22201         .pdu = event_download_mt_call_111,
22202         .pdu_len = sizeof(event_download_mt_call_111),
22203         .envelope = {
22204                 .type = STK_ENVELOPE_TYPE_EVENT_DOWNLOAD,
22205                 .src = STK_DEVICE_IDENTITY_TYPE_NETWORK,
22206                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
22207                 { .event_download = {
22208                         .type = STK_EVENT_TYPE_MT_CALL,
22209                         { .mt_call = {
22210                                 .transaction_id = 0,
22211                         }},
22212                 }},
22213         },
22214 };
22215
22216 static const unsigned char event_download_mt_call_112[] = {
22217         0xd6, 0x0f, 0x99, 0x01, 0x00, 0x82, 0x02, 0x83,
22218         0x81, 0x9c, 0x01, 0x00, 0x06, 0x03, 0x81, 0x89,
22219         0x67,
22220         /*
22221          * Byte 3 changed to 0x99 and byte 10 to 0x9c and byte 13 to
22222          * 0x06 (Comprehension Required should be set according to
22223          * TS 102 223 7.5.1.2)
22224          */
22225 };
22226
22227 static const struct envelope_test event_download_mt_call_data_112 = {
22228         .pdu = event_download_mt_call_112,
22229         .pdu_len = sizeof(event_download_mt_call_112),
22230         .envelope = {
22231                 .type = STK_ENVELOPE_TYPE_EVENT_DOWNLOAD,
22232                 .src = STK_DEVICE_IDENTITY_TYPE_NETWORK,
22233                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
22234                 { .event_download = {
22235                         .type = STK_EVENT_TYPE_MT_CALL,
22236                         { .mt_call = {
22237                                 .transaction_id = 0,
22238                                 .caller_address = {
22239                                         .ton_npi = 0x81, /* Unknown, ISDN */
22240                                         .number = "9876",
22241                                 },
22242                         }},
22243                 }},
22244         },
22245 };
22246
22247 static const unsigned char event_download_call_connected_111[] = {
22248         0xd6, 0x0a, 0x99, 0x01, 0x01, 0x82, 0x02, 0x82,
22249         0x81, 0x9c, 0x01, 0x80,
22250         /*
22251          * Byte 3 changed to 0x99 and byte 10 to 0x9c (Comprehension
22252          * Required should be set according to TS 102 223 7.5.2.2)
22253          */
22254 };
22255
22256 static const struct envelope_test event_download_call_connected_data_111 = {
22257         .pdu = event_download_call_connected_111,
22258         .pdu_len = sizeof(event_download_call_connected_111),
22259         .envelope = {
22260                 .type = STK_ENVELOPE_TYPE_EVENT_DOWNLOAD,
22261                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
22262                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
22263                 { .event_download = {
22264                         .type = STK_EVENT_TYPE_CALL_CONNECTED,
22265                         { .call_connected = {
22266                                 .transaction_id = 0x80,
22267                         }},
22268                 }},
22269         },
22270 };
22271
22272 static const unsigned char event_download_call_connected_112[] = {
22273         0xd6, 0x0a, 0x99, 0x01, 0x01, 0x82, 0x02, 0x83,
22274         0x81, 0x9c, 0x01, 0x80,
22275         /*
22276          * Byte 3 changed to 0x99 and byte 10 to 0x9c (Comprehension
22277          * Required should be set according to TS 102 223 7.5.2.2)
22278          */
22279 };
22280
22281 static const struct envelope_test event_download_call_connected_data_112 = {
22282         .pdu = event_download_call_connected_112,
22283         .pdu_len = sizeof(event_download_call_connected_112),
22284         .envelope = {
22285                 .type = STK_ENVELOPE_TYPE_EVENT_DOWNLOAD,
22286                 .src = STK_DEVICE_IDENTITY_TYPE_NETWORK,
22287                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
22288                 { .event_download = {
22289                         .type = STK_EVENT_TYPE_CALL_CONNECTED,
22290                         { .call_connected = {
22291                                 .transaction_id = 0x80,
22292                         }},
22293                 }},
22294         },
22295 };
22296
22297 static const unsigned char event_download_call_disconnected_111[] = {
22298         0xd6, 0x0a, 0x99, 0x01, 0x02, 0x82, 0x02, 0x83,
22299         0x81, 0x9c, 0x01, 0x80,
22300         /*
22301          * Byte 3 changed to 0x99 and byte 10 to 0x9c (Comprehension
22302          * Required should be set according to TS 102 223 7.5.3.2)
22303          */
22304 };
22305
22306 static const struct envelope_test event_download_call_disconnected_data_111 = {
22307         .pdu = event_download_call_disconnected_111,
22308         .pdu_len = sizeof(event_download_call_disconnected_111),
22309         .envelope = {
22310                 .type = STK_ENVELOPE_TYPE_EVENT_DOWNLOAD,
22311                 .src = STK_DEVICE_IDENTITY_TYPE_NETWORK,
22312                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
22313                 { .event_download = {
22314                         .type = STK_EVENT_TYPE_CALL_DISCONNECTED,
22315                         { .call_disconnected = {
22316                                 .transaction_ids = {
22317                                         .len = 1,
22318                                         .list = { 0x80 },
22319                                 },
22320                         }},
22321                 }},
22322         },
22323 };
22324
22325 static const unsigned char event_download_call_disconnected_112a[] = {
22326         0xd6, 0x0a, 0x99, 0x01, 0x02, 0x82, 0x02, 0x82,
22327         0x81, 0x9c, 0x01, 0x80,
22328         /*
22329          * Byte 3 changed to 0x99 and byte 10 to 0x9c (Comprehension
22330          * Required should be set according to TS 102 223 7.5.3.2)
22331          */
22332 };
22333
22334 static const struct envelope_test
22335                 event_download_call_disconnected_data_112a = {
22336         .pdu = event_download_call_disconnected_112a,
22337         .pdu_len = sizeof(event_download_call_disconnected_112a),
22338         .envelope = {
22339                 .type = STK_ENVELOPE_TYPE_EVENT_DOWNLOAD,
22340                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
22341                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
22342                 { .event_download = {
22343                         .type = STK_EVENT_TYPE_CALL_DISCONNECTED,
22344                         { .call_disconnected = {
22345                                 .transaction_ids = {
22346                                         .len = 1,
22347                                         .list = { 0x80 },
22348                                 },
22349                         }},
22350                 }},
22351         },
22352 };
22353
22354 static const unsigned char event_download_call_disconnected_112b[] = {
22355         0xd6, 0x0e, 0x99, 0x01, 0x02, 0x82, 0x02, 0x82,
22356         0x81, 0x9c, 0x01, 0x80, 0x1a, 0x02, 0x60, 0x90,
22357         /*
22358          * Byte 3 changed to 0x99 and byte 10 to 0x9c and byte 13 to
22359          * 1a (Comprehension Required should be set according to TS
22360          * 102 223 7.5.3.2)
22361          */
22362 };
22363
22364 static const struct envelope_test
22365                 event_download_call_disconnected_data_112b = {
22366         .pdu = event_download_call_disconnected_112b,
22367         .pdu_len = sizeof(event_download_call_disconnected_112b),
22368         .envelope = {
22369                 .type = STK_ENVELOPE_TYPE_EVENT_DOWNLOAD,
22370                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
22371                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
22372                 { .event_download = {
22373                         .type = STK_EVENT_TYPE_CALL_DISCONNECTED,
22374                         { .call_disconnected = {
22375                                 .transaction_ids = {
22376                                         .len = 1,
22377                                         .list = { 0x80 },
22378                                 },
22379                                 .cause = {
22380                                         .has_cause = TRUE,
22381                                         .len = 2,
22382                                         /* Normal call clearing */
22383                                         .cause = { 0x60, 0x90 },
22384                                 },
22385                         }},
22386                 }},
22387         },
22388 };
22389
22390 static const unsigned char event_download_call_disconnected_112c[] = {
22391         0xd6, 0x0e, 0x99, 0x01, 0x02, 0x82, 0x02, 0x82,
22392         0x81, 0x9c, 0x01, 0x80, 0x1a, 0x02, 0xe0, 0x90,
22393         /*
22394          * Byte 3 changed to 0x99 and byte 10 to 0x9c and byte 13 to
22395          * 1a (Comprehension Required should be set according to TS
22396          * 102 223 7.5.3.2)
22397          */
22398 };
22399
22400 static const struct envelope_test
22401                 event_download_call_disconnected_data_112c = {
22402         .pdu = event_download_call_disconnected_112c,
22403         .pdu_len = sizeof(event_download_call_disconnected_112c),
22404         .envelope = {
22405                 .type = STK_ENVELOPE_TYPE_EVENT_DOWNLOAD,
22406                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
22407                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
22408                 { .event_download = {
22409                         .type = STK_EVENT_TYPE_CALL_DISCONNECTED,
22410                         { .call_disconnected = {
22411                                 .transaction_ids = {
22412                                         .len = 1,
22413                                         .list = { 0x80 },
22414                                 },
22415                                 .cause = {
22416                                         .has_cause = TRUE,
22417                                         .len = 2,
22418                                         /* Normal call clearing */
22419                                         .cause = { 0xe0, 0x90 },
22420                                 },
22421                         }},
22422                 }},
22423         },
22424 };
22425
22426 static const unsigned char event_download_call_disconnected_113a[] = {
22427         0xd6, 0x0e, 0x99, 0x01, 0x02, 0x82, 0x02, 0x83,
22428         0x81, 0x9c, 0x01, 0x00, 0x1a, 0x02, 0x60, 0x90,
22429         /*
22430          * Byte 3 changed to 0x99 and byte 10 to 0x9c and byte 13 to
22431          * 1a (Comprehension Required should be set according to TS
22432          * 102 223 7.5.3.2)
22433          */
22434 };
22435
22436 static const struct envelope_test
22437                 event_download_call_disconnected_data_113a = {
22438         .pdu = event_download_call_disconnected_113a,
22439         .pdu_len = sizeof(event_download_call_disconnected_113a),
22440         .envelope = {
22441                 .type = STK_ENVELOPE_TYPE_EVENT_DOWNLOAD,
22442                 .src = STK_DEVICE_IDENTITY_TYPE_NETWORK,
22443                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
22444                 { .event_download = {
22445                         .type = STK_EVENT_TYPE_CALL_DISCONNECTED,
22446                         { .call_disconnected = {
22447                                 .transaction_ids = {
22448                                         .len = 1,
22449                                         .list = { 0 },
22450                                 },
22451                                 .cause = {
22452                                         .has_cause = TRUE,
22453                                         .len = 2,
22454                                         /* Normal call clearing */
22455                                         .cause = { 0x60, 0x90 },
22456                                 },
22457                         }},
22458                 }},
22459         },
22460 };
22461
22462 static const unsigned char event_download_call_disconnected_113b[] = {
22463         0xd6, 0x0e, 0x99, 0x01, 0x02, 0x82, 0x02, 0x83,
22464         0x81, 0x9c, 0x01, 0x00, 0x1a, 0x02, 0xe0, 0x90,
22465         /*
22466          * Byte 3 changed to 0x99 and byte 10 to 0x9c and byte 13 to
22467          * 1a (Comprehension Required should be set according to TS
22468          * 102 223 7.5.3.2)
22469          */
22470 };
22471
22472 static const struct envelope_test
22473                 event_download_call_disconnected_data_113b = {
22474         .pdu = event_download_call_disconnected_113b,
22475         .pdu_len = sizeof(event_download_call_disconnected_113b),
22476         .envelope = {
22477                 .type = STK_ENVELOPE_TYPE_EVENT_DOWNLOAD,
22478                 .src = STK_DEVICE_IDENTITY_TYPE_NETWORK,
22479                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
22480                 { .event_download = {
22481                         .type = STK_EVENT_TYPE_CALL_DISCONNECTED,
22482                         { .call_disconnected = {
22483                                 .transaction_ids = {
22484                                         .len = 1,
22485                                         .list = { 0 },
22486                                 },
22487                                 .cause = {
22488                                         .has_cause = TRUE,
22489                                         .len = 2,
22490                                         /* Normal call clearing */
22491                                         .cause = { 0xe0, 0x90 },
22492                                 },
22493                         }},
22494                 }},
22495         },
22496 };
22497
22498 static const unsigned char event_download_call_disconnected_114a[] = {
22499         0xd6, 0x0c, 0x99, 0x01, 0x02, 0x82, 0x02, 0x82,
22500         0x81, 0x9c, 0x01, 0x80, 0x1a, 0x00,
22501         /*
22502          * Byte 3 changed to 0x99 and byte 10 to 0x9c and byte 13 to
22503          * 1a (Comprehension Required should be set according to TS
22504          * 102 223 7.5.3.2)
22505          */
22506 };
22507
22508 static const struct envelope_test
22509                 event_download_call_disconnected_data_114a = {
22510         .pdu = event_download_call_disconnected_114a,
22511         .pdu_len = sizeof(event_download_call_disconnected_114a),
22512         .envelope = {
22513                 .type = STK_ENVELOPE_TYPE_EVENT_DOWNLOAD,
22514                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
22515                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
22516                 { .event_download = {
22517                         .type = STK_EVENT_TYPE_CALL_DISCONNECTED,
22518                         { .call_disconnected = {
22519                                 .transaction_ids = {
22520                                         .len = 1,
22521                                         .list = { 0x80 },
22522                                 },
22523                                 .cause = {
22524                                         .has_cause = TRUE,
22525                                         /* Radio link failure */
22526                                 },
22527                         }},
22528                 }},
22529         },
22530 };
22531
22532 static const unsigned char event_download_call_disconnected_114b[] = {
22533         0xd6, 0x0c, 0x99, 0x01, 0x02, 0x82, 0x02, 0x82,
22534         0x81, 0x9c, 0x01, 0x00, 0x1a, 0x00,
22535         /*
22536          * Byte 3 changed to 0x99 and byte 10 to 0x9c and byte 13 to
22537          * 1a (Comprehension Required should be set according to TS
22538          * 102 223 7.5.3.2)
22539          */
22540 };
22541
22542 static const struct envelope_test
22543                 event_download_call_disconnected_data_114b = {
22544         .pdu = event_download_call_disconnected_114b,
22545         .pdu_len = sizeof(event_download_call_disconnected_114b),
22546         .envelope = {
22547                 .type = STK_ENVELOPE_TYPE_EVENT_DOWNLOAD,
22548                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
22549                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
22550                 { .event_download = {
22551                         .type = STK_EVENT_TYPE_CALL_DISCONNECTED,
22552                         { .call_disconnected = {
22553                                 .transaction_ids = {
22554                                         .len = 1,
22555                                         .list = { 0 },
22556                                 },
22557                                 .cause = {
22558                                         .has_cause = TRUE,
22559                                         /* Radio link failure */
22560                                 },
22561                         }},
22562                 }},
22563         },
22564 };
22565
22566 static const unsigned char event_download_location_status_111[] = {
22567         0xd6, 0x0a, 0x99, 0x01, 0x03, 0x82, 0x02, 0x82,
22568         0x81, 0x9b, 0x01, 0x02,
22569         /*
22570          * Byte 3 changed to 0x99 and byte 10 to 0x9b (Comprehension
22571          * Required should be set according to TS 102 223 7.5.4.2)
22572          */
22573 };
22574
22575 static const struct envelope_test
22576                 event_download_location_status_data_111 = {
22577         .pdu = event_download_location_status_111,
22578         .pdu_len = sizeof(event_download_location_status_111),
22579         .envelope = {
22580                 .type = STK_ENVELOPE_TYPE_EVENT_DOWNLOAD,
22581                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
22582                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
22583                 { .event_download = {
22584                         .type = STK_EVENT_TYPE_LOCATION_STATUS,
22585                         { .location_status = {
22586                                 .state = STK_NO_SERVICE,
22587                         }},
22588                 }},
22589         },
22590 };
22591
22592 static const unsigned char event_download_location_status_112a[] = {
22593         0xd6, 0x15, 0x99, 0x01, 0x03, 0x82, 0x02, 0x82,
22594         0x81, 0x9b, 0x01, 0x00, 0x13, 0x09, 0x00, 0xf1,
22595         0x10, 0x00, 0x02, 0x00, 0x02, 0x00, 0x01,
22596         /*
22597          * Byte 3 changed to 0x99 and byte 10 to 0x9b (Comprehension
22598          * Required should be set according to TS 102 223 7.5.4.2)
22599          */
22600 };
22601
22602 static const struct envelope_test
22603                 event_download_location_status_data_112a = {
22604         .pdu = event_download_location_status_112a,
22605         .pdu_len = sizeof(event_download_location_status_112a),
22606         .envelope = {
22607                 .type = STK_ENVELOPE_TYPE_EVENT_DOWNLOAD,
22608                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
22609                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
22610                 { .event_download = {
22611                         .type = STK_EVENT_TYPE_LOCATION_STATUS,
22612                         { .location_status = {
22613                                 .state = STK_NORMAL_SERVICE,
22614                                 .info = {
22615                                         .mcc = "001",
22616                                         .mnc = "01",
22617                                         .lac_tac = 0x0002,
22618                                         .has_ci = TRUE,
22619                                         .ci = 0x0002,
22620                                         .has_ext_ci = TRUE,
22621                                         .ext_ci = 0x0001,
22622                                 },
22623                         }},
22624                 }},
22625         },
22626 };
22627
22628 static const unsigned char event_download_location_status_112b[] = {
22629         0xd6, 0x13, 0x99, 0x01, 0x03, 0x82, 0x02, 0x82,
22630         0x81, 0x9b, 0x01, 0x00, 0x13, 0x07, 0x00, 0x11,
22631         0x10, 0x00, 0x02, 0x00, 0x02,
22632         /*
22633          * Byte 3 changed to 0x99 and byte 10 to 0x9b (Comprehension
22634          * Required should be set according to TS 102 223 7.5.4.2)
22635          */
22636 };
22637
22638 static const struct envelope_test
22639                 event_download_location_status_data_112b = {
22640         .pdu = event_download_location_status_112b,
22641         .pdu_len = sizeof(event_download_location_status_112b),
22642         .envelope = {
22643                 .type = STK_ENVELOPE_TYPE_EVENT_DOWNLOAD,
22644                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
22645                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
22646                 { .event_download = {
22647                         .type = STK_EVENT_TYPE_LOCATION_STATUS,
22648                         { .location_status = {
22649                                 .state = STK_NORMAL_SERVICE,
22650                                 .info = {
22651                                         .mcc = "001",
22652                                         .mnc = "011",
22653                                         .lac_tac = 0x0002,
22654                                         .has_ci = TRUE,
22655                                         .ci = 0x0002,
22656                                 },
22657                         }},
22658                 }},
22659         },
22660 };
22661
22662 static const unsigned char event_download_location_status_122[] = {
22663         0xd6, 0x15, 0x99, 0x01, 0x03, 0x82, 0x02, 0x82,
22664         0x81, 0x9b, 0x01, 0x00, 0x13, 0x09, 0x00, 0xf1,
22665         0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2f,
22666         /*
22667          * Byte 3 changed to 0x99 and byte 10 to 0x9b (Comprehension
22668          * Required should be set according to TS 102 223 7.5.4.2)
22669          */
22670 };
22671
22672 static const struct envelope_test
22673                 event_download_location_status_data_122 = {
22674         .pdu = event_download_location_status_122,
22675         .pdu_len = sizeof(event_download_location_status_122),
22676         .envelope = {
22677                 .type = STK_ENVELOPE_TYPE_EVENT_DOWNLOAD,
22678                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
22679                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
22680                 { .event_download = {
22681                         .type = STK_EVENT_TYPE_LOCATION_STATUS,
22682                         { .location_status = {
22683                                 .state = STK_NORMAL_SERVICE,
22684                                 .info = {
22685                                         .mcc = "001",
22686                                         .mnc = "01",
22687                                         .lac_tac = 0x0002,
22688                                         .has_eutran_ci = TRUE,
22689                                         .eutran_ci = 0x0000002,
22690                                 },
22691                         }},
22692                 }},
22693         },
22694 };
22695
22696 /*
22697  * This is from 27.22.7.5.  The ENVELOPE given in 27.22.4.16.1.1 seems to
22698  * have invalid length value (2nd byte), but in turn the Comprehension
22699  * Required bit is set correctly..
22700  */
22701 static const unsigned char event_download_user_activity_111[] = {
22702         0xd6, 0x07, 0x99, 0x01, 0x04, 0x82, 0x02, 0x82,
22703         0x81,
22704         /*
22705          * Byte 3 changed to 0x99 (Comprehension Required should be
22706          * set according to TS 102 223 7.5.5.2)
22707          */
22708 };
22709
22710 static const struct envelope_test event_download_user_activity_data_111 = {
22711         .pdu = event_download_user_activity_111,
22712         .pdu_len = sizeof(event_download_user_activity_111),
22713         .envelope = {
22714                 .type = STK_ENVELOPE_TYPE_EVENT_DOWNLOAD,
22715                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
22716                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
22717                 { .event_download = {
22718                         .type = STK_EVENT_TYPE_USER_ACTIVITY,
22719                 }},
22720         },
22721 };
22722
22723 static const unsigned char event_download_idle_screen_available_111[] = {
22724         0xd6, 0x07, 0x99, 0x01, 0x05, 0x82, 0x02, 0x02,
22725         0x81,
22726         /*
22727          * Byte 3 changed to 0x99 (Comprehension Required should be
22728          * set according to TS 102 223 7.5.6.2)
22729          */
22730 };
22731
22732 static const struct envelope_test
22733                 event_download_idle_screen_available_data_111 = {
22734         .pdu = event_download_idle_screen_available_111,
22735         .pdu_len = sizeof(event_download_idle_screen_available_111),
22736         .envelope = {
22737                 .type = STK_ENVELOPE_TYPE_EVENT_DOWNLOAD,
22738                 .src = STK_DEVICE_IDENTITY_TYPE_DISPLAY,
22739                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
22740                 { .event_download = {
22741                         .type = STK_EVENT_TYPE_IDLE_SCREEN_AVAILABLE,
22742                 }},
22743         },
22744 };
22745
22746 static const unsigned char event_download_card_reader_status_111a[] = {
22747         0xd6, 0x0a, 0x99, 0x01, 0x06, 0x82, 0x02, 0x82,
22748         0x81, 0xa0, 0x01, 0x79,
22749 };
22750
22751 static const struct envelope_test
22752                 event_download_card_reader_status_data_111a = {
22753         .pdu = event_download_card_reader_status_111a,
22754         .pdu_len = sizeof(event_download_card_reader_status_111a),
22755         .envelope = {
22756                 .type = STK_ENVELOPE_TYPE_EVENT_DOWNLOAD,
22757                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
22758                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
22759                 { .event_download = {
22760                         .type = STK_EVENT_TYPE_CARD_READER_STATUS,
22761                         { .card_reader_status = {
22762                                 .id = 1,
22763                                 .removable = TRUE,
22764                                 .present = TRUE,
22765                                 .id1_size = TRUE,
22766                                 .card_present = TRUE,
22767                                 .card_powered = FALSE,
22768                         }},
22769                 }},
22770         },
22771 };
22772
22773 static const unsigned char event_download_card_reader_status_111b[] = {
22774         0xd6, 0x0a, 0x99, 0x01, 0x06, 0x82, 0x02, 0x82,
22775         0x81, 0xa0, 0x01, 0x59,
22776 };
22777
22778 static const struct envelope_test
22779                 event_download_card_reader_status_data_111b = {
22780         .pdu = event_download_card_reader_status_111b,
22781         .pdu_len = sizeof(event_download_card_reader_status_111b),
22782         .envelope = {
22783                 .type = STK_ENVELOPE_TYPE_EVENT_DOWNLOAD,
22784                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
22785                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
22786                 { .event_download = {
22787                         .type = STK_EVENT_TYPE_CARD_READER_STATUS,
22788                         { .card_reader_status = {
22789                                 .id = 1,
22790                                 .removable = TRUE,
22791                                 .present = TRUE,
22792                                 .id1_size = FALSE,
22793                                 .card_present = TRUE,
22794                                 .card_powered = FALSE,
22795                         }},
22796                 }},
22797         },
22798 };
22799
22800 static const unsigned char event_download_card_reader_status_111c[] = {
22801         0xd6, 0x0a, 0x99, 0x01, 0x06, 0x82, 0x02, 0x82,
22802         0x81, 0xa0, 0x01, 0x71,
22803 };
22804
22805 static const struct envelope_test
22806                 event_download_card_reader_status_data_111c = {
22807         .pdu = event_download_card_reader_status_111c,
22808         .pdu_len = sizeof(event_download_card_reader_status_111c),
22809         .envelope = {
22810                 .type = STK_ENVELOPE_TYPE_EVENT_DOWNLOAD,
22811                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
22812                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
22813                 { .event_download = {
22814                         .type = STK_EVENT_TYPE_CARD_READER_STATUS,
22815                         { .card_reader_status = {
22816                                 .id = 1,
22817                                 .removable = FALSE,
22818                                 .present = TRUE,
22819                                 .id1_size = TRUE,
22820                                 .card_present = TRUE,
22821                                 .card_powered = FALSE,
22822                         }},
22823                 }},
22824         },
22825 };
22826
22827 static const unsigned char event_download_card_reader_status_111d[] = {
22828         0xd6, 0x0a, 0x99, 0x01, 0x06, 0x82, 0x02, 0x82,
22829         0x81, 0xa0, 0x01, 0x51,
22830 };
22831
22832 static const struct envelope_test
22833                 event_download_card_reader_status_data_111d = {
22834         .pdu = event_download_card_reader_status_111d,
22835         .pdu_len = sizeof(event_download_card_reader_status_111d),
22836         .envelope = {
22837                 .type = STK_ENVELOPE_TYPE_EVENT_DOWNLOAD,
22838                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
22839                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
22840                 { .event_download = {
22841                         .type = STK_EVENT_TYPE_CARD_READER_STATUS,
22842                         { .card_reader_status = {
22843                                 .id = 1,
22844                                 .removable = FALSE,
22845                                 .present = TRUE,
22846                                 .id1_size = FALSE,
22847                                 .card_present = TRUE,
22848                                 .card_powered = FALSE,
22849                         }},
22850                 }},
22851         },
22852 };
22853
22854 static const unsigned char event_download_card_reader_status_112a[] = {
22855         0xd6, 0x0a, 0x99, 0x01, 0x06, 0x82, 0x02, 0x82,
22856         0x81, 0xa0, 0x01, 0x39,
22857 };
22858
22859 static const struct envelope_test
22860                 event_download_card_reader_status_data_112a = {
22861         .pdu = event_download_card_reader_status_112a,
22862         .pdu_len = sizeof(event_download_card_reader_status_112a),
22863         .envelope = {
22864                 .type = STK_ENVELOPE_TYPE_EVENT_DOWNLOAD,
22865                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
22866                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
22867                 { .event_download = {
22868                         .type = STK_EVENT_TYPE_CARD_READER_STATUS,
22869                         { .card_reader_status = {
22870                                 .id = 1,
22871                                 .removable = TRUE,
22872                                 .present = TRUE,
22873                                 .id1_size = TRUE,
22874                                 .card_present = FALSE,
22875                         }},
22876                 }},
22877         },
22878 };
22879
22880 static const unsigned char event_download_card_reader_status_112b[] = {
22881         0xd6, 0x0a, 0x99, 0x01, 0x06, 0x82, 0x02, 0x82,
22882         0x81, 0xa0, 0x01, 0x19,
22883 };
22884
22885 static const struct envelope_test
22886                 event_download_card_reader_status_data_112b = {
22887         .pdu = event_download_card_reader_status_112b,
22888         .pdu_len = sizeof(event_download_card_reader_status_112b),
22889         .envelope = {
22890                 .type = STK_ENVELOPE_TYPE_EVENT_DOWNLOAD,
22891                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
22892                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
22893                 { .event_download = {
22894                         .type = STK_EVENT_TYPE_CARD_READER_STATUS,
22895                         { .card_reader_status = {
22896                                 .id = 1,
22897                                 .removable = TRUE,
22898                                 .present = TRUE,
22899                                 .id1_size = FALSE,
22900                                 .card_present = FALSE,
22901                         }},
22902                 }},
22903         },
22904 };
22905
22906 static const unsigned char event_download_card_reader_status_112c[] = {
22907         0xd6, 0x0a, 0x99, 0x01, 0x06, 0x82, 0x02, 0x82,
22908         0x81, 0xa0, 0x01, 0x31,
22909 };
22910
22911 static const struct envelope_test
22912                 event_download_card_reader_status_data_112c = {
22913         .pdu = event_download_card_reader_status_112c,
22914         .pdu_len = sizeof(event_download_card_reader_status_112c),
22915         .envelope = {
22916                 .type = STK_ENVELOPE_TYPE_EVENT_DOWNLOAD,
22917                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
22918                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
22919                 { .event_download = {
22920                         .type = STK_EVENT_TYPE_CARD_READER_STATUS,
22921                         { .card_reader_status = {
22922                                 .id = 1,
22923                                 .removable = FALSE,
22924                                 .present = TRUE,
22925                                 .id1_size = TRUE,
22926                                 .card_present = FALSE,
22927                         }},
22928                 }},
22929         },
22930 };
22931
22932 static const unsigned char event_download_card_reader_status_112d[] = {
22933         0xd6, 0x0a, 0x99, 0x01, 0x06, 0x82, 0x02, 0x82,
22934         0x81, 0xa0, 0x01, 0x11,
22935 };
22936
22937 static const struct envelope_test
22938                 event_download_card_reader_status_data_112d = {
22939         .pdu = event_download_card_reader_status_112d,
22940         .pdu_len = sizeof(event_download_card_reader_status_112d),
22941         .envelope = {
22942                 .type = STK_ENVELOPE_TYPE_EVENT_DOWNLOAD,
22943                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
22944                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
22945                 { .event_download = {
22946                         .type = STK_EVENT_TYPE_CARD_READER_STATUS,
22947                         { .card_reader_status = {
22948                                 .id = 1,
22949                                 .removable = FALSE,
22950                                 .present = TRUE,
22951                                 .id1_size = FALSE,
22952                                 .card_present = FALSE,
22953                         }},
22954                 }},
22955         },
22956 };
22957
22958 static const unsigned char event_download_card_reader_status_212a[] = {
22959         0xd6, 0x0a, 0x99, 0x01, 0x06, 0x82, 0x02, 0x82,
22960         0x81, 0xa0, 0x01, 0x29,
22961 };
22962
22963 static const struct envelope_test
22964                 event_download_card_reader_status_data_212a = {
22965         .pdu = event_download_card_reader_status_212a,
22966         .pdu_len = sizeof(event_download_card_reader_status_212a),
22967         .envelope = {
22968                 .type = STK_ENVELOPE_TYPE_EVENT_DOWNLOAD,
22969                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
22970                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
22971                 { .event_download = {
22972                         .type = STK_EVENT_TYPE_CARD_READER_STATUS,
22973                         { .card_reader_status = {
22974                                 .id = 1,
22975                                 .removable = TRUE,
22976                                 .present = FALSE,
22977                                 .id1_size = TRUE,
22978                                 .card_present = FALSE,
22979                         }},
22980                 }},
22981         },
22982 };
22983
22984 static const unsigned char event_download_card_reader_status_212b[] = {
22985         0xd6, 0x0a, 0x99, 0x01, 0x06, 0x82, 0x02, 0x82,
22986         0x81, 0xa0, 0x01, 0x09,
22987 };
22988
22989 static const struct envelope_test
22990                 event_download_card_reader_status_data_212b = {
22991         .pdu = event_download_card_reader_status_212b,
22992         .pdu_len = sizeof(event_download_card_reader_status_212b),
22993         .envelope = {
22994                 .type = STK_ENVELOPE_TYPE_EVENT_DOWNLOAD,
22995                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
22996                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
22997                 { .event_download = {
22998                         .type = STK_EVENT_TYPE_CARD_READER_STATUS,
22999                         { .card_reader_status = {
23000                                 .id = 1,
23001                                 .removable = TRUE,
23002                                 .present = FALSE,
23003                                 .id1_size = FALSE,
23004                                 .card_present = FALSE,
23005                         }},
23006                 }},
23007         },
23008 };
23009
23010 static const unsigned char event_download_language_selection_111[] = {
23011         0xd6, 0x0b, 0x99, 0x01, 0x07, 0x82, 0x02, 0x82,
23012         0x81, 0xad, 0x02, 0x64, 0x65,
23013         /*
23014          * Byte 3 changed to 0x99 and byte 10 to 0xad (Comprehension
23015          * Required should be set according to TS 102 223 7.5.8.2)
23016          */
23017 };
23018
23019 static const struct envelope_test
23020                 event_download_language_selection_data_111 = {
23021         .pdu = event_download_language_selection_111,
23022         .pdu_len = sizeof(event_download_language_selection_111),
23023         .envelope = {
23024                 .type = STK_ENVELOPE_TYPE_EVENT_DOWNLOAD,
23025                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
23026                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
23027                 { .event_download = {
23028                         .type = STK_EVENT_TYPE_LANGUAGE_SELECTION,
23029                         { .language_selection = "de" },
23030                 }},
23031         },
23032 };
23033
23034 static const unsigned char event_download_language_selection_122[] = {
23035         0xd6, 0x0b, 0x99, 0x01, 0x07, 0x82, 0x02, 0x82,
23036         0x81, 0xad, 0x02, 0x73, 0x65,
23037         /* Byte 5 changed to 0x07 (Event: Language Selection) */
23038         /* Byte 8 changed to 0x82 (Source device: Terminal) */
23039         /* Removed the (unexpected?) Transaction ID data object (0x2d) */
23040 };
23041
23042 static const struct envelope_test
23043                 event_download_language_selection_data_122 = {
23044         .pdu = event_download_language_selection_122,
23045         .pdu_len = sizeof(event_download_language_selection_122),
23046         .envelope = {
23047                 .type = STK_ENVELOPE_TYPE_EVENT_DOWNLOAD,
23048                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
23049                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
23050                 { .event_download = {
23051                         .type = STK_EVENT_TYPE_LANGUAGE_SELECTION,
23052                         { .language_selection = "se" },
23053                 }},
23054         },
23055 };
23056
23057 static const unsigned char event_download_browser_termination_111[] = {
23058         0xd6, 0x0a, 0x99, 0x01, 0x08, 0x82, 0x02, 0x82,
23059         0x81, 0xb4, 0x01, 0x00,
23060 };
23061
23062 static const struct envelope_test
23063                 event_download_browser_termination_data_111 = {
23064         .pdu = event_download_browser_termination_111,
23065         .pdu_len = sizeof(event_download_browser_termination_111),
23066         .envelope = {
23067                 .type = STK_ENVELOPE_TYPE_EVENT_DOWNLOAD,
23068                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
23069                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
23070                 { .event_download = {
23071                         .type = STK_EVENT_TYPE_BROWSER_TERMINATION,
23072                         { .browser_termination = {
23073                                 .cause = STK_BROWSER_USER_TERMINATION,
23074                         }},
23075                 }},
23076         },
23077 };
23078
23079 static const unsigned char event_download_data_available_111[] = {
23080         0xd6, 0x0e, 0x99, 0x01, 0x09, 0x82, 0x02, 0x82,
23081         0x81, 0xb8, 0x02, 0x81, 0x00, 0xb7, 0x01, 0xff,
23082 };
23083
23084 static const struct envelope_test event_download_data_available_data_111 = {
23085         .pdu = event_download_data_available_111,
23086         .pdu_len = sizeof(event_download_data_available_111),
23087         .envelope = {
23088                 .type = STK_ENVELOPE_TYPE_EVENT_DOWNLOAD,
23089                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
23090                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
23091                 { .event_download = {
23092                         .type = STK_EVENT_TYPE_DATA_AVAILABLE,
23093                         { .data_available = {
23094                                 /* Channel 1 open, Link established */
23095                                 .channel = {
23096                                 .id = 1,
23097                                 .status =
23098                                 STK_CHANNEL_PACKET_DATA_SERVICE_ACTIVATED,
23099                                 },
23100                                 .channel_data_len = 255,
23101                         } },
23102                 } },
23103         },
23104 };
23105
23106 static const unsigned char event_download_data_available_211[] = {
23107         0xd6, 0x0e, 0x99, 0x01, 0x09, 0x82, 0x02, 0x82,
23108         0x81, 0xb8, 0x02, 0x81, 0x00, 0xb7, 0x01, 0xff,
23109 };
23110
23111 static const struct envelope_test event_download_data_available_data_211 = {
23112         .pdu = event_download_data_available_211,
23113         .pdu_len = sizeof(event_download_data_available_211),
23114         .envelope = {
23115                 .type = STK_ENVELOPE_TYPE_EVENT_DOWNLOAD,
23116                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
23117                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
23118                 { .event_download = {
23119                         .type = STK_EVENT_TYPE_DATA_AVAILABLE,
23120                         { .data_available = {
23121                                 /* Channel 1 open, Link established */
23122                                 .channel = {
23123                                 .id = 1,
23124                                 .status =
23125                                 STK_CHANNEL_PACKET_DATA_SERVICE_ACTIVATED,
23126                                 },
23127                                 .channel_data_len = 255,
23128                         } },
23129                 } },
23130         },
23131 };
23132
23133 static const unsigned char event_download_channel_status_131[] = {
23134         0xd6, 0x0b, 0x99, 0x01, 0x0a, 0x82, 0x02, 0x82,
23135         0x81, 0xb8, 0x02, 0x01, 0x05,
23136 };
23137
23138 static const struct envelope_test event_download_channel_status_data_131 = {
23139         .pdu = event_download_channel_status_131,
23140         .pdu_len = sizeof(event_download_channel_status_131),
23141         .envelope = {
23142                 .type = STK_ENVELOPE_TYPE_EVENT_DOWNLOAD,
23143                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
23144                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
23145                 { .event_download = {
23146                         .type = STK_EVENT_TYPE_CHANNEL_STATUS,
23147                         { .channel_status = {
23148                                 /* Channel 1, Link dropped */
23149                                 .channel = {
23150                                         .id = 1,
23151                                         .status = STK_CHANNEL_LINK_DROPPED,
23152                                 },
23153                         } },
23154                 } },
23155         },
23156 };
23157
23158 static const unsigned char event_download_channel_status_211[] = {
23159         0xd6, 0x0b, 0x99, 0x01, 0x0a, 0x82, 0x02, 0x82,
23160         0x81, 0xb8, 0x02, 0x41, 0x00,
23161         /*
23162          * Byte 10 changed to 0xb8 (Comprehension Required should be
23163          * set according to TS 102 223 7.5.11.2)
23164          */
23165 };
23166
23167 static const struct envelope_test event_download_channel_status_data_211 = {
23168         .pdu = event_download_channel_status_211,
23169         .pdu_len = sizeof(event_download_channel_status_211),
23170         .envelope = {
23171                 .type = STK_ENVELOPE_TYPE_EVENT_DOWNLOAD,
23172                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
23173                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
23174                 { .event_download = {
23175                         .type = STK_EVENT_TYPE_CHANNEL_STATUS,
23176                         { .channel_status = {
23177                                 /* Channel 1, TCP in LISTEN state */
23178                                 .channel = {
23179                                 .id = 1,
23180                                 .status = STK_CHANNEL_TCP_IN_LISTEN_STATE,
23181                                 },
23182                         } },
23183                 } },
23184         },
23185 };
23186
23187 static const unsigned char event_download_channel_status_221[] = {
23188         0xd6, 0x0b, 0x99, 0x01, 0x0a, 0x82, 0x02, 0x82,
23189         0x81, 0xb8, 0x02, 0x81, 0x00,
23190         /*
23191          * Byte 10 changed to 0xb8 (Comprehension Required should be
23192          * set according to TS 102 223 7.5.11.2)
23193          */
23194 };
23195
23196 static const struct envelope_test event_download_channel_status_data_221 = {
23197         .pdu = event_download_channel_status_221,
23198         .pdu_len = sizeof(event_download_channel_status_221),
23199         .envelope = {
23200                 .type = STK_ENVELOPE_TYPE_EVENT_DOWNLOAD,
23201                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
23202                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
23203                 { .event_download = {
23204                         .type = STK_EVENT_TYPE_CHANNEL_STATUS,
23205                         { .channel_status = {
23206                                 /* Channel 1 open, TCP Link established */
23207                                 .channel = {
23208                                 .id = 1,
23209                                 .status =
23210                                 STK_CHANNEL_PACKET_DATA_SERVICE_ACTIVATED,
23211                                 },
23212                         } },
23213                 } },
23214         },
23215 };
23216
23217 static const unsigned char event_download_network_rejection_111[] = {
23218         0xd6, 0x17, 0x99, 0x01, 0x12, 0x82, 0x02, 0x83,
23219         0x81, 0x7d, 0x05, 0x00, 0xf1, 0x10, 0x00, 0x01,
23220         0xbf, 0x01, 0x08, 0xf4, 0x01, 0x09, 0xf5, 0x01,
23221         0x0b,
23222         /*
23223          * Byte 3 changed to 99, byte 17 changed to bf, byte 19 to f4 and
23224          * byte 22 to f5 (Comprehension Required should be set according
23225          * to TS 131 111 7.5.2.2)
23226          */
23227 };
23228
23229 static const struct envelope_test event_download_network_rejection_data_111 = {
23230         .pdu = event_download_network_rejection_111,
23231         .pdu_len = sizeof(event_download_network_rejection_111),
23232         .envelope = {
23233                 .type = STK_ENVELOPE_TYPE_EVENT_DOWNLOAD,
23234                 .src = STK_DEVICE_IDENTITY_TYPE_NETWORK,
23235                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
23236                 { .event_download = {
23237                         .type = STK_EVENT_TYPE_NETWORK_REJECTION,
23238                         { .network_rejection = {
23239                                 .tai = {
23240                                         .mcc = "001",
23241                                         .mnc = "01",
23242                                         .tac = 0x0001,
23243                                 },
23244                                 .access_tech = STK_ACCESS_TECHNOLOGY_EUTRAN,
23245                                 .update_attach = STK_UPDATE_ATTACH_EPS_ATTACH,
23246                                 .cause = STK_CAUSE_EMM_PLMN_NOT_ALLOWED,
23247                         }},
23248                 }},
23249         },
23250 };
23251
23252 static const unsigned char event_download_network_rejection_121[] = {
23253         0xd6, 0x17, 0x99, 0x01, 0x12, 0x82, 0x02, 0x83,
23254         0x81, 0x7d, 0x05, 0x00, 0xf1, 0x10, 0x00, 0x01,
23255         0xbf, 0x01, 0x08, 0xf4, 0x01, 0x0b, 0xf5, 0x01,
23256         0x0c,
23257         /*
23258          * Byte 3 changed to 99, byte 17 changed to bf, byte 19 to f4 and
23259          * byte 22 to f5 (Comprehension Required should be set according
23260          * to TS 131 111 7.5.2.2)
23261          */
23262 };
23263
23264 static const struct envelope_test event_download_network_rejection_data_121 = {
23265         .pdu = event_download_network_rejection_121,
23266         .pdu_len = sizeof(event_download_network_rejection_121),
23267         .envelope = {
23268                 .type = STK_ENVELOPE_TYPE_EVENT_DOWNLOAD,
23269                 .src = STK_DEVICE_IDENTITY_TYPE_NETWORK,
23270                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
23271                 { .event_download = {
23272                         .type = STK_EVENT_TYPE_NETWORK_REJECTION,
23273                         { .network_rejection = {
23274                                 .tai = {
23275                                         .mcc = "001",
23276                                         .mnc = "01",
23277                                         .tac = 0x0001,
23278                                 },
23279                                 .access_tech = STK_ACCESS_TECHNOLOGY_EUTRAN,
23280                                 .update_attach = STK_UPDATE_ATTACH_TA_UPDATING,
23281                                 .cause = STK_CAUSE_EMM_TAC_NOT_ALLOWED,
23282                         }},
23283                 }},
23284         },
23285 };
23286
23287 static const unsigned char timer_expiration_211[] = {
23288         0xd7, 0x0c, 0x82, 0x02, 0x82, 0x81, 0xa4, 0x01,
23289         0x01, 0xa5, 0x03, 0x00, 0x00, 0x01,
23290 };
23291
23292 static const struct envelope_test timer_expiration_data_211 = {
23293         .pdu = timer_expiration_211,
23294         .pdu_len = sizeof(timer_expiration_211),
23295         .envelope = {
23296                 .type = STK_ENVELOPE_TYPE_TIMER_EXPIRATION,
23297                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
23298                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
23299                 { .timer_expiration = {
23300                         .id = 1,
23301                         .value = {
23302                                 .second = 10,
23303                                 .has_value = TRUE,
23304                         },
23305                 }},
23306         },
23307 };
23308
23309 static const unsigned char timer_expiration_221a[] = {
23310         0xd7, 0x0c, 0x82, 0x02, 0x82, 0x81, 0xa4, 0x01,
23311         0x01, 0xa5, 0x03, 0x00, 0x00, 0x03,
23312 };
23313
23314 static const struct envelope_test timer_expiration_data_221a = {
23315         .pdu = timer_expiration_221a,
23316         .pdu_len = sizeof(timer_expiration_221a),
23317         .envelope = {
23318                 .type = STK_ENVELOPE_TYPE_TIMER_EXPIRATION,
23319                 .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
23320                 .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
23321                 { .timer_expiration = {
23322                         .id = 1,
23323                         .value = {
23324                                 .second = 30,
23325                                 .has_value = TRUE,
23326                         },
23327                 }},
23328         },
23329 };
23330
23331 struct html_attr_test {
23332         char *text;
23333         struct stk_text_attribute text_attr;
23334         char *html;
23335 };
23336
23337 static struct html_attr_test html_attr_data_1 = {
23338         .text = "Blue green green green",
23339         .text_attr = {
23340                 .len = 8,
23341                 .attributes = { 0x00, 0x00, 0x03, 0x94, 0x00, 0x04, 0x03,
23342                                 0x96 },
23343         },
23344         .html = "<span style=\"color: #0000A0;background-color: #FFFFFF;\">"
23345                 "Blue</span><span style=\"color: #347235;background-color: "
23346                 "#FFFFFF;\"> green green green</span>",
23347 };
23348
23349 static struct html_attr_test html_attr_data_2 = {
23350         .text = "abc",
23351         .text_attr = {
23352                 .len = 8,
23353                 .attributes = { 0x00, 0x02, 0x03, 0x94, 0x01, 0x02, 0x03,
23354                                 0x96 },
23355         },
23356         .html = "<span style=\"color: #347235;background-color: #FFFFFF;\">"
23357                 "a</span><span style=\"color: #0000A0;background-color: "
23358                 "#FFFFFF;\">bc</span>",
23359 };
23360
23361 static struct html_attr_test html_attr_data_3 = {
23362         .text = "1 < 2, 2 > 1, 1 & 0 == 0\nSpecial Chars are Fun\r\nTo Write",
23363         .text_attr = {
23364                 .len = 4,
23365                 .attributes = { 0x00, 0x00, 0x03, 0x00 },
23366         },
23367         .html = "1 &lt; 2, 2 &gt; 1, 1 &amp; 0 == 0<br/>Special Chars are Fun"
23368                 "<br/>To Write",
23369 };
23370
23371 static struct html_attr_test html_attr_data_4 = {
23372         .text = "€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€"
23373                 "€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€"
23374                 "€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€"
23375                 "€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€"
23376                 "€€€€€€€€€€€€€€€",
23377         .text_attr = {
23378                 .len = 4,
23379                 .attributes = { 0x00, 0x00, 0x03, 0x94 },
23380         },
23381         .html = "<span style=\"color: #347235;background-color: #FFFFFF;\">"
23382                 "€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€"
23383                 "€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€"
23384                 "€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€"
23385                 "€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€"
23386                 "€€€€€€€€€€€€€€€</span>",
23387 };
23388
23389 static void test_html_attr(gconstpointer data)
23390 {
23391         const struct html_attr_test *test = data;
23392         check_text_attr_html(&test->text_attr, test->text, test->html);
23393 }
23394
23395 struct img_xpm_test {
23396         const unsigned char *img;
23397         unsigned int len;
23398         const unsigned char *clut;
23399         unsigned short clut_len;
23400         guint8 scheme;
23401         char *xpm;
23402 };
23403
23404 const unsigned char img1[] = { 0x05, 0x05, 0xFE, 0xEB, 0xBF, 0xFF, 0xFF, 0xFF };
23405
23406 const unsigned char img2[] = { 0x08, 0x08, 0x02, 0x03, 0x00, 0x16, 0xAA,
23407                                         0xAA, 0x80, 0x02, 0x85, 0x42, 0x81,
23408                                         0x42, 0x81, 0x42, 0x81, 0x52, 0x80,
23409                                         0x02, 0xAA, 0xAA, 0xFF, 0x00, 0x00,
23410                                         0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF };
23411
23412 const unsigned char img3[] = { 0x2E, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
23413                                 0x00, 0x01, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x0F,
23414                                 0xFF, 0x00, 0x00, 0x00, 0x00, 0x77, 0xFE, 0x00,
23415                                 0x00, 0x00, 0x01, 0xBF, 0xF8, 0x00, 0x00, 0x00,
23416                                 0x06, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x1A, 0x03,
23417                                 0x80, 0x00, 0x00, 0x00, 0x6B, 0xF6, 0xBC, 0x00,
23418                                 0x00, 0x01, 0xAF, 0xD8, 0x38, 0x00, 0x00, 0x06,
23419                                 0xBF, 0x60, 0x20, 0x00, 0x00, 0x1A, 0xFD, 0x80,
23420                                 0x40, 0x00, 0x00, 0x6B, 0xF6, 0x00, 0x80, 0x00,
23421                                 0x01, 0xA0, 0x1F, 0x02, 0x00, 0x00, 0x06, 0xFF,
23422                                 0xE4, 0x04, 0x00, 0x00, 0x1B, 0xFF, 0x90, 0x10,
23423                                 0x00, 0x00, 0x6D, 0xEE, 0x40, 0x40, 0x00, 0x01,
23424                                 0xBF, 0xF9, 0x01, 0x00, 0x00, 0x6F, 0xFF, 0xE4,
23425                                 0x04, 0x00, 0x00, 0x1B, 0xFF, 0x90, 0x10, 0x00,
23426                                 0x00, 0x6F, 0xFE, 0x40, 0x40, 0x00, 0x01, 0xBF,
23427                                 0xF9, 0x01, 0x00, 0x00, 0x06, 0xFF, 0xE6, 0x04,
23428                                 0x00, 0x00, 0x1B, 0xFF, 0x88, 0x10, 0x00, 0x00,
23429                                 0x6F, 0xFE, 0x20, 0x40, 0x00, 0x01, 0xBF, 0xF8,
23430                                 0x66, 0x00, 0x00, 0x06, 0xFF, 0xE0, 0xF0, 0x00,
23431                                 0x00, 0x1B, 0xFF, 0x80, 0x80, 0x00, 0x00, 0x7F,
23432                                 0xFE, 0x00, 0x00, 0x00, 0x03, 0x00, 0x0C, 0x00,
23433                                 0x00, 0x00, 0x1F, 0xFF, 0xF8, 0x00, 0x00, 0x00,
23434                                 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
23435                                 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
23436                                 0x1C, 0x21, 0x08, 0x44, 0xEE, 0x00, 0x48, 0xC4,
23437                                 0x31, 0x92, 0x20, 0x01, 0x25, 0x11, 0x45, 0x50,
23438                                 0x80, 0x07, 0x14, 0x45, 0x15, 0x43, 0x80, 0x12,
23439                                 0x71, 0x1C, 0x4D, 0x08, 0x00, 0x4A, 0x24, 0x89,
23440                                 0x32, 0x20, 0x01, 0xC8, 0x9E, 0x24, 0x4E,
23441                                 0xE0 };
23442
23443 const unsigned char img4[] = { 0x18, 0x10, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x01,
23444                                 0x80, 0x00, 0x01, 0x80, 0x00, 0x01, 0x8F,
23445                                 0x3C, 0xF1, 0x89, 0x20, 0x81, 0x89, 0x20,
23446                                 0x81, 0x89, 0x20, 0xF1, 0x89, 0x20, 0x11,
23447                                 0x89, 0x20, 0x11, 0x89, 0x20, 0x11, 0x8F,
23448                                 0x3C, 0xF1, 0x80, 0x00, 0x01, 0x80, 0x00,
23449                                 0x01, 0x80, 0x00, 0x01, 0xFF, 0xFF, 0xFF };
23450
23451 const unsigned char img5[] = { 0x08, 0x08, 0xFF, 0x03, 0xA5, 0x99, 0x99,
23452                                 0xA5, 0xC3, 0xFF };
23453
23454 static struct img_xpm_test xpm_test_1 = {
23455         .img = img1,
23456         .len = sizeof(img1),
23457         .scheme = STK_IMG_SCHEME_BASIC,
23458         .xpm = "/* XPM */\n"
23459                 "static char *xpm[] = {\n"
23460                 "\"5 5 2 1\",\n"
23461                 "\"0    c #000000\",\n"
23462                 "\"1    c #FFFFFF\",\n"
23463                 "\"11111\",\n"
23464                 "\"11011\",\n"
23465                 "\"10101\",\n"
23466                 "\"11011\",\n"
23467                 "\"11111\",\n"
23468                 "};",
23469 };
23470
23471 static struct img_xpm_test xpm_test_2 = {
23472         .img = img2,
23473         .len = sizeof(img2),
23474         .clut = img2 + 0x16,
23475         .clut_len = 0x09,
23476         .scheme = STK_IMG_SCHEME_COLOR,
23477         .xpm = "/* XPM */\n"
23478                 "static char *xpm[] = {\n"
23479                 "\"8 8 3 1\",\n"
23480                 "\"0    c #FF0000\",\n"
23481                 "\"1    c #00FF00\",\n"
23482                 "\"2    c #0000FF\",\n"
23483                 "\"22222222\",\n"
23484                 "\"20000002\",\n"
23485                 "\"20111002\",\n"
23486                 "\"20011002\",\n"
23487                 "\"20011002\",\n"
23488                 "\"20011102\",\n"
23489                 "\"20000002\",\n"
23490                 "\"22222222\",\n"
23491                 "};",
23492 };
23493
23494 static struct img_xpm_test xpm_test_3 = {
23495         .img = img3,
23496         .len = sizeof(img3),
23497         .scheme = STK_IMG_SCHEME_BASIC,
23498         .xpm = "/* XPM */\n"
23499                 "static char *xpm[] = {\n"
23500                 "\"46 40 2 1\",\n"
23501                 "\"0    c #000000\",\n"
23502                 "\"1    c #FFFFFF\",\n"
23503                 "\"0000000000000000000000000000000000000000000000\",\n"
23504                 "\"0000000000000000011111111110000000000000000000\",\n"
23505                 "\"0000000000000000111111111111000000000000000000\",\n"
23506                 "\"0000000000000001110111111111100000000000000000\",\n"
23507                 "\"0000000000000001101111111111100000000000000000\",\n"
23508                 "\"0000000000000001101111111111100000000000000000\",\n"
23509                 "\"0000000000000001101000000011100000000000000000\",\n"
23510                 "\"0000000000000001101011111101101011110000000000\",\n"
23511                 "\"0000000000000001101011111101100000111000000000\",\n"
23512                 "\"0000000000000001101011111101100000001000000000\",\n"
23513                 "\"0000000000000001101011111101100000000100000000\",\n"
23514                 "\"0000000000000001101011111101100000000010000000\",\n"
23515                 "\"0000000000000001101000000001111100000010000000\",\n"
23516                 "\"0000000000000001101111111111100100000001000000\",\n"
23517                 "\"0000000000000001101111111111100100000001000000\",\n"
23518                 "\"0000000000000001101101111011100100000001000000\",\n"
23519                 "\"0000000000000001101111111111100100000001000000\",\n"
23520                 "\"0000000000011011111111111111100100000001000000\",\n"
23521                 "\"0000000000000001101111111111100100000001000000\",\n"
23522                 "\"0000000000000001101111111111100100000001000000\",\n"
23523                 "\"0000000000000001101111111111100100000001000000\",\n"
23524                 "\"0000000000000001101111111111100110000001000000\",\n"
23525                 "\"0000000000000001101111111111100010000001000000\",\n"
23526                 "\"0000000000000001101111111111100010000001000000\",\n"
23527                 "\"0000000000000001101111111111100001100110000000\",\n"
23528                 "\"0000000000000001101111111111100000111100000000\",\n"
23529                 "\"0000000000000001101111111111100000001000000000\",\n"
23530                 "\"0000000000000001111111111111100000000000000000\",\n"
23531                 "\"0000000000000011000000000000110000000000000000\",\n"
23532                 "\"0000000000000111111111111111111000000000000000\",\n"
23533                 "\"0000000000000000000000000000000000000000000000\",\n"
23534                 "\"0000000000000000000000000000000000000000000000\",\n"
23535                 "\"0000000000000000000000000000000000000000000000\",\n"
23536                 "\"0000011100001000010000100001000100111011100000\",\n"
23537                 "\"0000010010001100010000110001100100100010000000\",\n"
23538                 "\"0000010010010100010001010001010101000010000000\",\n"
23539                 "\"0000011100010100010001010001010101000011100000\",\n"
23540                 "\"0000010010011100010001110001001101000010000000\",\n"
23541                 "\"0000010010100010010010001001001100100010000000\",\n"
23542                 "\"0000011100100010011110001001000100111011100000\",\n"
23543                 "};",
23544 };
23545
23546 static struct img_xpm_test xpm_test_4 = {
23547         .img = img4,
23548         .len = sizeof(img4),
23549         .scheme = STK_IMG_SCHEME_BASIC,
23550         .xpm = "/* XPM */\n"
23551                 "static char *xpm[] = {\n"
23552                 "\"24 16 2 1\",\n"
23553                 "\"0    c #000000\",\n"
23554                 "\"1    c #FFFFFF\",\n"
23555                 "\"111111111111111111111111\",\n"
23556                 "\"100000000000000000000001\",\n"
23557                 "\"100000000000000000000001\",\n"
23558                 "\"100000000000000000000001\",\n"
23559                 "\"100011110011110011110001\",\n"
23560                 "\"100010010010000010000001\",\n"
23561                 "\"100010010010000010000001\",\n"
23562                 "\"100010010010000011110001\",\n"
23563                 "\"100010010010000000010001\",\n"
23564                 "\"100010010010000000010001\",\n"
23565                 "\"100010010010000000010001\",\n"
23566                 "\"100011110011110011110001\",\n"
23567                 "\"100000000000000000000001\",\n"
23568                 "\"100000000000000000000001\",\n"
23569                 "\"100000000000000000000001\",\n"
23570                 "\"111111111111111111111111\",\n"
23571                 "};",
23572 };
23573
23574 static struct img_xpm_test xpm_test_5 = {
23575         .img = img5,
23576         .len = sizeof(img5),
23577         .scheme = STK_IMG_SCHEME_BASIC,
23578         .xpm = "/* XPM */\n"
23579                 "static char *xpm[] = {\n"
23580                 "\"8 8 2 1\",\n"
23581                 "\"0    c #000000\",\n"
23582                 "\"1    c #FFFFFF\",\n"
23583                 "\"11111111\",\n"
23584                 "\"00000011\",\n"
23585                 "\"10100101\",\n"
23586                 "\"10011001\",\n"
23587                 "\"10011001\",\n"
23588                 "\"10100101\",\n"
23589                 "\"11000011\",\n"
23590                 "\"11111111\",\n"
23591                 "};",
23592 };
23593
23594 static struct img_xpm_test xpm_test_6 = {
23595         .img = img2,
23596         .len = sizeof(img2),
23597         .clut = img2 + 0x16,
23598         .clut_len = 0x09,
23599         .scheme = STK_IMG_SCHEME_TRANSPARENCY,
23600         .xpm = "/* XPM */\n"
23601                 "static char *xpm[] = {\n"
23602                 "\"8 8 3 1\",\n"
23603                 "\"0    c #FF0000\",\n"
23604                 "\"1    c #00FF00\",\n"
23605                 "\"2    c None\",\n"
23606                 "\"22222222\",\n"
23607                 "\"20000002\",\n"
23608                 "\"20111002\",\n"
23609                 "\"20011002\",\n"
23610                 "\"20011002\",\n"
23611                 "\"20011102\",\n"
23612                 "\"20000002\",\n"
23613                 "\"22222222\",\n"
23614                 "};",
23615 };
23616
23617 static void test_img_to_xpm(gconstpointer data)
23618 {
23619         const struct img_xpm_test *test = data;
23620         char *xpm;
23621
23622         xpm = stk_image_to_xpm(test->img, test->len, test->scheme,
23623                                 test->clut, test->clut_len);
23624
23625         g_assert(memcmp(xpm, test->xpm, strlen(test->xpm)) == 0);
23626         g_free(xpm);
23627 }
23628
23629 int main(int argc, char **argv)
23630 {
23631         g_test_init(&argc, &argv, NULL);
23632
23633         g_test_add_data_func("/teststk/Display Text 1.1.1",
23634                                 &display_text_data_111, test_display_text);
23635         g_test_add_data_func("/teststk/Display Text 1.3.1",
23636                                 &display_text_data_131, test_display_text);
23637         g_test_add_data_func("/teststk/Display Text 1.4.1",
23638                                 &display_text_data_141, test_display_text);
23639         g_test_add_data_func("/teststk/Display Text 1.5.1",
23640                                 &display_text_data_151, test_display_text);
23641         g_test_add_data_func("/teststk/Display Text 1.6.1",
23642                                 &display_text_data_161, test_display_text);
23643         g_test_add_data_func("/teststk/Display Text 1.7.1",
23644                                 &display_text_data_171, test_display_text);
23645         g_test_add_data_func("/teststk/Display Text 5.1.1",
23646                                 &display_text_data_511, test_display_text);
23647         g_test_add_data_func("/teststk/Display Text 5.2.1",
23648                                 &display_text_data_521, test_display_text);
23649         g_test_add_data_func("/teststk/Display Text 5.3.1",
23650                                 &display_text_data_531, test_display_text);
23651         g_test_add_data_func("/teststk/Display Text 6.1.1",
23652                                 &display_text_data_611, test_display_text);
23653         g_test_add_data_func("/teststk/Display Text 7.1.1",
23654                                 &display_text_data_711, test_display_text);
23655         g_test_add_data_func("/teststk/Display Text 8.1.1",
23656                                 &display_text_data_811, test_display_text);
23657         g_test_add_data_func("/teststk/Display Text 8.2.1",
23658                                 &display_text_data_821, test_display_text);
23659         g_test_add_data_func("/teststk/Display Text 8.3.1",
23660                                 &display_text_data_831, test_display_text);
23661         g_test_add_data_func("/teststk/Display Text 8.4.1",
23662                                 &display_text_data_841, test_display_text);
23663         g_test_add_data_func("/teststk/Display Text 8.5.1",
23664                                 &display_text_data_851, test_display_text);
23665         g_test_add_data_func("/teststk/Display Text 8.6.1",
23666                                 &display_text_data_861, test_display_text);
23667         g_test_add_data_func("/teststk/Display Text 8.7.1",
23668                                 &display_text_data_871, test_display_text);
23669         g_test_add_data_func("/teststk/Display Text 8.8.1",
23670                                 &display_text_data_881, test_display_text);
23671         g_test_add_data_func("/teststk/Display Text 8.9.1",
23672                                 &display_text_data_891, test_display_text);
23673         g_test_add_data_func("/teststk/Display Text 9.1.1",
23674                                 &display_text_data_911, test_display_text);
23675         g_test_add_data_func("/teststk/Display Text 10.1.1",
23676                                 &display_text_data_1011, test_display_text);
23677
23678         g_test_add_data_func("/teststk/Display Text response 1.1.1",
23679                                 &display_text_response_data_111,
23680                                 test_terminal_response_encoding);
23681         g_test_add_data_func("/teststk/Display Text response 1.2.1",
23682                                 &display_text_response_data_121,
23683                                 test_terminal_response_encoding);
23684         g_test_add_data_func("/teststk/Display Text response 1.3.1",
23685                                 &display_text_response_data_131,
23686                                 test_terminal_response_encoding);
23687         g_test_add_data_func("/teststk/Display Text response 1.5.1",
23688                                 &display_text_response_data_151,
23689                                 test_terminal_response_encoding);
23690         g_test_add_data_func("/teststk/Display Text response 1.7.1",
23691                                 &display_text_response_data_171,
23692                                 test_terminal_response_encoding);
23693         g_test_add_data_func("/teststk/Display Text response 1.8.1",
23694                                 &display_text_response_data_181,
23695                                 test_terminal_response_encoding);
23696         g_test_add_data_func("/teststk/Display Text response 1.9.1",
23697                                 &display_text_response_data_191,
23698                                 test_terminal_response_encoding);
23699         g_test_add_data_func("/teststk/Display Text response 2.1.1",
23700                                 &display_text_response_data_211,
23701                                 test_terminal_response_encoding);
23702         g_test_add_data_func("/teststk/Display Text response 5.1.1B",
23703                                 &display_text_response_data_511b,
23704                                 test_terminal_response_encoding);
23705
23706         g_test_add_data_func("/teststk/Get Inkey 1.1.1",
23707                                 &get_inkey_data_111, test_get_inkey);
23708         g_test_add_data_func("/teststk/Get Inkey 1.2.1",
23709                                 &get_inkey_data_121, test_get_inkey);
23710         g_test_add_data_func("/teststk/Get Inkey 1.3.1",
23711                                 &get_inkey_data_131, test_get_inkey);
23712         g_test_add_data_func("/teststk/Get Inkey 1.4.1",
23713                                 &get_inkey_data_141, test_get_inkey);
23714         g_test_add_data_func("/teststk/Get Inkey 1.5.1",
23715                                 &get_inkey_data_151, test_get_inkey);
23716         g_test_add_data_func("/teststk/Get Inkey 1.6.1",
23717                                 &get_inkey_data_161, test_get_inkey);
23718         g_test_add_data_func("/teststk/Get Inkey 2.1.1",
23719                                 &get_inkey_data_211, test_get_inkey);
23720         g_test_add_data_func("/teststk/Get Inkey 3.1.1",
23721                                 &get_inkey_data_311, test_get_inkey);
23722         g_test_add_data_func("/teststk/Get Inkey 3.2.1",
23723                                 &get_inkey_data_321, test_get_inkey);
23724         g_test_add_data_func("/teststk/Get Inkey 4.1.1",
23725                                 &get_inkey_data_411, test_get_inkey);
23726         g_test_add_data_func("/teststk/Get Inkey 5.1.1",
23727                                 &get_inkey_data_511, test_get_inkey);
23728         g_test_add_data_func("/teststk/Get Inkey 5.1.2",
23729                                 &get_inkey_data_512, test_get_inkey);
23730         g_test_add_data_func("/teststk/Get Inkey 6.1.1",
23731                                 &get_inkey_data_611, test_get_inkey);
23732         g_test_add_data_func("/teststk/Get Inkey 6.2.1",
23733                                 &get_inkey_data_621, test_get_inkey);
23734         g_test_add_data_func("/teststk/Get Inkey 6.3.1",
23735                                 &get_inkey_data_631, test_get_inkey);
23736         g_test_add_data_func("/teststk/Get Inkey 6.4.1",
23737                                 &get_inkey_data_641, test_get_inkey);
23738         g_test_add_data_func("/teststk/Get Inkey 7.1.1",
23739                                 &get_inkey_data_711, test_get_inkey);
23740         g_test_add_data_func("/teststk/Get Inkey 7.1.2",
23741                                 &get_inkey_data_712, test_get_inkey);
23742         g_test_add_data_func("/teststk/Get Inkey 8.1.1",
23743                                 &get_inkey_data_811, test_get_inkey);
23744         g_test_add_data_func("/teststk/Get Inkey 9.1.1",
23745                                 &get_inkey_data_911, test_get_inkey);
23746         g_test_add_data_func("/teststk/Get Inkey 9.1.2",
23747                                 &get_inkey_data_912, test_get_inkey);
23748         g_test_add_data_func("/teststk/Get Inkey 9.2.1",
23749                                 &get_inkey_data_921, test_get_inkey);
23750         g_test_add_data_func("/teststk/Get Inkey 9.2.2",
23751                                 &get_inkey_data_922, test_get_inkey);
23752         g_test_add_data_func("/teststk/Get Inkey 9.3.1",
23753                                 &get_inkey_data_931, test_get_inkey);
23754         g_test_add_data_func("/teststk/Get Inkey 9.3.2",
23755                                 &get_inkey_data_932, test_get_inkey);
23756         g_test_add_data_func("/teststk/Get Inkey 9.4.1",
23757                                 &get_inkey_data_941, test_get_inkey);
23758         g_test_add_data_func("/teststk/Get Inkey 9.4.2",
23759                                 &get_inkey_data_942, test_get_inkey);
23760         g_test_add_data_func("/teststk/Get Inkey 9.4.3",
23761                                 &get_inkey_data_943, test_get_inkey);
23762         g_test_add_data_func("/teststk/Get Inkey 9.5.1",
23763                                 &get_inkey_data_951, test_get_inkey);
23764         g_test_add_data_func("/teststk/Get Inkey 9.5.2",
23765                                 &get_inkey_data_952, test_get_inkey);
23766         g_test_add_data_func("/teststk/Get Inkey 9.5.3",
23767                                 &get_inkey_data_953, test_get_inkey);
23768         g_test_add_data_func("/teststk/Get Inkey 9.6.1",
23769                                 &get_inkey_data_961, test_get_inkey);
23770         g_test_add_data_func("/teststk/Get Inkey 9.6.2",
23771                                 &get_inkey_data_962, test_get_inkey);
23772         g_test_add_data_func("/teststk/Get Inkey 9.6.3",
23773                                 &get_inkey_data_963, test_get_inkey);
23774         g_test_add_data_func("/teststk/Get Inkey 9.7.1",
23775                                 &get_inkey_data_971, test_get_inkey);
23776         g_test_add_data_func("/teststk/Get Inkey 9.7.2",
23777                                 &get_inkey_data_972, test_get_inkey);
23778         g_test_add_data_func("/teststk/Get Inkey 9.7.3",
23779                                 &get_inkey_data_973, test_get_inkey);
23780         g_test_add_data_func("/teststk/Get Inkey 9.8.1",
23781                                 &get_inkey_data_981, test_get_inkey);
23782         g_test_add_data_func("/teststk/Get Inkey 9.8.2",
23783                                 &get_inkey_data_982, test_get_inkey);
23784         g_test_add_data_func("/teststk/Get Inkey 9.8.3",
23785                                 &get_inkey_data_983, test_get_inkey);
23786         g_test_add_data_func("/teststk/Get Inkey 9.9.1",
23787                                 &get_inkey_data_991, test_get_inkey);
23788         g_test_add_data_func("/teststk/Get Inkey 9.9.2a",
23789                                 &get_inkey_data_992a, test_get_inkey);
23790         g_test_add_data_func("/teststk/Get Inkey 9.9.2b",
23791                                 &get_inkey_data_992b, test_get_inkey);
23792         g_test_add_data_func("/teststk/Get Inkey 9.9.3",
23793                                 &get_inkey_data_993, test_get_inkey);
23794         g_test_add_data_func("/teststk/Get Inkey 9.10.1",
23795                                 &get_inkey_data_9101, test_get_inkey);
23796         g_test_add_data_func("/teststk/Get Inkey 9.10.2",
23797                                 &get_inkey_data_9102, test_get_inkey);
23798         g_test_add_data_func("/teststk/Get Inkey 10.1.1",
23799                                 &get_inkey_data_1011, test_get_inkey);
23800         g_test_add_data_func("/teststk/Get Inkey 10.2.1",
23801                                 &get_inkey_data_1021, test_get_inkey);
23802         g_test_add_data_func("/teststk/Get Inkey 11.1.1",
23803                                 &get_inkey_data_1111, test_get_inkey);
23804         g_test_add_data_func("/teststk/Get Inkey 12.1.1",
23805                                 &get_inkey_data_1211, test_get_inkey);
23806         g_test_add_data_func("/teststk/Get Inkey 12.2.1",
23807                                 &get_inkey_data_1221, test_get_inkey);
23808         g_test_add_data_func("/teststk/Get Inkey 13.1.1",
23809                                 &get_inkey_data_1311, test_get_inkey);
23810
23811         g_test_add_data_func("/teststk/Get Inkey response 1.1.1",
23812                                 &get_inkey_response_data_111,
23813                                 test_terminal_response_encoding);
23814         g_test_add_data_func("/teststk/Get Inkey response 1.2.1",
23815                                 &get_inkey_response_data_121,
23816                                 test_terminal_response_encoding);
23817         g_test_add_data_func("/teststk/Get Inkey response 1.3.1",
23818                                 &get_inkey_response_data_131,
23819                                 test_terminal_response_encoding);
23820         g_test_add_data_func("/teststk/Get Inkey response 1.4.1",
23821                                 &get_inkey_response_data_141,
23822                                 test_terminal_response_encoding);
23823         g_test_add_data_func("/teststk/Get Inkey response 1.5.1",
23824                                 &get_inkey_response_data_151,
23825                                 test_terminal_response_encoding);
23826         g_test_add_data_func("/teststk/Get Inkey response 1.6.1",
23827                                 &get_inkey_response_data_161,
23828                                 test_terminal_response_encoding);
23829         g_test_add_data_func("/teststk/Get Inkey response 2.1.1",
23830                                 &get_inkey_response_data_211,
23831                                 test_terminal_response_encoding);
23832         g_test_add_data_func("/teststk/Get Inkey response 4.1.1",
23833                                 &get_inkey_response_data_411,
23834                                 test_terminal_response_encoding);
23835         g_test_add_data_func("/teststk/Get Inkey response 5.1.1",
23836                                 &get_inkey_response_data_511,
23837                                 test_terminal_response_encoding);
23838         g_test_add_data_func("/teststk/Get Inkey response 5.1.2",
23839                                 &get_inkey_response_data_512,
23840                                 test_terminal_response_encoding);
23841         g_test_add_data_func("/teststk/Get Inkey response 6.1.1B",
23842                                 &get_inkey_response_data_611b,
23843                                 test_terminal_response_encoding);
23844         g_test_add_data_func("/teststk/Get Inkey response 7.1.1",
23845                                 &get_inkey_response_data_711,
23846                                 test_terminal_response_encoding);
23847         g_test_add_data_func("/teststk/Get Inkey response 7.1.2",
23848                                 &get_inkey_response_data_712,
23849                                 test_terminal_response_encoding);
23850         g_test_add_data_func("/teststk/Get Inkey response 8.1.1",
23851                                 &get_inkey_response_data_811,
23852                                 test_terminal_response_encoding);
23853         g_test_add_data_func("/teststk/Get Inkey response 9.1.2",
23854                                 &get_inkey_response_data_912,
23855                                 test_terminal_response_encoding);
23856         g_test_add_data_func("/teststk/Get Inkey response 11.1.1",
23857                                 &get_inkey_response_data_1111,
23858                                 test_terminal_response_encoding);
23859         g_test_add_data_func("/teststk/Get Inkey response 13.1.1",
23860                                 &get_inkey_response_data_1311,
23861                                 test_terminal_response_encoding);
23862
23863         g_test_add_data_func("/teststk/Get Input 1.1.1",
23864                                 &get_input_data_111, test_get_input);
23865         g_test_add_data_func("/teststk/Get Input 1.2.1",
23866                                 &get_input_data_121, test_get_input);
23867         g_test_add_data_func("/teststk/Get Input 1.3.1",
23868                                 &get_input_data_131, test_get_input);
23869         g_test_add_data_func("/teststk/Get Input 1.4.1",
23870                                 &get_input_data_141, test_get_input);
23871         g_test_add_data_func("/teststk/Get Input 1.5.1",
23872                                 &get_input_data_151, test_get_input);
23873         g_test_add_data_func("/teststk/Get Input 1.6.1",
23874                                 &get_input_data_161, test_get_input);
23875         g_test_add_data_func("/teststk/Get Input 1.7.1",
23876                                 &get_input_data_171, test_get_input);
23877         g_test_add_data_func("/teststk/Get Input 1.8.1",
23878                                 &get_input_data_181, test_get_input);
23879         g_test_add_data_func("/teststk/Get Input 1.9.1",
23880                                 &get_input_data_191, test_get_input);
23881         g_test_add_data_func("/teststk/Get Input 1.10.1",
23882                                 &get_input_data_1101, test_get_input);
23883         g_test_add_data_func("/teststk/Get Input 2.1.1",
23884                                 &get_input_data_211, test_get_input);
23885         g_test_add_data_func("/teststk/Get Input 3.1.1",
23886                                 &get_input_data_311, test_get_input);
23887         g_test_add_data_func("/teststk/Get Input 3.2.1",
23888                                 &get_input_data_321, test_get_input);
23889         g_test_add_data_func("/teststk/Get Input 4.1.1",
23890                                 &get_input_data_411, test_get_input);
23891         g_test_add_data_func("/teststk/Get Input 4.2.1",
23892                                 &get_input_data_421, test_get_input);
23893         g_test_add_data_func("/teststk/Get Input 5.1.1",
23894                                 &get_input_data_511, test_get_input);
23895         g_test_add_data_func("/teststk/Get Input 5.2.1",
23896                                 &get_input_data_521, test_get_input);
23897         g_test_add_data_func("/teststk/Get Input 6.1.1",
23898                                 &get_input_data_611, test_get_input);
23899         g_test_add_data_func("/teststk/Get Input 6.2.1",
23900                                 &get_input_data_621, test_get_input);
23901         g_test_add_data_func("/teststk/Get Input 6.3.1",
23902                                 &get_input_data_631, test_get_input);
23903         g_test_add_data_func("/teststk/Get Input 6.4.1",
23904                                 &get_input_data_641, test_get_input);
23905         g_test_add_data_func("/teststk/Get Input 7.1.1",
23906                                 &get_input_data_711, test_get_input);
23907         g_test_add_data_func("/teststk/Get Input 8.1.1",
23908                                 &get_input_data_811, test_get_input);
23909         g_test_add_data_func("/teststk/Get Input 8.1.2",
23910                                 &get_input_data_812, test_get_input);
23911         g_test_add_data_func("/teststk/Get Input 8.2.1",
23912                                 &get_input_data_821, test_get_input);
23913         g_test_add_data_func("/teststk/Get Input 8.2.2",
23914                                 &get_input_data_822, test_get_input);
23915         g_test_add_data_func("/teststk/Get Input 8.3.1",
23916                                 &get_input_data_831, test_get_input);
23917         g_test_add_data_func("/teststk/Get Input 8.3.2",
23918                                 &get_input_data_832, test_get_input);
23919         g_test_add_data_func("/teststk/Get Input 8.4.1",
23920                                 &get_input_data_841, test_get_input);
23921         g_test_add_data_func("/teststk/Get Input 8.4.2",
23922                                 &get_input_data_842, test_get_input);
23923         g_test_add_data_func("/teststk/Get Input 8.4.3",
23924                                 &get_input_data_843, test_get_input);
23925         g_test_add_data_func("/teststk/Get Input 8.5.1",
23926                                 &get_input_data_851, test_get_input);
23927         g_test_add_data_func("/teststk/Get Input 8.5.2",
23928                                 &get_input_data_852, test_get_input);
23929         g_test_add_data_func("/teststk/Get Input 8.5.3",
23930                                 &get_input_data_853, test_get_input);
23931         g_test_add_data_func("/teststk/Get Input 8.6.1",
23932                                 &get_input_data_861, test_get_input);
23933         g_test_add_data_func("/teststk/Get Input 8.6.2",
23934                                 &get_input_data_862, test_get_input);
23935         g_test_add_data_func("/teststk/Get Input 8.6.3",
23936                                 &get_input_data_863, test_get_input);
23937         g_test_add_data_func("/teststk/Get Input 8.7.1",
23938                                 &get_input_data_871, test_get_input);
23939         g_test_add_data_func("/teststk/Get Input 8.7.2",
23940                                 &get_input_data_872, test_get_input);
23941         g_test_add_data_func("/teststk/Get Input 8.7.3",
23942                                 &get_input_data_873, test_get_input);
23943         g_test_add_data_func("/teststk/Get Input 8.8.1",
23944                                 &get_input_data_881, test_get_input);
23945         g_test_add_data_func("/teststk/Get Input 8.8.2",
23946                                 &get_input_data_882, test_get_input);
23947         g_test_add_data_func("/teststk/Get Input 8.8.3",
23948                                 &get_input_data_883, test_get_input);
23949         g_test_add_data_func("/teststk/Get Input 8.9.1",
23950                                 &get_input_data_891, test_get_input);
23951         g_test_add_data_func("/teststk/Get Input 8.9.2",
23952                                 &get_input_data_892, test_get_input);
23953         g_test_add_data_func("/teststk/Get Input 8.9.3",
23954                                 &get_input_data_893, test_get_input);
23955         g_test_add_data_func("/teststk/Get Input 8.10.1",
23956                                 &get_input_data_8101, test_get_input);
23957         g_test_add_data_func("/teststk/Get Input 8.10.2",
23958                                 &get_input_data_8102, test_get_input);
23959         g_test_add_data_func("/teststk/Get Input 9.1.1",
23960                                 &get_input_data_911, test_get_input);
23961         g_test_add_data_func("/teststk/Get Input 9.2.1",
23962                                 &get_input_data_921, test_get_input);
23963         g_test_add_data_func("/teststk/Get Input 10.1.1",
23964                                 &get_input_data_1011, test_get_input);
23965         g_test_add_data_func("/teststk/Get Input 10.2.1",
23966                                 &get_input_data_1021, test_get_input);
23967         g_test_add_data_func("/teststk/Get Input 11.1.1",
23968                                 &get_input_data_1111, test_get_input);
23969         g_test_add_data_func("/teststk/Get Input 11.2.1",
23970                                 &get_input_data_1121, test_get_input);
23971         g_test_add_data_func("/teststk/Get Input 12.1.1",
23972                                 &get_input_data_1211, test_get_input);
23973         g_test_add_data_func("/teststk/Get Input 12.2.1",
23974                                 &get_input_data_1221, test_get_input);
23975
23976         g_test_add_data_func("/teststk/Get Input response 1.1.1",
23977                                 &get_input_response_data_111,
23978                                 test_terminal_response_encoding);
23979         g_test_add_data_func("/teststk/Get Input response 1.2.1",
23980                                 &get_input_response_data_121,
23981                                 test_terminal_response_encoding);
23982         g_test_add_data_func("/teststk/Get Input response 1.3.1",
23983                                 &get_input_response_data_131,
23984                                 test_terminal_response_encoding);
23985         g_test_add_data_func("/teststk/Get Input response 1.4.1",
23986                                 &get_input_response_data_141,
23987                                 test_terminal_response_encoding);
23988         g_test_add_data_func("/teststk/Get Input response 1.5.1",
23989                                 &get_input_response_data_151,
23990                                 test_terminal_response_encoding);
23991         g_test_add_data_func("/teststk/Get Input response 1.6.1",
23992                                 &get_input_response_data_161,
23993                                 test_terminal_response_encoding);
23994         g_test_add_data_func("/teststk/Get Input response 1.7.1",
23995                                 &get_input_response_data_171,
23996                                 test_terminal_response_encoding);
23997         g_test_add_data_func("/teststk/Get Input response 1.8.1",
23998                                 &get_input_response_data_181,
23999                                 test_terminal_response_encoding);
24000         g_test_add_data_func("/teststk/Get Input response 1.9.1",
24001                                 &get_input_response_data_191,
24002                                 test_terminal_response_encoding);
24003         g_test_add_data_func("/teststk/Get Input response 2.1.1",
24004                                 &get_input_response_data_211,
24005                                 test_terminal_response_encoding);
24006         g_test_add_data_func("/teststk/Get Input response 3.1.1",
24007                                 &get_input_response_data_311,
24008                                 test_terminal_response_encoding);
24009         g_test_add_data_func("/teststk/Get Input response 4.1.1",
24010                                 &get_input_response_data_411,
24011                                 test_terminal_response_encoding);
24012         g_test_add_data_func("/teststk/Get Input response 4.2.1",
24013                                 &get_input_response_data_421,
24014                                 test_terminal_response_encoding);
24015         g_test_add_data_func("/teststk/Get Input response 6.1.1A",
24016                                 &get_input_response_data_611a,
24017                                 test_terminal_response_encoding);
24018         g_test_add_data_func("/teststk/Get Input response 6.1.1B",
24019                                 &get_input_response_data_611b,
24020                                 test_terminal_response_encoding);
24021         g_test_add_data_func("/teststk/Get Input response 7.1.1",
24022                                 &get_input_response_data_711,
24023                                 test_terminal_response_encoding);
24024         g_test_add_data_func("/teststk/Get Input response 8.1.2",
24025                                 &get_input_response_data_812,
24026                                 test_terminal_response_encoding);
24027         g_test_add_data_func("/teststk/Get Input response 8.4.3",
24028                                 &get_input_response_data_843,
24029                                 test_terminal_response_encoding);
24030         g_test_add_data_func("/teststk/Get Input response 10.1.1",
24031                                 &get_input_response_data_1011,
24032                                 test_terminal_response_encoding);
24033         g_test_add_data_func("/teststk/Get Input response 10.2.1",
24034                                 &get_input_response_data_1021,
24035                                 test_terminal_response_encoding);
24036         g_test_add_data_func("/teststk/Get Input response 12.1.1",
24037                                 &get_input_response_data_1211,
24038                                 test_terminal_response_encoding);
24039         g_test_add_data_func("/teststk/Get Input response 12.2.1",
24040                                 &get_input_response_data_1221,
24041                                 test_terminal_response_encoding);
24042
24043         g_test_add_data_func("/teststk/More Time 1.1.1",
24044                                 &more_time_data_111, test_more_time);
24045
24046         g_test_add_data_func("/teststk/More Time response 1.1.1",
24047                                 &more_time_response_data_111,
24048                                 test_terminal_response_encoding);
24049
24050         g_test_add_data_func("/teststk/Play Tone 1.1.1",
24051                                 &play_tone_data_111, test_play_tone);
24052         g_test_add_data_func("/teststk/Play Tone 1.1.2",
24053                                 &play_tone_data_112, test_play_tone);
24054         g_test_add_data_func("/teststk/Play Tone 1.1.3",
24055                                 &play_tone_data_113, test_play_tone);
24056         g_test_add_data_func("/teststk/Play Tone 1.1.4",
24057                                 &play_tone_data_114, test_play_tone);
24058         g_test_add_data_func("/teststk/Play Tone 1.1.5",
24059                                 &play_tone_data_115, test_play_tone);
24060         g_test_add_data_func("/teststk/Play Tone 1.1.6",
24061                                 &play_tone_data_116, test_play_tone);
24062         g_test_add_data_func("/teststk/Play Tone 1.1.7",
24063                                 &play_tone_data_117, test_play_tone);
24064         g_test_add_data_func("/teststk/Play Tone 1.1.8",
24065                                 &play_tone_data_118, test_play_tone);
24066         g_test_add_data_func("/teststk/Play Tone 1.1.9",
24067                                 &play_tone_data_119, test_play_tone);
24068         g_test_add_data_func("/teststk/Play Tone 1.1.10",
24069                                 &play_tone_data_1110, test_play_tone);
24070         g_test_add_data_func("/teststk/Play Tone 1.1.11",
24071                                 &play_tone_data_1111, test_play_tone);
24072         g_test_add_data_func("/teststk/Play Tone 1.1.12",
24073                                 &play_tone_data_1112, test_play_tone);
24074         g_test_add_data_func("/teststk/Play Tone 1.1.13",
24075                                 &play_tone_data_1113, test_play_tone);
24076         g_test_add_data_func("/teststk/Play Tone 1.1.14",
24077                                 &play_tone_data_1114, test_play_tone);
24078         g_test_add_data_func("/teststk/Play Tone 1.1.15",
24079                                 &play_tone_data_1115, test_play_tone);
24080         g_test_add_data_func("/teststk/Play Tone 2.1.1",
24081                                 &play_tone_data_211, test_play_tone);
24082         g_test_add_data_func("/teststk/Play Tone 2.1.2",
24083                                 &play_tone_data_212, test_play_tone);
24084         g_test_add_data_func("/teststk/Play Tone 2.1.3",
24085                                 &play_tone_data_213, test_play_tone);
24086         g_test_add_data_func("/teststk/Play Tone 3.1.1",
24087                                 &play_tone_data_311, test_play_tone);
24088         g_test_add_data_func("/teststk/Play Tone 3.2.1",
24089                                 &play_tone_data_321, test_play_tone);
24090         g_test_add_data_func("/teststk/Play Tone 3.3.1",
24091                                 &play_tone_data_331, test_play_tone);
24092         g_test_add_data_func("/teststk/Play Tone 3.4.1",
24093                                 &play_tone_data_341, test_play_tone);
24094         g_test_add_data_func("/teststk/Play Tone 4.1.1",
24095                                 &play_tone_data_411, test_play_tone);
24096         g_test_add_data_func("/teststk/Play Tone 4.1.2",
24097                                 &play_tone_data_412, test_play_tone);
24098         g_test_add_data_func("/teststk/Play Tone 4.2.1",
24099                                 &play_tone_data_421, test_play_tone);
24100         g_test_add_data_func("/teststk/Play Tone 4.2.2",
24101                                 &play_tone_data_422, test_play_tone);
24102         g_test_add_data_func("/teststk/Play Tone 4.3.1",
24103                                 &play_tone_data_431, test_play_tone);
24104         g_test_add_data_func("/teststk/Play Tone 4.3.2",
24105                                 &play_tone_data_432, test_play_tone);
24106         g_test_add_data_func("/teststk/Play Tone 4.4.1",
24107                                 &play_tone_data_441, test_play_tone);
24108         g_test_add_data_func("/teststk/Play Tone 4.4.2",
24109                                 &play_tone_data_442, test_play_tone);
24110         g_test_add_data_func("/teststk/Play Tone 4.4.3",
24111                                 &play_tone_data_443, test_play_tone);
24112         g_test_add_data_func("/teststk/Play Tone 4.5.1",
24113                                 &play_tone_data_451, test_play_tone);
24114         g_test_add_data_func("/teststk/Play Tone 4.5.2",
24115                                 &play_tone_data_452, test_play_tone);
24116         g_test_add_data_func("/teststk/Play Tone 4.5.3",
24117                                 &play_tone_data_453, test_play_tone);
24118         g_test_add_data_func("/teststk/Play Tone 4.6.1",
24119                                 &play_tone_data_461, test_play_tone);
24120         g_test_add_data_func("/teststk/Play Tone 4.6.2",
24121                                 &play_tone_data_462, test_play_tone);
24122         g_test_add_data_func("/teststk/Play Tone 4.6.3",
24123                                 &play_tone_data_463, test_play_tone);
24124         g_test_add_data_func("/teststk/Play Tone 4.7.1",
24125                                 &play_tone_data_471, test_play_tone);
24126         g_test_add_data_func("/teststk/Play Tone 4.7.2",
24127                                 &play_tone_data_472, test_play_tone);
24128         g_test_add_data_func("/teststk/Play Tone 4.7.3",
24129                                 &play_tone_data_473, test_play_tone);
24130         g_test_add_data_func("/teststk/Play Tone 4.8.1",
24131                                 &play_tone_data_481, test_play_tone);
24132         g_test_add_data_func("/teststk/Play Tone 4.8.2",
24133                                 &play_tone_data_482, test_play_tone);
24134         g_test_add_data_func("/teststk/Play Tone 4.8.3",
24135                                 &play_tone_data_483, test_play_tone);
24136         g_test_add_data_func("/teststk/Play Tone 4.9.1",
24137                                 &play_tone_data_491, test_play_tone);
24138         g_test_add_data_func("/teststk/Play Tone 4.9.2",
24139                                 &play_tone_data_492, test_play_tone);
24140         g_test_add_data_func("/teststk/Play Tone 4.9.3",
24141                                 &play_tone_data_493, test_play_tone);
24142         g_test_add_data_func("/teststk/Play Tone 4.10.1",
24143                                 &play_tone_data_4101, test_play_tone);
24144         g_test_add_data_func("/teststk/Play Tone 4.10.2",
24145                                 &play_tone_data_4102, test_play_tone);
24146         g_test_add_data_func("/teststk/Play Tone 5.1.1",
24147                                 &play_tone_data_511, test_play_tone);
24148         g_test_add_data_func("/teststk/Play Tone 5.1.2",
24149                                 &play_tone_data_512, test_play_tone);
24150         g_test_add_data_func("/teststk/Play Tone 5.1.3",
24151                                 &play_tone_data_513, test_play_tone);
24152         g_test_add_data_func("/teststk/Play Tone 6.1.1",
24153                                 &play_tone_data_611, test_play_tone);
24154         g_test_add_data_func("/teststk/Play Tone 6.1.2",
24155                                 &play_tone_data_612, test_play_tone);
24156         g_test_add_data_func("/teststk/Play Tone 6.1.3",
24157                                 &play_tone_data_613, test_play_tone);
24158
24159         g_test_add_data_func("/teststk/Play Tone response 1.1.1",
24160                                 &play_tone_response_data_111,
24161                                 test_terminal_response_encoding);
24162         g_test_add_data_func("/teststk/Play Tone response 1.1.9B",
24163                                 &play_tone_response_data_119b,
24164                                 test_terminal_response_encoding);
24165         g_test_add_data_func("/teststk/Play Tone response 1.1.14",
24166                                 &play_tone_response_data_1114,
24167                                 test_terminal_response_encoding);
24168         g_test_add_data_func("/teststk/Play Tone response 3.1.1B",
24169                                 &play_tone_response_data_311b,
24170                                 test_terminal_response_encoding);
24171
24172         g_test_add_data_func("/teststk/Poll Interval 1.1.1",
24173                                 &poll_interval_data_111, test_poll_interval);
24174
24175         g_test_add_data_func("/teststk/Poll Interval response 1.1.1",
24176                                 &poll_interval_response_data_111,
24177                                 test_terminal_response_encoding);
24178         g_test_add_data_func("/teststk/Poll Interval response 1.1.1A",
24179                                 &poll_interval_response_data_111a,
24180                                 test_terminal_response_encoding);
24181
24182         g_test_add_data_func("/teststk/Setup Menu 1.1.1",
24183                                 &setup_menu_data_111, test_setup_menu);
24184         g_test_add_data_func("/teststk/Setup Menu 1.1.2",
24185                                 &setup_menu_data_112, test_setup_menu);
24186         g_test_add_data_func("/teststk/Setup Menu 1.1.3",
24187                                 &setup_menu_data_113, test_setup_menu);
24188         g_test_add_data_func("/teststk/Setup Menu 1.2.1",
24189                                 &setup_menu_data_121, test_setup_menu);
24190         g_test_add_data_func("/teststk/Setup Menu 1.2.2",
24191                                 &setup_menu_data_122, test_setup_menu);
24192         g_test_add_data_func("/teststk/Setup Menu 1.2.3",
24193                                 &setup_menu_data_123, test_setup_menu);
24194         g_test_add_data_func("/teststk/Setup Menu 2.1.1",
24195                                 &setup_menu_data_211, test_setup_menu);
24196         g_test_add_data_func("/teststk/Setup Menu 3.1.1",
24197                                 &setup_menu_data_311, test_setup_menu);
24198         g_test_add_data_func("/teststk/Setup Menu 4.1.1",
24199                                 &setup_menu_data_411, test_setup_menu);
24200         g_test_add_data_func("/teststk/Setup Menu 4.2.1",
24201                                 &setup_menu_data_421, test_setup_menu);
24202         g_test_add_data_func("/teststk/Setup Menu 5.1.1",
24203                                 &setup_menu_data_511, test_setup_menu);
24204         g_test_add_data_func("/teststk/Setup Menu 6.1.1",
24205                                 &setup_menu_data_611, test_setup_menu);
24206         g_test_add_data_func("/teststk/Setup Menu 6.1.2",
24207                                 &setup_menu_data_612, test_setup_menu);
24208         g_test_add_data_func("/teststk/Setup Menu 6.2.1",
24209                                 &setup_menu_data_621, test_setup_menu);
24210         g_test_add_data_func("/teststk/Setup Menu 6.2.2",
24211                                 &setup_menu_data_622, test_setup_menu);
24212         g_test_add_data_func("/teststk/Setup Menu 6.3.1",
24213                                 &setup_menu_data_631, test_setup_menu);
24214         g_test_add_data_func("/teststk/Setup Menu 6.3.2",
24215                                 &setup_menu_data_632, test_setup_menu);
24216         g_test_add_data_func("/teststk/Setup Menu 6.4.1",
24217                                 &setup_menu_data_641, test_setup_menu);
24218         g_test_add_data_func("/teststk/Setup Menu 6.4.2",
24219                                 &setup_menu_data_642, test_setup_menu);
24220         g_test_add_data_func("/teststk/Setup Menu 6.4.3",
24221                                 &setup_menu_data_643, test_setup_menu);
24222         g_test_add_data_func("/teststk/Setup Menu 6.5.1",
24223                                 &setup_menu_data_651, test_setup_menu);
24224         g_test_add_data_func("/teststk/Setup Menu 6.6.1",
24225                                 &setup_menu_data_661, test_setup_menu);
24226         g_test_add_data_func("/teststk/Setup Menu 6.7.1",
24227                                 &setup_menu_data_671, test_setup_menu);
24228         g_test_add_data_func("/teststk/Setup Menu 6.8.1",
24229                                 &setup_menu_data_681, test_setup_menu);
24230         g_test_add_data_func("/teststk/Setup Menu 6.9.1",
24231                                 &setup_menu_data_691, test_setup_menu);
24232         g_test_add_data_func("/teststk/Setup Menu 6.10.1",
24233                                 &setup_menu_data_6101, test_setup_menu);
24234         g_test_add_data_func("/teststk/Setup Menu 7.1.1",
24235                                 &setup_menu_data_711, test_setup_menu);
24236         g_test_add_data_func("/teststk/Setup Menu 7.1.2",
24237                                 &setup_menu_data_712, test_setup_menu);
24238         g_test_add_data_func("/teststk/Setup Menu 7.1.3",
24239                                 &setup_menu_data_713, test_setup_menu);
24240         g_test_add_data_func("/teststk/Setup Menu 8.1.1",
24241                                 &setup_menu_data_811, test_setup_menu);
24242         g_test_add_data_func("/teststk/Setup Menu 8.1.2",
24243                                 &setup_menu_data_812, test_setup_menu);
24244         g_test_add_data_func("/teststk/Setup Menu 8.1.3",
24245                                 &setup_menu_data_813, test_setup_menu);
24246         g_test_add_data_func("/teststk/Setup Menu 9.1.1",
24247                                 &setup_menu_data_911, test_setup_menu);
24248         g_test_add_data_func("/teststk/Setup Menu 9.1.2",
24249                                 &setup_menu_data_912, test_setup_menu);
24250         g_test_add_data_func("/teststk/Setup Menu 9.1.3",
24251                                 &setup_menu_data_913, test_setup_menu);
24252
24253         g_test_add_data_func("/teststk/Setup Menu Negative 1",
24254                         &setup_menu_data_neg_1, test_setup_menu_missing_val);
24255         g_test_add_data_func("/teststk/Setup Menu Negative 2",
24256                         &setup_menu_data_neg_2, test_setup_menu_neg);
24257         g_test_add_data_func("/teststk/Setup Menu Negative 3",
24258                         &setup_menu_data_neg_3, test_setup_menu_neg);
24259         g_test_add_data_func("/teststk/Setup Menu Negative 4",
24260                         &setup_menu_data_neg_4, test_setup_menu_neg);
24261
24262         g_test_add_data_func("/teststk/Set Up Menu response 1.1.1",
24263                                 &set_up_menu_response_data_111,
24264                                 test_terminal_response_encoding);
24265         g_test_add_data_func("/teststk/Set Up Menu response 4.1.1B",
24266                                 &set_up_menu_response_data_411b,
24267                                 test_terminal_response_encoding);
24268         g_test_add_data_func("/teststk/Set Up Menu response 5.1.1",
24269                                 &set_up_menu_response_data_511,
24270                                 test_terminal_response_encoding);
24271
24272         g_test_add_data_func("/teststk/Select Item 1.1.1",
24273                                 &select_item_data_111, test_select_item);
24274         g_test_add_data_func("/teststk/Select Item 1.2.1",
24275                                 &select_item_data_121, test_select_item);
24276         g_test_add_data_func("/teststk/Select Item 1.3.1",
24277                                 &select_item_data_131, test_select_item);
24278         g_test_add_data_func("/teststk/Select Item 1.4.1",
24279                                 &select_item_data_141, test_select_item);
24280         g_test_add_data_func("/teststk/Select Item 1.5.1",
24281                                 &select_item_data_151, test_select_item);
24282         g_test_add_data_func("/teststk/Select Item 1.6.1",
24283                                 &select_item_data_161, test_select_item);
24284         g_test_add_data_func("/teststk/Select Item 2.1.1",
24285                                 &select_item_data_211, test_select_item);
24286         g_test_add_data_func("/teststk/Select Item 3.1.1",
24287                                 &select_item_data_311, test_select_item);
24288         g_test_add_data_func("/teststk/Select Item 4.1.1",
24289                                 &select_item_data_411, test_select_item);
24290         g_test_add_data_func("/teststk/Select Item 5.1.1",
24291                                 &select_item_data_511, test_select_item);
24292         g_test_add_data_func("/teststk/Select Item 5.2.1",
24293                                 &select_item_data_521, test_select_item);
24294         g_test_add_data_func("/teststk/Select Item 6.1.1",
24295                                 &select_item_data_611, test_select_item);
24296         g_test_add_data_func("/teststk/Select Item 6.2.1",
24297                                 &select_item_data_621, test_select_item);
24298         g_test_add_data_func("/teststk/Select Item 7.1.1",
24299                                 &select_item_data_711, test_select_item);
24300         g_test_add_data_func("/teststk/Select Item 8.1.1",
24301                                 &select_item_data_811, test_select_item);
24302         g_test_add_data_func("/teststk/Select Item 9.1.1",
24303                                 &select_item_data_911, test_select_item);
24304         g_test_add_data_func("/teststk/Select Item 9.1.2",
24305                                 &select_item_data_912, test_select_item);
24306         g_test_add_data_func("/teststk/Select Item 9.2.1",
24307                                 &select_item_data_921, test_select_item);
24308         g_test_add_data_func("/teststk/Select Item 9.2.2",
24309                                 &select_item_data_922, test_select_item);
24310         g_test_add_data_func("/teststk/Select Item 9.3.1",
24311                                 &select_item_data_931, test_select_item);
24312         g_test_add_data_func("/teststk/Select Item 9.3.2",
24313                                 &select_item_data_932, test_select_item);
24314         g_test_add_data_func("/teststk/Select Item 9.4.1",
24315                                 &select_item_data_941, test_select_item);
24316         g_test_add_data_func("/teststk/Select Item 9.4.2",
24317                                 &select_item_data_942, test_select_item);
24318         g_test_add_data_func("/teststk/Select Item 9.4.3",
24319                                 &select_item_data_943, test_select_item);
24320         g_test_add_data_func("/teststk/Select Item 9.5.1",
24321                                 &select_item_data_951, test_select_item);
24322         g_test_add_data_func("/teststk/Select Item 9.5.2",
24323                                 &select_item_data_952, test_select_item);
24324         g_test_add_data_func("/teststk/Select Item 9.5.3",
24325                                 &select_item_data_953, test_select_item);
24326         g_test_add_data_func("/teststk/Select Item 9.6.1",
24327                                 &select_item_data_961, test_select_item);
24328         g_test_add_data_func("/teststk/Select Item 9.6.2",
24329                                 &select_item_data_962, test_select_item);
24330         g_test_add_data_func("/teststk/Select Item 9.6.3",
24331                                 &select_item_data_963, test_select_item);
24332         g_test_add_data_func("/teststk/Select Item 9.7.1",
24333                                 &select_item_data_971, test_select_item);
24334         g_test_add_data_func("/teststk/Select Item 9.7.2",
24335                                 &select_item_data_972, test_select_item);
24336         g_test_add_data_func("/teststk/Select Item 9.7.3",
24337                                 &select_item_data_973, test_select_item);
24338         g_test_add_data_func("/teststk/Select Item 9.8.1",
24339                                 &select_item_data_981, test_select_item);
24340         g_test_add_data_func("/teststk/Select Item 9.8.2",
24341                                 &select_item_data_982, test_select_item);
24342         g_test_add_data_func("/teststk/Select Item 9.8.3",
24343                                 &select_item_data_983, test_select_item);
24344         g_test_add_data_func("/teststk/Select Item 9.9.1",
24345                                 &select_item_data_991, test_select_item);
24346         g_test_add_data_func("/teststk/Select Item 9.9.2",
24347                                 &select_item_data_992, test_select_item);
24348         g_test_add_data_func("/teststk/Select Item 9.9.3",
24349                                 &select_item_data_993, test_select_item);
24350         g_test_add_data_func("/teststk/Select Item 9.10.1",
24351                                 &select_item_data_9101, test_select_item);
24352         g_test_add_data_func("/teststk/Select Item 9.10.2",
24353                                 &select_item_data_9102, test_select_item);
24354         g_test_add_data_func("/teststk/Select Item 10.1.1",
24355                                 &select_item_data_1011, test_select_item);
24356         g_test_add_data_func("/teststk/Select Item 10.2.1",
24357                                 &select_item_data_1021, test_select_item);
24358         g_test_add_data_func("/teststk/Select Item 10.3.1",
24359                                 &select_item_data_1031, test_select_item);
24360         g_test_add_data_func("/teststk/Select Item 11.1.1",
24361                                 &select_item_data_1111, test_select_item);
24362         g_test_add_data_func("/teststk/Select Item 12.1.1",
24363                                 &select_item_data_1211, test_select_item);
24364         g_test_add_data_func("/teststk/Select Item 12.2.1",
24365                                 &select_item_data_1221, test_select_item);
24366         g_test_add_data_func("/teststk/Select Item 12.3.1",
24367                                 &select_item_data_1231, test_select_item);
24368
24369         g_test_add_data_func("/teststk/Select Item response 1.1.1",
24370                                 &select_item_response_data_111,
24371                                 test_terminal_response_encoding);
24372         g_test_add_data_func("/teststk/Select Item response 1.2.1",
24373                                 &select_item_response_data_121,
24374                                 test_terminal_response_encoding);
24375         g_test_add_data_func("/teststk/Select Item response 1.3.1",
24376                                 &select_item_response_data_131,
24377                                 test_terminal_response_encoding);
24378         g_test_add_data_func("/teststk/Select Item response 1.4.1",
24379                                 &select_item_response_data_141,
24380                                 test_terminal_response_encoding);
24381         g_test_add_data_func("/teststk/Select Item response 1.4.2",
24382                                 &select_item_response_data_142,
24383                                 test_terminal_response_encoding);
24384         g_test_add_data_func("/teststk/Select Item response 1.5.1",
24385                                 &select_item_response_data_151,
24386                                 test_terminal_response_encoding);
24387         g_test_add_data_func("/teststk/Select Item response 3.1.1",
24388                                 &select_item_response_data_311,
24389                                 test_terminal_response_encoding);
24390         g_test_add_data_func("/teststk/Select Item response 4.1.1",
24391                                 &select_item_response_data_411,
24392                                 test_terminal_response_encoding);
24393         g_test_add_data_func("/teststk/Select Item response 5.1.1B",
24394                                 &select_item_response_data_511b,
24395                                 test_terminal_response_encoding);
24396         g_test_add_data_func("/teststk/Select Item response 6.1.1",
24397                                 &select_item_response_data_611,
24398                                 test_terminal_response_encoding);
24399         g_test_add_data_func("/teststk/Select Item response 6.2.1",
24400                                 &select_item_response_data_621,
24401                                 test_terminal_response_encoding);
24402         g_test_add_data_func("/teststk/Select Item response 7.1.1",
24403                                 &select_item_response_data_711,
24404                                 test_terminal_response_encoding);
24405         g_test_add_data_func("/teststk/Select Item response 8.1.1",
24406                                 &select_item_response_data_811,
24407                                 test_terminal_response_encoding);
24408
24409         g_test_add_data_func("/teststk/Send SMS 1.1.1",
24410                                 &send_sms_data_111, test_send_sms);
24411         g_test_add_data_func("/teststk/Send SMS 1.2.1",
24412                                 &send_sms_data_121, test_send_sms);
24413         g_test_add_data_func("/teststk/Send SMS 1.3.1",
24414                                 &send_sms_data_131, test_send_sms);
24415         g_test_add_data_func("/teststk/Send SMS 1.4.1",
24416                                 &send_sms_data_141, test_send_sms);
24417         g_test_add_data_func("/teststk/Send SMS 1.5.1",
24418                                 &send_sms_data_151, test_send_sms);
24419         g_test_add_data_func("/teststk/Send SMS 1.6.1",
24420                                 &send_sms_data_161, test_send_sms);
24421         g_test_add_data_func("/teststk/Send SMS 1.7.1",
24422                                 &send_sms_data_171, test_send_sms);
24423         g_test_add_data_func("/teststk/Send SMS 1.8.1",
24424                                 &send_sms_data_181, test_send_sms);
24425         g_test_add_data_func("/teststk/Send SMS 2.1.1",
24426                                 &send_sms_data_211, test_send_sms);
24427         g_test_add_data_func("/teststk/Send SMS 2.1.2",
24428                                 &send_sms_data_212, test_send_sms);
24429         g_test_add_data_func("/teststk/Send SMS 2.1.3",
24430                                 &send_sms_data_213, test_send_sms);
24431         g_test_add_data_func("/teststk/Send SMS 3.1.1",
24432                                 &send_sms_data_311, test_send_sms);
24433         g_test_add_data_func("/teststk/Send SMS 3.2.1",
24434                                 &send_sms_data_321, test_send_sms);
24435         g_test_add_data_func("/teststk/Send SMS 4.1.1",
24436                                 &send_sms_data_411, test_send_sms);
24437         g_test_add_data_func("/teststk/Send SMS 4.1.2",
24438                                 &send_sms_data_412, test_send_sms);
24439         g_test_add_data_func("/teststk/Send SMS 4.2.1",
24440                                 &send_sms_data_421, test_send_sms);
24441         g_test_add_data_func("/teststk/Send SMS 4.2.2",
24442                                 &send_sms_data_422, test_send_sms);
24443         g_test_add_data_func("/teststk/Send SMS 4.3.1",
24444                                 &send_sms_data_431, test_send_sms);
24445         g_test_add_data_func("/teststk/Send SMS 4.3.2",
24446                                 &send_sms_data_432, test_send_sms);
24447         g_test_add_data_func("/teststk/Send SMS 4.4.1",
24448                                 &send_sms_data_441, test_send_sms);
24449         g_test_add_data_func("/teststk/Send SMS 4.4.2",
24450                                 &send_sms_data_442, test_send_sms);
24451         g_test_add_data_func("/teststk/Send SMS 4.4.3",
24452                                 &send_sms_data_443, test_send_sms);
24453         g_test_add_data_func("/teststk/Send SMS 4.5.1",
24454                                 &send_sms_data_451, test_send_sms);
24455         g_test_add_data_func("/teststk/Send SMS 4.5.2",
24456                                 &send_sms_data_452, test_send_sms);
24457         g_test_add_data_func("/teststk/Send SMS 4.5.3",
24458                                 &send_sms_data_453, test_send_sms);
24459         g_test_add_data_func("/teststk/Send SMS 4.6.1",
24460                                 &send_sms_data_461, test_send_sms);
24461         g_test_add_data_func("/teststk/Send SMS 4.6.2",
24462                                 &send_sms_data_462, test_send_sms);
24463         g_test_add_data_func("/teststk/Send SMS 4.6.3",
24464                                 &send_sms_data_463, test_send_sms);
24465         g_test_add_data_func("/teststk/Send SMS 4.7.1",
24466                                 &send_sms_data_471, test_send_sms);
24467         g_test_add_data_func("/teststk/Send SMS 4.7.2",
24468                                 &send_sms_data_472, test_send_sms);
24469         g_test_add_data_func("/teststk/Send SMS 4.7.3",
24470                                 &send_sms_data_473, test_send_sms);
24471         g_test_add_data_func("/teststk/Send SMS 4.8.1",
24472                                 &send_sms_data_481, test_send_sms);
24473         g_test_add_data_func("/teststk/Send SMS 4.8.2",
24474                                 &send_sms_data_482, test_send_sms);
24475         g_test_add_data_func("/teststk/Send SMS 4.8.3",
24476                                 &send_sms_data_483, test_send_sms);
24477         g_test_add_data_func("/teststk/Send SMS 4.9.1",
24478                                 &send_sms_data_491, test_send_sms);
24479         g_test_add_data_func("/teststk/Send SMS 4.9.2",
24480                                 &send_sms_data_492, test_send_sms);
24481         g_test_add_data_func("/teststk/Send SMS 4.9.3",
24482                                 &send_sms_data_493, test_send_sms);
24483         g_test_add_data_func("/teststk/Send SMS 4.10.1",
24484                                 &send_sms_data_4101, test_send_sms);
24485         g_test_add_data_func("/teststk/Send SMS 4.10.2",
24486                                 &send_sms_data_4102, test_send_sms);
24487         g_test_add_data_func("/teststk/Send SMS 5.1.1",
24488                                 &send_sms_data_511, test_send_sms);
24489         g_test_add_data_func("/teststk/Send SMS 5.1.2",
24490                                 &send_sms_data_512, test_send_sms);
24491         g_test_add_data_func("/teststk/Send SMS 5.1.3",
24492                                 &send_sms_data_513, test_send_sms);
24493         g_test_add_data_func("/teststk/Send SMS 6.1.1",
24494                                 &send_sms_data_611, test_send_sms);
24495         g_test_add_data_func("/teststk/Send SMS 6.1.2",
24496                                 &send_sms_data_612, test_send_sms);
24497         g_test_add_data_func("/teststk/Send SMS 6.1.3",
24498                                 &send_sms_data_613, test_send_sms);
24499
24500         g_test_add_data_func("/teststk/Send SS 1.1.1",
24501                                 &send_ss_data_111, test_send_ss);
24502         g_test_add_data_func("/teststk/Send SS 1.4.1",
24503                                 &send_ss_data_141, test_send_ss);
24504         g_test_add_data_func("/teststk/Send SS 1.5.1",
24505                                 &send_ss_data_151, test_send_ss);
24506         g_test_add_data_func("/teststk/Send SS 1.6.1",
24507                                 &send_ss_data_161, test_send_ss);
24508         g_test_add_data_func("/teststk/Send SS 2.1.1",
24509                                 &send_ss_data_211, test_send_ss);
24510         g_test_add_data_func("/teststk/Send SS 2.2.1",
24511                                 &send_ss_data_221, test_send_ss);
24512         g_test_add_data_func("/teststk/Send SS 2.3.1",
24513                                 &send_ss_data_231, test_send_ss);
24514         g_test_add_data_func("/teststk/Send SS 2.4.1",
24515                                 &send_ss_data_241, test_send_ss);
24516         g_test_add_data_func("/teststk/Send SS 3.1.1",
24517                                 &send_ss_data_311, test_send_ss);
24518         g_test_add_data_func("/teststk/Send SS 4.1.1",
24519                                 &send_ss_data_411, test_send_ss);
24520         g_test_add_data_func("/teststk/Send SS 4.1.2",
24521                                 &send_ss_data_412, test_send_ss);
24522         g_test_add_data_func("/teststk/Send SS 4.2.1",
24523                                 &send_ss_data_421, test_send_ss);
24524         g_test_add_data_func("/teststk/Send SS 4.2.2",
24525                                 &send_ss_data_422, test_send_ss);
24526         g_test_add_data_func("/teststk/Send SS 4.3.1",
24527                                 &send_ss_data_431, test_send_ss);
24528         g_test_add_data_func("/teststk/Send SS 4.3.2",
24529                                 &send_ss_data_432, test_send_ss);
24530         g_test_add_data_func("/teststk/Send SS 4.4.1",
24531                                 &send_ss_data_441, test_send_ss);
24532         g_test_add_data_func("/teststk/Send SS 4.4.2",
24533                                 &send_ss_data_442, test_send_ss);
24534         g_test_add_data_func("/teststk/Send SS 4.4.3",
24535                                 &send_ss_data_443, test_send_ss);
24536         g_test_add_data_func("/teststk/Send SS 4.5.1",
24537                                 &send_ss_data_451, test_send_ss);
24538         g_test_add_data_func("/teststk/Send SS 4.5.2",
24539                                 &send_ss_data_452, test_send_ss);
24540         g_test_add_data_func("/teststk/Send SS 4.5.3",
24541                                 &send_ss_data_453, test_send_ss);
24542         g_test_add_data_func("/teststk/Send SS 4.6.1",
24543                                 &send_ss_data_461, test_send_ss);
24544         g_test_add_data_func("/teststk/Send SS 4.6.2",
24545                                 &send_ss_data_462, test_send_ss);
24546         g_test_add_data_func("/teststk/Send SS 4.6.3",
24547                                 &send_ss_data_463, test_send_ss);
24548         g_test_add_data_func("/teststk/Send SS 4.7.1",
24549                                 &send_ss_data_471, test_send_ss);
24550         g_test_add_data_func("/teststk/Send SS 4.7.2",
24551                                 &send_ss_data_472, test_send_ss);
24552         g_test_add_data_func("/teststk/Send SS 4.7.3",
24553                                 &send_ss_data_473, test_send_ss);
24554         g_test_add_data_func("/teststk/Send SS 4.8.1",
24555                                 &send_ss_data_481, test_send_ss);
24556         g_test_add_data_func("/teststk/Send SS 4.8.2",
24557                                 &send_ss_data_482, test_send_ss);
24558         g_test_add_data_func("/teststk/Send SS 4.8.3",
24559                                 &send_ss_data_483, test_send_ss);
24560         g_test_add_data_func("/teststk/Send SS 4.9.1",
24561                                 &send_ss_data_491, test_send_ss);
24562         g_test_add_data_func("/teststk/Send SS 4.9.2",
24563                                 &send_ss_data_492, test_send_ss);
24564         g_test_add_data_func("/teststk/Send SS 4.9.3",
24565                                 &send_ss_data_493, test_send_ss);
24566         g_test_add_data_func("/teststk/Send SS 4.10.1",
24567                                 &send_ss_data_4101, test_send_ss);
24568         g_test_add_data_func("/teststk/Send SS 4.10.2",
24569                                 &send_ss_data_4102, test_send_ss);
24570         g_test_add_data_func("/teststk/Send SS 5.1.1",
24571                                 &send_ss_data_511, test_send_ss);
24572         g_test_add_data_func("/teststk/Send SS 6.1.1",
24573                                 &send_ss_data_611, test_send_ss);
24574
24575         g_test_add_data_func("/teststk/Send USSD 1.1.1",
24576                                 &send_ussd_data_111, test_send_ussd);
24577         g_test_add_data_func("/teststk/Send USSD 1.2.1",
24578                                 &send_ussd_data_121, test_send_ussd);
24579         g_test_add_data_func("/teststk/Send USSD 1.3.1",
24580                                 &send_ussd_data_131, test_send_ussd);
24581         g_test_add_data_func("/teststk/Send USSD 1.6.1",
24582                                 &send_ussd_data_161, test_send_ussd);
24583         g_test_add_data_func("/teststk/Send USSD 1.7.1",
24584                                 &send_ussd_data_171, test_send_ussd);
24585         g_test_add_data_func("/teststk/Send USSD 1.8.1",
24586                                 &send_ussd_data_181, test_send_ussd);
24587         g_test_add_data_func("/teststk/Send USSD 2.1.1",
24588                                 &send_ussd_data_211, test_send_ussd);
24589         g_test_add_data_func("/teststk/Send USSD 2.2.1",
24590                                 &send_ussd_data_221, test_send_ussd);
24591         g_test_add_data_func("/teststk/Send USSD 2.3.1",
24592                                 &send_ussd_data_231, test_send_ussd);
24593         g_test_add_data_func("/teststk/Send USSD 2.4.1",
24594                                 &send_ussd_data_241, test_send_ussd);
24595         g_test_add_data_func("/teststk/Send USSD 3.1.1",
24596                                 &send_ussd_data_311, test_send_ussd);
24597         g_test_add_data_func("/teststk/Send USSD 4.1.1",
24598                                 &send_ussd_data_411, test_send_ussd);
24599         g_test_add_data_func("/teststk/Send USSD 4.1.2",
24600                                 &send_ussd_data_412, test_send_ussd);
24601         g_test_add_data_func("/teststk/Send USSD 4.2.1",
24602                                 &send_ussd_data_421, test_send_ussd);
24603         g_test_add_data_func("/teststk/Send USSD 4.2.2",
24604                                 &send_ussd_data_422, test_send_ussd);
24605         g_test_add_data_func("/teststk/Send USSD 4.3.1",
24606                                 &send_ussd_data_431, test_send_ussd);
24607         g_test_add_data_func("/teststk/Send USSD 4.3.2",
24608                                 &send_ussd_data_432, test_send_ussd);
24609         g_test_add_data_func("/teststk/Send USSD 4.4.1",
24610                                 &send_ussd_data_441, test_send_ussd);
24611         g_test_add_data_func("/teststk/Send USSD 4.4.2",
24612                                 &send_ussd_data_442, test_send_ussd);
24613         g_test_add_data_func("/teststk/Send USSD 4.4.3",
24614                                 &send_ussd_data_443, test_send_ussd);
24615         g_test_add_data_func("/teststk/Send USSD 4.5.1",
24616                                 &send_ussd_data_451, test_send_ussd);
24617         g_test_add_data_func("/teststk/Send USSD 4.5.2",
24618                                 &send_ussd_data_452, test_send_ussd);
24619         g_test_add_data_func("/teststk/Send USSD 4.5.3",
24620                                 &send_ussd_data_453, test_send_ussd);
24621         g_test_add_data_func("/teststk/Send USSD 4.6.1",
24622                                 &send_ussd_data_461, test_send_ussd);
24623         g_test_add_data_func("/teststk/Send USSD 4.6.2",
24624                                 &send_ussd_data_462, test_send_ussd);
24625         g_test_add_data_func("/teststk/Send USSD 4.6.3",
24626                                 &send_ussd_data_463, test_send_ussd);
24627         g_test_add_data_func("/teststk/Send USSD 4.7.1",
24628                                 &send_ussd_data_471, test_send_ussd);
24629         g_test_add_data_func("/teststk/Send USSD 4.7.2",
24630                                 &send_ussd_data_472, test_send_ussd);
24631         g_test_add_data_func("/teststk/Send USSD 4.7.3",
24632                                 &send_ussd_data_473, test_send_ussd);
24633         g_test_add_data_func("/teststk/Send USSD 4.8.1",
24634                                 &send_ussd_data_481, test_send_ussd);
24635         g_test_add_data_func("/teststk/Send USSD 4.8.2",
24636                                 &send_ussd_data_482, test_send_ussd);
24637         g_test_add_data_func("/teststk/Send USSD 4.8.3",
24638                                 &send_ussd_data_483, test_send_ussd);
24639         g_test_add_data_func("/teststk/Send USSD 4.9.1",
24640                                 &send_ussd_data_491, test_send_ussd);
24641         g_test_add_data_func("/teststk/Send USSD 4.9.2",
24642                                 &send_ussd_data_492, test_send_ussd);
24643         g_test_add_data_func("/teststk/Send USSD 4.9.3",
24644                                 &send_ussd_data_493, test_send_ussd);
24645         g_test_add_data_func("/teststk/Send USSD 4.10.1",
24646                                 &send_ussd_data_4101, test_send_ussd);
24647         g_test_add_data_func("/teststk/Send USSD 4.10.2",
24648                                 &send_ussd_data_4102, test_send_ussd);
24649         g_test_add_data_func("/teststk/Send USSD 5.1.1",
24650                                 &send_ussd_data_511, test_send_ussd);
24651         g_test_add_data_func("/teststk/Send USSD 6.1.1",
24652                                 &send_ussd_data_611, test_send_ussd);
24653
24654         g_test_add_data_func("/teststk/Send SMS response 1.1.1",
24655                                 &send_sms_response_data_111,
24656                                 test_terminal_response_encoding);
24657         g_test_add_data_func("/teststk/Send SMS response 1.2.1",
24658                                 &send_sms_response_data_121,
24659                                 test_terminal_response_encoding);
24660         g_test_add_data_func("/teststk/Send SMS response 3.1.1B",
24661                                 &send_sms_response_data_311b,
24662                                 test_terminal_response_encoding);
24663
24664         g_test_add_data_func("/teststk/Setup Call 1.1.1",
24665                                 &setup_call_data_111, test_setup_call);
24666         g_test_add_data_func("/teststk/Setup Call 1.4.1",
24667                                 &setup_call_data_141, test_setup_call);
24668         g_test_add_data_func("/teststk/Setup Call 1.5.1",
24669                                 &setup_call_data_151, test_setup_call);
24670         g_test_add_data_func("/teststk/Setup Call 1.8.1",
24671                                 &setup_call_data_181, test_setup_call);
24672         g_test_add_data_func("/teststk/Setup Call 1.9.1",
24673                                 &setup_call_data_191, test_setup_call);
24674         g_test_add_data_func("/teststk/Setup Call 1.10.1",
24675                                 &setup_call_data_1101, test_setup_call);
24676         g_test_add_data_func("/teststk/Setup Call 1.11.1",
24677                                 &setup_call_data_1111, test_setup_call);
24678         g_test_add_data_func("/teststk/Setup Call 1.12.1",
24679                                 &setup_call_data_1121, test_setup_call);
24680         g_test_add_data_func("/teststk/Setup Call 2.1.1",
24681                                 &setup_call_data_211, test_setup_call);
24682         g_test_add_data_func("/teststk/Setup Call 3.1.1",
24683                                 &setup_call_data_311, test_setup_call);
24684         g_test_add_data_func("/teststk/Setup Call 3.2.1",
24685                                 &setup_call_data_321, test_setup_call);
24686         g_test_add_data_func("/teststk/Setup Call 3.3.1",
24687                                 &setup_call_data_331, test_setup_call);
24688         g_test_add_data_func("/teststk/Setup Call 3.4.1",
24689                                 &setup_call_data_341, test_setup_call);
24690         g_test_add_data_func("/teststk/Setup Call 4.1.1",
24691                                 &setup_call_data_411, test_setup_call);
24692         g_test_add_data_func("/teststk/Setup Call 4.1.2",
24693                                 &setup_call_data_412, test_setup_call);
24694         g_test_add_data_func("/teststk/Setup Call 4.2.1",
24695                                 &setup_call_data_421, test_setup_call);
24696         g_test_add_data_func("/teststk/Setup Call 4.2.2",
24697                                 &setup_call_data_422, test_setup_call);
24698         g_test_add_data_func("/teststk/Setup Call 4.3.1",
24699                                 &setup_call_data_431, test_setup_call);
24700         g_test_add_data_func("/teststk/Setup Call 4.3.2",
24701                                 &setup_call_data_432, test_setup_call);
24702         g_test_add_data_func("/teststk/Setup Call 4.4.1",
24703                                 &setup_call_data_441, test_setup_call);
24704         g_test_add_data_func("/teststk/Setup Call 4.4.2",
24705                                 &setup_call_data_442, test_setup_call);
24706         g_test_add_data_func("/teststk/Setup Call 4.4.3",
24707                                 &setup_call_data_443, test_setup_call);
24708         g_test_add_data_func("/teststk/Setup Call 4.5.1",
24709                                 &setup_call_data_451, test_setup_call);
24710         g_test_add_data_func("/teststk/Setup Call 4.5.2",
24711                                 &setup_call_data_452, test_setup_call);
24712         g_test_add_data_func("/teststk/Setup Call 4.5.3",
24713                                 &setup_call_data_453, test_setup_call);
24714         g_test_add_data_func("/teststk/Setup Call 4.6.1",
24715                                 &setup_call_data_461, test_setup_call);
24716         g_test_add_data_func("/teststk/Setup Call 4.6.2",
24717                                 &setup_call_data_462, test_setup_call);
24718         g_test_add_data_func("/teststk/Setup Call 4.6.3",
24719                                 &setup_call_data_463, test_setup_call);
24720         g_test_add_data_func("/teststk/Setup Call 4.7.1",
24721                                 &setup_call_data_471, test_setup_call);
24722         g_test_add_data_func("/teststk/Setup Call 4.7.2",
24723                                 &setup_call_data_472, test_setup_call);
24724         g_test_add_data_func("/teststk/Setup Call 4.7.3",
24725                                 &setup_call_data_473, test_setup_call);
24726         g_test_add_data_func("/teststk/Setup Call 4.8.1",
24727                                 &setup_call_data_481, test_setup_call);
24728         g_test_add_data_func("/teststk/Setup Call 4.8.2",
24729                                 &setup_call_data_482, test_setup_call);
24730         g_test_add_data_func("/teststk/Setup Call 4.8.3",
24731                                 &setup_call_data_483, test_setup_call);
24732         g_test_add_data_func("/teststk/Setup Call 4.9.1",
24733                                 &setup_call_data_491, test_setup_call);
24734         g_test_add_data_func("/teststk/Setup Call 4.9.2",
24735                                 &setup_call_data_492, test_setup_call);
24736         g_test_add_data_func("/teststk/Setup Call 4.9.3",
24737                                 &setup_call_data_493, test_setup_call);
24738         g_test_add_data_func("/teststk/Setup Call 4.10.1",
24739                                 &setup_call_data_4101, test_setup_call);
24740         g_test_add_data_func("/teststk/Setup Call 4.10.2",
24741                                 &setup_call_data_4102, test_setup_call);
24742         g_test_add_data_func("/teststk/Setup Call 5.1.1",
24743                                 &setup_call_data_511, test_setup_call);
24744         g_test_add_data_func("/teststk/Setup Call 5.2.1",
24745                                 &setup_call_data_521, test_setup_call);
24746         g_test_add_data_func("/teststk/Setup Call 6.1.1",
24747                                 &setup_call_data_611, test_setup_call);
24748         g_test_add_data_func("/teststk/Setup Call 6.2.1",
24749                                 &setup_call_data_621, test_setup_call);
24750         g_test_add_data_func("/teststk/Setup Call 7.1.1",
24751                                 &setup_call_data_711, test_setup_call);
24752         g_test_add_data_func("/teststk/Setup Call 7.2.1",
24753                                 &setup_call_data_721, test_setup_call);
24754
24755         g_test_add_data_func("/teststk/Set Up Call response 1.1.1",
24756                                 &set_up_call_response_data_111,
24757                                 test_terminal_response_encoding);
24758         g_test_add_data_func("/teststk/Set Up Call response 1.2.1",
24759                                 &set_up_call_response_data_121,
24760                                 test_terminal_response_encoding);
24761         g_test_add_data_func("/teststk/Set Up Call response 1.4.1",
24762                                 &set_up_call_response_data_141,
24763                                 test_terminal_response_encoding);
24764         g_test_add_data_func("/teststk/Set Up Call response 1.5.1",
24765                                 &set_up_call_response_data_151,
24766                                 test_terminal_response_encoding);
24767         g_test_add_data_func("/teststk/Set Up Call response 1.6.1",
24768                                 &set_up_call_response_data_161,
24769                                 test_terminal_response_encoding);
24770         g_test_add_data_func("/teststk/Set Up Call response 1.7.1A",
24771                                 &set_up_call_response_data_171a,
24772                                 test_terminal_response_encoding);
24773         g_test_add_data_func("/teststk/Set Up Call response 1.7.1B",
24774                                 &set_up_call_response_data_171b,
24775                                 test_terminal_response_encoding);
24776         g_test_add_data_func("/teststk/Set Up Call response 1.10.1",
24777                                 &set_up_call_response_data_1101,
24778                                 test_terminal_response_encoding);
24779         g_test_add_data_func("/teststk/Set Up Call response 1.11.1B",
24780                                 &set_up_call_response_data_1111b,
24781                                 test_terminal_response_encoding);
24782         g_test_add_data_func("/teststk/Set Up Call response 1.12.1",
24783                                 &set_up_call_response_data_1121,
24784                                 test_terminal_response_encoding);
24785         g_test_add_data_func("/teststk/Set Up Call response 3.1.1B",
24786                                 &set_up_call_response_data_311b,
24787                                 test_terminal_response_encoding);
24788
24789         g_test_add_data_func("/teststk/Refresh 1.2.1",
24790                                 &refresh_data_121, test_refresh);
24791         g_test_add_data_func("/teststk/Refresh 1.5.1",
24792                                 &refresh_data_151, test_refresh);
24793
24794         g_test_add_data_func("/teststk/Refresh response 1.1.1A",
24795                                 &refresh_response_data_111a,
24796                                 test_terminal_response_encoding);
24797         g_test_add_data_func("/teststk/Refresh response 1.1.1B",
24798                                 &refresh_response_data_111b,
24799                                 test_terminal_response_encoding);
24800         g_test_add_data_func("/teststk/Refresh response 1.2.1A",
24801                                 &refresh_response_data_121a,
24802                                 test_terminal_response_encoding);
24803         g_test_add_data_func("/teststk/Refresh response 1.2.1B",
24804                                 &refresh_response_data_121b,
24805                                 test_terminal_response_encoding);
24806         g_test_add_data_func("/teststk/Refresh response 1.3.1A",
24807                                 &refresh_response_data_131a,
24808                                 test_terminal_response_encoding);
24809         g_test_add_data_func("/teststk/Refresh response 1.3.1B",
24810                                 &refresh_response_data_141b,
24811                                 test_terminal_response_encoding);
24812         g_test_add_data_func("/teststk/Refresh response 1.4.1A",
24813                                 &refresh_response_data_141a,
24814                                 test_terminal_response_encoding);
24815         g_test_add_data_func("/teststk/Refresh response 1.4.1B",
24816                                 &refresh_response_data_141b,
24817                                 test_terminal_response_encoding);
24818         g_test_add_data_func("/teststk/Refresh response 1.7.1",
24819                                 &refresh_response_data_171,
24820                                 test_terminal_response_encoding);
24821         g_test_add_data_func("/teststk/Refresh response 2.4.1A",
24822                                 &refresh_response_data_241a,
24823                                 test_terminal_response_encoding);
24824         g_test_add_data_func("/teststk/Refresh response 2.4.1B",
24825                                 &refresh_response_data_241b,
24826                                 test_terminal_response_encoding);
24827         g_test_add_data_func("/teststk/Refresh response 3.1.1",
24828                                 &refresh_response_data_311,
24829                                 test_terminal_response_encoding);
24830         g_test_add_data_func("/teststk/Refresh response 3.1.2",
24831                                 &refresh_response_data_312,
24832                                 test_terminal_response_encoding);
24833
24834         g_test_add_data_func("/teststk/Polling off 1.1.2",
24835                                 &polling_off_data_112, test_polling_off);
24836
24837         g_test_add_data_func("/teststk/Polling off response 1.1.2",
24838                                 &polling_off_response_data_112,
24839                                 test_terminal_response_encoding);
24840
24841         g_test_add_data_func("/teststk/Provide Local Info 1.2.1",
24842                         &provide_local_info_data_121, test_provide_local_info);
24843         g_test_add_data_func("/teststk/Provide Local Info 1.4.1",
24844                         &provide_local_info_data_141, test_provide_local_info);
24845         g_test_add_data_func("/teststk/Provide Local Info 1.5.1",
24846                         &provide_local_info_data_151, test_provide_local_info);
24847         g_test_add_data_func("/teststk/Provide Local Info 1.8.1",
24848                         &provide_local_info_data_181, test_provide_local_info);
24849         g_test_add_data_func("/teststk/Provide Local Info 1.9.1",
24850                         &provide_local_info_data_191, test_provide_local_info);
24851         g_test_add_data_func("/teststk/Provide Local Info 1.11.1",
24852                         &provide_local_info_data_1111, test_provide_local_info);
24853
24854         g_test_add_data_func("/teststk/Provide Local Info response 1.1.1A",
24855                         &provide_local_info_response_data_111a,
24856                         test_terminal_response_encoding);
24857         g_test_add_data_func("/teststk/Provide Local Info response 1.1.1B",
24858                         &provide_local_info_response_data_111b,
24859                         test_terminal_response_encoding);
24860         g_test_add_data_func("/teststk/Provide Local Info response 1.2.1",
24861                         &provide_local_info_response_data_121,
24862                         test_terminal_response_encoding);
24863         g_test_add_data_func("/teststk/Provide Local Info response 1.3.1",
24864                         &provide_local_info_response_data_131,
24865                         test_terminal_response_encoding);
24866         g_test_add_data_func("/teststk/Provide Local Info response 1.4.1",
24867                         &provide_local_info_response_data_141,
24868                         test_terminal_response_encoding);
24869         g_test_add_data_func("/teststk/Provide Local Info response 1.5.1",
24870                         &provide_local_info_response_data_151,
24871                         test_terminal_response_encoding);
24872         g_test_add_data_func("/teststk/Provide Local Info response 1.6.1",
24873                         &provide_local_info_response_data_161,
24874                         test_terminal_response_encoding);
24875         g_test_add_data_func("/teststk/Provide Local Info response 1.7.1",
24876                         &provide_local_info_response_data_171,
24877                         test_terminal_response_encoding);
24878         g_test_add_data_func("/teststk/Provide Local Info response 1.8.1",
24879                         &provide_local_info_response_data_181,
24880                         test_terminal_response_encoding);
24881         g_test_add_data_func("/teststk/Provide Local Info response 1.9.1",
24882                         &provide_local_info_response_data_191,
24883                         test_terminal_response_encoding);
24884         g_test_add_data_func("/teststk/Provide Local Info response 1.11.1",
24885                         &provide_local_info_response_data_1111,
24886                         test_terminal_response_encoding);
24887         g_test_add_data_func("/teststk/Provide Local Info response 1.12.1",
24888                         &provide_local_info_response_data_1121,
24889                         test_terminal_response_encoding);
24890         g_test_add_data_func("/teststk/Provide Local Info response 1.13.1",
24891                         &provide_local_info_response_data_1131,
24892                         test_terminal_response_encoding);
24893         g_test_add_data_func("/teststk/Provide Local Info response 1.14.1",
24894                         &provide_local_info_response_data_1141,
24895                         test_terminal_response_encoding);
24896         g_test_add_data_func("/teststk/Provide Local Info response 1.15.1",
24897                         &provide_local_info_response_data_1151,
24898                         test_terminal_response_encoding);
24899         g_test_add_data_func("/teststk/Provide Local Info response 1.16.1",
24900                         &provide_local_info_response_data_1161,
24901                         test_terminal_response_encoding);
24902         g_test_add_data_func("/teststk/Provide Local Info response 1.17.1",
24903                         &provide_local_info_response_data_1171,
24904                         test_terminal_response_encoding);
24905
24906         g_test_add_data_func("/teststk/Setup Event List 1.1.1",
24907                         &setup_event_list_data_111, test_setup_event_list);
24908         g_test_add_data_func("/teststk/Setup Event List 1.2.1",
24909                         &setup_event_list_data_121, test_setup_event_list);
24910         g_test_add_data_func("/teststk/Setup Event List 1.2.2",
24911                         &setup_event_list_data_122, test_setup_event_list);
24912         g_test_add_data_func("/teststk/Setup Event List 1.3.1",
24913                         &setup_event_list_data_131, test_setup_event_list);
24914         g_test_add_data_func("/teststk/Setup Event List 1.3.2",
24915                         &setup_event_list_data_132, test_setup_event_list);
24916         g_test_add_data_func("/teststk/Setup Event List 1.4.1",
24917                         &setup_event_list_data_141, test_setup_event_list);
24918
24919         g_test_add_data_func("/teststk/Set Up Event List response 1.1.1",
24920                         &set_up_event_list_response_data_111,
24921                         test_terminal_response_encoding);
24922
24923         g_test_add_data_func("/teststk/Perform Card APDU 1.1.1",
24924                         &perform_card_apdu_data_111, test_perform_card_apdu);
24925         g_test_add_data_func("/teststk/Perform Card APDU 1.1.2",
24926                         &perform_card_apdu_data_112, test_perform_card_apdu);
24927         g_test_add_data_func("/teststk/Perform Card APDU 1.2.1",
24928                         &perform_card_apdu_data_121, test_perform_card_apdu);
24929         g_test_add_data_func("/teststk/Perform Card APDU 1.2.2",
24930                         &perform_card_apdu_data_122, test_perform_card_apdu);
24931         g_test_add_data_func("/teststk/Perform Card APDU 1.2.3",
24932                         &perform_card_apdu_data_123, test_perform_card_apdu);
24933         g_test_add_data_func("/teststk/Perform Card APDU 1.2.4",
24934                         &perform_card_apdu_data_124, test_perform_card_apdu);
24935         g_test_add_data_func("/teststk/Perform Card APDU 1.2.5",
24936                         &perform_card_apdu_data_125, test_perform_card_apdu);
24937         g_test_add_data_func("/teststk/Perform Card APDU 1.5.1",
24938                         &perform_card_apdu_data_151, test_perform_card_apdu);
24939         g_test_add_data_func("/teststk/Perform Card APDU 2.1.1",
24940                         &perform_card_apdu_data_211, test_perform_card_apdu);
24941
24942         g_test_add_data_func("/teststk/Get Reader Status 1.1.1",
24943                         &get_reader_status_data_111, test_get_reader_status);
24944
24945         g_test_add_data_func("/teststk/Timer Management 1.1.1",
24946                         &timer_mgmt_data_111, test_timer_mgmt);
24947         g_test_add_data_func("/teststk/Timer Management 1.1.2",
24948                         &timer_mgmt_data_112, test_timer_mgmt);
24949         g_test_add_data_func("/teststk/Timer Management 1.1.3",
24950                         &timer_mgmt_data_113, test_timer_mgmt);
24951         g_test_add_data_func("/teststk/Timer Management 1.1.4",
24952                         &timer_mgmt_data_114, test_timer_mgmt);
24953         g_test_add_data_func("/teststk/Timer Management 1.2.1",
24954                         &timer_mgmt_data_121, test_timer_mgmt);
24955         g_test_add_data_func("/teststk/Timer Management 1.2.2",
24956                         &timer_mgmt_data_122, test_timer_mgmt);
24957         g_test_add_data_func("/teststk/Timer Management 1.2.3",
24958                         &timer_mgmt_data_123, test_timer_mgmt);
24959         g_test_add_data_func("/teststk/Timer Management 1.2.4",
24960                         &timer_mgmt_data_124, test_timer_mgmt);
24961         g_test_add_data_func("/teststk/Timer Management 1.3.1",
24962                         &timer_mgmt_data_131, test_timer_mgmt);
24963         g_test_add_data_func("/teststk/Timer Management 1.3.2",
24964                         &timer_mgmt_data_132, test_timer_mgmt);
24965         g_test_add_data_func("/teststk/Timer Management 1.3.3",
24966                         &timer_mgmt_data_133, test_timer_mgmt);
24967         g_test_add_data_func("/teststk/Timer Management 1.3.4",
24968                         &timer_mgmt_data_134, test_timer_mgmt);
24969         g_test_add_data_func("/teststk/Timer Management 1.4.1",
24970                         &timer_mgmt_data_141, test_timer_mgmt);
24971         g_test_add_data_func("/teststk/Timer Management 1.4.2",
24972                         &timer_mgmt_data_142, test_timer_mgmt);
24973         g_test_add_data_func("/teststk/Timer Management 1.4.3",
24974                         &timer_mgmt_data_143, test_timer_mgmt);
24975         g_test_add_data_func("/teststk/Timer Management 1.4.4",
24976                         &timer_mgmt_data_144, test_timer_mgmt);
24977         g_test_add_data_func("/teststk/Timer Management 1.4.5",
24978                         &timer_mgmt_data_145, test_timer_mgmt);
24979         g_test_add_data_func("/teststk/Timer Management 1.4.6",
24980                         &timer_mgmt_data_146, test_timer_mgmt);
24981         g_test_add_data_func("/teststk/Timer Management 1.4.7",
24982                         &timer_mgmt_data_147, test_timer_mgmt);
24983         g_test_add_data_func("/teststk/Timer Management 1.4.8",
24984                         &timer_mgmt_data_148, test_timer_mgmt);
24985         g_test_add_data_func("/teststk/Timer Management 1.5.1",
24986                         &timer_mgmt_data_151, test_timer_mgmt);
24987         g_test_add_data_func("/teststk/Timer Management 1.5.2",
24988                         &timer_mgmt_data_152, test_timer_mgmt);
24989         g_test_add_data_func("/teststk/Timer Management 1.5.3",
24990                         &timer_mgmt_data_153, test_timer_mgmt);
24991         g_test_add_data_func("/teststk/Timer Management 1.5.4",
24992                         &timer_mgmt_data_154, test_timer_mgmt);
24993         g_test_add_data_func("/teststk/Timer Management 1.5.5",
24994                         &timer_mgmt_data_155, test_timer_mgmt);
24995         g_test_add_data_func("/teststk/Timer Management 1.5.6",
24996                         &timer_mgmt_data_156, test_timer_mgmt);
24997         g_test_add_data_func("/teststk/Timer Management 1.5.7",
24998                         &timer_mgmt_data_157, test_timer_mgmt);
24999         g_test_add_data_func("/teststk/Timer Management 1.5.8",
25000                         &timer_mgmt_data_158, test_timer_mgmt);
25001         g_test_add_data_func("/teststk/Timer Management 1.6.1",
25002                         &timer_mgmt_data_161, test_timer_mgmt);
25003         g_test_add_data_func("/teststk/Timer Management 1.6.2",
25004                         &timer_mgmt_data_162, test_timer_mgmt);
25005         g_test_add_data_func("/teststk/Timer Management 1.6.3",
25006                         &timer_mgmt_data_163, test_timer_mgmt);
25007         g_test_add_data_func("/teststk/Timer Management 1.6.4",
25008                         &timer_mgmt_data_164, test_timer_mgmt);
25009         g_test_add_data_func("/teststk/Timer Management 1.6.5",
25010                         &timer_mgmt_data_165, test_timer_mgmt);
25011         g_test_add_data_func("/teststk/Timer Management 1.6.6",
25012                         &timer_mgmt_data_166, test_timer_mgmt);
25013         g_test_add_data_func("/teststk/Timer Management 1.6.7",
25014                         &timer_mgmt_data_167, test_timer_mgmt);
25015         g_test_add_data_func("/teststk/Timer Management 1.6.8",
25016                         &timer_mgmt_data_168, test_timer_mgmt);
25017         g_test_add_data_func("/teststk/Timer Management 2.1.1",
25018                         &timer_mgmt_data_211, test_timer_mgmt);
25019         g_test_add_data_func("/teststk/Timer Management 2.2.1",
25020                         &timer_mgmt_data_221, test_timer_mgmt);
25021
25022         g_test_add_data_func("/teststk/Timer Management response 1.1.1",
25023                         &timer_mgmt_response_data_111,
25024                         test_terminal_response_encoding);
25025         g_test_add_data_func("/teststk/Timer Management response 1.1.2",
25026                         &timer_mgmt_response_data_112,
25027                         test_terminal_response_encoding);
25028         g_test_add_data_func("/teststk/Timer Management response 1.1.4",
25029                         &timer_mgmt_response_data_114,
25030                         test_terminal_response_encoding);
25031         g_test_add_data_func("/teststk/Timer Management response 1.2.1",
25032                         &timer_mgmt_response_data_121,
25033                         test_terminal_response_encoding);
25034         g_test_add_data_func("/teststk/Timer Management response 1.2.2",
25035                         &timer_mgmt_response_data_122,
25036                         test_terminal_response_encoding);
25037         g_test_add_data_func("/teststk/Timer Management response 1.2.4",
25038                         &timer_mgmt_response_data_124,
25039                         test_terminal_response_encoding);
25040         g_test_add_data_func("/teststk/Timer Management response 1.3.1",
25041                         &timer_mgmt_response_data_131,
25042                         test_terminal_response_encoding);
25043         g_test_add_data_func("/teststk/Timer Management response 1.3.2",
25044                         &timer_mgmt_response_data_132,
25045                         test_terminal_response_encoding);
25046         g_test_add_data_func("/teststk/Timer Management response 1.3.4",
25047                         &timer_mgmt_response_data_134,
25048                         test_terminal_response_encoding);
25049         g_test_add_data_func("/teststk/Timer Management response 1.4.1A",
25050                         &timer_mgmt_response_data_141a,
25051                         test_terminal_response_encoding);
25052         g_test_add_data_func("/teststk/Timer Management response 1.4.1B",
25053                         &timer_mgmt_response_data_141b,
25054                         test_terminal_response_encoding);
25055         g_test_add_data_func("/teststk/Timer Management response 1.4.2A",
25056                         &timer_mgmt_response_data_142a,
25057                         test_terminal_response_encoding);
25058         g_test_add_data_func("/teststk/Timer Management response 1.4.3A",
25059                         &timer_mgmt_response_data_143a,
25060                         test_terminal_response_encoding);
25061         g_test_add_data_func("/teststk/Timer Management response 1.4.4A",
25062                         &timer_mgmt_response_data_144a,
25063                         test_terminal_response_encoding);
25064         g_test_add_data_func("/teststk/Timer Management response 1.4.5A",
25065                         &timer_mgmt_response_data_145a,
25066                         test_terminal_response_encoding);
25067         g_test_add_data_func("/teststk/Timer Management response 1.4.6A",
25068                         &timer_mgmt_response_data_146a,
25069                         test_terminal_response_encoding);
25070         g_test_add_data_func("/teststk/Timer Management response 1.4.7A",
25071                         &timer_mgmt_response_data_147a,
25072                         test_terminal_response_encoding);
25073         g_test_add_data_func("/teststk/Timer Management response 1.4.8A",
25074                         &timer_mgmt_response_data_148a,
25075                         test_terminal_response_encoding);
25076         g_test_add_data_func("/teststk/Timer Management response 1.5.1A",
25077                         &timer_mgmt_response_data_151a,
25078                         test_terminal_response_encoding);
25079         g_test_add_data_func("/teststk/Timer Management response 1.5.1B",
25080                         &timer_mgmt_response_data_151b,
25081                         test_terminal_response_encoding);
25082         g_test_add_data_func("/teststk/Timer Management response 1.5.2A",
25083                         &timer_mgmt_response_data_152a,
25084                         test_terminal_response_encoding);
25085         g_test_add_data_func("/teststk/Timer Management response 1.5.3A",
25086                         &timer_mgmt_response_data_153a,
25087                         test_terminal_response_encoding);
25088         g_test_add_data_func("/teststk/Timer Management response 1.5.4A",
25089                         &timer_mgmt_response_data_154a,
25090                         test_terminal_response_encoding);
25091         g_test_add_data_func("/teststk/Timer Management response 1.5.5A",
25092                         &timer_mgmt_response_data_155a,
25093                         test_terminal_response_encoding);
25094         g_test_add_data_func("/teststk/Timer Management response 1.5.6A",
25095                         &timer_mgmt_response_data_156a,
25096                         test_terminal_response_encoding);
25097         g_test_add_data_func("/teststk/Timer Management response 1.5.7A",
25098                         &timer_mgmt_response_data_157a,
25099                         test_terminal_response_encoding);
25100         g_test_add_data_func("/teststk/Timer Management response 1.5.8A",
25101                         &timer_mgmt_response_data_158a,
25102                         test_terminal_response_encoding);
25103         g_test_add_data_func("/teststk/Timer Management response 1.6.3",
25104                         &timer_mgmt_response_data_163,
25105                         test_terminal_response_encoding);
25106         g_test_add_data_func("/teststk/Timer Management response 1.6.4",
25107                         &timer_mgmt_response_data_164,
25108                         test_terminal_response_encoding);
25109         g_test_add_data_func("/teststk/Timer Management response 1.6.5",
25110                         &timer_mgmt_response_data_165,
25111                         test_terminal_response_encoding);
25112         g_test_add_data_func("/teststk/Timer Management response 1.6.6",
25113                         &timer_mgmt_response_data_166,
25114                         test_terminal_response_encoding);
25115         g_test_add_data_func("/teststk/Timer Management response 1.6.7",
25116                         &timer_mgmt_response_data_167,
25117                         test_terminal_response_encoding);
25118
25119         g_test_add_data_func("/teststk/Setup Idle Mode Text 1.1.1",
25120                 &setup_idle_mode_text_data_111, test_setup_idle_mode_text);
25121         g_test_add_data_func("/teststk/Setup Idle Mode Text 1.2.1",
25122                 &setup_idle_mode_text_data_121, test_setup_idle_mode_text);
25123         g_test_add_data_func("/teststk/Setup Idle Mode Text 1.3.1",
25124                 &setup_idle_mode_text_data_131, test_setup_idle_mode_text);
25125         g_test_add_data_func("/teststk/Setup Idle Mode Text 1.7.1",
25126                 &setup_idle_mode_text_data_171, test_setup_idle_mode_text);
25127         g_test_add_data_func("/teststk/Setup Idle Mode Text 2.1.1",
25128                 &setup_idle_mode_text_data_211, test_setup_idle_mode_text);
25129         g_test_add_data_func("/teststk/Setup Idle Mode Text 2.2.1",
25130                 &setup_idle_mode_text_data_221, test_setup_idle_mode_text);
25131         g_test_add_data_func("/teststk/Setup Idle Mode Text 2.3.1",
25132                 &setup_idle_mode_text_data_231, test_setup_idle_mode_text);
25133         g_test_add_data_func("/teststk/Setup Idle Mode Text 2.4.1",
25134                 &setup_idle_mode_text_data_241, test_setup_idle_mode_text);
25135         g_test_add_data_func("/teststk/Setup Idle Mode Text 3.1.1",
25136                 &setup_idle_mode_text_data_311, test_setup_idle_mode_text);
25137         g_test_add_data_func("/teststk/Setup Idle Mode Text 4.1.1",
25138                 &setup_idle_mode_text_data_411, test_setup_idle_mode_text);
25139         g_test_add_data_func("/teststk/Setup Idle Mode Text 4.1.2",
25140                 &setup_idle_mode_text_data_412, test_setup_idle_mode_text);
25141         g_test_add_data_func("/teststk/Setup Idle Mode Text 4.2.1",
25142                 &setup_idle_mode_text_data_421, test_setup_idle_mode_text);
25143         g_test_add_data_func("/teststk/Setup Idle Mode Text 4.2.2",
25144                 &setup_idle_mode_text_data_422, test_setup_idle_mode_text);
25145         g_test_add_data_func("/teststk/Setup Idle Mode Text 4.3.1",
25146                 &setup_idle_mode_text_data_431, test_setup_idle_mode_text);
25147         g_test_add_data_func("/teststk/Setup Idle Mode Text 4.3.2",
25148                 &setup_idle_mode_text_data_432, test_setup_idle_mode_text);
25149         g_test_add_data_func("/teststk/Setup Idle Mode Text 4.4.1",
25150                 &setup_idle_mode_text_data_441, test_setup_idle_mode_text);
25151         g_test_add_data_func("/teststk/Setup Idle Mode Text 4.4.2",
25152                 &setup_idle_mode_text_data_442, test_setup_idle_mode_text);
25153         g_test_add_data_func("/teststk/Setup Idle Mode Text 4.4.3",
25154                 &setup_idle_mode_text_data_443, test_setup_idle_mode_text);
25155         g_test_add_data_func("/teststk/Setup Idle Mode Text 4.5.1",
25156                 &setup_idle_mode_text_data_451, test_setup_idle_mode_text);
25157         g_test_add_data_func("/teststk/Setup Idle Mode Text 4.5.2",
25158                 &setup_idle_mode_text_data_452, test_setup_idle_mode_text);
25159         g_test_add_data_func("/teststk/Setup Idle Mode Text 4.5.3",
25160                 &setup_idle_mode_text_data_453, test_setup_idle_mode_text);
25161         g_test_add_data_func("/teststk/Setup Idle Mode Text 4.6.1",
25162                 &setup_idle_mode_text_data_461, test_setup_idle_mode_text);
25163         g_test_add_data_func("/teststk/Setup Idle Mode Text 4.6.2",
25164                 &setup_idle_mode_text_data_462, test_setup_idle_mode_text);
25165         g_test_add_data_func("/teststk/Setup Idle Mode Text 4.6.3",
25166                 &setup_idle_mode_text_data_463, test_setup_idle_mode_text);
25167         g_test_add_data_func("/teststk/Setup Idle Mode Text 4.7.1",
25168                 &setup_idle_mode_text_data_471, test_setup_idle_mode_text);
25169         g_test_add_data_func("/teststk/Setup Idle Mode Text 4.7.2",
25170                 &setup_idle_mode_text_data_472, test_setup_idle_mode_text);
25171         g_test_add_data_func("/teststk/Setup Idle Mode Text 4.7.3",
25172                 &setup_idle_mode_text_data_473, test_setup_idle_mode_text);
25173         g_test_add_data_func("/teststk/Setup Idle Mode Text 4.8.1",
25174                 &setup_idle_mode_text_data_481, test_setup_idle_mode_text);
25175         g_test_add_data_func("/teststk/Setup Idle Mode Text 4.8.2",
25176                 &setup_idle_mode_text_data_482, test_setup_idle_mode_text);
25177         g_test_add_data_func("/teststk/Setup Idle Mode Text 4.8.3",
25178                 &setup_idle_mode_text_data_483, test_setup_idle_mode_text);
25179         g_test_add_data_func("/teststk/Setup Idle Mode Text 4.9.1",
25180                 &setup_idle_mode_text_data_491, test_setup_idle_mode_text);
25181         g_test_add_data_func("/teststk/Setup Idle Mode Text 4.9.2",
25182                 &setup_idle_mode_text_data_492, test_setup_idle_mode_text);
25183         g_test_add_data_func("/teststk/Setup Idle Mode Text 4.9.3",
25184                 &setup_idle_mode_text_data_493, test_setup_idle_mode_text);
25185         g_test_add_data_func("/teststk/Setup Idle Mode Text 4.10.1",
25186                 &setup_idle_mode_text_data_4101, test_setup_idle_mode_text);
25187         g_test_add_data_func("/teststk/Setup Idle Mode Text 4.10.2",
25188                 &setup_idle_mode_text_data_4102, test_setup_idle_mode_text);
25189         g_test_add_data_func("/teststk/Setup Idle Mode Text 5.1.1",
25190                 &setup_idle_mode_text_data_511, test_setup_idle_mode_text);
25191         g_test_add_data_func("/teststk/Setup Idle Mode Text 6.1.1",
25192                 &setup_idle_mode_text_data_611, test_setup_idle_mode_text);
25193
25194         g_test_add_data_func("/teststk/Set Up Idle Mode Text response 1.1.1",
25195                         &set_up_idle_mode_text_response_data_111,
25196                         test_terminal_response_encoding);
25197         g_test_add_data_func("/teststk/Set Up Idle Mode Text response 2.1.1B",
25198                         &set_up_idle_mode_text_response_data_211b,
25199                         test_terminal_response_encoding);
25200         g_test_add_data_func("/teststk/Set Up Idle Mode Text response 2.4.1",
25201                         &set_up_idle_mode_text_response_data_241,
25202                         test_terminal_response_encoding);
25203
25204         g_test_add_data_func("/teststk/Run At Command 1.1.1",
25205                         &run_at_command_data_111, test_run_at_command);
25206         g_test_add_data_func("/teststk/Run At Command 1.2.1",
25207                         &run_at_command_data_121, test_run_at_command);
25208         g_test_add_data_func("/teststk/Run At Command 1.3.1",
25209                         &run_at_command_data_131, test_run_at_command);
25210         g_test_add_data_func("/teststk/Run At Command 2.1.1",
25211                         &run_at_command_data_211, test_run_at_command);
25212         g_test_add_data_func("/teststk/Run At Command 2.2.1",
25213                         &run_at_command_data_221, test_run_at_command);
25214         g_test_add_data_func("/teststk/Run At Command 2.3.1",
25215                         &run_at_command_data_231, test_run_at_command);
25216         g_test_add_data_func("/teststk/Run At Command 2.4.1",
25217                         &run_at_command_data_241, test_run_at_command);
25218         g_test_add_data_func("/teststk/Run At Command 2.5.1",
25219                         &run_at_command_data_251, test_run_at_command);
25220         g_test_add_data_func("/teststk/Run At Command 3.1.1",
25221                         &run_at_command_data_311, test_run_at_command);
25222         g_test_add_data_func("/teststk/Run At Command 3.1.2",
25223                         &run_at_command_data_312, test_run_at_command);
25224         g_test_add_data_func("/teststk/Run At Command 3.2.1",
25225                         &run_at_command_data_321, test_run_at_command);
25226         g_test_add_data_func("/teststk/Run At Command 3.2.2",
25227                         &run_at_command_data_322, test_run_at_command);
25228         g_test_add_data_func("/teststk/Run At Command 3.3.1",
25229                         &run_at_command_data_331, test_run_at_command);
25230         g_test_add_data_func("/teststk/Run At Command 3.3.2",
25231                         &run_at_command_data_332, test_run_at_command);
25232         g_test_add_data_func("/teststk/Run At Command 3.4.1",
25233                         &run_at_command_data_341, test_run_at_command);
25234         g_test_add_data_func("/teststk/Run At Command 3.4.2",
25235                         &run_at_command_data_342, test_run_at_command);
25236         g_test_add_data_func("/teststk/Run At Command 3.4.3",
25237                         &run_at_command_data_343, test_run_at_command);
25238         g_test_add_data_func("/teststk/Run At Command 3.5.1",
25239                         &run_at_command_data_351, test_run_at_command);
25240         g_test_add_data_func("/teststk/Run At Command 3.5.2",
25241                         &run_at_command_data_352, test_run_at_command);
25242         g_test_add_data_func("/teststk/Run At Command 3.5.3",
25243                         &run_at_command_data_353, test_run_at_command);
25244         g_test_add_data_func("/teststk/Run At Command 3.6.1",
25245                         &run_at_command_data_361, test_run_at_command);
25246         g_test_add_data_func("/teststk/Run At Command 3.6.2",
25247                         &run_at_command_data_362, test_run_at_command);
25248         g_test_add_data_func("/teststk/Run At Command 3.6.3",
25249                         &run_at_command_data_363, test_run_at_command);
25250         g_test_add_data_func("/teststk/Run At Command 3.7.1",
25251                         &run_at_command_data_371, test_run_at_command);
25252         g_test_add_data_func("/teststk/Run At Command 3.7.2",
25253                         &run_at_command_data_372, test_run_at_command);
25254         g_test_add_data_func("/teststk/Run At Command 3.7.3",
25255                         &run_at_command_data_373, test_run_at_command);
25256         g_test_add_data_func("/teststk/Run At Command 3.8.1",
25257                         &run_at_command_data_381, test_run_at_command);
25258         g_test_add_data_func("/teststk/Run At Command 3.8.2",
25259                         &run_at_command_data_382, test_run_at_command);
25260         g_test_add_data_func("/teststk/Run At Command 3.8.3",
25261                         &run_at_command_data_383, test_run_at_command);
25262         g_test_add_data_func("/teststk/Run At Command 3.9.1",
25263                         &run_at_command_data_391, test_run_at_command);
25264         g_test_add_data_func("/teststk/Run At Command 3.9.2",
25265                         &run_at_command_data_392, test_run_at_command);
25266         g_test_add_data_func("/teststk/Run At Command 3.9.3",
25267                         &run_at_command_data_393, test_run_at_command);
25268         g_test_add_data_func("/teststk/Run At Command 3.10.1",
25269                         &run_at_command_data_3101, test_run_at_command);
25270         g_test_add_data_func("/teststk/Run At Command 3.10.2",
25271                         &run_at_command_data_3102, test_run_at_command);
25272         g_test_add_data_func("/teststk/Run At Command 4.1.1",
25273                         &run_at_command_data_411, test_run_at_command);
25274         g_test_add_data_func("/teststk/Run At Command 5.1.1",
25275                         &run_at_command_data_511, test_run_at_command);
25276         g_test_add_data_func("/teststk/Run At Command 6.1.1",
25277                         &run_at_command_data_611, test_run_at_command);
25278
25279         g_test_add_data_func("/teststk/Run AT Command response 1.1.1",
25280                         &run_at_command_response_data_111,
25281                         test_terminal_response_encoding);
25282         g_test_add_data_func("/teststk/Run AT Command response 2.1.1B",
25283                         &run_at_command_response_data_211b,
25284                         test_terminal_response_encoding);
25285         g_test_add_data_func("/teststk/Run AT Command response 2.5.1",
25286                         &run_at_command_response_data_251,
25287                         test_terminal_response_encoding);
25288
25289         g_test_add_data_func("/teststk/Send DTMF 1.1.1",
25290                         &send_dtmf_data_111, test_send_dtmf);
25291         g_test_add_data_func("/teststk/Send DTMF 1.2.1",
25292                         &send_dtmf_data_121, test_send_dtmf);
25293         g_test_add_data_func("/teststk/Send DTMF 1.3.1",
25294                         &send_dtmf_data_131, test_send_dtmf);
25295         g_test_add_data_func("/teststk/Send DTMF 2.1.1",
25296                         &send_dtmf_data_211, test_send_dtmf);
25297         g_test_add_data_func("/teststk/Send DTMF 2.2.1",
25298                         &send_dtmf_data_221, test_send_dtmf);
25299         g_test_add_data_func("/teststk/Send DTMF 2.3.1",
25300                         &send_dtmf_data_231, test_send_dtmf);
25301         g_test_add_data_func("/teststk/Send DTMF 3.1.1",
25302                         &send_dtmf_data_311, test_send_dtmf);
25303         g_test_add_data_func("/teststk/Send DTMF 4.1.1",
25304                         &send_dtmf_data_411, test_send_dtmf);
25305         g_test_add_data_func("/teststk/Send DTMF 4.1.2",
25306                         &send_dtmf_data_412, test_send_dtmf);
25307         g_test_add_data_func("/teststk/Send DTMF 4.2.1",
25308                         &send_dtmf_data_421, test_send_dtmf);
25309         g_test_add_data_func("/teststk/Send DTMF 4.2.2",
25310                         &send_dtmf_data_422, test_send_dtmf);
25311         g_test_add_data_func("/teststk/Send DTMF 4.3.1",
25312                         &send_dtmf_data_431, test_send_dtmf);
25313         g_test_add_data_func("/teststk/Send DTMF 4.3.2",
25314                         &send_dtmf_data_432, test_send_dtmf);
25315         g_test_add_data_func("/teststk/Send DTMF 4.4.1",
25316                         &send_dtmf_data_441, test_send_dtmf);
25317         g_test_add_data_func("/teststk/Send DTMF 4.4.2",
25318                         &send_dtmf_data_442, test_send_dtmf);
25319         g_test_add_data_func("/teststk/Send DTMF 4.4.3",
25320                         &send_dtmf_data_443, test_send_dtmf);
25321         g_test_add_data_func("/teststk/Send DTMF 4.5.1",
25322                         &send_dtmf_data_451, test_send_dtmf);
25323         g_test_add_data_func("/teststk/Send DTMF 4.5.2",
25324                         &send_dtmf_data_452, test_send_dtmf);
25325         g_test_add_data_func("/teststk/Send DTMF 4.5.3",
25326                         &send_dtmf_data_453, test_send_dtmf);
25327         g_test_add_data_func("/teststk/Send DTMF 4.6.1",
25328                         &send_dtmf_data_461, test_send_dtmf);
25329         g_test_add_data_func("/teststk/Send DTMF 4.6.2",
25330                         &send_dtmf_data_462, test_send_dtmf);
25331         g_test_add_data_func("/teststk/Send DTMF 4.6.3",
25332                         &send_dtmf_data_463, test_send_dtmf);
25333         g_test_add_data_func("/teststk/Send DTMF 4.7.1",
25334                         &send_dtmf_data_471, test_send_dtmf);
25335         g_test_add_data_func("/teststk/Send DTMF 4.7.2",
25336                         &send_dtmf_data_472, test_send_dtmf);
25337         g_test_add_data_func("/teststk/Send DTMF 4.7.3",
25338                         &send_dtmf_data_473, test_send_dtmf);
25339         g_test_add_data_func("/teststk/Send DTMF 4.8.1",
25340                         &send_dtmf_data_481, test_send_dtmf);
25341         g_test_add_data_func("/teststk/Send DTMF 4.8.2",
25342                         &send_dtmf_data_482, test_send_dtmf);
25343         g_test_add_data_func("/teststk/Send DTMF 4.8.3",
25344                         &send_dtmf_data_483, test_send_dtmf);
25345         g_test_add_data_func("/teststk/Send DTMF 4.9.1",
25346                         &send_dtmf_data_491, test_send_dtmf);
25347         g_test_add_data_func("/teststk/Send DTMF 4.9.2",
25348                         &send_dtmf_data_492, test_send_dtmf);
25349         g_test_add_data_func("/teststk/Send DTMF 4.9.3",
25350                         &send_dtmf_data_493, test_send_dtmf);
25351         g_test_add_data_func("/teststk/Send DTMF 4.10.1",
25352                         &send_dtmf_data_4101, test_send_dtmf);
25353         g_test_add_data_func("/teststk/Send DTMF 4.10.2",
25354                         &send_dtmf_data_4102, test_send_dtmf);
25355         g_test_add_data_func("/teststk/Send DTMF 5.1.1",
25356                         &send_dtmf_data_511, test_send_dtmf);
25357         g_test_add_data_func("/teststk/Send DTMF 6.1.1",
25358                         &send_dtmf_data_611, test_send_dtmf);
25359
25360         g_test_add_data_func("/teststk/Send DTMF response 1.1.1",
25361                         &send_dtmf_response_data_111,
25362                         test_terminal_response_encoding);
25363         g_test_add_data_func("/teststk/Send DTMF response 1.4.1",
25364                         &send_dtmf_response_data_141,
25365                         test_terminal_response_encoding);
25366         g_test_add_data_func("/teststk/Send DTMF response 2.1.1B",
25367                         &send_dtmf_response_data_211b,
25368                         test_terminal_response_encoding);
25369
25370         g_test_add_data_func("/teststk/Language Notification 1.1.1",
25371                 &language_notification_data_111, test_language_notification);
25372         g_test_add_data_func("/teststk/Language Notification 1.2.1",
25373                 &language_notification_data_121, test_language_notification);
25374
25375         g_test_add_data_func("/teststk/Language Notification response 1.1.1",
25376                         &language_notification_response_data_111,
25377                         test_terminal_response_encoding);
25378         g_test_add_data_func("/teststk/Language Notification response 1.2.1",
25379                         &language_notification_response_data_121,
25380                         test_terminal_response_encoding);
25381
25382         g_test_add_data_func("/teststk/Launch Browser 1.1.1",
25383                                 &launch_browser_data_111, test_launch_browser);
25384         g_test_add_data_func("/teststk/Launch Browser 1.2.1",
25385                                 &launch_browser_data_121, test_launch_browser);
25386         g_test_add_data_func("/teststk/Launch Browser 1.3.1",
25387                                 &launch_browser_data_131, test_launch_browser);
25388         g_test_add_data_func("/teststk/Launch Browser 1.4.1",
25389                                 &launch_browser_data_141, test_launch_browser);
25390         g_test_add_data_func("/teststk/Launch Browser 2.1.1",
25391                                 &launch_browser_data_211, test_launch_browser);
25392         g_test_add_data_func("/teststk/Launch Browser 2.2.1",
25393                                 &launch_browser_data_221, test_launch_browser);
25394         g_test_add_data_func("/teststk/Launch Browser 2.3.1",
25395                                 &launch_browser_data_231, test_launch_browser);
25396         g_test_add_data_func("/teststk/Launch Browser 3.1.1",
25397                                 &launch_browser_data_311, test_launch_browser);
25398         g_test_add_data_func("/teststk/Launch Browser 4.1.1",
25399                                 &launch_browser_data_411, test_launch_browser);
25400         g_test_add_data_func("/teststk/Launch Browser 4.2.1",
25401                                 &launch_browser_data_421, test_launch_browser);
25402         g_test_add_data_func("/teststk/Launch Browser 5.1.1",
25403                                 &launch_browser_data_511, test_launch_browser);
25404         g_test_add_data_func("/teststk/Launch Browser 5.1.2",
25405                                 &launch_browser_data_512, test_launch_browser);
25406         g_test_add_data_func("/teststk/Launch Browser 5.2.1",
25407                                 &launch_browser_data_521, test_launch_browser);
25408         g_test_add_data_func("/teststk/Launch Browser 5.2.2",
25409                                 &launch_browser_data_522, test_launch_browser);
25410         g_test_add_data_func("/teststk/Launch Browser 5.3.1",
25411                                 &launch_browser_data_531, test_launch_browser);
25412         g_test_add_data_func("/teststk/Launch Browser 5.3.2",
25413                                 &launch_browser_data_532, test_launch_browser);
25414         g_test_add_data_func("/teststk/Launch Browser 5.4.1",
25415                                 &launch_browser_data_541, test_launch_browser);
25416         g_test_add_data_func("/teststk/Launch Browser 5.4.2",
25417                                 &launch_browser_data_542, test_launch_browser);
25418         g_test_add_data_func("/teststk/Launch Browser 5.4.3",
25419                                 &launch_browser_data_543, test_launch_browser);
25420         g_test_add_data_func("/teststk/Launch Browser 5.5.1",
25421                                 &launch_browser_data_551, test_launch_browser);
25422         g_test_add_data_func("/teststk/Launch Browser 5.5.2",
25423                                 &launch_browser_data_552, test_launch_browser);
25424         g_test_add_data_func("/teststk/Launch Browser 5.5.3",
25425                                 &launch_browser_data_553, test_launch_browser);
25426         g_test_add_data_func("/teststk/Launch Browser 5.6.1",
25427                                 &launch_browser_data_561, test_launch_browser);
25428         g_test_add_data_func("/teststk/Launch Browser 5.6.2",
25429                                 &launch_browser_data_562, test_launch_browser);
25430         g_test_add_data_func("/teststk/Launch Browser 5.6.3",
25431                                 &launch_browser_data_563, test_launch_browser);
25432         g_test_add_data_func("/teststk/Launch Browser 5.7.1",
25433                                 &launch_browser_data_571, test_launch_browser);
25434         g_test_add_data_func("/teststk/Launch Browser 5.7.2",
25435                                 &launch_browser_data_572, test_launch_browser);
25436         g_test_add_data_func("/teststk/Launch Browser 5.7.3",
25437                                 &launch_browser_data_573, test_launch_browser);
25438         g_test_add_data_func("/teststk/Launch Browser 5.8.1",
25439                                 &launch_browser_data_581, test_launch_browser);
25440         g_test_add_data_func("/teststk/Launch Browser 5.8.2",
25441                                 &launch_browser_data_582, test_launch_browser);
25442         g_test_add_data_func("/teststk/Launch Browser 5.8.3",
25443                                 &launch_browser_data_583, test_launch_browser);
25444         g_test_add_data_func("/teststk/Launch Browser 5.9.1",
25445                                 &launch_browser_data_591, test_launch_browser);
25446         g_test_add_data_func("/teststk/Launch Browser 5.9.2",
25447                                 &launch_browser_data_592, test_launch_browser);
25448         g_test_add_data_func("/teststk/Launch Browser 5.9.3",
25449                                 &launch_browser_data_593, test_launch_browser);
25450         g_test_add_data_func("/teststk/Launch Browser 5.10.1",
25451                                 &launch_browser_data_5101, test_launch_browser);
25452         g_test_add_data_func("/teststk/Launch Browser 5.10.2",
25453                                 &launch_browser_data_5102, test_launch_browser);
25454         g_test_add_data_func("/teststk/Launch Browser 6.1.1",
25455                                 &launch_browser_data_611, test_launch_browser);
25456         g_test_add_data_func("/teststk/Launch Browser 7.1.1",
25457                                 &launch_browser_data_711, test_launch_browser);
25458
25459         g_test_add_data_func("/teststk/Launch Browser response 1.1.1",
25460                         &launch_browser_response_data_111,
25461                         test_terminal_response_encoding);
25462         g_test_add_data_func("/teststk/Launch Browser response 2.1.1",
25463                         &launch_browser_response_data_211,
25464                         test_terminal_response_encoding);
25465         g_test_add_data_func("/teststk/Launch Browser response 2.2.1",
25466                         &launch_browser_response_data_221,
25467                         test_terminal_response_encoding);
25468         g_test_add_data_func("/teststk/Launch Browser response 2.3.1",
25469                         &launch_browser_response_data_231,
25470                         test_terminal_response_encoding);
25471         g_test_add_data_func("/teststk/Launch Browser response 4.1.1B",
25472                         &launch_browser_response_data_411b,
25473                         test_terminal_response_encoding);
25474
25475
25476         g_test_add_data_func("/teststk/Open channel 2.1.1",
25477                                 &open_channel_data_211, test_open_channel);
25478         g_test_add_data_func("/teststk/Open channel 2.2.1",
25479                                 &open_channel_data_221, test_open_channel);
25480         g_test_add_data_func("/teststk/Open channel 2.3.1",
25481                                 &open_channel_data_231, test_open_channel);
25482         g_test_add_data_func("/teststk/Open channel 2.4.1",
25483                                 &open_channel_data_241, test_open_channel);
25484         g_test_add_data_func("/teststk/Open channel 5.1.1",
25485                                 &open_channel_data_511, test_open_channel);
25486         g_test_add_data_func("/teststk/Open channel response 2.1.1",
25487                                 &open_channel_response_data_211,
25488                                 test_terminal_response_encoding);
25489         g_test_add_data_func("/teststk/Open channel response 2.7.1",
25490                                 &open_channel_response_data_271,
25491                                 test_terminal_response_encoding);
25492
25493         g_test_add_data_func("/teststk/Close channel 1.1.1",
25494                                 &close_channel_data_111, test_close_channel);
25495         g_test_add_data_func("/teststk/Close channel 2.1.1",
25496                                 &close_channel_data_211, test_close_channel);
25497         g_test_add_data_func("/teststk/Close channel response 1.2.1",
25498                                 &close_channel_response_data_121,
25499                                 test_terminal_response_encoding);
25500         g_test_add_data_func("/teststk/Close channel response 1.3.1",
25501                                 &close_channel_response_data_131,
25502                                 test_terminal_response_encoding);
25503
25504         g_test_add_data_func("/teststk/Receive data 1.1.1",
25505                                 &receive_data_data_111, test_receive_data);
25506         g_test_add_data_func("/teststk/Receive data 2.1.1",
25507                                 &receive_data_data_211, test_receive_data);
25508         g_test_add_data_func("/teststk/Receive data response 1.1.1",
25509                                 &receive_data_response_data_111,
25510                                 test_terminal_response_encoding);
25511
25512         g_test_add_data_func("/teststk/Send data 1.1.1",
25513                                         &send_data_data_111, test_send_data);
25514         g_test_add_data_func("/teststk/Send data 1.2.1",
25515                                         &send_data_data_121, test_send_data);
25516         g_test_add_data_func("/teststk/Send data 2.1.1",
25517                                         &send_data_data_211, test_send_data);
25518         g_test_add_data_func("/teststk/Send data response 1.1.1",
25519                                         &send_data_response_data_111,
25520                                         test_terminal_response_encoding);
25521         g_test_add_data_func("/teststk/Send data response 1.2.1",
25522                                         &send_data_response_data_121,
25523                                         test_terminal_response_encoding);
25524         g_test_add_data_func("/teststk/Send data response 1.5.1",
25525                                         &send_data_response_data_151,
25526                                         test_terminal_response_encoding);
25527
25528         g_test_add_data_func("/teststk/Get Channel status 1.1.1",
25529                         &get_channel_status_data_111, test_get_channel_status);
25530         g_test_add_data_func("/teststk/Get Channel status response 1.1.1",
25531                                         &get_channel_status_response_data_111,
25532                                         test_terminal_response_encoding);
25533         g_test_add_data_func("/teststk/Get Channel status response 1.2.1",
25534                                         &get_channel_status_response_data_121,
25535                                         test_terminal_response_encoding);
25536         g_test_add_data_func("/teststk/Get Channel status response 1.3.1",
25537                                         &get_channel_status_response_data_131,
25538                                         test_terminal_response_encoding);
25539
25540         g_test_add_data_func("/teststk/SMS-PP data download 1.6.1",
25541                         &sms_pp_data_download_data_161,
25542                         test_envelope_encoding);
25543         g_test_add_data_func("/teststk/SMS-PP data download 1.6.2",
25544                         &sms_pp_data_download_data_162,
25545                         test_envelope_encoding);
25546         g_test_add_data_func("/teststk/SMS-PP data download 1.8.2",
25547                         &sms_pp_data_download_data_182,
25548                         test_envelope_encoding);
25549
25550         g_test_add_data_func("/teststk/CBS-PP data download 1.1",
25551                         &cbs_pp_data_download_data_11, test_envelope_encoding);
25552         g_test_add_data_func("/teststk/CBS-PP data download 1.7",
25553                         &cbs_pp_data_download_data_17, test_envelope_encoding);
25554
25555         g_test_add_data_func("/teststk/Menu Selection 1.1.1",
25556                         &menu_selection_data_111, test_envelope_encoding);
25557         g_test_add_data_func("/teststk/Menu Selection 1.1.2",
25558                         &menu_selection_data_112, test_envelope_encoding);
25559         g_test_add_data_func("/teststk/Menu Selection 1.2.1",
25560                         &menu_selection_data_121, test_envelope_encoding);
25561         g_test_add_data_func("/teststk/Menu Selection 1.2.2",
25562                         &menu_selection_data_122, test_envelope_encoding);
25563         g_test_add_data_func("/teststk/Menu Selection 1.2.3",
25564                         &menu_selection_data_123, test_envelope_encoding);
25565         g_test_add_data_func("/teststk/Menu Selection 2.1.1",
25566                         &menu_selection_data_211, test_envelope_encoding);
25567         g_test_add_data_func("/teststk/Menu Selection 6.1.2",
25568                         &menu_selection_data_612, test_envelope_encoding);
25569         g_test_add_data_func("/teststk/Menu Selection 6.4.1",
25570                         &menu_selection_data_641, test_envelope_encoding);
25571
25572         g_test_add_data_func("/teststk/Call Control 1.1.1A",
25573                         &call_control_data_111a, test_envelope_encoding);
25574         g_test_add_data_func("/teststk/Call Control 1.1.1B",
25575                         &call_control_data_111b, test_envelope_encoding);
25576         g_test_add_data_func("/teststk/Call Control 1.3.1A",
25577                         &call_control_data_131a, test_envelope_encoding);
25578         g_test_add_data_func("/teststk/Call Control 1.3.1B",
25579                         &call_control_data_131b, test_envelope_encoding);
25580
25581         g_test_add_data_func("/teststk/MO Short Message Control 1.1.1A",
25582                         &mo_short_message_control_data_111a,
25583                         test_envelope_encoding);
25584         g_test_add_data_func("/teststk/MO Short Message Control 1.1.1B",
25585                         &mo_short_message_control_data_111b,
25586                         test_envelope_encoding);
25587
25588         g_test_add_data_func("/teststk/Event: MT Call 1.1.1",
25589                         &event_download_mt_call_data_111,
25590                         test_envelope_encoding);
25591         g_test_add_data_func("/teststk/Event: MT Call 1.1.2",
25592                         &event_download_mt_call_data_112,
25593                         test_envelope_encoding);
25594
25595         g_test_add_data_func("/teststk/Event: Call Connected 1.1.1",
25596                         &event_download_call_connected_data_111,
25597                         test_envelope_encoding);
25598         g_test_add_data_func("/teststk/Event: Call Connected 1.1.2",
25599                         &event_download_call_connected_data_112,
25600                         test_envelope_encoding);
25601
25602         g_test_add_data_func("/teststk/Event: Call Disconnected 1.1.1",
25603                         &event_download_call_disconnected_data_111,
25604                         test_envelope_encoding);
25605         g_test_add_data_func("/teststk/Event: Call Disconnected 1.1.2A",
25606                         &event_download_call_disconnected_data_112a,
25607                         test_envelope_encoding);
25608         g_test_add_data_func("/teststk/Event: Call Disconnected 1.1.2B",
25609                         &event_download_call_disconnected_data_112b,
25610                         test_envelope_encoding);
25611         g_test_add_data_func("/teststk/Event: Call Disconnected 1.1.2C",
25612                         &event_download_call_disconnected_data_112c,
25613                         test_envelope_encoding);
25614         g_test_add_data_func("/teststk/Event: Call Disconnected 1.1.3A",
25615                         &event_download_call_disconnected_data_113a,
25616                         test_envelope_encoding);
25617         g_test_add_data_func("/teststk/Event: Call Disconnected 1.1.3B",
25618                         &event_download_call_disconnected_data_113b,
25619                         test_envelope_encoding);
25620         g_test_add_data_func("/teststk/Event: Call Disconnected 1.1.4A",
25621                         &event_download_call_disconnected_data_114a,
25622                         test_envelope_encoding);
25623         g_test_add_data_func("/teststk/Event: Call Disconnected 1.1.4B",
25624                         &event_download_call_disconnected_data_114b,
25625                         test_envelope_encoding);
25626
25627         g_test_add_data_func("/teststk/Event: Location Status 1.1.1",
25628                         &event_download_location_status_data_111,
25629                         test_envelope_encoding);
25630         g_test_add_data_func("/teststk/Event: Location Status 1.1.2A",
25631                         &event_download_location_status_data_112a,
25632                         test_envelope_encoding);
25633         g_test_add_data_func("/teststk/Event: Location Status 1.1.2B",
25634                         &event_download_location_status_data_112b,
25635                         test_envelope_encoding);
25636         g_test_add_data_func("/teststk/Event: Location Status 1.2.2",
25637                         &event_download_location_status_data_122,
25638                         test_envelope_encoding);
25639
25640         g_test_add_data_func("/teststk/Event: User Activity 1.1.1",
25641                         &event_download_user_activity_data_111,
25642                         test_envelope_encoding);
25643
25644         g_test_add_data_func("/teststk/Event: Idle Screen Available 1.1.1",
25645                         &event_download_idle_screen_available_data_111,
25646                         test_envelope_encoding);
25647
25648         g_test_add_data_func("/teststk/Event: Card Reader Status 1.1.1A",
25649                         &event_download_card_reader_status_data_111a,
25650                         test_envelope_encoding);
25651         g_test_add_data_func("/teststk/Event: Card Reader Status 1.1.1B",
25652                         &event_download_card_reader_status_data_111b,
25653                         test_envelope_encoding);
25654         g_test_add_data_func("/teststk/Event: Card Reader Status 1.1.1C",
25655                         &event_download_card_reader_status_data_111c,
25656                         test_envelope_encoding);
25657         g_test_add_data_func("/teststk/Event: Card Reader Status 1.1.1D",
25658                         &event_download_card_reader_status_data_111d,
25659                         test_envelope_encoding);
25660         g_test_add_data_func("/teststk/Event: Card Reader Status 1.1.2A",
25661                         &event_download_card_reader_status_data_112a,
25662                         test_envelope_encoding);
25663         g_test_add_data_func("/teststk/Event: Card Reader Status 1.1.2B",
25664                         &event_download_card_reader_status_data_112b,
25665                         test_envelope_encoding);
25666         g_test_add_data_func("/teststk/Event: Card Reader Status 1.1.2C",
25667                         &event_download_card_reader_status_data_112c,
25668                         test_envelope_encoding);
25669         g_test_add_data_func("/teststk/Event: Card Reader Status 1.1.2D",
25670                         &event_download_card_reader_status_data_112d,
25671                         test_envelope_encoding);
25672         g_test_add_data_func("/teststk/Event: Card Reader Status 2.1.2A",
25673                         &event_download_card_reader_status_data_212a,
25674                         test_envelope_encoding);
25675         g_test_add_data_func("/teststk/Event: Card Reader Status 2.1.2B",
25676                         &event_download_card_reader_status_data_212b,
25677                         test_envelope_encoding);
25678
25679         g_test_add_data_func("/teststk/Event: Language Selection 1.1.1",
25680                         &event_download_language_selection_data_111,
25681                         test_envelope_encoding);
25682         g_test_add_data_func("/teststk/Event: Language Selection 1.2.2",
25683                         &event_download_language_selection_data_122,
25684                         test_envelope_encoding);
25685
25686         g_test_add_data_func("/teststk/Event: Browser Termination 1.1.1",
25687                         &event_download_browser_termination_data_111,
25688                         test_envelope_encoding);
25689
25690         g_test_add_data_func("/teststk/Event: Data Available 1.1.1",
25691                         &event_download_data_available_data_111,
25692                         test_envelope_encoding);
25693         g_test_add_data_func("/teststk/Event: Data Available 2.1.1",
25694                         &event_download_data_available_data_211,
25695                         test_envelope_encoding);
25696
25697         g_test_add_data_func("/teststk/Event: Channel Status 1.3.1",
25698                         &event_download_channel_status_data_131,
25699                         test_envelope_encoding);
25700         g_test_add_data_func("/teststk/Event: Channel Status 2.1.1",
25701                         &event_download_channel_status_data_211,
25702                         test_envelope_encoding);
25703         g_test_add_data_func("/teststk/Event: Channel Status 2.2.1",
25704                         &event_download_channel_status_data_221,
25705                         test_envelope_encoding);
25706
25707         g_test_add_data_func("/teststk/Event: Network Rejection 1.1.1",
25708                         &event_download_network_rejection_data_111,
25709                         test_envelope_encoding);
25710         g_test_add_data_func("/teststk/Event: Network Rejection 1.2.1",
25711                         &event_download_network_rejection_data_121,
25712                         test_envelope_encoding);
25713
25714         g_test_add_data_func("/teststk/Timer Expiration 2.1.1",
25715                         &timer_expiration_data_211, test_envelope_encoding);
25716         g_test_add_data_func("/teststk/Timer Expiration 2.2.1A",
25717                         &timer_expiration_data_221a, test_envelope_encoding);
25718
25719         g_test_add_data_func("/teststk/HTML Attribute Test 1",
25720                                 &html_attr_data_1, test_html_attr);
25721         g_test_add_data_func("/teststk/HTML Attribute Test 2",
25722                                 &html_attr_data_2, test_html_attr);
25723         g_test_add_data_func("/teststk/HTML Attribute Test 3",
25724                                 &html_attr_data_3, test_html_attr);
25725         g_test_add_data_func("/teststk/HTML Attribute Test 4",
25726                                 &html_attr_data_4, test_html_attr);
25727
25728         g_test_add_data_func("/teststk/IMG to XPM Test 1",
25729                                 &xpm_test_1, test_img_to_xpm);
25730         g_test_add_data_func("/teststk/IMG to XPM Test 2",
25731                                 &xpm_test_2, test_img_to_xpm);
25732         g_test_add_data_func("/teststk/IMG to XPM Test 3",
25733                                 &xpm_test_3, test_img_to_xpm);
25734         g_test_add_data_func("/teststk/IMG to XPM Test 4",
25735                                 &xpm_test_4, test_img_to_xpm);
25736         g_test_add_data_func("/teststk/IMG to XPM Test 5",
25737                                 &xpm_test_5, test_img_to_xpm);
25738         g_test_add_data_func("/teststk/IMG to XPM Test 6",
25739                                 &xpm_test_6, test_img_to_xpm);
25740
25741         return g_test_run();
25742 }