Telematics SDK - API Reference  v1.58.0
Thermal Management

Data Structures

class  telux::therm::ThermalFactory
 ThermalFactory allows creation of thermal manager. More...
 
class  telux::therm::IThermalListener
 Listener class for getting notifications when thermal service status changes. 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...
 
struct  telux::therm::BoundCoolingDevice
 
class  telux::therm::IThermalManager
 IThermalManager provides interface to get thermal zone and cooling device information. More...
 
class  telux::therm::ITripPoint
 ITripPoint provides interface to get trip point type, trip point temperature and hysteresis value for that trip point. More...
 
class  telux::therm::IThermalZone
 IThermalZone provides interface to get type of the sensor, the current temperature reading, trip points and the cooling devices binded etc. More...
 
class  telux::therm::ICoolingDevice
 ICoolingDevice provides interface to get type of the cooling device, the maximum throttle state and the currently requested throttle state of the cooling device. More...
 

Typedefs

using telux::therm::ThermalNotificationMask = std::bitset< 16 >
 

Enumerations

enum  telux::therm::AutoShutdownMode { telux::therm::AutoShutdownMode::UNKNOWN, telux::therm::AutoShutdownMode::ENABLE, telux::therm::AutoShutdownMode::DISABLE }
 
enum  telux::therm::TripType {
  telux::therm::TripType::UNKNOWN, telux::therm::TripType::CRITICAL, telux::therm::TripType::HOT, telux::therm::TripType::PASSIVE,
  telux::therm::TripType::ACTIVE, telux::therm::TripType::CONFIGURABLE_HIGH, telux::therm::TripType::CONFIGURABLE_LOW
}
 
enum  telux::therm::TripEvent { telux::therm::TripEvent::NONE = -1, telux::therm::TripEvent::CROSSED_UNDER, telux::therm::TripEvent::CROSSED_OVER }
 
enum  telux::therm::ThermalNotificationType { telux::therm::TNT_TRIP_UPDATE, telux::therm::TNT_CDEV_LEVEL_UPDATE, telux::therm::TNT_MAX_TYPE }
 

Variables

const uint32_t telux::therm::DEFAULT_TIMEOUT = 30
 

Detailed Description

This section contains APIs related to Thermal Management such as read list of thermal zones, cooling devices and binding info.


Data Structure Documentation

class telux::therm::ThermalFactory

ThermalFactory allows creation of thermal manager.

Public Member Functions

virtual std::shared_ptr< IThermalManagergetThermalManager (telux::common::InitResponseCb callback=nullptr, telux::common::ProcType operType=telux::common::ProcType::LOCAL_PROC)=0
 
virtual std::shared_ptr< IThermalShutdownManagergetThermalShutdownManager (telux::common::InitResponseCb callback=nullptr)=0
 

Static Public Member Functions

static ThermalFactorygetInstance ()
 

Member Function Documentation

static ThermalFactory& telux::therm::ThermalFactory::getInstance ( )
static

Get Thermal Factory instance.

virtual std::shared_ptr<IThermalManager> telux::therm::ThermalFactory::getThermalManager ( telux::common::InitResponseCb  callback = nullptr,
telux::common::ProcType  operType = telux::common::ProcType::LOCAL_PROC 
)
pure virtual

Get thermal manager instance associated with a telux::common::ProcType to get list of thermal zones (sensors) and cooling devices supported by the device

On platforms with Access control enabled, Caller needs to have TELUX_THERM_DATA_READ permission to invoke this API successfully.

Parameters
[in]callbackOptional callback pointer to get the response of the manager initialization.
[in]oprTypeOperation type telux::common::ProcType. Local operation type fetches the thermal zones information where the application is running. Remote operation type fetches the thermal zones information of modem if the application is running on external application processor(EAP) and vice versa.
Returns
Pointer of IThermalManager object.
virtual std::shared_ptr<IThermalShutdownManager> telux::therm::ThermalFactory::getThermalShutdownManager ( telux::common::InitResponseCb  callback = nullptr)
pure virtual

Get thermal shutdown manager instance to control automatic thermal shutdown and get relevant notifications

On platforms with Access control enabled, Caller needs to have TELUX_THERM_SHUTDOWN_CTRL permission to invoke this API successfully.

Parameters
[in]callbackOptional callback pointer to get the response of the manager initialization.
Returns
Pointer of IThermalShutdownManager object.
class telux::therm::IThermalListener

Listener class for getting notifications when thermal service status changes. 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 ~IThermalListener ()
 
virtual void onCoolingDeviceLevelChange (std::shared_ptr< ICoolingDevice > coolingDevice)
 
