+
+static int get_cdd_freq (int s, int must)
+{
+ switch (sensor_desc[s].type) {
+ case SENSOR_TYPE_ACCELEROMETER:
+ return (must ? 100 : 200); /* must 100 Hz, should 200 Hz, CDD compliant */
+
+ case SENSOR_TYPE_GYROSCOPE:
+ return (must ? 200 : 200); /* must 200 Hz, should 200 Hz, CDD compliant */
+
+ case SENSOR_TYPE_MAGNETIC_FIELD:
+ return (must ? 10 : 50); /* must 10 Hz, should 50 Hz, CDD compliant */
+
+ case SENSOR_TYPE_LIGHT:
+ case SENSOR_TYPE_AMBIENT_TEMPERATURE:
+ case SENSOR_TYPE_TEMPERATURE:
+ return (must ? 1 : 2); /* must 1 Hz, should 2Hz, not mentioned in CDD */
+
+ default:
+ return 1; /* Use 1 Hz by default, e.g. for proximity */
+ }
+}
+
+/*
+ * This value is defined only for continuous mode and on-change sensors. It is the delay between two sensor events corresponding to the lowest frequency that
+ * this sensor supports. When lower frequencies are requested through batch()/setDelay() the events will be generated at this frequency instead. It can be used
+ * by the framework or applications to estimate when the batch FIFO may be full. maxDelay should always fit within a 32 bit signed integer. It is declared as
+ * 64 bit on 64 bit architectures only for binary compatibility reasons. Availability: SENSORS_DEVICE_API_VERSION_1_3
+ */