Tizen Native API
9.0
|
The Temperature API provides functions to get information about the temperature.
Required Header
#include <device/temperature.h>
Overview
The Temperature API provides the way to get the current thermal value such as Application Processor, Communication Processor and Battery.
Overview
This API is related with the following features:
- http://tizen.org/feature/thermistor.ap
- http://tizen.org/feature/thermistor.cp
- http://tizen.org/feature/thermistor.battery
It is recommended to use features in your application for reliability.
You can check if the device supports the related features for this API by using System Information, and control your application's actions accordingly.
To ensure your application is running only on devices with specific features, please define the features in your manifest file using the manifest editor in the SDK.
More details on using features in your application can be found in the feature element description.
Functions | |
int | device_thermal_get_temperature (device_thermal_e type, int *temp) |
Gets the temperature value based on the specified device type. |
Enumeration Type Documentation
enum device_thermal_e |
Function Documentation
int device_thermal_get_temperature | ( | device_thermal_e | type, |
int * | temp | ||
) |
Gets the temperature value based on the specified device type.
Retrieves the current temperature value of a specified device.
- Since :
- 5.5
- Remarks:
- Ensure that the provided temp pointer is valid and has enough memory allocated.
- Parameters:
-
[in] type The index of the device DEVICE_THERMAL_AP
DEVICE_THERMAL_CP
DEVICE_THERMAL_BATTERY[out] temp The temperature value in degrees Celsius
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
DEVICE_ERROR_NONE Successful DEVICE_ERROR_NOT_SUPPORTED Not supported device DEVICE_ERROR_INVALID_PARAMETER Invalid parameter DEVICE_ERROR_OPERATION_FAILED Operation failed #include <device/temperature.h> ... int temperature = 0; int ret = 0; ... ret = device_thermal_get_temperature(DEVICE_THERMAL_AP, &temperature); if (ret == DEVICE_ERROR_NONE) { ... } ...
- See also:
- device_thermal_e