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 //--------------------------------------------------------------------------------------------------668 * @note If telephone destination number is too long is too long (max LE_MDMDEFS_PHONE_NUM_MAX_LEN674 //--------------------------------------------------------------------------------------------------683 //--------------------------------------------------------------------------------------------------700 //--------------------------------------------------------------------------------------------------709 //--------------------------------------------------------------------------------------------------723 //--------------------------------------------------------------------------------------------------734 //--------------------------------------------------------------------------------------------------749 //--------------------------------------------------------------------------------------------------760 //--------------------------------------------------------------------------------------------------768 * @note If length of the data is too long (max LE_SMS_PDU_MAX_BYTES bytes), it is a fatal error,774 //--------------------------------------------------------------------------------------------------785 //--------------------------------------------------------------------------------------------------800 //--------------------------------------------------------------------------------------------------807 //--------------------------------------------------------------------------------------------------822 //--------------------------------------------------------------------------------------------------833 //--------------------------------------------------------------------------------------------------845 //--------------------------------------------------------------------------------------------------852 //--------------------------------------------------------------------------------------------------863 //--------------------------------------------------------------------------------------------------874 //--------------------------------------------------------------------------------------------------878 * Refer to @ref platformConstraintsSpecificErrorCodes for platform specific error code description.885 //--------------------------------------------------------------------------------------------------892 //--------------------------------------------------------------------------------------------------900 * @note If telephone destination number is too long is too long (max LE_MDMDEFS_PHONE_NUM_MAX_LEN905 //--------------------------------------------------------------------------------------------------918 //--------------------------------------------------------------------------------------------------927 //--------------------------------------------------------------------------------------------------940 //--------------------------------------------------------------------------------------------------952 //--------------------------------------------------------------------------------------------------959 //--------------------------------------------------------------------------------------------------969 //--------------------------------------------------------------------------------------------------976 //--------------------------------------------------------------------------------------------------985 //--------------------------------------------------------------------------------------------------992 //--------------------------------------------------------------------------------------------------1003 //--------------------------------------------------------------------------------------------------1012 //--------------------------------------------------------------------------------------------------1023 //--------------------------------------------------------------------------------------------------1032 //--------------------------------------------------------------------------------------------------1036 * Output parameter is updated with the Telephone number. If the Telephone number string exceeds1047 //--------------------------------------------------------------------------------------------------1058 //--------------------------------------------------------------------------------------------------1063 * value of 'len' parameter, a LE_OVERFLOW error code is returned and 'timestamp' is filled until1073 //--------------------------------------------------------------------------------------------------1089 //--------------------------------------------------------------------------------------------------1093 * @return Number of characters for text and UCS2 messages, or the length of the data in bytes for1099 //--------------------------------------------------------------------------------------------------1106 //--------------------------------------------------------------------------------------------------1111 * exceeds the value of 'len' parameter, LE_OVERFLOW error code is returned and 'text' is filled1120 //--------------------------------------------------------------------------------------------------1131 //--------------------------------------------------------------------------------------------------1146 //--------------------------------------------------------------------------------------------------1157 //--------------------------------------------------------------------------------------------------1171 //--------------------------------------------------------------------------------------------------1182 //--------------------------------------------------------------------------------------------------1187 * in bytes. If the PDU data exceed the value of 'len' input parameter, a LE_OVERFLOW error code is1197 //--------------------------------------------------------------------------------------------------1208 //--------------------------------------------------------------------------------------------------1217 //--------------------------------------------------------------------------------------------------1224 //--------------------------------------------------------------------------------------------------1238 //--------------------------------------------------------------------------------------------------1245 //--------------------------------------------------------------------------------------------------1253 //--------------------------------------------------------------------------------------------------1259 //--------------------------------------------------------------------------------------------------1268 //--------------------------------------------------------------------------------------------------1275 //--------------------------------------------------------------------------------------------------1286 //--------------------------------------------------------------------------------------------------1293 //--------------------------------------------------------------------------------------------------1304 //--------------------------------------------------------------------------------------------------1311 //--------------------------------------------------------------------------------------------------1321 //--------------------------------------------------------------------------------------------------1328 //--------------------------------------------------------------------------------------------------1335 //--------------------------------------------------------------------------------------------------1342 //--------------------------------------------------------------------------------------------------1349 //--------------------------------------------------------------------------------------------------1356 //--------------------------------------------------------------------------------------------------1360 * Output parameter is updated with the SMS Service center address. If the Telephone number string exceeds1370 //--------------------------------------------------------------------------------------------------1379 //--------------------------------------------------------------------------------------------------1384 * E.164 numbers can have a maximum of fifteen digits and are usually written with a '+' prefix.1390 * @note If the SMS center address number is too long (max LE_MDMDEFS_PHONE_NUM_MAX_LEN digits), it1393 //--------------------------------------------------------------------------------------------------1400 //--------------------------------------------------------------------------------------------------1407 //--------------------------------------------------------------------------------------------------1414 //--------------------------------------------------------------------------------------------------1421 //--------------------------------------------------------------------------------------------------1428 //--------------------------------------------------------------------------------------------------1436 //--------------------------------------------------------------------------------------------------1442 //--------------------------------------------------------------------------------------------------1450 //--------------------------------------------------------------------------------------------------1456 //--------------------------------------------------------------------------------------------------1464 //--------------------------------------------------------------------------------------------------1470 //--------------------------------------------------------------------------------------------------1478 //--------------------------------------------------------------------------------------------------1484 //--------------------------------------------------------------------------------------------------1492 //--------------------------------------------------------------------------------------------------1501 //--------------------------------------------------------------------------------------------------1509 //--------------------------------------------------------------------------------------------------1518 //--------------------------------------------------------------------------------------------------1526 //--------------------------------------------------------------------------------------------------1532 //--------------------------------------------------------------------------------------------------1541 //--------------------------------------------------------------------------------------------------1553 //--------------------------------------------------------------------------------------------------1562 //--------------------------------------------------------------------------------------------------1574 //--------------------------------------------------------------------------------------------------1582 //--------------------------------------------------------------------------------------------------1588 //--------------------------------------------------------------------------------------------------1599 //--------------------------------------------------------------------------------------------------1608 //--------------------------------------------------------------------------------------------------1612 //--------------------------------------------------------------------------------------------------1618 //--------------------------------------------------------------------------------------------------1622 //--------------------------------------------------------------------------------------------------1628 //--------------------------------------------------------------------------------------------------1632 //--------------------------------------------------------------------------------------------------1638 //--------------------------------------------------------------------------------------------------1646 //--------------------------------------------------------------------------------------------------1652 //--------------------------------------------------------------------------------------------------1660 //--------------------------------------------------------------------------------------------------1666 //--------------------------------------------------------------------------------------------------1675 //--------------------------------------------------------------------------------------------------1682 //--------------------------------------------------------------------------------------------------1684 * Get TP-Message-Reference of a message. Message type should be either a SMS Status Report or an1694 //--------------------------------------------------------------------------------------------------1703 //--------------------------------------------------------------------------------------------------1715 //--------------------------------------------------------------------------------------------------1729 //--------------------------------------------------------------------------------------------------1740 //--------------------------------------------------------------------------------------------------1751 //--------------------------------------------------------------------------------------------------1762 //--------------------------------------------------------------------------------------------------1773 //--------------------------------------------------------------------------------------------------1783 //--------------------------------------------------------------------------------------------------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_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)