All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
le_smsInbox_interface.h File Reference
#include "legato.h"
#include "le_mdmDefs_interface.h"
#include "le_sim_interface.h"
#include "le_sms_interface.h"

Go to the source code of this file.

Typedefs

typedef struct le_smsInbox_Msg * le_smsInbox_MsgRef_t
 
typedef struct
le_smsInbox_RxMessageHandler * 
le_smsInbox_RxMessageHandlerRef_t
 
typedef void(* le_smsInbox_RxMessageHandlerFunc_t )(le_smsInbox_MsgRef_t msgRef, void *contextPtr)
 

Functions

void le_smsInbox_ConnectService (void)
 
void le_smsInbox_DisconnectService (void)
 
le_smsInbox_RxMessageHandlerRef_t le_smsInbox_AddRxMessageHandler (le_smsInbox_InboxMessageHandlerFunc_t handlerPtr, void *contextPtr)
 
void le_smsInbox_RemoveRxMessageHandler (le_smsInbox_RxMessageHandlerRef_t addHandlerRef)
 
void le_smsInbox_DeleteMsg (le_smsInbox_MsgRef_t msgRef)
 
le_result_t le_smsInbox_GetImsi (le_smsInbox_MsgRef_t msgRef, char *imsi, size_t imsiNumElements)
 
le_sms_Format_t le_smsInbox_GetFormat (le_smsInbox_MsgRef_t msgRef)
 
le_result_t le_smsInbox_GetSenderTel (le_smsInbox_MsgRef_t msgRef, char *tel, size_t telNumElements)
 
le_result_t le_smsInbox_GetTimeStamp (le_smsInbox_MsgRef_t msgRef, char *timestamp, size_t timestampNumElements)
 
size_t le_smsInbox_GetMsgLen (le_smsInbox_MsgRef_t msgRef)
 
le_result_t le_smsInbox_GetText (le_smsInbox_MsgRef_t msgRef, char *text, size_t textNumElements)
 
le_result_t le_smsInbox_GetBinary (le_smsInbox_MsgRef_t msgRef, uint8_t *binPtr, size_t *binNumElementsPtr)
 
le_result_t le_smsInbox_GetPdu (le_smsInbox_MsgRef_t msgRef, uint8_t *pduPtr, size_t *pduNumElementsPtr)
 
le_smsInbox_MsgRef_t le_smsInbox_GetFirst (void)
 
le_smsInbox_MsgRef_t le_smsInbox_GetNext (le_smsInbox_MsgRef_t msgRef)
 
bool le_smsInbox_IsUnread (le_smsInbox_MsgRef_t msgRef)
 
void le_smsInbox_MarkRead (le_smsInbox_MsgRef_t msgRef)
 
void le_smsInbox_MarkUnread (le_smsInbox_MsgRef_t msgRef)
 

Detailed Description

Legato SMS Inbox Service include file.

Copyright (C) Sierra Wireless Inc. Use of this work is subject to license.

Typedef Documentation

typedef struct le_smsInbox_Msg* le_smsInbox_MsgRef_t

Declare a reference type for referring to Message objects.

typedef void(* le_smsInbox_RxMessageHandlerFunc_t)(le_smsInbox_MsgRef_t msgRef, void *contextPtr)

Handler for New Message.

Parameters
msgRefMessage reference.
contextPtr
typedef struct le_smsInbox_RxMessageHandler* le_smsInbox_RxMessageHandlerRef_t

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

Function Documentation

le_smsInbox_RxMessageHandlerRef_t le_smsInbox_AddRxMessageHandler ( le_smsInbox_InboxMessageHandlerFunc_t  handlerPtr,
void *  contextPtr 
)

Add handler function for EVENT 'le_smsInbox_RxMessage'

This event provides information on new received messages.

Parameters
[in]handlerPtr
[in]contextPtr
void le_smsInbox_ConnectService ( void  )

Connect the client to the service

void le_smsInbox_DeleteMsg ( le_smsInbox_MsgRef_t  msgRef)

Delete a Message.

Note
It is valid to delete a non-existent message.
Parameters
[in]msgRefMessage reference.
void le_smsInbox_DisconnectService ( void  )

Disconnect the client from the service

le_result_t le_smsInbox_GetBinary ( le_smsInbox_MsgRef_t  msgRef,
uint8_t *  binPtr,
size_t *  binNumElementsPtr 
)

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]msgRefMessage reference.
[out]binPtrBinary message.
[in,out]binNumElementsPtr
le_smsInbox_MsgRef_t le_smsInbox_GetFirst ( void  )

Get the first Message object reference in the inbox message.

Returns
  • NULL No message found.
  • Msg Message object reference.
le_sms_Format_t le_smsInbox_GetFormat ( le_smsInbox_MsgRef_t  msgRef)

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.
Parameters
[in]msgRefMessage reference.
le_result_t le_smsInbox_GetImsi ( le_smsInbox_MsgRef_t  msgRef,
char *  imsi,
size_t  imsiNumElements 
)

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]msgRefMessage reference.
[out]imsiIMSI
[in]imsiNumElements
size_t le_smsInbox_GetMsgLen ( le_smsInbox_MsgRef_t  msgRef)

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]msgRefMessage reference.
le_smsInbox_MsgRef_t le_smsInbox_GetNext ( le_smsInbox_MsgRef_t  msgRef)

Get the next Message object reference in the inbox message.

Returns
  • NULL No message found.
  • Msg Message object reference.
Parameters
[in]msgRefCurrent message reference.
le_result_t le_smsInbox_GetPdu ( le_smsInbox_MsgRef_t  msgRef,
uint8_t *  pduPtr,
size_t *  pduNumElementsPtr 
)

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]msgRefMessage reference.
[out]pduPtrPDU message.
[in,out]pduNumElementsPtr
le_result_t le_smsInbox_GetSenderTel ( le_smsInbox_MsgRef_t  msgRef,
char *  tel,
size_t  telNumElements 
)

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]msgRefMessage reference.
[out]telIdentifier string.
[in]telNumElements
le_result_t le_smsInbox_GetText ( le_smsInbox_MsgRef_t  msgRef,
char *  text,
size_t  textNumElements 
)

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]msgRefMessage reference.
[out]textMessage text.
[in]textNumElements
le_result_t le_smsInbox_GetTimeStamp ( le_smsInbox_MsgRef_t  msgRef,
char *  timestamp,
size_t  timestampNumElements 
)

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]msgRefMessage reference.
[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]timestampNumElements
bool le_smsInbox_IsUnread ( le_smsInbox_MsgRef_t  msgRef)

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]msgRefMessage reference.
void le_smsInbox_MarkRead ( le_smsInbox_MsgRef_t  msgRef)

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]msgRefMessage reference.
void le_smsInbox_MarkUnread ( le_smsInbox_MsgRef_t  msgRef)

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]msgRefMessage reference.
void le_smsInbox_RemoveRxMessageHandler ( le_smsInbox_RxMessageHandlerRef_t  addHandlerRef)

Remove handler function for EVENT 'le_smsInbox_RxMessage'

Parameters
[in]addHandlerRef