Home | History | Annotate | Download | only in android

Lines Matching refs:sensors

14 #include "android/hw-sensors.h"
23 #include "android/sensors-port.h"
27 #define D(...) VERBOSE_PRINT(sensors,__VA_ARGS__)
34 #define T(...) VERBOSE_PRINT(sensors,__VA_ARGS__)
123 * - when the qemu-specific sensors HAL module starts, it sends
124 * "list-sensors"
127 * to a bitmap of available hardware sensors in the current AVD
136 * send information about the corresponding enabled sensors. The default
173 Sensor sensors[MAX_SENSORS];
180 HwSensors* sensors;
190 /* remove from sensors's list */
191 if (cl->sensors) {
192 HwSensorClient** pnode = &cl->sensors->clients;
204 cl->sensors = NULL;
226 _hwSensorClient_new( HwSensors* sensors )
232 cl->sensors = sensors;
237 cl->next = sensors->clients;
238 sensors->clients = cl;
291 HwSensors* hw = cl->sensors;
299 sensor = &hw->sensors[ANDROID_SENSOR_ACCELERATION];
308 sensor = &hw->sensors[ANDROID_SENSOR_MAGNETIC_FIELD];
309 /* NOTE: sensors HAL expects "magnetic", not "magnetic-field" name here. */
318 sensor = &hw->sensors[ANDROID_SENSOR_ORIENTATION];
327 sensor = &hw->sensors[ANDROID_SENSOR_TEMPERATURE];
334 sensor = &hw->sensors[ANDROID_SENSOR_PROXIMITY];
362 HwSensors* hw = cl->sensors;
366 /* "list-sensors" is used to get an integer bit map of
367 * available emulated sensors. We compute the mask from the
370 if (msglen == 12 && !memcmp(msg, "list-sensors", 12)) {
376 if (hw->sensors[nn].enabled)
424 if (!hw->sensors[id].enabled) {
486 HwSensors* sensors = opaque;
487 HwSensorClient* cl = _hwSensorClient_new(sensors);
503 Sensor* s = &h->sensors[sensor_id];
510 /* Saves available sensors to allow checking availability when loaded.
517 // number of sensors
521 Sensor* s = &h->sensors[i];
561 /* check number of sensors */
564 D("%s: cannot load: snapshot requires %d sensors, %d available\n",
572 Sensor* s = &h->sensors[i];
607 * less hardware sensors.
610 h->sensors[i].enabled = 0;
621 Sensor* s = &h->sensors[ANDROID_SENSOR_PROXIMITY];
660 /* initialize the sensors state */
672 h->service = qemud_service_register("sensors", 0, h, _hwSensors_connect,
676 h->sensors[ANDROID_SENSOR_ACCELERATION].enabled = 1;
680 h->sensors[ANDROID_SENSOR_PROXIMITY].enabled = 1;
684 h->sensors[ANDROID_SENSOR_MAGNETIC_FIELD].enabled = 1;
688 h->sensors[ANDROID_SENSOR_ORIENTATION].enabled = 1;
692 h->sensors[ANDROID_SENSOR_TEMPERATURE].enabled = 1;
711 D("%s: sensors qemud service initialized", __FUNCTION__);
748 if (! hw->sensors[id].enabled)
756 /* Interface of reading the data for all sensors */
769 Sensor* sensor = &hw->sensors[sensor_id];
783 /* Interface of setting the data for all sensors */
793 if (! hw->sensors[sensor_id].enabled)
812 return hw->sensors[sensor_id].enabled;