# Manages the sensors events
extern class ASensorEventQueue `{ASensorEventQueue*`}
# Enable the selected sensor, returns a negative value on error
fun enable_sensor(sensor: ASensor): Int `{
return ASensorEventQueue_enableSensor(self, sensor);
`}
# Disable the selected sensor, returns a negative value on error
fun disable_sensor(sensor: ASensor): Int `{
return ASensorEventQueue_disableSensor(self, sensor);
`}
# Set the delivery rate of events in microseconds for the given sensor
fun set_event_rate(sensor: ASensor, usec: Int): Int `{
return ASensorEventQueue_setEventRate(self, sensor, usec);
`}
# Returns 1 if the queue has events, 0 if it does not have events,
# and a negative value if there is an error
fun has_events: Int `{
return ASensorEventQueue_hasEvents(self);
`}
# Returns the next available events from the queue.
# Returns a negative value if no events are available or an error has occured
# otherwise the number of events returned
fun get_events(events: ASensorEvents, count: Int): Int `{
return ASensorEventQueue_getEvents(self, events, (size_t)count);
`}
end
lib/android/sensors.nit:89,1--118,3