SensorEvent¶
-
public class
SensorEvent¶ This class represents a
KallistoSensorevent and holds information such as the sensor’s type, the timestamp, accuracy and of course the sensor’sdata.Refer to the
Kallistodevice datasheet for the coordinate system.
Fields¶
accuracy¶
-
public int
accuracy¶ The accuracy of this event.
Only reports
KallistoSensorManager.SENSOR_STATUS_ACCURACY_HIGHfor now.
rawTimestamp¶
-
public long
rawTimestamp¶ The time at which the event happened in nanoseconds.
This time is generated by the
Kallistodevice and doesn’t have any relation with the real time. Beware that it uses a 32 bit counter in microseconds so it will overflow after 2³²-1 uS.Since the transport layer is the Bluetooth Low Energy, there will be delays to the event delivery. A event generated will be delayed by the BLE connection (refer to the Bluetooth specification for details) and by queuing in the device side. Expect delays, in average, of about 100 ms.
sensor¶
-
public KallistoSensor
sensor¶ The
sensorthat generated this event.
timestamp¶
-
public long
timestamp¶ The time at which the event happened in nanoseconds.
Beware that some sensors doesn’t support synchronization so this field will be equal to the rawTimestamp.
This time is synchronized with SystemClock.elapsedRealtimeNanos() with a very simple algorithm that calculates the relation between the 0 in the device and the real time.
Since the transport layer is the Bluetooth Low Energy, there will be delays to the event delivery. A event generated will be delayed by the BLE connection (refer to the Bluetooth specification for details) and by queuing in the device side. Expect delays, in average, of about 100 ms.
values¶
-
public final float[]
values¶ The length and contents of the
valuesarray depends on whichKallistoSensortype is being monitored.Some new sensor types were introduced:
: A new event with the value
1is received when a fall is detected.: A sensor of this type measures a voltage. Reports a single value with the voltage measured in milli-volts.
: A sensor of this type measures the equivalent CO2 concentrations. Reports a single value representing the concentration in parts-per-million (ppm).
: A sensor of this type measures the Total Volatile Organic Compound concentration. Reports a single value representing the concentration in parts-per-billion (ppb).
: A simple on/off button. Reports a button press with the value
1and a0otherwise. Only reports transitions.Refer to the Android documentation for the rest of the sensor types.
See
android.hardware.SensorEvent.values.