/* Fall back to simple form, like ro.iio.anglvel.name */
- sprintf(prop_name, PROP_BASE, prefix, sel);
+ snprintf(prop_name, PROP_NAME_MAX, PROP_BASE, prefix, sel);
if (property_get(prop_name, prop_val, "")) {
strncpy(val, prop_val, MAX_NAME_SIZE-1);
/* We should cap returned samples accordingly... */
- switch (sensor[s].type) {
+ switch (sensor_desc[s].type) {
case SENSOR_TYPE_ACCELEROMETER: /* m/s^2 */
return 50;
if (strstr(quirks_buf, "spotty"))
sensor[s].quirks |= QUIRK_SPOTTY;
+ if (strstr(quirks_buf, "no-event"))
+ sensor[s].quirks |= QUIRK_NO_EVENT_MODE;
+
+ if (strstr(quirks_buf, "no-trig"))
+ sensor[s].quirks |= QUIRK_NO_TRIG_MODE;
+
+ if (strstr(quirks_buf, "no-poll"))
+ sensor[s].quirks |= QUIRK_NO_POLL_MODE;
+
sensor[s].quirks |= QUIRK_ALREADY_DECODED;
}
char* sensor_get_string_type (int s)
{
- switch (sensor[s].type) {
+ switch (sensor_desc[s].type) {
case SENSOR_TYPE_ACCELEROMETER:
return SENSOR_STRING_TYPE_ACCELEROMETER;
{
flag_t flags = 0;
- switch (sensor[s].type) {
+ switch (sensor_desc[s].type) {
case SENSOR_TYPE_LIGHT:
case SENSOR_TYPE_AMBIENT_TEMPERATURE:
case SENSOR_TYPE_TEMPERATURE:
static int get_cdd_freq (int s, int must)
{
- switch (sensor[s].type) {
+ switch (sensor_desc[s].type) {
case SENSOR_TYPE_ACCELEROMETER:
return (must ? 100 : 200); /* must 100 Hz, should 200 Hz, CDD compliant */