le_smsInbox1 API Reference

Files

file  le_smsInbox1_common.h
 
file  le_smsInbox1_interface.h
 

Macros

#define LE_SMSINBOX1_FORMAT_UNKNOWN   -1
 
#define LE_SMSINBOX1_MAX_MBOX_NAME_LEN   12
 

Typedefs

typedef struct le_smsInbox1_Session * le_smsInbox1_SessionRef_t
 
typedef struct le_smsInbox1_RxMessageHandler * le_smsInbox1_RxMessageHandlerRef_t
 
typedef void(* le_smsInbox1_RxMessageHandlerFunc_t) (uint32_t msgId, void *contextPtr)
 
typedef void(* le_smsInbox1_DisconnectHandler_t) (void *)
 

Functions

void le_smsInbox1_ConnectService (void)
 
le_result_t le_smsInbox1_TryConnectService (void)
 
LE_FULL_API void le_smsInbox1_SetServerDisconnectHandler (le_smsInbox1_DisconnectHandler_t disconnectHandler, void *contextPtr)
 
void le_smsInbox1_DisconnectService (void)
 
le_smsInbox1_SessionRef_t le_smsInbox1_Open (void)
 
void le_smsInbox1_Close (le_smsInbox1_SessionRef_t sessionRef)
 
le_smsInbox1_RxMessageHandlerRef_t le_smsInbox1_AddRxMessageHandler (le_smsInbox1_RxMessageHandlerFunc_t handlerPtr, void *contextPtr)
 
void le_smsInbox1_RemoveRxMessageHandler (le_smsInbox1_RxMessageHandlerRef_t handlerRef)
 
void le_smsInbox1_DeleteMsg (uint32_t msgId)
 
le_result_t le_smsInbox1_GetImsi (uint32_t msgId, char *imsi, size_t imsiSize)
 
le_sms_Format_t le_smsInbox1_GetFormat (uint32_t msgId)
 
le_result_t le_smsInbox1_GetSenderTel (uint32_t msgId, char *tel, size_t telSize)
 
le_result_t le_smsInbox1_GetTimeStamp (uint32_t msgId, char *timestamp, size_t timestampSize)
 
size_t le_smsInbox1_GetMsgLen (uint32_t msgId)
 
le_result_t le_smsInbox1_GetText (uint32_t msgId, char *text, size_t textSize)
 
le_result_t le_smsInbox1_GetBinary (uint32_t msgId, uint8_t *binPtr, size_t *binSizePtr)
 
le_result_t le_smsInbox1_GetPdu (uint32_t msgId, uint8_t *pduPtr, size_t *pduSizePtr)
 
uint32_t le_smsInbox1_GetFirst (le_smsInbox1_SessionRef_t sessionRef)
 
uint32_t le_smsInbox1_GetNext (le_smsInbox1_SessionRef_t sessionRef)
 
bool le_smsInbox1_IsUnread (uint32_t msgId)
 
void le_smsInbox1_MarkRead (uint32_t msgId)
 
void le_smsInbox1_MarkUnread (uint32_t msgId)
 
le_result_t le_smsInbox1_SetMaxMessages (uint32_t maxMessageCount)
 
le_result_t le_smsInbox1_GetMaxMessages (uint32_t *maxMessageCountPtrPtr)
 

Detailed Description

Macro Definition Documentation

◆ LE_SMSINBOX1_FORMAT_UNKNOWN

#define LE_SMSINBOX1_FORMAT_UNKNOWN   -1

Define unknown format

◆ LE_SMSINBOX1_MAX_MBOX_NAME_LEN

#define LE_SMSINBOX1_MAX_MBOX_NAME_LEN   12

Define the name of length of the message box name

Typedef Documentation

◆ le_smsInbox1_DisconnectHandler_t

typedef void(* le_smsInbox1_DisconnectHandler_t) (void *)

Type for handler called when a server disconnects.

◆ le_smsInbox1_RxMessageHandlerFunc_t

typedef void(* le_smsInbox1_RxMessageHandlerFunc_t) (uint32_t msgId, void *contextPtr)

Handler for New Message.

◆ le_smsInbox1_RxMessageHandlerRef_t

typedef struct le_smsInbox1_RxMessageHandler* le_smsInbox1_RxMessageHandlerRef_t

Reference type used by Add/Remove functions for EVENT 'le_smsInbox1_RxMessage'

◆ le_smsInbox1_SessionRef_t

