Telematics SDK - Interface Specification  v1.16.0
 All Data Structures Namespaces Functions Variables Typedefs Enumerations Enumerator Groups Pages
Telematics_power

Data Structures

class  telux::power::PowerFactory
 PowerFactory allows creation of power manager instance. More...
 
class  telux::power::IPowerListener
 Listener class for getting notifications related to system power-state and also the updates related to power-management 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::IPowerManager
 IPowerManager provides interface to register and de-register listeners (to get system power-state updates). And also API to initiate system power-state transition. More...
 

Enumerations

enum  telux::power::SystemState { telux::power::SystemState::UNKNOWN, telux::power::SystemState::SUSPEND, telux::power::SystemState::RESUME, telux::power::SystemState::SHUTDOWN }
 
enum  telux::power::SystemStateAck { telux::power::SystemStateAck::SUSPEND_ACK, telux::power::SystemStateAck::SHUTDOWN_ACK }
 

Detailed Description


Data Structure Documentation

class telux::power::PowerFactory

PowerFactory allows creation of power 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< IPowerManagergetPowerManager ()
 
 ~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 power-management

std::shared_ptr<IPowerManager> telux::power::PowerFactory::getPowerManager ( )

API to get the Power Manager instance

Returns
Pointer of IPowerManager 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::IPowerListener

Listener class for getting notifications related to system power-state and also the updates related to power-management 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 onSystemStateUpdate (SystemState state)
 
virtual ~IPowerListener ()
 
- Public Member Functions inherited from telux::common::IServiceStatusListener
virtual void onServiceStatusChange (ServiceStatus status)
 
virtual ~IServiceStatusListener ()
 

Constructor & Destructor Documentation

virtual telux::power::IPowerListener::~IPowerListener ( )
virtual

Destructor of IPowerListener

Member Function Documentation

virtual void telux::power::IPowerListener::onSystemStateUpdate ( SystemState  state)
virtual

This function is called when the system/device is going to change its power-state.

Parameters
[in]statepower 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::IPowerManager

IPowerManager provides interface to register and de-register listeners (to get system power-state updates). And also API to initiate system power-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< IPowerListener > listener)=0
 
virtual telux::common::Status deregisterListener (std::weak_ptr< IPowerListener > listener)=0
 
virtual telux::common::Status setSystemState (SystemState state, telux::common::ResponseCallback callback=nullptr)=0
 
virtual SystemState getSystemState ()=0
 
virtual telux::common::Status sendSysStateAck (SystemStateAck ack)=0
 
virtual ~IPowerManager ()
 

Constructor & Destructor Documentation

virtual telux::power::IPowerManager::~IPowerManager ( )
virtual

Destructor of IPowerManager

Member Function Documentation

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

Checks the status of power-management 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::IPowerManager::onReady ( )
pure virtual

Wait for power-management services to be ready.

Returns
A future that caller can wait on to be notified when power-management 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::IPowerManager::registerListener ( std::weak_ptr< IPowerListener listener)
pure virtual

Register a listener for updates on system power-state changes.

Parameters
[in]listenerPointer of IPowerListener 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::IPowerManager::deregisterListener ( std::weak_ptr< IPowerListener listener)
pure virtual

Remove a previously registered listener.

Parameters
[in]listenerPreviously registered IPowerListener 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::IPowerManager::setSystemState ( SystemState  state,
telux::common::ResponseCallback  callback = nullptr 
)
pure virtual

Initiate a System power-state transition.

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

Parameters
[in]statepower-state that the System is intended to enter
[in]callbackOptional callback to get the response for the system-state transition command
Returns
Status of setSystemState 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 SystemState telux::power::IPowerManager::getSystemState ( )
pure virtual

Get the current system power-state.

Returns
SystemState
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::IPowerManager::sendSysStateAck ( SystemStateAck  ack)
pure virtual

API to send the acknowledgement, after processing a system power-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 SystemState notification.
Returns
Status of sendSysStateAck 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 system 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 System states.The client process sends this after processing the SystemState notification, indicating that it is prepared for state transition.

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

Enumerator
SUSPEND_ACK 

processed SystemState::SUSPEND notification

SHUTDOWN_ACK 

processed SystemState::SHUTDOWN notification