Tizen Native API
|
Functions | |
int | sensor_get_name (sensor_h sensor, char **name) |
Gets the name of the sensor. | |
int | sensor_get_vendor (sensor_h sensor, char **vendor) |
Gets the vendor of the sensor. | |
int | sensor_get_type (sensor_h sensor, sensor_type_e *type) |
Gets the type of the sensor. | |
int | sensor_get_min_range (sensor_h sensor, float *min_range) |
Gets the minimum range of the sensor. | |
int | sensor_get_max_range (sensor_h sensor, float *max_range) |
Gets the maximum range of the sensor. | |
int | sensor_get_resolution (sensor_h sensor, float *resolution) |
Gets the resolution of the sensor. | |
int | sensor_get_min_interval (sensor_h sensor, int *min_interval) |
Gets the minimun interval of the sensor. | |
int | sensor_get_fifo_count (sensor_h sensor, int *fifo_count) |
Gets the fifo count of the sensor. | |
int | sensor_get_max_batch_count (sensor_h sensor, int *max_batch_count) |
Gets the maximum batch count of the sensor. |
The Hardware Information API provides information about hardware.
Required Header
#include <sensor.h>
Overview
This API provides functions for hardware features, such as name, vendor and other information
Related Features
This API is related with the following features:
- http://tizen.org/feature/sensor.accelerometer
- http://tizen.org/feature/sensor.barometer
- http://tizen.org/feature/sensor.gyroscope
- http://tizen.org/feature/sensor.magnetometer
- http://tizen.org/feature/sensor.photometer
- http://tizen.org/feature/sensor.proximity
- http://tizen.org/feature/sensor.tiltmeter
- http://tizen.org/feature/sensor.ultraviolet
- http://tizen.org/feature/sensor.temperature
- http://tizen.org/feature/sensor.humidity
- http://tizen.org/feature/sensor.linear_acceleration
- http://tizen.org/feature/sensor.rotation_vector
- http://tizen.org/feature/sensor.gravity
- http://tizen.org/feature/sensor.heart_rate_monitor
- http://tizen.org/feature/sensor.heart_rate_monitor.led_green
- http://tizen.org/feature/sensor.heart_rate_monitor.led_ir
- http://tizen.org/feature/sensor.heart_rate_monitor.led_red
- http://tizen.org/feature/sensor.gyroscope.uncalibrated
- http://tizen.org/feature/sensor.magnetometer.uncalibrated
- http://tizen.org/feature/sensor.gyroscope_rotation_vector
- http://tizen.org/feature/sensor.geomagnetic_rotation_vector
It is recommended to design feature related codes in your application for reliability.
You can check if a devrice supports the related features for this API by using System Information, thereby controlling the procedure of your application.
To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.
More details on featuring your application can be found from Feature Element.
Function Documentation
int sensor_get_fifo_count | ( | sensor_h | sensor, |
int * | fifo_count | ||
) |
Gets the fifo count of the sensor.
- Since :
- 2.3
- Parameters:
-
[in] sensor The sensor handle [out] fifo_count The fifo count
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
SENSOR_ERROR_NONE Successful SENSOR_ERROR_INVALID_PARAMETER Invalid parameter SENSOR_ERROR_NOT_SUPPORTED The sensor type is not supported in the current device SENSOR_ERROR_IO_ERROR I/O error SENSOR_ERROR_OPERATION_FAILED Operation failed
int sensor_get_max_batch_count | ( | sensor_h | sensor, |
int * | max_batch_count | ||
) |
Gets the maximum batch count of the sensor.
- Since :
- 2.3
- Parameters:
-
[in] sensor The sensor handle [out] max_batch_count The maximum batch count
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
SENSOR_ERROR_NONE Successful SENSOR_ERROR_INVALID_PARAMETER Invalid parameter SENSOR_ERROR_NOT_SUPPORTED The sensor type is not supported in the current device SENSOR_ERROR_IO_ERROR I/O error SENSOR_ERROR_OPERATION_FAILED Operation failed
int sensor_get_max_range | ( | sensor_h | sensor, |
float * | max_range | ||
) |
Gets the maximum range of the sensor.
- Since :
- 2.3
- Parameters:
-
[in] sensor The sensor handle [out] max_range The maximum range
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
SENSOR_ERROR_NONE Successful SENSOR_ERROR_INVALID_PARAMETER Invalid parameter SENSOR_ERROR_NOT_SUPPORTED The sensor type is not supported in the current device SENSOR_ERROR_IO_ERROR I/O error SENSOR_ERROR_OPERATION_FAILED Operation failed
int sensor_get_min_interval | ( | sensor_h | sensor, |
int * | min_interval | ||
) |
Gets the minimun interval of the sensor.
- Since :
- 2.3
- Parameters:
-
[in] sensor The sensor handle [out] min_interval The minimum interval (in milliseconds)
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
SENSOR_ERROR_NONE Successful SENSOR_ERROR_INVALID_PARAMETER Invalid parameter SENSOR_ERROR_NOT_SUPPORTED The sensor type is not supported in the current device SENSOR_ERROR_IO_ERROR I/O error SENSOR_ERROR_OPERATION_FAILED Operation failed
int sensor_get_min_range | ( | sensor_h | sensor, |
float * | min_range | ||
) |
Gets the minimum range of the sensor.
- Since :
- 2.3
- Parameters:
-
[in] sensor The sensor handle [out] min_range The minimum range
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
SENSOR_ERROR_NONE Successful SENSOR_ERROR_INVALID_PARAMETER Invalid parameter SENSOR_ERROR_NOT_SUPPORTED The sensor type is not supported in the current device SENSOR_ERROR_IO_ERROR I/O error SENSOR_ERROR_OPERATION_FAILED Operation failed
int sensor_get_name | ( | sensor_h | sensor, |
char ** | name | ||
) |
Gets the name of the sensor.
- Since :
- 2.3
- Parameters:
-
[in] sensor The sensor handle [out] name The name of the sensor
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
SENSOR_ERROR_NONE Successful SENSOR_ERROR_INVALID_PARAMETER Invalid parameter SENSOR_ERROR_NOT_SUPPORTED The sensor type is not supported in the current device SENSOR_ERROR_IO_ERROR I/O error SENSOR_ERROR_OPERATION_FAILED Operation failed
int sensor_get_resolution | ( | sensor_h | sensor, |
float * | resolution | ||
) |
Gets the resolution of the sensor.
- Since :
- 2.3
- Parameters:
-
[in] sensor The sensor handle [out] resolution The resolution
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
SENSOR_ERROR_NONE Successful SENSOR_ERROR_INVALID_PARAMETER Invalid parameter SENSOR_ERROR_NOT_SUPPORTED The sensor type is not supported in the current device SENSOR_ERROR_IO_ERROR I/O error SENSOR_ERROR_OPERATION_FAILED Operation failed
int sensor_get_type | ( | sensor_h | sensor, |
sensor_type_e * | type | ||
) |
Gets the type of the sensor.
- Since :
- 2.3
- Parameters:
-
[in] sensor The sensor handle [out] type The type of the sensor
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
SENSOR_ERROR_NONE Successful SENSOR_ERROR_INVALID_PARAMETER Invalid parameter SENSOR_ERROR_NOT_SUPPORTED The sensor type is not supported in the current device SENSOR_ERROR_IO_ERROR I/O error SENSOR_ERROR_OPERATION_FAILED Operation failed
int sensor_get_vendor | ( | sensor_h | sensor, |
char ** | vendor | ||
) |
Gets the vendor of the sensor.
- Since :
- 2.3
- Parameters:
-
[in] sensor The sensor handle [out] vendor The vendor of the sensor
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
SENSOR_ERROR_NONE Successful SENSOR_ERROR_INVALID_PARAMETER Invalid parameter SENSOR_ERROR_NOT_SUPPORTED The sensor type is not supported in the current device SENSOR_ERROR_IO_ERROR I/O error SENSOR_ERROR_OPERATION_FAILED Operation failed