le_sms_interface.h File Reference

#include "legato.h"
#include "le_mdmDefs_interface.h"
#include "le_sms_common.h"

Go to the source code of this file.

Typedefs

typedef void(* le_sms_DisconnectHandler_t) (void *)
 

Functions

void le_sms_ConnectService (void)
 
le_result_t le_sms_TryConnectService (void)
 
LE_FULL_API void le_sms_SetServerDisconnectHandler (le_sms_DisconnectHandler_t disconnectHandler, void *contextPtr)
 
void le_sms_DisconnectService (void)
 
le_sms_RxMessageHandlerRef_t le_sms_AddRxMessageHandler (le_sms_RxMessageHandlerFunc_t handlerPtr, void *contextPtr)
 
void le_sms_RemoveRxMessageHandler (le_sms_RxMessageHandlerRef_t handlerRef)
 
le_sms_FullStorageEventHandlerRef_t le_sms_AddFullStorageEventHandler (le_sms_FullStorageHandlerFunc_t handlerPtr, void *contextPtr)
 
void le_sms_RemoveFullStorageEventHandler (le_sms_FullStorageEventHandlerRef_t handlerRef)
 
le_sms_MsgRef_t le_sms_Create (void)
 
le_result_t le_sms_SetTimeout (le_sms_MsgRef_t msgRef, uint32_t timeout)
 
le_result_t le_sms_SetDestination (le_sms_MsgRef_t msgRef, const char *LE_NONNULL dest)
 
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_SetUCS2 (le_sms_MsgRef_t msgRef, const uint16_t *ucs2Ptr, size_t ucs2Size)
 
le_result_t le_sms_SetPDU (le_sms_MsgRef_t msgRef, const uint8_t *pduPtr, size_t pduSize)
 
le_result_t le_sms_Send (le_sms_MsgRef_t msgRef)
 
le_result_t le_sms_SendAsync (le_sms_MsgRef_t msgRef, le_sms_CallbackResultFunc_t handlerPtr, void *contextPtr)
 
le_sms_ErrorCode3GPP2_t le_sms_Get3GPP2ErrorCode (le_sms_MsgRef_t msgRef)
 
void le_sms_GetErrorCode (le_sms_MsgRef_t msgRef, le_sms_ErrorCode_t *rpCausePtr, le_sms_ErrorCode_t *tpCausePtr)
 
int32_t le_sms_GetPlatformSpecificErrorCode (le_sms_MsgRef_t msgRef)
 
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_sms_MsgRef_t le_sms_SendPdu (const uint8_t *pduPtr, size_t pduSize, le_sms_CallbackResultFunc_t handlerPtr, void *contextPtr)
 
void le_sms_Delete (le_sms_MsgRef_t msgRef)
 
le_sms_Format_t le_sms_GetFormat (le_sms_MsgRef_t msgRef)
 
le_sms_Type_t le_sms_GetType (le_sms_MsgRef_t msgRef)
 
le_result_t le_sms_GetCellBroadcastId (le_sms_MsgRef_t msgRef, uint16_t *messageIdPtr)
 
le_result_t le_sms_GetCellBroadcastSerialNumber (le_sms_MsgRef_t msgRef, uint16_t *serialNumberPtr)
 
le_result_t le_sms_GetSenderTel (le_sms_MsgRef_t msgRef, char *tel, size_t telSize)
 
le_result_t le_sms_GetTimeStamp (le_sms_MsgRef_t msgRef, char *timestamp, size_t timestampSize)
 
size_t le_sms_GetUserdataLen (le_sms_MsgRef_t msgRef)
 
le_result_t le_sms_GetText (le_sms_MsgRef_t msgRef, char *text, size_t textSize)
 
le_result_t le_sms_GetBinary (le_sms_MsgRef_t msgRef, uint8_t *binPtr, size_t *binSizePtr)
 
le_result_t le_sms_GetUCS2 (le_sms_MsgRef_t msgRef, uint16_t *ucs2Ptr, size_t *ucs2SizePtr)
 
le_result_t le_sms_GetPDU (le_sms_MsgRef_t msgRef, uint8_t *pduPtr, size_t *pduSizePtr)
 
size_t le_sms_GetPDULen (le_sms_MsgRef_t msgRef)
 
le_result_t le_sms_DeleteFromStorage (le_sms_MsgRef_t msgRef)
 
le_sms_MsgListRef_t le_sms_CreateRxMsgList (void)
 
void le_sms_DeleteList (le_sms_MsgListRef_t msgListRef)
 
le_sms_MsgRef_t le_sms_GetFirst (le_sms_MsgListRef_t msgListRef)
 
le_sms_MsgRef_t le_sms_GetNext (le_sms_MsgListRef_t msgListRef)
 
le_sms_Status_t le_sms_GetStatus (le_sms_MsgRef_t msgRef)
 
void le_sms_MarkRead (le_sms_MsgRef_t msgRef)
 
void le_sms_MarkUnread (le_sms_MsgRef_t msgRef)
 
le_result_t le_sms_GetSmsCenterAddress (char *tel, size_t telSize)
 
le_result_t le_sms_SetSmsCenterAddress (const char *LE_NONNULL tel)
 
le_result_t le_sms_SetPreferredStorage (le_sms_Storage_t prefStorage)
 