typedef struct le_smsInbox1_Session* le_smsInbox1_SessionRef_t

Reference type for referring to open message box sessions.

Function Documentation

◆ le_smsInbox1_AddRxMessageHandler()

le_smsInbox1_RxMessageHandlerRef_t le_smsInbox1_AddRxMessageHandler ( le_smsInbox1_RxMessageHandlerFunc_t  handlerPtr,
void *  contextPtr 
)

Add handler function for EVENT 'le_smsInbox1_RxMessage'

This event provides information on new received messages.

Parameters
[in]handlerPtr
[in]contextPtr

◆ le_smsInbox1_Close()

void le_smsInbox1_Close ( le_smsInbox1_SessionRef_t  sessionRef)

Close a previously open message box.

Parameters
[in]sessionRefMailbox session reference.

◆ le_smsInbox1_ConnectService()

void le_smsInbox1_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_smsInbox1_DeleteMsg()

void le_smsInbox1_DeleteMsg ( uint32_t  msgId)

Delete a Message.

Note
It is valid to delete a non-existent message.
Parameters
[in]msgIdMessage identifier.

◆ le_smsInbox1_DisconnectService()

void le_smsInbox1_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_smsInbox1_GetBinary()

le_result_t le_smsInbox1_GetBinary ( uint32_t  msgId,
uint8_t *  binPtr,
size_t *  binSizePtr 
)

Get the binary Message.

Returns
  • LE_BAD_PARAMETER The message reference is invalid.
  • LE_FORMAT_ERROR Message is not in binary format.
  • LE_OVERFLOW Message length exceed the maximum length.
  • LE_OK Function succeeded.
Parameters
[in]msgIdMessage identifier.
[out]binPtrBinary message.
[in,out]binSizePtr

◆ le_smsInbox1_GetFirst()

uint32_t le_smsInbox1_GetFirst ( le_smsInbox1_SessionRef_t  sessionRef)

Get the first Message object reference in the inbox message.

Returns
  • 0 No message found (message box parsing is over).
  • Message identifier.
Parameters
[in]sessionRefMailbox session reference.

◆ le_smsInbox1_GetFormat()

le_sms_Format_t le_smsInbox1_GetFormat ( uint32_t  msgId)

Get the message format (text, binary or PDU).

Returns
  • Message format.
  • FORMAT_UNKNOWN when the message format cannot be identified or the message reference is invalid.
Note
For incoming SMS Inbox, format returned by le_smsInbox1_GetFormat() is never LE_SMSINBOX1_FORMAT_PDU.
Parameters
[in]msgIdMessage identifier.

◆ le_smsInbox1_GetImsi()

le_result_t le_smsInbox1_GetImsi ( uint32_t  msgId,
char *  imsi,
size_t  imsiSize 
)

Retrieves the IMSI of the message receiver SIM if it applies.

Returns
  • LE_NOT_FOUND The message item is not tied to a SIM card, the imsi string is empty.
  • LE_OVERFLOW The imsiPtr buffer was too small for the IMSI.
  • LE_BAD_PARAMETER The message reference is invalid.
  • LE_FAULT The function failed.
  • LE_OK The function succeeded.
Parameters
[in]msgIdMessage identifier.
[out]imsiIMSI.
[in]imsiSize

◆ le_smsInbox1_GetMaxMessages()

le_result_t le_smsInbox1_GetMaxMessages ( uint32_t *  maxMessageCountPtrPtr)

Get the maximum number of messages for message box.

Returns
  • LE_BAD_PARAMETER The message box name is invalid.
  • LE_OK Function succeeded.
  • LE_FAULT Function failed.
Parameters
[out]maxMessageCountPtrPtrMaximum number of messages

◆ le_smsInbox1_GetMsgLen()

size_t le_smsInbox1_GetMsgLen ( uint32_t  msgId)

Get the message Length value.

Returns
Number of characters for text messages, or the length of the data in bytes for raw binary and PDU messages.
Parameters
[in]msgIdMessage identifier.

◆ le_smsInbox1_GetNext()

uint32_t le_smsInbox1_GetNext ( le_smsInbox1_SessionRef_t  sessionRef)

Get the next Message object reference in the inbox message.

Returns
  • 0 No message found (message box parsing is over).
  • Message identifier.
Parameters
[in]sessionRefMailbox session reference.

◆ le_smsInbox1_GetPdu()

