3dphotoshoot

diff src/android/sensordef.c @ 24:2712c5da2e00

getting sensor input (hack)
author John Tsiombikas <nuclear@member.fsf.org>
date Tue, 16 Jun 2015 06:17:59 +0300
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/android/sensordef.c	Tue Jun 16 06:17:59 2015 +0300
     1.3 @@ -0,0 +1,41 @@
     1.4 +#include "sensordef.h"
     1.5 +
     1.6 +static const char *names[] = {
     1.7 +	"unknown",
     1.8 +	"accelerometer",
     1.9 +	"magnetic field",
    1.10 +	"orientation",
    1.11 +	"gyroscope",
    1.12 +	"light",
    1.13 +	"pressure",
    1.14 +	"temperature",
    1.15 +	"proximity",
    1.16 +	"gravity",
    1.17 +	"linear acceleration",
    1.18 +	"rotation vector",
    1.19 +	"relative humidity",
    1.20 +	"ambient temperature",
    1.21 +	"magnetic field (uncalibrated)",
    1.22 +	"game rotation vector",
    1.23 +	"gyroscope (uncalibrated)",
    1.24 +	"significant motion",
    1.25 +	"step detector",
    1.26 +	"step counter",
    1.27 +	"geomagnetic rotation",
    1.28 +	"heart rate",
    1.29 +	"tilt detector",
    1.30 +	"wake gesture",
    1.31 +	"glance gesture",
    1.32 +	"pick up gesture",
    1.33 +	"wrist tilt gesture"
    1.34 +};
    1.35 +
    1.36 +#define NUM_SENSOR_TYPES	(sizeof names / sizeof *names)
    1.37 +
    1.38 +const char *sensor_typestr(int type)
    1.39 +{
    1.40 +	if(type < 0 || type >= NUM_SENSOR_TYPES) {
    1.41 +		type = 0;
    1.42 +	}
    1.43 +	return names[type];
    1.44 +}