Snapdragon® Telematics Application Framework (TelAF) Interface Specification
taf_sms_client.c File Reference
#include "taf_sms_interface.h"
#include "taf_sms_messages.h"
#include "taf_sms_service.h"

Data Structures

struct  _ClientThreadData_t
 

Macros

#define LOCK_INIT   le_mutex_Lock(le_ifgen_InitMutexRef);
 Locks the mutex. More...
 
#define UNLOCK_INIT   le_mutex_Unlock(le_ifgen_InitMutexRef);
 Unlocks the mutex. More...
 

Functions

 LE_MEM_DEFINE_STATIC_POOL (taf_sms_ClientThreadData, LE_CDATA_COMPONENT_COUNT, sizeof(_ClientThreadData_t))
 
static le_result_t InitClientForThread (bool isBlocking)
 
static _ClientThreadData_tGetClientThreadDataPtr (void)
 
 __attribute__ ((unused))
 
static void ClientThreadDestructor (void *objPtr)
 
static void InitCommonData (void)
 
static le_result_t DoConnectService (bool isBlocking)
 
void taf_sms_ConnectService (void)
 
le_result_t taf_sms_TryConnectService (void)
 
static void SessionCloseHandler (le_msg_SessionRef_t sessionRef, void *contextPtr)
 
void taf_sms_SetServerDisconnectHandler (taf_sms_DisconnectHandler_t disconnectHandler, void *contextPtr)
 
static void NonExitSessionCloseHandler (le_msg_SessionRef_t sessionRef, void *contextPtr)
 
void taf_sms_SetNonExitServerDisconnectHandler (taf_sms_DisconnectHandler_t disconnectHandler, void *contextPtr)
 
void taf_sms_DisconnectService (void)
 
taf_sms_MsgListRef_t taf_sms_CreateRxMsgList (void)
 
void taf_sms_DeleteList (taf_sms_MsgListRef_t msgListRef)
 
taf_sms_RxMsgHandlerRef_t taf_sms_AddRxMsgHandler (taf_sms_RxMsgHandlerFunc_t handlerPtr, void *contextPtr)
 
void taf_sms_RemoveRxMsgHandler (taf_sms_RxMsgHandlerRef_t handlerRef)
 
taf_sms_FullStorageEventHandlerRef_t taf_sms_AddFullStorageEventHandler (taf_sms_FullStorageHandlerFunc_t handlerPtr, void *contextPtr)
 
void taf_sms_RemoveFullStorageEventHandler (taf_sms_FullStorageEventHandlerRef_t handlerRef)
 
taf_sms_MsgRef_t taf_sms_GetFirst (taf_sms_MsgListRef_t msgListRef)
 
taf_sms_MsgRef_t taf_sms_GetNext (taf_sms_MsgListRef_t msgListRef)
 
taf_sms_SendStatus_t taf_sms_GetSendStatus (taf_sms_MsgRef_t msgRef)
 
taf_sms_ReadStatus_t taf_sms_GetReadStatus (taf_sms_MsgRef_t msgRef)
 
taf_sms_LockStatus_t taf_sms_GetLockStatus (taf_sms_MsgRef_t msgRef)
 
taf_sms_MsgRef_t taf_sms_Create (void)
 
le_result_t taf_sms_SetDestination (taf_sms_MsgRef_t msgRef, const char *LE_NONNULL dest)
 
le_result_t taf_sms_SetText (taf_sms_MsgRef_t msgRef, const char *LE_NONNULL text)
 
le_result_t taf_sms_SetBinary (taf_sms_MsgRef_t msgRef, const uint8_t *binPtr, size_t binSize)
 
le_result_t taf_sms_SetUCS2 (taf_sms_MsgRef_t msgRef, const uint16_t *ucs2Ptr, size_t ucs2Size)
 
le_result_t taf_sms_SetPDU (taf_sms_MsgRef_t msgRef, const uint8_t *pduPtr, size_t pduSize)
 
