#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) |
Detailed Description
Legato SMS Inbox 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
-
msgId Message 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] sessionRef Mailbox session reference.
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.
void le_smsInbox1_DeleteMsg | ( | uint32_t | msgId | ) |
Delete a Message.
- Note
- It is valid to delete a non-existent message.
- Parameters
-
[in] msgId Message identifier.
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_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] msgId Message identifier. [out] binPtr Binary 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] sessionRef Mailbox 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] msgId Message 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] msgId Message identifier. [out] imsi IMSI. [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] msgId Message 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] sessionRef Mailbox 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] msgId Message identifier. [out] pduPtr PDU 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] msgId Message identifier. [out] tel Identifier 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] msgId Message identifier. [out] text Message 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] msgId Message identifier. [out] timestamp Message 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] msgId Message 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] msgId Message 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] msgId Message 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
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.