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