Telematics SDK - Interface Specification  v1.26.3
TCU Activity Manager

Data Structures

class  telux::power::PowerFactory
 PowerFactory allows creation of TCU-activity manager instance. More...
 
class  telux::power::ITcuActivityListener
 Listener class for getting notifications related to TCU-activity state and also the updates related to TCU-activity service status. The client needs to implement these methods as briefly as possible and avoid blocking calls in it. The methods in this class can be invoked from multiple different threads. Client needs to make sure that the implementation is thread-safe. More...
 
class  telux::power::ITcuActivityManager
 ITcuActivityManager provides interface to register and de-register listeners (to get TCU-activity state updates). And also API to initiate TCU-activity state transition. More...
 

Enumerations

enum  telux::power::TcuActivityState { telux::power::TcuActivityState::UNKNOWN, telux::power::TcuActivityState::SUSPEND, telux::power::TcuActivityState::RESUME, telux::power::TcuActivityState::SHUTDOWN }
 
enum  telux::power::TcuActivityStateAck { telux::power::TcuActivityStateAck::SUSPEND_ACK, telux::power::TcuActivityStateAck::SHUTDOWN_ACK }
 

Detailed Description

This section contains APIs related to TCU activity state management.


Data Structure Documentation

class telux::power::PowerFactory

PowerFactory allows creation of TCU-activity manager instance.

Note
Eval: This is a new API and is being evaluated.It is subject to change and could break backwards compatibility.

Public Member Functions

std::shared_ptr< ITcuActivityManagergetTcuActivityManager ()
 
 ~PowerFactory ()
 

Static Public Member Functions

static PowerFactorygetInstance ()
 

Constructor & Destructor Documentation

telux::power::PowerFactory::~PowerFactory ( )

Member Function Documentation

static PowerFactory& telux::power::PowerFactory::getInstance ( )
static

API to get the factory instance for TCU-activity management

std::shared_ptr<ITcuActivityManager> telux::power::PowerFactory::getTcuActivityManager ( )

API to get the TCU-activity Manager instance

Returns
Pointer of ITcuActivityManager object.
Note
Eval: This is a new API and is being evaluated.It is subject to change and could break backwards compatibility.
class telux::power::ITcuActivityListener

Listener class for getting notifications related to TCU-activity state and also the updates related to TCU-activity service status. The client needs to implement these methods as briefly as possible and avoid blocking calls in it. The methods in this class can be invoked from multiple different threads. Client needs to make sure that the implementation is thread-safe.

Note
Eval: This is a new API and is being evaluated.It is subject to change and could break backwards compatibility.

Public Member Functions

virtual void onTcuActivityStateUpdate (TcuActivityState state)
 
virtual ~ITcuActivityListener ()
 

Constructor & Destructor Documentation

virtual telux::power::ITcuActivityListener::~ITcuActivityListener ( )
virtual

Destructor of ITcuActivityListener

Member Function Documentation

virtual void telux::power::ITcuActivityListener::onTcuActivityStateUpdate ( TcuActivityState  state)
virtual

This function is called when the TCU-activity state is going to change.

Parameters
[in]stateTCU-activity state that system is about to enter
Note
Eval: This is a new API and is being evaluated.It is subject to change and could break backwards compatibility.
class telux::power::ITcuActivityManager

ITcuActivityManager provides interface to register and de-register listeners (to get TCU-activity state updates). And also API to initiate TCU-activity state transition.

Note
Eval: This is a new API and is being evaluated.It is subject to change and could break backwards compatibility.

Public Member Functions

virtual bool isReady ()=0
 
virtual std::future< bool > onReady ()=0
 
virtual telux::common::Status registerListener (std::weak_ptr< ITcuActivityListener > listener)=0
 
virtual telux::common::Status deregisterListener (std::weak_ptr< ITcuActivityListener > listener)=0
 
virtual telux::common::Status registerServiceStateListener (std::weak_ptr< telux::common::IServiceStatusListener > listener)=0
 
virtual telux::common::Status deregisterServiceStateListener (std::weak_ptr< telux::common::IServiceStatusListener > listener)=0
 
virtual telux::common::Status setActivityState (TcuActivityState state, telux::common::ResponseCallback callback=nullptr)=0
 