virtual void onTripEvent (std::shared_ptr< ITripPoint > tripPoint, TripEvent tripEvent)
 
- Public Member Functions inherited from telux::common::IServiceStatusListener
virtual void onServiceStatusChange (ServiceStatus status)
 
virtual ~IServiceStatusListener ()
 

Constructor & Destructor Documentation

virtual telux::therm::IThermalListener::~IThermalListener ( )
virtual

Destructor of IThermalListener

Member Function Documentation

virtual void telux::therm::IThermalListener::onCoolingDeviceLevelChange ( std::shared_ptr< ICoolingDevice coolingDevice)
virtual

This function is called at the time of cooling device level update. On platforms with Access control enabled, the client needs to have TELUX_THERM_DATA_READ permission to receive this event.

Parameters
[in]coolingDevice- vector of cooling device for which the level has been updated.
virtual void telux::therm::IThermalListener::onTripEvent ( std::shared_ptr< ITripPoint tripPoint,
TripEvent  tripEvent 
)
virtual

This function is called at the time of trip event occurs. On platforms with Access control enabled, the client needs to have TELUX_THERM_DATA_READ permission to receive this event.

Parameters
[in]tripInfo- Vector of the trip point for which trip event has been occured.
[in]tripEvent- Indicates trip event.
  • NONE
  • CROSSED_UNDER
  • CROSSED_OVER
struct telux::therm::BoundCoolingDevice

Defines the trip points to which cooling device is bound.

Data Fields
int coolingDeviceId

Cooling device Id associated with trip points

vector< shared_ptr< ITripPoint > > bindingInfo

List of trippoints bound to the cooling device

class telux::therm::IThermalManager

IThermalManager provides interface to get thermal zone and cooling device information.

Public Member Functions

virtual telux::common::ServiceStatus getServiceStatus ()=0
 
virtual telux::common::Status registerListener (std::weak_ptr< IThermalListener > listener, ThermalNotificationMask mask=0xFFFF)=0
 
virtual telux::common::Status deregisterListener (std::weak_ptr< IThermalListener > listener, ThermalNotificationMask mask=0xFFFF)=0
 
virtual std::vector< std::shared_ptr< IThermalZone > > getThermalZones ()=0
 
virtual std::vector< std::shared_ptr< ICoolingDevice > > getCoolingDevices ()=0
 
virtual std::shared_ptr< IThermalZonegetThermalZone (int thermalZoneId)=0
 
virtual std::shared_ptr< ICoolingDevicegetCoolingDevice (int coolingDeviceId)=0
 
virtual ~IThermalManager ()
 

Constructor & Destructor Documentation

virtual telux::therm::IThermalManager::~IThermalManager ( )
virtual

Destructor of IThermalManager

Member Function Documentation

virtual telux::common::ServiceStatus telux::therm::IThermalManager::getServiceStatus ( )
pure virtual

This status indicates whether the 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::therm::IThermalManager::registerListener ( std::weak_ptr< IThermalListener listener,
ThermalNotificationMask  mask = 0xFFFF 
)
pure virtual

Registers the listener for Thermal Manager indications.

Parameters
[in]listener- pointer to implemented listener.
[in]mask- Bit mask representing a set of notifications that needs to be registered - ThermalNotificationType Notifications under IThermalListener that are not listed in ThermalNotificationType would always be registered by default when this API is invoked. In the absence of this optional parameter, all the notifications will be registered. Bits that are not set in the mask are ignored and do not have any effect on registration or deregistration. To deregister, the API deregisterListener should be used. For Example: API invoked with mask: 0x0001 enables onTripEvent notification, next invocation with mask: 0x0002 enables onCoolingDeviceLevelUpdate notification and previous registration for onTripEvent remains intact.
Returns
status of the registration request.
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::therm::IThermalManager::deregisterListener ( std::weak_ptr< IThermalListener listener,
ThermalNotificationMask  mask = 0xFFFF 
)
pure virtual

Deregisters the previously registered listener.

Parameters
[in]listener- pointer to registered listener that needs to be removed.
[in]mask- Bit mask that denotes a set of notifications that needs to be de-registered - ThermalNotificationType Notifications under IThermalListener that are not listed in ThermalNotificationType would not be de-registered by default. If the client does not specifies mask or sets all the bits, this API de-registers all the notifications. Bits that are not set in the mask are ignored and do not have any effect on registration or deregistration,To register, the API registerListener should be used. For Example: API invoked with mask: 0x0001 disables onTripEvent notification, next invocation with mask: 0x0002 disables onCoolingDeviceLevelUpdate notification. mask: 0x0000 is invalid options and API invoked with mask 0x0000 will be ignored.
Returns
status of the deregistration request.
Note
Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.
virtual std::vector<std::shared_ptr<IThermalZone> > telux::therm::IThermalManager::getThermalZones ( )
pure virtual