le_result_t le_sms_GetPreferredStorage (le_sms_Storage_t *prefStoragePtr)
 
le_result_t le_sms_ActivateCellBroadcast (void)
 
le_result_t le_sms_DeactivateCellBroadcast (void)
 
le_result_t le_sms_ActivateCdmaCellBroadcast (void)
 
le_result_t le_sms_DeactivateCdmaCellBroadcast (void)
 
le_result_t le_sms_AddCellBroadcastIds (uint16_t fromId, uint16_t toId)
 
le_result_t le_sms_RemoveCellBroadcastIds (uint16_t fromId, uint16_t toId)
 
le_result_t le_sms_ClearCellBroadcastIds (void)
 
le_result_t le_sms_AddCdmaCellBroadcastServices (le_sms_CdmaServiceCat_t serviceCat, le_sms_Languages_t language)
 
le_result_t le_sms_RemoveCdmaCellBroadcastServices (le_sms_CdmaServiceCat_t serviceCat, le_sms_Languages_t language)
 
le_result_t le_sms_ClearCdmaCellBroadcastServices (void)
 
le_result_t le_sms_GetCount (le_sms_Type_t messageType, int32_t *messageCountPtr)
 
void le_sms_StartCount (void)
 
void le_sms_StopCount (void)
 
void le_sms_ResetCount (void)
 
le_result_t le_sms_EnableStatusReport (void)
 
le_result_t le_sms_DisableStatusReport (void)
 
le_result_t le_sms_IsStatusReportEnabled (bool *enabledPtr)
 
le_result_t le_sms_GetTpMr (le_sms_MsgRef_t msgRef, uint8_t *tpMrPtr)
 
le_result_t le_sms_GetTpRa (le_sms_MsgRef_t msgRef, uint8_t *toraPtr, char *ra, size_t raSize)
 
le_result_t le_sms_GetTpScTs (le_sms_MsgRef_t msgRef, char *scts, size_t sctsSize)
 
le_result_t le_sms_GetTpDt (le_sms_MsgRef_t msgRef, char *dt, size_t dtSize)
 
le_result_t le_sms_GetTpSt (le_sms_MsgRef_t msgRef, uint8_t *stPtr)
 

Detailed Description

Legato SMS include file.

Typedef Documentation

◆ le_sms_DisconnectHandler_t

typedef void(* le_sms_DisconnectHandler_t) (void *)

Type for handler called when a server disconnects.

Function Documentation

◆ le_sms_ActivateCdmaCellBroadcast()

le_result_t le_sms_ActivateCdmaCellBroadcast ( void  )

Activate CDMA Cell Broadcast message notification

Returns
  • LE_FAULT Function failed.
  • LE_OK Function succeeded.

◆ le_sms_ActivateCellBroadcast()

le_result_t le_sms_ActivateCellBroadcast ( void  )

Activate Cell Broadcast message notification

Returns
  • LE_FAULT Function failed.
  • LE_OK Function succeeded.

◆ le_sms_AddCdmaCellBroadcastServices()

le_result_t le_sms_AddCdmaCellBroadcastServices ( le_sms_CdmaServiceCat_t  serviceCat,
le_sms_Languages_t  language 
)

Add CDMA Cell Broadcast category services.

Returns
  • LE_FAULT Function failed.
  • LE_BAD_PARAMETER Parameter is invalid.
  • LE_OK Function succeeded.
Parameters
[in]serviceCatService category assignment. Reference to 3GPP2 C.R1001-D v1.0 Section 9.3.1 Standard Service Category Assignments.
[in]languageLanguage Indicator. Reference to 3GPP2 C.R1001-D v1.0 Section 9.2.1 Language Indicator Value Assignments

◆ le_sms_AddCellBroadcastIds()

le_result_t le_sms_AddCellBroadcastIds ( uint16_t  fromId,
uint16_t  toId 
)

Add Cell Broadcast message Identifiers range.

Returns
  • LE_FAULT Function failed.
  • LE_OK Function succeeded.
Parameters
[in]fromIdStarting point of the range of cell broadcast message identifier.
[in]toIdEnding point of the range of cell broadcast message identifier.

◆ le_sms_AddFullStorageEventHandler()

le_sms_FullStorageEventHandlerRef_t le_sms_AddFullStorageEventHandler ( le_sms_FullStorageHandlerFunc_t  handlerPtr,
void *  contextPtr 
)

Add handler function for EVENT 'le_sms_FullStorageEvent'

This event provides information on full storage indication.

Parameters
[in]handlerPtr
[in]contextPtr

◆ le_sms_AddRxMessageHandler()

le_sms_RxMessageHandlerRef_t le_sms_AddRxMessageHandler ( le_sms_RxMessageHandlerFunc_t  handlerPtr,
void *  contextPtr 
)

Message Format. Message Type. Message Status. CDMA Cell broadcast message languages. CDMA Cell broadcast Service Categories. SMS storage area. 3GPP2 Message Error code when the message sending has failed. Message Error code when the message sending has failed. Declare a reference type for referring to SMS Message objects. Opaque type for SMS Message Listing. Handler for Sending result. Handler for New Message. Reference type used by Add/Remove functions for EVENT 'le_sms_RxMessage' Handler for full storage indication. Reference type used by Add/Remove functions for EVENT 'le_sms_FullStorageEvent' Add handler function for EVENT 'le_sms_RxMessage'

