Telematics SDK - API Reference
v1.51.0
|
Data Structures | |
struct | telux::tel::MessageAttributes |
Contains structure of message attributes like encoding type, number of segments, characters left in last segment. More... | |
struct | telux::tel::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. More... | |
class | telux::tel::SmsMessage |
Data structure represents an incoming SMS. This is applicable for single part message or part of the multipart message. More... | |
class | telux::tel::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. More... | |
class | telux::tel::ISmsListener |
A listener class receives notification for the incoming message(s) and delivery report for sent message(s). More... | |
class | telux::tel::ISmscAddressCallback |
Typedefs | |
using | telux::tel::PduBuffer = std::vector< uint8_t > |
using | telux::tel::SmsResponseCb = std::function< void(std::vector< int > msgRefs, telux::common::ErrorCode errorCode)> |
Enumerations | |
enum | telux::tel::SmsEncoding { telux::tel::SmsEncoding::GSM7, telux::tel::SmsEncoding::GSM8, telux::tel::SmsEncoding::UCS2, telux::tel::SmsEncoding::UNKNOWN } |
Specifies the encoding of the SMS message. More... | |
This section contains APIs related to Sending and Receiving SMS.
struct telux::tel::MessageAttributes |
Contains structure of message attributes like encoding type, number of segments, characters left in last segment.
Data Fields | ||
---|---|---|
SmsEncoding | encoding |
Data encoding type |
int | numberOfSegments |
Number of segments |
int | segmentSize |
Max size of each segment |
int | numberOfCharsLeftInLastSegment |
characters left in last segment |
struct telux::tel::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.
class telux::tel::SmsMessage |
Data structure represents an incoming SMS. This is applicable for single part message or part of the multipart message.
Public Member Functions | |
SmsMessage (std::string text, std::string sender, std::string receiver, SmsEncoding encoding, std::string pdu, PduBuffer pduBuffer, std::shared_ptr< MessagePartInfo > info) | |
const std::string & | getText () const |
const std::string & | getSender () const |
const std::string & | getReceiver () const |
SmsEncoding | getEncoding () const |
const std::string & | getPdu () const |
PduBuffer | getRawPdu () const |
std::shared_ptr< MessagePartInfo > | getMessagePartInfo () |
const std::string | toString () const |
telux::tel::SmsMessage::SmsMessage | ( | std::string | text, |
std::string | sender, | ||
std::string | receiver, | ||
SmsEncoding | encoding, | ||
std::string | pdu, | ||
PduBuffer | pduBuffer, | ||
std::shared_ptr< MessagePartInfo > | info | ||
) |
const std::string& telux::tel::SmsMessage::getText | ( | ) | const |
Get the message text for the single part message or part of the multipart message.
const std::string& telux::tel::SmsMessage::getSender | ( | ) | const |
Get the originating address (sender address).
const std::string& telux::tel::SmsMessage::getReceiver | ( | ) | const |
Get the destination address (receiver address).
SmsEncoding telux::tel::SmsMessage::getEncoding | ( | ) | const |
Get encoding format used for the single part message or part of the multipart message.
const std::string& telux::tel::SmsMessage::getPdu | ( | ) | const |
Get the raw PDU for the single part message or part of the multipart message.
PduBuffer telux::tel::SmsMessage::getRawPdu | ( | ) | const |
Get the raw PDU buffer for the single part message or part of the multipart message.
std::shared_ptr<MessagePartInfo> telux::tel::SmsMessage::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.
const std::string telux::tel::SmsMessage::toString | ( | ) | const |
Get the text related informative representation of this object.
class telux::tel::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 Member Functions | |
virtual telux::common::ServiceStatus | getServiceStatus ()=0 |
virtual telux::common::Status | sendSms (const std::string &message, const std::string &receiverAddress, std::shared_ptr< telux::common::ICommandResponseCallback > sentCallback=nullptr, std::shared_ptr< telux::common::ICommandResponseCallback > deliveryCallback=nullptr)=0 |
virtual telux::common::Status | sendSms (std::string message, std::string receiverAddress, bool deliveryReportNeeded=true, SmsResponseCb sentCallback=nullptr, std::string smscAddr="")=0 |
virtual telux::common::Status | sendRawSms (const std::vector< PduBuffer > rawPdus, SmsResponseCb sentCallback=nullptr)=0 |
virtual telux::common::Status | requestSmscAddress (std::shared_ptr< ISmscAddressCallback > callback=nullptr)=0 |
virtual telux::common::Status | setSmscAddress (const std::string &smscAddress, telux::common::ResponseCallback callback=nullptr)=0 |
virtual MessageAttributes | calculateMessageAttributes (const std::string &message)=0 |
virtual int | getPhoneId ()=0 |
virtual telux::common::Status | registerListener (std::weak_ptr< ISmsListener > listener)=0 |
virtual telux::common::Status | removeListener (std::weak_ptr< ISmsListener > listener)=0 |
virtual | ~ISmsManager () |
|
virtual |
|
pure virtual |
This status indicates whether the ISmsManager object is in a usable state.
|
pure virtual |
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.
[in] | message | Message text to be sent |
[in] | receiverAddress | Receiver or destination address |
[in] | sentCallback | Optional callback pointer to get the response of send SMS request. |
[in] | deliveryCallback | Optional callback pointer to get message delivery status |
|
pure virtual |
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. On platforms with access control enabled, caller needs to have TELUX_TEL_SMS_OPS permission to invoke this API successfully.
[in] | message | Message text to be send. |
[in] | receiverAddress | Receiver or destination address |
[in] | deliveryReportNeeded | Delivery status received in the listener API telux::tel::ISmsListener if deliveryReportNeeded is true. Provided recipient responds to SMSC before the validity period expires. If deliveryReportNeeded is false delivery report will not be received. |
[in] | sentCallback | Optional callback pointer to get the sent response for single part or multi-part SMS. |
[in] | smscAddr | SMS is sent to SMSC address. If SMSC address is empty then pre-configured SMSC address is used. |
|
pure virtual |
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. On platforms with access control enabled, caller needs to have TELUX_TEL_SMS_OPS permission to invoke this API successfully.
[in] | rawPdus | Each element in the vector represents a part of a multipart message. For single part message the vector will have single element. |
[in] | sentCallback | Optional callback to get the sent response for single part or multi-part SMS. |
|
pure virtual |
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.
[in] | callback | Optional callback pointer to get the response of Smsc address request |
|
pure virtual |
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.
[in] | smscAddress | SMSC address |
[in] | callback | Optional callback pointer to get the response of set SMSC address |
|
pure virtual |
Calculate message attributes for the given message.
[in] | message | Message to send |
|
pure virtual |
Get associated phone id for this SMSManager.
|
pure virtual |
Register a listener for Sms events
[in] | listener | Pointer to ISmsListener object which receives event corresponding to SMS |
|
pure virtual |
Remove a previously added listener.
[in] | listener | Pointer to ISmsListener object |
class telux::tel::ISmsListener |
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 Member Functions | |
virtual void | onIncomingSms (int phoneId, std::shared_ptr< SmsMessage > message) |
virtual void | onIncomingSms (int phoneId, std::shared_ptr< std::vector< SmsMessage >> messages) |
virtual void | onDeliveryReport (int phoneId, int msgRef, std::string receiverAddress, telux::common::ErrorCode error) |
virtual | ~ISmsListener () |
Public Member Functions inherited from telux::common::IServiceStatusListener | |
virtual void | onServiceStatusChange (ServiceStatus status) |
virtual | ~IServiceStatusListener () |
|
virtual |
|
virtual |
This function will be invoked when a single part message is received or when a part of a multi-part message is received.
On platforms with access control enabled, the client needs to have TELUX_TEL_SMS_LISTEN permission to invoke this API successfully.
[in] | phoneId | Unique identifier per SIM slot. Phone on which the message is received. |
[in] | message | Pointer to SmsMessage object |
|
virtual |
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.
On platforms with access control enabled, the client needs to have TELUX_TEL_SMS_LISTEN permission to invoke this API successfully.
[in] | phoneId | Unique identifier per SIM slot. Phone on which the message is received. |
[in] | messages | Pointer to list of SmsMessage received corresponding to single part or all parts of multipart message. |
|
virtual |
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.
On platforms with access control enabled, the client needs to have TELUX_TEL_SMS_OPS permission to invoke this API successfully.
[in] | phoneId | Unique identifier per SIM slot. Phone on which the message is received. |
[in] | msgRef | Message reference number (as per spec 3GPP TS 23.040 9.2.2.3) for a single part message or part of multipart message. |
[in] | receiverAddress | Receiver or destination address |
[in] | error | telux::common::ErrorCode |
class telux::tel::ISmscAddressCallback |
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 Member Functions | |
virtual void | smscAddressResponse (const std::string &address, telux::common::ErrorCode error)=0 |
Public Member Functions inherited from telux::common::ICommandCallback | |
virtual | ~ICommandCallback () |
|
pure virtual |
This function is called with the response to the Smsc address request.
[in] | address | Smsc address |
[in] | error | telux::common::ErrorCode |
using telux::tel::PduBuffer = typedef std::vector<uint8_t> |
using telux::tel::SmsResponseCb = typedef std::function<void(std::vector<int> msgRefs, telux::common::ErrorCode errorCode)> |
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 and telux::tel::ISmsManager::sendRawSms APIs.
The callback can be invoked from multiple different threads. The implementation should be thread safe.
[in] | msgRefs | 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 will be invoked with the message reference number corresponding to that part. |
[in] | errorCode | 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. |
|
strong |