le_sms_interface.h

Go to the documentation of this file.
1 
2 
3 /*
4  * ====================== WARNING ======================
5  *
6  * THE CONTENTS OF THIS FILE HAVE BEEN AUTO-GENERATED.
7  * DO NOT MODIFY IN ANY WAY.
8  *
9  * ====================== WARNING ======================
10  */
11 
12 /**
13  * @page c_sms SMS
14  *
15  * @ref le_sms_interface.h "API Reference"
16  *
17  * <HR>
18  *
19  * This file contains data structures and prototypes definitions for high level SMS APIs.
20  *
21  * SMS is a common way to communicate in the M2M world.
22  *
23  * It's an easy, fast way to send a small amount of data (e.g., sensor values for gas telemetry).
24  * Usually, the radio module requests small power resources to send or receive a message.
25  * It's often a good way to wake-up a device that was disconnected from the network or that was
26  * operating in low power mode.
27  *
28  * @section le_sms_binding IPC interfaces binding
29  *
30  * All the functions of this API are provided by the @b modemService.
31  *
32  * Here's a code sample binding to modem services:
33  * @verbatim
34  bindings:
35  {
36  clientExe.clientComponent.le_sms -> modemService.le_sms
37  }
38  @endverbatim
39  *
40  * @section le_sms_ops_creating_msg Creating a Message object
41  * There are 3 kinds of supported messages: text messages, binary messages, and PDU messages.
42  *
43  * You must create a Message object by calling @c le_sms_Create() before using the message
44  * APIs. It automatically allocates needed resources for the Message object, which is referenced by
45  * @c le_sms_MsgRef_t type.
46  *
47  * When the Message object is no longer needed, call @c le_sms_Delete() to free all
48  * allocated resources associated with the object.
49  *
50  * @section le_sms_ops_deleting_msg Deleting a Message object
51  * To delete a Message object, call le_sms_Delete(). This frees all the
52  * resources allocated for the Message object. If several users own the Message object
53  * (e.g., several handler functions registered for SMS message reception), the
54  * Message object will be deleted only after the last user deletes the Message object.
55  *
56  * @section le_sms_ops_sending Sending a message
57  * To send a message, create an @c le_sms_MsgRef_t object by calling the
58  * @c le_sms_Create() function. Then, set all the needed parameters for the message:
59  * - Destination telephone number with le_sms_SetDestination();
60  * - Text content with le_sms_SetText(), the total length are set as well with this API, maximum
61  * 160 characters as only the 7-bit alphabet is supported.
62  * - Binary content with le_sms_SetBinary(), total length is set with this API, maximum 140 bytes.
63  * - PDU content with le_sms_SetPDU(), total length is set with this API, max 36 (header) + 140
64  * (payload) bytes long.
65  * - UCS2 content (16-bit format) with le_sms_SetUCS2(), total length is set with this API, maximum
66  * 70 characters (140 bytes).
67  *
68  * When the Msg object is ready, call @c le_sms_Send() to transmit it.
69  *
70  * @c le_sms_Send() is a blocking function with a maximum timeout set to 240 seconds, it will return
71  * once the Modem has given back a positive or negative answer to the sending operation.
72  * The return of @c le_sms_Send() API provides definitive status of the sending operation.
73  * TP-Validity-Period(TP-VP) parameter value indicates the time period for which the short message
74  * is valid, i.e. for how long the Service Center (SC) shall guarantee its existence in the SC
75  * memory before delivery to the recipient has been carried out. The default validity period(TP-VP)
76  * is set to 7 days for MO SMS.
77  *
78  * When a message sending has failed and returned LE_FAULT, call le_sms_GetErrorCode() to retrieve
79  * the 3GPP message error code or le_sms_Get3GPP2ErrorCode() to retrieve the 3GPP2 message error
80  * code. If LE_SMS_ERROR_3GPP_PLATFORM_SPECIFIC or LE_SMS_ERROR_3GPP2_PLATFORM_SPECIFIC values is
81  * returned, call le_sms_GetPlatformSpecificErrorCode() to retrieve the platform specific error
82  * code.
83  *
84  * Please refer to @ref platformConstraintsSpecificErrorCodes for platform
85  * specific error code description.
86  *
87  * Please refer to @ref c_smsSampleMO page to get an example of SMS message sending.
88  *
89  * @section le_sms_ops_async_sending Sending asynchronously a message
90  *
91  * To send an asynchronous message, le_sms_SendAsync() API can be called instead of le_sms_Send().
92  * le_sms_SendAsync() is a non-blocking function, it queues the message to the SMS pool and returns
93  * immediatly. Then, Legato will internally attempt to send the SMS with a maximum timeout set
94  * to 240 seconds for each SMS in the pool.
95  * This function is usefull to stack a set of messages without blocking the user application.
96  * Moreover, a handler can be specified to le_sms_SendAsync() API in order to keep track of the
97  * transmission status.
98  *
99  * The default validity period(TP-VP) is set to 7 days for MO SMS.
100  *
101  * A text message can be sent with one simple function: le_sms_SendText(). You only have to pass
102  * the three following parameters:
103  * - the destination telephone number.
104  * - the text message, the total length are set as well with this function, maximum 160
105  * characters as only the 7-bit alphabet is supported.
106  * - the callback function to get a notification indicating the sending result: LE_SMS_SENT,
107  * LE_SMS_SENDING_FAILED or LE_SMS_SENDING_TIMEOUT.
108  * The default validity period(TP-VP) is set to 7 days for MO SMS.
109  *
110  * A PDU message can be sent using the le_sms_SendPdu() functions. The parameters to give are:
111  * - the PDU content, total length is set with this API, maximum 176 bytes long = 36 (header) +
112  * 140 (payload).
113  * - the callback function to get a notification indicating the sending result: LE_SMS_SENT,
114  * LE_SMS_SENDING_FAILED or LE_SMS_SENDING_TIMEOUT.
115  * The default validity period(TP-VP) is set to 7 days for MO SMS.
116  *
117  * When a message sending has failed, call le_sms_GetErrorCode() to retrieve the 3GPP message error
118  * code or le_sms_Get3GPP2ErrorCode() to retrieve the 3GPP2 message error code.
119  * If LE_SMS_ERROR_3GPP_PLATFORM_SPECIFIC or LE_SMS_ERROR_3GPP2_PLATFORM_SPECIFIC values is
120  * returned, call le_sms_GetPlatformSpecificErrorCode() to retrieve the platform specific error
121  * code.
122  *
123  * Message object is never deleted regardless of the sending result. Caller has to
124  * delete it. Message object once used for sending the message can not be reused to
125  * send another message regardless of success or failure. New object has to be created
126  * for new message.
127  *
128  * @section le_sms_ops_receiving Receiving a message
129  * To receive SMS messages, register a handler function to obtain incoming
130  * messages. Use @c le_sms_AddRxMessageHandler() to register that handler.
131  *
132  * The handler must satisfy the following prototype:
133  * @c typedef void (*le_sms_RxMessageHandlerFunc_t)(le_sms_MsgRef_t msg).
134  *
135  * When a new incoming message is received, a Message object is automatically created and the
136  * handler is called. This Message object is Read-Only, any calls of a le_sms_SetXXX API will
137  * return a LE_NOT_PERMITTED error.
138  *
139  * Use the following APIs to retrieve message information and data from the Message
140  * object:
141  * - le_sms_GetFormat() - determine if it is a binary or a text message.
142  * - le_sms_GetSenderTel() - get the sender's Telephone number.
143  * - le_sms_GetTimeStamp() - get the timestamp sets by the Service Center.
144  * - le_sms_GetUserdataLen() - get the message content (text, binary or UCS2) length.
145  * - le_sms_GetPDULen() - get the PDU message length.
146  * - le_sms_GetText() - get the message text.
147  * - le_sms_GetUCS2() - get the UCS2 message content (16-bit format).
148  * - le_sms_GetBinary() - get the message binary content.
149  * - le_sms_GetPDU() - get the message PDU data.
150  * - le_sms_GetType() - get the message type.
151  *
152  * @note - If two (or more) registered handler functions exist, they are
153  * all called and get a different message object reference.
154  *
155  * @note - For incoming SMS, if the returned format is LE_SMS_FORMAT_PDU, the PDU length can be
156  * retrieved by calling le_sms_GetPDULen() and the content can be read by le_sms_GetPDU().
157  *
158  * If a succession of messages is received, a new Message object is created for each, and
159  * the handler is called for each new message.
160  *
161  * Uninstall the handler function by calling @c le_sms_RemoveRxMessageHandler().
162  * @note @c le_sms_RemoveRxMessageHandler() API does not delete the Message Object.
163  * The caller has to delete it.
164  *
165  * Please refer to @ref c_smsSampleMT page to get an example of SMS message reception handling.
166  *
167  * @section le_sms_ops_sms_storage Receiving a full SMS storage indication
168  * To receive a SMS full storage status, the application has to register a handler function.
169  * Use @c le_sms_AddFullStorageEventHandler() to register that handler.
170  *
171  * The handler must satisfy the following prototype:
172  * @c typedef void (*le_sms_FullStorageEventFunc_t)(le_sms_Storage_t storage).
173  *
174  * Uninstall the handler function by calling @c le_sms_RemoveFullStorageEventHandler().
175  *
176  * Please refer to @ref c_smsSampleMT page to get an example of SMS storage indication
177  * handling.
178  *
179  * @section le_sms_ops_listing Listing messages recorded in storage area
180  *
181  * Call @c le_sms_CreateRxMsgList() to create a List object that lists the received
182  * messages present in the storage area, which is referenced by @c le_sms_MsgListRef_t
183  * type.
184  *
185  * If messages are not present, the le_sms_CreateRxMsgList() returns NULL.
186  *
187  * Once the list is available, call @c le_sms_GetFirst() to get the first
188  * message from the list, and then call @c le_sms_GetNext() API to get the next message.
189  *
190  * Call @c le_sms_DeleteList() to free all allocated
191  * resources associated with the List object.
192  *
193  * Call @c le_sms_GetStatus() to read the status of a message (Received
194  * Read, Received Unread).
195  *
196  * To finish, you can also modify the received status of a message with
197  * @c le_sms_MarkRead() and @c le_sms_MarkUnread().
198  *
199  * @section le_sms_ops_deleting Deleting a message from the storage area
200  *
201  * @c le_sms_DeleteFromStorage() deletes the message from the storage area. Message is
202  * identified with @c le_sms_MsgRef_t object. The API returns an error if the deletion cannot be
203  * performed or if it is a broadcast or a non stored message.
204  *
205  * @note If several users own the Message object on new reception
206  * (e.g., several handler functions registered for SMS message reception), the
207  * Message will be deleted from the storage area only after the last user deletes
208  * the Message object reference (not necessary from storage). API returns always LE_OK in this case.
209  *
210  * @note If one client creates a list and deletes all sms from storage, other clients won’t see sms
211  * stored If they have not created a sms list too. Sms List creation locks and
212  * delays sms deletion from storage until all references have been deleted.
213  *
214  * @section le_sms_ops_broadcast SMS Cell Broadcast
215  *
216  * The Cell Broadcast service permits a number of unacknowledged general messages to be broadcast
217  * to all receivers within a particular region. Cell Broadcast messages are broadcast to defined
218  * geographical areas known as cell broadcast areas. These areas may comprise of one or more cells,
219  * or may comprise the entire PLMN.
220  *
221  * GSM or UMTS SMS cell broadcast service can be activated or deactivated with
222  * le_sms_ActivateCellBroadcast() and le_sms_DeactivateCellBroadcast() APIs.
223  *
224  * CDMA cell broadcast service can be activated or deactivated with
225  * le_sms_ActivateCdmaCellBroadcast() and le_sms_DeactivateCdmaCellBroadcast() APIs.
226  *
227  * Cell broadcast message receptions are notify by the SMS handler like a SMS message reception,
228  * but there are neither stored in SIM nor in the modem. So le_sms_DeleteFromStorage()
229  * can't be used but the message reference shall be delete with le_sms_Delete().
230  *
231  * - le_sms_GetFormat() - determine if it is a binary or a text message.
232  * - le_sms_GetUserdataLen() - get the message content (text, binary or UCS2) length.
233  * - le_sms_GetPDULen() - get the PDU message received length.
234  * - le_sms_GetText() - get the message text.
235  * - le_sms_GetBinary() - get the message binary content.
236  * - le_sms_GetUCS2() - get the UCS2 message content (16-bit format).
237  * - le_sms_GetPDU() - get the message PDU data received length.
238  * - le_sms_GetCellBroadcastId() - get the message identifier received (3GPP 23.41).
239  * - le_sms_GetCellBroadcastSerialNumber() get the message Serial Number received (3GPP 23.41).
240  *
241  * A sample code that implements a function for SMS Cell Broadcast reception can be found in
242  * \b smsCBTest.c file (please refer to @ref c_smsCbSample page).
243  *
244  * @b Serial @b Number
245  *
246  * Cell Broadcast Serial Number parameter is a 16-bit integer which identifies a particular
247  * CBS message from the source and type indicated by the Message Identifier and is altered every
248  * time the CBS message with a given Message Identifier is changed.
249  *
250  * The two bytes of the Serial Number field are divided into a 2-bit Geographical Scope (GS)
251  * indicator, a 10-bit Message Code and a 4-bit Update Number as shown below:
252  *
253  * - GS code (bit 14 and 15): The Geographical Scope (GS) indicates the geographical area over
254  * which the Message Code is unique, and the display mode.
255  *
256  * - Message Code (bit 4 to 13) : The Message Code differentiates between CBS messages from
257  * the same source and type (i.e. with the same Message Identifier). Message Codes are for
258  * allocation by PLMN operators. The Message Code identifies different message themes.
259  * For example, let the value for the Message Identifier be "Automotive Association" (= source),
260  * "Traffic Reports" (= type). Then "Crash on A1 J5" could be one value for the message code,
261  * "Cow on A32 J4" could be another, and "Slow vehicle on M3 J3" yet another.
262  *
263  * - Update Number (bit 0 to 3) : The Update Number indicates a change of the message content of
264  * the same CBS message, i.e. the CBS message with the same Message Identifier, Geographical
265  * Scope, and Message Code.
266  *
267  * Serial Number fields meaning are defined in the 3GPP 23.041 (9.4.1.2.1 Serial Number).
268  *
269  * @b Message @b Identifier
270  *
271  * Message Identifier parameter identifies the source and type of the CBS message. For example,
272  * "Automotive Association" (= source), "Traffic Reports" (= type) could correspond to one value.
273  * A number of CBS messages may originate from the same source and/or be of the same type.
274  * These will be distinguished by the Serial Number.
275  *
276  * Message identifier meaning ranges are defined in the 3GPP 23.041 (9.4.1.2.2 Message Identifier).
277  *
278  * @section le_sms_ops_broadcast_configuration SMS Cell Broadcast configuration
279  *
280  * GSM or UMTS Cell broadcast Message identifiers range can be added or removed with
281  * le_sms_AddCellBroadcastIds() and le_sms_RemoveCellBroadcastIds() APIs. All Message identifiers
282  * can be removed with le_sms_ClearCellBroadcastIds() API.
283  *
284  * CDMA Cell broadcast Service categories can be added or removed with
285  * le_sms_AddCdmaCellBroadcastServices() and le_sms_RemoveCdmaCellBroadcastServices() APIs. All
286  * Service categories can be removed with le_sms_ClearCdmaCellBroadcastServices() API.
287  *
288  * @section le_sms_ops_statusReport SMS Status Report
289  *
290  * SMS Status Report may be sent by the SMS Center (SMSC) to inform the originating device about the
291  * final outcome of the message delivery.
292  *
293  * SMS Status Report can be activated or deactivated for outgoing messages with
294  * le_sms_EnableStatusReport() and le_sms_DisableStatusReport(). The current activation state can
295  * be retrieved with le_sms_IsStatusReportEnabled().
296  *
297  * The reception of a SMS Status Report is notified by the SMS handler like a SMS message reception,
298  * but the message is neither stored in SIM nor in the modem. So le_sms_DeleteFromStorage()
299  * can't be used, but the message reference shall be delete with le_sms_Delete(). Received SMS
300  * Status Reports are identified by a specific type: @ref LE_SMS_TYPE_STATUS_REPORT.
301  *
302  * The different elements of the SMS Status Report can be retrieved with the following APIs:
303  * - le_sms_GetTpMr() gives the Message Reference, defined in 3GPP TS 23.040 section 9.2.3.6.
304  * - le_sms_GetTpRa() gives the Recipient Address, defined in 3GPP TS 23.040 section 9.2.3.14, and
305  * the Recipient Address Type of Address, defined in 3GPP TS 24.011 section 8.2.5.2.
306  * - le_sms_GetTpScTs() gives the Service Centre Time Stamp, defined in 3GPP TS 23.040
307  * section 9.2.3.11.
308  * - le_sms_GetTpDt() gives the Discharge Time, defined in 3GPP TS 23.040 section 9.2.3.13.
309  * - le_sms_GetTpSt() gives the Status, defined in 3GPP TS 23.040 section 9.2.3.15.
310  *
311  * @section le_sms_ops_configuration SMS configuration
312  *
313  * Modem SMS Center Address can be set or get with le_sms_SetSmsCenterAddress() and
314  * le_sms_GetSmsCenterAddress() functions
315  *
316  * @section le_sms_ops_storage_configuration Preferred SMS storage configuration
317  *
318  * Preferred SMS storage for incoming messages can be set or get with le_sms_SetPreferredStorage()
319  * and le_sms_GetPreferredStorage() functions.
320  *
321  * @section le_sms_ops_statistics SMS statistics
322  *
323  * The number of SMS successfully sent or received through the Legato API can be counted.
324  * This feature is activated by default. le_sms_GetCount() allows retrieving the message count
325  * for each SMS type (cf. @ref le_sms_Type_t).
326  *
327  * le_sms_StopCount() stops the message counting and le_sms_StartCount() restarts it.
328  * le_sms_ResetCount() can be used to reset the message counters.
329  *
330  * @note The activation state of this feature is persistent even after a reboot of the platform.
331  *
332  * @section le_sms_ops_samples Sample codes
333  * A sample code that implements a function for Mobile Originated SMS message can be found in
334  * \b smsMO.c file (please refer to @ref c_smsSampleMO page).
335  *
336  * A sample code that implements a function for Mobile Terminated SMS message can be found in
337  * \b smsMT.c file (please refer to @ref c_smsSampleMT page).
338  *
339  * These two samples can be easily compiled and run into the \b sms app, to install and use
340  * this app:
341  *
342  * @verbatim
343  $ make ar7
344  $ bin/instapp build/ar7/bin/samples/sms.ar7 <ipaddress>
345  @endverbatim
346  * where ipaddress is the address of your target device.
347  *
348  * Then on your target, just run:
349  * @verbatim
350  $ app start sms
351  @endverbatim
352  *
353  * The sample replies to the sender by the message "Message from <phone number> received". Where
354  * "phone number" is the sender's phone number.
355  *
356  * Sample code for that application can be seen in the following pages:
357  * - @subpage c_smsSampleMO <br>
358  * - @subpage c_smsSampleMT
359  *
360  * <HR>
361  *
362  * Copyright (C) Sierra Wireless Inc.
363  */
364 /**
365  * @file le_sms_interface.h
366  *
367  * Legato @ref c_sms include file.
368  *
369  * Copyright (C) Sierra Wireless Inc.
370  */
371 /**
372  * @page c_smsSampleMO Sample code for Mobile Originated SMS message
373  *
374  * @include "apps/sample/sms/smsClient/smsMO.c"
375  */
376 /**
377  * @page c_smsSampleMT Sample code for Mobile Terminated SMS message
378  *
379  * @include "apps/sample/sms/smsClient/smsMT.c"
380  */
381 /**
382  * @page c_smsCbSample Sample code for SMS Cell Broadcast reception
383  *
384  * @include "apps/test/modemServices/sms/smsIntegrationTest/smsCBTest/smsCBTest.c"
385  */
386 
387 #ifndef LE_SMS_INTERFACE_H_INCLUDE_GUARD
388 #define LE_SMS_INTERFACE_H_INCLUDE_GUARD
389 
390 
391 #include "legato.h"
392 
393 // Interface specific includes
394 #include "le_mdmDefs_interface.h"
395 
396 // Internal includes for this interface
397 #include "le_sms_common.h"
398 //--------------------------------------------------------------------------------------------------
399 /**
400  * Type for handler called when a server disconnects.
401  */
402 //--------------------------------------------------------------------------------------------------
403 typedef void (*le_sms_DisconnectHandler_t)(void *);
404 
405 //--------------------------------------------------------------------------------------------------
406 /**
407  *
408  * Connect the current client thread to the service providing this API. Block until the service is
409  * available.
410  *
411  * For each thread that wants to use this API, either ConnectService or TryConnectService must be
412  * called before any other functions in this API. Normally, ConnectService is automatically called
413  * for the main thread, but not for any other thread. For details, see @ref apiFilesC_client.
414  *
415  * This function is created automatically.
416  */
417 //--------------------------------------------------------------------------------------------------
419 (
420  void
421 );
422 
423 //--------------------------------------------------------------------------------------------------
424 /**
425  *
426  * Try to connect the current client thread to the service providing this API. Return with an error
427  * if the service is not available.
428  *
429  * For each thread that wants to use this API, either ConnectService or TryConnectService must be
430  * called before any other functions in this API. Normally, ConnectService is automatically called
431  * for the main thread, but not for any other thread. For details, see @ref apiFilesC_client.
432  *
433  * This function is created automatically.
434  *
435  * @return
436  * - LE_OK if the client connected successfully to the service.
437  * - LE_UNAVAILABLE if the server is not currently offering the service to which the client is
438  * bound.
439  * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).
440  * - LE_COMM_ERROR if the Service Directory cannot be reached.
441  */
442 //--------------------------------------------------------------------------------------------------
444 (
445  void
446 );
447 
448 //--------------------------------------------------------------------------------------------------
449 /**
450  * Set handler called when server disconnection is detected.
451  *
452  * When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants
453  * to continue without exiting, it should call longjmp() from inside the handler.
454  */
455 //--------------------------------------------------------------------------------------------------
457 (
458  le_sms_DisconnectHandler_t disconnectHandler,
459  void *contextPtr
460 );
461 
462 //--------------------------------------------------------------------------------------------------
463 /**
464  *
465  * Disconnect the current client thread from the service providing this API.
466  *
467  * Normally, this function doesn't need to be called. After this function is called, there's no
468  * longer a connection to the service, and the functions in this API can't be used. For details, see
469  * @ref apiFilesC_client.
470  *
471  * This function is created automatically.
472  */
473 //--------------------------------------------------------------------------------------------------
475 (
476  void
477 );
478 
479 
480 //--------------------------------------------------------------------------------------------------
481 /**
482  * Message Format.
483  */
484 //--------------------------------------------------------------------------------------------------
485 
486 
487 //--------------------------------------------------------------------------------------------------
488 /**
489  * Message Type.
490  */
491 //--------------------------------------------------------------------------------------------------
492 
493 
494 //--------------------------------------------------------------------------------------------------
495 /**
496  * Message Status.
497  */
498 //--------------------------------------------------------------------------------------------------
499 
500 
501 //--------------------------------------------------------------------------------------------------
502 /**
503  * CDMA Cell broadcast message languages.
504  */
505 //--------------------------------------------------------------------------------------------------
506 
507 
508 //--------------------------------------------------------------------------------------------------
509 /**
510  * CDMA Cell broadcast Service Categories.
511  */
512 //--------------------------------------------------------------------------------------------------
513 
514 
515 //--------------------------------------------------------------------------------------------------
516 /**
517  * SMS storage area.
518  */
519 //--------------------------------------------------------------------------------------------------
520 
521 
522 //--------------------------------------------------------------------------------------------------
523 /**
524  * 3GPP2 Message Error code when the message sending has failed.
525  */
526 //--------------------------------------------------------------------------------------------------
527 
528 
529 //--------------------------------------------------------------------------------------------------
530 /**
531  * Message Error code when the message sending has failed.
532  */
533 //--------------------------------------------------------------------------------------------------
534 
535 
536 //--------------------------------------------------------------------------------------------------
537 /**
538  * Declare a reference type for referring to SMS Message objects.
539  */
540 //--------------------------------------------------------------------------------------------------
541 
542 
543 //--------------------------------------------------------------------------------------------------
544 /**
545  * Opaque type for SMS Message Listing.
546  */
547 //--------------------------------------------------------------------------------------------------
548 
549 
550 //--------------------------------------------------------------------------------------------------
551 /**
552  * Handler for Sending result.
553  */
554 //--------------------------------------------------------------------------------------------------
555 
556 
557 //--------------------------------------------------------------------------------------------------
558 /**
559  * Handler for New Message.
560  *
561  */
562 //--------------------------------------------------------------------------------------------------
563 
564 
565 //--------------------------------------------------------------------------------------------------
566 /**
567  * Reference type used by Add/Remove functions for EVENT 'le_sms_RxMessage'
568  */
569 //--------------------------------------------------------------------------------------------------
570 
571 
572 //--------------------------------------------------------------------------------------------------
573 /**
574  * Handler for full storage indication.
575  *
576  */
577 //--------------------------------------------------------------------------------------------------
578 
579 
580 //--------------------------------------------------------------------------------------------------
581 /**
582  * Reference type used by Add/Remove functions for EVENT 'le_sms_FullStorageEvent'
583  */
584 //--------------------------------------------------------------------------------------------------
585 
586 
587 //--------------------------------------------------------------------------------------------------
588 /**
589  * Add handler function for EVENT 'le_sms_RxMessage'
590  *
591  * This event provides information on new received messages.
592  *
593  */
594 //--------------------------------------------------------------------------------------------------
595 le_sms_RxMessageHandlerRef_t le_sms_AddRxMessageHandler
596 (
597  le_sms_RxMessageHandlerFunc_t handlerPtr,
598  ///< [IN]
599  void* contextPtr
600  ///< [IN]
601 );
602 
603 //--------------------------------------------------------------------------------------------------
604 /**
605  * Remove handler function for EVENT 'le_sms_RxMessage'
606  */
607 //--------------------------------------------------------------------------------------------------
609 (
610  le_sms_RxMessageHandlerRef_t handlerRef
611  ///< [IN]
612 );
613 
614 //--------------------------------------------------------------------------------------------------
615 /**
616  * Add handler function for EVENT 'le_sms_FullStorageEvent'
617  *
618  * This event provides information on full storage indication.
619  *
620  */
621 //--------------------------------------------------------------------------------------------------
622 le_sms_FullStorageEventHandlerRef_t le_sms_AddFullStorageEventHandler
623 (
624  le_sms_FullStorageHandlerFunc_t handlerPtr,
625  ///< [IN]
626  void* contextPtr
627  ///< [IN]
628 );
629 
630 //--------------------------------------------------------------------------------------------------
631 /**
632  * Remove handler function for EVENT 'le_sms_FullStorageEvent'
633  */
634 //--------------------------------------------------------------------------------------------------
636 (
637  le_sms_FullStorageEventHandlerRef_t handlerRef
638  ///< [IN]
639 );
640 
641 //--------------------------------------------------------------------------------------------------
642 /**
643  * Create an SMS Message data structure.
644  *
645  * @return Reference to the new Message object.
646  *
647  * @note
648  * On failure, the process exits, so you don't have to worry about checking the returned
649  * reference for validity.
650  */
651 //--------------------------------------------------------------------------------------------------
652 le_sms_MsgRef_t le_sms_Create
653 (
654  void
655 );
656 
657 //--------------------------------------------------------------------------------------------------
658 /**
659  * Set the Telephone destination number.
660  *
661  * Telephone number is defined in ITU-T recommendations E.164/E.163.
662  * E.164 numbers can have a maximum of fifteen digits and are usually written with a '+' prefix.
663  *
664  * @return LE_NOT_PERMITTED Message is Read-Only.
665  * @return LE_BAD_PARAMETER Telephone destination number length is equal to zero.
666  * @return LE_OK Function succeeded.
667  *
668  * @note If telephone destination number is too long is too long (max LE_MDMDEFS_PHONE_NUM_MAX_LEN
669  * digits), it is a fatal error, the function will not return.
670  *
671  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
672  * function will not return.
673  */
674 //--------------------------------------------------------------------------------------------------
676 (
677  le_sms_MsgRef_t msgRef,
678  ///< [IN] Reference to the message object.
679  const char* LE_NONNULL dest
680  ///< [IN] Telephone number string.
681 );
682 
683 //--------------------------------------------------------------------------------------------------
684 /**
685  * This function must be called to set the Text Message content.
686  *
687  * @return LE_NOT_PERMITTED Message is Read-Only.
688  * @return LE_BAD_PARAMETER Text message length is equal to zero.
689  * @return LE_OK Function succeeded.
690  *
691  * @note Text Message is encoded in ASCII format (ISO8859-15) and characters have to exist in
692  * the GSM 23.038 7 bit alphabet.
693  *
694  * @note If message is too long (max LE_SMS_TEXT_MAX_LEN digits), it is a fatal error, the
695  * function will not return.
696  *
697  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
698  * function will not return.
699  */
700 //--------------------------------------------------------------------------------------------------
702 (
703  le_sms_MsgRef_t msgRef,
704  ///< [IN] Reference to the message object.
705  const char* LE_NONNULL text
706  ///< [IN] SMS text.
707 );
708 
709 //--------------------------------------------------------------------------------------------------
710 /**
711  * Set the binary message content.
712  *
713  * @return LE_NOT_PERMITTED Message is Read-Only.
714  * @return LE_BAD_PARAMETER Length of the data is equal to zero.
715  * @return LE_OK Function succeeded.
716  *
717  * @note If length of the data is too long (max LE_SMS_BINARY_MAX_BYTES bytes), it is a fatal
718  * error, the function will not return.
719  *
720  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
721  * function will not return.
722  */
723 //--------------------------------------------------------------------------------------------------
725 (
726  le_sms_MsgRef_t msgRef,
727  ///< [IN] Reference to the message object.
728  const uint8_t* binPtr,
729  ///< [IN] Binary data.
730  size_t binSize
731  ///< [IN]
732 );
733 
734 //--------------------------------------------------------------------------------------------------
735 /**
736  * Set the UCS2 message content (16-bit format).
737  *
738  * @return
739  * - LE_NOT_PERMITTED Message is Read-Only.
740  * - LE_BAD_PARAMETER Length of the data is equal to zero.
741  * - LE_OK Function succeeded.
742  *
743  * @note If length of the data is too long (max LE_SMS_UCS2_MAX_CHARS), it is a fatal
744  * error, the function will not return.
745  *
746  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
747  * function will not return.
748  */
749 //--------------------------------------------------------------------------------------------------
751 (
752  le_sms_MsgRef_t msgRef,
753  ///< [IN] Reference to the message object.
754  const uint16_t* ucs2Ptr,
755  ///< [IN] UCS2 message.
756  size_t ucs2Size
757  ///< [IN]
758 );
759 
760 //--------------------------------------------------------------------------------------------------
761 /**
762  * Set the PDU message content.
763  *
764  * @return LE_NOT_PERMITTED Message is Read-Only.
765  * @return LE_BAD_PARAMETER Length of the data is equal to zero.
766  * @return LE_OK Function succeeded.
767  *
768  * @note If length of the data is too long (max LE_SMS_PDU_MAX_BYTES bytes), it is a fatal error,
769  * the function will not return.
770  *
771  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
772  * function will not return.
773  */
774 //--------------------------------------------------------------------------------------------------
776 (
777  le_sms_MsgRef_t msgRef,
778  ///< [IN] Reference to the message object.
779  const uint8_t* pduPtr,
780  ///< [IN] PDU message.
781  size_t pduSize
782  ///< [IN]
783 );
784 
785 //--------------------------------------------------------------------------------------------------
786 /**
787  * Send an SMS message.
788  *
789  * Verifies first if the parameters are valid, then it checks the modem state can support
790  * message sending.
791  *
792  * @return LE_FORMAT_ERROR Message content is invalid.
793  * @return LE_FAULT Function failed to send the message.
794  * @return LE_OK Function succeeded.
795  * @return LE_TIMEOUT Timeout before the complete sending.
796  *
797  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
798  * function will not return.
799  */
800 //--------------------------------------------------------------------------------------------------
802 (
803  le_sms_MsgRef_t msgRef
804  ///< [IN] Reference to the message object.
805 );
806 
807 //--------------------------------------------------------------------------------------------------
808 /**
809  * Send an asynchronous SMS message.
810  *
811  * Verifies first if the parameters are valid, then it checks the modem state can support
812  * message sending.
813  *
814  * @return LE_FORMAT_ERROR Message content is invalid.
815  * @return LE_FAULT Function failed to send the message.
816  * @return LE_OK Function succeeded.
817  * @return LE_TIMEOUT Timeout before the complete sending.
818  *
819  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
820  * function will not return.
821  */
822 //--------------------------------------------------------------------------------------------------
824 (
825  le_sms_MsgRef_t msgRef,
826  ///< [IN] Reference to the message object.
827  le_sms_CallbackResultFunc_t handlerPtr,
828  ///< [IN] CallBack for sending result.
829  void* contextPtr
830  ///< [IN]
831 );
832 
833 //--------------------------------------------------------------------------------------------------
834 /**
835  * Get the error code when a 3GPP2 message sending has Failed.
836  *
837  * @return The error code
838  *
839  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
840  * function will not return.
841  *
842  * @note It is only applicable for 3GPP2 message sending failure, otherwise
843  * LE_SMS_ERROR_3GPP2_MAX is returned.
844  */
845 //--------------------------------------------------------------------------------------------------
846 le_sms_ErrorCode3GPP2_t le_sms_Get3GPP2ErrorCode
847 (
848  le_sms_MsgRef_t msgRef
849  ///< [IN] Reference to the message object.
850 );
851 
852 //--------------------------------------------------------------------------------------------------
853 /**
854  * Get the Radio Protocol and the Transfer Protocol error code when a 3GPP message sending has
855  * failed.
856  *
857  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
858  * function will not return.
859  *
860  * @note It is only applicable for 3GPP message sending failure, otherwise
861  * LE_SMS_ERROR_3GPP_MAX is returned.
862  */
863 //--------------------------------------------------------------------------------------------------
865 (
866  le_sms_MsgRef_t msgRef,
867  ///< [IN] Reference to the message object.
868  le_sms_ErrorCode_t* rpCausePtr,
869  ///< [OUT] Radio Protocol cause code.
870  le_sms_ErrorCode_t* tpCausePtr
871  ///< [OUT] Transfer Protocol cause code.
872 );
873 
874 //--------------------------------------------------------------------------------------------------
875 /**
876  * Called to get the platform specific error code.
877  *
878  * Refer to @ref platformConstraintsSpecificErrorCodes for platform specific error code description.
879  *
880  * @return The platform specific error code.
881  *
882  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
883  * function will not return.
884  */
885 //--------------------------------------------------------------------------------------------------
887 (
888  le_sms_MsgRef_t msgRef
889  ///< [IN] Reference to the message object.
890 );
891 
892 //--------------------------------------------------------------------------------------------------
893 /**
894  * Create and asynchronously send a text message.
895  *
896  * @return
897  * - le_sms_Msg Reference to the new Message object pooled.
898  * - NULL Not possible to pool a new message.
899  *
900  * @note If telephone destination number is too long is too long (max LE_MDMDEFS_PHONE_NUM_MAX_LEN
901  * digits), it is a fatal error, the function will not return.
902  * @note If message is too long (max LE_SMS_TEXT_MAX_LEN digits), it is a fatal error, the
903  * function will not return.
904  */
905 //--------------------------------------------------------------------------------------------------
906 le_sms_MsgRef_t le_sms_SendText
907 (
908  const char* LE_NONNULL destStr,
909  ///< [IN] Telephone number string.
910  const char* LE_NONNULL textStr,
911  ///< [IN] SMS text.
912  le_sms_CallbackResultFunc_t handlerPtr,
913  ///< [IN] CallBack for sending result.
914  void* contextPtr
915  ///< [IN]
916 );
917 
918 //--------------------------------------------------------------------------------------------------
919 /**
920  * Create and asynchronously send a PDU message.
921  *
922  * @return
923  * - le_sms_Msg Reference to the new Message object pooled.
924  * - NULL Not possible to pool a new message.
925  *
926  */
927 //--------------------------------------------------------------------------------------------------
928 le_sms_MsgRef_t le_sms_SendPdu
929 (
930  const uint8_t* pduPtr,
931  ///< [IN] PDU message.
932  size_t pduSize,
933  ///< [IN]
934  le_sms_CallbackResultFunc_t handlerPtr,
935  ///< [IN] CallBack for sending result.
936  void* contextPtr
937  ///< [IN]
938 );
939 
940 //--------------------------------------------------------------------------------------------------
941 /**
942  * Delete a Message data structure.
943  *
944  * It deletes the Message data structure and all the allocated memory is freed. If several
945  * users own the Message object (e.g., several handler functions registered for
946  * SMS message reception), the Message object will only be deleted if one User
947  * owns the Message object.
948  *
949  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
950  * function will not return.
951  */
952 //--------------------------------------------------------------------------------------------------
953 void le_sms_Delete
954 (
955  le_sms_MsgRef_t msgRef
956  ///< [IN] Reference to the message object.
957 );
958 
959 //--------------------------------------------------------------------------------------------------
960 /**
961  * Get the message format.
962  *
963  * @return Message format.
964  *
965  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
966  * function will not return.
967  *
968  */
969 //--------------------------------------------------------------------------------------------------
970 le_sms_Format_t le_sms_GetFormat
971 (
972  le_sms_MsgRef_t msgRef
973  ///< [IN] Reference to the message object.
974 );
975 
976 //--------------------------------------------------------------------------------------------------
977 /**
978  * Get the message type.
979  *
980  * @return Message type.
981  *
982  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
983  * function will not return.
984  */
985 //--------------------------------------------------------------------------------------------------
986 le_sms_Type_t le_sms_GetType
987 (
988  le_sms_MsgRef_t msgRef
989  ///< [IN] Reference to the message object.
990 );
991 
992 //--------------------------------------------------------------------------------------------------
993 /**
994  * Get the Cell Broadcast Message Identifier.
995  *
996  * @return
997  * - LE_FAULT Message is not a cell broadcast type.
998  * - LE_OK Function succeeded.
999  *
1000  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
1001  * function will not return.
1002  */
1003 //--------------------------------------------------------------------------------------------------
1005 (
1006  le_sms_MsgRef_t msgRef,
1007  ///< [IN] Reference to the message object.
1008  uint16_t* messageIdPtr
1009  ///< [OUT] Cell Broadcast Message Identifier.
1010 );
1011 
1012 //--------------------------------------------------------------------------------------------------
1013 /**
1014  * Get the Cell Broadcast Message Serial Number.
1015  *
1016  * @return
1017  * - LE_FAULT Message is not a cell broadcast type.
1018  * - LE_OK Function succeeded.
1019  *
1020  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
1021  * function will not return.
1022  */
1023 //--------------------------------------------------------------------------------------------------
1025 (
1026  le_sms_MsgRef_t msgRef,
1027  ///< [IN] Reference to the message object.
1028  uint16_t* serialNumberPtr
1029  ///< [OUT] Cell Broadcast Serial Number.
1030 );
1031 
1032 //--------------------------------------------------------------------------------------------------
1033 /**
1034  * Get the Sender Telephone number.
1035  *
1036  * Output parameter is updated with the Telephone number. If the Telephone number string exceeds
1037  * the value of 'len' parameter, LE_OVERFLOW error code is returned and 'tel' is filled until
1038  * 'len-1' characters and a null-character is implicitly appended at the end of 'tel'.
1039  *
1040  * @return LE_NOT_PERMITTED Message is not a received message.
1041  * @return LE_OVERFLOW Telephone number length exceed the maximum length.
1042  * @return LE_OK Function succeeded.
1043  *
1044  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
1045  * function will not return.
1046  */
1047 //--------------------------------------------------------------------------------------------------
1049 (
1050  le_sms_MsgRef_t msgRef,
1051  ///< [IN] Reference to the message object.
1052  char* tel,
1053  ///< [OUT] Telephone number string.
1054  size_t telSize
1055  ///< [IN]
1056 );
1057 
1058 //--------------------------------------------------------------------------------------------------
1059 /**
1060  * Get the Service Center Time Stamp string.
1061  *
1062  * Output parameter is updated with the Time Stamp string. If the Time Stamp string exceeds the
1063  * value of 'len' parameter, a LE_OVERFLOW error code is returned and 'timestamp' is filled until
1064  * 'len-1' characters and a null-character is implicitly appended at the end of 'timestamp'.
1065  *
1066  * @return LE_NOT_PERMITTED Message is not a received message.
1067  * @return LE_OVERFLOW Timestamp number length exceed the maximum length.
1068  * @return LE_OK Function succeeded.
1069  *
1070  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
1071  * function will not return.
1072  */
1073 //--------------------------------------------------------------------------------------------------
1075 (
1076  le_sms_MsgRef_t msgRef,
1077  ///< [IN] Reference to the message object.
1078  char* timestamp,
1079  ///< [OUT] Message time stamp (in text mode).
1080  ///< string format: "yy/MM/dd,hh:mm:ss+/-zz"
1081  ///< (Year/Month/Day,Hour:Min:Seconds+/-TimeZone)
1082  ///< The time zone indicates the difference, expressed
1083  ///< in quarters of an hours between the local time
1084  ///< and GMT.
1085  size_t timestampSize
1086  ///< [IN]
1087 );
1088 
1089 //--------------------------------------------------------------------------------------------------
1090 /**
1091  * Get the message Length value.
1092  *
1093  * @return Number of characters for text and UCS2 messages, or the length of the data in bytes for
1094  * raw binary messages.
1095  *
1096  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
1097  * function will not return.
1098  */
1099 //--------------------------------------------------------------------------------------------------
1100 size_t le_sms_GetUserdataLen
1101 (
1102  le_sms_MsgRef_t msgRef
1103  ///< [IN] Reference to the message object.
1104 );
1105 
1106 //--------------------------------------------------------------------------------------------------
1107 /**
1108  * Get the text Message.
1109  *
1110  * Output parameter is updated with the text string encoded in ASCII format. If the text string
1111  * exceeds the value of 'len' parameter, LE_OVERFLOW error code is returned and 'text' is filled
1112  * until 'len-1' characters and a null-character is implicitly appended at the end of 'text'.
1113  *
1114  * @return LE_OVERFLOW Message length exceed the maximum length.
1115  * @return LE_OK Function succeeded.
1116  *
1117  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
1118  * function will not return.
1119  */
1120 //--------------------------------------------------------------------------------------------------
1122 (
1123  le_sms_MsgRef_t msgRef,
1124  ///< [IN] Reference to the message object.
1125  char* text,
1126  ///< [OUT] SMS text.
1127  size_t textSize
1128  ///< [IN]
1129 );
1130 
1131 //--------------------------------------------------------------------------------------------------
1132 /**
1133  * Get the binary Message.
1134  *
1135  * Output parameters are updated with the binary message content and the length of the raw
1136  * binary message in bytes. If the binary data exceed the value of 'len' input parameter, a
1137  * LE_OVERFLOW error code is returned and 'raw' is filled until 'len' bytes.
1138  *
1139  * @return LE_FORMAT_ERROR Message is not in binary format
1140  * @return LE_OVERFLOW Message length exceed the maximum length.
1141  * @return LE_OK Function succeeded.
1142  *
1143  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
1144  * function will not return.
1145  */
1146 //--------------------------------------------------------------------------------------------------
1148 (
1149  le_sms_MsgRef_t msgRef,
1150  ///< [IN] Reference to the message object.
1151  uint8_t* binPtr,
1152  ///< [OUT] Binary message.
1153  size_t* binSizePtr
1154  ///< [INOUT]
1155 );
1156 
1157 //--------------------------------------------------------------------------------------------------
1158 /**
1159  * Get the UCS2 Message (16-bit format).
1160  *
1161  * Output parameters are updated with the UCS2 message content and the number of characters. If
1162  * the UCS2 data exceed the value of the length input parameter, a LE_OVERFLOW error
1163  * code is returned and 'ucs2Ptr' is filled until of the number of chars specified.
1164  *
1165  * @return
1166  * - LE_FORMAT_ERROR Message is not in binary format
1167  * - LE_OVERFLOW Message length exceed the maximum length.
1168  * - LE_OK Function succeeded.
1169  *
1170  */
1171 //--------------------------------------------------------------------------------------------------
1173 (
1174  le_sms_MsgRef_t msgRef,
1175  ///< [IN] Reference to the message object.
1176  uint16_t* ucs2Ptr,
1177  ///< [OUT] UCS2 message.
1178  size_t* ucs2SizePtr
1179  ///< [INOUT]
1180 );
1181 
1182 //--------------------------------------------------------------------------------------------------
1183 /**
1184  * Get the PDU message.
1185  *
1186  * Output parameters are updated with the PDU message content and the length of the PDU message
1187  * in bytes. If the PDU data exceed the value of 'len' input parameter, a LE_OVERFLOW error code is
1188  * returned and 'pdu' is filled until 'len' bytes.
1189  *
1190  * @return LE_FORMAT_ERROR Unable to encode the message in PDU (only for outgoing messages).
1191  * @return LE_OVERFLOW Message length exceed the maximum length.
1192  * @return LE_OK Function succeeded.
1193  *
1194  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
1195  * function will not return.
1196  */
1197 //--------------------------------------------------------------------------------------------------
1199 (
1200  le_sms_MsgRef_t msgRef,
1201  ///< [IN] Reference to the message object.
1202  uint8_t* pduPtr,
1203  ///< [OUT] PDU message.
1204  size_t* pduSizePtr
1205  ///< [INOUT]
1206 );
1207 
1208 //--------------------------------------------------------------------------------------------------
1209 /**
1210  * Get the message Length value.
1211  *
1212  * @return Length of the data in bytes of the PDU message.
1213  *
1214  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
1215  * function will not return.
1216  */
1217 //--------------------------------------------------------------------------------------------------
1218 size_t le_sms_GetPDULen
1219 (
1220  le_sms_MsgRef_t msgRef
1221  ///< [IN] Reference to the message object.
1222 );
1223 
1224 //--------------------------------------------------------------------------------------------------
1225 /**
1226  * Delete an SMS message from the storage area.
1227  *
1228  * Verifies first if the parameter is valid, then it checks the modem state can support
1229  * message deleting.
1230  *
1231  * @return LE_FAULT Function failed to perform the deletion.
1232  * @return LE_NO_MEMORY The message is not present in storage area.
1233  * @return LE_OK Function succeeded.
1234  *
1235  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
1236  * function will not return.
1237  */
1238 //--------------------------------------------------------------------------------------------------
1240 (
1241  le_sms_MsgRef_t msgRef
1242  ///< [IN] Reference to the message object.
1243 );
1244 
1245 //--------------------------------------------------------------------------------------------------
1246 /**
1247  * Create an object's reference of the list of received messages
1248  * saved in the SMS message storage area.
1249  *
1250  * @return
1251  * Reference to the List object. Null pointer if no messages have been retrieved.
1252  */
1253 //--------------------------------------------------------------------------------------------------
1254 le_sms_MsgListRef_t le_sms_CreateRxMsgList
1255 (
1256  void
1257 );
1258 
1259 //--------------------------------------------------------------------------------------------------
1260 /**
1261  * Delete the list of the Messages retrieved from the message
1262  * storage.
1263  *
1264  * @note
1265  * On failure, the process exits, so you don't have to worry about checking the returned
1266  * reference for validity.
1267  */
1268 //--------------------------------------------------------------------------------------------------
1269 void le_sms_DeleteList
1270 (
1271  le_sms_MsgListRef_t msgListRef
1272  ///< [IN] Messages list.
1273 );
1274 
1275 //--------------------------------------------------------------------------------------------------
1276 /**
1277  * Get the first Message object reference in the list of messages
1278  * retrieved with le_sms_CreateRxMsgList().
1279  *
1280  * @return NULL No message found.
1281  * @return Msg Message object reference.
1282  *
1283  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
1284  * function will not return.
1285  */
1286 //--------------------------------------------------------------------------------------------------
1287 le_sms_MsgRef_t le_sms_GetFirst
1288 (
1289  le_sms_MsgListRef_t msgListRef
1290  ///< [IN] Messages list.
1291 );
1292 
1293 //--------------------------------------------------------------------------------------------------
1294 /**
1295  * Get the next Message object reference in the list of messages
1296  * retrieved with le_sms_CreateRxMsgList().
1297  *
1298  * @return NULL No message found.
1299  * @return Msg Message object reference.
1300  *
1301  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
1302  * function will not return.
1303  */
1304 //--------------------------------------------------------------------------------------------------
1305 le_sms_MsgRef_t le_sms_GetNext
1306 (
1307  le_sms_MsgListRef_t msgListRef
1308  ///< [IN] Messages list.
1309 );
1310 
1311 //--------------------------------------------------------------------------------------------------
1312 /**
1313  * Read the Message status (Received Read, Received Unread, Stored
1314  * Sent, Stored Unsent).
1315  *
1316  * @return Status of the message.
1317  *
1318  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
1319  * function will not return.
1320  */
1321 //--------------------------------------------------------------------------------------------------
1322 le_sms_Status_t le_sms_GetStatus
1323 (
1324  le_sms_MsgRef_t msgRef
1325  ///< [IN] Messages list.
1326 );
1327 
1328 //--------------------------------------------------------------------------------------------------
1329 /**
1330  * Mark a message as 'read'.
1331  *
1332  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
1333  * function will not return.
1334  */
1335 //--------------------------------------------------------------------------------------------------
1336 void le_sms_MarkRead
1337 (
1338  le_sms_MsgRef_t msgRef
1339  ///< [IN] Messages list.
1340 );
1341 
1342 //--------------------------------------------------------------------------------------------------
1343 /**
1344  * Mark a message as 'unread'.
1345  *
1346  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
1347  * function will not return.
1348  */
1349 //--------------------------------------------------------------------------------------------------
1350 void le_sms_MarkUnread
1351 (
1352  le_sms_MsgRef_t msgRef
1353  ///< [IN] Messages list.
1354 );
1355 
1356 //--------------------------------------------------------------------------------------------------
1357 /**
1358  * Get the SMS center address.
1359  *
1360  * Output parameter is updated with the SMS Service center address. If the Telephone number string exceeds
1361  * the value of 'len' parameter, LE_OVERFLOW error code is returned and 'tel' is filled until
1362  * 'len-1' characters and a null-character is implicitly appended at the end of 'tel'.
1363  *
1364  * @return
1365  * - LE_FAULT Service is not available.
1366  * - LE_OVERFLOW Telephone number length exceed the maximum length.
1367  * - LE_OK Function succeeded.
1368  *
1369  */
1370 //--------------------------------------------------------------------------------------------------
1372 (
1373  char* tel,
1374  ///< [OUT] SMS center address number string.
1375  size_t telSize
1376  ///< [IN]
1377 );
1378 
1379 //--------------------------------------------------------------------------------------------------
1380 /**
1381  * Set the SMS center address.
1382  *
1383  * SMS center address number is defined in ITU-T recommendations E.164/E.163.
1384  * E.164 numbers can have a maximum of fifteen digits and are usually written with a '+' prefix.
1385  *
1386  * @return
1387  * - LE_FAULT Service is not available..
1388  * - LE_OK Function succeeded.
1389  *
1390  * @note If the SMS center address number is too long (max LE_MDMDEFS_PHONE_NUM_MAX_LEN digits), it
1391  * is a fatal error, the function will not return.
1392  */
1393 //--------------------------------------------------------------------------------------------------
1395 (
1396  const char* LE_NONNULL tel
1397  ///< [IN] SMS center address number string.
1398 );
1399 
1400 //--------------------------------------------------------------------------------------------------
1401 /**
1402  * Set the preferred SMS storage for incoming messages.
1403  * @return
1404  * - LE_FAULT Function failed.
1405  * - LE_OK Function succeeded.
1406  */
1407 //--------------------------------------------------------------------------------------------------
1409 (
1410  le_sms_Storage_t prefStorage
1411  ///< [IN] storage parameter.
1412 );
1413 
1414 //--------------------------------------------------------------------------------------------------
1415 /**
1416  * Get the preferred SMS storage for incoming messages.
1417  * @return
1418  * - LE_FAULT Function failed.
1419  * - LE_OK Function succeeded.
1420  */
1421 //--------------------------------------------------------------------------------------------------
1423 (
1424  le_sms_Storage_t* prefStoragePtr
1425  ///< [OUT] storage parameter.
1426 );
1427 
1428 //--------------------------------------------------------------------------------------------------
1429 /**
1430  * Activate Cell Broadcast message notification
1431  *
1432  * @return
1433  * - LE_FAULT Function failed.
1434  * - LE_OK Function succeeded.
1435  */
1436 //--------------------------------------------------------------------------------------------------
1438 (
1439  void
1440 );
1441 
1442 //--------------------------------------------------------------------------------------------------
1443 /**
1444  * Deactivate Cell Broadcast message notification
1445  *
1446  * @return
1447  * - LE_FAULT Function failed.
1448  * - LE_OK Function succeeded.
1449  */
1450 //--------------------------------------------------------------------------------------------------
1452 (
1453  void
1454 );
1455 
1456 //--------------------------------------------------------------------------------------------------
1457 /**
1458  * Activate CDMA Cell Broadcast message notification
1459  *
1460  * @return
1461  * - LE_FAULT Function failed.
1462  * - LE_OK Function succeeded.
1463  */
1464 //--------------------------------------------------------------------------------------------------
1466 (
1467  void
1468 );
1469 
1470 //--------------------------------------------------------------------------------------------------
1471 /**
1472  * Deactivate CDMA Cell Broadcast message notification
1473  *
1474  * @return
1475  * - LE_FAULT Function failed.
1476  * - LE_OK Function succeeded.
1477  */
1478 //--------------------------------------------------------------------------------------------------
1480 (
1481  void
1482 );
1483 
1484 //--------------------------------------------------------------------------------------------------
1485 /**
1486  * Add Cell Broadcast message Identifiers range.
1487  *
1488  * @return
1489  * - LE_FAULT Function failed.
1490  * - LE_OK Function succeeded.
1491  */
1492 //--------------------------------------------------------------------------------------------------
1494 (
1495  uint16_t fromId,
1496  ///< [IN] Starting point of the range of cell broadcast message identifier.
1497  uint16_t toId
1498  ///< [IN] Ending point of the range of cell broadcast message identifier.
1499 );
1500 
1501 //--------------------------------------------------------------------------------------------------
1502 /**
1503  * Remove Cell Broadcast message Identifiers range.
1504  *
1505  * @return
1506  * - LE_FAULT Function failed.
1507  * - LE_OK Function succeeded.
1508  */
1509 //--------------------------------------------------------------------------------------------------
1511 (
1512  uint16_t fromId,
1513  ///< [IN] Starting point of the range of cell broadcast message identifier.
1514  uint16_t toId
1515  ///< [IN] Ending point of the range of cell broadcast message identifier.
1516 );
1517 
1518 //--------------------------------------------------------------------------------------------------
1519 /**
1520  * Clear Cell Broadcast message Identifiers.
1521  *
1522  * @return
1523  * - LE_FAULT Function failed.
1524  * - LE_OK Function succeeded.
1525  */
1526 //--------------------------------------------------------------------------------------------------
1528 (
1529  void
1530 );
1531 
1532 //--------------------------------------------------------------------------------------------------
1533 /**
1534  * Add CDMA Cell Broadcast category services.
1535  *
1536  * @return
1537  * - LE_FAULT Function failed.
1538  * - LE_BAD_PARAMETER Parameter is invalid.
1539  * - LE_OK Function succeeded.
1540  */
1541 //--------------------------------------------------------------------------------------------------
1543 (
1544  le_sms_CdmaServiceCat_t serviceCat,
1545  ///< [IN] Service category assignment. Reference to 3GPP2 C.R1001-D
1546  ///< v1.0 Section 9.3.1 Standard Service Category Assignments.
1547  le_sms_Languages_t language
1548  ///< [IN] Language Indicator. Reference to
1549  ///< 3GPP2 C.R1001-D v1.0 Section 9.2.1 Language Indicator
1550  ///< Value Assignments
1551 );
1552 
1553 //--------------------------------------------------------------------------------------------------
1554 /**
1555  * Remove CDMA Cell Broadcast category services.
1556  *
1557  * @return
1558  * - LE_FAULT Function failed.
1559  * - LE_BAD_PARAMETER Parameter is invalid.
1560  * - LE_OK Function succeeded.
1561  */
1562 //--------------------------------------------------------------------------------------------------
1564 (
1565  le_sms_CdmaServiceCat_t serviceCat,
1566  ///< [IN] Service category assignment. Reference to 3GPP2 C.R1001-D
1567  ///< v1.0 Section 9.3.1 Standard Service Category Assignments.
1568  le_sms_Languages_t language
1569  ///< [IN] Language Indicator. Reference to
1570  ///< 3GPP2 C.R1001-D v1.0 Section 9.2.1 Language Indicator
1571  ///< Value Assignments
1572 );
1573 
1574 //--------------------------------------------------------------------------------------------------
1575 /**
1576  * Clear CDMA Cell Broadcast category services.
1577  *
1578  * @return
1579  * - LE_FAULT Function failed.
1580  * - LE_OK Function succeeded.
1581  */
1582 //--------------------------------------------------------------------------------------------------
1584 (
1585  void
1586 );
1587 
1588 //--------------------------------------------------------------------------------------------------
1589 /**
1590  * Get the number of messages successfully received or sent since last counter reset.
1591  *
1592  * @return
1593  * - LE_OK Function succeeded.
1594  * - LE_BAD_PARAMETER A parameter is invalid.
1595  *
1596  * @note If the caller is passing a bad pointer into this function, it is a fatal error, the
1597  * function will not return.
1598  */
1599 //--------------------------------------------------------------------------------------------------
1601 (
1602  le_sms_Type_t messageType,
1603  ///< [IN] Message type
1604  int32_t* messageCountPtr
1605  ///< [OUT] Number of messages
1606 );
1607 
1608 //--------------------------------------------------------------------------------------------------
1609 /**
1610  * Start to count the messages successfully received and sent.
1611  */
1612 //--------------------------------------------------------------------------------------------------
1613 void le_sms_StartCount
1614 (
1615  void
1616 );
1617 
1618 //--------------------------------------------------------------------------------------------------
1619 /**
1620  * Stop to count the messages successfully received and sent.
1621  */
1622 //--------------------------------------------------------------------------------------------------
1623 void le_sms_StopCount
1624 (
1625  void
1626 );
1627 
1628 //--------------------------------------------------------------------------------------------------
1629 /**
1630  * Reset the count of messages successfully received and sent.
1631  */
1632 //--------------------------------------------------------------------------------------------------
1633 void le_sms_ResetCount
1634 (
1635  void
1636 );
1637 
1638 //--------------------------------------------------------------------------------------------------
1639 /**
1640  * Enable SMS Status Report for outgoing messages.
1641  *
1642  * @return
1643  * - LE_OK Function succeeded.
1644  * - LE_FAULT Function failed.
1645  */
1646 //--------------------------------------------------------------------------------------------------
1648 (
1649  void
1650 );
1651 
1652 //--------------------------------------------------------------------------------------------------
1653 /**
1654  * Disable SMS Status Report for outgoing messages.
1655  *
1656  * @return
1657  * - LE_OK Function succeeded.
1658  * - LE_FAULT Function failed.
1659  */
1660 //--------------------------------------------------------------------------------------------------
1662 (
1663  void
1664 );
1665 
1666 //--------------------------------------------------------------------------------------------------
1667 /**
1668  * Get SMS Status Report activation state.
1669  *
1670  * @return
1671  * - LE_OK Function succeeded.
1672  * - LE_BAD_PARAMETER Parameter is invalid.
1673  * - LE_FAULT Function failed.
1674  */
1675 //--------------------------------------------------------------------------------------------------
1677 (
1678  bool* enabledPtr
1679  ///< [OUT] True when SMS Status Report is enabled, false otherwise.
1680 );
1681 
1682 //--------------------------------------------------------------------------------------------------
1683 /**
1684  * Get TP-Message-Reference of a message. Message type should be either a SMS Status Report or an
1685  * outgoing SMS.
1686  * TP-Message-Reference is defined in 3GPP TS 23.040 section 9.2.3.6.
1687  *
1688  * @return
1689  * - LE_OK Function succeeded.
1690  * - LE_BAD_PARAMETER Parameter is invalid.
1691  * - LE_FAULT Function failed.
1692  * - LE_UNAVAILABLE Outgoing SMS message is not sent.
1693  */
1694 //--------------------------------------------------------------------------------------------------
1696 (
1697  le_sms_MsgRef_t msgRef,
1698  ///< [IN] Reference to the message object.
1699  uint8_t* tpMrPtr
1700  ///< [OUT] 3GPP TS 23.040 TP-Message-Reference.
1701 );
1702 
1703 //--------------------------------------------------------------------------------------------------
1704 /**
1705  * Get TP-Recipient-Address of SMS Status Report.
1706  * TP-Recipient-Address is defined in 3GPP TS 23.040 section 9.2.3.14.
1707  * TP-Recipient-Address Type-of-Address is defined in 3GPP TS 24.011 section 8.2.5.2.
1708  *
1709  * @return
1710  * - LE_OK Function succeeded.
1711  * - LE_BAD_PARAMETER A parameter is invalid.
1712  * - LE_OVERFLOW The Recipient Address length exceeds the length of the provided buffer.
1713  * - LE_FAULT Function failed.
1714  */
1715 //--------------------------------------------------------------------------------------------------
1717 (
1718  le_sms_MsgRef_t msgRef,
1719  ///< [IN] Reference to the message object.
1720  uint8_t* toraPtr,
1721  ///< [OUT] 3GPP TS 24.011 TP-Recipient-Address
1722  ///< Type-of-Address.
1723  char* ra,
1724  ///< [OUT] 3GPP TS 23.040 TP-Recipient-Address.
1725  size_t raSize
1726  ///< [IN]
1727 );
1728 
1729 //--------------------------------------------------------------------------------------------------
1730 /**
1731  * Get TP-Service-Centre-Time-Stamp of SMS Status Report.
1732  * TP-Service-Centre-Time-Stamp is defined in 3GPP TS 23.040 section 9.2.3.11.
1733  *
1734  * @return
1735  * - LE_OK Function succeeded.
1736  * - LE_BAD_PARAMETER A parameter is invalid.
1737  * - LE_OVERFLOW The SC Timestamp length exceeds the length of the provided buffer.
1738  * - LE_FAULT Function failed.
1739  */
1740 //--------------------------------------------------------------------------------------------------
1742 (
1743  le_sms_MsgRef_t msgRef,
1744  ///< [IN] Reference to the message object.
1745  char* scts,
1746  ///< [OUT] 3GPP TS 23.040 TP-Service-Centre-Time-Stamp.
1747  size_t sctsSize
1748  ///< [IN]
1749 );
1750 
1751 //--------------------------------------------------------------------------------------------------
1752 /**
1753  * Get TP-Discharge-Time of SMS Status Report.
1754  * TP-Discharge-Time is defined in 3GPP TS 23.040 section 9.2.3.13.
1755  *
1756  * @return
1757  * - LE_OK Function succeeded.
1758  * - LE_BAD_PARAMETER A parameter is invalid.
1759  * - LE_OVERFLOW The Discharge Time length exceeds the length of the provided buffer.
1760  * - LE_FAULT Function failed.
1761  */
1762 //--------------------------------------------------------------------------------------------------
1764 (
1765  le_sms_MsgRef_t msgRef,
1766  ///< [IN] Reference to the message object.
1767  char* dt,
1768  ///< [OUT] 3GPP TS 23.040 TP-Discharge-Time.
1769  size_t dtSize
1770  ///< [IN]
1771 );
1772 
1773 //--------------------------------------------------------------------------------------------------
1774 /**
1775  * Get TP-Status of SMS Status Report.
1776  * TP-Status is defined in 3GPP TS 23.040 section 9.2.3.15.
1777  *
1778  * @return
1779  * - LE_OK Function succeeded.
1780  * - LE_BAD_PARAMETER A parameter is invalid.
1781  * - LE_FAULT Function failed.
1782  */
1783 //--------------------------------------------------------------------------------------------------
1785 (
1786  le_sms_MsgRef_t msgRef,
1787  ///< [IN] Reference to the message object.
1788  uint8_t* stPtr
1789  ///< [OUT] 3GPP TS 23.040 TP-Status.
1790 );
1791 
1792 #endif // LE_SMS_INTERFACE_H_INCLUDE_GUARD
LE_FULL_API void le_sms_SetServerDisconnectHandler(le_sms_DisconnectHandler_t disconnectHandler, void *contextPtr)
void le_sms_Delete(le_sms_MsgRef_t msgRef)
le_result_t le_sms_GetPDU(le_sms_MsgRef_t msgRef, uint8_t *pduPtr, size_t *pduSizePtr)
le_result_t le_sms_GetCellBroadcastId(le_sms_MsgRef_t msgRef, uint16_t *messageIdPtr)
le_result_t le_sms_ClearCdmaCellBroadcastServices(void)
le_result_t le_sms_GetSmsCenterAddress(char *tel, size_t telSize)
void le_sms_StartCount(void)
le_result_t
Definition: le_basics.h:45
le_sms_ErrorCode3GPP2_t le_sms_Get3GPP2ErrorCode(le_sms_MsgRef_t msgRef)
le_result_t le_sms_ClearCellBroadcastIds(void)
void le_sms_MarkUnread(le_sms_MsgRef_t msgRef)
le_sms_MsgRef_t le_sms_Create(void)
le_result_t le_sms_SetUCS2(le_sms_MsgRef_t msgRef, const uint16_t *ucs2Ptr, size_t ucs2Size)
size_t le_sms_GetUserdataLen(le_sms_MsgRef_t msgRef)
le_result_t le_sms_GetTpRa(le_sms_MsgRef_t msgRef, uint8_t *toraPtr, char *ra, size_t raSize)
le_sms_MsgRef_t le_sms_SendPdu(const uint8_t *pduPtr, size_t pduSize, le_sms_CallbackResultFunc_t handlerPtr, void *contextPtr)
void(* le_sms_DisconnectHandler_t)(void *)
Definition: le_sms_interface.h:403
void le_sms_GetErrorCode(le_sms_MsgRef_t msgRef, le_sms_ErrorCode_t *rpCausePtr, le_sms_ErrorCode_t *tpCausePtr)
le_result_t le_sms_ActivateCellBroadcast(void)
le_sms_MsgRef_t le_sms_GetNext(le_sms_MsgListRef_t msgListRef)
le_result_t le_sms_GetBinary(le_sms_MsgRef_t msgRef, uint8_t *binPtr, size_t *binSizePtr)
le_sms_MsgListRef_t le_sms_CreateRxMsgList(void)
void le_sms_RemoveRxMessageHandler(le_sms_RxMessageHandlerRef_t handlerRef)
le_result_t le_sms_GetText(le_sms_MsgRef_t msgRef, char *text, size_t textSize)
le_result_t le_sms_ActivateCdmaCellBroadcast(void)
le_sms_FullStorageEventHandlerRef_t le_sms_AddFullStorageEventHandler(le_sms_FullStorageHandlerFunc_t handlerPtr, void *contextPtr)
le_result_t le_sms_DeactivateCellBroadcast(void)
le_result_t le_sms_GetCellBroadcastSerialNumber(le_sms_MsgRef_t msgRef, uint16_t *serialNumberPtr)
le_result_t le_sms_DisableStatusReport(void)
void le_sms_DisconnectService(void)
le_result_t le_sms_TryConnectService(void)
le_result_t le_sms_AddCellBroadcastIds(uint16_t fromId, uint16_t toId)
le_result_t le_sms_SetText(le_sms_MsgRef_t msgRef, const char *LE_NONNULL text)
le_result_t le_sms_SetBinary(le_sms_MsgRef_t msgRef, const uint8_t *binPtr, size_t binSize)
le_result_t le_sms_SetPreferredStorage(le_sms_Storage_t prefStorage)
le_result_t le_sms_DeleteFromStorage(le_sms_MsgRef_t msgRef)
le_result_t le_sms_GetUCS2(le_sms_MsgRef_t msgRef, uint16_t *ucs2Ptr, size_t *ucs2SizePtr)
le_result_t le_sms_GetSenderTel(le_sms_MsgRef_t msgRef, char *tel, size_t telSize)
le_result_t le_sms_SendAsync(le_sms_MsgRef_t msgRef, le_sms_CallbackResultFunc_t handlerPtr, void *contextPtr)
le_sms_Status_t le_sms_GetStatus(le_sms_MsgRef_t msgRef)
le_result_t le_sms_GetPreferredStorage(le_sms_Storage_t *prefStoragePtr)
size_t le_sms_GetPDULen(le_sms_MsgRef_t msgRef)
le_result_t le_sms_DeactivateCdmaCellBroadcast(void)
le_result_t le_sms_RemoveCdmaCellBroadcastServices(le_sms_CdmaServiceCat_t serviceCat, le_sms_Languages_t language)
le_result_t le_sms_SetSmsCenterAddress(const char *LE_NONNULL tel)
le_sms_MsgRef_t le_sms_GetFirst(le_sms_MsgListRef_t msgListRef)
void le_sms_ResetCount(void)
#define LE_FULL_API
Definition: le_apiFeatures.h:40
le_result_t le_sms_SetPDU(le_sms_MsgRef_t msgRef, const uint8_t *pduPtr, size_t pduSize)
le_result_t le_sms_RemoveCellBroadcastIds(uint16_t fromId, uint16_t toId)
void le_sms_ConnectService(void)
le_sms_MsgRef_t le_sms_SendText(const char *LE_NONNULL destStr, const char *LE_NONNULL textStr, le_sms_CallbackResultFunc_t handlerPtr, void *contextPtr)
le_result_t le_sms_SetDestination(le_sms_MsgRef_t msgRef, const char *LE_NONNULL dest)
le_result_t le_sms_GetTpDt(le_sms_MsgRef_t msgRef, char *dt, size_t dtSize)
le_result_t le_sms_AddCdmaCellBroadcastServices(le_sms_CdmaServiceCat_t serviceCat, le_sms_Languages_t language)
le_result_t le_sms_GetTpMr(le_sms_MsgRef_t msgRef, uint8_t *tpMrPtr)
le_result_t le_sms_EnableStatusReport(void)
le_sms_Format_t le_sms_GetFormat(le_sms_MsgRef_t msgRef)
int32_t le_sms_GetPlatformSpecificErrorCode(le_sms_MsgRef_t msgRef)
le_result_t le_sms_GetCount(le_sms_Type_t messageType, int32_t *messageCountPtr)
le_sms_Type_t le_sms_GetType(le_sms_MsgRef_t msgRef)
void le_sms_RemoveFullStorageEventHandler(le_sms_FullStorageEventHandlerRef_t handlerRef)
le_result_t le_sms_GetTpSt(le_sms_MsgRef_t msgRef, uint8_t *stPtr)
le_result_t le_sms_GetTimeStamp(le_sms_MsgRef_t msgRef, char *timestamp, size_t timestampSize)
le_result_t le_sms_Send(le_sms_MsgRef_t msgRef)
void le_sms_DeleteList(le_sms_MsgListRef_t msgListRef)
le_sms_RxMessageHandlerRef_t le_sms_AddRxMessageHandler(le_sms_RxMessageHandlerFunc_t handlerPtr, void *contextPtr)
le_result_t le_sms_IsStatusReportEnabled(bool *enabledPtr)
void le_sms_MarkRead(le_sms_MsgRef_t msgRef)
le_result_t le_sms_GetTpScTs(le_sms_MsgRef_t msgRef, char *scts, size_t sctsSize)
void le_sms_StopCount(void)