Data Definition
The input data structure of the sensor input module consists of four parts: sensor data x, y, z, and type. The data is provided for developers through callbacks.
Example:
1 2 3 4 5 6 | struct SensorData { float x; float y; float z; int32_t type; } __attribute__((packed)); |
The following sensors are available:
1 2 3 4 5 6 7 8 9 10 11 12 13 | enum VmiSensorType : uint32_t { HANDLE_ACCELERATION = 0, // Acceleration sensor HANDLE_GYROSCOPE, // Gyroscope sensor HANDLE_MAGNETIC_FIELD, // Magnetic field sensor HANDLE_ORIENTATION, // Orientation sensor HANDLE_TEMPERATURE, // Temperature sensor HANDLE_PROXIMITY, // Proximity sensor HANDLE_LIGHT, // Light sensor HANDLE_PRESSURE, // Pressure sensor HANDLE_HUMIDITY, // Humidity sensor HANDLE_MAGNETIC_FIELD_UNCALIBRATED, // Uncalibrated magnetic field sensor HANDLE_MAX = 10 }; |
The output data structure of the sensor output module consists of the sensor type handle and the sensor sampling rate. The data is provided for developers through callbacks.
Example:
1 2 3 4 | struct SensorActivateData { int handle; // handle corresponds to the value of VmiSensorType. int64_t samplingPeriod; // When a sensor is deactivated, this field can be ignored or set to the default value. } __attribute__((packed)); |
Parent topic: Sensor Input Development