4 * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
5 * Copyright (c) 2013 Intel Corporation. All rights reserved.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
26 * @addtogroup TAPI_SMS
30 * @brief TAPI sms Interface
38 #define TELEPHONY_SMS_INTERFACE TELEPHONY_SERVICE".Sms"
40 #define TEL_SMS_SCA_LEN_MAX 20 /**< Maximum length of SCA (in string format)*/
42 #define TEL_SMS_CB_DATA_SIZE_MAX 88 /**< Maximum CB Message Size. Cell broadcast message data [Refer 3GPP TS 23.041 9.4.1] */
43 #define TEL_SMS_ETWS_DATA_SIZE_MAX 1252 /**< Maximum ETWS Message Size */
45 #define TEL_SMS_GSM_MSG_NUM_MAX 255 /**< Maximum GSM SMS message number*/
46 #define TEL_SMS_GSM_CBMI_LIST_SIZE_MAX 50 /**< Maximum GSM SMS CBMI list size*/
47 #define TEL_SMS_SMDATA_SIZE_MAX 164 /**< Maximum SMS data size that can be stored*/
50 * @enum TelSmsMsgStatus
51 * This enumeration defines the sms Response (Result) codes.
54 TEL_SMS_STATUS_MT_READ, /**< MT message, stored and read */
55 TEL_SMS_STATUS_MT_UNREAD, /**< MT message, stored and unread */
56 TEL_SMS_STATUS_MO_SENT, /**< MO message, stored and sent */
57 TEL_SMS_STATUS_MO_NOT_SENT, /**< MO message, stored but not sent */
58 TEL_SMS_STATUS_MO_DELIVERED, /**< delivered destination */
59 TEL_SMS_STATUS_MO_DELIVERY_NOT_CONFIRMED, /**< Service centre forwarded message but is unable to confirm delivery*/
60 TEL_SMS_STATUS_REPLACED /**< Message has been replaced*/
65 * @enum TelSmsCbMsgType
66 * This enumeration defines the different CB message types.
69 TEL_SMS_CB_MSG_GSM, /**< GSM Cell broadcast message */
70 TEL_SMS_CB_MSG_UMTS /**< UMTSCell broadcast message */
74 * @enum TelSmsEtwsMsgType
75 * This enumeration defines the different ETWS message types.
78 TEL_SMS_ETWS_PRIMARY, /**< Primary ETWS message */
79 TEL_SMS_ETWS_SECONDARY_GSM, /**< GSM Secondary ETWS message */
80 TEL_SMS_ETWS_SECONDARY_UMTS /**< UMTS Secondary ETWS message */
85 * This enum defines the different SMS error causes that come in the
86 * sent status acknowledgement/notification after sending a message to the network
89 TEL_SMS_RESULT_SUCCESS, /**< Operation completed successfully */
90 TEL_SMS_RESULT_FAILURE, /**< Operation Failed */
91 TEL_SMS_RESULT_INVALID_PARAMETER, /**< Invalid input parameters */
92 TEL_SMS_RESULT_MEMORY_FAILURE, /**< Memory allocation failed */
93 TEL_SMS_RESULT_OPERATION_NOT_SUPPORTED, /**< Operation not supported */
94 TEL_SMS_RESULT_UNKNOWN_FAILURE, /**< Unknown failure */
96 TEL_SMS_RESULT_INVALID_MANDATORY_INFO, /**< Invalid format for some parameters passed in Data package information(TPDU)*/
97 TEL_SMS_RESULT_NETWORK_CONGESTION, /**< SMS SIM operation cannot be performed due to Network Congestion */
98 TEL_SMS_RESULT_SIM_FAILURE, /**< SMS SIM operation cannot be performed due to SIM failure */
99 TEL_SMS_RESULT_NETWORK_FAILURE, /**< SMS SIM operation cannot be performed due to Network failure */
100 TEL_SMS_RESULT_OPERATION_NOT_PERMITTED /** Operation not permitted */
104 * This structure defines the properties of a dialing number
105 * Type of Number, Numbering Plan Indicator and the actual number.
108 unsigned char ton; /**< Type of number*/
109 unsigned char npi; /**<Numbering plan identification*/
110 char number[TEL_SMS_SCA_LEN_MAX + 1]; /**< Destination address */
114 * This structure defines the different parameters of CB configuration
117 unsigned short from_msg_id; /**< Starting point of the range of CBS message ID */
118 unsigned short to_msg_id; /**< Ending point of the range of CBS message ID */
119 gboolean selected; /**< 0x00 . Not selected. 0x01 . Selected */
120 } TelSmsCbMsgInfo3gpp;
123 * This structure defines the different parameters of CB configuration informations
126 gboolean cb_enabled; /**< CB service state. If cb_enabled is true then cell broadcast service will be enabled and
127 * underlying modem will enable CB Channel to receiving CB messages. Otherwise CB service
128 * will be disabled, underlying modem will deactivate the CB channel. (enabled/disabled) */
129 unsigned int msg_id_range_cnt; /**< Range of CB message ID count */
130 TelSmsCbMsgInfo3gpp msg_ids[TEL_SMS_GSM_CBMI_LIST_SIZE_MAX]; /**< Range of CB message ID information */
131 } TelSmsCbConfigInfo;
134 * This structure defines different fields involved in setting the parameters of
135 * a particular sms in EFsmsp.
138 unsigned int index; /**< Index */
139 TelSmsSca sca; /**< Service Centre Address info */
140 unsigned short vp; /**< Validity Period */
144 * This structure defines different fields involved in getting the sms parameters
147 unsigned int count; /**< SMS parameter count */
148 TelSmsParamsInfo *params; /**< SMS parameter informations */
149 } TelSmsParamsInfoList;
152 * This structure defines the fields related to an Sms like SIM index, TPDU
156 TelSmsSca sca; /**< Service Centre Address info */
157 unsigned int tpdu_length; /**< Size of array tpdu (which is actual TPDU message) */
158 unsigned char tpdu[TEL_SMS_SMDATA_SIZE_MAX]; /**< SMS TPDU message */
159 } TelSmsDatapackageInfo;
162 *This structure defines the data Related to MessageStatus and SMS Data Stored.
165 TelSmsMsgStatus status; /**< Message status.*/
166 TelSmsDatapackageInfo data; /**<SMS message data*/
170 *This structure defines the data Related to SMS Data to be send.
173 gboolean more_msgs; /**< More messages to be send exist */
174 TelSmsDatapackageInfo send_data; /**<SMS message data*/
178 *This structure defines the data Related to set message status
181 unsigned int index; /**< Index where message status to be set */
182 TelSmsMsgStatus status; /**< Message status.*/
186 * @enum TelSmsDeliveryReport
187 * This enum defines the error causes for delivery report
190 TEL_SMS_DELIVERY_REPORT_SUCCESS, /**<Message was sent successfully*/
191 TEL_SMS_DELIVERY_REPORT_MEMORY_ERROR, /**< Memory capacity exceeded/memory full*/
192 TEL_SMS_DELIVERY_REPORT_UNSPECIFIED_ERROR /**<Unspecified error */
193 } TelSmsDeliveryReport;
196 *This structure defines the SMS delivery report information
199 TelSmsDeliveryReport report; /**<Delivery report response types*/
200 TelSmsDatapackageInfo data; /**<SMS data */
201 } TelSmsDeliverReportInfo;
204 * This structure defines the different parameters that are related to the message count
205 * in a particular memory(Phone/SIM)
208 unsigned int total_count; /**< Total count of messages stored in SIM*/
209 unsigned int used_count; /**< Stored message count in SIM in SIM*/
210 unsigned int index_list[TEL_SMS_GSM_MSG_NUM_MAX]; /**< Message index list stored in SIM. And the maximum
211 *size of this array can be of totalCount.This array contains the
212 *list of index values in which the messages are stored.
213 *i.e. index_list[totalcount] = [2,3] denotes that indexs
214 *2 and 3 are stored(valid) and others not(empty).
216 } TelSmsStoredMsgCountInfo;
219 * This structure defines a cell broadcast message.
222 TelSmsCbMsgType cb_type; /**< Cell Broadcast message type */
223 unsigned int length; /**<Length of cb_data (which is actual TPDU message) */
224 unsigned char *cb_data; /**<Cell broadcast message data[Refer 3GPP TS 23.041 9.4.1]*/
228 * This structure defines a ETWS message.
231 TelSmsEtwsMsgType etws_type; /**< Cell Broadcast message type */
232 unsigned int length; /**<Length of etws_data (which is actual TPDU message) */
233 unsigned char *etws_data; /**<Cell broadcast message data[Refer 3GPP TS 23.041 9.4.1]*/
237 * \defgroup TAPI_EVENT TAPI Event IDs
242 * \defgroup TEL_EVENT_SMS SMS Event IDs
248 * @brief Incoming Message
249 * @section subscription Event Subscription
250 * @details Event can be subscribed with event id TEL_NOTI_SMS_INCOM_MSG
251 * @sa tapi_register_event_id
252 * @section handling Event Handling
253 * @details TAPI will invoke the registered callback (\ref TapiEvtCb) and return the following data:
254 * @retval handle #TelHandle used for registering the event
255 * @retval evt_id TEL_NOTI_SMS_INCOM_MSG
256 * @retval data reference to \ref TelSmsDatapackageInfo structure
257 * @retval user_data user data passed while registering the event
259 #define TEL_NOTI_SMS_INCOM_MSG TELEPHONY_SMS_INTERFACE":IncomingMsg"
263 * @brief Incoming CB Message
264 * @section subscription Event Subscription
265 * @details Event can be subscribed with event id TEL_NOTI_SMS_CB_INCOM_MSG
266 * @sa tapi_register_event_id
267 * @section handling Event Handling
268 * @details TAPI will invoke the registered callback (\ref TapiEvtCb) and return the following data:
269 * @retval handle #TelHandle used for registering the event
270 * @retval evt_id TEL_NOTI_SMS_CB_INCOM_MSG
271 * @retval data reference to \ref TelSmsCbMsgInfo structure
272 * @retval user_data user data passed while registering the event
274 #define TEL_NOTI_SMS_CB_INCOM_MSG TELEPHONY_SMS_INTERFACE":IncomingCbMsg"
278 * @brief Incoming ETWS Message
279 * @section subscription Event Subscription
280 * @details Event can be subscribed with event id TEL_NOTI_SMS_ETWS_INCOM_MSG
281 * @sa tapi_register_event_id
282 * @section handling Event Handling
283 * @details TAPI will invoke the registered callback (\ref TapiEvtCb) and return the following data:
284 * @retval handle #TelHandle used for registering the event
285 * @retval evt_id TEL_NOTI_SMS_ETWS_INCOM_MSG
286 * @retval data reference to \ref TelSmsEtwsMsgInfo structure
287 * @retval user_data user data passed while registering the event
289 #define TEL_NOTI_SMS_ETWS_INCOM_MSG TELEPHONY_SMS_INTERFACE":IncomingEtwsMsg"
293 * @brief SIM memory status for SMS
294 * @section subscription Event Subscription
295 * @details Event can be subscribed with event id TEL_NOTI_SMS_SIM_MEMORY_STATUS
296 * @sa tapi_register_event_id
297 * @section handling Event Handling
298 * @details TAPI will invoke the registered callback (\ref TapiEvtCb) and return the following data:
299 * @retval handle #TelHandle used for registering the event
300 * @retval evt_id TEL_NOTI_SMS_SIM_MEMORY_STATUS
301 * @retval data <b>TRUE</b>: Memory available\n <b>FALSE</b>: Memory NOT available
302 * @retval user_data user data passed while registering the event
304 #define TEL_NOTI_SMS_SIM_MEMORY_STATUS TELEPHONY_SMS_INTERFACE":SimMemoryStatus"
308 * @brief SMS init status
309 * @section subscription Event Subscription
310 * @details Event can be subscribed with event id TEL_NOTI_SMS_INIT_STATUS
311 * @sa tapi_register_event_id
312 * @section handling Event Handling
313 * @details TAPI will invoke the registered callback (\ref TapiEvtCb) and return the following data:
314 * @retval handle #TelHandle used for registering the event
315 * @retval evt_id TEL_NOTI_SMS_INIT_STATUS
316 * @retval data <b>TRUE</b>: SMS is Initialized\n <b>FALSE</b>: SMS is NOT initialized
317 * @retval user_data user data passed while registering the event
319 #define TEL_NOTI_SMS_INIT_STATUS TELEPHONY_SMS_INTERFACE":InitStatus"
332 #endif /* __TEL_SMS_H__ */