static int get_field_count (int s, size_t *field_size)
{
*field_size = sizeof(float);
+
switch (sensor[s].type) {
case SENSOR_TYPE_ACCELEROMETER: /* m/s^2 */
case SENSOR_TYPE_MAGNETIC_FIELD: /* micro-tesla */
case SENSOR_TYPE_GYROSCOPE: /* radians/s */
return 3;
+ case SENSOR_TYPE_INTERNAL_INTENSITY:
+ case SENSOR_TYPE_INTERNAL_ILLUMINANCE:
case SENSOR_TYPE_LIGHT: /* SI lux units */
case SENSOR_TYPE_AMBIENT_TEMPERATURE: /* °C */
case SENSOR_TYPE_TEMPERATURE: /* °C */
memcpy(data, &sensor[s].sample, sizeof(sensors_event_t));
data->sensor = s;
- data->type = sensor[s].type;
+ data->type = sensor_desc[s].type; /* sensor_desc[s].type can differ from sensor[s].type ; internal types are remapped */
return 1;
}
data->version = sizeof(sensors_event_t);
data->sensor = s;
- data->type = sensor[s].type;
+ data->type = sensor_desc[s].type; /* sensor_desc[s].type can differ from sensor[s].type ; internal types are remapped */
data->timestamp = sensor[s].report_ts;
if (sensor[s].mode == MODE_EVENT) {