Telematics SDK - Interface Specification
v1.46.10
|
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. The system can be configured to be operated in ACTIVE or PASSIVE mode with respect to TcuActivity management. In ACTIVE mode, the TCU-activity management service leads the system into desired activity state after receiving the acknowledgements from all the clients or after the configured timeout. In PASSIVE mode, the management service just notifies the clients about the state transition and conveys their acknowledgement status back to the Master application that triggered the state transition. More... | |
This section contains APIs related to TCU activity state management.
class telux::power::PowerFactory |
PowerFactory allows creation of TCU-activity manager instance.
Public Member Functions | |
std::shared_ptr< ITcuActivityManager > | getTcuActivityManager (ClientType clientType=ClientType::SLAVE, common::ProcType procType=common::ProcType::LOCAL_PROC, telux::common::InitResponseCb callback=nullptr) |
Static Public Member Functions | |
static PowerFactory & | getInstance () |
|
static |
API to get the factory instance for TCU-activity management
std::shared_ptr<ITcuActivityManager> telux::power::PowerFactory::getTcuActivityManager | ( | ClientType | clientType = ClientType::SLAVE , |
common::ProcType | procType = common::ProcType::LOCAL_PROC , |
||
telux::common::InitResponseCb | callback = nullptr |
||
) |
API to get the TCU-activity Manager instance
[in] | type | Type of the client that is going to access ITcuActivityManager APIs ClientType |
[in] | procType | Required processor type on which the operations will be performed telux::common::ProcType |
[in] | callback | Optional callback pointer to get the response of the manager initialization. |
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.
Public Member Functions | |
virtual void | onTcuActivityStateUpdate (TcuActivityState state) |
virtual void | onSlaveAckStatusUpdate (telux::common::Status status) |
virtual | ~ITcuActivityListener () |
|
virtual |
Destructor of ITcuActivityListener
|
virtual |
This function is called when the TCU-activity state is going to change.
[in] | state | TCU-activity state that system is about to enter |
|
virtual |
This function is called with the overall acknowledgement status from all the SLAVE clients, for state change triggered previously by MASTER client.
This API will be invoked only for the MASTER client. If at least one SLAVE client does not acknowledge within the configured timeout, then Status::EXPIRED would be reported.
[in] | status | status of the SLAVE clients acknowledgements |
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. The system can be configured to be operated in ACTIVE or PASSIVE mode with respect to TcuActivity management. In ACTIVE mode, the TCU-activity management service leads the system into desired activity state after receiving the acknowledgements from all the clients or after the configured timeout. In PASSIVE mode, the management service just notifies the clients about the state transition and conveys their acknowledgement status back to the Master application that triggered the state transition.
Public Member Functions | |
virtual bool | isReady ()=0 |
virtual std::future< bool > | onReady ()=0 |
virtual telux::common::ServiceStatus | getServiceStatus ()=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 () |
|
virtual |
Destructor of ITcuActivityManager
|
pure virtual |
Checks the status of TCU-activity services and if the other APIs are ready for use, and returns the result.
|
pure virtual |
Wait for TCU-activity services to be ready.
|
pure virtual |
This status indicates whether the ITcuActivityManager object is in a usable state.
|
pure virtual |
Register a listener for updates on TCU-activity state changes.
[in] | listener | Pointer of ITcuActivityListener object that processes the notification |
|
pure virtual |
Remove a previously registered listener.
[in] | listener | Previously registered ITcuActivityListener that needs to be removed |
|
pure virtual |
Register a listener for updates on TCU-activity management service status.
[in] | listener | Pointer of IServiceStatusListener object that processes the notification |
|
pure virtual |
Remove a previously registered listener for service status updates.
[in] | listener | Previously registered IServiceStatusListener that needs to be removed |
|
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.
This API is meant for clients that have instantiated the ITcuActivityManager instance using ClientType::MASTER
[in] | state | TCU-activity state that the System is intended to enter |
[in] | callback | Optional callback to get the response for the TCU-activity state transition command |
|
pure virtual |
Get the current TCU-activity state.
|
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).
[in] | ack | Acknowledgement for a TCU-activity state notification. |
|
strong |
|
strong |
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 |
|
strong |
Defines the type of the client that would be using the ITcuActivityManager APIs. Client that just needs the TcuActivityState notifications needs to choose ClientType::SLAVE. And the client that determines the TcuActivityState would choose ClientType::MASTER. Only a Master client can set the TcuActivityState. In a system, there should be a single Master client.
The ClientType needs to be chosen while instantiating the ITcuActivityManager, using the API PowerFactory::getTcuActivityManager
Enumerator | |
---|---|
SLAVE |
Client is a slave and interested in state change notification |
MASTER |
Client makes the decision on when the TcuActivityState should change |