Event represents a sensor event.
| 37 | |
| 38 | // Event represents a sensor event. |
| 39 | type Event struct { |
| 40 | // Sensor is the type of the sensor the event is coming from. |
| 41 | Sensor Type |
| 42 | |
| 43 | // Timestamp is a device specific event time in nanoseconds. |
| 44 | // Timestamps are not Unix times, they represent a time that is |
| 45 | // only valid for the device's default sensor. |
| 46 | Timestamp int64 |
| 47 | |
| 48 | // Data is the event data. |
| 49 | // |
| 50 | // If the event source is Accelerometer, |
| 51 | // - Data[0]: acceleration force in x axis in m/s^2 |
| 52 | // - Data[1]: acceleration force in y axis in m/s^2 |
| 53 | // - Data[2]: acceleration force in z axis in m/s^2 |
| 54 | // |
| 55 | // If the event source is Gyroscope, |
| 56 | // - Data[0]: rate of rotation around the x axis in rad/s |
| 57 | // - Data[1]: rate of rotation around the y axis in rad/s |
| 58 | // - Data[2]: rate of rotation around the z axis in rad/s |
| 59 | // |
| 60 | // If the event source is Magnetometer, |
| 61 | // - Data[0]: force of gravity along the x axis in m/s^2 |
| 62 | // - Data[1]: force of gravity along the y axis in m/s^2 |
| 63 | // - Data[2]: force of gravity along the z axis in m/s^2 |
| 64 | // |
| 65 | Data []float64 |
| 66 | } |
| 67 | |
| 68 | // TODO(jbd): Move Sender interface definition to a top-level package. |
| 69 |
nothing calls this directly
no outgoing calls
no test coverage detected