Telematics SDK - Interface Specification
v1.16.0
|
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... | |
class telux::power::PowerFactory |
PowerFactory allows creation of power manager instance.
Public Member Functions | |
std::shared_ptr< IPowerManager > | getPowerManager () |
~PowerFactory () | |
Static Public Member Functions | |
static PowerFactory & | getInstance () |
telux::power::PowerFactory::~PowerFactory | ( | ) |
|
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
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.
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 () |
|
virtual |
Destructor of IPowerListener
|
virtual |
This function is called when the system/device is going to change its power-state.
[in] | state | power state that system is about to enter |
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.
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 () |
|
virtual |
Destructor of IPowerManager
|
pure virtual |
Checks the status of power-management services and if the other APIs are ready for use, and returns the result.
|
pure virtual |
Wait for power-management services to be ready.
|
pure virtual |
Register a listener for updates on system power-state changes.
[in] | listener | Pointer of IPowerListener object that processes the notification |
|
pure virtual |
Remove a previously registered listener.
[in] | listener | Previously registered IPowerListener that needs to be removed |
|
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.
[in] | state | power-state that the System is intended to enter |
[in] | callback | Optional callback to get the response for the system-state transition command |
|
pure virtual |
Get the current system power-state.
|
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).
[in] | ack | Acknowledgement for a SystemState notification. |
|
strong |
|
strong |
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 |