Telematics SDK - Interface Specification  v1.46.10

Data Structures

struct  telux::tel::MessageAttributes
 Contains structure of message attributes like encoding type, number of segments, characters left in last segment. More...
 
class  telux::tel::SmsMessage
 A Short Message Service message. More...
 
class  telux::tel::ISmsManager
 SMS Manager class is the primary interface to send and receive SMS messages. It allows to send an SMS in several formats and sizes. More...
 
class  telux::tel::ISmsListener
 A listener class for monitoring incoming SMS and notify subsystem status changes. Override the methods for the state that you wish to receive updates for. More...
 
class  telux::tel::ISmscAddressCallback
 

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...
 

Detailed Description

This section contains APIs related to Sending and Receiving SMS.


Data Structure Documentation

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

class telux::tel::SmsMessage

A Short Message Service message.

Public Member Functions

 SmsMessage (std::string text, std::string sender, std::string receiver, SmsEncoding encoding, std::string pdu)
 
const std::string & getText () const
 
const std::string & getSender () const
 
const std::string & getReceiver () const
 
SmsEncoding getEncoding () const
 
const std::string & getPdu () const
 
const std::string toString () const
 

Constructor & Destructor Documentation

telux::tel::SmsMessage::SmsMessage ( std::string  text,
std::string  sender,
std::string  receiver,
SmsEncoding  encoding,
std::string  pdu 
)

Member Function Documentation

const std::string& telux::tel::SmsMessage::getText ( ) const

Get the message body.

Returns
String containing SMS message.
const std::string& telux::tel::SmsMessage::getSender ( ) const

Get the originating address (sender) of this SMS message.

Returns
String containing sender address.
const std::string& telux::tel::SmsMessage::getReceiver ( ) const

Get the destination address (receiver) of this SMS message.

Returns
String containing receiver address
SmsEncoding telux::tel::SmsMessage::getEncoding ( ) const

Get encoding used for this SMS message.

Returns
SMS message encoding used.
const std::string& telux::tel::SmsMessage::getPdu ( ) const

Get the raw PDU for the message.

Returns
String containing raw pdu data.
const std::string telux::tel::SmsMessage::toString ( ) const

Get the text related informative representation of this object.

Returns
String containing informative string.
class telux::tel::ISmsManager

SMS Manager class is the primary interface to send and receive SMS messages. It allows to send an SMS in several formats and sizes.

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 > callback=nullptr, std::shared_ptr< telux::common::ICommandResponseCallback > deliveryCallback=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 ()
 

Constructor & Destructor Documentation

virtual telux::tel::ISmsManager::~ISmsManager ( )
virtual

Member Function Documentation

virtual telux::common::ServiceStatus telux::tel::ISmsManager::getServiceStatus ( )
pure virtual

This status indicates whether the ISmsManager object is in a usable state.

Returns
telux::common::ServiceStatus
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
virtual telux::common::Status telux::tel::ISmsManager::sendSms ( const std::string &  message,
const std::string &  receiverAddress,
std::shared_ptr< telux::common::ICommandResponseCallback callback = nullptr,
std::shared_ptr< telux::common::ICommandResponseCallback deliveryCallback = nullptr 
)
pure virtual

Send SMS to destination address. Only support UCS2 format, GSM 7 bit default alphabet and does not support National language shift tables.

Parameters
[in]messageMessage or payload text to be sent
[in]receiverAddressReceiver or destination address
[in]sentCallbackOptional callback pointer to get the response of send SMS request, This callback gives possible error codes.
[in]deliveryCallbackOptional callback pointer to get message delivery status
Returns
Status of sendSms i.e. success or suitable error code.
virtual telux::common::Status telux::tel::ISmsManager::requestSmscAddress ( std::shared_ptr< ISmscAddressCallback callback = nullptr)
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.

Parameters
[in]callbackOptional callback pointer to get the response of Smsc address request
Returns
Status of getSmscAddress i.e. success or suitable error code.
virtual telux::common::Status telux::tel::ISmsManager::setSmscAddress ( const std::string &  smscAddress,
telux::common::ResponseCallback  callback = nullptr 
)
pure virtual

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

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

Parameters
[in]smscAddressSMSC address
[in]callbackOptional callback pointer to get the response of set SMSC address
Returns
Status of setSmscAddress i.e. success or suitable error code.
virtual MessageAttributes telux::tel::ISmsManager::calculateMessageAttributes ( const std::string &  message)
pure virtual

Calculate message attributes for the given message.

Parameters
[in]messageMessage to send
Returns
MessageAttributes structure containing encoding type, number of segments, max size of segment and characters left in last segment.
virtual int telux::tel::ISmsManager::getPhoneId ( )
pure virtual

Get associated phone id for this SMSManager.

Returns
PhoneId.
virtual telux::common::Status telux::tel::ISmsManager::registerListener ( std::weak_ptr< ISmsListener listener)
pure virtual

Register a listener for Sms events

Parameters
[in]listenerPointer to ISmsListener object which receives event corresponding to SMS
Returns
Status of registerListener i.e. success or suitable error code.
virtual telux::common::Status telux::tel::ISmsManager::removeListener ( std::weak_ptr< ISmsListener listener)
pure virtual

Remove a previously added listener.

Parameters
[in]listenerPointer to ISmsListener object
Returns
Status of removeListener i.e. success or suitable error code.
class telux::tel::ISmsListener

A listener class for monitoring incoming SMS and notify subsystem status changes. Override the methods for the state that you wish to receive updates for.

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 ~ISmsListener ()
 
- Public Member Functions inherited from telux::common::IServiceStatusListener
virtual void onServiceStatusChange (ServiceStatus status)
 
virtual ~IServiceStatusListener ()
 

Constructor & Destructor Documentation

virtual telux::tel::ISmsListener::~ISmsListener ( )
virtual

Member Function Documentation

virtual void telux::tel::ISmsListener::onIncomingSms ( int  phoneId,
std::shared_ptr< SmsMessage message 
)
virtual

This function is called when device receives an incoming message

Parameters
[in]phoneIdUnique identifier per phone
[in]SmsMessagePointer to SmsMessage object
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 ()
 

Member Function Documentation

virtual void telux::tel::ISmscAddressCallback::smscAddressResponse ( const std::string &  address,
telux::common::ErrorCode  error 
)
pure virtual

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

Parameters
[in]addressSmsc address
[in]errorErrorCode

Enumeration Type Documentation

Specifies the encoding of the SMS message.

Enumerator
GSM7 

GSM 7-bit default alphabet encoding

GSM8 

GSM 8-bit data encoding

UCS2 

UCS-2 encoding

UNKNOWN 

Unknown encoding