This event provides information on new received messages.

Parameters
[in]handlerPtr
[in]contextPtr

◆ le_sms_ClearCdmaCellBroadcastServices()

le_result_t le_sms_ClearCdmaCellBroadcastServices ( void  )

Clear CDMA Cell Broadcast category services.

Returns
  • LE_FAULT Function failed.
  • LE_OK Function succeeded.

◆ le_sms_ClearCellBroadcastIds()

le_result_t le_sms_ClearCellBroadcastIds ( void  )

Clear Cell Broadcast message Identifiers.

Returns
  • LE_FAULT Function failed.
  • LE_OK Function succeeded.

◆ le_sms_ConnectService()

void le_sms_ConnectService ( void  )

Connect the current client thread to the service providing this API. Block until the service is available.

For each thread that wants to use this API, either ConnectService or TryConnectService must be called before any other functions in this API. Normally, ConnectService is automatically called for the main thread, but not for any other thread. For details, see Client-specific Functions.

This function is created automatically.

◆ le_sms_Create()

le_sms_MsgRef_t le_sms_Create ( void  )

Create an SMS Message data structure.

Returns
Reference to the new Message object.
Note
On failure, the process exits, so you don't have to worry about checking the returned reference for validity.

◆ le_sms_CreateRxMsgList()

le_sms_MsgListRef_t le_sms_CreateRxMsgList ( void  )

Create an object's reference of the list of received messages saved in the SMS message storage area.

Returns
Reference to the List object. Null pointer if no messages have been retrieved.

◆ le_sms_DeactivateCdmaCellBroadcast()

le_result_t le_sms_DeactivateCdmaCellBroadcast ( void  )

Deactivate CDMA Cell Broadcast message notification

Returns
  • LE_FAULT Function failed.
  • LE_OK Function succeeded.

◆ le_sms_DeactivateCellBroadcast()

le_result_t le_sms_DeactivateCellBroadcast ( void  )

Deactivate Cell Broadcast message notification

Returns
  • LE_FAULT Function failed.
  • LE_OK Function succeeded.

◆ le_sms_Delete()

void le_sms_Delete ( le_sms_MsgRef_t  msgRef)

Delete a Message data structure.

It deletes the Message data structure and all the allocated memory is freed. If several users own the Message object (e.g., several handler functions registered for SMS message reception), the Message object will only be deleted if one User owns the Message object.

Note
If the caller is passing a bad pointer into this function, it is a fatal error, the function will not return.
Parameters
[in]msgRefReference to the message object.

◆ le_sms_DeleteFromStorage()

le_result_t le_sms_DeleteFromStorage ( le_sms_MsgRef_t  msgRef)

Delete an SMS message from the storage area.

Verifies first if the parameter is valid, then it checks the modem state can support message deleting.

Returns
LE_FAULT Function failed to perform the deletion.
LE_NO_MEMORY The message is not present in storage area.
LE_OK Function succeeded.
Note
If the caller is passing a bad pointer into this function, it is a fatal error, the function will not return.
Parameters
[in]msgRefReference to the message object.

◆ le_sms_DeleteList()

void le_sms_DeleteList ( le_sms_MsgListRef_t  msgListRef)

Delete the list of the Messages retrieved from the message storage.

Note
On failure, the process exits, so you don't have to worry about checking the returned reference for validity.
Parameters
[in]msgListRefMessages list.

◆ le_sms_DisableStatusReport()

le_result_t le_sms_DisableStatusReport ( void  )

Disable SMS Status Report for outgoing messages.

Returns
  • LE_OK Function succeeded.
  • LE_FAULT Function failed.

◆ le_sms_DisconnectService()

void le_sms_DisconnectService ( void  )

Disconnect the current client thread from the service providing this API.

Normally, this function doesn't need to be called. After this function is called, there's no longer a connection to the service, and the functions in this API can't be used. For details, see Client-specific Functions.

This function is created automatically.

◆ le_sms_EnableStatusReport()

le_result_t le_sms_EnableStatusReport ( void  )

Enable SMS Status Report for outgoing messages.

Returns
  • LE_OK Function succeeded.
  • LE_FAULT Function failed.

◆ le_sms_Get3GPP2ErrorCode()

le_sms_ErrorCode3GPP2_t le_sms_Get3GPP2ErrorCode ( le_sms_MsgRef_t  msgRef)

Get the error code when a 3GPP2 message sending has Failed.

Returns
The error code
Note
If the caller is passing a bad pointer into this function, it is a fatal error, the function will not return.
It is only applicable for 3GPP2 message sending failure, otherwise LE_SMS_ERROR_3GPP2_MAX is returned.
Parameters
[in]msgRefReference to the message object.

◆ le_sms_GetBinary()

le_result_t le_sms_GetBinary ( le_sms_MsgRef_t  msgRef,
uint8_t *  binPtr,
size_t *  binSizePtr 
)

Get the binary Message.

Output parameters are updated with the binary message content and the length of the raw binary message in bytes. If the binary data exceed the value of 'len' input parameter, a LE_OVERFLOW error code is returned and 'raw' is filled until 'len' bytes.

