Go to the source code of this file.
Macros | |
#define | LE_SMS_TIMESTAMP_MAX_LEN 20 |
#define | LE_SMS_TIMESTAMP_MAX_BYTES 21 |
#define | LE_SMS_TEXT_MAX_LEN 160 |
#define | LE_SMS_TEXT_MAX_BYTES 161 |
#define | LE_SMS_BINARY_MAX_BYTES 140 |
#define | LE_SMS_PDU_MAX_PAYLOAD 140 |
#define | LE_SMS_PDU_MAX_BYTES 176 |
Typedefs | |
typedef struct le_sms_Msg * | le_sms_MsgRef_t |
typedef struct le_sms_MsgList * | le_sms_MsgListRef_t |
typedef struct le_sms_RxMessageHandler * | le_sms_RxMessageHandlerRef_t |
typedef void(* | le_sms_CallbackResultFunc_t) (le_sms_MsgRef_t msgRef, le_sms_Status_t status, void *contextPtr) |
typedef void(* | le_sms_RxMessageHandlerFunc_t) (le_sms_MsgRef_t msgRef, void *contextPtr) |
Legato SMS include file.
Copyright (C) Sierra Wireless Inc. Use of this work is subject to license.
#define LE_SMS_BINARY_MAX_BYTES 140 |
The raw binary message can be up to 140 bytes long.
#define LE_SMS_PDU_MAX_BYTES 176 |
The PDU message can be up to 36 (header) + 140 (payload) bytes long.
#define LE_SMS_PDU_MAX_PAYLOAD 140 |
The PDU payload bytes long.
#define LE_SMS_TEXT_MAX_BYTES 161 |
Test message string length (including the null-terminator).
#define LE_SMS_TEXT_MAX_LEN 160 |
The text message can be up to 160 characters long. One extra byte is added for the null character.
#define LE_SMS_TIMESTAMP_MAX_BYTES 21 |
Time stamp string length (including the null-terminator).
#define LE_SMS_TIMESTAMP_MAX_LEN 20 |
Time stamp string length. The string format is "yy/MM/dd,hh:mm:ss+/-zz" (Year/Month/Day,Hour:Min:Seconds+/-TimeZone). One extra byte is added for the null character.
typedef void(* le_sms_CallbackResultFunc_t) (le_sms_MsgRef_t msgRef, le_sms_Status_t status, void *contextPtr) |
Handler for Sending result.
msgRef | Reference to the message object. |
status | Status result. |
contextPtr |
typedef struct le_sms_MsgList* le_sms_MsgListRef_t |
Opaque type for SMS Message Listing.
typedef struct le_sms_Msg* le_sms_MsgRef_t |
Declare a reference type for referring to SMS Message objects.
typedef void(* le_sms_RxMessageHandlerFunc_t) (le_sms_MsgRef_t msgRef, void *contextPtr) |
Handler for New Message.
msgRef | Message reference. |
contextPtr |
typedef struct le_sms_RxMessageHandler* le_sms_RxMessageHandlerRef_t |
Reference type used by Add/Remove functions for EVENT 'le_sms_RxMessage'
CDMA Cell broadcast Service Categories.
3GPP2 Message Error code when the message sending has failed.
enum le_sms_ErrorCode_t |
Message Error code when the message sending has failed.
enum le_sms_Format_t |
enum le_sms_Languages_t |
CDMA Cell broadcast message languages.
enum le_sms_Status_t |
Message Status.
enum le_sms_Type_t |
le_result_t le_sms_ActivateCdmaCellBroadcast | ( | void | ) |
Activate CDMA Cell Broadcast message notification
le_result_t le_sms_ActivateCellBroadcast | ( | void | ) |
Activate Cell Broadcast message notification
le_result_t le_sms_AddCdmaCellBroadcastServices | ( | le_sms_CdmaServiceCat_t | serviceCat, |
le_sms_Languages_t | language | ||
) |
Add CDMA Cell Broadcast category services.
[in] | serviceCat | Service category assignment. Reference to 3GPP2 C.R1001-D v1.0 Section 9.3.1 Standard Service Category Assignments. |
[in] | language | Language Indicator. Reference to 3GPP2 C.R1001-D v1.0 Section 9.2.1 Language Indicator Value Assignments |
le_result_t le_sms_AddCellBroadcastIds | ( | uint16_t | fromId, |
uint16_t | toId | ||
) |
Add Cell Broadcast message Identifiers range.
[in] | fromId | Starting point of the range of cell broadcast message identifier. |
[in] | toId | Ending point of the range of cell broadcast message identifier. |
le_sms_RxMessageHandlerRef_t le_sms_AddRxMessageHandler | ( | le_sms_RxMessageHandlerFunc_t | handlerPtr, |
void * | contextPtr | ||
) |
Add handler function for EVENT 'le_sms_RxMessage'
This event provides information on new received messages.
[in] | handlerPtr | |
[in] | contextPtr |
le_result_t le_sms_ClearCdmaCellBroadcastServices | ( | void | ) |
Clear CDMA Cell Broadcast category services.
le_result_t le_sms_ClearCellBroadcastIds | ( | void | ) |
Clear Cell Broadcast message Identifiers.
void le_sms_ConnectService | ( | void | ) |
Connect the client to the service
le_sms_MsgRef_t le_sms_Create | ( | void | ) |
Create an SMS Message data structure.
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.
le_result_t le_sms_DeactivateCdmaCellBroadcast | ( | void | ) |
Deactivate CDMA Cell Broadcast message notification
le_result_t le_sms_DeactivateCellBroadcast | ( | void | ) |
Deactivate Cell Broadcast message notification
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.
[in] | msgRef | Reference to the message object. |
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.
[in] | msgRef | Reference to the message object. |
void le_sms_DeleteList | ( | le_sms_MsgListRef_t | msgListRef | ) |
Delete the list of the Messages retrieved from the message storage.
[in] | msgListRef | Messages list. |
void le_sms_DisconnectService | ( | void | ) |
Disconnect the client from the service
le_sms_ErrorCode3GPP2_t le_sms_Get3GPP2ErrorCode | ( | le_sms_MsgRef_t | msgRef | ) |
Get the error code when a 3GPP2 message sending has Failed.
[in] | msgRef | Reference to the message object. |
le_result_t le_sms_GetBinary | ( | le_sms_MsgRef_t | msgRef, |
uint8_t * | binPtr, | ||
size_t * | binNumElementsPtr | ||
) |
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.
[in] | msgRef | Reference to the message object. |
[out] | binPtr | Binary message. |
[in,out] | binNumElementsPtr |
le_result_t le_sms_GetCellBroadcastId | ( | le_sms_MsgRef_t | msgRef, |
uint16_t * | messageIdPtr | ||
) |
Get the Cell Broadcast Message Identifier.
[in] | msgRef | Reference to the message object. |
[out] | messageIdPtr | Cell Broadcast Message Identifier. |
le_result_t le_sms_GetCellBroadcastSerialNumber | ( | le_sms_MsgRef_t | msgRef, |
uint16_t * | serialNumberPtr | ||
) |
Get the Cell Broadcast Message Serial Number.
[in] | msgRef | Reference to the message object. |
[out] | serialNumberPtr | Cell Broadcast Serial Number. |
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.
[in] | msgRef | Reference to the message object. |
[out] | rpCausePtr | Radio Protocol cause code. |
[out] | tpCausePtr | Transfer Protocol cause code. |
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().
[in] | msgListRef | Messages list. |
le_sms_Format_t le_sms_GetFormat | ( | le_sms_MsgRef_t | msgRef | ) |
Get the message format.
[in] | msgRef | Reference to the message object. |
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().
[in] | msgListRef | Messages list. |
le_result_t le_sms_GetPDU | ( | le_sms_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. 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.
[in] | msgRef | Reference to the message object. |
[out] | pduPtr | PDU message. |
[in,out] | pduNumElementsPtr |
size_t le_sms_GetPDULen | ( | le_sms_MsgRef_t | msgRef | ) |
Get the message Length value.
[in] | msgRef | Reference to the message object. |
int32_t le_sms_GetPlatformSpecificErrorCode | ( | le_sms_MsgRef_t | msgRef | ) |
Called to get the platform specific error code.
[in] | msgRef | Reference to the message object. |
le_result_t le_sms_GetSenderTel | ( | le_sms_MsgRef_t | msgRef, |
char * | tel, | ||
size_t | telNumElements | ||
) |
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'.
[in] | msgRef | Reference to the message object. |
[out] | tel | Telephone number string. |
[in] | telNumElements |
le_result_t le_sms_GetSmsCenterAddress | ( | char * | tel, |
size_t | telNumElements | ||
) |
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'.
[out] | tel | SMS center address number string. |
[in] | telNumElements |
le_sms_Status_t le_sms_GetStatus | ( | le_sms_MsgRef_t | msgRef | ) |
Read the Message status (Received Read, Received Unread, Stored Sent, Stored Unsent).
[in] | msgRef | Messages list. |
le_result_t le_sms_GetText | ( | le_sms_MsgRef_t | msgRef, |
char * | text, | ||
size_t | textNumElements | ||
) |
Get the text Message.
Output parameter is updated with the text string. 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'.
[in] | msgRef | Reference to the message object. |
[out] | text | SMS text. |
[in] | textNumElements |
le_result_t le_sms_GetTimeStamp | ( | le_sms_MsgRef_t | msgRef, |
char * | timestamp, | ||
size_t | timestampNumElements | ||
) |
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'.
[in] | msgRef | Reference to the message object. |
[out] | timestamp | Message time stamp (in text mode). string format: "yy/MM/dd,hh:mm:ss+/-zz" (Year/Month/Day,Hour:Min:Seconds+/-TimeZone) |
[in] | timestampNumElements |
le_sms_Type_t le_sms_GetType | ( | le_sms_MsgRef_t | msgRef | ) |
Get the message type.
[in] | msgRef | Reference to the message object. |
size_t le_sms_GetUserdataLen | ( | le_sms_MsgRef_t | msgRef | ) |
Get the message Length value.
[in] | msgRef | Reference to the message object. |
void le_sms_MarkRead | ( | le_sms_MsgRef_t | msgRef | ) |
Mark a message as 'read'.
[in] | msgRef | Messages list. |
void le_sms_MarkUnread | ( | le_sms_MsgRef_t | msgRef | ) |
Mark a message as 'unread'.
[in] | msgRef | Messages list. |
le_result_t le_sms_RemoveCdmaCellBroadcastServices | ( | le_sms_CdmaServiceCat_t | serviceCat, |
le_sms_Languages_t | language | ||
) |
Remove CDMA Cell Broadcast category services.
[in] | serviceCat | Service category assignment. Reference to 3GPP2 C.R1001-D v1.0 Section 9.3.1 Standard Service Category Assignments. |
[in] | language | Language Indicator. Reference to 3GPP2 C.R1001-D v1.0 Section 9.2.1 Language Indicator Value Assignments |
le_result_t le_sms_RemoveCellBroadcastIds | ( | uint16_t | fromId, |
uint16_t | toId | ||
) |
Remove Cell Broadcast message Identifiers range.
[in] | fromId | Starting point of the range of cell broadcast message identifier. |
[in] | toId | Ending point of the range of cell broadcast message identifier. |
void le_sms_RemoveRxMessageHandler | ( | le_sms_RxMessageHandlerRef_t | addHandlerRef | ) |
Remove handler function for EVENT 'le_sms_RxMessage'
[in] | addHandlerRef |
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.
[in] | msgRef | Reference to the message object. |
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.
[in] | msgRef | Reference to the message object. |
[in] | handlerPtr | |
[in] | contextPtr |
le_sms_MsgRef_t le_sms_SendPdu | ( | const uint8_t * | pduPtr, |
size_t | pduNumElements, | ||
le_sms_CallbackResultFunc_t | handlerPtr, | ||
void * | contextPtr | ||
) |
Create and asynchronously send a PDU message.
[in] | pduPtr | PDU message. |
[in] | pduNumElements | |
[in] | handlerPtr | |
[in] | contextPtr |
le_sms_MsgRef_t le_sms_SendText | ( | const char * | destStr, |
const char * | textStr, | ||
le_sms_CallbackResultFunc_t | handlerPtr, | ||
void * | contextPtr | ||
) |
Create and asynchronously send a text message.
[in] | destStr | Telephone number string. |
[in] | textStr | SMS text. |
[in] | handlerPtr | |
[in] | contextPtr |
le_result_t le_sms_SetBinary | ( | le_sms_MsgRef_t | msgRef, |
const uint8_t * | binPtr, | ||
size_t | binNumElements | ||
) |
Set the binary message content.
[in] | msgRef | Reference to the message object. |
[in] | binPtr | Binary data. |
[in] | binNumElements |
le_result_t le_sms_SetDestination | ( | le_sms_MsgRef_t | msgRef, |
const char * | 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.
[in] | msgRef | Reference to the message object. |
[in] | dest | Telephone number string. |
le_result_t le_sms_SetPDU | ( | le_sms_MsgRef_t | msgRef, |
const uint8_t * | pduPtr, | ||
size_t | pduNumElements | ||
) |
Set the PDU message content.
[in] | msgRef | Reference to the message object. |
[in] | pduPtr | PDU message. |
[in] | pduNumElements |
le_result_t le_sms_SetSmsCenterAddress | ( | const char * | 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.
[in] | tel | SMS center address number string. |
le_result_t le_sms_SetText | ( | le_sms_MsgRef_t | msgRef, |
const char * | text | ||
) |
This function must be called to set the Text Message content.
[in] | msgRef | Reference to the message object. |
[in] | text | SMS text. |
le_result_t le_sms_SetTimeout | ( | le_sms_MsgRef_t | msgRef, |
uint32_t | timeout | ||
) |
Set the timeout to send a SMS Message.
[in] | msgRef | Reference to the message object. |
[in] | timeout | Timeout in seconds. |