Add max_interval in sensor_info_t
[platform/hal/api/sensor.git] / include / hal-sensor-types.h
index fcba0cd..ad119a2 100644 (file)
@@ -77,6 +77,8 @@ typedef enum {
   SENSOR_DEVICE_HUMAN_SLEEP_DETECTOR,
   SENSOR_DEVICE_HUMAN_STRESS_MONITOR,
 
+  SENSOR_DEVICE_LIDAR = 1000,
+
   SENSOR_DEVICE_EXERCISE_WALKING = 0x400,
   SENSOR_DEVICE_EXERCISE_RUNNING,
   SENSOR_DEVICE_EXERCISE_HIKING,
@@ -171,6 +173,7 @@ typedef struct sensor_info_t {
   float max_range;
   float resolution;
   int min_interval;
+  int max_interval;
   int max_batch_count;
   bool wakeup_supported;
 } sensor_info_t;
@@ -521,6 +524,11 @@ enum sensor_attribute {
       CONVERT_TYPE_ATTR(SENSOR_DEVICE_FALL_DETECTION, 0x1),
 };
 
+enum sensor_attribute_common {
+  SENSOR_ATTR_COMMON_START = 0x1000000,
+  SENSOR_ATTR_POWER_STATE = SENSOR_ATTR_COMMON_START + 10001,
+};
+
 enum sensor_activity {
   SENSOR_ACTIVITY_UNKNOWN = 1,
   SENSOR_ACTIVITY_STILL = 2,
@@ -566,10 +574,19 @@ class sensor_device {
                                  int32_t value) {
     return true;
   }
-  virtual bool set_attribute_str(uint32_t id, int32_t attribute, char *value,
+  virtual bool set_attribute_str(uint32_t id, int32_t attribute, const char *value,
                                  int len) {
     return true;
   }
+  virtual bool get_attribute_int(uint32_t id, int32_t attribute,
+                                 int32_t *value) {
+    return true;
+  }
+  virtual bool get_attribute_str(uint32_t id, int32_t attribute, char **value,
+                                 int *len) {
+    return true;
+  }
+
   virtual bool flush(uint32_t id) { return true; }
 };