Returns
LE_FORMAT_ERROR Message is not in binary format
LE_OVERFLOW Message length exceed the maximum length.
LE_OK Function succeeded.
Note
If the caller is passing a bad pointer into this function, it is a fatal error, the function will not return.
Parameters
[in]msgRefReference to the message object.
[out]binPtrBinary message.
[in,out]binSizePtr

◆ le_sms_GetCellBroadcastId()

le_result_t le_sms_GetCellBroadcastId ( le_sms_MsgRef_t  msgRef,
uint16_t *  messageIdPtr 
)

Get the Cell Broadcast Message Identifier.

Returns
  • LE_FAULT Message is not a cell broadcast type.
  • LE_OK Function succeeded.
Note
If the caller is passing a bad pointer into this function, it is a fatal error, the function will not return.
Parameters
[in]msgRefReference to the message object.
[out]messageIdPtrCell Broadcast Message Identifier.

◆ le_sms_GetCellBroadcastSerialNumber()

le_result_t le_sms_GetCellBroadcastSerialNumber ( le_sms_MsgRef_t  msgRef,
uint16_t *  serialNumberPtr 
)

Get the Cell Broadcast Message Serial Number.

Returns
  • LE_FAULT Message is not a cell broadcast type.
  • LE_OK Function succeeded.
Note
If the caller is passing a bad pointer into this function, it is a fatal error, the function will not return.
Parameters
[in]msgRefReference to the message object.
[out]serialNumberPtrCell Broadcast Serial Number.

◆ le_sms_GetCount()

le_result_t le_sms_GetCount ( le_sms_Type_t  messageType,
int32_t *  messageCountPtr 
)

Get the number of messages successfully received or sent since last counter reset.

Returns
  • LE_OK Function succeeded.
  • LE_BAD_PARAMETER A parameter is invalid.
Note
If the caller is passing a bad pointer into this function, it is a fatal error, the function will not return.
Parameters
[in]messageTypeMessage type
[out]messageCountPtrNumber of messages

◆ le_sms_GetErrorCode()

void le_sms_GetErrorCode ( le_sms_MsgRef_t  msgRef,
le_sms_ErrorCode_t *  rpCausePtr,
le_sms_ErrorCode_t *  tpCausePtr 
)

Get the Radio Protocol and the Transfer Protocol error code when a 3GPP message sending has failed.

Note
If the caller is passing a bad pointer into this function, it is a fatal error, the function will not return.
It is only applicable for 3GPP message sending failure, otherwise LE_SMS_ERROR_3GPP_MAX is returned.
Parameters
[in]msgRefReference to the message object.
[out]rpCausePtrRadio Protocol cause code.
[out]tpCausePtrTransfer Protocol cause code.

◆ le_sms_GetFirst()

le_sms_MsgRef_t le_sms_GetFirst ( le_sms_MsgListRef_t  msgListRef)

Get the first Message object reference in the list of messages retrieved with le_sms_CreateRxMsgList().

Returns
NULL No message found.
Msg Message object reference.
Note
If the caller is passing a bad pointer into this function, it is a fatal error, the function will not return.
Parameters
[in]msgListRefMessages list.

◆ le_sms_GetFormat()

le_sms_Format_t le_sms_GetFormat ( le_sms_MsgRef_t  msgRef)

Get the message format.

Returns
Message format.
Note
If the caller is passing a bad pointer into this function, it is a fatal error, the function will not return.
Parameters
[in]msgRefReference to the message object.

◆ le_sms_GetNext()

le_sms_MsgRef_t le_sms_GetNext ( le_sms_MsgListRef_t  msgListRef)

Get the next Message object reference in the list of messages retrieved with le_sms_CreateRxMsgList().

Returns
NULL No message found.
Msg Message object reference.
Note
If the caller is passing a bad pointer into this function, it is a fatal error, the function will not return.
Parameters
[in]msgListRefMessages list.

◆ le_sms_GetPDU()

le_result_t le_sms_GetPDU ( le_sms_MsgRef_t  msgRef,
uint8_t *  pduPtr,
size_t *  pduSizePtr 
)

Get the PDU message.

Output parameters are updated with the PDU message content and the length of the PDU message in bytes. If the PDU data exceed the value of 'len' input parameter, a LE_OVERFLOW error code is returned and 'pdu' is filled until 'len' bytes.

Returns
LE_FORMAT_ERROR Unable to encode the message in PDU (only for outgoing messages).
LE_OVERFLOW Message length exceed the maximum length.
LE_OK Function succeeded.
Note
If the caller is passing a bad pointer into this function, it is a fatal error, the function will not return.
Parameters
[in]msgRefReference to the message object.
[out]pduPtrPDU message.
[in,out]pduSizePtr

◆ le_sms_GetPDULen()

size_t le_sms_GetPDULen ( le_sms_MsgRef_t  msgRef)

Get the message Length value.

Returns
Length of the data in bytes of the PDU message.
Note
If the caller is passing a bad pointer into this function, it is a fatal error, the function will not return.
Parameters
[in]msgRefReference to the message object.

◆ le_sms_GetPlatformSpecificErrorCode()

int32_t le_sms_GetPlatformSpecificErrorCode ( le_sms_MsgRef_t  msgRef)

Called to get the platform specific error code.

Refer to Platform specific error codes for platform specific error code description.

Returns
The platform specific error code.
Note
If the caller is passing a bad pointer into this function, it is a fatal error, the function will not return.
Parameters
[in]msgRefReference to the message object.

