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

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)
 

Functions

void le_smsInbox1_ConnectService (void)
 
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 addHandlerRef)
 
void le_smsInbox1_DeleteMsg (uint32_t msgId)
 
le_result_t le_smsInbox1_GetImsi (uint32_t msgId, char *imsi, size_t imsiNumElements)
 
le_sms_Format_t le_smsInbox1_GetFormat (uint32_t msgId)
 
le_result_t le_smsInbox1_GetSenderTel (uint32_t msgId, char *tel, size_t telNumElements)
 
le_result_t le_smsInbox1_GetTimeStamp (uint32_t msgId, char *timestamp, size_t timestampNumElements)
 
size_t le_smsInbox1_GetMsgLen (uint32_t msgId)
 
le_result_t le_smsInbox1_GetText (uint32_t msgId, char *text, size_t textNumElements)
 
le_result_t le_smsInbox1_GetBinary (uint32_t msgId, uint8_t *binPtr, size_t *binNumElementsPtr)
 
le_result_t le_smsInbox1_GetPdu (uint32_t msgId, uint8_t *pduPtr, size_t *pduNumElementsPtr)
 
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)
 

Detailed Description

Legato SMS Inbox Service include file.

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

Macro Definition Documentation

#define LE_SMSINBOX1_FORMAT_UNKNOWN   -1

Define unknown format

#define LE_SMSINBOX1_MAX_MBOX_NAME_LEN   12

Define the name of length of the message box name

Typedef Documentation

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

Handler for New Message.

Parameters
msgIdMessage identifier.
contextPtr
typedef struct le_smsInbox1_RxMessageHandler* le_smsInbox1_RxMessageHandlerRef_t

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

typedef struct le_smsInbox1_Session* le_smsInbox1_SessionRef_t

Reference type for referring to open message box sessions.

Function Documentation

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
void le_smsInbox1_Close ( le_smsInbox1_SessionRef_t  sessionRef)

Close a previously open message box.

Parameters
[in]sessionRefMailbox session reference.
void le_smsInbox1_ConnectService ( void  )

Connect the client to the service

void le_smsInbox1_DeleteMsg ( uint32_t  msgId)

Delete a Message.

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

Disconnect the client from the service

le_result_t le_smsInbox1_GetBinary ( uint32_t  msgId,
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]msgIdMessage identifier.
[out]binPtrBinary message.
[in,out]binNumElementsPtr
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_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_result_t le_smsInbox1_GetImsi ( uint32_t  msgId,
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]msgIdMessage identifier.
[out]imsiIMSI.
[in]imsiNumElements
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.
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_result_t le_smsInbox1_GetPdu ( uint32_t  msgId,
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]msgIdMessage identifier.
[out]pduPtrPDU message.
[in,out]pduNumElementsPtr
le_result_t le_smsInbox1_GetSenderTel ( uint32_t  msgId,
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]msgIdMessage identifier.
[out]telIdentifier string.
[in]telNumElements
le_result_t le_smsInbox1_GetText ( uint32_t  msgId,
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]msgIdMessage identifier.
[out]textMessage text.
[in]textNumElements
le_result_t le_smsInbox1_GetTimeStamp ( uint32_t  msgId,
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]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]timestampNumElements
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.
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.
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_SessionRef_t le_smsInbox1_Open ( void  )

Open a message box.

Returns
Reference on the opened message box session
void le_smsInbox1_RemoveRxMessageHandler ( le_smsInbox1_RxMessageHandlerRef_t  addHandlerRef)

Remove handler function for EVENT 'le_smsInbox1_RxMessage'

Parameters
[in]addHandlerRef