# SMS

**Detailed Description**

This section contains APIs related to Sending and Receiving SMS.

- *group* Telematics\_sms

    - Typedefs

- using PduBuffer = std::vector&lt;uint8\_t&gt;

    - 

- using SmsResponseCb = std::function&lt;void(std::vector&lt;int&gt; msgRefs, [telux](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv45telux)::[common](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6commonE)::[ErrorCode](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6common9ErrorCodeE) errorCode)&gt;

    - This function is called in response to sending a single part or multi-part SMS. This response callback is invoked when a single part message is sent or when all the parts of a multi-part message is sent. This function is called in response to [telux::tel::ISmsManager::sendSms](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#a00758_1af7cb6eecd5028f4806fccd255b45e435) and [telux::tel::ISmsManager::sendRawSms](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#a00758_1aace42f8e31570b802f5e35c81e510be1) APIs.

The callback can be invoked from multiple different threads. The implementation should be thread safe.

- Param msgRefs:

    - **[in]** This parameter represent the unique message reference number(s) corresponding to single/multi-part message that we successfully sent. When part of a message is delivered, the notification API i.e [telux::tel::ISmsListener::onDeliveryReport](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#a00759_1a18e2df87d3333c45ef14d22cdbd4266c) will be invoked with the message reference number corresponding to that part.

- Param errorCode:

    - **[in]** If sending any part of a multi-part message fails or a single part message fails this API will return an telux:common::ErrorCode corresponding to the failure.

- using RequestSmsInfoListCb = std::function&lt;void(std::vector&lt;SmsMetaInfo&gt; infos, [telux](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv45telux)::[common](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6commonE)::[ErrorCode](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6common9ErrorCodeE) errorCode)&gt;

    - This function can be invoked in response to getting a list of message information for the messages saved in SIM storage. To get message detail at a specific index on storage, [telux::tel::ISmsManager::readMessage](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#a00758_1a492da99234c9ac1727673b3f57a68007) API should be invoked. The callback can be invoked from multiple different threads. The implementation should be thread-safe.

- Param infos:

    - **[in]** List of SMS message meta information i.e [telux::tel::SmsMetaInfo](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#a00754).

- Param errorCode:

    - **[in]** Return code which indicates whether the operation succeeded or not. [telux::common::ErrorCode](https://docs.qualcomm.com/doc/80-PF458-2/topic/enum_a00023_1ga84acdb74b7d34616b1ca497c7369810d.html#a00023_1ga84acdb74b7d34616b1ca497c7369810d).

- using ReadSmsMessageCb = std::function&lt;void(SmsMessage message, [telux](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv45telux)::[common](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6commonE)::[ErrorCode](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6common9ErrorCodeE) errorCode)&gt;

    - This function can be invoked in response to reading SMS message on SIM storage. The callback can be from multiple different threads. The implementation should be thread-safe.

- Param message:

    - **[in]** [telux::tel::SmsMessage](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#a00757)

- Param errorCode:

    - **[in]** Return code which indicates whether the operation succeeded or not. [telux::common::ErrorCode](https://docs.qualcomm.com/doc/80-PF458-2/topic/enum_a00023_1ga84acdb74b7d34616b1ca497c7369810d.html#a00023_1ga84acdb74b7d34616b1ca497c7369810d).

- using RequestPreferredStorageCb = std::function&lt;void([StorageType](https://docs.qualcomm.com/doc/80-PF458-2/topic/sms.html#_CPPv411StorageType) type, [telux](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv45telux)::[common](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6commonE)::[ErrorCode](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6common9ErrorCodeE) errorCode)&gt;

    - This function can be invoked in response to request for preferred SMS storage. The callback can be from multiple different threads. The implementation should be thread-safe.

- Param type:

    - **[in]** Preferred [telux::tel::StorageType](https://docs.qualcomm.com/doc/80-PF458-2/topic/enum_a00024_1gafdc2a3741609d551c22fc6e6e88557c0.html#a00024_1gafdc2a3741609d551c22fc6e6e88557c0)

- Param errorCode:

    - **[in]** Return code which indicates whether the operation succeeded or not. [telux::common::ErrorCode](https://docs.qualcomm.com/doc/80-PF458-2/topic/enum_a00023_1ga84acdb74b7d34616b1ca497c7369810d.html#a00023_1ga84acdb74b7d34616b1ca497c7369810d).

- using RequestStorageDetailsCb = std::function&lt;void(uint32\_t maxCount, uint32\_t availableCount, [telux](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv45telux)::[common](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6commonE)::[ErrorCode](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6common9ErrorCodeE) errorCode)&gt;

    - This function can be invoked in response to request for storage details. The callback can be from multiple different threads. The implementation should be thread-safe.

- Param maxCount:

    - **[in]** Maximum number of messages allowed for SIM storage.

- Param availableCount:

    - **[in]** Available count in terms of SIM messages.

- Param errorCode:

    - **[in]** Return code which indicates whether the operation succeeded or not. [telux::common::ErrorCode](https://docs.qualcomm.com/doc/80-PF458-2/topic/enum_a00023_1ga84acdb74b7d34616b1ca497c7369810d.html#a00023_1ga84acdb74b7d34616b1ca497c7369810d).

Enums

- enum SmsEncoding

    - Specifies the encoding of the SMS message.

*Values:*

- enumerator GSM7

    - GSM 7-bit default alphabet encoding

- enumerator GSM8

    - GSM 8-bit data encoding

- enumerator UCS2

    - UCS-2 encoding

- enumerator UNKNOWN

    - Unknown encoding

- enum SmsTagType

    - Specifies the SMS tag type. All incoming messages will be received and stored with tag as MT\_NOT\_READ. It is the client’s responsibility to update the tag to MT\_READ using [telux::tel::ISmsManager::setTag](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#a00758_1ae56b70674b381ef53c0f86a0ad1599e6) whenever the message is considered read.

*Values:*

- enumerator UNKNOWN

    - Unknown tag type

- enumerator MT\_READ

    - MT message marked as read

- enumerator MT\_NOT\_READ

    - MT message marked as not read

- enum DeleteType

    - Specifies the type of delete operation to be performed.

*Values:*

- enumerator UNKNOWN

    - Unknown delete type

- enumerator DELETE\_ALL

    - Delete all message from memory storage

- enumerator DELETE\_MESSAGES\_BY\_TAG

    - Deletes all messages from the memory storage that match the specific message tag

- enumerator DELETE\_MSG\_AT\_INDEX

    - Deletes only the message at the specific index from the memory storage

- enum StorageType

    - Specifies the SMS storage type for incoming message.

*Values:*

- enumerator UNKNOWN

    - Unknown storage type

- enumerator NONE

    - This indicates SMS not stored on any of storage and is directly notified to client. This is the default storage type

- enumerator SIM

    - This indicates SMS is stored on SIM

- struct DeleteInfo

    - Specify delete information used for deleting message on storage.

Public Members

- [DeleteType](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux3tel10DeleteTypeE) delType

    - Specifies the type of delete operation to be performed

- [SmsTagType](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux3tel10SmsTagTypeE) tagType

    - 1. If SMS tag type is set to telux::tel::SmsTagType::UNKNOWN and delType is set to telux::tel::DeleteType::DELETE\_ALL then all messages on the storage would be deleted.

    2. To delete all messages of a particular tag, set tagType to the particular tag like telux::tel::SmsTagType::MT\_READ and delType to telux::tel::DeleteType::DELETE\_MESSAGES\_BY\_TAG

- uint32\_t msgIndex

    - To delete message at specific index, specify msgIndex and delType as telux::tel::DeleteType::DELETE\_MSG\_AT\_INDEX

- struct SmsMetaInfo

    - Provides certain attributes of an SMS message.

Public Members

- uint32\_t msgIndex

    - Message index on storage

- [SmsTagType](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux3tel10SmsTagTypeE) tagType

    - SMS tag type

- struct MessageAttributes

    - Contains structure of message attributes like encoding type, number of segments, characters left in last segment.

Public Members

- [SmsEncoding](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux3tel11SmsEncodingE) encoding

    - Data encoding type

- int numberOfSegments

    - Number of segments

- int segmentSize

    - Max size of each segment

- int numberOfCharsLeftInLastSegment

    - characters left in last segment

- struct MessagePartInfo

    - Structure containing information about the part of multi-part SMS such as concatenated message reference number, number of segments and segment number. During concatenation this information along with originating address helps in associating each part of the multi-part message to the corresponding multi-part message.

Public Members

- uint16\_t refNumber

    - Concatenated message reference number as per spec 3GPP TS 23.040 9.2.3.24.1. For each part of multipart message this message reference will be the same

- uint8\_t numberOfSegments

    - Number of segments

- uint8\_t segmentNumber

    - Segment Number

- class SmsMessage

    - Data structure represents an incoming SMS. This is applicable for single part message or part of the multipart message.

Public Functions

- SmsMessage(std::string text, std::string sender, std::string receiver, [SmsEncoding](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux3tel11SmsEncodingE) encoding, std::string pdu, [PduBuffer](https://docs.qualcomm.com/doc/80-PF458-2/topic/typedef_a00024_1ga825d3b6839aabec296ad91ffe5c4ab2c.html#_CPPv4N5telux3tel9PduBufferE) pduBuffer, std::shared\_ptr&lt;[MessagePartInfo](https://docs.qualcomm.com/doc/80-PF458-2/topic/struct_a00756.html#_CPPv4N5telux3tel15MessagePartInfoE)&gt; info)

    - 

- SmsMessage(std::string text, std::string sender, std::string receiver, [SmsEncoding](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux3tel11SmsEncodingE) encoding, std::string pdu, [PduBuffer](https://docs.qualcomm.com/doc/80-PF458-2/topic/typedef_a00024_1ga825d3b6839aabec296ad91ffe5c4ab2c.html#_CPPv4N5telux3tel9PduBufferE) pduBuffer, std::shared\_ptr&lt;[MessagePartInfo](https://docs.qualcomm.com/doc/80-PF458-2/topic/struct_a00756.html#_CPPv4N5telux3tel15MessagePartInfoE)&gt; info, bool isMetaInfoValid, [SmsMetaInfo](https://docs.qualcomm.com/doc/80-PF458-2/topic/struct_a00754.html#_CPPv4N5telux3tel11SmsMetaInfoE) metaInfo)

    - 

- const std::string &getText() const

    - Get the message text for the single part message or part of the multipart message.

- Returns:

    - String containing SMS message.

- const std::string &getSender() const

    - Get the originating address (sender address).

- Returns:

    - String containing sender address.

- const std::string &getReceiver() const

    - Get the destination address (receiver address).

- Returns:

    - String containing receiver address

- [SmsEncoding](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux3tel11SmsEncodingE) getEncoding() const

    - Get encoding format used for the single part message or part of the multipart message.

- Returns:

    - SMS message encoding used.

- const std::string &getPdu() const

    - Get the raw PDU for the single part message or part of the multipart message.

Deprecated Use API [SmsMessage::getRawPdu](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#a00757_1afe0ef27ec44593ab387fc21f7a324a05)

- Returns:

    - String containing raw PDU content.

- [PduBuffer](https://docs.qualcomm.com/doc/80-PF458-2/topic/typedef_a00024_1ga825d3b6839aabec296ad91ffe5c4ab2c.html#_CPPv4N5telux3tel9PduBufferE) getRawPdu() const

    - Get the raw PDU buffer for the single part message or part of the multipart message.

- Returns:

    - Buffer containing raw PDU content.

- std::shared\_ptr&lt;[MessagePartInfo](https://docs.qualcomm.com/doc/80-PF458-2/topic/struct_a00756.html#_CPPv4N5telux3tel15MessagePartInfoE)&gt; getMessagePartInfo()

    - Applicable for multi-part SMS only. Get the information such as segment number, number of segments and concatenated reference number corresponding to the part of multi-part SMS.

- Returns:

    - If a message is single part SMS the method returns null otherwise returns message part information.

- const std::string toString() const

    - Get the text related informative representation of this object.

- Returns:

    - String containing informative string.

- [telux](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv45telux)::[common](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6commonE)::[Status](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6common6StatusE) getMetaInfo([SmsMetaInfo](https://docs.qualcomm.com/doc/80-PF458-2/topic/struct_a00754.html#_CPPv4N5telux3tel11SmsMetaInfoE) &metaInfo)

    - Get meta information of SMS stored in storage. There is no meta information when storage type is none.

- Parameters:

    - **metaInfo** – **[out]** Meta information about SMS message stored in storage.

- Returns:

    - Status of getMetaInfo i.e. success or suitable error code.

Private Members

- std::string text\_

    - Message text

- std::string sender\_

    - Originating address (sender)

- std::string receiver\_

    - Destination address (receiver)

- [SmsEncoding](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux3tel11SmsEncodingE) encoding\_

    - Encoding of the SMS message

- std::string pdu\_

    - Raw PDU content. This is deprecated use rawPdu\_

- [PduBuffer](https://docs.qualcomm.com/doc/80-PF458-2/topic/typedef_a00024_1ga825d3b6839aabec296ad91ffe5c4ab2c.html#_CPPv4N5telux3tel9PduBufferE) rawPdu\_

    - Raw PDU content

- std::shared\_ptr&lt;[MessagePartInfo](https://docs.qualcomm.com/doc/80-PF458-2/topic/struct_a00756.html#_CPPv4N5telux3tel15MessagePartInfoE)&gt; msgPartInfo\_

    - Information related to part of multi-part message

- bool isMetaInfoValid\_

    - If true meta information is valid otherwise not

- [SmsMetaInfo](https://docs.qualcomm.com/doc/80-PF458-2/topic/struct_a00754.html#_CPPv4N5telux3tel11SmsMetaInfoE) metaInfo\_

    - Meta information related to SMS stored on SIM

- class ISmsManager

    - SmsManager class is the primary interface to manage SMS operations such as send and receive an SMS text and raw encoded PDU(s). This class handles single part and multi-part messages.

Public Functions

- virtual [telux](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv45telux)::[common](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6commonE)::[ServiceStatus](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6common13ServiceStatusE) getServiceStatus() = 0

    - This status indicates whether the [ISmsManager](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#a00758) object is in a usable state.

- Returns:

    - [telux::common::ServiceStatus](https://docs.qualcomm.com/doc/80-PF458-2/topic/enum_a00023_1ga7063b4a1071b6581022e30b730684e4d.html#a00023_1ga7063b4a1071b6581022e30b730684e4d)

- virtual [telux](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv45telux)::[common](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6commonE)::[Status](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6common6StatusE) sendSms(std::string message, std::string receiverAddress, bool deliveryReportNeeded, [SmsResponseCb](https://docs.qualcomm.com/doc/80-PF458-2/topic/typedef_a00024_1ga793ea1c0ed9f2d1dfea0aeebc93142e1.html#_CPPv4N5telux3tel13SmsResponseCbE) sentCallback = nullptr, std::string smscAddr = "") = 0

    - Send single or multipart SMS to the destination address. When registered on IMS the SMS will be attempted over IMS. If sending SMS over IMS fails, an automatic retry would be attempted to send the message over CS. Only support UCS2 format, GSM 7 bit default alphabet and does not support National language shift tables. The SMS is sent directly not stored on storage.

On platforms with access control enabled, caller needs to have TELUX\_TEL\_SMS\_OPS permission to invoke this API successfully.

- Parameters:

    - - **message** – **[in]** Message text to be send.
- **receiverAddress** – **[in]** Receiver or destination address
- **deliveryReportNeeded** – **[in]** Delivery status received in the listener API [telux::tel::ISmsListener](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#a00759) if deliveryReportNeeded is true. Provided recipient responds to SMSC before the validity period expires. If deliveryReportNeeded is false delivery report will not be received.
- **sentCallback** – **[in]** Optional callback pointer to get the sent response for single part or multi-part SMS.
- **smscAddr** – **[in]** SMS is sent to SMSC address. If SMSC address is empty then pre-configured SMSC address is used.

- Returns:

    - Status of sendSms i.e. success or suitable error code.

- virtual [telux](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv45telux)::[common](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6commonE)::[Status](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6common6StatusE) sendRawSms(const std::vector&lt;[PduBuffer](https://docs.qualcomm.com/doc/80-PF458-2/topic/typedef_a00024_1ga825d3b6839aabec296ad91ffe5c4ab2c.html#_CPPv4N5telux3tel9PduBufferE)&gt; rawPdus, [SmsResponseCb](https://docs.qualcomm.com/doc/80-PF458-2/topic/typedef_a00024_1ga793ea1c0ed9f2d1dfea0aeebc93142e1.html#_CPPv4N5telux3tel13SmsResponseCbE) sentCallback = nullptr) = 0

    - Send an SMS that is provided as a raw encoded PDU(s). When registered on IMS the SMS will be attempted over IMS. If sending SMS over IMS fails, an automatic retry would be attempted to send the message over CS. If the SMS is a multi-part message, the API expects multiple PDU to be passed to it. The SMS is sent directly not stored on storage.

On platforms with access control enabled, caller needs to have TELUX\_TEL\_SMS\_OPS permission to invoke this API successfully.

- Parameters:

    - - **rawPdus** – **[in]** Each element in the vector represents a part of a multipart message. For single part message the vector will have single element.
- **sentCallback** – **[in]** Optional callback to get the sent response for single part or multi-part SMS.

- Returns:

    - Status of sendRawSms i.e. success or suitable error code.

- virtual [telux](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv45telux)::[common](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6commonE)::[Status](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6common6StatusE) requestSmscAddress(std::shared\_ptr&lt;[ISmscAddressCallback](https://docs.qualcomm.com/doc/80-PF458-2/topic/class_a00760.html#_CPPv4N5telux3tel20ISmscAddressCallbackE)&gt; callback = nullptr) = 0

    - Request for Short Messaging Service Center (SMSC) Address.Purpose of SMSC is to store, forward, convert and deliver Short Message Service (SMS) messages.

On platforms with access control enabled, caller needs to have TELUX\_TEL\_SMS\_CONFIG permission to invoke this API successfully.

- Parameters:

    - **callback** – **[in]** Optional callback pointer to get the response of Smsc address request

- Returns:

    - Status of getSmscAddress i.e. success or suitable error code.

- virtual [telux](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv45telux)::[common](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6commonE)::[Status](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6common6StatusE) setSmscAddress(const std::string &smscAddress, [telux](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv45telux)::[common](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6commonE)::[ResponseCallback](https://docs.qualcomm.com/doc/80-PF458-2/topic/typedef_a00236_1a8f614f0a0eeca90c94dad1967ca93bcd.html#_CPPv4N5telux6common16ResponseCallbackE) callback = nullptr) = 0

    - Sets the Short Message Service Center(SMSC) address on the device.

On platforms with access control enabled, caller needs to have TELUX\_TEL\_SMS\_CONFIG permission to invoke this API successfully.

This will change the SMSC address for all the SMS messages sent from any app.

- Parameters:

    - - **smscAddress** – **[in]** SMSC address
- **callback** – **[in]** Optional callback pointer to get the response of set SMSC address

- Returns:

    - Status of setSmscAddress i.e. success or suitable error code.

- virtual [telux](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv45telux)::[common](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6commonE)::[Status](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6common6StatusE) requestSmsMessageList([SmsTagType](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux3tel10SmsTagTypeE) type, [RequestSmsInfoListCb](https://docs.qualcomm.com/doc/80-PF458-2/topic/typedef_a00024_1ga2be437c058c945546bd8dac5f1b1a694.html#_CPPv4N5telux3tel20RequestSmsInfoListCbE) callback) = 0

    - Requests a list of message information for the messages saved in SIM storage.

On platforms with access control enabled, the caller needs to have TELUX\_TEL\_SMS\_STORAGE permission to invoke this API successfully.

- Parameters:

    - - **type** – **[in]** Specifies the tag type of the SMS message that should be matched when retrieving the list. Specifying telux::tel::SmsTagType::UNKNOWN will retrieve all the messages from storage.
- **callback** – **[in]** Callback to get the response of request SMS messages info.

- Returns:

    - Status of requestSmsMessageList i.e. success or suitable error code.

- virtual [telux](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv45telux)::[common](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6commonE)::[Status](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6common6StatusE) readMessage(uint32\_t messageIndex, [ReadSmsMessageCb](https://docs.qualcomm.com/doc/80-PF458-2/topic/typedef_a00024_1ga8467f8ca9c5d1d70df245adebd038872.html#_CPPv4N5telux3tel16ReadSmsMessageCbE) callback) = 0

    - Retrieve a particular message from SIM storage matching the index.

On platforms with access control enabled, the caller needs to have TELUX\_TEL\_SMS\_STORAGE permission to invoke this API successfully.

- Parameters:

    - - **messageIndex** – **[in]** SMS index on storage.
- **callback** – **[in]** Callback to get the response of read SMS message from storage .

- Returns:

    - Status of readMessage i.e. success or suitable error code.

- virtual [telux](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv45telux)::[common](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6commonE)::[Status](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6common6StatusE) deleteMessage([DeleteInfo](https://docs.qualcomm.com/doc/80-PF458-2/topic/struct_a00753.html#_CPPv4N5telux3tel10DeleteInfoE) info, [telux](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv45telux)::[common](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6commonE)::[ResponseCallback](https://docs.qualcomm.com/doc/80-PF458-2/topic/typedef_a00236_1a8f614f0a0eeca90c94dad1967ca93bcd.html#_CPPv4N5telux6common16ResponseCallbackE) callback = nullptr) = 0

    - Delete specific SMS based on message index or delete messages on SIM storage based on [telux::tel::SmsTagType](https://docs.qualcomm.com/doc/80-PF458-2/topic/enum_a00024_1ga3471fb6a70c1957607d85b4844f9d355.html#a00024_1ga3471fb6a70c1957607d85b4844f9d355) or delete all messages from SIM storage.

On platforms with access control enabled, the caller needs to have TELUX\_TEL\_SMS\_STORAGE permission to invoke this API successfully.

- Parameters:

    - - **info** – **[in]** Specify delete information based on which messages are deleted
- **callback** – **[in]** Optional callback to get the response of delete SMS message from storage .

- Returns:

    - Status of deleteMessage i.e. success or suitable error code.

- virtual [telux](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv45telux)::[common](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6commonE)::[Status](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6common6StatusE) requestPreferredStorage([RequestPreferredStorageCb](https://docs.qualcomm.com/doc/80-PF458-2/topic/typedef_a00024_1ga3d30e5eca1debf427229affb7a8d8085.html#_CPPv4N5telux3tel25RequestPreferredStorageCbE) callback) = 0

    - Request preferred storage for incoming SMS.

On platforms with access control enabled, the caller needs to have TELUX\_TEL\_SMS\_CONFIG permission to invoke this API successfully.

- Parameters:

    - **callback** – **[in]** Callback to get the response of get preferred storage type .

- Returns:

    - Status of requestPreferredStorage i.e. success or suitable error code.

- virtual [telux](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv45telux)::[common](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6commonE)::[Status](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6common6StatusE) setPreferredStorage([StorageType](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux3tel11StorageTypeE) storageType, [telux](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv45telux)::[common](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6commonE)::[ResponseCallback](https://docs.qualcomm.com/doc/80-PF458-2/topic/typedef_a00236_1a8f614f0a0eeca90c94dad1967ca93bcd.html#_CPPv4N5telux6common16ResponseCallbackE) callback = nullptr) = 0

    - Set the preferred storage for incoming SMS. All future messages that arrive will be stored on the storage set in this API, if any. Messages in the current storage will not be moved to the new storage. If client does not require messages to be stored by the platform, then the storage could be set to telux::tel::StorageType::NONE.

On platforms with access control enabled, the caller needs to have TELUX\_TEL\_SMS\_CONFIG permission to invoke this API successfully.

- Parameters:

    - - **storageType** – **[in]** [telux::tel::StorageType](https://docs.qualcomm.com/doc/80-PF458-2/topic/enum_a00024_1gafdc2a3741609d551c22fc6e6e88557c0.html#a00024_1gafdc2a3741609d551c22fc6e6e88557c0)
- **callback** – **[in]** Optional callback to get the response of set preferred storage.

- Returns:

    - Status of setPreferredStorage i.e. success or suitable error code.

- virtual [telux](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv45telux)::[common](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6commonE)::[Status](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6common6StatusE) setTag(uint32\_t msgIndex, [SmsTagType](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux3tel10SmsTagTypeE) tagType, [telux](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv45telux)::[common](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6commonE)::[ResponseCallback](https://docs.qualcomm.com/doc/80-PF458-2/topic/typedef_a00236_1a8f614f0a0eeca90c94dad1967ca93bcd.html#_CPPv4N5telux6common16ResponseCallbackE) callback = nullptr) = 0

    - Update the tag of the incoming message stored in SIM storage as read/unread

On platforms with access control enabled, the caller needs to have TELUX\_TEL\_SMS\_OPS permission to invoke this API successfully.

- Parameters:

    - - **msgIndex** – **[in]** Message index corresponding to message in storage for which tag needs to be updated.
- **tagType** – **[in]** [telux::tel::SmsTagType](https://docs.qualcomm.com/doc/80-PF458-2/topic/enum_a00024_1ga3471fb6a70c1957607d85b4844f9d355.html#a00024_1ga3471fb6a70c1957607d85b4844f9d355). The applicable tag types are MT\_READ and MT\_NOT\_READ.
- **callback** – **[in]** Optional callback to get the response of updating the tag.

- Returns:

    - Status of setTag i.e. success or suitable error code.

- virtual [telux](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv45telux)::[common](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6commonE)::[Status](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6common6StatusE) requestStorageDetails([RequestStorageDetailsCb](https://docs.qualcomm.com/doc/80-PF458-2/topic/typedef_a00024_1ga9d52bf97b791f5553a8316c492a278b1.html#_CPPv4N5telux3tel23RequestStorageDetailsCbE) callback) = 0

    - Request details about SIM storage like total size and available size in terms of number of messages.

On platforms with access control enabled, the caller needs to have TELUX\_TEL\_SMS\_CONFIG permission to invoke this API successfully.

- Parameters:

    - **callback** – **[in]** Callback to get the response of storage detail request.

- Returns:

    - Status of requestStorageDetails i.e. success or suitable error code.

- virtual [MessageAttributes](https://docs.qualcomm.com/doc/80-PF458-2/topic/struct_a00755.html#_CPPv4N5telux3tel17MessageAttributesE) calculateMessageAttributes(const std::string &message) = 0

    - Calculate message attributes for the given message.

- Parameters:

    - **message** – **[in]** Message to send

- Returns:

    - [MessageAttributes](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#a00755) structure containing encoding type, number of segments, max size of segment and characters left in last segment.

- virtual int getPhoneId() = 0

    - Get associated phone id for this SMSManager.

- Returns:

    - PhoneId.

- virtual [telux](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv45telux)::[common](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6commonE)::[Status](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6common6StatusE) registerListener(std::weak\_ptr&lt;[ISmsListener](https://docs.qualcomm.com/doc/80-PF458-2/topic/class_a00759.html#_CPPv4N5telux3tel12ISmsListenerE)&gt; listener) = 0

    - Register a listener for Sms events

- Parameters:

    - **listener** – **[in]** Pointer to [ISmsListener](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#a00759) object which receives event corresponding to SMS

- Returns:

    - Status of registerListener i.e. success or suitable error code.

- virtual [telux](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv45telux)::[common](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6commonE)::[Status](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6common6StatusE) removeListener(std::weak\_ptr&lt;[ISmsListener](https://docs.qualcomm.com/doc/80-PF458-2/topic/class_a00759.html#_CPPv4N5telux3tel12ISmsListenerE)&gt; listener) = 0

    - Remove a previously added listener.

- Parameters:

    - **listener** – **[in]** Pointer to [ISmsListener](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#a00759) object

- Returns:

    - Status of removeListener i.e. success or suitable error code.

- virtual [telux](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv45telux)::[common](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6commonE)::[Status](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6common6StatusE) sendSms(const std::string &message, const std::string &receiverAddress, std::shared\_ptr&lt;[telux](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv45telux)::[common](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6commonE)::[ICommandResponseCallback](https://docs.qualcomm.com/doc/80-PF458-2/topic/class_a00280.html#_CPPv4N5telux6common24ICommandResponseCallbackE)&gt; sentCallback = nullptr, std::shared\_ptr&lt;[telux](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv45telux)::[common](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6commonE)::[ICommandResponseCallback](https://docs.qualcomm.com/doc/80-PF458-2/topic/class_a00280.html#_CPPv4N5telux6common24ICommandResponseCallbackE)&gt; deliveryCallback = nullptr) = 0

    - Send SMS to the destination address. When registered on IMS the SMS will be attempted over IMS. If sending SMS over IMS fails, an automatic retry would be attempted to send the message over CS. Only support UCS2 format, GSM 7 bit default alphabet and does not support National language shift tables.

On platforms with access control enabled, caller needs to have TELUX\_TEL\_SMS\_OPS permission to invoke this API successfully.

Deprecated Use API [ISmsManager::sendSms](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#a00758_1af7cb6eecd5028f4806fccd255b45e435)(const std::string &message, const std::string &receiverAddress, bool deliveryReportNeeded = true, SmsResponseCb callback = nullptr, std::string smscAddr = “”)

- Parameters:

    - - **message** – **[in]** Message text to be sent
- **receiverAddress** – **[in]** Receiver or destination address
- **sentCallback** – **[in]** Optional callback pointer to get the response of send SMS request.
- **deliveryCallback** – **[in]** Optional callback pointer to get message delivery status

- Returns:

    - Status of sendSms i.e. success or suitable error code.

- inline virtual ~ISmsManager()

    -

- class ISmsListener : public [telux](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv45telux)::[common](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6commonE)::[IServiceStatusListener](https://docs.qualcomm.com/doc/80-PF458-2/topic/class_a00049.html#_CPPv4N5telux6common22IServiceStatusListenerE)

    - A listener class receives notification for the incoming message(s) and delivery report for sent message(s).

The methods in listener can be invoked from multiple different threads. The implementation should be thread safe.

Public Functions

- inline virtual void onIncomingSms(int phoneId, std::shared\_ptr&lt;[SmsMessage](https://docs.qualcomm.com/doc/80-PF458-2/topic/class_a00757.html#_CPPv4N5telux3tel10SmsMessageE)&gt; message)

    - This function will be invoked when a single part message is received or when a part of a multi-part message is received. If the SMS preferred storage is to store the SMS in storage i.e SIM then the SMS will be first stored in storage and then this API will be invoked.

On platforms with access control enabled, the client needs to have TELUX\_TEL\_SMS\_LISTEN permission to invoke this API successfully.

- Parameters:

    - - **phoneId** – **[in]** Unique identifier per SIM slot. Phone on which the message is received.
- **message** – **[in]** Pointer to [SmsMessage](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#a00757) object

- inline virtual void onIncomingSms(int phoneId, std::shared\_ptr&lt;std::vector&lt;[SmsMessage](https://docs.qualcomm.com/doc/80-PF458-2/topic/class_a00757.html#_CPPv4N5telux3tel10SmsMessageE)&gt;&gt; messages)

    - This function will be invoked when either a single part message is received, or when all the parts of a multipart message have been received. This API is invoked only once all parts of a message are received. In case of a single part message, it will be invoked as soon as it is received. In case of multi-part, the implementation waits for all parts of the message to arrive and then invokes this API. If the SMS preferred storage is to store the SMS in storage i.e SIM then the messages will be first stored in storage and then this API will be invoked.

On platforms with access control enabled, the client needs to have TELUX\_TEL\_SMS\_LISTEN permission to invoke this API successfully.

- Parameters:

    - - **phoneId** – **[in]** Unique identifier per SIM slot. Phone on which the message is received.
- **messages** – **[in]** Pointer to list of [SmsMessage](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#a00757) received corresponding to single part or all parts of multipart message.

- inline virtual void onDeliveryReport(int phoneId, int msgRef, std::string receiverAddress, [telux](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv45telux)::[common](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6commonE)::[ErrorCode](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6common9ErrorCodeE) error)

    - This function will be invoked when either a delivery report for a single part message is received or when the delivery report for part of a multi-part message is received. In order to determine delivery of all parts of the multi-part message, the client application shall compare message reference received in the delivery indications with message references received in [telux::tel::SmsResponseCb](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#a00024_1ga793ea1c0ed9f2d1dfea0aeebc93142e1).

On platforms with access control enabled, the client needs to have TELUX\_TEL\_SMS\_OPS permission to invoke this API successfully.

- Parameters:

    - - **phoneId** – **[in]** Unique identifier per SIM slot. Phone on which the message is received.
- **msgRef** – **[in]** Message reference number (as per spec 3GPP TS 23.040 9.2.2.3) for a single part message or part of multipart message.
- **receiverAddress** – **[in]** Receiver or destination address
- **error** – **[in]** [telux::common::ErrorCode](https://docs.qualcomm.com/doc/80-PF458-2/topic/enum_a00023_1ga84acdb74b7d34616b1ca497c7369810d.html#a00023_1ga84acdb74b7d34616b1ca497c7369810d)

- inline virtual void onMemoryFull(int phoneId, [StorageType](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux3tel11StorageTypeE) type)

    - This function will be invoked when SMS storage is full.

On platforms with access control enabled, the client needs to have TELUX\_TEL\_SMS\_STORAGE permission to invoke this API successfully.

- Parameters:

    - - **phoneId** – **[in]** Unique identifier per SIM slot. Phone on which the message is received.
- **type** – **[in]** [telux::tel::StorageType](https://docs.qualcomm.com/doc/80-PF458-2/topic/enum_a00024_1gafdc2a3741609d551c22fc6e6e88557c0.html#a00024_1gafdc2a3741609d551c22fc6e6e88557c0). Applicable storage type StorageType::SIM

- inline virtual ~ISmsListener()

    -

- class ISmscAddressCallback : public [telux](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv45telux)::[common](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6commonE)::[ICommandCallback](https://docs.qualcomm.com/doc/80-PF458-2/topic/class_a00279.html#_CPPv4N5telux6common16ICommandCallbackE)

    - Interface for SMS callback object. Client needs to implement this interface to get single shot responses for send SMS.

The methods in callback can be invoked from multiple different threads. The implementation should be thread safe.

Public Functions

- virtual void smscAddressResponse(const std::string &address, [telux](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv45telux)::[common](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6commonE)::[ErrorCode](https://docs.qualcomm.com/doc/80-PF458-2/topic/common.html#_CPPv4N5telux6common9ErrorCodeE) error) = 0

    - This function is called with the response to the Smsc address request.

- Parameters:

    - - **address** – **[in]** Smsc address
- **error** – **[in]** [telux::common::ErrorCode](https://docs.qualcomm.com/doc/80-PF458-2/topic/enum_a00023_1ga84acdb74b7d34616b1ca497c7369810d.html#a00023_1ga84acdb74b7d34616b1ca497c7369810d)

Last Published: Apr 14, 2026

[Previous Topic
telux::tel::IEcallListener](https://docs.qualcomm.com/bundle/publicresource/80-PF458-2/topics/ecall.md) [Next Topic
SIM card services](https://docs.qualcomm.com/bundle/publicresource/80-PF458-2/topics/sim_card_services.md)