le_sms_interface.h
Go to the documentation of this file.
44 * APIs. It automatically allocates needed resources for the Message object, which is referenced by62 * - Binary content with le_sms_SetBinary(), total length is set with this API, maximum 140 bytes.65 * - UCS2 content (16-bit format) with le_sms_SetUCS2(), total length is set with this API, maximum70 * @c le_sms_Send() is a blocking function with a maximum timeout set to 240 seconds, it will return73 * TP-Validity-Period(TP-VP) parameter value indicates the time period for which the short message75 * memory before delivery to the recipient has been carried out. The default validity period(TP-VP)78 * When a message sending has failed and returned LE_FAULT, call le_sms_GetErrorCode() to retrieve91 * To send an asynchronous message, le_sms_SendAsync() API can be called instead of le_sms_Send().92 * le_sms_SendAsync() is a non-blocking function, it queues the message to the SMS pool and returns117 * When a message sending has failed, call le_sms_GetErrorCode() to retrieve the 3GPP message error208 * the Message object reference (not necessary from storage). API returns always LE_OK in this case.210 * @note If one client creates a list and deletes all sms from storage, other clients won’t see sms216 * The Cell Broadcast service permits a number of unacknowledged general messages to be broadcast218 * geographical areas known as cell broadcast areas. These areas may comprise of one or more cells,272 * "Automotive Association" (= source), "Traffic Reports" (= type) could correspond to one value.276 * Message identifier meaning ranges are defined in the 3GPP 23.041 (9.4.1.2.2 Message Identifier).281 * le_sms_AddCellBroadcastIds() and le_sms_RemoveCellBroadcastIds() APIs. All Message identifiers290 * SMS Status Report may be sent by the SMS Center (SMSC) to inform the originating device about the294 * le_sms_EnableStatusReport() and le_sms_DisableStatusReport(). The current activation state can297 * The reception of a SMS Status Report is notified by the SMS handler like a SMS message reception,304 * - le_sms_GetTpRa() gives the Recipient Address, defined in 3GPP TS 23.040 section 9.2.3.14, and318 * Preferred SMS storage for incoming messages can be set or get with le_sms_SetPreferredStorage()402 //--------------------------------------------------------------------------------------------------406 //--------------------------------------------------------------------------------------------------409 //--------------------------------------------------------------------------------------------------412 * Connect the current client thread to the service providing this API. Block until the service is415 * For each thread that wants to use this API, either ConnectService or TryConnectService must be416 * called before any other functions in this API. Normally, ConnectService is automatically called421 //--------------------------------------------------------------------------------------------------427 //--------------------------------------------------------------------------------------------------430 * Try to connect the current client thread to the service providing this API. Return with an error433 * For each thread that wants to use this API, either ConnectService or TryConnectService must be434 * called before any other functions in this API. Normally, ConnectService is automatically called443 * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).446 //--------------------------------------------------------------------------------------------------452 //--------------------------------------------------------------------------------------------------456 * When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants459 //--------------------------------------------------------------------------------------------------466 //--------------------------------------------------------------------------------------------------472 * longer a connection to the service, and the functions in this API can't be used. For details, see477 //--------------------------------------------------------------------------------------------------484 //--------------------------------------------------------------------------------------------------488 //--------------------------------------------------------------------------------------------------491 //--------------------------------------------------------------------------------------------------495 //--------------------------------------------------------------------------------------------------498 //--------------------------------------------------------------------------------------------------502 //--------------------------------------------------------------------------------------------------505 //--------------------------------------------------------------------------------------------------509 //--------------------------------------------------------------------------------------------------512 //--------------------------------------------------------------------------------------------------516 //--------------------------------------------------------------------------------------------------519 //--------------------------------------------------------------------------------------------------523 //--------------------------------------------------------------------------------------------------526 //--------------------------------------------------------------------------------------------------530 //--------------------------------------------------------------------------------------------------533 //--------------------------------------------------------------------------------------------------537 //--------------------------------------------------------------------------------------------------540 //--------------------------------------------------------------------------------------------------544 //--------------------------------------------------------------------------------------------------547 //--------------------------------------------------------------------------------------------------551 //--------------------------------------------------------------------------------------------------554 //--------------------------------------------------------------------------------------------------558 //--------------------------------------------------------------------------------------------------561 //--------------------------------------------------------------------------------------------------566 //--------------------------------------------------------------------------------------------------569 //--------------------------------------------------------------------------------------------------573 //--------------------------------------------------------------------------------------------------576 //--------------------------------------------------------------------------------------------------581 //--------------------------------------------------------------------------------------------------584 //--------------------------------------------------------------------------------------------------588 //--------------------------------------------------------------------------------------------------591 //--------------------------------------------------------------------------------------------------598 //--------------------------------------------------------------------------------------------------607 //--------------------------------------------------------------------------------------------------611 //--------------------------------------------------------------------------------------------------618 //--------------------------------------------------------------------------------------------------625 //--------------------------------------------------------------------------------------------------634 //--------------------------------------------------------------------------------------------------638 //--------------------------------------------------------------------------------------------------645 //--------------------------------------------------------------------------------------------------655 //--------------------------------------------------------------------------------------------------661 //--------------------------------------------------------------------------------------------------672 * @note If telephone destination number is too long is too long (max LE_MDMDEFS_PHONE_NUM_MAX_LEN678 //--------------------------------------------------------------------------------------------------687 //--------------------------------------------------------------------------------------------------704 //--------------------------------------------------------------------------------------------------713 //--------------------------------------------------------------------------------------------------727 //--------------------------------------------------------------------------------------------------738 //--------------------------------------------------------------------------------------------------753 //--------------------------------------------------------------------------------------------------764 //--------------------------------------------------------------------------------------------------772 * @note If length of the data is too long (max LE_SMS_PDU_MAX_BYTES bytes), it is a fatal error,778 //--------------------------------------------------------------------------------------------------789 //--------------------------------------------------------------------------------------------------804 //--------------------------------------------------------------------------------------------------811 //--------------------------------------------------------------------------------------------------826 //--------------------------------------------------------------------------------------------------837 //--------------------------------------------------------------------------------------------------849 //--------------------------------------------------------------------------------------------------856 //--------------------------------------------------------------------------------------------------867 //--------------------------------------------------------------------------------------------------878 //--------------------------------------------------------------------------------------------------882 * Refer to @ref platformConstraintsSpecificErrorCodes for platform specific error code description.889 //--------------------------------------------------------------------------------------------------896 //--------------------------------------------------------------------------------------------------904 * @note If telephone destination number is too long is too long (max LE_MDMDEFS_PHONE_NUM_MAX_LEN909 //--------------------------------------------------------------------------------------------------922 //--------------------------------------------------------------------------------------------------931 //--------------------------------------------------------------------------------------------------944 //--------------------------------------------------------------------------------------------------956 //--------------------------------------------------------------------------------------------------963 //--------------------------------------------------------------------------------------------------973 //--------------------------------------------------------------------------------------------------980 //--------------------------------------------------------------------------------------------------989 //--------------------------------------------------------------------------------------------------996 //--------------------------------------------------------------------------------------------------1007 //--------------------------------------------------------------------------------------------------1016 //--------------------------------------------------------------------------------------------------1027 //--------------------------------------------------------------------------------------------------1036 //--------------------------------------------------------------------------------------------------1040 * Output parameter is updated with the Telephone number. If the Telephone number string exceeds1051 //--------------------------------------------------------------------------------------------------1062 //--------------------------------------------------------------------------------------------------1067 * value of 'len' parameter, a LE_OVERFLOW error code is returned and 'timestamp' is filled until1077 //--------------------------------------------------------------------------------------------------1093 //--------------------------------------------------------------------------------------------------1097 * @return Number of characters for text and UCS2 messages, or the length of the data in bytes for1103 //--------------------------------------------------------------------------------------------------1110 //--------------------------------------------------------------------------------------------------1115 * exceeds the value of 'len' parameter, LE_OVERFLOW error code is returned and 'text' is filled1124 //--------------------------------------------------------------------------------------------------1135 //--------------------------------------------------------------------------------------------------1150 //--------------------------------------------------------------------------------------------------1161 //--------------------------------------------------------------------------------------------------1175 //--------------------------------------------------------------------------------------------------1186 //--------------------------------------------------------------------------------------------------1191 * in bytes. If the PDU data exceed the value of 'len' input parameter, a LE_OVERFLOW error code is1201 //--------------------------------------------------------------------------------------------------1212 //--------------------------------------------------------------------------------------------------1221 //--------------------------------------------------------------------------------------------------1228 //--------------------------------------------------------------------------------------------------1242 //--------------------------------------------------------------------------------------------------1249 //--------------------------------------------------------------------------------------------------1257 //--------------------------------------------------------------------------------------------------1263 //--------------------------------------------------------------------------------------------------1272 //--------------------------------------------------------------------------------------------------1279 //--------------------------------------------------------------------------------------------------1290 //--------------------------------------------------------------------------------------------------1297 //--------------------------------------------------------------------------------------------------1308 //--------------------------------------------------------------------------------------------------1315 //--------------------------------------------------------------------------------------------------1325 //--------------------------------------------------------------------------------------------------1332 //--------------------------------------------------------------------------------------------------1339 //--------------------------------------------------------------------------------------------------1346 //--------------------------------------------------------------------------------------------------1353 //--------------------------------------------------------------------------------------------------1360 //--------------------------------------------------------------------------------------------------1364 * Output parameter is updated with the SMS Service center address. If the Telephone number string exceeds1374 //--------------------------------------------------------------------------------------------------1383 //--------------------------------------------------------------------------------------------------1388 * E.164 numbers can have a maximum of fifteen digits and are usually written with a '+' prefix.1394 * @note If the SMS center address number is too long (max LE_MDMDEFS_PHONE_NUM_MAX_LEN digits), it1397 //--------------------------------------------------------------------------------------------------1404 //--------------------------------------------------------------------------------------------------1411 //--------------------------------------------------------------------------------------------------1418 //--------------------------------------------------------------------------------------------------1425 //--------------------------------------------------------------------------------------------------1432 //--------------------------------------------------------------------------------------------------1440 //--------------------------------------------------------------------------------------------------1446 //--------------------------------------------------------------------------------------------------1454 //--------------------------------------------------------------------------------------------------1460 //--------------------------------------------------------------------------------------------------1468 //--------------------------------------------------------------------------------------------------1474 //--------------------------------------------------------------------------------------------------1482 //--------------------------------------------------------------------------------------------------1488 //--------------------------------------------------------------------------------------------------1496 //--------------------------------------------------------------------------------------------------1505 //--------------------------------------------------------------------------------------------------1513 //--------------------------------------------------------------------------------------------------1522 //--------------------------------------------------------------------------------------------------1530 //--------------------------------------------------------------------------------------------------1536 //--------------------------------------------------------------------------------------------------1545 //--------------------------------------------------------------------------------------------------1557 //--------------------------------------------------------------------------------------------------1566 //--------------------------------------------------------------------------------------------------1578 //--------------------------------------------------------------------------------------------------1586 //--------------------------------------------------------------------------------------------------1592 //--------------------------------------------------------------------------------------------------1603 //--------------------------------------------------------------------------------------------------1612 //--------------------------------------------------------------------------------------------------1616 //--------------------------------------------------------------------------------------------------1622 //--------------------------------------------------------------------------------------------------1626 //--------------------------------------------------------------------------------------------------1632 //--------------------------------------------------------------------------------------------------1636 //--------------------------------------------------------------------------------------------------1642 //--------------------------------------------------------------------------------------------------1650 //--------------------------------------------------------------------------------------------------1656 //--------------------------------------------------------------------------------------------------1664 //--------------------------------------------------------------------------------------------------1670 //--------------------------------------------------------------------------------------------------1679 //--------------------------------------------------------------------------------------------------1686 //--------------------------------------------------------------------------------------------------1688 * Get TP-Message-Reference of a message. Message type should be either a SMS Status Report or an1698 //--------------------------------------------------------------------------------------------------1707 //--------------------------------------------------------------------------------------------------1719 //--------------------------------------------------------------------------------------------------1733 //--------------------------------------------------------------------------------------------------1744 //--------------------------------------------------------------------------------------------------1755 //--------------------------------------------------------------------------------------------------1766 //--------------------------------------------------------------------------------------------------1777 //--------------------------------------------------------------------------------------------------1787 //--------------------------------------------------------------------------------------------------le_result_t le_sms_ActivateCellBroadcast(void)le_result_t le_sms_ClearCdmaCellBroadcastServices(void)void le_sms_RemoveFullStorageEventHandler(le_sms_FullStorageEventHandlerRef_t handlerRef)void le_sms_GetErrorCode(le_sms_MsgRef_t msgRef, le_sms_ErrorCode_t *rpCausePtr, le_sms_ErrorCode_t *tpCausePtr)le_sms_MsgRef_t le_sms_SendPdu(const uint8_t *pduPtr, size_t pduSize, le_sms_CallbackResultFunc_t handlerPtr, void *contextPtr)le_sms_MsgRef_t le_sms_GetNext(le_sms_MsgListRef_t msgListRef)le_result_t le_sms_AddCellBroadcastIds(uint16_t fromId, uint16_t toId)le_result_t le_sms_DeactivateCdmaCellBroadcast(void)le_result_t le_sms_GetCellBroadcastSerialNumber(le_sms_MsgRef_t msgRef, uint16_t *serialNumberPtr)le_sms_MsgRef_t le_sms_GetFirst(le_sms_MsgListRef_t msgListRef)size_t le_sms_GetUserdataLen(le_sms_MsgRef_t msgRef)LE_FULL_API void le_sms_SetServerDisconnectHandler(le_sms_DisconnectHandler_t disconnectHandler, void *contextPtr)void(* le_sms_DisconnectHandler_t)(void *)Definition: le_sms_interface.h:407le_result_t le_sms_GetUCS2(le_sms_MsgRef_t msgRef, uint16_t *ucs2Ptr, size_t *ucs2SizePtr)le_result_t le_sms_ClearCellBroadcastIds(void)void le_sms_Delete(le_sms_MsgRef_t msgRef)void le_sms_DeleteList(le_sms_MsgListRef_t msgListRef)void le_sms_ConnectService(void)void le_sms_DisconnectService(void)le_sms_Format_t le_sms_GetFormat(le_sms_MsgRef_t msgRef)struct le_sms_RxMessageHandler * le_sms_RxMessageHandlerRef_tDefinition: le_sms_common.h:537le_result_t le_sms_GetBinary(le_sms_MsgRef_t msgRef, uint8_t *binPtr, size_t *binSizePtr)le_result_t le_sms_GetCount(le_sms_Type_t messageType, int32_t *messageCountPtr)le_result_t le_sms_GetPDU(le_sms_MsgRef_t msgRef, uint8_t *pduPtr, size_t *pduSizePtr)le_sms_MsgRef_t le_sms_Create(void)le_result_t le_sms_SetPDU(le_sms_MsgRef_t msgRef, const uint8_t *pduPtr, size_t pduSize)le_result_t le_sms_Send(le_sms_MsgRef_t msgRef)void le_sms_StartCount(void)le_result_t le_sms_SendAsync(le_sms_MsgRef_t msgRef, le_sms_CallbackResultFunc_t handlerPtr, void *contextPtr)le_sms_FullStorageEventHandlerRef_t le_sms_AddFullStorageEventHandler(le_sms_FullStorageHandlerFunc_t handlerPtr, void *contextPtr)le_result_t le_sms_GetTpMr(le_sms_MsgRef_t msgRef, uint8_t *tpMrPtr)le_result_t le_sms_RemoveCdmaCellBroadcastServices(le_sms_CdmaServiceCat_t serviceCat, le_sms_Languages_t language)le_result_t le_sms_SetUCS2(le_sms_MsgRef_t msgRef, const uint16_t *ucs2Ptr, size_t ucs2Size)le_result_t le_sms_GetPreferredStorage(le_sms_Storage_t *prefStoragePtr)int32_t le_sms_GetPlatformSpecificErrorCode(le_sms_MsgRef_t msgRef)void le_sms_StopCount(void)le_result_t le_sms_AddCdmaCellBroadcastServices(le_sms_CdmaServiceCat_t serviceCat, le_sms_Languages_t language)size_t le_sms_GetPDULen(le_sms_MsgRef_t msgRef)le_result_t le_sms_TryConnectService(void)le_result_t le_sms_ActivateCdmaCellBroadcast(void)le_sms_Type_t le_sms_GetType(le_sms_MsgRef_t msgRef)le_result_t le_sms_GetText(le_sms_MsgRef_t msgRef, char *text, size_t textSize)le_result_t le_sms_RemoveCellBroadcastIds(uint16_t fromId, uint16_t toId)le_sms_MsgListRef_t le_sms_CreateRxMsgList(void)le_result_t le_sms_SetPreferredStorage(le_sms_Storage_t prefStorage)le_result_t le_sms_GetSmsCenterAddress(char *tel, size_t telSize)le_result_t le_sms_SetText(le_sms_MsgRef_t msgRef, const char *LE_NONNULL text)le_result_t le_sms_SetDestination(le_sms_MsgRef_t msgRef, const char *LE_NONNULL dest)le_result_t le_sms_IsStatusReportEnabled(bool *enabledPtr)le_sms_ErrorCode3GPP2_t le_sms_Get3GPP2ErrorCode(le_sms_MsgRef_t msgRef)le_result_t le_sms_GetTpRa(le_sms_MsgRef_t msgRef, uint8_t *toraPtr, char *ra, size_t raSize)le_result_t le_sms_GetTpSt(le_sms_MsgRef_t msgRef, uint8_t *stPtr)le_result_t le_sms_GetTpScTs(le_sms_MsgRef_t msgRef, char *scts, size_t sctsSize)le_result_t le_sms_SetSmsCenterAddress(const char *LE_NONNULL tel)le_result_t le_sms_EnableStatusReport(void)void(* le_sms_RxMessageHandlerFunc_t)(le_sms_MsgRef_t msgRef, void *contextPtr)Definition: le_sms_common.h:570le_result_t le_sms_GetSenderTel(le_sms_MsgRef_t msgRef, char *tel, size_t telSize)le_result_t le_sms_DisableStatusReport(void)void le_sms_RemoveRxMessageHandler(le_sms_RxMessageHandlerRef_t handlerRef)void le_sms_ResetCount(void)void le_sms_MarkRead(le_sms_MsgRef_t msgRef)le_result_t le_sms_SetBinary(le_sms_MsgRef_t msgRef, const uint8_t *binPtr, size_t binSize)void le_sms_MarkUnread(le_sms_MsgRef_t msgRef)le_result_t le_sms_GetTpDt(le_sms_MsgRef_t msgRef, char *dt, size_t dtSize)le_sms_Status_t le_sms_GetStatus(le_sms_MsgRef_t msgRef)le_result_t le_sms_DeactivateCellBroadcast(void)void(* le_sms_FullStorageHandlerFunc_t)(le_sms_Storage_t storage, void *contextPtr)Definition: le_sms_common.h:584le_result_t le_sms_GetCellBroadcastId(le_sms_MsgRef_t msgRef, uint16_t *messageIdPtr)le_result_t le_sms_GetTimeStamp(le_sms_MsgRef_t msgRef, char *timestamp, size_t timestampSize)le_sms_RxMessageHandlerRef_t le_sms_AddRxMessageHandler(le_sms_RxMessageHandlerFunc_t handlerPtr, void *contextPtr)le_sms_MsgRef_t le_sms_SendText(const char *LE_NONNULL destStr, const char *LE_NONNULL textStr, le_sms_CallbackResultFunc_t handlerPtr, void *contextPtr)void(* le_sms_CallbackResultFunc_t)(le_sms_MsgRef_t msgRef, le_sms_Status_t status, void *contextPtr)Definition: le_sms_common.h:554struct le_sms_FullStorageEventHandler * le_sms_FullStorageEventHandlerRef_tDefinition: le_sms_common.h:545le_result_t le_sms_DeleteFromStorage(le_sms_MsgRef_t msgRef)