le_result_t le_smsInbox1_GetPdu ( uint32_t  msgId,
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.

Returns
  • LE_BAD_PARAMETER The message reference is invalid.
  • LE_FORMAT_ERROR Unable to encode the message in PDU.
  • LE_OVERFLOW Message length exceed the maximum length.
  • LE_OK Function succeeded.
Parameters
[in]msgIdMessage identifier.
[out]pduPtrPDU message.
[in,out]pduSizePtr

◆ le_smsInbox1_GetSenderTel()

le_result_t le_smsInbox1_GetSenderTel ( uint32_t  msgId,
char *  tel,
size_t  telSize 
)

Get the Sender Identifier.

Returns
  • LE_BAD_PARAMETER The message reference is invalid.
  • LE_OVERFLOW Identifier length exceed the maximum length.
  • LE_OK Function succeeded.
Parameters
[in]msgIdMessage identifier.
[out]telIdentifier string.
[in]telSize

◆ le_smsInbox1_GetText()

le_result_t le_smsInbox1_GetText ( uint32_t  msgId,
char *  text,
size_t  textSize 
)

Get the text Message.

Returns
  • LE_BAD_PARAMETER The message reference is invalid.
  • LE_FORMAT_ERROR Message is not in text format.
  • LE_OVERFLOW Message length exceed the maximum length.
  • LE_OK Function succeeded.
Parameters
[in]msgIdMessage identifier.
[out]textMessage text.
[in]textSize

◆ le_smsInbox1_GetTimeStamp()

le_result_t le_smsInbox1_GetTimeStamp ( uint32_t  msgId,
char *  timestamp,
size_t  timestampSize 
)

Get the Message Time Stamp string (it does not apply for PDU message).

Returns
  • LE_BAD_PARAMETER The message reference is invalid.
  • LE_NOT_FOUND The message is a PDU message.
  • LE_OVERFLOW Timestamp number length exceed the maximum length.
  • LE_OK Function succeeded.
Parameters
[in]msgIdMessage identifier.
[out]timestampMessage time stamp (for text or binary messages). String format: "yy/MM/dd,hh:mm:ss+/-zz" (Year/Month/Day,Hour:Min:Seconds+/-TimeZone)
[in]timestampSize

◆ le_smsInbox1_IsUnread()

bool le_smsInbox1_IsUnread ( uint32_t  msgId)

allow to know whether the message has been read or not. The message status is tied to the client app.

Returns
True if the message is unread, false otherwise.
Note
If the caller is passing a bad message reference into this function, it is a fatal error, the function will not return.
Parameters
[in]msgIdMessage identifier.

◆ le_smsInbox1_MarkRead()

void le_smsInbox1_MarkRead ( uint32_t  msgId)

Mark a message as 'read'.

Note
If the caller is passing a bad message reference into this function, it is a fatal error, the function will not return.
Parameters
[in]msgIdMessage identifier.

◆ le_smsInbox1_MarkUnread()

void le_smsInbox1_MarkUnread ( uint32_t  msgId)

Mark a message as 'unread'.

Note
If the caller is passing a bad message reference into this function, it is a fatal error, the function will not return.
Parameters
[in]msgIdMessage identifier.

◆ le_smsInbox1_Open()

le_smsInbox1_SessionRef_t le_smsInbox1_Open ( void  )

Reference type for referring to open message box sessions. Handler for New Message. Reference type used by Add/Remove functions for EVENT 'le_smsInbox1_RxMessage' Open a message box.

Returns
Reference on the opened message box session

◆ le_smsInbox1_RemoveRxMessageHandler()

void le_smsInbox1_RemoveRxMessageHandler ( le_smsInbox1_RxMessageHandlerRef_t  handlerRef)

Remove handler function for EVENT 'le_smsInbox1_RxMessage'

Parameters
[in]handlerRef

◆ le_smsInbox1_SetMaxMessages()

le_result_t le_smsInbox1_SetMaxMessages ( uint32_t  maxMessageCount)

Set the maximum number of messages for message box.

Returns
  • LE_BAD_PARAMETER The message box name is invalid.
  • LE_OVERFLOW Message count exceed the maximum limit.
  • LE_OK Function succeeded.
  • LE_FAULT Function failed.
Parameters
[in]maxMessageCountMaximum number of messages

◆ le_smsInbox1_SetServerDisconnectHandler()

LE_FULL_API void le_smsInbox1_SetServerDisconnectHandler ( le_smsInbox1_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_smsInbox1_TryConnectService()

le_result_t le_smsInbox1_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.