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