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()398 //--------------------------------------------------------------------------------------------------402 //--------------------------------------------------------------------------------------------------405 //--------------------------------------------------------------------------------------------------408 * Connect the current client thread to the service providing this API. Block until the service is411 * For each thread that wants to use this API, either ConnectService or TryConnectService must be412 * called before any other functions in this API. Normally, ConnectService is automatically called417 //--------------------------------------------------------------------------------------------------423 //--------------------------------------------------------------------------------------------------426 * Try to connect the current client thread to the service providing this API. Return with an error429 * For each thread that wants to use this API, either ConnectService or TryConnectService must be430 * called before any other functions in this API. Normally, ConnectService is automatically called439 * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).442 //--------------------------------------------------------------------------------------------------448 //--------------------------------------------------------------------------------------------------452 * When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants455 //--------------------------------------------------------------------------------------------------462 //--------------------------------------------------------------------------------------------------468 * longer a connection to the service, and the functions in this API can't be used. For details, see473 //--------------------------------------------------------------------------------------------------480 //--------------------------------------------------------------------------------------------------484 //--------------------------------------------------------------------------------------------------487 //--------------------------------------------------------------------------------------------------491 //--------------------------------------------------------------------------------------------------494 //--------------------------------------------------------------------------------------------------498 //--------------------------------------------------------------------------------------------------501 //--------------------------------------------------------------------------------------------------505 //--------------------------------------------------------------------------------------------------508 //--------------------------------------------------------------------------------------------------512 //--------------------------------------------------------------------------------------------------515 //--------------------------------------------------------------------------------------------------519 //--------------------------------------------------------------------------------------------------522 //--------------------------------------------------------------------------------------------------526 //--------------------------------------------------------------------------------------------------529 //--------------------------------------------------------------------------------------------------533 //--------------------------------------------------------------------------------------------------536 //--------------------------------------------------------------------------------------------------540 //--------------------------------------------------------------------------------------------------543 //--------------------------------------------------------------------------------------------------547 //--------------------------------------------------------------------------------------------------550 //--------------------------------------------------------------------------------------------------554 //--------------------------------------------------------------------------------------------------557 //--------------------------------------------------------------------------------------------------562 //--------------------------------------------------------------------------------------------------565 //--------------------------------------------------------------------------------------------------569 //--------------------------------------------------------------------------------------------------572 //--------------------------------------------------------------------------------------------------577 //--------------------------------------------------------------------------------------------------580 //--------------------------------------------------------------------------------------------------584 //--------------------------------------------------------------------------------------------------587 //--------------------------------------------------------------------------------------------------594 //--------------------------------------------------------------------------------------------------603 //--------------------------------------------------------------------------------------------------607 //--------------------------------------------------------------------------------------------------614 //--------------------------------------------------------------------------------------------------621 //--------------------------------------------------------------------------------------------------630 //--------------------------------------------------------------------------------------------------634 //--------------------------------------------------------------------------------------------------641 //--------------------------------------------------------------------------------------------------651 //--------------------------------------------------------------------------------------------------657 //--------------------------------------------------------------------------------------------------673 //--------------------------------------------------------------------------------------------------682 //--------------------------------------------------------------------------------------------------693 * @note If telephone destination number is too long is too long (max LE_MDMDEFS_PHONE_NUM_MAX_LEN699 //--------------------------------------------------------------------------------------------------708 //--------------------------------------------------------------------------------------------------725 //--------------------------------------------------------------------------------------------------734 //--------------------------------------------------------------------------------------------------748 //--------------------------------------------------------------------------------------------------759 //--------------------------------------------------------------------------------------------------774 //--------------------------------------------------------------------------------------------------785 //--------------------------------------------------------------------------------------------------793 * @note If length of the data is too long (max LE_SMS_PDU_MAX_BYTES bytes), it is a fatal error,799 //--------------------------------------------------------------------------------------------------810 //--------------------------------------------------------------------------------------------------825 //--------------------------------------------------------------------------------------------------832 //--------------------------------------------------------------------------------------------------847 //--------------------------------------------------------------------------------------------------858 //--------------------------------------------------------------------------------------------------870 //--------------------------------------------------------------------------------------------------877 //--------------------------------------------------------------------------------------------------888 //--------------------------------------------------------------------------------------------------899 //--------------------------------------------------------------------------------------------------903 * Refer to @ref platformConstraintsSpecificErrorCodes for platform specific error code description.910 //--------------------------------------------------------------------------------------------------917 //--------------------------------------------------------------------------------------------------925 * @note If telephone destination number is too long is too long (max LE_MDMDEFS_PHONE_NUM_MAX_LEN930 //--------------------------------------------------------------------------------------------------943 //--------------------------------------------------------------------------------------------------952 //--------------------------------------------------------------------------------------------------965 //--------------------------------------------------------------------------------------------------977 //--------------------------------------------------------------------------------------------------984 //--------------------------------------------------------------------------------------------------994 //--------------------------------------------------------------------------------------------------1001 //--------------------------------------------------------------------------------------------------1010 //--------------------------------------------------------------------------------------------------1017 //--------------------------------------------------------------------------------------------------1028 //--------------------------------------------------------------------------------------------------1037 //--------------------------------------------------------------------------------------------------1048 //--------------------------------------------------------------------------------------------------1057 //--------------------------------------------------------------------------------------------------1061 * Output parameter is updated with the Telephone number. If the Telephone number string exceeds1072 //--------------------------------------------------------------------------------------------------1083 //--------------------------------------------------------------------------------------------------1088 * value of 'len' parameter, a LE_OVERFLOW error code is returned and 'timestamp' is filled until1098 //--------------------------------------------------------------------------------------------------1114 //--------------------------------------------------------------------------------------------------1118 * @return Number of characters for text and UCS2 messages, or the length of the data in bytes for1124 //--------------------------------------------------------------------------------------------------1131 //--------------------------------------------------------------------------------------------------1136 * exceeds the value of 'len' parameter, LE_OVERFLOW error code is returned and 'text' is filled1145 //--------------------------------------------------------------------------------------------------1156 //--------------------------------------------------------------------------------------------------1171 //--------------------------------------------------------------------------------------------------1182 //--------------------------------------------------------------------------------------------------1196 //--------------------------------------------------------------------------------------------------1207 //--------------------------------------------------------------------------------------------------1212 * in bytes. If the PDU data exceed the value of 'len' input parameter, a LE_OVERFLOW error code is1222 //--------------------------------------------------------------------------------------------------1233 //--------------------------------------------------------------------------------------------------1242 //--------------------------------------------------------------------------------------------------1249 //--------------------------------------------------------------------------------------------------1263 //--------------------------------------------------------------------------------------------------1270 //--------------------------------------------------------------------------------------------------1278 //--------------------------------------------------------------------------------------------------1284 //--------------------------------------------------------------------------------------------------1293 //--------------------------------------------------------------------------------------------------1300 //--------------------------------------------------------------------------------------------------1311 //--------------------------------------------------------------------------------------------------1318 //--------------------------------------------------------------------------------------------------1329 //--------------------------------------------------------------------------------------------------1336 //--------------------------------------------------------------------------------------------------1346 //--------------------------------------------------------------------------------------------------1353 //--------------------------------------------------------------------------------------------------1360 //--------------------------------------------------------------------------------------------------1367 //--------------------------------------------------------------------------------------------------1374 //--------------------------------------------------------------------------------------------------1381 //--------------------------------------------------------------------------------------------------1385 * Output parameter is updated with the SMS Service center address. If the Telephone number string exceeds1395 //--------------------------------------------------------------------------------------------------1404 //--------------------------------------------------------------------------------------------------1409 * E.164 numbers can have a maximum of fifteen digits and are usually written with a '+' prefix.1415 * @note If the SMS center address number is too long (max LE_MDMDEFS_PHONE_NUM_MAX_LEN digits), it1418 //--------------------------------------------------------------------------------------------------1425 //--------------------------------------------------------------------------------------------------1432 //--------------------------------------------------------------------------------------------------1439 //--------------------------------------------------------------------------------------------------1446 //--------------------------------------------------------------------------------------------------1453 //--------------------------------------------------------------------------------------------------1461 //--------------------------------------------------------------------------------------------------1467 //--------------------------------------------------------------------------------------------------1475 //--------------------------------------------------------------------------------------------------1481 //--------------------------------------------------------------------------------------------------1489 //--------------------------------------------------------------------------------------------------1495 //--------------------------------------------------------------------------------------------------1503 //--------------------------------------------------------------------------------------------------1509 //--------------------------------------------------------------------------------------------------1517 //--------------------------------------------------------------------------------------------------1526 //--------------------------------------------------------------------------------------------------1534 //--------------------------------------------------------------------------------------------------1543 //--------------------------------------------------------------------------------------------------1551 //--------------------------------------------------------------------------------------------------1557 //--------------------------------------------------------------------------------------------------1566 //--------------------------------------------------------------------------------------------------1578 //--------------------------------------------------------------------------------------------------1587 //--------------------------------------------------------------------------------------------------1599 //--------------------------------------------------------------------------------------------------1607 //--------------------------------------------------------------------------------------------------1613 //--------------------------------------------------------------------------------------------------1624 //--------------------------------------------------------------------------------------------------1633 //--------------------------------------------------------------------------------------------------1637 //--------------------------------------------------------------------------------------------------1643 //--------------------------------------------------------------------------------------------------1647 //--------------------------------------------------------------------------------------------------1653 //--------------------------------------------------------------------------------------------------1657 //--------------------------------------------------------------------------------------------------1663 //--------------------------------------------------------------------------------------------------1671 //--------------------------------------------------------------------------------------------------1677 //--------------------------------------------------------------------------------------------------1685 //--------------------------------------------------------------------------------------------------1691 //--------------------------------------------------------------------------------------------------1700 //--------------------------------------------------------------------------------------------------1707 //--------------------------------------------------------------------------------------------------1709 * Get TP-Message-Reference of a message. Message type should be either a SMS Status Report or an1719 //--------------------------------------------------------------------------------------------------1728 //--------------------------------------------------------------------------------------------------1740 //--------------------------------------------------------------------------------------------------1754 //--------------------------------------------------------------------------------------------------1765 //--------------------------------------------------------------------------------------------------1776 //--------------------------------------------------------------------------------------------------1787 //--------------------------------------------------------------------------------------------------1798 //--------------------------------------------------------------------------------------------------1808 //--------------------------------------------------------------------------------------------------LE_FULL_API void le_sms_SetServerDisconnectHandler(le_sms_DisconnectHandler_t disconnectHandler, void *contextPtr)void le_sms_Delete(le_sms_MsgRef_t msgRef)le_result_t le_sms_GetPDU(le_sms_MsgRef_t msgRef, uint8_t *pduPtr, size_t *pduSizePtr)le_result_t le_sms_GetCellBroadcastId(le_sms_MsgRef_t msgRef, uint16_t *messageIdPtr)le_result_t le_sms_ClearCdmaCellBroadcastServices(void)le_result_t le_sms_GetSmsCenterAddress(char *tel, size_t telSize)void le_sms_StartCount(void)le_sms_ErrorCode3GPP2_t le_sms_Get3GPP2ErrorCode(le_sms_MsgRef_t msgRef)le_result_t le_sms_ClearCellBroadcastIds(void)void le_sms_MarkUnread(le_sms_MsgRef_t msgRef)le_sms_MsgRef_t le_sms_Create(void)le_result_t le_sms_SetUCS2(le_sms_MsgRef_t msgRef, const uint16_t *ucs2Ptr, size_t ucs2Size)size_t le_sms_GetUserdataLen(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_SetTimeout(le_sms_MsgRef_t msgRef, uint32_t timeout)le_sms_MsgRef_t le_sms_SendPdu(const uint8_t *pduPtr, size_t pduSize, le_sms_CallbackResultFunc_t handlerPtr, void *contextPtr)void(* le_sms_DisconnectHandler_t)(void *)Definition: le_sms_interface.h:403void le_sms_GetErrorCode(le_sms_MsgRef_t msgRef, le_sms_ErrorCode_t *rpCausePtr, le_sms_ErrorCode_t *tpCausePtr)le_result_t le_sms_ActivateCellBroadcast(void)le_sms_MsgRef_t le_sms_GetNext(le_sms_MsgListRef_t msgListRef)le_result_t le_sms_GetBinary(le_sms_MsgRef_t msgRef, uint8_t *binPtr, size_t *binSizePtr)le_sms_MsgListRef_t le_sms_CreateRxMsgList(void)void le_sms_RemoveRxMessageHandler(le_sms_RxMessageHandlerRef_t handlerRef)le_result_t le_sms_GetText(le_sms_MsgRef_t msgRef, char *text, size_t textSize)le_result_t le_sms_ActivateCdmaCellBroadcast(void)le_sms_FullStorageEventHandlerRef_t le_sms_AddFullStorageEventHandler(le_sms_FullStorageHandlerFunc_t handlerPtr, void *contextPtr)le_result_t le_sms_DeactivateCellBroadcast(void)le_result_t le_sms_GetCellBroadcastSerialNumber(le_sms_MsgRef_t msgRef, uint16_t *serialNumberPtr)le_result_t le_sms_DisableStatusReport(void)void le_sms_DisconnectService(void)le_result_t le_sms_TryConnectService(void)le_result_t le_sms_AddCellBroadcastIds(uint16_t fromId, uint16_t toId)le_result_t le_sms_SetText(le_sms_MsgRef_t msgRef, const char *LE_NONNULL text)le_result_t le_sms_SetBinary(le_sms_MsgRef_t msgRef, const uint8_t *binPtr, size_t binSize)le_result_t le_sms_SetPreferredStorage(le_sms_Storage_t prefStorage)le_result_t le_sms_DeleteFromStorage(le_sms_MsgRef_t msgRef)le_result_t le_sms_GetUCS2(le_sms_MsgRef_t msgRef, uint16_t *ucs2Ptr, size_t *ucs2SizePtr)le_result_t le_sms_GetSenderTel(le_sms_MsgRef_t msgRef, char *tel, size_t telSize)le_result_t le_sms_SendAsync(le_sms_MsgRef_t msgRef, le_sms_CallbackResultFunc_t handlerPtr, void *contextPtr)le_sms_Status_t le_sms_GetStatus(le_sms_MsgRef_t msgRef)le_result_t le_sms_GetPreferredStorage(le_sms_Storage_t *prefStoragePtr)size_t le_sms_GetPDULen(le_sms_MsgRef_t msgRef)le_result_t le_sms_DeactivateCdmaCellBroadcast(void)le_result_t le_sms_RemoveCdmaCellBroadcastServices(le_sms_CdmaServiceCat_t serviceCat, le_sms_Languages_t language)le_result_t le_sms_SetSmsCenterAddress(const char *LE_NONNULL tel)le_sms_MsgRef_t le_sms_GetFirst(le_sms_MsgListRef_t msgListRef)void le_sms_ResetCount(void)le_result_t le_sms_SetPDU(le_sms_MsgRef_t msgRef, const uint8_t *pduPtr, size_t pduSize)le_result_t le_sms_RemoveCellBroadcastIds(uint16_t fromId, uint16_t toId)void le_sms_ConnectService(void)le_sms_MsgRef_t le_sms_SendText(const char *LE_NONNULL destStr, const char *LE_NONNULL textStr, le_sms_CallbackResultFunc_t handlerPtr, void *contextPtr)le_result_t le_sms_SetDestination(le_sms_MsgRef_t msgRef, const char *LE_NONNULL dest)le_result_t le_sms_GetTpDt(le_sms_MsgRef_t msgRef, char *dt, size_t dtSize)le_result_t le_sms_AddCdmaCellBroadcastServices(le_sms_CdmaServiceCat_t serviceCat, le_sms_Languages_t language)le_result_t le_sms_GetTpMr(le_sms_MsgRef_t msgRef, uint8_t *tpMrPtr)le_result_t le_sms_EnableStatusReport(void)le_sms_Format_t le_sms_GetFormat(le_sms_MsgRef_t msgRef)int32_t le_sms_GetPlatformSpecificErrorCode(le_sms_MsgRef_t msgRef)le_result_t le_sms_GetCount(le_sms_Type_t messageType, int32_t *messageCountPtr)le_sms_Type_t le_sms_GetType(le_sms_MsgRef_t msgRef)void le_sms_RemoveFullStorageEventHandler(le_sms_FullStorageEventHandlerRef_t handlerRef)le_result_t le_sms_GetTpSt(le_sms_MsgRef_t msgRef, uint8_t *stPtr)le_result_t le_sms_GetTimeStamp(le_sms_MsgRef_t msgRef, char *timestamp, size_t timestampSize)le_result_t le_sms_Send(le_sms_MsgRef_t msgRef)void le_sms_DeleteList(le_sms_MsgListRef_t msgListRef)le_sms_RxMessageHandlerRef_t le_sms_AddRxMessageHandler(le_sms_RxMessageHandlerFunc_t handlerPtr, void *contextPtr)le_result_t le_sms_IsStatusReportEnabled(bool *enabledPtr)void le_sms_MarkRead(le_sms_MsgRef_t msgRef)le_result_t le_sms_GetTpScTs(le_sms_MsgRef_t msgRef, char *scts, size_t sctsSize)void le_sms_StopCount(void)