◆ le_sms_GetPreferredStorage()

le_result_t le_sms_GetPreferredStorage ( le_sms_Storage_t *  prefStoragePtr)

Get the preferred SMS storage for incoming messages.

Returns
  • LE_FAULT Function failed.
  • LE_OK Function succeeded.
Parameters
[out]prefStoragePtrstorage parameter.

◆ le_sms_GetSenderTel()

le_result_t le_sms_GetSenderTel ( le_sms_MsgRef_t  msgRef,
char *  tel,
size_t  telSize 
)

Get the Sender Telephone number.

Output parameter is updated with the Telephone number. If the Telephone number string exceeds the value of 'len' parameter, LE_OVERFLOW error code is returned and 'tel' is filled until 'len-1' characters and a null-character is implicitly appended at the end of 'tel'.

Returns
LE_NOT_PERMITTED Message is not a received message.
LE_OVERFLOW Telephone number length exceed the maximum length.
LE_OK Function succeeded.
Note
If the caller is passing a bad pointer into this function, it is a fatal error, the function will not return.
Parameters
[in]msgRefReference to the message object.
[out]telTelephone number string.
[in]telSize

◆ le_sms_GetSmsCenterAddress()

le_result_t le_sms_GetSmsCenterAddress ( char *  tel,
size_t  telSize 
)

Get the SMS center address.

Output parameter is updated with the SMS Service center address. If the Telephone number string exceeds the value of 'len' parameter, LE_OVERFLOW error code is returned and 'tel' is filled until 'len-1' characters and a null-character is implicitly appended at the end of 'tel'.

Returns
  • LE_FAULT Service is not available.
  • LE_OVERFLOW Telephone number length exceed the maximum length.
  • LE_OK Function succeeded.
Parameters
[out]telSMS center address number string.
[in]telSize

◆ le_sms_GetStatus()

le_sms_Status_t le_sms_GetStatus ( le_sms_MsgRef_t  msgRef)

Read the Message status (Received Read, Received Unread, Stored Sent, Stored Unsent).

Returns
Status of the message.
Note
If the caller is passing a bad pointer into this function, it is a fatal error, the function will not return.
Parameters
[in]msgRefMessages list.

◆ le_sms_GetText()

le_result_t le_sms_GetText ( le_sms_MsgRef_t  msgRef,
char *  text,
size_t  textSize 
)

Get the text Message.

Output parameter is updated with the text string encoded in ASCII format. If the text string exceeds the value of 'len' parameter, LE_OVERFLOW error code is returned and 'text' is filled until 'len-1' characters and a null-character is implicitly appended at the end of 'text'.

Returns
LE_OVERFLOW Message length exceed the maximum length.
LE_OK Function succeeded.
Note
If the caller is passing a bad pointer into this function, it is a fatal error, the function will not return.
Parameters
[in]msgRefReference to the message object.
[out]textSMS text.
[in]textSize

◆ le_sms_GetTimeStamp()

le_result_t le_sms_GetTimeStamp ( le_sms_MsgRef_t  msgRef,
char *  timestamp,
size_t  timestampSize 
)

Get the Service Center Time Stamp string.

Output parameter is updated with the Time Stamp string. If the Time Stamp string exceeds the value of 'len' parameter, a LE_OVERFLOW error code is returned and 'timestamp' is filled until 'len-1' characters and a null-character is implicitly appended at the end of 'timestamp'.

Returns
LE_NOT_PERMITTED Message is not a received message.
LE_OVERFLOW Timestamp number length exceed the maximum length.
LE_OK Function succeeded.
Note
If the caller is passing a bad pointer into this function, it is a fatal error, the function will not return.
Parameters
[in]msgRefReference to the message object.
[out]timestampMessage time stamp (in text mode). string format: "yy/MM/dd,hh:mm:ss+/-zz" (Year/Month/Day,Hour:Min:Seconds+/-TimeZone) The time zone indicates the difference, expressed in quarters of an hours between the local time and GMT.
[in]timestampSize

◆ le_sms_GetTpDt()

le_result_t le_sms_GetTpDt ( le_sms_MsgRef_t  msgRef,
char *  dt,
size_t  dtSize 
)

Get TP-Discharge-Time of SMS Status Report. TP-Discharge-Time is defined in 3GPP TS 23.040 section 9.2.3.13.

Returns
  • LE_OK Function succeeded.
  • LE_BAD_PARAMETER A parameter is invalid.
  • LE_OVERFLOW The Discharge Time length exceeds the length of the provided buffer.
  • LE_FAULT Function failed.
Parameters
[in]msgRefReference to the message object.
[out]dt3GPP TS 23.040 TP-Discharge-Time.
[in]dtSize

◆ le_sms_GetTpMr()

le_result_t le_sms_GetTpMr ( le_sms_MsgRef_t  msgRef,
uint8_t *  tpMrPtr 
)

Get TP-Message-Reference of a message. Message type should be either a SMS Status Report or an outgoing SMS. TP-Message-Reference is defined in 3GPP TS 23.040 section 9.2.3.6.

Returns
  • LE_OK Function succeeded.
  • LE_BAD_PARAMETER Parameter is invalid.
  • LE_FAULT Function failed.
  • LE_UNAVAILABLE Outgoing SMS message is not sent.