le_result_t taf_sms_SetCallback (taf_sms_MsgRef_t msgRef, taf_sms_CallbackResultFunc_t handlerPtr, void *contextPtr)
 
le_result_t taf_sms_SetPhoneId (taf_sms_MsgRef_t msgRef, uint8_t phoneId)
 
void taf_sms_Delete (taf_sms_MsgRef_t msgRef)
 
le_result_t taf_sms_GetPhoneId (taf_sms_MsgRef_t msgRef, uint8_t *phoneIdPtr)
 
le_result_t taf_sms_GetSenderTel (taf_sms_MsgRef_t msgRef, char *tel, size_t telSize)
 
le_result_t taf_sms_GetText (taf_sms_MsgRef_t msgRef, char *text, size_t textSize)
 
le_result_t taf_sms_GetBinary (taf_sms_MsgRef_t msgRef, uint8_t *binPtr, size_t *binSizePtr)
 
le_result_t taf_sms_GetUCS2 (taf_sms_MsgRef_t msgRef, uint16_t *ucs2Ptr, size_t *ucs2SizePtr)
 
le_result_t taf_sms_GetPDU (taf_sms_MsgRef_t msgRef, uint8_t *pduPtr, size_t *pduSizePtr)
 
size_t taf_sms_GetPDULen (taf_sms_MsgRef_t msgRef)
 
taf_sms_Type_t taf_sms_GetType (taf_sms_MsgRef_t msgRef)
 
taf_sms_Format_t taf_sms_GetFormat (taf_sms_MsgRef_t msgRef)
 
size_t taf_sms_GetUserdataLen (taf_sms_MsgRef_t msgRef)
 
le_result_t taf_sms_Send (taf_sms_MsgRef_t msgRef)
 
le_result_t taf_sms_DeleteFromStorage (taf_sms_MsgRef_t msgRef)
 
le_result_t taf_sms_DeleteAllFromStorage (taf_sms_Storage_t storage)
 
void taf_sms_MarkRead (taf_sms_MsgRef_t msgRef)
 
void taf_sms_MarkUnread (taf_sms_MsgRef_t msgRef)
 
le_result_t taf_sms_LockFromStorage (taf_sms_MsgRef_t msgRef)
 
le_result_t taf_sms_UnlockFromStorage (taf_sms_MsgRef_t msgRef)
 
le_result_t taf_sms_EncryptFromStorage (taf_sms_MsgRef_t msgRef)
 
le_result_t taf_sms_GetSmsCenterAddress (uint8_t phoneId, char *addr, size_t addrSize)
 
le_result_t taf_sms_SetSmsCenterAddress (uint8_t phoneId, const char *LE_NONNULL addr)
 
le_result_t taf_sms_SetPreferredStorage (taf_sms_Storage_t prefStorage)
 
le_result_t taf_sms_GetPreferredStorage (taf_sms_Storage_t *prefStoragePtr)
 
le_result_t taf_sms_SendPduMsg (const uint8_t *dataPtrPtr, size_t dataPtrSize, uint32_t timeout)
 
le_result_t taf_sms_SendPduMsgEx (uint8_t phoneId, const uint8_t *dataPtrPtr, size_t dataPtrSize, uint32_t timeout)
 
le_result_t taf_sms_ActivateCellBroadcast (uint8_t phoneId)
 
le_result_t taf_sms_DeactivateCellBroadcast (uint8_t phoneId)
 
le_result_t taf_sms_AddCellBroadcastIds (uint8_t phoneId, uint16_t fromId, uint16_t toId)
 
le_result_t taf_sms_RemoveCellBroadcastIds (uint8_t phoneId, uint16_t fromId, uint16_t toId)
 

Variables

static le_mem_PoolRef_t _ClientThreadDataPool
 
static pthread_key_t _ThreadDataKey
 
static bool CommonDataInitialized = false
 
le_mutex_Ref_t le_ifgen_InitMutexRef
 

