3c272440919fd69eb939470929f476170e0f58a0
[framework/telephony/libtcore.git] / include / type / sms.h
1 /*
2  * libtcore
3  *
4  * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Ja-young Gu <jygu@samsung.com>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20
21 #ifndef __TYPE_SMS_H__
22 #define __TYPE_SMS_H__
23
24 __BEGIN_DECLS
25
26 /*
27         TREQ_SMS_SEND_UMTS_MSG,
28         TREQ_SMS_READ_MSG,
29         TREQ_SMS_SAVE_MSG,
30         TREQ_SMS_DELETE_MSG,
31         TREQ_SMS_GET_COUNT,
32         TREQ_SMS_GET_SCA,
33         TREQ_SMS_SET_SCA,
34         TREQ_SMS_GET_CB_CONFIG,
35         TREQ_SMS_SET_CB_CONFIG,
36         TREQ_SMS_SET_MEM_STATUS,
37         TREQ_SMS_GET_PREF_BEARER,
38         TREQ_SMS_SET_PREF_BEARER,
39         TREQ_SMS_SET_DELIVERY_REPORT,
40         TREQ_SMS_SET_MSG_STATUS,
41         TREQ_SMS_GET_PARAMS,
42         TREQ_SMS_SET_PARAMS,
43         TREQ_SMS_GET_PARAMCNT,
44         TREQ_SMS_SEND_CDMA_MSG,
45
46         TREQ_PS_ACTIVATE_CONTEXT,
47         TREQ_PS_DEACTIVATE_CONTEXT,
48         TREQ_PS_PDP_ACTIVATE,
49         TREQ_PS_PDP_DEACTIVATE,
50         TREQ_PS_SET_DORMANT,
51         TREQ_PS_SET_PORT_LIST,
52         TREQ_PS_GET_PORT_LIST,
53         TREQ_PS_DUN_PIN_CONTROL,
54 */
55
56 #define SMS_SMSP_ADDRESS_LEN                                    20              /* EF-SMSP digit length */
57 #define SMS_SMDATA_SIZE_MAX                                     165             /* Maximum SMS data size that can be stored*/
58 #define SMS_GSM_SMS_CBMI_LIST_SIZE_MAX          50              /* Maximum GSM SMS CBMI list size*/
59 #define SMS_SMSP_ALPHA_ID_LEN_MAX                       128             /* EF-SMSP alpha id length */
60 #define SMS_MAXLENGTH_SMS_ADDRESS                       32              /* MAX sms destination(or origination ) address /call back number */
61 #define SMS_MAXLENGTH_SMS_MO_USER_DATA          160             /* Maximum MO user data  size*/
62 #define SMS_MAXLENGTH_SMS_MT_USER_DATA          160             /* Maximum MT user data  size*/
63 #define SMS_MAX_EFSMSP_RECORD_LENGTH            156             /* Maximum number of bytes SMSP Record size (Y + 28), y : 0 ~ 128 */
64
65 /*==================================================================================================
66                                             MACROS
67 ==================================================================================================*/
68 /* NetText */
69 #define SMS_MSG_SIZE_MAX                                                918             /**< Maximum Message Size */
70 #define SMS_CB_SIZE_MAX                                         93              /** Maximum CB Message Size */
71 #define SMS_ETWS_SIZE_MAX                                       56              /** Maximum ETWS Message Size */
72
73 #define SMS_ADDRESS_LEN_MAX                                     20              /* Nettext Address Length */
74 #define SMS_SCADDRESS_LEN_MAX                           18              /* SC Address Length */
75
76 #define SMS_CB_PAGE_SIZE_MAX                                    9               /**< CB maximum page size*/
77 #define SMS_GSM_SMS_MSG_NUM_MAX                         90              /**< Maximum GSM SMS message number*/
78 #define SMS_GSM_SMS_CBMI_LIST_SIZE_MAX          50              /**< Maximum GSM SMS CBMI list size*/
79 #define SMS_SMDATA_SIZE_MAX                                     165             /**< Maximum SMS data size that can be stored*/
80 #define SMS_MAX_SMS_SERVICE_CENTER_ADDR         12              /**<Maximum SMS service center address*/
81 #define SMS_MAX_INDEX                                                   25              /**< Maximum index value for SMS */
82
83 #define SMS_SMSP_PARAMS_MAX_LEN                         28
84
85 // ************************  CDMA Features  **************************//
86 #define SMS_PARAM_TELESERVICE_MASK                                      1 << 0  /**< Teleservice parameter bit position */
87 #define SMS_PARAM_SERVICE_CATEGORY_MASK                         1 << 1  /**< Service Category parameter bit position */
88 #define SMS_PARAM_ADDRESS_MASK                                          1 << 2  /**< Address parameter bit position */
89 #define SMS_PARAM_SUBADDRESS_MASK                                       1 << 3  /**< Subaddress parameter bit position */
90 #define SMS_PARAM_BEARER_REPLY_MASK                                     1 << 4  /**< Bearer reply parameter bit position */
91 #define SMS_PARAM_CAUSE_CODES_MASK                                      1 << 5  /**< Cause Code parameter bit position */
92 #define SMS_PARAM_MESSAGE_ID_MASK                                       1 << 6  /**< Message ID parameter bit position */
93 #define SMS_PARAM_USER_DATA_MASK                                        1 << 7  /**< User Data parameter bit position */
94 #define SMS_PARAM_USER_RESPONSE_CODE_MASK                       1 << 8  /**< User Response Code parameter bit position */
95 #define SMS_PARAM_MC_TIME_STAMP_MASK                            1 << 9  /**< Message Center Timestamp parameter bit position */
96 #define SMS_PARAM_VALIDITY_PERIOD_ABS_MASK                      1 << 10 /**< Valid period Absolute parameter bit position */
97 #define SMS_PARAM_VALIDITY_PERIOD_REL_MASK                      1 << 11 /**< Valid period Relative parameter bit position */
98 #define SMS_PARAM_DEFERRED_DELIVERY_ABS_MASK            1 << 12 /**< Deferred delivery absolute parameter bit position */
99 #define SMS_PARAM_DEFERRED_DELIVERY_REL_MASK            1 << 13 /**< Deferred delivery relative parameter bit position */
100 #define SMS_PARAM_PRIORITY_MASK                                         1 << 14 /**< Priority parameter bit position */
101 #define SMS_PARAM_PRIVACY_MASK                                          1 << 15 /**< Privacy parameter bit position */
102 #define SMS_PARAM_REPLY_OPTION_MASK                                     1 << 16 /**< Reply Option parameter bit position */
103 #define SMS_PARAM_NUMBER_OF_MESSAGE_MASK                        1 << 17 /**< Number of message parameter bit position */
104 #define SMS_PARAM_ALERT_ON_DELIVERY_MASK                        1 << 18 /**< Alert on delivery parameter bit position */
105 #define SMS_PARAM_LANGUAGE_MASK                                         1 << 19 /**< Language parameter bit position */
106 #define SMS_PARAM_CALLBACK_MASK                                         1 << 20 /**< Callback Number parameter bit position */
107 #define SMS_PARAM_DISPLAY_MODE_MASK                                     1 << 21 /**< Display mode parameter bit position */
108 #define SMS_PARAM_MULTI_ENCODING_USER_DATA_MASK 1 << 22 /**< Multi Encoding user data parameter bit position */
109
110 #define SMS_MAXLENGTH_SMS_MT_USER_DATA                          160             /**< Maximum MT user data  size*/
111 #define SMS_MAXLENGTH_SMS_MO_USER_DATA                          160             /**< Maximum MO user data  size*/
112
113 #define SMS_MAXLENGTH_SMS_ADDRESS                                       32              /**< MAX sms destination(or origination ) address /call back number */
114
115 #define SMS_ERR_CLASS0_STATUS_SEND_OK                                                           0       /**< send success */
116 #define SMS_ERR_CLASS23_ADDRESS_VACANT                                                          0       /**< address vacant */
117 #define SMS_ERR_CLASS23_ADDRESS_TRANSLATION_FAILURE                             1       /**< address translation failure */
118 #define SMS_ERR_CLASS23_NETWORK_RESOURCE_SHORTAGE                                       2       /**< network resource shortage */
119 #define SMS_ERR_CLASS23_NETWORK_FAILURE                                                         3       /**< network failure */
120 #define SMS_ERR_CLASS23_INVALID_TELESERVICE_ID                                          4       /**< invalid teleservice id */
121 #define SMS_ERR_CLASS23_OTHER_NETWORK_PROBLEM                                           5       /**< other network problem */
122 #define SMS_ERR_CLASS23_OTHER_NETWORK_PROBLEM_MORE_FIRST                        6       /**< other network problem more first */
123 #define SMS_ERR_CLASS23_OTHER_NETWORK_PROBLEM_MORE_LAST                 31      /**< other network problem more last */
124 #define SMS_ERR_CLASS23_NO_PAGE_RESPONSE                                                        32      /**< no page response */
125 #define SMS_ERR_CLASS23_DESTINATION_BUSY                                                        33      /**< destination busy */
126 #define SMS_ERR_CLASS23_NO_ACK                                                                          34      /**< no ack */
127 #define SMS_ERR_CLASS23_DESTINATION_RESOURCE_SHORTAGE                           35      /**< destination resource shortage */
128 #define SMS_ERR_CLASS23_SMS_DELIVERY_POSTPONED                                          36      /**< sms delivery postponed */
129 #define SMS_ERR_CLASS23_DESTINATION_OUT_OF_SERVICE                                      37      /**< destination out of service */
130 #define SMS_ERR_CLASS23_DESTINATION_NO_LONGER_AT_THIS_ADDRESS   38      /**< destination no longer at this address */
131 #define SMS_ERR_CLASS23_OTHER_TERMINAL_PROBLEM                                          39      /**< other terminal problem */
132 #define SMS_ERR_CLASS23_OTHER_TERMINAL_PROBLEM_MORE_FIRST               40      /**< other terminal problem more first */
133 #define SMS_ERR_CLASS23_OTHER_TERMINAL_PROBLEM_MORE_LAST                        47      /**< other terminal problem more last */
134 #define SMS_ERR_CLASS23_SMS_DELIVERY_POSTPONED_MORE_FIRST                       48      /**< sms delivery postpone more first */
135 #define SMS_ERR_CLASS23_SMS_DELIVERY_POSTPONED_MORE_LAST                        63      /**< sms delivery postpone more last */
136 #define SMS_ERR_CLASS23_RADIO_IF_RESOURCE_SHORTAGE                                      64      /**< radio interface resource shortage */
137 #define SMS_ERR_CLASS23_RADIO_IF_INCOMPATIBLE                                           65      /**< radio interface incompatible */
138 #define SMS_ERR_CLASS23_OTHER_RADIO_IF_PROBLEM                                          66      /**< other radio interface problem */
139 #define SMS_ERR_CLASS23_OTHER_RADIO_IF_PROBLEM_MORE_FIRST                       67      /**< other radio interface problem more first */
140 #define SMS_ERR_CLASS23_OTHER_RADIO_IF_PROBLEM_MORE_LAST                        95      /**< other radio interface problem more last */
141 #define SMS_ERR_CLASS23_UNEXPECTED_PARM_SIZE                                            96      /**< unexpected parameter size */
142 #define SMS_ERR_CLASS23_SMS_ORIGINATION_DENIED                                          97      /**< sms origination denied */
143 #define SMS_ERR_CLASS23_SMS_TERMINATION_DENIED                                          98      /**< sms termination denied */
144 #define SMS_ERR_CLASS23_SUPPL_SERVICE_NOT_SUPPORTED                             99      /**< supplementary service not supported */
145 #define SMS_ERR_CLASS23_SMS_NOT_SUPPORTED                                                       100     /**< sms not supported */
146 #define SMS_ERR_CLASS23_RESERVED_101                                                                    101     /**< reserved 101 */
147 #define SMS_ERR_CLASS23_MISSING_EXPECTED_PARM                                           102     /**< missing expected parameter */
148 #define SMS_ERR_CLASS23_MISSING_MANDATORY_PARM                                  103     /**< missing mandatory parameter value */
149 #define SMS_ERR_CLASS23_UNRECOGNIZED_PARM_VALUE                                 104     /**< unrecognized parameter value */
150 #define SMS_ERR_CLASS23_UNEXPECTED_PARM_VALUE                                           105     /**< unexpected parameter value */
151 #define SMS_ERR_CLASS23_USER_DATA_SIZE_ERROR                                            106     /**< user data size error */
152 #define SMS_ERR_CLASS23_OTHER_GENERAL_PROBLEMS                                          107     /**< other general problem */
153 #define SMS_ERR_CLASS23_OTHER_GENERAL_PROBLEMS_MORE_FIRST               108     /**< other general problem first */
154 #define SMS_ERR_CLASS23_OTHER_GENERAL_PROBLEMS_MORE_LAST                        255     /**< other general problem last */
155
156 #define SMS_ERR_CLASS4_WAITING_FOR_TL_ACK                                                       1       /**< waiting for transport ack */
157 #define SMS_ERR_CLASS4_OUT_OF_RESOURCES                                                         2       /**< out of resource */
158 #define SMS_ERR_CLASS4_ACCESS_TOO_LARGE                                                         3       /**< access to large */
159 #define SMS_ERR_CLASS4_DTC_TOO_LARGE                                                                    4       /**< DTC too large */
160 #define SMS_ERR_CLASS4_DTC_CONNECTED                                                                    5       /**< DTC connected */
161 #define SMS_ERR_CLASS4_NETWORK_NOT_READY                                                        6       /**< network not ready */
162 #define SMS_ERR_CLASS4_NO_SVC                                                                                   7       /**< no service */
163 #define SMS_ERR_CLASS4_PHONE_NOT_READY                                                          8       /**< phone not ready */
164 #define SMS_ERR_CLASS4_NOT_ALLOWED_IN_AMPS                                                      9       /**< fail to allowed in amps */
165 #define SMS_ERR_CLASS4_CANNOT_SEND_BROADCAST                                            10      /**< fail to send broadcast */
166 #define SMS_ERR_CLASS4_INVALID_TRANSACTION_ID
167 // ********************************************************************//
168
169 /*==================================================================================================
170                                              ENUMS
171 ==================================================================================================*/
172 /**
173  * @enum telephony_sms_MsgStatus_t
174  * This enumeration defines the network text status type.
175  */
176 enum telephony_sms_MsgStatus {
177         SMS_STATUS_READ,                                                /**< MT message, stored and read */
178         SMS_STATUS_UNREAD,                                      /**< MT message, stored and unread */
179         SMS_STATUS_SENT,                                                /**< MO message, stored and  sent */
180         SMS_STATUS_UNSENT,                                      /**< MO message, stored but not sent */
181         SMS_STATUS_DELIVERED,                                   /**< delivered destination */
182         SMS_STATUS_DELIVERY_UNCONFIRMED,        /**< Service centre forwarded message but is unable to confirm delivery*/
183         SMS_STATUS_MESSAGE_REPLACED,            /**< Message has been replaced*/
184         SMS_STATUS_RESERVED                                     /**< Reserved for future use*/
185 };
186
187 /**
188  * @enum telephony_sms_MemStatusType
189  * This enumeration defines the memory status type.
190  */
191 enum telephony_sms_MemStatusType {
192         SMS_PDA_MEMORY_STATUS_AVAILABLE = 0x01, /**< PDA Memory Available */
193         SMS_PDA_MEMORY_STATUS_FULL                      = 0x02,  /**< PDAMemory is Full */
194         SMS_PHONE_MEMORY_STATUS_AVAILABLE       = 0x03, /**< Phone memory Available */
195         SMS_PHONE_MEMORY_STATUS_FULL            = 0x04, /**< phone memory is full */
196 };
197
198 /**
199  * @enum telephony_sms_BearerType_t
200  * This enum defines the different bearer types
201  */
202 enum telephony_sms_BearerType {
203         SMS_BEARER_PS_ONLY = 0x01,       /**< Send SMS only on PS Bearer */
204         SMS_BEARER_CS_ONLY,                  /**< Send SMS only on CS Bearer */
205         SMS_BEARER_PS_PREFERRED,        /**<Send SMS preferably on PS Bearer*/
206         SMS_BEARER_CS_PREFERRED ,       /**<Send SMS preferably on CS Bearer*/
207         SMS_NO_PREFERRED_BEARER         /**<SMS is sent based on default preferred bearer set at OEM based on vendor/operator preference*/
208 };
209
210
211 /**
212 * @enum telephony_sms_CbMsgType_t
213 * This enumeration defines the different CB message types.
214 */
215 enum telephony_sms_CbMsgType {
216            SMS_CB_MSG_CBS = 1,          /**< Cell broadcast message */
217            SMS_CB_MSG_SCHEDULE, /**< CB Schedule message  */
218            SMS_CB_MSG_CBS41,            /**< CBS41 type message  */
219            SMS_CB_MSG_INVALID           /**< Invalid  CB message */
220 };
221
222 /**
223 * @enum telephony_sms_etws_type
224 * This enumeration defines the different ETWS message types.
225 */
226 enum telephony_sms_etws_type {
227                 SMS_ETWS_MSG_PRIMARY = 0,                               /**< PRIMARY ETWS Message */
228                 SMS_ETWS_MSG_SECONDARY_GSM,                             /**< SECONDARY GSM ETWS Message */
229                 SMS_ETWS_MSG_SECONDARY_UMTS                             /**< SECONDARY UMTS ETWS Message */
230 };
231
232 /**
233  * @enum telephony_sms_Response_t
234  * This enum defines the different response types that come in the
235  * sent status acknowledgement/notification after sending a message to the network
236  */
237 enum telephony_sms_Response {
238         SMS_SENDSMS_SUCCESS = 0x00,                                     /**<Message send success*/
239         SMS_ROUTING_NOT_AVAILABLE,                                      /**< Message routing not available*/
240         SMS_INVALID_PARAMETER,                                          /**< Invalid parameter present in TPDU*/
241         SMS_DEVICE_FAILURE,                                                     /**< Device failure*/
242         SMS_SERVICE_RESERVED,                                                   /**< Reserved Service*/
243         SMS_INVALID_LOCATION,                                                   /**< Invalid location*/
244         SMS_NO_SIM,                                                             /**< No SIM error*/
245         SMS_SIM_NOT_READY,                                                      /**< SIM not ready error*/
246         SMS_NO_NETWORK_RESP,                                                    /**< No response from network*/
247         SMS_DEST_ADDRESS_FDN_RESTRICTED,                        /**< Destination address restricted*/
248         SMS_SCADDRESS_FDN_RESTRICTED,                           /**< Service center address restricted*/
249         SMS_RESEND_ALREADY_DONE,                                        /**< Resend a operation already done*/
250         SMS_SCADDRESS_NOT_AVAILABLE,                            /**< SCA address not available*/
251         SMS_UNASSIGNED_NUMBER = 0x8001,                         /**< Unassigned number*/
252         SMS_OPERATOR_DETERMINED_BARRING = 0x8008,       /**< Operator determined barring*/
253         SMS_CALL_BARRED = 0x800A,                                               /**< Call barred*/
254         SMS_MESSAGE_TRANSFER_REJECTED = 0x8015,         /**< Message transfer rejected*/
255         SMS_MEMORY_CAPACITY_EXCEEDED = 0x8016,          /**< Memory capacity exceeded/memory full*/
256         SMS_DESTINAITION_OUTOFSERVICE = 0x801B,         /**< Destination number/address out of service*/
257         SMS_UNSPECIFIED_SUBSCRIBER = 0x801C,                    /**< Unspecified subscriber*/
258         SMS_FACILITY_REJECTED = 0x801D,                         /**< Facility rejected*/
259         SMS_UNKNOWN_SUBSCRIBER = 0x801E,                                /**< Unknown subscriber*/
260         SMS_NETWORK_OUTOFORDER = 0x8026,                        /**< Network out of order*/
261         SMS_TEMPORARY_FAILURE = 0x8029,                         /**< Temporary failure*/
262         SMS_CONGESTION = 0x802A,                                                /**< Congestion happened*/
263         SMS_RESOURCES_UNAVAILABLE = 0x802F,                     /**< Resource unavailable*/
264         SMS_FACILITY_NOT_SUBSCRIBED = 0x8032,                   /**< Facility not subscribed by the user*/
265         SMS_FACILITY_NOT_IMPLEMENTED = 0x8045,          /**< Facility not implemented*/
266         SMS_INVALID_REF_VALUE = 0x8051,                         /**< Invalid reference value*/
267         SMS_INVALID_MSG = 0x805F,                                               /**< Invalid message*/
268         SMS_INVALID_MANDATORY_INFO = 0x8060,                    /**< Invalid Mandatory information*/
269         SMS_MESSAGE_TYPE_NOT_IMPLEMENTED = 0x8061,      /**< Message type not implemented*/
270         SMS_MESSAGE_NOT_COMPAT_PROTOCOL = 0x8062,       /**< Message not compact protocol*/
271         SMS_IE_NOT_IMPLEMENTED = 0x8063,                         /**< Information element not implemented*/
272         SMS_PROTOCOL_ERROR = 0x806F,                                    /**< Protocol error*/
273         SMS_INTERWORKING = 0x807F,                                      /**< Networking error*/
274         SMS_ME_FULL = 0x8080,                                                   /**< SMS ME FULL */
275         SMS_SIM_FULL = 0x8081,                                                  /**< SMS SIM FULL */
276         SMS_TIMEOUT                                                                     /**< Timeout error */
277 };
278
279  /** @enum  telephony_sms_Cause_t
280  * This enum defines the different cause types that come in the
281  * sent status acknowledgement/notification after sending a message to the network
282  */
283
284 enum telephony_sms_Cause {
285
286         SMS_SUCCESS,                                            /**< SMS Operation successful*/
287         SMS_INVALID_PARAMETER_FORMAT,    /**< Invalid format for some parameters passed in Data package information(TPDU)*/
288         SMS_PHONE_FAILURE,                              /**<SMS operation failed due to Modem failure*/
289         SMS_SIM_BUSY,                                           /**< SMS SIM operation cannot be performed as SIM is busy with some other operation*/
290         SMS_SIM_FAILURE,                                        /**< SMS SIM operation cannot be performed due to SIM failure */
291         SMS_UNKNOWN,                                            /**< unknown error*/
292         SMS_MEMORY_FAILURE,                             /**< Error while accessing memory or allocation of memory for SMS operation.*/
293         SMS_OPERATION_NOT_SUPPORTED     /**< operation not allowed/supported*/
294 } ;
295
296 /**
297  * @enum telephony_sms_SetResponse
298  * This defines the response values
299  */
300 enum telephony_sms_SetResponse {
301         SMS_CBSETCONFIG_RSP,                    /**<  cellbroadcast config response */
302         SMS_SETPREFERREDBEARER_RSP,     /**<  set preferred bearer response */
303         SMS_SETPARAMETERS_RSP,          /**<  set parameter response */
304         SMS_SETMEMORYSTATUS_RSP,        /**<   set memory status response*/
305         SMS_SETMESSAGESTATUS_RSP,       /**<   set message status response*/
306         SMS_SETDEVICESTATUS_RSP,                /**<   set device status response*/
307         SMS_SETSCADDR_RSP,                      /**<   set SCA address response */
308         SMS_SET_RSP_MAX                         /**<   maximum limit*/
309 };
310
311 /**
312  * @enum telephony_sms_3gpp_type
313  * This defines the type of 3gpp
314  */
315 enum telephony_sms_3gpp_type {
316         SMS_NETTYPE_3GPP = 0x01,                                                /**< 3gpp type */
317         SMS_NETTYPE_3GPP2,    /**< 3gpp2 type (CDMA) */
318 };
319
320
321 /**
322  * This structure defines the fields related to an Sms like SIM index, TPDU  and length
323  */
324 struct telephony_sms_DataPackageInfo {
325         unsigned char   sca[SMS_SMSP_ADDRESS_LEN];                      /* Service Centre address - an optional parameter. If this parameter is not present, then this field will be Null.If present, the valid service centre address information is filled as per 3GPP TS23.040 9.1.2.5 Address fields */
326         int                     msgLength;                                                      /* Size of array szData (which is actual TPDU message) */
327         unsigned char tpduData[SMS_SMDATA_SIZE_MAX + 1];        /* SMS TPDU message */
328 };
329
330 /**
331  *This structure defines the data Related to SimIndex,MessageStatus and SMS Data Stored.
332  */
333 struct telephony_sms_Data {
334         int                                                                     simIndex;       /**< Index where SMS is stored. */
335         enum telephony_sms_MsgStatus                    msgStatus;      /**< Message status.*/
336         struct telephony_sms_DataPackageInfo    smsData;        /**<SMS message */
337 };
338
339 struct telephony_sms_AddressInfo {
340         unsigned int    dialNumLen;                                                             /* length of address. If Service center address is not set, then this will be zero */
341         int                     typeOfNum;                                                              /* Type of number*/
342         int                     numPlanId;                                                              /* Numbering plan identification*/
343         unsigned char diallingNum[SMS_SMSP_ADDRESS_LEN + 1];    /* destination address. If Address not set, then set to 0xFF */
344 };
345
346 /**
347  * This structure defines different fields involved in setting the parameters of
348  * a particular sms in EFsmsp.
349  */
350 struct telephony_sms_Params {
351
352         unsigned char                                   recordIndex;                                            /**< Index*/
353         unsigned char                                   recordLen;                                                      /**< SMS Parameter Record length*/
354         unsigned long                                           alphaIdLen;                                                     /**< Alpha id length */
355         char                                                    szAlphaId[SMS_SMSP_ALPHA_ID_LEN_MAX + 1];       /**< Alpha id .It is a unique identifier for each row/record in EFsmsp */ //JYGU: TAPI_SIM_SMSP_ALPHA_ID_LEN_MAX 128
356         unsigned char                                   paramIndicator;                                         /**< SMS parameter indicator is a 1 byte value. Each bit in this value indicates the presence/absence of the sms header parameters.If the parameter is present the corresponding bit value is set to 0.If the parameter is absent then it is set as 1.Refer 3GPP TS 31.02 :4.4.23 */
357         struct telephony_sms_AddressInfo        tpDestAddr;                                                     /**< TP-destination address (TP-DA) */
358         struct telephony_sms_AddressInfo        tpSvcCntrAddr;                                          /**< TP-service center address */
359         unsigned short                                  tpProtocolId;                                           /**< TP-protocol Id */
360         unsigned short                                  tpDataCodingScheme;                             /**< TP-data coding scheme */
361         unsigned short                                  tpValidityPeriod;                                               /**< TP-validity period */
362 };
363
364 /**
365  * This structure defines the different parameters that are related to the message count
366  *in a particular memory(Phone/SIM)
367  */
368 struct telephony_sms_StoredMsgCountInfo {
369         unsigned int    totalCount;                                                             /**< Total count of messages stored in SIM*/
370         int                     usedCount;                                                              /**< Stored message count in SIM in SIM*/
371         int                     indexList[SMS_GSM_SMS_MSG_NUM_MAX];     /**< Message index list stored in SIM. And the maximum size of this array can be of totalCount.This array contains the list of index values in which the messages are stored.i.e. index_list[totalcount] = [2,3] denotes that indexs 2 and 3 are stored(valid) and others not(empty).*/
372 };
373
374 /**
375  * This structure defines a cell broadcast message.
376  */
377 struct telephony_sms_CbMsg {
378
379         enum telephony_sms_CbMsgType    cbMsgType;                                                      /**< Cell Broadcast  message type */
380         unsigned short                                  length;                                                                 /**<Size of array szMsgData (which is actual TPDU message) */
381         char                                                    msgData[SMS_CB_SIZE_MAX + 1]; /**<Cell broadcast message data[Refer 3GPP TS 23.041 9.4.1]*/
382 };
383
384 struct telephony_sms_etws_msg {
385
386         enum telephony_sms_etws_type    etwsMsgType;                                                    /**< ETWS  message type */
387         unsigned short                                  length;                                                                 /**<Size of array msgData (which is actual TPDU message) */
388         char                                                    msgData[SMS_ETWS_SIZE_MAX + 1]; /**< ETWS message data[Refer 3GPP TS 23.041 9.4.1.3]*/
389 };
390
391 struct telephony_sms_cb_msg_info_3gpp {
392  unsigned short fromMsgId; /**< Starting point of the range of CBS message ID */
393  unsigned short toMsgId; /**< Ending point of the range of CBS message ID */
394  unsigned char selected; /**< 0x00 . Not selected. 0x01 . Selected */
395 };
396
397 struct telephony_sms_cb_msg_info_3gpp2 {
398  unsigned short cbCategory; /**< CB Service category */
399  unsigned short cbLanguage; /**< Language indicator value
400                                                                 . 0x00 . LANGUAGE_UNKNOWN .
401                                                                         Unknown or Unspecified
402                                                                 . 0x01 . LANGUAGE_ENGLISH . English
403                                                                 . 0x02 . LANGUAGE_FRENCH . French
404                                                                 . 0x03 . LANGUAGE_SPANISH . Spanish
405                                                                 . 0x04 . LANGUAGE_JAPANESE . Japanese
406                                                                 . 0x05 . LANGUAGE_KOREAN . Korean
407                                                                 . 0x06 . LANGUAGE_CHINESE . Chinese
408                                                                 . 0x07 . LANGUAGE_HEBREW . Hebrew*/
409  unsigned char selected; /**< 0x00 . Not selected. 0x01 . Selected */
410 };
411
412 union telephony_sms_cb_msg_info_u {
413         struct telephony_sms_cb_msg_info_3gpp net3gpp; /**< 3GPP Broadcast Configuration Information */
414         struct telephony_sms_cb_msg_info_3gpp2 net3gpp2; /**< 3GPP2 Broadcast Configuration Information, CDMA*/
415 };
416
417 struct telephony_sms_CbConfig {
418         int net3gppType;  /**< Type of 3gpp, 0x01 . 3gpp. 0x02 . 3gpp2(CDMA) */
419         int cbEnabled; /**< CB service state. If cb_enabled is true then cell broadcast service will be enabled and underlying modem will enable CB Channel to receiving CB messages. Otherwise CB service will be disabled, underlying modem will deactivate the CB channel. (enabled/disabled) */
420         unsigned char msgIdMaxCount; /**< CB Channel List Max Count For Response */
421         int msgIdRangeCount; /**< Range of CB message ID count */
422         union telephony_sms_cb_msg_info_u msgIDs[SMS_GSM_SMS_CBMI_LIST_SIZE_MAX]; /**< Range of CB message ID information */
423 };
424
425
426 // ************************  CDMA Features  **************************//
427  /** @enum  telephony_sms_Is637AlertPriority_t
428  * This enum defines the type of alerts used to distinguish different priorities
429  * of the message
430  */
431 enum telephony_sms_Is637AlertPriority {
432         SMS_ALERT_PRIORITY_DEFAULT = 0, /* Mobile default alert */
433         SMS_ALERT_PRIORITY_LOW,                 /* Low priority alert */
434         SMS_ALERT_PRIORITY_MEDIUM,              /* Medium priority alert */
435         SMS_ALERT_PRIORITY_HIGH,                        /* High priority alert */
436 };
437
438  /** @enum  telephony_sms_Is637Privacy_t
439  * This enum defines the desired privacy level of the message
440  */
441 enum telephony_sms_Is637Privacy {
442         SMS_PRIVACY_NOT_RESTRICTED = 0, /* Not restricted */
443         SMS_PRIVACY_RESTRICTED,                 /* Restricted */
444         SMS_PRIVACY_CONFIDENTIAL,               /* Confidential */
445         SMS_PRIVACY_SECRET,                             /* Secret */
446 };
447
448  /** @enum  telephony_sms_Is637Priority_t
449  * This enum defines the priority level of the message
450  */
451 enum telephony_sms_Is637Priority {
452         SMS_PRIORITY_NORMAL = 0,                /* Normal */
453         SMS_PRIORITY_INTERACTIVE,               /* Interactive */
454         SMS_PRIORITY_URGENT,                    /* Urgent */
455         SMS_PRIORITY_EMERGENCY,         /* Emergency */
456 };
457
458  /** @enum  telephony_sms_Is637LangIndicator_t
459  * This enum defines the language of the message so that the receiving mobile station can
460  * discard those messages that are not in the user's preferred language
461  */
462 enum telephony_sms_Is637LangIndicator {
463         SMS_LANG_UNKNOWN = 0x0,                 /* Unknown or unspecified */
464         SMS_LANG_ENGLISH,                               /* English */
465         SMS_LANG_FRENCH,                                /* French */
466         SMS_LANG_SPANISH,                               /* Spanish */
467         SMS_LANG_JAPANESE,                      /* Japanese */
468         SMS_LANG_KOREAN,                                /* Korean */
469         SMS_LANG_CHINESE,                               /* Chinese */
470         SMS_LANG_HEBREW,                                /* Hebrew */
471 };
472
473  /** @enum  telephony_sms_Is637MsgDisplayMode_t
474  * This enum defines the display mode to the mobile station when to display the received message
475  */
476 enum telephony_sms_Is637MsgDisplayMode {
477         SMS_MSG_DISPLAY_IMMEDIATE = 0x0,                /* The mobile station is to display the received message as soon as possible */
478         SMS_MSG_DISPLAY_DEFAULT,                                /* he mobile station is to display the received message based on a pre-defined mode in the mobile station. */
479         SMS_MSG_DISPLAY_USER_INVOKE = 0x3,      /* The mobile station is to display the received message based on the mode selected by the user. */
480         SMS_MSG_DISPLAY_RESERVED,                       /* Reserved */
481 };
482
483  /** @enum  telephony_sms_Is637ErrorClass_t
484  * This enum defines the error report class
485  */
486 enum telephony_sms_Is637ErrorClass {
487         SMS_MSG_ERROR_CLASS_NONE = 0x0,                                         /* None error(for SMS ack) */
488         SMS_MSG_ERROR_CLASS_TEMPORARY_ERROR = 0x2,                      /* Temporary error(for SMS ack) */
489         SMS_MSG_ERROR_CLASS_PERMANENT_ERROR = 0x3,                      /* Permanent error(for SMS ack) */
490         SMS_MSG_ERROR_CLASS_PHONE_INTERNAL_ERROR = 0x4, /* Phone Internal Status (for Send status) */
491 };
492
493  /** @enum  telephony_sms_BroadCastCategory_t
494  * This enum defines the Broadcast Service Category
495  */
496 enum telephony_sms_BroadCastCategory {
497         SMS_CATEGORY_UNKNOWN            = 0x00,                 /* Unknown category */
498         SMS_CATEGORY_EMERGENCY          = 0x01,                 /* Emergency category */
499         SMS_CATEGORY_ADMIN                      = 0x02,                 /* Admin category */
500         SMS_CATEGORY_MAINTENANCE        = 0x03,                 /* Maintenance category */
501         SMS_CATEGORY_GEN_NEWS_LOC       = 0x04,                 /* General News(Local) category */
502         SMS_CATEGORY_GEN_NEWS_REG       = 0x05,                 /* General News(Regional) category */
503         SMS_CATEGORY_GEN_NEWS_NAT       = 0x06,                 /* General News(National) category */
504         SMS_CATEGORY_GEN_NEWS_INT       = 0x07,                 /* General News(International) category */
505         SMS_CATEGORY_FIN_NEWS_LOC       = 0x08,                 /* Business/Financial News(Local) category */
506         SMS_CATEGORY_FIN_NEWS_REG       = 0x09,                 /* Business/Financial News(Regional) category */
507         SMS_CATEGORY_FIN_NEWS_NAT       = 0x0A,                 /* Business/Financial News(National) category */
508         SMS_CATEGORY_FIN_NEWS_INT       = 0x0B,                 /* Business/Financial News(International) category */
509         SMS_CATEGORY_SPT_NEWS_LOC       = 0x0C,                 /* Sports News(Local) category */
510         SMS_CATEGORY_SPT_NEWS_REG       = 0x0D,                 /* Sports News(Regional) category */
511         SMS_CATEGORY_SPT_NEWS_NAT       = 0x0E,                 /* Sports News(National) category */
512         SMS_CATEGORY_SPT_NEWS_INT       = 0x0F,                 /* Sports News(International) category */
513         SMS_CATEGORY_ENT_NEWS_LOC       = 0x10,                 /* Entertainment News(Local) category */
514         SMS_CATEGORY_ENT_NEWS_REG       = 0x11,                 /* Entertainment News(Regional) category */
515         SMS_CATEGORY_ENT_NEWS_NAT       = 0x12,                 /* Entertainment News(National) category */
516         SMS_CATEGORY_ENT_NEWS_INT       = 0x13,                 /* Entertainment News(International) category */
517         SMS_CATEGORY_LOC_WEATHER        = 0x14,                 /* Local Weather category */
518         SMS_CATEGORY_AREA_TRAFFIC       = 0x15,                 /* Area Traffic Reports category */
519         SMS_CATEGORY_AIRPORT_SCHED      = 0x16,                 /* Local Airport Flight Schedules category */
520         SMS_CATEGORY_RESTAURANTS        = 0x17,                 /* Restaurants category */
521         SMS_CATEGORY_LODGINGS           = 0x18,                 /* Lodgings category */
522         SMS_CATEGORY_RETAILS                    = 0x19,                 /* Retail Directory category */
523         SMS_CATEGORY_ADS                                = 0x1A,                 /* Advertisements category */
524         SMS_CATEGORY_STOCK_QUOTES       = 0x1B,                 /* Stock Quotes category */
525         SMS_CATEGORY_JOBS                       = 0x1C,                 /* Employment Opportunities category */
526         SMS_CATEGORY_MEDICAL                    = 0x1D,                 /* Medical/Health/Hospitals category */
527         SMS_CATEGORY_TECH_NEWS          = 0x1E,                 /* Technology News category */
528         SMS_CATEGORY_MULTI                      =  0x1F,                        /* Multi-category */
529 };
530
531 /** @enum  telephony_sms_MsgType_t
532  * This enum defines the type of IS637 message
533  */
534 enum telephony_sms_CdmaMsgType {
535         SMS_MESSAGETYPE_DELIVER = 0x01,                         /* sms deliver message  */
536         SMS_MESSAGETYPE_SUBMIT = 0x02,                          /* sms submit message  */
537         SMS_MESSAGETYPE_CANCEL = 0x03,                          /* sms cancellation message  */
538         SMS_MESSAGETYPE_DELIVERY_ACK = 0x04,                    /* sms delivery acknowledgment message  */
539         SMS_MESSAGETYPE_USER_ACK = 0x05,                                /* sms user acknowledgment message  */
540 } telephony_sms_CdmaMsgType_e;
541
542 /** @enum  telephony_sms_Is637DigitMode_t
543  * This enum defines the type of address whether it is 4-bit mode or 8-bit mode
544  */
545 enum telephony_sms_Is637DigitMode {
546         SMS_DIGITMODE_4BITDTMF  = 0x00,         /* 4-bit mode  */
547         SMS_DIGITMODE_8BITCODE  = 0x01,         /* 8-bit mode  */
548 };
549
550 /** @enum  telephony_sms_Is637NumberMode_t
551  * This enum defines the mode of address number to indicate whether the address type is as defined in ANSI TI.607 or is a data network address
552  */
553 enum telephony_sms_Is637NumberMode {
554         SMS_NUMMODE_NONE_DATANETWORK =  0x00,   /* in ANSI TI.607 */
555         SMS_NUMMODE_DATANETWORK = 0x01,                 /* in Data Network */
556 };
557
558 /** @enum  telephony_sms_Is637NumberType_t
559  * This enum defines the type of address
560  */
561 enum telephony_sms_Is637NumberType {
562         SMS_NUMBER_TYPE_UNKNOWN         = 0x00,         /*  Unknown */
563         SMS_NUMBER_TYPE_INTERNATIONAL   = 0x01,         /*  International number*/
564         SMS_NUMBER_TYPE_NATIONAL                = 0x02,         /*  National number */
565         SMS_NUMBER_TYPE_NETWORK         = 0x03,         /*  Abbreviated number */
566         SMS_NUMBER_TYPE_SUBSCRIBER              = 0x04,         /* Abbreviated number */
567         SMS_NUMBER_TYPE_RESERVED_5              = 0x05,         /*  Reserved */
568         SMS_NUMBER_TYPE_ABBREVIATED             = 0x06,         /*  Abbreviated number */
569         SMS_NUMBER_TYPE_RESERVED_7              = 0x07,         /*  Reserved */
570         SMS_NUMBER_TYPE_IP                              = 0x11,         /*  Internet Protocol(RFC 791) */
571         SMS_NUMBER_TYPE_EMAILADDR               = 0x12,         /*  Internet Email Address(RFC 822) */
572 } telephony_sms_Is637NumberType_e;
573
574 /** @enum  telephony_sms_Is637NumberPlan_t
575  * This enum defines the plan of address
576  */
577 enum telephony_sms_Is637NumberPlan {
578         SMS_NUMBER_PLAN_UNKNOWN         = 0x00, /*  Unknown */
579         SMS_NUMBER_PLAN_TELEPHONY               = 0x01, /* ISDN/Telephony numbering plan */
580         SMS_NUMBER_PLAN_RESERVED_2              = 0x02, /*  Reserved */
581         SMS_NUMBER_PLAN_DATA                    = 0x03, /* Data numbering plan */
582         SMS_NUMBER_PLAN_TELEX                   = 0x04, /* CTelex numbering plan */
583         SMS_NUMBER_PLAN_RESERVED_5              = 0x05, /*  Reserved */
584         SMS_NUMBER_PLAN_RESERVED_6              = 0x06, /*  Reserved */
585         SMS_NUMBER_PLAN_RESERVED_7              = 0x07, /*  Reserved */
586         SMS_NUMBER_PLAN_RESERVED_8              = 0x08, /*  Reserved */
587         SMS_NUMBER_PLAN_PRIVATE                 = 0x09, /*  Private numbering plan */
588         SMS_NUMBER_PLAN_RESERVED_10     = 0x0A, /*  Reserved */
589         SMS_NUMBER_PLAN_RESERVED_11     = 0x0B, /*  Reserved */
590         SMS_NUMBER_PLAN_RESERVED_12     = 0x0C, /*  Reserved */
591         SMS_NUMBER_PLAN_RESERVED_13     = 0x0D, /*  Reserved */
592         SMS_NUMBER_PLAN_RESERVED_14     = 0x0E, /*  Reserved */
593         SMS_NUMBER_PLAN_RESERVED_15     = 0x0F, /*  Reserved */
594 };
595
596 /** @enum  telephony_sms_Is637SubAddressType_t
597  * This enum defines the plan of address
598  */
599 enum telephony_sms_Is637SubAddressType {
600
601         SMS_SUBADDR_NSAP                                = 0x00, /**< NSAP ( CCITT Recommendation X.213 or ISO 8348 AD2 ) */
602         SMS_SUBADDR_USER_SPECIFIED      = 0x01, /**<  User-specified */
603 };
604
605 /**
606  *  This structure defines cause code as an indication whether an SMS error has occurred and
607  *  if so, whether the condition is considered temporary or permanent
608  **/
609 struct telephony_sms_Is637CauseCode {
610         unsigned char                                           ReplySeqNumber; /* Reply sequence number */
611         enum telephony_sms_Is637ErrorClass      ErrClass;                       /* Error report class */
612         unsigned char                                                   Cause;                          /* Error cause identifier */
613 };
614
615 /**
616  * This structure defines the parameters of address and its type
617  */
618 struct telephony_sms_Is637Address {
619         enum telephony_sms_Is637DigitMode               Digit;                  /* Digit mode indicator (0x00:4bit_dtmf, 0x01:8bit_code) */
620         enum telephony_sms_Is637NumberMode      NumberMode;     /* Number mode indicator (0x00:ANSI TI607, 0x01:Data network) */
621         enum telephony_sms_Is637NumberType      NumberType;     /* Type of number */
622         enum telephony_sms_Is637NumberPlan      NumberPlan;     /* Numbering plan */
623         unsigned char                                           szAddrLength;   /* The number of CHARi */
624         unsigned char                                           szAddress[SMS_MAXLENGTH_SMS_ADDRESS]; /* The address digit or character */
625 };
626
627 /**
628  * This structure defines the parameters of subaddress of originator and destination
629  */
630 struct telephony_sms_Is637SubAddress {
631         enum telephony_sms_Is637SubAddressType  SubType;                /* Subaddress type */
632         unsigned char                                                   Odd;                    /* Odd/even indicator */
633         unsigned char                                                   szAddrLength;   /* The number of CHARi */
634         unsigned char                                                   szAddress[SMS_MAXLENGTH_SMS_ADDRESS]; /* A subaddress octet */
635 };
636
637 /**
638  * This structure defines the message center time stamp may be include
639  * with SMS message sent from a message center
640  */
641 struct telephony_sms_TimeStamp {
642         unsigned int    year;           /* Year - if the year is 2002, the year field contains 0x02 */
643         unsigned int    month;          /* Month (1 ~ 12) */
644         unsigned int    day;            /* Day (1 ~ 31) */
645         unsigned int    hours;          /* Hours (0 ~ 23) */
646         unsigned int    minutes;        /* Minute (0 ~ 59) */
647         unsigned int    seconds;        /* Seconds (0 ~ 59) */
648 };
649
650 /**
651  * The structure defines the parameter of SMS submit message
652  */
653 struct telephony_sms_Is637OutSubmit {
654         struct telephony_sms_Is637Address               DstAddr; /* Destination address */
655         struct telephony_sms_Is637SubAddress    DstSubAddr; /* Destination subaddress */
656         unsigned short                                          TeleService; /* Teleservice Identifier */
657         int                                                                     bBearerReplySeqRequest; /* Bearer reply sequence request */
658         unsigned char                                                   ReplySeqNumber; /* Reply sequence number */
659         unsigned short                                          MsgId; /* Message identifier */
660         unsigned short                                          MsgEncoding; /* Message encoding (defined in TSB-58A) */
661         unsigned short                                          MsgLength; /* Message length */
662         unsigned char                                                   szData[SMS_MAXLENGTH_SMS_MO_USER_DATA]; /* SMS user data */
663         struct telephony_sms_TimeStamp          ValidityPeriodAbs; /* Validity period - Absolute (not supported) */
664         unsigned char                                                   ValidityPeriodRel; /* Validity period - Relative (not supported) */
665         struct telephony_sms_TimeStamp          DeferredDelTimeAbs; /* Deferred delivery time - Absolute */
666         unsigned char                                                   DeferredDelTimeRel; /* Deferred delivery time - Relative */
667         enum telephony_sms_Is637Priority                Priority; /* Priority indicator */
668         enum telephony_sms_Is637Privacy         Privacy; /* Privacy indicator */
669         int                                                                     bUserAckRequest; /* User acknowledge request */
670         int                                                                     bDeliveryAckRequest; /* Delivery acknowledge request */
671         enum telephony_sms_Is637AlertPriority   AlertPriority; /* Alert priority of message */
672         enum telephony_sms_Is637LangIndicator   MsgLang; /* Language indicator */
673         struct telephony_sms_Is637Address               CallBackNumber; /* Callback number address */
674 };
675
676 /**
677  * The structure defines the parameter of SMS acknowledgement message for submit
678  */
679 struct telephony_sms_Is637OutAck {
680         struct telephony_sms_Is637Address               DstAddr; /* Destination address */
681         struct telephony_sms_Is637SubAddress    DstSubAddr; /* Destination subaddress */
682         unsigned short                                          TeleService; /* Teleservice Identifier */
683         int                                                                     bBearerReplySeqRequest; /* Bearer reply sequence request */
684         unsigned char                                           ReplySeqNumber; /* Reply sequence number */
685         unsigned short                                          MsgId; /* Message identifier */
686         unsigned short                                          MsgEncoding; /* Message encoding (defined in TSB-58A) */
687         unsigned short                                          MsgLength; /* Message length */
688         unsigned char                                                   szData[SMS_MAXLENGTH_SMS_MO_USER_DATA]; /* SMS user data */
689         unsigned char                                                   UserResponseCode; /* User response code */
690 };
691
692 /**
693  * The structure defines the parameter of SMS cancellation message
694  */
695 struct telephony_sms_Is637OutCancel {
696         struct telephony_sms_Is637Address               DstAddr; /* Destination address */
697         struct telephony_sms_Is637SubAddress    DstSubAddr; /* Destination subaddress */
698         unsigned short                                          TeleService; /* Teleservice Identifier */
699         int                                                                     bBearerReplySeqRequest; /* Bearer reply sequence request */
700         unsigned char                                                   ReplySeqNumber; /* Reply sequence number */
701         unsigned short                                          MsgId; /* Message identifier */
702 };
703
704 /**
705  * The structure defines the parameter of SMS devivery message
706  */
707 struct telephony_sms_Is637InDeliver {
708         struct telephony_sms_Is637Address                       OrigAddr; /* Origination address */
709         struct telephony_sms_Is637SubAddress            OrigSubAddr; /* Origination subaddress */
710         unsigned short                                                  TeleService; /* Teleservice Identifier */
711         int                                                                             bBearerReplySeqRequest; /* Bearer reply sequence request */
712         unsigned char                                                           ReplySeqNumber; /* Reply sequence number */
713         unsigned short                                                  MsgId; /* Message identifier */
714         unsigned short                                                  MsgEncoding; /* Message encoding (defined in TSB-58A) */
715         unsigned short                                                  MsgLength; /* Message length */
716         unsigned char                                                           szData[SMS_MAXLENGTH_SMS_MT_USER_DATA]; /* SMS user data */
717         struct telephony_sms_TimeStamp                  MessageCenterTimeStamp; /* Message center time stamp */
718         struct telephony_sms_TimeStamp                  ValidityPeriodAbs; /* Validity period - Absolute */
719         unsigned char                                                           ValidityPeriodRel; /* Validity period - Relative */
720         struct telephony_sms_TimeStamp                  DeferredDelTimeAbs; /* Deferred delivery time - Absolute (not supported) */
721         unsigned char                                                           DeferredDelTimeRel; /* Deferred delivery time - Relative (not supported) */
722         enum telephony_sms_Is637Priority                        Priority; /* Priority indicator */
723         enum telephony_sms_Is637Privacy                 Privacy; /* Privacy indicator */
724         unsigned char                                                           NumMsg; /* Number of voice mail (0-99) */
725         int                                                                             bUserAckRequest; /* User acknowledge request */
726         int                                                                             bDeliveryAckRequest; /* Delivery acknowledge request */
727         enum telephony_sms_Is637AlertPriority           AlertPriority; /* Alert priority of message */
728         enum telephony_sms_Is637LangIndicator           MsgLang; /* Language indicator */
729         struct telephony_sms_Is637Address                       CallBackNumer; /* Callback number address */
730         enum telephony_sms_Is637MsgDisplayMode  Display; /* Message display mode */
731 };
732
733 /**
734  * The structure defines the parameter of SMS acknowledge message for deliver
735  */
736 struct telephony_sms_Is637InAck {
737         struct telephony_sms_Is637Address               OrigAddr; /* Origination address */
738         struct telephony_sms_Is637SubAddress    OrigSubAddr; /* Origination subaddress */
739         unsigned short                                          TeleService; /* Teleservice Identifier */
740         int                                                                     bBearerReplySeqRequest; /* Bearer reply sequence request */
741         unsigned char                                                   ReplySeqNumber; /* Reply sequence number */
742         unsigned short                                          MsgId; /* Message identifier */
743         unsigned short                                          MsgEncoding; /* Message encoding (defined in TSB-58A) */
744         unsigned short                                          MsgLength; /* Message length */
745         unsigned char                                                   szData[SMS_MAXLENGTH_SMS_MT_USER_DATA]; /* SMS user data */
746         unsigned char                                                   UserResponseCode; /* User response code */
747         struct telephony_sms_TimeStamp          MessageCenterTimeStamp; /* Message center time stamp */
748 };
749
750 /**
751  * The structure defines the parameter of SMS acknowledge message from message center
752  */
753 struct telephony_sms_Is637InDeliverAck {
754         struct telephony_sms_Is637Address               OrigAddr; /* Origination address */
755         struct telephony_sms_Is637SubAddress    OrigSubAddr; /* Origination subaddress */
756         unsigned short                                          TeleService; /* Teleservice Identifier */
757         int                                                                     bBearerReplySeqRequest; /* Bearer reply sequence request */
758         unsigned char                                                   ReplySeqNumber; /* Reply sequence number */
759         unsigned short                                          MsgId; /* Message identifier */
760         unsigned short                                          MsgEncoding; /* Message encoding (defined in TSB-58A) */
761         unsigned short                                          MsgLength; /* Message length */
762         unsigned char                                                   szData[SMS_MAXLENGTH_SMS_MT_USER_DATA]; /* SMS user data */
763         struct telephony_sms_TimeStamp          MessageCenterTimeStamp; /* Message center time stamp */
764 };
765
766 /**
767  * The structure defines the parameter of SMS broadcast message
768  */
769 struct telephony_sms_Is637InBroadCast {
770         enum telephony_sms_BroadCastCategory            ServiceCategory; /* Broadcast service category */
771         unsigned short                                                  MsgId; /* Message identifier */
772         int                                                                             bBearerReplySeqRequest; /* Bearer reply sequence request */
773         unsigned char                                                           ReplySeqNumber; /* Reply sequence number */
774         unsigned short                                                  MsgEncoding; /* Message encoding (defined in TSB-58A) */
775         unsigned short                                                  MsgLength; /* Message length */
776         unsigned char                                                           szData[SMS_MAXLENGTH_SMS_MT_USER_DATA]; /* SMS user data */
777         struct telephony_sms_TimeStamp                  MessageCenterTimeStamp; /* Message center time stamp */
778         struct telephony_sms_TimeStamp                  ValidityPeriodAbs; /* Validity period - Absolute */
779         unsigned char                                                           ValidityPeriodRel; /* Validity period - Relative */
780         enum telephony_sms_Is637Priority                        Priority; /* Priority indicator */
781         enum telephony_sms_Is637AlertPriority           AlertPriority; /* Alert priority of message */
782         enum telephony_sms_Is637LangIndicator           MsgLang; /* Language indicator */
783         enum telephony_sms_Is637MsgDisplayMode  Display; /* Message display mode */
784 } telephony_sms_Is637InBroadCast_t;
785
786
787 /**
788  * The structure defines the type of SMS message as union
789  */
790 union telephony_sms_CdmaMessage_u {
791         struct telephony_sms_Is637OutSubmit     outSubmit;              /* Outgoing Submit message */
792         struct telephony_sms_Is637OutAck                outAck;                 /* Outgoing Acknowledge message */
793         struct telephony_sms_Is637OutCancel     outCancel;              /* Outgoing Cancel message */
794         struct telephony_sms_Is637InDeliver             inDeliver;              /* Incoming Delivery message */
795         struct telephony_sms_Is637InAck         inAck;                  /* Incoming Acknowledge message */
796         struct telephony_sms_Is637InDeliverAck  inDeliverAck;   /* Incoming Delivery Acknowledge message */
797         struct telephony_sms_Is637InBroadCast   inBc;                   /* Incoming Broadcast message */
798 };
799
800 /**
801  * The structure defines the parameter of entire SMS message of each type
802  */
803 struct telephony_sms_CdmaMsgInfo {
804         int                                                                     ParamMask; /**< Parameter ID mask */
805         enum telephony_sms_CdmaMsgType          MsgType; /**< Message type */
806         union telephony_sms_CdmaMessage_u       MsgData; /**< Message data */
807 };
808
809 /*-----------------------------------------------------------------------------------------------------------------*/
810 /*-----------------------------------------------------------------------------------------------------------------*/
811 /*-----------------------------------------------------------------------------------------------------------------*/
812 /*-----------------------------------------------------------------------------------------------------------------*/
813 /*-----------------------------------------------------------------------------------------------------------------*/
814
815
816 /*---------------------------------*/
817 /*                Structs of Requests              */
818 /*---------------------------------*/
819 struct treq_sms_send_umts_msg {
820         struct telephony_sms_DataPackageInfo    msgDataPackage;
821         int                                                                     more;
822 };
823
824 struct treq_sms_send_cdma_msg {
825         struct telephony_sms_CdmaMsgInfo        cdmaMsgInfo;
826         unsigned int                                            more;
827 };
828
829 struct treq_sms_read_msg {
830         int     index;
831 };
832
833 struct treq_sms_save_msg {
834         int                                                                     simIndex;                       /* Index where SMS is stored. */
835         enum telephony_sms_MsgStatus                    msgStatus;
836         struct telephony_sms_DataPackageInfo    msgDataPackage;
837 };
838
839 struct treq_sms_delete_msg {
840         int     index;
841 };
842
843 struct treq_sms_get_msg_count {
844 };
845
846 struct treq_sms_get_sca {
847         int     index;
848 };
849
850 struct treq_sms_set_sca {
851         struct telephony_sms_AddressInfo        scaInfo;
852         int                                                             index;
853 };
854
855 struct treq_sms_get_cb_config {
856 };
857
858 struct treq_sms_set_cb_config {
859         int net3gppType;  /**< Type of 3gpp, 0x01 . 3gpp. 0x02 . 3gpp2(CDMA) */
860         int cbEnabled; /**< CB service state. If cb_enabled is true then cell broadcast service will be enabled and underlying modem will enable CB Channel to receiving CB messages. Otherwise CB service will be disabled, underlying modem will deactivate the CB channel. (enabled/disabled) */
861         unsigned char msgIdMaxCount; /**< CB Channel List Max Count For Response */
862         int msgIdRangeCount; /**< Range of CB message ID count */
863         union telephony_sms_cb_msg_info_u msgIDs[SMS_GSM_SMS_CBMI_LIST_SIZE_MAX]; /**< Range of CB message ID information */
864 };
865
866 struct treq_sms_set_mem_status {
867         int     memory_status;
868 };
869
870 struct treq_sms_get_pref_bearer {
871 };
872
873 struct treq_sms_set_pref_bearer {
874         int     svc;
875 };
876
877 struct treq_sms_set_delivery_report {
878         struct telephony_sms_DataPackageInfo    dataInfo;
879         int                                                                     rspType;
880 };
881
882 struct treq_sms_set_msg_status {
883         int                                                     index;
884         enum telephony_sms_MsgStatus    msgStatus;
885 };
886
887 struct treq_sms_get_params {
888         int     index;
889 };
890
891 struct treq_sms_set_params {
892         struct telephony_sms_Params     params;
893 };
894
895 struct treq_sms_get_paramcnt {
896 };
897
898 /*----------------------------------*/
899 /*                Structs of Responses              */
900 /*----------------------------------*/
901 struct tresp_sms_send_umts_msg {
902         struct telephony_sms_DataPackageInfo    dataInfo;
903         int                                                                     result;
904 };
905
906 struct tresp_sms_read_msg {
907         struct telephony_sms_Data       dataInfo;
908         int                                             result;
909 };
910
911 struct tresp_sms_save_msg {
912         int     index;
913         int     result;
914 };
915
916 struct tresp_sms_delete_msg {
917         int     index;
918         int     result;
919 };
920
921 struct tresp_sms_get_storedMsgCnt {
922         struct telephony_sms_StoredMsgCountInfo storedMsgCnt;
923         int                                                                             result;
924 };
925
926 struct tresp_sms_get_sca {
927         struct telephony_sms_AddressInfo        scaAddress;
928         int                                                             result;
929 };
930
931 struct tresp_sms_set_sca {
932         int     result;
933 };
934
935 struct tresp_sms_get_cb_config {
936         struct telephony_sms_CbConfig   cbConfig;
937         int                                                     result;
938 };
939
940 struct tresp_sms_set_cb_config {
941         int     result;
942 };
943
944 struct tresp_sms_set_mem_status {
945         int     result;
946 };
947
948 struct tresp_sms_get_pref_bearer {
949         int     result;
950 };
951
952 struct tresp_sms_set_pref_bearer {
953         int     svc;
954         int     result;
955 };
956
957 struct tresp_sms_set_delivery_report {
958         int     result;
959 };
960
961 struct tresp_sms_set_msg_status {
962         int     result;
963 };
964
965 struct tresp_sms_get_params {
966         struct telephony_sms_Params     paramsInfo;
967         int                                                     result;
968 };
969
970 struct tresp_sms_set_params {
971         int     result;
972 };
973
974 struct tresp_sms_get_paramcnt {
975         int     recordCount;
976         int     result;
977 };
978
979 struct tresp_sms_send_cdma_msg {
980         struct telephony_sms_Is637CauseCode     causeCode;
981         int                                                                     result;
982 };
983
984 /*-----------------------------------*/
985 /*                Structs of Notifications              */
986 /*-----------------------------------*/
987 struct tnoti_sms_umts_msg {
988         struct telephony_sms_DataPackageInfo    msgInfo;
989 };
990
991 struct tnoti_sms_cdma_msg {
992         struct telephony_sms_CdmaMsgInfo        cdmaMsg;
993 };
994
995 struct tnoti_sms_cellBroadcast_msg {
996         struct telephony_sms_CbMsg      cbMsg;
997 };
998
999 struct tnoti_sms_etws_msg {
1000         struct telephony_sms_etws_msg   etwsMsg;
1001 };
1002
1003 struct tnoti_sms_memory_status {
1004         int     status;
1005 };
1006
1007 struct tnoti_sms_ready_status {
1008         gboolean        status;
1009 };
1010
1011 __END_DECLS
1012
1013 #endif
1014