aboutsummaryrefslogtreecommitdiffstats
path: root/android/hw-sensors.h
diff options
context:
space:
mode:
authorTim Wan <tim.wan@sonyericsson.com>2011-01-10 10:58:25 +0100
committerJohan Redestig <johan.redestig@sonyericsson.com>2011-06-08 12:11:55 +0200
commit736e01f86f4ec4049bb5795f1ddb979132b05333 (patch)
tree8ffcae3451227cbd830e16555e10c1713c9748fb /android/hw-sensors.h
parent945e4f4f8554b7b2f30b95d3560465c93975a8a9 (diff)
downloadexternal_qemu-736e01f86f4ec4049bb5795f1ddb979132b05333.zip
external_qemu-736e01f86f4ec4049bb5795f1ddb979132b05333.tar.gz
external_qemu-736e01f86f4ec4049bb5795f1ddb979132b05333.tar.bz2
Sensor Command Line Interface implementation.
Implement an unified sensor command line interface(CLI) on emulator to check all available sensors, and get/set specified sensor data. Change-Id: Ibb3c3522dc6c88e42fa1c7dffa32fbb675596b08
Diffstat (limited to 'android/hw-sensors.h')
-rw-r--r--android/hw-sensors.h31
1 files changed, 30 insertions, 1 deletions
diff --git a/android/hw-sensors.h b/android/hw-sensors.h
index 665cc6d..78c6a26 100644
--- a/android/hw-sensors.h
+++ b/android/hw-sensors.h
@@ -17,6 +17,20 @@
/* initialize sensor emulation */
extern void android_hw_sensors_init( void );
+/* NOTE: Sensor status Error definition, It will be used in the Sensors Command
+ * part in android/console.c. Details:
+ * SENSOR_STATUS_NO_SERVICE: "sensors" qemud service is not available/initiated.
+ * SENSOR_STATUS_DISABLED: sensor is disabled.
+ * SENSOR_STATUS_UNKNOWN: wrong sensor name.
+ * SENSOR_STATUS_OK: Everything is OK to the current sensor.
+ * */
+typedef enum{
+ SENSOR_STATUS_NO_SERVICE = -3,
+ SENSOR_STATUS_DISABLED = -2,
+ SENSOR_STATUS_UNKNOWN = -1,
+ SENSOR_STATUS_OK = 0,
+} SensorStatus;
+
/* NOTE: this list must be the same that the one defined in
* the sensors_qemu.c source of the libsensors.goldfish.so
* library.
@@ -47,6 +61,21 @@ typedef enum {
} AndroidCoarseOrientation;
/* change the coarse orientation value */
-extern void android_sensors_set_coarse_orientation( AndroidCoarseOrientation orient );
+extern void android_sensors_set_coarse_orientation( AndroidCoarseOrientation orient );
+
+/* get sensor values */
+extern int android_sensors_get( int sensor_id, float* a, float* b, float* c );
+
+/* set sensor values */
+extern int android_sensors_set( int sensor_id, float a, float b, float c );
+
+/* Get sensor id from sensor name */
+extern int android_sensors_get_id_from_name( char* sensorname );
+
+/* Get sensor name from sensor id */
+extern const char* android_sensors_get_name_from_id( int sensor_id );
+
+/* Get sensor from sensor id */
+extern uint8_t android_sensors_get_sensor_status( int sensor_id );
#endif /* _android_gps_h */