le_smsInbox1_common.h

Go to the documentation of this file.
1 
2 /*
3  * ====================== WARNING ======================
4  *
5  * THE CONTENTS OF THIS FILE HAVE BEEN AUTO-GENERATED.
6  * DO NOT MODIFY IN ANY WAY.
7  *
8  * ====================== WARNING ======================
9  */
10 /**
11  * @file le_smsInbox1_common.h
12  *
13  * Type definitions for le_smsInbox1.
14  *
15  */
16 #ifndef LE_SMSINBOX1_COMMON_H_INCLUDE_GUARD
17 #define LE_SMSINBOX1_COMMON_H_INCLUDE_GUARD
18 
19 
20 #include "legato.h"
21 
22 // Interface specific includes
23 #include "le_mdmDefs_common.h"
24 #include "le_sim_common.h"
25 #include "le_sms_common.h"
26 
27 #define IFGEN_LE_SMSINBOX1_PROTOCOL_ID "29519277b102cc40392e7940ee0aa673"
28 #define IFGEN_LE_SMSINBOX1_MSG_SIZE 271
29 /** @addtogroup le_smsInbox1
30  * @{ **/
31 
32 
33 //--------------------------------------------------------------------------------------------------
34 /**
35  * Define unknown format
36  */
37 //--------------------------------------------------------------------------------------------------
38 #define LE_SMSINBOX1_FORMAT_UNKNOWN -1
39 
40 //--------------------------------------------------------------------------------------------------
41 /**
42  * Define the name of length of the message box name
43  */
44 //--------------------------------------------------------------------------------------------------
45 #define LE_SMSINBOX1_MAX_MBOX_NAME_LEN 12
46 
47 //--------------------------------------------------------------------------------------------------
48 /**
49  * Reference type for referring to open message box sessions.
50  */
51 //--------------------------------------------------------------------------------------------------
52 typedef struct le_smsInbox1_Session* le_smsInbox1_SessionRef_t;
53 
54 
55 //--------------------------------------------------------------------------------------------------
56 /**
57  * Reference type used by Add/Remove functions for EVENT 'le_smsInbox1_RxMessage'
58  */
59 //--------------------------------------------------------------------------------------------------
60 typedef struct le_smsInbox1_RxMessageHandler* le_smsInbox1_RxMessageHandlerRef_t;
61 
62 
63 //--------------------------------------------------------------------------------------------------
64 /**
65  * Handler for New Message.
66  *
67  */
68 //--------------------------------------------------------------------------------------------------
70 (
71  uint32_t msgId,
72  ///< Message identifier.
73  void* contextPtr
74  ///<
75 );
76 
77 
78 //--------------------------------------------------------------------------------------------------
79 /**
80  * Get if this client bound locally.
81  */
82 //--------------------------------------------------------------------------------------------------
83 LE_SHARED bool ifgen_le_smsInbox1_HasLocalBinding
84 (
85  void
86 );
87 
88 
89 //--------------------------------------------------------------------------------------------------
90 /**
91  * Init data that is common across all threads
92  */
93 //--------------------------------------------------------------------------------------------------
94 LE_SHARED void ifgen_le_smsInbox1_InitCommonData
95 (
96  void
97 );
98 
99 
100 //--------------------------------------------------------------------------------------------------
101 /**
102  * Perform common initialization and open a session
103  */
104 //--------------------------------------------------------------------------------------------------
105 LE_SHARED le_result_t ifgen_le_smsInbox1_OpenSession
106 (
107  le_msg_SessionRef_t _ifgen_sessionRef,
108  bool isBlocking
109 );
110 
111 //--------------------------------------------------------------------------------------------------
112 /**
113  * Open a message box.
114  *
115  * @return
116  * Reference on the opened message box session
117  */
118 //--------------------------------------------------------------------------------------------------
119 LE_SHARED le_smsInbox1_SessionRef_t ifgen_le_smsInbox1_Open
120 (
121  le_msg_SessionRef_t _ifgen_sessionRef
122 );
123 
124 //--------------------------------------------------------------------------------------------------
125 /**
126  * Close a previously open message box.
127  *
128  */
129 //--------------------------------------------------------------------------------------------------
130 LE_SHARED void ifgen_le_smsInbox1_Close
131 (
132  le_msg_SessionRef_t _ifgen_sessionRef,
133  le_smsInbox1_SessionRef_t sessionRef
134  ///< [IN] Mailbox session reference.
135 );
136 
137 //--------------------------------------------------------------------------------------------------
138 /**
139  * Add handler function for EVENT 'le_smsInbox1_RxMessage'
140  *
141  * This event provides information on new received messages.
142  *
143  */
144 //--------------------------------------------------------------------------------------------------
145 LE_SHARED le_smsInbox1_RxMessageHandlerRef_t ifgen_le_smsInbox1_AddRxMessageHandler
146 (
147  le_msg_SessionRef_t _ifgen_sessionRef,
149  ///< [IN]
150  void* contextPtr
151  ///< [IN]
152 );
153 
154 //--------------------------------------------------------------------------------------------------
155 /**
156  * Remove handler function for EVENT 'le_smsInbox1_RxMessage'
157  */
158 //--------------------------------------------------------------------------------------------------
159 LE_SHARED void ifgen_le_smsInbox1_RemoveRxMessageHandler
160 (
161  le_msg_SessionRef_t _ifgen_sessionRef,
163  ///< [IN]
164 );
165 
166 //--------------------------------------------------------------------------------------------------
167 /**
168  * Delete a Message.
169  *
170  * @note It is valid to delete a non-existent message.
171  */
172 //--------------------------------------------------------------------------------------------------
173 LE_SHARED void ifgen_le_smsInbox1_DeleteMsg
174 (
175  le_msg_SessionRef_t _ifgen_sessionRef,
176  uint32_t msgId
177  ///< [IN] Message identifier.
178 );
179 
180 //--------------------------------------------------------------------------------------------------
181 /**
182  * Retrieves the IMSI of the message receiver SIM if it applies.
183  *
184  * @return
185  * - LE_NOT_FOUND The message item is not tied to a SIM card, the imsi string is empty.
186  * - LE_OVERFLOW The imsiPtr buffer was too small for the IMSI.
187  * - LE_BAD_PARAMETER The message reference is invalid.
188  * - LE_FAULT The function failed.
189  * - LE_OK The function succeeded.
190  *
191  */
192 //--------------------------------------------------------------------------------------------------
193 LE_SHARED le_result_t ifgen_le_smsInbox1_GetImsi
194 (
195  le_msg_SessionRef_t _ifgen_sessionRef,
196  uint32_t msgId,
197  ///< [IN] Message identifier.
198  char* imsi,
199  ///< [OUT] IMSI.
200  size_t imsiSize
201  ///< [IN]
202 );
203 
204 //--------------------------------------------------------------------------------------------------
205 /**
206  * Get the message format (text, binary or PDU).
207  *
208  * @return
209  * - Message format.
210  * - FORMAT_UNKNOWN when the message format cannot be identified or the message reference is
211  * invalid.
212  * @note For incoming SMS Inbox, format returned by le_smsInbox1_GetFormat() is never
213  * LE_SMSINBOX1_FORMAT_PDU.
214  */
215 //--------------------------------------------------------------------------------------------------
216 LE_SHARED le_sms_Format_t ifgen_le_smsInbox1_GetFormat
217 (
218  le_msg_SessionRef_t _ifgen_sessionRef,
219  uint32_t msgId
220  ///< [IN] Message identifier.
221 );
222 
223 //--------------------------------------------------------------------------------------------------
224 /**
225  * Get the Sender Identifier.
226  *
227  * @return
228  * - LE_BAD_PARAMETER The message reference is invalid.
229  * - LE_OVERFLOW Identifier length exceed the maximum length.
230  * - LE_OK Function succeeded.
231  */
232 //--------------------------------------------------------------------------------------------------
233 LE_SHARED le_result_t ifgen_le_smsInbox1_GetSenderTel
234 (
235  le_msg_SessionRef_t _ifgen_sessionRef,
236  uint32_t msgId,
237  ///< [IN] Message identifier.
238  char* tel,
239  ///< [OUT] Identifier string.
240  size_t telSize
241  ///< [IN]
242 );
243 
244 //--------------------------------------------------------------------------------------------------
245 /**
246  * Get the Message Time Stamp string (it does not apply for PDU message).
247  *
248  * @return
249  * - LE_BAD_PARAMETER The message reference is invalid.
250  * - LE_NOT_FOUND The message is a PDU message.
251  * - LE_OVERFLOW Timestamp number length exceed the maximum length.
252  * - LE_OK Function succeeded.
253  */
254 //--------------------------------------------------------------------------------------------------
255 LE_SHARED le_result_t ifgen_le_smsInbox1_GetTimeStamp
256 (
257  le_msg_SessionRef_t _ifgen_sessionRef,
258  uint32_t msgId,
259  ///< [IN] Message identifier.
260  char* timestamp,
261  ///< [OUT] Message time stamp (for text or binary
262  ///< messages). String format:
263  ///< "yy/MM/dd,hh:mm:ss+/-zz"
264  ///< (Year/Month/Day,Hour:Min:Seconds+/-TimeZone)
265  size_t timestampSize
266  ///< [IN]
267 );
268 
269 //--------------------------------------------------------------------------------------------------
270 /**
271  * Get the message Length value.
272  *
273  * @return Number of characters for text messages, or the length of the data in bytes for raw
274  * binary and PDU messages.
275  */
276 //--------------------------------------------------------------------------------------------------
277 LE_SHARED size_t ifgen_le_smsInbox1_GetMsgLen
278 (
279  le_msg_SessionRef_t _ifgen_sessionRef,
280  uint32_t msgId
281  ///< [IN] Message identifier.
282 );
283 
284 //--------------------------------------------------------------------------------------------------
285 /**
286  * Get the text Message.
287  *
288  *
289  * @return
290  * - LE_BAD_PARAMETER The message reference is invalid.
291  * - LE_FORMAT_ERROR Message is not in text format.
292  * - LE_OVERFLOW Message length exceed the maximum length.
293  * - LE_OK Function succeeded.
294  */
295 //--------------------------------------------------------------------------------------------------
296 LE_SHARED le_result_t ifgen_le_smsInbox1_GetText
297 (
298  le_msg_SessionRef_t _ifgen_sessionRef,
299  uint32_t msgId,
300  ///< [IN] Message identifier.
301  char* text,
302  ///< [OUT] Message text.
303  size_t textSize
304  ///< [IN]
305 );
306 
307 //--------------------------------------------------------------------------------------------------
308 /**
309  * Get the binary Message.
310  *
311  *
312  * @return
313  * - LE_BAD_PARAMETER The message reference is invalid.
314  * - LE_FORMAT_ERROR Message is not in binary format.
315  * - LE_OVERFLOW Message length exceed the maximum length.
316  * - LE_OK Function succeeded.
317  */
318 //--------------------------------------------------------------------------------------------------
319 LE_SHARED le_result_t ifgen_le_smsInbox1_GetBinary
320 (
321  le_msg_SessionRef_t _ifgen_sessionRef,
322  uint32_t msgId,
323  ///< [IN] Message identifier.
324  uint8_t* binPtr,
325  ///< [OUT] Binary message.
326  size_t* binSizePtr
327  ///< [INOUT]
328 );
329 
330 //--------------------------------------------------------------------------------------------------
331 /**
332  * Get the PDU message.
333  *
334  * Output parameters are updated with the PDU message content and the length of the PDU message
335  * in bytes.
336  *
337  * @return
338  * - LE_BAD_PARAMETER The message reference is invalid.
339  * - LE_FORMAT_ERROR Unable to encode the message in PDU.
340  * - LE_OVERFLOW Message length exceed the maximum length.
341  * - LE_OK Function succeeded.
342  */
343 //--------------------------------------------------------------------------------------------------
344 LE_SHARED le_result_t ifgen_le_smsInbox1_GetPdu
345 (
346  le_msg_SessionRef_t _ifgen_sessionRef,
347  uint32_t msgId,
348  ///< [IN] Message identifier.
349  uint8_t* pduPtr,
350  ///< [OUT] PDU message.
351  size_t* pduSizePtr
352  ///< [INOUT]
353 );
354 
355 //--------------------------------------------------------------------------------------------------
356 /**
357  * Get the first Message object reference in the inbox message.
358  *
359  * @return
360  * - 0 No message found (message box parsing is over).
361  * - Message identifier.
362  */
363 //--------------------------------------------------------------------------------------------------
364 LE_SHARED uint32_t ifgen_le_smsInbox1_GetFirst
365 (
366  le_msg_SessionRef_t _ifgen_sessionRef,
367  le_smsInbox1_SessionRef_t sessionRef
368  ///< [IN] Mailbox session reference.
369 );
370 
371 //--------------------------------------------------------------------------------------------------
372 /**
373  * Get the next Message object reference in the inbox message.
374  *
375  * @return
376  * - 0 No message found (message box parsing is over).
377  * - Message identifier.
378  */
379 //--------------------------------------------------------------------------------------------------
380 LE_SHARED uint32_t ifgen_le_smsInbox1_GetNext
381 (
382  le_msg_SessionRef_t _ifgen_sessionRef,
383  le_smsInbox1_SessionRef_t sessionRef
384  ///< [IN] Mailbox session reference.
385 );
386 
387 //--------------------------------------------------------------------------------------------------
388 /**
389  * allow to know whether the message has been read or not. The message status is tied to the client
390  * app.
391  *
392  * @return True if the message is unread, false otherwise.
393  *
394  * @note If the caller is passing a bad message reference into this function, it is a fatal error,
395  * the function will not return.
396  */
397 //--------------------------------------------------------------------------------------------------
398 LE_SHARED bool ifgen_le_smsInbox1_IsUnread
399 (
400  le_msg_SessionRef_t _ifgen_sessionRef,
401  uint32_t msgId
402  ///< [IN] Message identifier.
403 );
404 
405 //--------------------------------------------------------------------------------------------------
406 /**
407  * Mark a message as 'read'.
408  *
409  * @note If the caller is passing a bad message reference into this function, it is a fatal error,
410  * the function will not return.
411  */
412 //--------------------------------------------------------------------------------------------------
413 LE_SHARED void ifgen_le_smsInbox1_MarkRead
414 (
415  le_msg_SessionRef_t _ifgen_sessionRef,
416  uint32_t msgId
417  ///< [IN] Message identifier.
418 );
419 
420 //--------------------------------------------------------------------------------------------------
421 /**
422  * Mark a message as 'unread'.
423  *
424  * @note If the caller is passing a bad message reference into this function, it is a fatal error,
425  * the function will not return.
426  */
427 //--------------------------------------------------------------------------------------------------
428 LE_SHARED void ifgen_le_smsInbox1_MarkUnread
429 (
430  le_msg_SessionRef_t _ifgen_sessionRef,
431  uint32_t msgId
432  ///< [IN] Message identifier.
433 );
434 
435 //--------------------------------------------------------------------------------------------------
436 /**
437  * Set the maximum number of messages for message box.
438  *
439  * @return
440  * - LE_BAD_PARAMETER The message box name is invalid.
441  * - LE_OVERFLOW Message count exceed the maximum limit.
442  * - LE_OK Function succeeded.
443  * - LE_FAULT Function failed.
444  */
445 //--------------------------------------------------------------------------------------------------
446 LE_SHARED le_result_t ifgen_le_smsInbox1_SetMaxMessages
447 (
448  le_msg_SessionRef_t _ifgen_sessionRef,
449  uint32_t maxMessageCount
450  ///< [IN] Maximum number of messages
451 );
452 
453 //--------------------------------------------------------------------------------------------------
454 /**
455  * Get the maximum number of messages for message box.
456  *
457  * @return
458  * - LE_BAD_PARAMETER The message box name is invalid.
459  * - LE_OK Function succeeded.
460  * - LE_FAULT Function failed.
461  */
462 //--------------------------------------------------------------------------------------------------
463 LE_SHARED le_result_t ifgen_le_smsInbox1_GetMaxMessages
464 (
465  le_msg_SessionRef_t _ifgen_sessionRef,
466  uint32_t* maxMessageCountPtrPtr
467  ///< [OUT] Maximum number of messages
468 );
469 /** @} **/
470 #endif // LE_SMSINBOX1_COMMON_H_INCLUDE_GUARD
#define LE_SHARED
Definition: le_basics.h:287
struct le_smsInbox1_Session * le_smsInbox1_SessionRef_t
Definition: le_smsInbox1_common.h:52
le_result_t
Definition: le_basics.h:46
struct le_smsInbox1_RxMessageHandler * le_smsInbox1_RxMessageHandlerRef_t
Definition: le_smsInbox1_common.h:60
struct le_msg_Session * le_msg_SessionRef_t
Definition: le_messaging.h:860
le_sms_Format_t
Definition: le_sms_common.h:109
void(* le_smsInbox1_RxMessageHandlerFunc_t)(uint32_t msgId, void *contextPtr)
Definition: le_smsInbox1_common.h:70