Parameters
[in]msgRefReference to the message object.
[out]tpMrPtr3GPP TS 23.040 TP-Message-Reference.

◆ le_sms_GetTpRa()

le_result_t le_sms_GetTpRa ( le_sms_MsgRef_t  msgRef,
uint8_t *  toraPtr,
char *  ra,
size_t  raSize 
)

Get TP-Recipient-Address of SMS Status Report. TP-Recipient-Address is defined in 3GPP TS 23.040 section 9.2.3.14. TP-Recipient-Address Type-of-Address is defined in 3GPP TS 24.011 section 8.2.5.2.

Returns
  • LE_OK Function succeeded.
  • LE_BAD_PARAMETER A parameter is invalid.
  • LE_OVERFLOW The Recipient Address length exceeds the length of the provided buffer.
  • LE_FAULT Function failed.
Parameters
[in]msgRefReference to the message object.
[out]toraPtr3GPP TS 24.011 TP-Recipient-Address Type-of-Address.
[out]ra3GPP TS 23.040 TP-Recipient-Address.
[in]raSize

◆ le_sms_GetTpScTs()

le_result_t le_sms_GetTpScTs ( le_sms_MsgRef_t  msgRef,
char *  scts,
size_t  sctsSize 
)

Get TP-Service-Centre-Time-Stamp of SMS Status Report. TP-Service-Centre-Time-Stamp is defined in 3GPP TS 23.040 section 9.2.3.11.

Returns
  • LE_OK Function succeeded.
  • LE_BAD_PARAMETER A parameter is invalid.
  • LE_OVERFLOW The SC Timestamp length exceeds the length of the provided buffer.
  • LE_FAULT Function failed.
Parameters
[in]msgRefReference to the message object.
[out]scts3GPP TS 23.040 TP-Service-Centre-Time-Stamp.
[in]sctsSize

◆ le_sms_GetTpSt()

le_result_t le_sms_GetTpSt ( le_sms_MsgRef_t  msgRef,
uint8_t *  stPtr 
)

Get TP-Status of SMS Status Report. TP-Status is defined in 3GPP TS 23.040 section 9.2.3.15.

Returns
  • LE_OK Function succeeded.
  • LE_BAD_PARAMETER A parameter is invalid.
  • LE_FAULT Function failed.
Parameters
[in]msgRefReference to the message object.
[out]stPtr3GPP TS 23.040 TP-Status.

◆ le_sms_GetType()

le_sms_Type_t le_sms_GetType ( le_sms_MsgRef_t  msgRef)

Get the message type.

Returns
Message type.
Note
If the caller is passing a bad pointer into this function, it is a fatal error, the function will not return.
Parameters
[in]msgRefReference to the message object.

◆ le_sms_GetUCS2()

le_result_t le_sms_GetUCS2 ( le_sms_MsgRef_t  msgRef,
uint16_t *  ucs2Ptr,
size_t *  ucs2SizePtr 
)

Get the UCS2 Message (16-bit format).

Output parameters are updated with the UCS2 message content and the number of characters. If the UCS2 data exceed the value of the length input parameter, a LE_OVERFLOW error code is returned and 'ucs2Ptr' is filled until of the number of chars specified.

Returns
  • LE_FORMAT_ERROR Message is not in binary format
  • LE_OVERFLOW Message length exceed the maximum length.
  • LE_OK Function succeeded.
Parameters
[in]msgRefReference to the message object.
[out]ucs2PtrUCS2 message.
[in,out]ucs2SizePtr

◆ le_sms_GetUserdataLen()

size_t le_sms_GetUserdataLen ( le_sms_MsgRef_t  msgRef)

Get the message Length value.

Returns
Number of characters for text and UCS2 messages, or the length of the data in bytes for raw binary messages.
Note
If the caller is passing a bad pointer into this function, it is a fatal error, the function will not return.
Parameters
[in]msgRefReference to the message object.

◆ le_sms_IsStatusReportEnabled()

le_result_t le_sms_IsStatusReportEnabled ( bool *  enabledPtr)

Get SMS Status Report activation state.

Returns
  • LE_OK Function succeeded.
  • LE_BAD_PARAMETER Parameter is invalid.
  • LE_FAULT Function failed.
Parameters
[out]enabledPtrTrue when SMS Status Report is enabled, false otherwise.

◆ le_sms_MarkRead()

void le_sms_MarkRead ( le_sms_MsgRef_t  msgRef)

Mark a message as 'read'.

Note
If the caller is passing a bad pointer into this function, it is a fatal error, the function will not return.
Parameters
[in]msgRefMessages list.

◆ le_sms_MarkUnread()

void le_sms_MarkUnread ( le_sms_MsgRef_t  msgRef)

Mark a message as 'unread'.

Note
If the caller is passing a bad pointer into this function, it is a fatal error, the function will not return.
Parameters
[in]msgRefMessages list.

◆ le_sms_RemoveCdmaCellBroadcastServices()

le_result_t le_sms_RemoveCdmaCellBroadcastServices ( le_sms_CdmaServiceCat_t  serviceCat,
le_sms_Languages_t  language 
)

Remove CDMA Cell Broadcast category services.

Returns
  • LE_FAULT Function failed.
  • LE_BAD_PARAMETER Parameter is invalid.
  • LE_OK Function succeeded.
