Tizen Native API
Hardware Information

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:

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]sensorThe sensor handle
[out]fifo_countThe fifo count
Returns:
0 on success, otherwise a negative error value
Return values:
SENSOR_ERROR_NONESuccessful
SENSOR_ERROR_INVALID_PARAMETERInvalid parameter
SENSOR_ERROR_NOT_SUPPORTEDThe sensor type is not supported in the current device
SENSOR_ERROR_IO_ERRORI/O error
SENSOR_ERROR_OPERATION_FAILEDOperation 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]sensorThe sensor handle
[out]max_batch_countThe maximum batch count
Returns:
0 on success, otherwise a negative error value
Return values:
SENSOR_ERROR_NONESuccessful
SENSOR_ERROR_INVALID_PARAMETERInvalid parameter
SENSOR_ERROR_NOT_SUPPORTEDThe sensor type is not supported in the current device
SENSOR_ERROR_IO_ERRORI/O error
SENSOR_ERROR_OPERATION_FAILEDOperation failed
int sensor_get_max_range ( sensor_h  sensor,
float *  max_range 
)

Gets the maximum range of the sensor.

Since :
2.3
Parameters:
[in]sensorThe sensor handle
[out]max_rangeThe maximum range
Returns:
0 on success, otherwise a negative error value
Return values:
SENSOR_ERROR_NONESuccessful
SENSOR_ERROR_INVALID_PARAMETERInvalid parameter
SENSOR_ERROR_NOT_SUPPORTEDThe sensor type is not supported in the current device
SENSOR_ERROR_IO_ERRORI/O error
SENSOR_ERROR_OPERATION_FAILEDOperation failed
int sensor_get_min_interval ( sensor_h  sensor,
int *  min_interval 
)

Gets the minimun interval of the sensor.

Since :
2.3
Parameters:
[in]sensorThe sensor handle
[out]min_intervalThe minimum interval (in milliseconds)
Returns:
0 on success, otherwise a negative error value
Return values:
SENSOR_ERROR_NONESuccessful
SENSOR_ERROR_INVALID_PARAMETERInvalid parameter
SENSOR_ERROR_NOT_SUPPORTEDThe sensor type is not supported in the current device
SENSOR_ERROR_IO_ERRORI/O error
SENSOR_ERROR_OPERATION_FAILEDOperation failed
int sensor_get_min_range ( sensor_h  sensor,
float *  min_range 
)

Gets the minimum range of the sensor.

Since :
2.3
Parameters:
[in]sensorThe sensor handle
[out]min_rangeThe minimum range
Returns:
0 on success, otherwise a negative error value
Return values:
SENSOR_ERROR_NONESuccessful
SENSOR_ERROR_INVALID_PARAMETERInvalid parameter
SENSOR_ERROR_NOT_SUPPORTEDThe sensor type is not supported in the current device
SENSOR_ERROR_IO_ERRORI/O error
SENSOR_ERROR_OPERATION_FAILEDOperation failed
int sensor_get_name ( sensor_h  sensor,
char **  name 
)

Gets the name of the sensor.

Since :
2.3
Parameters:
[in]sensorThe sensor handle
[out]nameThe name of the sensor
Returns:
0 on success, otherwise a negative error value
Return values:
SENSOR_ERROR_NONESuccessful
SENSOR_ERROR_INVALID_PARAMETERInvalid parameter
SENSOR_ERROR_NOT_SUPPORTEDThe sensor type is not supported in the current device
SENSOR_ERROR_IO_ERRORI/O error
SENSOR_ERROR_OPERATION_FAILEDOperation failed
int sensor_get_resolution ( sensor_h  sensor,
float *  resolution 
)

Gets the resolution of the sensor.

Since :
2.3
Parameters:
[in]sensorThe sensor handle
[out]resolutionThe resolution
Returns:
0 on success, otherwise a negative error value
Return values:
SENSOR_ERROR_NONESuccessful
SENSOR_ERROR_INVALID_PARAMETERInvalid parameter
SENSOR_ERROR_NOT_SUPPORTEDThe sensor type is not supported in the current device
SENSOR_ERROR_IO_ERRORI/O error
SENSOR_ERROR_OPERATION_FAILEDOperation failed
int sensor_get_type ( sensor_h  sensor,
sensor_type_e type 
)

Gets the type of the sensor.

Since :
2.3
Parameters:
[in]sensorThe sensor handle
[out]typeThe type of the sensor
Returns:
0 on success, otherwise a negative error value
Return values:
SENSOR_ERROR_NONESuccessful
SENSOR_ERROR_INVALID_PARAMETERInvalid parameter
SENSOR_ERROR_NOT_SUPPORTEDThe sensor type is not supported in the current device
SENSOR_ERROR_IO_ERRORI/O error
SENSOR_ERROR_OPERATION_FAILEDOperation failed
int sensor_get_vendor ( sensor_h  sensor,
char **  vendor 
)

Gets the vendor of the sensor.

Since :
2.3
Parameters:
[in]sensorThe sensor handle
[out]vendorThe vendor of the sensor
Returns:
0 on success, otherwise a negative error value
Return values:
SENSOR_ERROR_NONESuccessful
SENSOR_ERROR_INVALID_PARAMETERInvalid parameter
SENSOR_ERROR_NOT_SUPPORTEDThe sensor type is not supported in the current device
SENSOR_ERROR_IO_ERRORI/O error
SENSOR_ERROR_OPERATION_FAILEDOperation failed