update tizen source
[framework/messaging/msg-service.git] / plugin / sms_plugin / include / SmsPluginTypes.h
1 /*
2 *
3 * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd. All Rights Reserved.
4 *
5 * This file is part of msg-service.
6 *
7 * Contact: Jaeyun Jeong <jyjeong@samsung.com>
8 *          Sangkoo Kim <sangkoo.kim@samsung.com>
9 *          Seunghwan Lee <sh.cat.lee@samsung.com>
10 *          SoonMin Jung <sm0415.jung@samsung.com>
11 *          Jae-Young Lee <jy4710.lee@samsung.com>
12 *          KeeBum Kim <keebum.kim@samsung.com>
13 *
14 * PROPRIETARY/CONFIDENTIAL
15 *
16 * This software is the confidential and proprietary information of
17 * SAMSUNG ELECTRONICS ("Confidential Information"). You shall not
18 * disclose such Confidential Information and shall use it only in
19 * accordance with the terms of the license agreement you entered
20 * into with SAMSUNG ELECTRONICS.
21 *
22 * SAMSUNG make no representations or warranties about the suitability
23 * of the software, either express or implied, including but not limited
24 * to the implied warranties of merchantability, fitness for a particular
25 * purpose, or non-infringement. SAMSUNG shall not be liable for any
26 * damages suffered by licensee as a result of using, modifying or
27 * distributing this software or its derivatives.
28 *
29 */
30
31 #ifndef SMS_PLUGIN_TYPES_H
32 #define SMS_PLUGIN_TYPES_H
33
34
35 /*==================================================================================================
36                                          INCLUDE FILES
37 ==================================================================================================*/
38 #include "MsgInternalTypes.h"
39 #include "MsgStorageTypes.h"
40 #include "MsgSettingTypes.h"
41
42
43 /*==================================================================================================
44                                     DEFINES
45 ==================================================================================================*/
46 #define MAX_ADDRESS_LEN                         21 // including '+'
47 #define MAX_USER_DATA_LEN                       160
48 #define MAX_GSM_7BIT_DATA_LEN           160
49 #define MAX_UCS2_DATA_LEN                       140
50 #define MAX_TPDU_DATA_LEN                       165
51 #define MAX_SMSC_LEN                            20
52 #define MAX_ADD_PARAM_LEN                       12
53 #define MAX_ABS_TIME_PARAM_LEN          7
54 #define MAX_REL_TIME_PARAM_LEN          1
55 #define MAX_UD_HEADER_NUM                       7
56 #define MAX_SAT_TPDU_LEN                        175
57 #define MAX_CBMSG_PAGE_SIZE             93
58 #define MAX_CBMSG_PAGE_NUM              15
59 #define MAX_SIM_SMS_NUM                 90
60
61 #define SMS_PUSH_XML_HREF_TAG           "href"
62 #define SMS_PUSH_XML_SI_ID_TAG          "si-id"
63 #define SMS_PUSH_XML_CREATED_TAG        "created"
64 #define SMS_PUSH_XML_EXPIRES_TAG        "si-expires"
65 #define SMS_PUSH_XML_ACTION_TAG "action"
66
67 #define SMS_PUSH_XML_INVAL_OBJ          "invalidate-object"
68 #define SMS_PUSH_XML_INVAL_SVC          "invalidate-service"
69 #define SMS_PUSH_XML_CO_URI             "uri"
70
71
72 /*==================================================================================================
73                                          TYPES
74 ==================================================================================================*/
75
76 /**
77 \brief Represents TPDU Type.
78 */
79 typedef unsigned char SMS_TPDU_TYPE_T;
80
81 /**
82 \brief Represents TPDU Type.
83 */
84 typedef unsigned char SMS_VPF_T;
85
86 /**
87 \brief Represents TPDU Type.
88 */
89 typedef unsigned char SMS_TON_T;
90
91 /**
92 \brief Represents TPDU Type.
93 */
94 typedef unsigned char SMS_NPI_T;
95
96 /**
97 \brief Represents TPDU Type.
98 */
99 typedef unsigned char SMS_PID_T;
100
101
102 /**
103 \brief Represents TPDU Type.
104 */
105 typedef unsigned char SMS_MSG_CLASS_T;
106
107
108 /**
109 \brief Represents TPDU Type.
110 */
111 typedef unsigned char SMS_CODING_SCHEME_T;
112
113
114 /**
115 \brief Represents TPDU Type.
116 */
117 typedef unsigned char SMS_CODING_GROUP_T;
118
119
120 /**
121 \brief Represents TPDU Type.
122 */
123 typedef unsigned char SMS_INDICATOR_TYPE_T;
124
125
126 /**
127 \brief Represents TPDU Type.
128 */
129 typedef unsigned char SMS_TIME_FORMAT_T;
130
131
132 /**
133 \brief Represents TPDU Type.
134 */
135 typedef unsigned char SMS_FAIL_CAUSE_T;
136
137
138 /**
139 \brief Represents TPDU Type.
140 */
141 typedef unsigned char SMS_STATUS_T;
142
143
144 /**
145 \brief Represents TPDU Type.
146 */
147 typedef unsigned char SMS_REF_NUMBER_T;
148
149
150 /**
151 \brief Represents TPDU Type.
152 */
153 typedef unsigned char SMS_REPORT_TYPE_T;
154
155
156 /**
157 \brief Represents TPDU Type.
158 */
159 typedef unsigned char SMS_UDH_TYPE_T;
160
161
162 /**
163 \brief Represents WAP Push App Code.
164 */
165 typedef unsigned char SMS_WAP_APP_CODE_T;
166
167
168 typedef unsigned char SMS_CB_NETWORK_TYPE_T;
169
170
171 typedef unsigned char SMS_CBMSG_TYPE_T;
172
173
174 typedef unsigned char SMS_CBMSG_LANG_TYPE_T;
175
176
177 typedef unsigned char SMS_CBMSG_CODING_GROUP_T;
178
179
180 typedef unsigned char SMS_SAT_CMD_TYPE_T;
181
182
183 typedef unsigned short SMS_SIM_EFILE_NAME_T;
184
185
186 typedef unsigned char SMS_LANGUAGE_ID_T;
187
188
189 /*==================================================================================================
190                                     ENUMS
191 ==================================================================================================*/
192 enum _SMS_TPDU_TYPE_E
193 {
194         SMS_TPDU_SUBMIT,
195         SMS_TPDU_DELIVER,
196         SMS_TPDU_DELIVER_REP,
197         SMS_TPDU_STATUS_REP,
198 };
199
200
201 enum _SMS_VPF_E
202 {
203         SMS_VPF_NOT_PRESENT = 0,
204         SMS_VPF_ENHANCED,
205         SMS_VPF_RELATIVE,
206         SMS_VPF_ABSOLUTE,
207 };
208
209
210 enum _SMS_TON_E
211 {
212         SMS_TON_UNKNOWN = 0,            /* unknown */
213         SMS_TON_INTERNATIONAL,  /* international */
214         SMS_TON_NATIONAL,                       /* national */
215         SMS_TON_NETWORK,                        /* network */
216         SMS_TON_SUBSCRIBER,             /* subscriber */
217         SMS_TON_ALPHANUMERIC,           /* alpha numberic */
218         SMS_TON_ABBREVIATED,            /* abbreviated */
219         SMS_TON_RESERVE,                        /* reserve */
220 };
221
222
223 enum _SMS_NPI_E
224 {
225         SMS_NPI_UNKNOWN = 0,            /* unknown */
226         SMS_NPI_ISDN = 1,                       /* idsn */
227         SMS_NPI_DATA = 3,                       /* data */
228         SMS_NPI_TELEX = 4,                      /* telex */
229         SMS_NPI_SMSC = 5,                       /* smsc */
230         SMS_NPI_NATIONAL = 8,           /* national */
231         SMS_NPI_PRIVATE = 9,                    /* private */
232         SMS_NPI_ERMES = 10,                     /* ermes */
233 };
234
235
236 enum _SMS_PID_E
237 {
238         SMS_PID_NORMAL = 0x00,
239
240         SMS_PID_TELEX = 0x21,
241         SMS_PID_GROUP3_TELEX = 0x22,
242         SMS_PID_GROUP4_TELEX = 0x23,
243         SMS_PID_VOICE = 0x24,
244         SMS_PID_ERMES = 0x25,
245         SMS_PID_NPS = 0x26,
246         SMS_PID_VIDEO = 0x27,
247         SMS_PID_TELETEX_UNSPEC = 0x28,
248         SMS_PID_TELETEX_PSPDN = 0x29,
249         SMS_PID_TELETEX_CSPDN = 0x2A,
250         SMS_PID_TELETEX_PSTN = 0x2B,
251         SMS_PID_TELETEX_ISDN = 0x2C,
252         SMS_PID_UCI = 0x2D,
253         SMS_PID_x400 = 0x31,
254         SMS_PID_EMAIL = 0x32,
255
256         SMS_PID_TYPE0 = 0x40,
257         SMS_PID_REPLACE_TYPE1 = 0x41,
258         SMS_PID_REPLACE_TYPE2 = 0x42,
259         SMS_PID_REPLACE_TYPE3 = 0x43,
260         SMS_PID_REPLACE_TYPE4 = 0x44,
261         SMS_PID_REPLACE_TYPE5 = 0x45,
262         SMS_PID_REPLACE_TYPE6 = 0x46,
263         SMS_PID_REPLACE_TYPE7 = 0x47,
264
265         SMS_PID_RETURN_CALL = 0x5F,
266 };
267
268
269 enum _SMS_MSG_CLASS_E
270 {
271         SMS_MSG_CLASS_0 = 0,
272         SMS_MSG_CLASS_1,
273         SMS_MSG_CLASS_2,
274         SMS_MSG_CLASS_3,
275         SMS_MSG_CLASS_NONE,
276 };
277
278
279 enum _SMS_CODING_SCHEME_E
280 {
281         SMS_CHARSET_7BIT = 0,
282         SMS_CHARSET_8BIT,
283         SMS_CHARSET_UCS2,
284         SMS_CHARSET_AUTO,
285 };
286
287
288 enum _SMS_CODING_GROUP_E
289 {
290         SMS_GROUP_GENERAL = 0,
291         SMS_GROUP_CODING_CLASS,
292         SMS_GROUP_DELETION,
293         SMS_GROUP_DISCARD,
294         SMS_GROUP_STORE,
295         SMS_GROUP_UNKNOWN,
296 };
297
298
299 enum _SMS_INDICATOR_TYPE_E
300 {
301         SMS_VOICE_INDICATOR = 0,
302         SMS_FAX_INDICATOR,
303         SMS_EMAIL_INDICATOR,
304         SMS_OTHER_INDICATOR,
305 };
306
307
308 enum _SMS_TIME_FORMAT_E
309 {
310         SMS_TIME_RELATIVE = 0,
311         SMS_TIME_ABSOLUTE
312 };
313
314
315 enum _SMS_FAIL_CAUSE_E
316 {
317         SMS_FC_MSG_TYPE0_NOT_SUPPORTED = 0x81,
318         SMS_FC_SM_CANNOT_BE_REPLACED = 0x82,
319         SMS_FC_UNSPEC_PID_ERROR = 0x8F,
320         SMS_FC_MSG_CLASS_NOT_SUPPORTED = 0x91,
321         SMS_FC_UNSPEC_DCS_ERROR = 0x9F,
322         SMS_FC_TPDU_NOT_SUPPORTED = 0xB0,
323         SMS_FC_SIM_STORAGE_FULL = 0xD0,
324         SMS_FC_NO_STORAGE_IN_SIM = 0xD1,
325         SMS_FC_ERROR_IN_MS = 0xD2,
326         SMS_FC_MSG_CAPA_EXCEEDED = 0xD3,
327         SMS_FC_SAT_BUSY = 0xD4,
328         SMS_FC_SIM_DOWNLOAD_ERROR = 0xD5,
329         SMS_FC_UNSPEC_ERROR = 0xFF,
330 };
331
332
333 enum _SMS_STATUS_E
334 {
335         SMS_STATUS_RECEIVE_SUCCESS = 0x00,
336         SMS_STATUS_UNABLE_TO_CONFIRM_DELIVER = 0x01,
337         SMS_STATUS_REPLACED = 0x02,
338         SMS_STATUS_SMSC_SPECIFIC_LAST = 0x1F,
339
340         SMS_STATUS_TRY_CONGESTION = 0x20,
341         SMS_STATUS_TRY_SME_BUSY = 0x21,
342         SMS_STATUS_TRY_NO_RESPONSE = 0x22,
343         SMS_STATUS_TRY_SERVICE_REJECTED = 0x23,
344         SMS_STATUS_TRY_QOS_NOT_AVAILABLE = 0x24,
345
346         SMS_STATUS_PERM_REMOTE_ERROR = 0x40,
347         SMS_STATUS_PERM_IMCOMPATIBLE_DEST = 0x41,
348         SMS_STATUS_PERM_CONNECTION_REJECTED = 0x42,
349         SMS_STATUS_PERM_NOT_OBTAINABLE = 0x43,
350         SMS_STATUS_PERM_QOS_NOT_AVAILABLE = 0x44,
351         SMS_STATUS_PERM_NO_INTERWORK_AVAILABLE = 0x45,
352         SMS_STATUS_PERM_MSG_VAL_PERIOD_EXPIRED = 0x46,
353         SMS_STATUS_PERM_MSG_DEL_BY_ORIGIN_SME = 0x47,
354         SMS_STATUS_PERM_MSG_DEL_BY_SMSC_ADMIN = 0x48,
355         SMS_STATUS_PERM_MSG_NOT_EXIST = 0x49,
356
357         SMS_STATUS_TEMP_CONGESTION = 0x60,
358         SMS_STATUS_TEMP_SME_BUSY = 0x61,
359         SMS_STATUS_TEMP_NO_RESPONSE = 0x62,
360         SMS_STATUS_TEMP_SERVICE_REJECTED = 0x63,
361         SMS_STATUS_TEMP_QOS_NOT_AVAILABLE = 0x64,
362         SMS_STATUS_TEMP_ERROR_IN_SME = 0x65,
363 };
364
365
366 enum _SMS_REF_NUMBER_E
367 {
368         SMS_REF_NUM_8BIT = 0,
369         SMS_REF_NUM_16BIT
370 };
371
372
373 enum _SMS_REPORT_TYPE_E
374 {
375         SMS_REPORT_POSITIVE = 0,
376         SMS_REPORT_NEGATIVE
377 };
378
379
380 enum _SMS_UDH_TYPE_E
381 {
382         SMS_UDH_CONCAT_8BIT = 0x00,
383         SMS_UDH_SPECIAL_SMS = 0x01,
384         // 0x02, 0x03 - Reserved
385         SMS_UDH_APP_PORT_8BIT = 0x04,
386         SMS_UDH_APP_PORT_16BIT = 0x05,
387         SMS_UDH_SC_CONTROL = 0x06,
388         SMS_UDH_SRC_IND = 0x07,
389         SMS_UDH_CONCAT_16BIT = 0x08,
390         SMS_UDH_WCMP = 0x09,
391         SMS_UDH_ALTERNATE_REPLY_ADDRESS = 0x22,
392         SMS_UDH_SINGLE_SHIFT = 0x24,
393         SMS_UDH_LOCKING_SHIFT = 0x25,
394         SMS_UDH_NONE = 0xFF,
395 };
396
397
398 enum _SMS_WAP_APP_CODE_E
399 {
400         SMS_WAP_APPLICATION_DEFAULT = 0x00,
401
402         SMS_WAP_APPLICATION_PUSH_SI,
403         SMS_WAP_APPLICATION_PUSH_SIC,
404
405         SMS_WAP_APPLICATION_PUSH_SL,
406         SMS_WAP_APPLICATION_PUSH_SLC,
407
408         SMS_WAP_APPLICATION_PUSH_CO,
409         SMS_WAP_APPLICATION_PUSH_COC,
410
411         SMS_WAP_APPLICATION_MMS_UA,
412
413         SMS_WAP_APPLICATION_PUSH_SIA,
414
415         SMS_WAP_APPLICATION_SYNCML_DM_BOOTSTRAP,
416         SMS_WAP_APPLICATION_SYNCML_DM_BOOTSTRAP_XML,
417         SMS_WAP_APPLICATION_SYNCML_DM_NOTIFICATION,
418         SMS_WAP_APPLICATION_SYNCML_DS_NOTIFICATION,
419         SMS_WAP_APPLICATION_SYNCML_DS_NOTIFICATION_WBXML,
420
421         SMS_WAP_APPLICATION_LOC_UA_WBXML,
422         SMS_WAP_APPLICATION_LOC_UA_XML,
423
424         SMS_WAP_APPLICATION_DRM_UA_XML,
425         SMS_WAP_APPLICATION_DRM_UA_MESSAGE,
426         SMS_WAP_APPLICATION_DRM_UA_CONETENT,
427         SMS_WAP_APPLICATION_DRM_UA_RIGHTS_XML,
428         SMS_WAP_APPLICATION_DRM_UA_RIGHTS_WBXML,
429         SMS_WAP_APPLICATION_DRM_V2_RO_XML,
430         SMS_WAP_APPLICATION_DRM_V2_ROAP_PDU_XML,
431         SMS_WAP_APPLICATION_DRM_V2_ROAP_TRIGGER_XML,
432         SMS_WAP_APPLICATION_DRM_V2_ROAP_TRIGGER_WBXML,
433
434         SMS_WAP_APPLICATION_PUSH_PROVISIONING,
435         SMS_WAP_APPLICATION_PUSH_PROVISIONING_XML,
436         SMS_WAP_APPLICATION_PUSH_PROVISIONING_WBXML,
437
438         SMS_WAP_APPLICATION_PUSH_BROWSER_SETTINGS,
439         SMS_WAP_APPLICATION_PUSH_BROWSER_BOOKMARKS,
440         SMS_WAP_APPLICATION_PUSH_SYNCSET_WBXML,
441         SMS_WAP_APPLICATION_PUSH_SYNCSET_XML,
442
443         SMS_WAP_APPLICATION_PUSH_EMAIL_XML,
444         SMS_WAP_APPLICATION_PUSH_EMAIL_WBXML,
445
446         SMS_WAP_APPLICATION_PUSH_IMPS_CIR,
447
448         SMS_WAP_APPLICATION_PUSH_WAP_WMLC,
449
450         SMS_WAP_APPLICATION_WML_UA,
451         SMS_WAP_APPLICATION_WTA_UA,
452
453         SMS_WAP_APPLICATION_PUSH_SYNCML,
454         SMS_WAP_APPLICATION_LOC_UA,
455         SMS_WAP_APPLICATION_SYNCML_DM,
456         SMS_WAP_APPLICATION_PUSH_EMAIL,
457
458         SMS_OMA_APPLICATION_ULP_UA,
459         SMS_OMA_APPLICATION_DLOTA_UA,
460
461         SMS_WAP_APPLICATION_LBS,
462 };
463
464
465 enum _SMS_CB_NETWORK_TYPE_E
466 {
467         SMS_CB_NETWORK_TYPE_2G_GSM = 1,
468         SMS_CB_NETWORK_TYPE_3G_UMTS,
469 };
470
471
472 enum _SMS_CBMSG_TYPE_E
473 {
474         SMS_CBMSG_TYPE_CBS = 1,         /**< CBS */
475         SMS_CBMSG_TYPE_SCHEDULE,                /**< Schedule */
476         SMS_CBMSG_TYPE_CBS41,                   /**< CBS41 */
477         SMS_CBMSG_TYPE_JAVACBS,         /**< JAVA-CB Message*/
478 };
479
480
481 enum _SMS_CBMSG_LANG_TYPE_E
482 {
483         SMS_CBMSG_LANG_GERMAN                   = 0x00,
484         SMS_CBMSG_LANG_ENGLISH                  = 0x01,
485         SMS_CBMSG_LANG_ITALIAN                  = 0x02,
486         SMS_CBMSG_LANG_FRENCH                   = 0x03,
487         SMS_CBMSG_LANG_SPANISH                  = 0x04,
488         SMS_CBMSG_LANG_DUTCH                    = 0x05,
489         SMS_CBMSG_LANG_SWEDISH          = 0x06,
490         SMS_CBMSG_LANG_DANISH                   = 0x07,
491         SMS_CBMSG_LANG_PORTUGUESE       = 0x08,
492         SMS_CBMSG_LANG_FINNISH                  = 0x09,
493         SMS_CBMSG_LANG_NORWEGIAN        = 0x0a,
494         SMS_CBMSG_LANG_GREEK                    = 0x0b,
495         SMS_CBMSG_LANG_TURKISH                  = 0x0c,
496         SMS_CBMSG_LANG_HUNGARIAN        = 0x0d,
497         SMS_CBMSG_LANG_POLISH                   = 0x0e,
498         SMS_CBMSG_LANG_UNSPECIFIED      = 0x0f,
499
500         SMS_CBMSG_LANG_ISO639           = 0x10,
501
502         SMS_CBMSG_LANG_CZECH                    = 0x20,
503         SMS_CBMSG_LANG_HEBREW           = 0x21,
504         SMS_CBMSG_LANG_ARABIC           = 0x22,
505         SMS_CBMSG_LANG_RUSSIAN          = 0x23,
506         SMS_CBMSG_LANG_ICELANDIC                = 0x24,
507         SMS_CBMSG_LANG_RESERVED_25      = 0x25,
508         SMS_CBMSG_LANG_RESERVED_26      = 0x26,
509         SMS_CBMSG_LANG_RESERVED_27      = 0x27,
510         SMS_CBMSG_LANG_RESERVED_28      = 0x28,
511         SMS_CBMSG_LANG_RESERVED_29      = 0x29,
512         SMS_CBMSG_LANG_RESERVED_2A      = 0x2a,
513         SMS_CBMSG_LANG_RESERVED_2B      = 0x2b,
514         SMS_CBMSG_LANG_RESERVED_2C      = 0x2c,
515         SMS_CBMSG_LANG_RESERVED_2D      = 0x2d,
516         SMS_CBMSG_LANG_RESERVED_2E      = 0x2e,
517         SMS_CBMSG_LANG_RESERVED_2F      = 0x2f,
518
519         SMS_CBMSG_LANG_DUMMY                    = 0xFF
520 };
521
522
523 enum _SMS_CBMSG_CODING_GROUP_E
524 {
525         SMS_CBMSG_CODGRP_GENERAL_DCS,                   /**< Bits 7..4 00xx */
526         SMS_CBMSG_CODGRP_WAP,                                   /**< 1110 Cell Broadcast */
527         SMS_CBMSG_CODGRP_CLASS_CODING,                  /**< 1111 Cell Broadcast */
528 };
529
530
531 enum _SMS_SAT_CMD_TYPE_E
532 {
533         SMS_SAT_CMD_REFRESH,
534         SMS_SAT_CMD_SEND_SMS,
535         SMS_SAT_CMD_SMS_CTRL,
536 };
537
538
539 enum _SMS_SIM_EFILE_NAME_E
540 {
541         SMS_SIM_EFILE_USIM_SMS  = 0x6A3C,               /** < USIM Short Messages file */
542         SMS_SIM_EFILE_USIM_SMSP = 0x6A42,               /** < USIM SMS parameter */
543         SMS_SIM_EFILE_USIM_SMSS = 0x6A43,               /** < USIM SMS status */
544         SMS_SIM_EFILE_USIM_CBMI = 0x6A45,               /** < USIM Cell Broadcast Message Identifier */
545         SMS_SIM_EFILE_USIM_MBDN = 0x6FC7,               /** < USIM Mail Box Dialing Number */
546         SMS_SIM_EFILE_SMS                       = 0x6F3C,               /** < Short Messages file */
547         SMS_SIM_EFILE_SMSP                      = 0x6F42,               /** < SMS Parameter */
548         SMS_SIM_EFILE_SMSS                      = 0x6F43,               /** < SMS Status */
549         SMS_SIM_EFILE_CBMI                      = 0x6F45,               /** < Cell Broadcast Message Identifier */
550         SMS_SIM_EFILE_MBDN              = 0x6FC7,               /** < Mail Box Dialing Number */
551 };
552
553
554 enum _SMS_LANGUAGE_ID_E
555 {
556         SMS_LANG_ID_RESERVED = 0,
557         SMS_LANG_ID_TURKISH,
558         SMS_LANG_ID_SPANISH,
559         SMS_LANG_ID_PORTUGUESE,
560         SMS_LANG_ID_BENGALI,
561         SMS_LANG_ID_GUJARATI,
562         SMS_LANG_ID_HINDI,
563         SMS_LANG_ID_KANNADA,
564         SMS_LANG_ID_MALAYALAM,
565         SMS_LANG_ID_ORIYA,
566         SMS_LANG_ID_PUNJABI,
567         SMS_LANG_ID_TAMIL,
568         SMS_LANG_ID_TELUGU,
569         SMS_LANG_ID_URDU,
570 };
571
572
573 /*==================================================================================================
574                                          STRUCTURES
575 ==================================================================================================*/
576 typedef struct _SMS_ADDRESS_S
577 {
578         SMS_TON_T               ton;
579         SMS_NPI_T               npi;
580         char                            address[MAX_ADDRESS_LEN+1];        /* < null terminated string */
581 } SMS_ADDRESS_S;
582
583
584 typedef struct _SMS_DCS_S
585 {
586         bool                                            bCompressed;
587         bool                                            bMWI;
588         bool                                            bIndActive;
589         SMS_MSG_CLASS_T                 msgClass;
590         SMS_CODING_SCHEME_T     codingScheme;
591         SMS_CODING_GROUP_T              codingGroup;
592         SMS_INDICATOR_TYPE_T            indType;
593 } SMS_DCS_S;
594
595
596 typedef struct _SMS_TIME_REL_S
597 {
598         unsigned char time;
599 } SMS_TIME_REL_S;
600
601
602 typedef struct _SMS_TIME_ABS_S
603 {
604         unsigned char year;
605         unsigned char month;
606         unsigned char day;
607         unsigned char hour;
608         unsigned char minute;
609         unsigned char second;
610         unsigned char timeZone;
611 } SMS_TIME_ABS_S;
612
613
614 typedef struct _SMS_TIMESTAMP_S
615 {
616         SMS_TIME_FORMAT_T format;
617
618         union
619         {
620                 SMS_TIME_REL_S  relative;
621                 SMS_TIME_ABS_S  absolute;
622         } time;
623 } SMS_TIMESTAMP_S;
624
625
626 typedef struct _SMS_CONCAT_8BIT_S
627 {
628         unsigned char           msgRef;
629         unsigned char           totalSeg;
630         unsigned char           seqNum;
631 } SMS_CONCAT_8BIT_S;
632
633
634 typedef struct _SMS_CONCAT_16BIT_S
635 {
636         unsigned short          msgRef;
637         unsigned char           totalSeg;
638         unsigned char           seqNum;
639 } SMS_CONCAT_16BIT_S;
640
641
642 typedef struct _SMS_APP_PORT_8BIT_S
643 {
644         unsigned char           destPort;
645         unsigned char           originPort;
646 } SMS_APP_PORT_8BIT_S;
647
648
649 typedef struct _SMS_APP_PORT_16BIT_S
650 {
651         unsigned short          destPort;
652         unsigned short          originPort;
653 } SMS_APP_PORT_16BIT_S;
654
655
656 typedef struct _SMS_SPECIAL_INDICATION_S
657 {
658         bool                            bStore;
659         unsigned short          msgInd;
660         unsigned short          waitMsgNum;
661 } SMS_SPECIAL_INDICATION_S;
662
663
664 typedef struct _SMS_SINGLE_SHIFT_S
665 {
666         SMS_LANGUAGE_ID_T       langId;
667 } SMS_SINGLE_SHIFT_S;
668
669
670 typedef struct _SMS_LOCKING_SHIFT_S
671 {
672         SMS_LANGUAGE_ID_T       langId;
673 } SMS_LOCKING_SHIFT_S;
674
675
676 typedef struct _SMS_UDH_S
677 {
678         SMS_UDH_TYPE_T udhType;
679
680         union
681         {
682                 SMS_CONCAT_8BIT_S                       concat8bit;
683                 SMS_CONCAT_16BIT_S                      concat16bit;
684                 SMS_APP_PORT_8BIT_S             appPort8bit;
685                 SMS_APP_PORT_16BIT_S            appPort16bit;
686                 SMS_SPECIAL_INDICATION_S        specialInd;
687                 SMS_SINGLE_SHIFT_S                      singleShift;
688                 SMS_LOCKING_SHIFT_S                     lockingShift;
689                 SMS_ADDRESS_S                           alternateAddress;
690         } udh;
691 } SMS_UDH_S;
692
693
694 typedef struct _SMS_USERDATA_S
695 {
696         int                     headerCnt;
697         SMS_UDH_S       header[MAX_UD_HEADER_NUM];
698         int                     length;
699         char                    data[MAX_USER_DATA_LEN+1];
700 } SMS_USERDATA_S;
701
702
703 typedef struct _SMS_TPUD_S
704 {
705         int             udl;
706         char            ud[MAX_USER_DATA_LEN+1];
707 } SMS_TPUD_S;
708
709
710 typedef struct _SMS_SUBMIT_S
711 {
712         bool                            bRejectDup;
713         bool                            bStatusReport;
714         bool                            bHeaderInd;
715         bool                            bReplyPath;
716         unsigned char           msgRef;
717         SMS_VPF_T               vpf;
718         SMS_ADDRESS_S   destAddress;
719         SMS_PID_T               pid;
720         SMS_DCS_S               dcs;
721         SMS_TIMESTAMP_S validityPeriod;
722         SMS_USERDATA_S  userData;
723 } SMS_SUBMIT_S;
724
725
726 typedef struct _SMS_SUBMIT_DATA_S
727 {
728         SMS_ADDRESS_S   destAddress;
729         unsigned int            segCount;
730         SMS_USERDATA_S  userData[MAX_SEGMENT_NUM];
731 } SMS_SUBMIT_DATA_S;
732
733
734 typedef struct _SMS_DELIVER_S
735 {
736         bool                            bMoreMsg;
737         bool                            bStatusReport;
738         bool                            bHeaderInd;
739         bool                            bReplyPath;
740         SMS_ADDRESS_S   originAddress;
741         SMS_PID_T               pid;
742         SMS_DCS_S               dcs;
743         SMS_TIMESTAMP_S timeStamp;
744         SMS_USERDATA_S  userData;
745         SMS_TPUD_S              udData;
746 } SMS_DELIVER_S;
747
748
749 typedef struct _SMS_DELIVER_REPORT_S
750 {
751         SMS_REPORT_TYPE_T       reportType;
752         bool                                    bHeaderInd;
753         SMS_FAIL_CAUSE_T                failCause;
754         unsigned char                   paramInd;
755         SMS_PID_T                       pid;
756         SMS_DCS_S                       dcs;
757         SMS_USERDATA_S          userData;
758 } SMS_DELIVER_REPORT_S;
759
760
761 typedef struct _SMS_STATUS_REPORT_S
762 {
763         bool                            bMoreMsg;
764         bool                            bStatusReport;
765         bool                            bHeaderInd;
766         unsigned char           msgRef;
767         SMS_ADDRESS_S   recipAddress;
768         SMS_TIMESTAMP_S timeStamp;
769         SMS_TIMESTAMP_S dischargeTime;
770         SMS_STATUS_T    status;
771         unsigned char           paramInd;
772         SMS_PID_T               pid;
773         SMS_DCS_S               dcs;
774         SMS_USERDATA_S  userData;
775 } SMS_STATUS_REPORT_S;
776
777
778 typedef struct _SMS_TPDU_S
779 {
780         SMS_TPDU_TYPE_T tpduType;
781
782         union
783         {
784                 SMS_SUBMIT_S                    submit;
785                 SMS_DELIVER_S                   deliver;
786                 SMS_DELIVER_REPORT_S    deliverRep;
787                 SMS_STATUS_REPORT_S             statusRep;
788         } data;
789 } SMS_TPDU_S;
790
791
792 typedef struct
793 {
794         MSG_REQUEST_ID_T                reqId;          /**< Indicates the request ID, which is unique.
795                                                                                 When applications submit a request to the framework, this value will be set by the framework. */
796         MSG_MESSAGE_INFO_S              msgInfo;        /**< Indicates the message structure to be sent by applications. */
797         MSG_SENDINGOPT_INFO_S   sendOptInfo;
798
799         bool                                            bReqCb;
800 } SMS_REQUEST_INFO_S;
801
802
803 typedef struct _SMS_SENT_INFO_S
804 {
805         SMS_REQUEST_INFO_S              reqInfo;                /**< Indicates the corresponding request structure. */
806         bool                                            bLast;
807 } SMS_SENT_INFO_S;
808
809
810 typedef struct _SMS_PUSH_APP_INFO_S
811 {
812         char*                           pContentType;
813         char*                           pAppId;
814         SMS_WAP_APP_CODE_T      appCode;
815 } SMS_PUSH_APP_INFO_S;
816
817
818 typedef struct _SMS_CBMSG_SERIAL_NUM_S
819 {
820         unsigned char           geoScope;
821         unsigned char           updateNum;
822         unsigned short          msgCode;
823 } SMS_CBMSG_SERIAL_NUM_S;
824
825
826 typedef struct _SMS_CBMSG_DCS_S
827 {
828         SMS_CBMSG_CODING_GROUP_T                codingGroup;            /**< Coding group, GSM 03.38 */
829         SMS_MSG_CLASS_T                                 classType;              /**< The message class */
830         bool                                                            bCompressed;            /**< if text is compressed this is TRUE */
831         SMS_CODING_SCHEME_T                     codingScheme;   /**< How to encode a message. */
832         SMS_CBMSG_LANG_TYPE_T                           langType;
833         unsigned char                                           iso639Lang[3];  /* 2 GSM chars and a CR char */
834         bool                                                            bUDH;
835         unsigned char                                           rawData;
836 } SMS_CBMSG_DCS_S;
837
838
839 typedef struct _SMS_CBMSG_HEADER_S
840 {
841         SMS_CBMSG_SERIAL_NUM_S          serialNum;              /**< Cell Broadcast Serial number */
842         unsigned short                                  msgId;                  /**< Message identifier code */
843         MSG_CB_LANGUAGE_TYPE_T          langType;               /**< Languages in CB Messages */
844         SMS_CBMSG_DCS_S                 dcs;                            /**< Data coding scheme */
845         unsigned char                                   page;                   /**< current page number */
846         unsigned char                                   totalPages;             /**< Total number of pages in this messages */
847         time_t                                          recvTime;               /**< Msg Recv Time */
848 } SMS_CBMSG_HEADER_S;
849
850
851 typedef struct _SMS_CBMSG_PAGE_S
852 {
853         SMS_CBMSG_TYPE_T                        cbMsgType;                                                      /*CBS Msg or SCHEDULE Msg or CBS41 Msg */
854         SMS_CBMSG_HEADER_S                      pageHeader;                                                     /**< CB Message Header */
855         int                                                     pageLength;                                                     /**< message string length */
856         char                                                    pageData[MAX_CBMSG_PAGE_SIZE+1];                /**< user data */
857 } SMS_CBMSG_PAGE_S;
858
859
860 typedef struct _SMS_CBMSG_S
861 {
862         SMS_CBMSG_TYPE_T                        cbMsgType;                                                      /*CBS Msg or SCHEDULE Msg or CBS41 Msg */
863         unsigned short                                  msgId;                                                          /**< Message identifier code */
864         SMS_MSG_CLASS_T                         classType;                                                      /**< The message class */
865         SMS_CODING_SCHEME_T             codingScheme;                                           /**< How to encode a message. */
866         time_t                                          recvTime;                                                       /**< Msg Recv Time */
867         int                                                     msgLength;                                                      /**< message string length */
868         char                                                    msgData[MAX_CBMSG_PAGE_SIZE*MAX_CBMSG_PAGE_NUM+1];              /**< user data */
869 } SMS_CBMSG_S;
870
871
872 typedef struct _SMS_LANG_INFO_S
873 {
874         bool                                                    bSingleShift;
875         bool                                                    bLockingShift;
876
877         SMS_LANGUAGE_ID_T                       singleLang;
878         SMS_LANGUAGE_ID_T                       lockingLang;
879 } SMS_LANG_INFO_S;
880
881
882 typedef struct _SMS_WSP_CONTENTS_TYPE_S
883 {
884         char*         contentsTypeName;
885         unsigned char contentsTypeCode;
886 } SMS_WSP_CONTENTS_TYPE_S;
887
888
889 typedef struct _SMS_WSP_CHARSET_S
890 {
891         char*  charsetName;
892         unsigned short charsetCode;
893 } SMS_WSP_CHARSET_S;
894
895
896 typedef struct _SMS_WAP_UNREGISTER_CONTENTS_TYPE_S
897 {
898         char*         contentsTypeName;
899         unsigned short contentsTypeCode;
900 } SMS_WAP_UNREGISTER_CONTENTS_TYPE_S;
901
902
903 typedef struct _SMS_WSP_LANGUAGE_S
904 {
905         char*         languageName;
906         unsigned char languageCode;
907 } SMS_WSP_LANGUAGE_S;
908
909
910 typedef struct _SMS_WSP_HEADER_PARAMETER_S
911 {
912         char*         parameterToken;
913         unsigned char parameterCode;
914 } SMS_WSP_HEADER_PARAMETER_S;
915
916
917 typedef struct _SMS_WSP_METHOD_TYPE_S
918 {
919         char*         methodName;
920         unsigned char methodCode;
921 } SMS_WSP_METHOD_TYPE_S;
922
923
924 typedef struct _SMS_WSP_SECURITY_TYPE_S
925 {
926         char*         SecurityTypeName;
927         unsigned char SecurityTypeCode;
928 }SMS_WSP_SECURITY_TYPE_S;
929
930
931 /**
932  *      @brief  Represents SIM count information.
933  */
934 typedef struct
935 {
936         unsigned int    totalCount;                     /**< The total number of SIM */
937         int                     usedCount;                      /**< The used number of SIM */
938         int                     indexList[MAX_SIM_SMS_NUM];     /**< The SIM index list */
939 }MSG_SIM_COUNT_S;
940
941
942 /**
943  *      @brief  Represents Concat SIM Msg information.
944  */
945 typedef struct
946 {
947         unsigned int            simIdCnt;                                                                                       /**< The total number of SIM Msg ID*/
948         MSG_SIM_ID_T            simIdList[MAX_SEGMENT_NUM];                                                     /**< The SIM Msg ID List */
949         char                            msgData[(MAX_MSG_DATA_LEN*MAX_SEGMENT_NUM)+1];          /**< user data */
950 } SMS_CONCAT_SIM_MSG_S;
951
952 #endif //SMS_PLUGIN_TYPES_H
953