Parameters
[in]serviceCatService category assignment. Reference to 3GPP2 C.R1001-D v1.0 Section 9.3.1 Standard Service Category Assignments.
[in]languageLanguage Indicator. Reference to 3GPP2 C.R1001-D v1.0 Section 9.2.1 Language Indicator Value Assignments

◆ le_sms_RemoveCellBroadcastIds()

le_result_t le_sms_RemoveCellBroadcastIds ( uint16_t  fromId,
uint16_t  toId 
)

Remove Cell Broadcast message Identifiers range.

Returns
  • LE_FAULT Function failed.
  • LE_OK Function succeeded.
Parameters
[in]fromIdStarting point of the range of cell broadcast message identifier.
[in]toIdEnding point of the range of cell broadcast message identifier.

◆ le_sms_RemoveFullStorageEventHandler()

void le_sms_RemoveFullStorageEventHandler ( le_sms_FullStorageEventHandlerRef_t  handlerRef)

Remove handler function for EVENT 'le_sms_FullStorageEvent'

Parameters
[in]handlerRef

◆ le_sms_RemoveRxMessageHandler()

void le_sms_RemoveRxMessageHandler ( le_sms_RxMessageHandlerRef_t  handlerRef)

Remove handler function for EVENT 'le_sms_RxMessage'

Parameters
[in]handlerRef

◆ le_sms_ResetCount()

void le_sms_ResetCount ( void  )

Reset the count of messages successfully received and sent.

◆ le_sms_Send()

le_result_t le_sms_Send ( le_sms_MsgRef_t  msgRef)

Send an SMS message.

Verifies first if the parameters are valid, then it checks the modem state can support message sending.

Returns
LE_FORMAT_ERROR Message content is invalid.
LE_FAULT Function failed to send the message.
LE_OK Function succeeded.
LE_TIMEOUT Timeout before the complete sending.
Note
If the caller is passing a bad pointer into this function, it is a fatal error, the function will not return.
Parameters
[in]msgRefReference to the message object.

◆ le_sms_SendAsync()

le_result_t le_sms_SendAsync ( le_sms_MsgRef_t  msgRef,
le_sms_CallbackResultFunc_t  handlerPtr,
void *  contextPtr 
)

Send an asynchronous SMS message.

Verifies first if the parameters are valid, then it checks the modem state can support message sending.

Returns
LE_FORMAT_ERROR Message content is invalid.
LE_FAULT Function failed to send the message.
LE_OK Function succeeded.
LE_TIMEOUT Timeout before the complete sending.
Note
If the caller is passing a bad pointer into this function, it is a fatal error, the function will not return.
Parameters
[in]msgRefReference to the message object.
[in]handlerPtrCallBack for sending result.
[in]contextPtr

◆ le_sms_SendPdu()

le_sms_MsgRef_t le_sms_SendPdu ( const uint8_t *  pduPtr,
size_t  pduSize,
le_sms_CallbackResultFunc_t  handlerPtr,
void *  contextPtr 
)

Create and asynchronously send a PDU message.

Returns
  • le_sms_Msg Reference to the new Message object pooled.
  • NULL Not possible to pool a new message.
Parameters
[in]pduPtrPDU message.
[in]pduSize
[in]handlerPtrCallBack for sending result.
[in]contextPtr

◆ le_sms_SendText()

le_sms_MsgRef_t le_sms_SendText ( const char *LE_NONNULL  destStr,
const char *LE_NONNULL  textStr,
le_sms_CallbackResultFunc_t  handlerPtr,
void *  contextPtr 
)

Create and asynchronously send a text message.

Returns
  • le_sms_Msg Reference to the new Message object pooled.
  • NULL Not possible to pool a new message.
Note
If telephone destination number is too long is too long (max LE_MDMDEFS_PHONE_NUM_MAX_LEN digits), it is a fatal error, the function will not return.
If message is too long (max LE_SMS_TEXT_MAX_LEN digits), it is a fatal error, the function will not return.
Parameters
[in]destStrTelephone number string.
[in]textStrSMS text.
[in]handlerPtrCallBack for sending result.
[in]contextPtr

◆ le_sms_SetBinary()

le_result_t le_sms_SetBinary ( le_sms_MsgRef_t  msgRef,
const uint8_t *  binPtr,
size_t  binSize 
)

Set the binary message content.

Returns
LE_NOT_PERMITTED Message is Read-Only.
LE_BAD_PARAMETER Length of the data is equal to zero.
LE_OK Function succeeded.
Note
If length of the data is too long (max LE_SMS_BINARY_MAX_BYTES bytes), it is a fatal error, the function will not return.
If the caller is passing a bad pointer into this function, it is a fatal error, the function will not return.
Parameters
[in]msgRefReference to the message object.
[in]binPtrBinary data.
[in]binSize

◆ le_sms_SetDestination()

le_result_t le_sms_SetDestination ( le_sms_MsgRef_t  msgRef,
const char *LE_NONNULL  dest 
)

Set the Telephone destination number.

Telephone number is defined in ITU-T recommendations E.164/E.163. E.164 numbers can have a maximum of fifteen digits and are usually written with a '+' prefix.

