4 * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Ja-young Gu <jygu@samsung.com>
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
12 * http://www.apache.org/licenses/LICENSE-2.0
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.
27 * @addtogroup CAPI_TELEPHONY_SERVICE_SMS
31 #ifndef _TEL_NETTEXT_H_
32 #define _TEL_NETTEXT_H_
44 * @brief Definition for the EF-SMSP digit length.
47 #define TAPI_SIM_SMSP_ADDRESS_LEN 20
50 * @brief Definition for the EF-SMSP alpha ID length.
53 #define TAPI_SIM_SMSP_ALPHA_ID_LEN_MAX 128
56 * @brief Definition for the maximum message size.
59 #define TAPI_NETTEXT_MSG_SIZE_MAX 918
62 * @brief Definition for the maximum CB message size.
65 #define TAPI_NETTEXT_CB_SIZE_MAX 1252
68 * @brief Definition for the maximum ETWS message size.
71 #define TAPI_NETTEXT_ETWS_SIZE_MAX 1252
74 * @brief Definition for the nettext address length.
77 #define TAPI_NETTEXT_ADDRESS_LEN_MAX 20
80 * @brief Definition for the SC address length.
83 #define TAPI_NETTEXT_SCADDRESS_LEN_MAX 18
86 * @brief Definition for the CB maximum page size.
89 #define TAPI_NETTEXT_CB_PAGE_SIZE_MAX 9
92 * @brief Definition for the maximum GSM SMS message number.
95 #define TAPI_NETTEXT_SMS_MSG_NUM_MAX 255 /**< Maximum SMS message number*/
98 * @brief Definition for the maximum GSM SMS CBMI list size.
101 #define TAPI_NETTEXT_SMS_CBMI_LIST_SIZE_MAX 50 /**< Maximum SMS CBMI list size*/
104 * @brief Definition for the maximum SMS data size that can be stored.
107 #define TAPI_NETTEXT_SMDATA_SIZE_MAX 255 /**< Maximum SMS data size that can be stored*/
110 * @brief Definition for the maximum SMS service center address.
113 #define TAPI_NETTEXT_MAX_SMS_SERVICE_CENTER_ADDR 12
116 * @brief Definition for the maximum index value of the SMS.
119 #define TAPI_NETTEXT_MAX_INDEX 255
121 #define TAPI_NETTEXT_SMSP_PARAMS_MAX_LEN 28
124 * @brief Enumeration for network text status type.
129 TAPI_NETTEXT_STATUS_READ, /**< MT message, stored and read */
130 TAPI_NETTEXT_STATUS_UNREAD, /**< MT message, stored and unread */
131 TAPI_NETTEXT_STATUS_SENT, /**< MO message, stored and sent */
132 TAPI_NETTEXT_STATUS_UNSENT, /**< MO message, stored but not sent */
133 TAPI_NETTEXT_STATUS_DELIVERED, /**< Delivered destination */
134 TAPI_NETTEXT_STATUS_DELIVERY_UNCONFIRMED, /**< Service centre forwarded message but is unable to confirm delivery */
135 TAPI_NETTEXT_STATUS_MESSAGE_REPLACED, /**< Message has been replaced */
136 TAPI_NETTEXT_STATUS_RESERVED /**< Reserved for future use */
140 * @brief Enumeration for memory status type.
145 TAPI_NETTEXT_PDA_MEMORY_STATUS_AVAILABLE = 0x01, /**< PDA memory is available */
146 TAPI_NETTEXT_PDA_MEMORY_STATUS_FULL = 0x02, /**< PDA memory is full */
147 TAPI_NETTEXT_PHONE_MEMORY_STATUS_AVAILABLE = 0x03, /**< Phone memory is available */
148 TAPI_NETTEXT_PHONE_MEMORY_STATUS_FULL = 0x04, /**< Phone memory is full */
149 }TelSmsMemStatusType;
152 * @brief Enumeration for different CB message types.
157 TAPI_NETTEXT_CB_MSG_GSM = 1, /**< GSM Cell broadcast message */
158 TAPI_NETTEXT_CB_MSG_UMTS, /**< UMTSCell broadcast message */
159 TAPI_NETTEXT_CB_MSG_CDMA /**< CDMA broadcast message */
163 * @brief Enumeration for different ETWS message types.
168 TAPI_NETTEXT_ETWS_PRIMARY = 0, /**< Primary ETWS message */
169 TAPI_NETTEXT_ETWS_SECONDARY_GSM, /**< GSM Secondary ETWS message */
170 TAPI_NETTEXT_ETWS_SECONDARY_UMTS, /**< UMTS Secondary ETWS message */
171 TAPI_NETTEXT_ETWS_SECONDARY_CDMA /*TODO:Will be supported*/
172 } TelSmsEtwsMsgType_t;
175 * @brief Enumeration for different response types that come in the
176 * sent status acknowledgement/notification after sending a message to the network.
181 TAPI_NETTEXT_SENDSMS_SUCCESS = 0x00, /**< Message sent successfully */
182 TAPI_NETTEXT_ROUTING_NOT_AVAILABLE, /**< Message routing not available */
183 TAPI_NETTEXT_INVALID_PARAMETER, /**< Invalid parameter present in TPDU */
184 TAPI_NETTEXT_DEVICE_FAILURE, /**< Device failure */
185 TAPI_NETTEXT_SERVICE_RESERVED, /**< Reserved Service */
186 TAPI_NETTEXT_INVALID_LOCATION, /**< Invalid location */
187 TAPI_NETTEXT_NO_SIM, /**< No SIM error */
188 TAPI_NETTEXT_SIM_NOT_READY, /**< SIM not ready error */
189 TAPI_NETTEXT_NO_NETWORK_RESP, /**< No response from network */
190 TAPI_NETTEXT_DEST_ADDRESS_FDN_RESTRICTED,/**< Destination address restricted */
191 TAPI_NETTEXT_SCADDRESS_FDN_RESTRICTED, /**< Service center address restricted */
192 TAPI_NETTEXT_RESEND_ALREADY_DONE, /**< Resend an already done operation */
193 TAPI_NETTEXT_SCADDRESS_NOT_AVAILABLE, /**< SCA address not available */
194 TAPI_NETTEXT_UNASSIGNED_NUMBER = 0x8001, /**< Unassigned number */
195 TAPI_NETTEXT_OPERATOR_DETERMINED_BARRING = 0x8008,/**< Operator determined barring */
196 TAPI_NETTEXT_CALL_BARRED = 0x800A, /**< Call barred */
197 TAPI_NETTEXT_MESSAGE_TRANSFER_REJECTED = 0x8015, /**< Message transfer rejected */
198 TAPI_NETTEXT_MEMORY_CAPACITY_EXCEEDED = 0x8016, /**< Memory capacity exceeded/memory full */
199 TAPI_NETTEXT_DESTINAITION_OUTOFSERVICE = 0x801B, /**< Destination number/address out of service */
200 TAPI_NETTEXT_UNSPECIFIED_SUBSCRIBER = 0x801C, /**< Unspecified subscriber */
201 TAPI_NETTEXT_FACILITY_REJECTED = 0x801D, /**< Facility rejected */
202 TAPI_NETTEXT_UNKNOWN_SUBSCRIBER = 0x801E, /**< Unknown subscriber */
203 TAPI_NETTEXT_NETWORK_OUTOFORDER = 0x8026, /**< Network out of order */
204 TAPI_NETTEXT_TEMPORARY_FAILURE = 0x8029, /**< Temporary failure */
205 TAPI_NETTEXT_CONGESTION = 0x802A, /**< Congestion occurred */
206 TAPI_NETTEXT_RESOURCES_UNAVAILABLE = 0x802F, /**< Resource unavailable */
207 TAPI_NETTEXT_FACILITY_NOT_SUBSCRIBED = 0x8032, /**< Facility not subscribed by the user */
208 TAPI_NETTEXT_FACILITY_NOT_IMPLEMENTED = 0x8045, /**< Facility not implemented */
209 TAPI_NETTEXT_INVALID_REF_VALUE = 0x8051, /**< Invalid reference value */
210 TAPI_NETTEXT_INVALID_MSG = 0x805F, /**< Invalid message */
211 TAPI_NETTEXT_INVALID_MANDATORY_INFO = 0x8060, /**< Invalid Mandatory information */
212 TAPI_NETTEXT_MESSAGE_TYPE_NOT_IMPLEMENTED = 0x8061,/**< Message type not implemented */
213 TAPI_NETTEXT_MESSAGE_NOT_COMPAT_PROTOCOL = 0x8062, /**< Message not compact protocol */
214 TAPI_NETTEXT_IE_NOT_IMPLEMENTED = 0x8063, /**< Information element not implemented */
215 TAPI_NETTEXT_PROTOCOL_ERROR = 0x806F, /**< Protocol error */
216 TAPI_NETTEXT_INTERWORKING = 0x807F, /**< Networking error */
217 TAPI_NETTEXT_ME_FULL = 0x8080, /**< SMS ME FULL */
218 TAPI_NETTEXT_SIM_FULL = 0x8081, /**< SMS SIM FULL */
219 TAPI_NETTEXT_TIMEOUT /**< Timeout error */
223 * @brief Enumeration for different cause types that come in the
224 * sent status acknowledgement/notification after sending a message to the network.
230 TAPI_NETTEXT_SUCCESS, /**< SMS operation successful */
231 TAPI_NETTEXT_INVALID_PARAMETER_FORMAT, /**< Invalid format for some parameters passed in Data package information(TPDU) */
232 TAPI_NETTEXT_PHONE_FAILURE, /**< SMS operation failed due to Modem failure */
233 TAPI_NETTEXT_SIM_BUSY, /**< SMS SIM operation cannot be performed as the SIM is busy with some other operation */
234 TAPI_NETTEXT_SIM_FAILURE, /**< SMS SIM operation cannot be performed due to SIM failure */
235 TAPI_NETTEXT_UNKNOWN, /**< Unknown error */
236 TAPI_NETTEXT_MEMORY_FAILURE, /**< Error while accessing memory or allocating memory for SMS operation */
237 TAPI_NETTEXT_OPERATION_NOT_SUPPORTED /**< Operation not allowed/supported */
241 * @brief Enumeration for response values.
246 TAPI_NETTEXT_CBSETCONFIG_RSP, /**< Cell broadcast config response */
247 TAPI_NETTEXT_SETPREFERREDBEARER_RSP, /**< Set preferred bearer response */
248 TAPI_NETTEXT_SETPARAMETERS_RSP, /**< Set parameter response */
249 TAPI_NETTEXT_SETMEMORYSTATUS_RSP, /**< Set memory status response */
250 TAPI_NETTEXT_SETMESSAGESTATUS_RSP, /**< Set message status response */
251 TAPI_NETTEXT_SETDEVICESTATUS_RSP, /**< Set device status response */
252 TAPI_NETTEXT_SETSCADDR_RSP, /**< Set SCA address response */
253 TAPI_NETTEXT_SET_RSP_MAX /**< Maximum limit */
257 * @brief Enumeration for the type of Network
261 TAPI_NETTEXT_NETTYPE_3GPP = 0x01, /**< 3gpp type */
262 TAPI_NETTEXT_NETTYPE_3GPP2 = 0x02, /**< 3gpp2 type (CDMA) */
266 * @brief Enumeration for the sms ready status type.
270 TAPI_NETTEXT_READY_STATUS_NONE = 0x00,
271 TAPI_NETTEXT_READY_STATUS_3GPP = 0x01,
272 TAPI_NETTEXT_READY_STATUS_3GPP2 = 0x02,
273 TAPI_NETTEXT_READY_STATUS_3GPP_AND_3GPP2 = 0x03,
274 }TelSmsReadyStatus_t;
277 * @brief The structure type for different parameters of the CB configuration.
281 unsigned short FromMsgId; /**< Starting point of the range of the CBS message ID */
282 unsigned short ToMsgId; /**< Ending point of the range of the CBS message ID */
283 unsigned char Selected; /**< 0x00 . Not selected. 0x01 . Selected */
284 } TelSmsCbMsgInfo3gpp_t;
287 unsigned short CBCategory; /**< CB Service category */
288 unsigned short CBLanguage; /**< Language indicator value
289 . 0x00 . LANGUAGE_UNKNOWN . Unknown or Unspecified
290 . 0x01 . LANGUAGE_ENGLISH . English
291 . 0x02 . LANGUAGE_FRENCH . French
292 . 0x03 . LANGUAGE_SPANISH . Spanish
293 . 0x04 . LANGUAGE_JAPANESE . Japanese
294 . 0x05 . LANGUAGE_KOREAN . Korean
295 . 0x06 . LANGUAGE_CHINESE . Chinese
296 . 0x07 . LANGUAGE_HEBREW . Hebrew */
297 unsigned char Selected; /**< 0x00 . Not selected. 0x01 . Selected */
298 } TelSmsCbMsgInfo3gpp2_t;
301 TelSmsCbMsgInfo3gpp_t Net3gpp; /**< 3GPP Broadcast Configuration Information */
302 TelSmsCbMsgInfo3gpp2_t Net3gpp2; /**< 3GPP2 Broadcast Configuration Information, CDMA */
306 int Net3gppType; /**< Type of 3GPP, 0x01 . 3gpp. 0x02 . 3gpp2(CDMA) */
307 int CBEnabled; /**< CB service state. If @a CBEnabled is @c true then the cell broadcast service will be enabled and the underlying modem will enable the CB Channel to receive CB messages. Otherwise the CB service will be disabled and the underlying modem will deactivate the CB channel. (enabled/disabled) */
308 unsigned char MsgIdMaxCount; /**< CB Channel List Max Count For Response */
309 int MsgIdRangeCount; /**< Range of CB message ID count */
310 TelSmsCbMsgInfo_t MsgIDs[TAPI_NETTEXT_SMS_CBMI_LIST_SIZE_MAX]; /**< Range of CB message ID information */
314 * @brief The structure type for properties of a dialing number.
315 * @details Those properties are: type of the number, numbering plan indicator, length, and the actual number.
319 unsigned int DialNumLen; /**< Length of the address. If the Service center address is not set, then this will be zero */
320 TelSimTypeOfNum_t Ton; /**< Type of number */
321 TelSimNumberingPlanIdentity_t Npi; /**< Numbering plan identification */
322 unsigned char szDiallingNum[TAPI_SIM_SMSP_ADDRESS_LEN + 1]; /**< Destination address. If the address is not set, then it is set to 0xFF */
323 } TelSmsAddressInfo_t;
326 * @brief The structure type for different fields involved in setting the parameters of a particular SMS in EFsmsp.
331 unsigned char RecordIndex; /**< Index */
332 unsigned char RecordLen; /**< SMS Parameter Record length */
333 unsigned long AlphaIdLen; /**< Alpha ID length */
334 char szAlphaId[TAPI_SIM_SMSP_ALPHA_ID_LEN_MAX + 1]; /**< Alpha ID. It is a unique identifier for each row/record in EFsmsp */
335 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 @c 0. If the parameter is absent then it is set as @c 1. Refer 3GPP TS 31.02 :4.4.23 */
336 TelSmsAddressInfo_t TpDestAddr; /**< TP-destination address (TP-DA) */
337 TelSmsAddressInfo_t TpSvcCntrAddr; /**< TP-service center address */
338 unsigned short TpProtocolId; /**< TP-protocol ID */
339 unsigned short TpDataCodingScheme; /**< TP-data coding scheme */
340 unsigned short TpValidityPeriod; /**< TP-validity period */
344 * @brief The structure type for the fields related to an SMS like format(3GPP/3GPP2), TPDU and length
346 * SCA will be filled by MSG_SERVICE for GSM/UMTS technology only.\n
347 * For CDMA SCA need not be filled by MSG_SERVICE.
351 unsigned char Sca[TAPI_SIM_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 */
352 int MsgLength; /**< Size of array szData (which is actual TPDU message) */
353 unsigned char szData[TAPI_NETTEXT_SMDATA_SIZE_MAX + 1]; /**<SMS TPDU message */
354 TelSmsNetType_t format;
355 } TelSmsDatapackageInfo_t;
358 * @brief The structure type for data related to SimIndex, MessageStatus, and SMS Data Stored.
362 int SimIndex; /**< Index where SMS is stored */
363 TelSmsMsgStatus_t MsgStatus; /**< Message status */
364 TelSmsDatapackageInfo_t SmsData; /**< SMS message */
368 * @brief The structure type for different parameters that are related to the message count in a particular memory (Phone/SIM).
372 unsigned int TotalCount; /**< Total count of messages stored in the SIM */
373 int UsedCount; /**< Stored message count in the SIM */
374 int IndexList[TAPI_NETTEXT_SMS_MSG_NUM_MAX]; /**< Message index list stored in the SIM. And the maximum size of this array can be of @a TotalCount. This array contains the list of index values in which the messages are stored, i.e. index_list[totalcount] = [2,3] denotes that indexes 2 and 3 are stored(valid) and others are not(empty) */
375 } TelSmsStoredMsgCountInfo_t;
378 * @brief The structure type for a cell broadcast message.
383 TelSmsCbMsgType_t CbMsgType; /**< Cell Broadcast message type */
384 unsigned short Length; /**< Size of array @a szMsgData (which is the actual TPDU message) */
385 char szMsgData[TAPI_NETTEXT_CB_SIZE_MAX + 1]; /**< Cell broadcast message data[Refer 3GPP TS 23.041 9.4.1] */
389 * @brief The structure type for a ETWS message.
393 TelSmsEtwsMsgType_t EtwsMsgType; /**< Cell Broadcast message type */
394 unsigned short Length; /**< Size of array @a szMsgData (which is the actual TPDU message) */
395 char szMsgData[TAPI_NETTEXT_ETWS_SIZE_MAX + 1]; /**< Cell broadcast message data[Refer 3GPP TS 23.041 9.4.1] */
398 struct tel_noti_sms_incomming_msg {
399 char Sca[TAPI_SIM_SMSP_ADDRESS_LEN]; /**< TBD */
400 int MsgLength; /**< TBD */
401 char szData[TAPI_NETTEXT_SMDATA_SIZE_MAX + 1]; /**< TBD */
402 TelSmsNetType_t format;
405 struct tel_noti_sms_incomming_cb_msg {
406 TelSmsCbMsgType_t CbMsgType; /**< Cell Broadcast message type */
407 short Length; /**< Size of array @a szMsgData (which is the actual TPDU message) */
408 char szMsgData[TAPI_NETTEXT_CB_SIZE_MAX + 1]; /**< Cell broadcast message data[Refer 3GPP TS 23.041 9.4.1] */
411 struct tel_noti_sms_incomming_etws_msg {
412 TelSmsEtwsMsgType_t EtwsMsgType; /**< ETWS message type */
413 short Length; /**< Size of array @a szMsgData (which is the actual TPDU message) */
414 char szMsgData[TAPI_NETTEXT_ETWS_SIZE_MAX + 1]; /**< ETWS message data[Refer 3GPP TS 23.041 9.4.1] */
422 #endif // _TEL_NETTEXT_H_