Retrieves the list of thermal zone info like type, temperature and trip points.

Returns
List of thermal zones.
virtual std::vector<std::shared_ptr<ICoolingDevice> > telux::therm::IThermalManager::getCoolingDevices ( )
pure virtual

Retrieves the list of thermal cooling device info like type, maximum throttle state and currently requested throttle state.

Returns
List of cooling devices.
virtual std::shared_ptr<IThermalZone> telux::therm::IThermalManager::getThermalZone ( int  thermalZoneId)
pure virtual

Retrieves the thermal zone details like temperature, type and trip point info for the given thermal zone identifier.

Parameters
[in]thermalZoneIdThermal zone identifier
Returns
Pointer to thermal zone.
virtual std::shared_ptr<ICoolingDevice> telux::therm::IThermalManager::getCoolingDevice ( int  coolingDeviceId)
pure virtual

Retrieves the cooling device details like type of the device, maximum cooling level and current cooling level for the given cooling device identifier.

Parameters
[in]coolingDeviceIdCooling device identifier
Returns
Pointer to cooling device.
class telux::therm::ITripPoint

ITripPoint provides interface to get trip point type, trip point temperature and hysteresis value for that trip point.

Public Member Functions

virtual TripType getType () const =0
 
virtual int getThresholdTemp () const =0
 
virtual int getHysteresis () const =0
 
virtual int getTripId () const =0
 
virtual int getTZoneId () const =0
 
virtual bool operator== (const ITripPoint &rHs) const =0
 
virtual ~ITripPoint ()
 

Constructor & Destructor Documentation

virtual telux::therm::ITripPoint::~ITripPoint ( )
virtual

Destructor of ITripPoint

Member Function Documentation

virtual TripType telux::therm::ITripPoint::getType ( ) const
pure virtual

Retrieves trip point type.

Returns
Type of trip point if available else return UNKNOWN.
virtual int telux::therm::ITripPoint::getThresholdTemp ( ) const
pure virtual

Retrieves the temperature above which certain trip point will be fired.

  • Units: MilliDegree Celsius
Returns
Threshold temperature
virtual int telux::therm::ITripPoint::getHysteresis ( ) const
pure virtual

Retrieves hysteresis value that is the difference between current temperature of the device and the temperature above which certain trip point will be fired. Units: MilliDegree Celsius

Returns
Hysteresis value
virtual int telux::therm::ITripPoint::getTripId ( ) const
pure virtual

Retrieves the identifier for trip point.

Returns
Identifier for trip point
virtual int telux::therm::ITripPoint::getTZoneId ( ) const
pure virtual

Retrieves associated tzone id for a trip point.

Returns
Identifier for thermal zone
virtual bool telux::therm::ITripPoint::operator== ( const ITripPoint rHs) const
pure virtual

Operator for compare two trip points

Returns
result of two trip points whether equal or not equal.
class telux::therm::IThermalZone

IThermalZone provides interface to get type of the sensor, the current temperature reading, trip points and the cooling devices binded etc.

Public Member Functions

virtual int getId () const =0
 
virtual std::string getDescription () const =0
 
virtual int getCurrentTemp () const =0
 
virtual int getPassiveTemp () const =0
 
virtual std::vector< std::shared_ptr< ITripPoint > > getTripPoints () const =0
 
virtual std::vector< BoundCoolingDevicegetBoundCoolingDevices () const =0
 
virtual ~IThermalZone ()
 

Constructor & Destructor Documentation

virtual telux::therm::IThermalZone::~IThermalZone ( )
virtual

Destructor of IThermalZone

Member Function Documentation

virtual int telux::therm::IThermalZone::getId ( ) const
pure virtual

Retrieves the identifier for thermal zone.

Returns
Identifier for thermal zone
virtual std::string telux::therm::IThermalZone::getDescription ( ) const
pure virtual

Retrieves the type of sensor.

Returns
Sensor type
virtual int telux::therm::IThermalZone::getCurrentTemp ( ) const
pure virtual

Retrieves the current temperature of the device. Units: MilliDegree Celsius

Returns
Current temperature
virtual int telux::therm::IThermalZone::getPassiveTemp ( ) const
pure virtual

Retrieves the temperature of passive trip point for the zone. Default value is 0. Valid values: 0 (disabled) or greater than 1000 (enabled), Units: MilliDegree Celsius

Returns
Temperature of passive trip point
virtual std::vector<std::shared_ptr<ITripPoint> > telux::therm::IThermalZone::getTripPoints ( ) const
pure virtual