Returns
LE_NOT_PERMITTED Message is Read-Only.
LE_BAD_PARAMETER Telephone destination number length is equal to zero.
LE_OK Function succeeded.
Note
If telephone destination number is too long is too long (max LE_MDMDEFS_PHONE_NUM_MAX_LEN digits), it is a fatal error, the function will not return.
If the caller is passing a bad pointer into this function, it is a fatal error, the function will not return.
Parameters
[in]msgRefReference to the message object.
[in]destTelephone number string.

◆ le_sms_SetPDU()

le_result_t le_sms_SetPDU ( le_sms_MsgRef_t  msgRef,
const uint8_t *  pduPtr,
size_t  pduSize 
)

Set the PDU message content.

Returns
LE_NOT_PERMITTED Message is Read-Only.
LE_BAD_PARAMETER Length of the data is equal to zero.
LE_OK Function succeeded.
Note
If length of the data is too long (max LE_SMS_PDU_MAX_BYTES bytes), it is a fatal error, the function will not return.
If the caller is passing a bad pointer into this function, it is a fatal error, the function will not return.
Parameters
[in]msgRefReference to the message object.
[in]pduPtrPDU message.
[in]pduSize

◆ le_sms_SetPreferredStorage()

le_result_t le_sms_SetPreferredStorage ( le_sms_Storage_t  prefStorage)

Set the preferred SMS storage for incoming messages.

Returns
  • LE_FAULT Function failed.
  • LE_OK Function succeeded.
Parameters
[in]prefStoragestorage parameter.

◆ le_sms_SetServerDisconnectHandler()

LE_FULL_API void le_sms_SetServerDisconnectHandler ( le_sms_DisconnectHandler_t  disconnectHandler,
void *  contextPtr 
)

Set handler called when server disconnection is detected.

When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants to continue without exiting, it should call longjmp() from inside the handler.

◆ le_sms_SetSmsCenterAddress()

le_result_t le_sms_SetSmsCenterAddress ( const char *LE_NONNULL  tel)

Set the SMS center address.

SMS center address number is defined in ITU-T recommendations E.164/E.163. E.164 numbers can have a maximum of fifteen digits and are usually written with a '+' prefix.

Returns
  • LE_FAULT Service is not available..
  • LE_OK Function succeeded.
Note
If the SMS center address number is too long (max LE_MDMDEFS_PHONE_NUM_MAX_LEN digits), it is a fatal error, the function will not return.
Parameters
[in]telSMS center address number string.

◆ le_sms_SetText()

le_result_t le_sms_SetText ( le_sms_MsgRef_t  msgRef,
const char *LE_NONNULL  text 
)

This function must be called to set the Text Message content.

Returns
LE_NOT_PERMITTED Message is Read-Only.
LE_BAD_PARAMETER Text message length is equal to zero.
LE_OK Function succeeded.
Note
Text Message is encoded in ASCII format (ISO8859-15) and characters have to exist in the GSM 23.038 7 bit alphabet.
If message is too long (max LE_SMS_TEXT_MAX_LEN digits), it is a fatal error, the function will not return.
If the caller is passing a bad pointer into this function, it is a fatal error, the function will not return.
Parameters
[in]msgRefReference to the message object.
[in]textSMS text.

◆ le_sms_SetTimeout()

le_result_t le_sms_SetTimeout ( le_sms_MsgRef_t  msgRef,
uint32_t  timeout 
)

Set the timeout to send a SMS Message.

Returns
  • LE_FAULT Message is not in UNSENT state or is Read-Only.
  • LE_OK Function succeeded.
Note
On failure, the process exits, so you don't have to worry about checking the returned reference for validity.
Deprecated:
This API should not be used for new applications and will be removed in a future version of Legato.
Parameters
[in]msgRefReference to the message object.
[in]timeoutTimeout in seconds.

◆ le_sms_SetUCS2()

le_result_t le_sms_SetUCS2 ( le_sms_MsgRef_t  msgRef,
const uint16_t *  ucs2Ptr,
size_t  ucs2Size 
)

Set the UCS2 message content (16-bit format).

Returns
  • LE_NOT_PERMITTED Message is Read-Only.
  • LE_BAD_PARAMETER Length of the data is equal to zero.
  • LE_OK Function succeeded.
Note
If length of the data is too long (max LE_SMS_UCS2_MAX_CHARS), it is a fatal error, the function will not return.
If the caller is passing a bad pointer into this function, it is a fatal error, the function will not return.
Parameters
[in]msgRefReference to the message object.
[in]ucs2PtrUCS2 message.
[in]ucs2Size

◆ le_sms_StartCount()

void le_sms_StartCount ( void  )

Start to count the messages successfully received and sent.

◆ le_sms_StopCount()

void le_sms_StopCount ( void  )

Stop to count the messages successfully received and sent.

◆ le_sms_TryConnectService()

le_result_t le_sms_TryConnectService ( void  )

Try to connect the current client thread to the service providing this API. Return with an error if the service is not available.

For each thread that wants to use this API, either ConnectService or TryConnectService must be called before any other functions in this API. Normally, ConnectService is automatically called for the main thread, but not for any other thread. For details, see Client-specific Functions.

This function is created automatically.

Returns
  • LE_OK if the client connected successfully to the service.
  • LE_UNAVAILABLE if the server is not currently offering the service to which the client is bound.
  • LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).
  • LE_COMM_ERROR if the Service Directory cannot be reached.