Macro Definition Documentation

◆ LOCK_INIT

#define LOCK_INIT   le_mutex_Lock(le_ifgen_InitMutexRef);

Locks the mutex.

◆ UNLOCK_INIT

#define UNLOCK_INIT   le_mutex_Unlock(le_ifgen_InitMutexRef);

Unlocks the mutex.

Function Documentation

◆ LE_MEM_DEFINE_STATIC_POOL()

LE_MEM_DEFINE_STATIC_POOL ( taf_sms_ClientThreadData  ,
LE_CDATA_COMPONENT_COUNT  ,
sizeof(_ClientThreadData_t  
)

Static pool for client threads.

◆ InitClientForThread()

static le_result_t InitClientForThread ( bool  isBlocking)
static

Initialize thread specific data, and connect to the service for the current thread.

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.

◆ GetClientThreadDataPtr()

static _ClientThreadData_t* GetClientThreadDataPtr ( void  )
static

Get a pointer to the client thread data for the current thread.

If the current thread does not have client data, then NULL is returned

◆ __attribute__()

__attribute__ ( (unused)  )

Return the sessionRef for the current thread.

If the current thread does not have a session ref, then this is a fatal error.

◆ ClientThreadDestructor()

static void ClientThreadDestructor ( void *  objPtr)
static

Destructor function for client thread objects.

◆ InitCommonData()

static void InitCommonData ( void  )
static

Init data that is common across all threads.

◆ DoConnectService()

static le_result_t DoConnectService ( bool  isBlocking)
static

Connect to the service, using either blocking or non-blocking calls.

This function implements the details of the public ConnectService functions.

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.

◆ taf_sms_ConnectService()

void taf_sms_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 apiFilesC_client.

This function is created automatically.

◆ taf_sms_TryConnectService()

le_result_t taf_sms_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 apiFilesC_client.

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.

◆ SessionCloseHandler()

static void SessionCloseHandler ( le_msg_SessionRef_t  sessionRef,
void *  contextPtr 
)
static

◆ taf_sms_SetServerDisconnectHandler()

void taf_sms_SetServerDisconnectHandler ( taf_sms_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.

◆ NonExitSessionCloseHandler()

static void NonExitSessionCloseHandler ( le_msg_SessionRef_t  sessionRef,
void *  contextPtr 
)
static

◆ taf_sms_SetNonExitServerDisconnectHandler()

void taf_sms_SetNonExitServerDisconnectHandler ( taf_sms_DisconnectHandler_t  disconnectHandler,
void *  contextPtr 
)

Set handler called when server disconnection is detected without exiting.

When a server connection is lost, call this handler without exit.

Warning
When using the API, it needs the application developer to handle some cases like re-connecting and recycling the resources. For most of cases, it is safe to use SetServerDisconnectHandler.

◆ taf_sms_DisconnectService()

void taf_sms_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 apiFilesC_client.

This function is created automatically.

◆ taf_sms_CreateRxMsgList()

taf_sms_MsgListRef_t taf_sms_CreateRxMsgList ( void  )

Creates a message list for accessing messages.

Returns
Created message list reference.

◆ taf_sms_DeleteList()

void taf_sms_DeleteList ( taf_sms_MsgListRef_t  msgListRef)

Deletes a message list.

Parameters
[in]msgListRefMessage list reference.

◆ taf_sms_AddRxMsgHandler()

taf_sms_RxMsgHandlerRef_t taf_sms_AddRxMsgHandler ( taf_sms_RxMsgHandlerFunc_t  handlerPtr,
void *  contextPtr 
)

Add handler function for EVENT 'taf_sms_RxMsg'

Event for handler usage.

Parameters
[in]handlerPtrHandler for receiving messages.
[in]contextPtr

◆ taf_sms_RemoveRxMsgHandler()

void taf_sms_RemoveRxMsgHandler ( taf_sms_RxMsgHandlerRef_t  handlerRef)

Remove handler function for EVENT 'taf_sms_RxMsg'

Parameters
[in]handlerRef

◆ taf_sms_AddFullStorageEventHandler()

taf_sms_FullStorageEventHandlerRef_t taf_sms_AddFullStorageEventHandler ( taf_sms_FullStorageHandlerFunc_t  handlerPtr,
void *  contextPtr 
)

Add handler function for EVENT 'taf_sms_FullStorageEvent'

Event for information on full storage notifications.

Parameters
[in]handlerPtrHandler for full storage indications.
[in]contextPtr

◆ taf_sms_RemoveFullStorageEventHandler()

void taf_sms_RemoveFullStorageEventHandler ( taf_sms_FullStorageEventHandlerRef_t  handlerRef)

Remove handler function for EVENT 'taf_sms_FullStorageEvent'

Parameters
[in]handlerRef

◆ taf_sms_GetFirst()

taf_sms_MsgRef_t taf_sms_GetFirst ( taf_sms_MsgListRef_t  msgListRef)

Gets the first message in the given list.

Returns
The first message reference in the message list.
Parameters
[in]msgListRefMessage list reference.

◆ taf_sms_GetNext()

taf_sms_MsgRef_t taf_sms_GetNext ( taf_sms_MsgListRef_t  msgListRef)

Gets the next message in the list.

Returns
The next message reference from the message list.
Parameters
[in]msgListRefMessage list reference.

◆ taf_sms_GetSendStatus()

taf_sms_SendStatus_t taf_sms_GetSendStatus ( taf_sms_MsgRef_t  msgRef)

Gets the message's send status.

Returns
The message send status.
Parameters
[in]msgRefMessage reference.

◆ taf_sms_GetReadStatus()

taf_sms_ReadStatus_t taf_sms_GetReadStatus ( taf_sms_MsgRef_t  msgRef)

Gets the message's read status.

Returns
The message's read status.
Parameters
[in]msgRefMessage reference.

◆ taf_sms_GetLockStatus()

taf_sms_LockStatus_t taf_sms_GetLockStatus ( taf_sms_MsgRef_t  msgRef)

Gets the message's lock status.

Returns
The message's lock status.
Parameters
[in]msgRefMessage reference.

◆ taf_sms_Create()

taf_sms_MsgRef_t taf_sms_Create ( void  )

Creates a new message to send.

Returns
The created message reference.

◆ taf_sms_SetDestination()

le_result_t taf_sms_SetDestination ( taf_sms_MsgRef_t  msgRef,
const char *LE_NONNULL  dest 
)

Sets the message's destination phone number.

Returns
  • LE_BAD_PARAMETER – Invalid input.
  • LE_NOT_FOUND – Invalid message.
  • LE_FAULT – Failed.
  • LE_OK – Succeeded.
Parameters
[in]msgRefMessage reference.
[in]destDestination number.

◆ taf_sms_SetText()

le_result_t taf_sms_SetText ( taf_sms_MsgRef_t  msgRef,
const char *LE_NONNULL  text 
)

Sets the message's text.

Returns
  • LE_BAD_PARAMETER – Invalid input.
  • LE_NOT_FOUND – Invalid message.
  • LE_FAULT – Failed.
  • LE_OK – Succeeded.
Parameters
[in]msgRefMessage reference.
[in]textText message.

◆ taf_sms_SetBinary()

le_result_t taf_sms_SetBinary ( taf_sms_MsgRef_t  msgRef,
const uint8_t *  binPtr,
size_t  binSize 
)

Sets the message's binary content.

Returns
  • LE_BAD_PARAMETER – Invalid input.
  • LE_NOT_FOUND – Invalid message.
  • LE_FAULT – Failed.
  • LE_OK – Succeeded.
Parameters
[in]msgRefMessage reference.
[in]binPtrBinary data.
[in]binSize

◆ taf_sms_SetUCS2()

le_result_t taf_sms_SetUCS2 ( taf_sms_MsgRef_t  msgRef,
const uint16_t *  ucs2Ptr,
size_t  ucs2Size 
)

Sets the message's UCS2 content.

Returns
  • LE_BAD_PARAMETER – Invalid input.
  • LE_NOT_FOUND – Invalid message.
  • LE_FAULT – Failed.
  • LE_OK – Succeeded.
Parameters
[in]msgRefMessage reference.
[in]ucs2PtrUCS2 message.
[in]ucs2Size

◆ taf_sms_SetPDU()

le_result_t taf_sms_SetPDU ( taf_sms_MsgRef_t  msgRef,
const uint8_t *  pduPtr,
size_t  pduSize 
)

Sets the message's PDU format.

Returns
  • LE_BAD_PARAMETER – Invalid input.
  • LE_NOT_FOUND – Invalid message.
  • LE_FAULT – Failed.
  • LE_OK – Succeeded.
Parameters
[in]msgRefMessage reference.
[in]pduPtrMessage in PDU format.
[in]pduSize

◆ taf_sms_SetCallback()

le_result_t taf_sms_SetCallback ( taf_sms_MsgRef_t  msgRef,
taf_sms_CallbackResultFunc_t  handlerPtr,
void *  contextPtr 
)

Sets the message's callback function.

Returns
  • LE_BAD_PARAMETER – Invalid input.
  • LE_NOT_FOUND – Invalid message.
  • LE_OK – Succeeded.
Parameters
[in]msgRefMessage reference.
[in]handlerPtrHandler for sending message.
[in]contextPtr

◆ taf_sms_SetPhoneId()

le_result_t taf_sms_SetPhoneId ( taf_sms_MsgRef_t  msgRef,
uint8_t  phoneId 
)

Sets the phone ID function for the message; phone ID must be 1 or 2 (for DSDA use case).

Returns
  • LE_NOT_FOUND – Invalid message.
  • LE_OK – Succeeded.
Parameters
[in]msgRefMessage reference.
[in]phoneIdPhone ID.

◆ taf_sms_Delete()

void taf_sms_Delete ( taf_sms_MsgRef_t  msgRef)

Deletes a message from the message list, if there is no message list reference, it deletes the message from storage.

Parameters
[in]msgRefMessage reference.

◆ taf_sms_GetPhoneId()

le_result_t taf_sms_GetPhoneId ( taf_sms_MsgRef_t  msgRef,
uint8_t *  phoneIdPtr 
)

Gets the message's phone ID (only for the messages stored in the SIM or created by the client).

Returns
  • LE_NOT_FOUND – Invalid message.
  • LE_NOT_PERMITTED – Invalid message type.
  • LE_BAD_PARAMETER – Invalid phone ID pointer.
  • LE_OK – Succeeded.
Parameters
[in]msgRefMessage reference.
[out]phoneIdPtrPointer to the stored phone ID.

◆ taf_sms_GetSenderTel()

le_result_t taf_sms_GetSenderTel ( taf_sms_MsgRef_t  msgRef,
char *  tel,
size_t  telSize 
)

Gets the message sender's phone number.

Returns
  • LE_NOT_FOUND – Invalid message.
  • LE_NOT_PERMITTED – Invalid message type.
  • LE_FAULT – Invalid input string.
  • LE_OVERFLOW – String overflow.
  • LE_OK – Succeeded.
Parameters
[in]msgRefMessage reference.
[out]telBuffer to store sender's number.
[in]telSize

◆ taf_sms_GetText()

le_result_t taf_sms_GetText ( taf_sms_MsgRef_t  msgRef,
char *  text,
size_t  textSize 
)

Gets the message's text.

Returns
  • LE_NOT_FOUND – Invalid message.
  • LE_FAULT – Invalid input string.
  • LE_OVERFLOW – String overflow.
  • LE_OK – Succeeded.
Parameters
[in]msgRefMessage reference.
[out]textBuffer to store message text.
[in]textSize

◆ taf_sms_GetBinary()

le_result_t taf_sms_GetBinary ( taf_sms_MsgRef_t  msgRef,
uint8_t *  binPtr,
size_t *  binSizePtr 
)

Gets the message's binary data.

Returns
  • LE_NOT_FOUND – Invalid message.
  • LE_FAULT – Invalid input string.
  • LE_OVERFLOW – String overflow.
  • LE_OK – Succeeded.
Parameters
[in]msgRefMessage reference.
[out]binPtrBuffer to store binary data.
[in,out]binSizePtr

◆ taf_sms_GetUCS2()

le_result_t taf_sms_GetUCS2 ( taf_sms_MsgRef_t  msgRef,
uint16_t *  ucs2Ptr,
size_t *  ucs2SizePtr 
)

Gets the message's UCS2 encoding.

Returns
  • LE_NOT_FOUND – Invalid message.
  • LE_FAULT – Invalid input string.
  • LE_OVERFLOW – String overflow.
  • LE_OK – Succeeded.
Parameters
[in]msgRefMessage reference.
[out]ucs2PtrBuffer to store UCS2 characters.
[in,out]ucs2SizePtr

◆ taf_sms_GetPDU()

le_result_t taf_sms_GetPDU ( taf_sms_MsgRef_t  msgRef,
uint8_t *  pduPtr,
size_t *  pduSizePtr 
)

Gets the message's PDU data.

Returns
  • LE_NOT_FOUND – Invalid message.
  • LE_FAULT – Invalid input string.
  • LE_OVERFLOW – String overflow.
  • LE_OK – Succeeded.
Parameters
[in]msgRefMessage reference.
[out]pduPtrBuffer to store PDU data.
[in,out]pduSizePtr

◆ taf_sms_GetPDULen()

size_t taf_sms_GetPDULen ( taf_sms_MsgRef_t  msgRef)

Gets the message's PDU length.

Returns
  • LE_NOT_FOUND – Invalid message.
  • LE_FAULT – Invalid input string.
  • LE_OVERFLOW – String overflow.
  • LE_OK – Succeeded.
Parameters
[in]msgRefMessage reference.

◆ taf_sms_GetType()

taf_sms_Type_t taf_sms_GetType ( taf_sms_MsgRef_t  msgRef)

Gets the message's type.

Returns
The message type.
Parameters
[in]msgRefMessage reference.

◆ taf_sms_GetFormat()

taf_sms_Format_t taf_sms_GetFormat ( taf_sms_MsgRef_t  msgRef)

Gets the message's format.

Returns
The message format.
Parameters
[in]msgRefMessage reference.

◆ taf_sms_GetUserdataLen()

size_t taf_sms_GetUserdataLen ( taf_sms_MsgRef_t  msgRef)

Gets the message's text length.

Returns
The message's text length.
Parameters
[in]msgRefMessage reference.

◆ taf_sms_Send()

le_result_t taf_sms_Send ( taf_sms_MsgRef_t  msgRef)

Send the message.

Returns
  • LE_NOT_FOUND – Invalid message.
  • LE_BAD_PARAMETER – Invalid phone ID.
  • LE_FORMAT_ERROR – Failed to encode message.
  • LE_OK – Succeeded.
Parameters
[in]msgRefMessage reference.

◆ taf_sms_DeleteFromStorage()

le_result_t taf_sms_DeleteFromStorage ( taf_sms_MsgRef_t  msgRef)

Deletes a message from storage.

Returns
  • LE_NOT_FOUND – Invalid message.
  • LE_BAD_PARAMETER – Invalid storage.
  • LE_FAULT – Failed.
  • LE_OK – Succeeded.
Parameters
[in]msgRefMessage reference.

◆ taf_sms_DeleteAllFromStorage()

le_result_t taf_sms_DeleteAllFromStorage ( taf_sms_Storage_t  storage)

Deletes all messages from storage.

Note
In the case of HLOS storage, this API only deletes unlocked messages.
Returns
  • LE_BAD_PARAMETER – Invalid storage.
  • LE_FAULT: Failed.
  • LE_OK – Succeeded.
Parameters
[in]storage

◆ taf_sms_MarkRead()

void taf_sms_MarkRead ( taf_sms_MsgRef_t  msgRef)

Marks a message's status as read.

Parameters
[in]msgRefMessage reference.

◆ taf_sms_MarkUnread()

void taf_sms_MarkUnread ( taf_sms_MsgRef_t  msgRef)

Marks a message's status as unread.

Parameters
[in]msgRefMessage reference.

◆ taf_sms_LockFromStorage()

le_result_t taf_sms_LockFromStorage ( taf_sms_MsgRef_t  msgRef)

Marks a message's lock status as locked; the message cannot be deleted from storage.

Returns
  • LE_NOT_FOUND – Invalid message.
  • LE_FAULT – Failed.
  • LE_OK – Succeeded.
  • LE_NOT_PERMITTED – Message is locked or is not stored in HLOS.
Parameters
[in]msgRefMessage reference.

◆ taf_sms_UnlockFromStorage()

le_result_t taf_sms_UnlockFromStorage ( taf_sms_MsgRef_t  msgRef)

Marks a message's lock status as unlocked; the message can be deleted from storage.

Returns
  • LE_NOT_FOUND – Invalid message.
  • LE_FAULT – Failed.
  • LE_OK – Succeeded.
  • LE_NOT_PERMITTED – Message is not locked or is not stored in HLOS.
Parameters
[in]msgRefMessage reference.

◆ taf_sms_EncryptFromStorage()

le_result_t taf_sms_EncryptFromStorage ( taf_sms_MsgRef_t  msgRef)

Encrypts a message which is stored in HLOS.

Returns
  • LE_NOT_FOUND – Invalid message.
  • LE_FAULT – Failed.
  • LE_OK – Succeeded.
  • LE_NOT_PERMITTED – Message is not stored in HLOS.
Parameters
[in]msgRefMessage reference.

◆ taf_sms_GetSmsCenterAddress()

le_result_t taf_sms_GetSmsCenterAddress ( uint8_t  phoneId,
char *  addr,
size_t  addrSize 
)

Gets the SMS center address for the specified phone ID.

Returns
  • LE_OVERFLOW – Input buffer len is not enough.
  • LE_FAULT – Internal error.
  • LE_TIMEOUT – Timeout occurred.
  • LE_BAD_PARAMETER – Invalid input.
  • LE_OK – Succeeded.
Parameters
[in]phoneIdPhone ID.
[out]addrBuffer to store SMS center address.
[in]addrSize

◆ taf_sms_SetSmsCenterAddress()

le_result_t taf_sms_SetSmsCenterAddress ( uint8_t  phoneId,
const char *LE_NONNULL  addr 
)

Sets the SMS center address for the specified phone ID.

Returns
  • LE_OVERFLOW – Input buffer len is not enough.
  • LE_FAULT – Internal error.
  • LE_TIMEOUT – Timeout occurred.
  • LE_OK – Succeeded.
Parameters
[in]phoneIdPhone ID.
[in]addrSMS center address.

◆ taf_sms_SetPreferredStorage()

le_result_t taf_sms_SetPreferredStorage ( taf_sms_Storage_t  prefStorage)

Sets the preferred SMS storage place.

Returns
  • LE_FAULT – Failed.
  • LE_TIMEOUT – Timeout occurred.
  • LE_UNSUPPORTED – Input storage is not suppported.
  • LE_BAD_PARAMETER – Invalid input.
  • LE_OK – Succeeded.
Parameters
[in]prefStoragePreferred storage type.

◆ taf_sms_GetPreferredStorage()

le_result_t taf_sms_GetPreferredStorage ( taf_sms_Storage_t prefStoragePtr)

Gets the preferred SMS storage place.

Returns
  • LE_FAULT – Failed.
  • LE_TIMEOUT – Timeout occurred.
  • LE_OK – Succeeded.
Parameters
[out]prefStoragePtrPreferred storage type.

◆ taf_sms_SendPduMsg()

le_result_t taf_sms_SendPduMsg ( const uint8_t *  dataPtrPtr,
size_t  dataPtrSize,
uint32_t  timeout 
)

Sends a PDU message.

Returns
  • LE_FAULT – Failed.
  • LE_OK – Succeeded.
Parameters
[in]dataPtrPtrMessage in PDU format.
[in]dataPtrSize
[in]timeoutTimeout value message sent.

◆ taf_sms_SendPduMsgEx()

le_result_t taf_sms_SendPduMsgEx ( uint8_t  phoneId,
const uint8_t *  dataPtrPtr,
size_t  dataPtrSize,
uint32_t  timeout 
)

Sends a PDU message with phone ID.

Returns
  • LE_FAULT – Failed.
  • LE_OK – Succeeded.
Parameters
[in]phoneIdPhone ID.
[in]dataPtrPtrMessage in PDU format.
[in]dataPtrSize
[in]timeoutTimeout value message sent.

◆ taf_sms_ActivateCellBroadcast()

le_result_t taf_sms_ActivateCellBroadcast ( uint8_t  phoneId)

Activates cell broadcast for the specified phone ID.

Returns
  • LE_TIMEOUT – Timeout occurred.
  • LE_FAULT – Failed.
  • LE_OK – Succeeded.
Parameters
[in]phoneIdPhone ID.

◆ taf_sms_DeactivateCellBroadcast()

le_result_t taf_sms_DeactivateCellBroadcast ( uint8_t  phoneId)

Deactivates cell broadcast for the specified phone ID.

Returns
  • LE_FAULT – Failed.
  • LE_TIMEOUT – Timeout occurred.
  • LE_OK – Succeeded.
Parameters
[in]phoneIdPhone ID.

◆ taf_sms_AddCellBroadcastIds()

le_result_t taf_sms_AddCellBroadcastIds ( uint8_t  phoneId,
uint16_t  fromId,
uint16_t  toId 
)

Adds cell broadcast message range of identifier for the specified phone ID.

Returns
  • LE_BAD_PARAMETER – Invalid input.
  • LE_TIMEOUT – Timeout occurred.
  • LE_FAULT – Internal error.
  • LE_OK – Succceeded.
Parameters
[in]phoneIdPhone ID.
[in]fromIdStarting point of the filter.
[in]toIdEnding point of the filter.

◆ taf_sms_RemoveCellBroadcastIds()

le_result_t taf_sms_RemoveCellBroadcastIds ( uint8_t  phoneId,
uint16_t  fromId,
uint16_t  toId 
)

Removes cell broadcast range of message identifiers for the specified phone ID.

Returns
  • LE_BAD_PARAMETER – Invalid input.
  • LE_TIMEOUT – Timeout occurred.
  • LE_FAULT – Internal error.
  • LE_OK – Succceeded.
Parameters
[in]phoneIdPhone ID.
[in]fromIdStarting point of the range.
[in]toIdEnding point of the range.

Variable Documentation

◆ _ClientThreadDataPool

le_mem_PoolRef_t _ClientThreadDataPool
static

The memory pool for client thread objects

◆ _ThreadDataKey

pthread_key_t _ThreadDataKey
static

Key under which the pointer to the Thread Object (_ClientThreadData_t) will be kept in thread-local storage. This allows a thread to quickly get a pointer to its own Thread Object.

◆ CommonDataInitialized

bool CommonDataInitialized = false
static

This global flag is shared by all client threads, and is used to indicate whether the common data has been initialized.

Warning
Use InitMutex, defined below, to protect accesses to this data.

◆ le_ifgen_InitMutexRef

le_mutex_Ref_t le_ifgen_InitMutexRef

Mutex and associated macros for use with the above CommonDataInitialized.