Retrieves trip point information like trip type, trip temperature and hysteresis.

Returns
Trip point info list
virtual std::vector<BoundCoolingDevice> telux::therm::IThermalZone::getBoundCoolingDevices ( ) const
pure virtual

Retrieves the list of cooling device and the associated trip points bound to cooling device in given thermal zone.

Returns
List of bound cooling device for the given thermal zone.
class telux::therm::ICoolingDevice

ICoolingDevice provides interface to get type of the cooling device, the maximum throttle state and the currently requested throttle state of the cooling device.

Public Member Functions

virtual int getId () const =0
 
virtual std::string getDescription () const =0
 
virtual int getMaxCoolingLevel () const =0
 
virtual int getCurrentCoolingLevel () const =0
 
virtual ~ICoolingDevice ()
 

Constructor & Destructor Documentation

virtual telux::therm::ICoolingDevice::~ICoolingDevice ( )
virtual

Destructor of ICoolingDevice

Member Function Documentation

virtual int telux::therm::ICoolingDevice::getId ( ) const
pure virtual

Retrieves the identifier of the thermal cooling device.

Returns
Cooling device identifier
virtual std::string telux::therm::ICoolingDevice::getDescription ( ) const
pure virtual

Retrieves the type of the cooling device.

Returns
Cooling device type
virtual int telux::therm::ICoolingDevice::getMaxCoolingLevel ( ) const
pure virtual

Retrieves the maximum cooling level of the cooling device.

Returns
Maximum cooling level of the thermal cooling device
virtual int telux::therm::ICoolingDevice::getCurrentCoolingLevel ( ) const
pure virtual

Retrieves the current cooling level of the cooling device. This value can be between 0 and max cooling level. Max cooling level is different for different cooling devices like fan, processor etc.

Returns
Current cooling level of the thermal cooling device

Typedef Documentation

using telux::therm::ThermalNotificationMask = typedef std::bitset<16>

Bit mask that denotes a set of notifications defined in ThermalNotificationType

Enumeration Type Documentation

Defines the status of automatic thermal shutdown

Enumerator
UNKNOWN 

Automatic thermal shutdown status is unknown

ENABLE 

Automatic thermal shutdown is enabled

DISABLE 

Automatic thermal shutdown is disabled

Defines the type of trip points, it can be one of the values for ACPI (Advanced Configuration and Power Interface) thermal zone

Enumerator
UNKNOWN 

Trip type is unknown

CRITICAL 

Trip point at which system shuts down

HOT 

Trip point to notify emergency

PASSIVE 

Trip point at which kernel lowers the CPU's frequency and throttle the processor down

ACTIVE 

Trip point at which processor fan turns on

CONFIGURABLE_HIGH 

Triggering threshold at which mitigation starts. This type is added to support legacy targets

CONFIGURABLE_LOW 

Clearing threshold at which mitigation stops. This type is added to support legacy targets

Defines the event of trip.

Enumerator
NONE 

Trip event is none

CROSSED_UNDER 

This event will be triggered when the temperature decreases and crosses below the configured trip minus hysteresis temp. This event will not be triggered again, if the temperature remains below the trip temperature. For Example: Below scenario considered as CROSSED_UNDER. Prev temp: 27000 milli degree Celsius, Trip temp: 25000 milli degree Celsius, Hyst: 5000 milli degree Celsius, Curr Temp: 19000 milli degree Celsius, Below scenario will not generate CROSSED_UNDER event again. Prev temp: 19000 milli degree Celsius, Trip temp: 25000 milli degree Celsius, Hyst: 5000 milli degree Celsius, Curr Temp: 18000 milli degree Celsius / 22000 milli degree Celsius

CROSSED_OVER 

This event will be triggered when the temperature increases and crosses over the configured trip temperature. This event will not be triggered again, if the temperature remains over the trip temperature. For Example: Below scenario considered as CROSSED_OVER. Prev temp: 24000 milli degree Celsius, Trip temp: 25000 milli degree Celsius, Curr Temp: 26000 milli degree Celsius, Below scenario will not generate CROSSED_OVER event again. Prev temp: 26000 milli degree Celsius, Trip temp: 25000 milli degree Celsius, Curr Temp: 27000 milli degree Celsius

Defines some of the notifications supported by IThermalListener which can be dynamically disabled/enabled.

Enumerator
TNT_TRIP_UPDATE 
TNT_CDEV_LEVEL_UPDATE 
TNT_MAX_TYPE 

Variable Documentation

const uint32_t telux::therm::DEFAULT_TIMEOUT = 30

Default time out (in seconds) for thermal auto-shutdown service to re-enable thermal auto-shutdown.