virtual TcuActivityState getActivityState ()=0
 
virtual telux::common::Status sendActivityStateAck (TcuActivityStateAck ack)=0
 
virtual ~ITcuActivityManager ()
 

Constructor & Destructor Documentation

virtual telux::power::ITcuActivityManager::~ITcuActivityManager ( )
virtual

Destructor of ITcuActivityManager

Member Function Documentation

virtual bool telux::power::ITcuActivityManager::isReady ( )
pure virtual

Checks the status of TCU-activity services and if the other APIs are ready for use, and returns the result.

Returns
True if the services are ready otherwise false.
Note
Eval: This is a new API and is being evaluated.It is subject to change and could break backwards compatibility.
virtual std::future<bool> telux::power::ITcuActivityManager::onReady ( )
pure virtual

Wait for TCU-activity services to be ready.

Returns
A future that caller can wait on to be notified when TCU-activity services are ready.
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::power::ITcuActivityManager::registerListener ( std::weak_ptr< ITcuActivityListener listener)
pure virtual

Register a listener for updates on TCU-activity state changes.

Parameters
[in]listenerPointer of ITcuActivityListener object that processes the notification
Returns
Status of registerListener i.e success or suitable status code.
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::power::ITcuActivityManager::deregisterListener ( std::weak_ptr< ITcuActivityListener listener)
pure virtual

Remove a previously registered listener.

Parameters
[in]listenerPreviously registered ITcuActivityListener that needs to be removed
Returns
Status of deregisterListener, success or suitable status code
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::power::ITcuActivityManager::registerServiceStateListener ( std::weak_ptr< telux::common::IServiceStatusListener listener)
pure virtual

Register a listener for updates on TCU-activity management service status.

Parameters
[in]listenerPointer of IServiceStatusListener object that processes the notification
Returns
Status of registerServiceStateListener i.e success or suitable status code.
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::power::ITcuActivityManager::deregisterServiceStateListener ( std::weak_ptr< telux::common::IServiceStatusListener listener)
pure virtual

Remove a previously registered listener for service status updates.

Parameters
[in]listenerPreviously registered IServiceStatusListener that needs to be removed
Returns
Status of deregisterServiceStateListener, success or suitable status code
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::power::ITcuActivityManager::setActivityState ( TcuActivityState  state,
telux::common::ResponseCallback  callback = nullptr 
)
pure virtual

Initiate a TCU-activity state transition.

This API needs to be used cautiously, as it could change the power-state of the system and may affect other processes.

Parameters
[in]stateTCU-activity state that the System is intended to enter
[in]callbackOptional callback to get the response for the TCU-activity state transition command
Returns
Status of setActivityState i.e. success or suitable status code.
Note
Eval: This is a new API and is being evaluated.It is subject to change and could break backwards compatibility.
virtual TcuActivityState telux::power::ITcuActivityManager::getActivityState ( )
pure virtual

Get the current TCU-activity state.

Returns
TcuActivityState
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::power::ITcuActivityManager::sendActivityStateAck ( TcuActivityStateAck  ack)
pure virtual

API to send the acknowledgement, after processing a TCU-activity state notification. This indicates that the client is prepared for state transition.Only one acknowledgement is expected from a single client process(may have multiple listeners).

Parameters
[in]ackAcknowledgement for a TCU-activity state notification.
Returns
Status of sendActivityStateAck i.e. success or suitable status code.
Note
Eval: This is a new API and is being evaluated.It is subject to change and could break backwards compatibility.

Enumeration Type Documentation

Defines the supported TCU-activity states that the listeners will be notified about.

Enumerator
UNKNOWN 

To indicate that system state information is not available

SUSPEND 

System is going to SUSPEND state

RESUME 

System is going to RESUME state

SHUTDOWN 

System is going to SHUTDOWN

Defines the acknowledgements to TCU-activity states.The client process sends this after processing the TcuActivityState notification, indicating that it is prepared for state transition

Acknowledgement for TcuActivityState::RESUME is not required, as the state transition has already happened.

Enumerator
SUSPEND_ACK 

processed TcuActivityState::SUSPEND notification

SHUTDOWN_ACK 

processed TcuActivityState::SHUTDOWN notification