217efb839855960241a8571505dc1f0ad33531c7
[platform/core/system/sensord.git] / include / sensor_hal_types.h
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 #ifndef _SENSOR_HAL_TYPES_H_
19 #define _SENSOR_HAL_TYPES_H_
20
21 #include <stdint.h>
22 #include <stdbool.h>
23 #include <time.h>
24
25 #define SENSOR_HAL_VERSION(maj, min) \
26                 ((((maj) & 0xFFFF) << 24) | ((min) & 0xFFFF))
27
28 #ifdef __cplusplus
29 extern "C"
30 {
31 #endif /* __cplusplus */
32
33 /*
34  * Sensor Types
35  * These types are used to controll the sensors
36  *
37  * - base unit
38  *   acceleration values : meter per second^2 (m/s^2)
39  *   magnetic values     : micro-Tesla (uT)
40  *   orientation values  : degrees
41  *   gyroscope values    : degree/s
42  *   temperature values  : degrees centigrade
43  *   proximity valeus    : distance
44  *   light values        : lux
45  *   pressure values     : hectopascal (hPa)
46  *   humidity            : relative humidity (%)
47  */
48 typedef enum {
49         SENSOR_DEVICE_UNKNOWN = -2,
50         SENSOR_DEVICE_ALL = -1,
51         SENSOR_DEVICE_ACCELEROMETER,
52         SENSOR_DEVICE_GRAVITY,
53         SENSOR_DEVICE_LINEAR_ACCELERATION,
54         SENSOR_DEVICE_GEOMAGNETIC,
55         SENSOR_DEVICE_ROTATION_VECTOR,
56         SENSOR_DEVICE_ORIENTATION,
57         SENSOR_DEVICE_GYROSCOPE,
58         SENSOR_DEVICE_LIGHT,
59         SENSOR_DEVICE_PROXIMITY,
60         SENSOR_DEVICE_PRESSURE,
61         SENSOR_DEVICE_ULTRAVIOLET,
62         SENSOR_DEVICE_TEMPERATURE,
63         SENSOR_DEVICE_HUMIDITY,
64         SENSOR_DEVICE_HRM,
65         SENSOR_DEVICE_HRM_LED_GREEN,
66         SENSOR_DEVICE_HRM_LED_IR,
67         SENSOR_DEVICE_HRM_LED_RED,
68         SENSOR_DEVICE_GYROSCOPE_UNCAL,
69         SENSOR_DEVICE_GEOMAGNETIC_UNCAL,
70         SENSOR_DEVICE_GYROSCOPE_RV,
71         SENSOR_DEVICE_GEOMAGNETIC_RV,
72
73         SENSOR_DEVICE_SIGNIFICANT_MOTION = 0x100,
74
75         SENSOR_DEVICE_HUMAN_PEDOMETER = 0x300,
76         SENSOR_DEVICE_HUMAN_SLEEP_MONITOR,
77         SENSOR_DEVICE_HUMAN_SLEEP_DETECTOR,
78         SENSOR_DEVICE_HUMAN_STRESS_MONITOR,
79
80         SENSOR_DEVICE_EXERCISE_WALKING = 0x400,
81         SENSOR_DEVICE_EXERCISE_RUNNING,
82         SENSOR_DEVICE_EXERCISE_HIKING,
83         SENSOR_DEVICE_EXERCISE_CYCLING,
84         SENSOR_DEVICE_EXERCISE_ELLIPTICAL,
85         SENSOR_DEVICE_EXERCISE_INDOOR_CYCLING,
86         SENSOR_DEVICE_EXERCISE_ROWING,
87         SENSOR_DEVICE_EXERCISE_STEPPER,
88
89         SENSOR_DEVICE_DATA_JOURNAL = 0x500,
90
91         SENSOR_DEVICE_FUSION = 0x900,
92         SENSOR_DEVICE_AUTO_ROTATION,
93         SENSOR_DEVICE_AUTO_BRIGHTNESS,
94         SENSOR_DEVICE_MYOTEST,
95
96         SENSOR_DEVICE_GESTURE_MOVEMENT = 0x1200,
97         SENSOR_DEVICE_GESTURE_WRIST_UP,
98         SENSOR_DEVICE_GESTURE_WRIST_DOWN,
99         SENSOR_DEVICE_GESTURE_MOVEMENT_STATE,
100         SENSOR_DEVICE_GESTURE_PICK_UP,
101         SENSOR_DEVICE_GESTURE_FACE_DOWN,
102
103         SENSOR_DEVICE_ACTIVITY_TRACKER = 0x1A00,
104         SENSOR_DEVICE_ACTIVITY_LEVEL_MONITOR,
105         SENSOR_DEVICE_GPS_BATCH,
106         SENSOR_DEVICE_PPG_BATCH,
107         SENSOR_DEVICE_GPS_TIMESYNC,
108
109         SENSOR_DEVICE_HRM_CTRL = 0x1A80,
110         SENSOR_DEVICE_REG_CTRL,
111         SENSOR_DEVICE_GPS_CTRL,
112
113         SENSOR_DEVICE_WEAR_STATUS = 0x2000,
114         SENSOR_DEVICE_WEAR_ON_MONITOR,
115         SENSOR_DEVICE_NO_MOVE_DETECTOR,
116         SENSOR_DEVICE_RESTING_HR,
117         SENSOR_DEVICE_STEP_LEVEL_MONITOR,
118         SENSOR_DEVICE_EXERCISE_STANDALONE,
119         SENSOR_DEVICE_EXERCISE_HR,
120         SENSOR_DEVICE_WORKOUT,
121         SENSOR_DEVICE_CYCLE_MONITOR,
122         SENSOR_DEVICE_STAIR_TRACKER,
123         SENSOR_DEVICE_PRESSURE_INDICATOR,
124         SENSOR_DEVICE_PRESSURE_ALERT,
125         SENSOR_DEVICE_HR_CALORIE,
126         SENSOR_DEVICE_SWIMMING_TRACKER,
127         SENSOR_DEVICE_STRESS_TRACKER,
128         SENSOR_DEVICE_FAKE_MOTION,
129         SENSOR_DEVICE_GEOFENCE,
130         SENSOR_DEVICE_SWIMMING_OUTDOOR,
131         SENSOR_DEVICE_AUTO_SWIMMING,
132         SENSOR_DEVICE_INACTIVITY_DETECTOR,
133         SENSOR_DEVICE_HRM_BP,
134         SENSOR_DEVICE_ECG,
135         SENSOR_DEVICE_FALL_DETECTION,
136
137         SENSOR_DEVICE_CONTEXT = 0x7000,
138         SENSOR_DEVICE_MOTION,
139         SENSOR_DEVICE_PIR,
140         SENSOR_DEVICE_PIR_LONG,
141         SENSOR_DEVICE_DUST,
142         SENSOR_DEVICE_THERMOMETER,
143         SENSOR_DEVICE_PEDOMETER,
144         SENSOR_DEVICE_FLAT,
145         SENSOR_DEVICE_HRM_RAW,
146         SENSOR_DEVICE_TILT,
147         SENSOR_DEVICE_ROTATION_VECTOR_RAW,
148         SENSOR_DEVICE_GSR,
149         SENSOR_DEVICE_SIMSENSE,
150         SENSOR_DEVICE_PPG,
151 } sensor_device_type;
152
153 /*
154  * A platform sensor handler is generated based on this handle
155  * This id can be assigned from HAL developer. so it has to be unique in 1 sensor_device.
156  */
157 typedef struct sensor_info_t {
158         uint32_t id;
159         const char *name;
160         sensor_device_type type;
161         unsigned int event_type; // for Internal API
162         const char *model_name;
163         const char *vendor;
164         float min_range;
165         float max_range;
166         float resolution;
167         int min_interval;
168         int max_batch_count;
169         bool wakeup_supported;
170 } sensor_info_t;
171
172 enum sensor_accuracy_t {
173         SENSOR_ACCURACY_UNDEFINED = -1,
174         SENSOR_ACCURACY_BAD = 0,
175         SENSOR_ACCURACY_NORMAL = 1,
176         SENSOR_ACCURACY_GOOD = 2,
177         SENSOR_ACCURACY_VERYGOOD = 3
178 };
179
180 #define SENSOR_DATA_VALUE_SIZE 16
181
182 /* sensor_data_t */
183 typedef struct sensor_data_t {
184         int accuracy;
185         unsigned long long timestamp;
186         int value_count;
187         float values[SENSOR_DATA_VALUE_SIZE];
188 } sensor_data_t;
189
190 #define SENSORHUB_DATA_VALUE_SIZE 4096
191
192 /* sensorhub_data_t */
193 typedef struct sensorhub_data_t {
194         int accuracy;
195         unsigned long long timestamp;
196
197         /*
198          *  Use "value_count" instead of "hub_data_size"
199          *  which is going to be removed soon
200          */
201         union {
202                 int value_count;
203                 int hub_data_size; /* deprecated */
204         };
205
206         /*
207          *  Use "values" instead of "hub_data"
208          *  which is going to be removed soon
209          */
210         union {
211                 char values[SENSORHUB_DATA_VALUE_SIZE];
212                 char hub_data[SENSORHUB_DATA_VALUE_SIZE]; /* deprecated */
213         };
214 } sensorhub_data_t;
215
216 #define SENSOR_PEDOMETER_DATA_DIFFS_SIZE        20
217
218 typedef struct {
219         int accuracy;
220         unsigned long long timestamp;
221         int value_count;        /* value_count == 8 */
222         float values[SENSOR_DATA_VALUE_SIZE];
223         /* values = {step count, walk step count, run step count,
224                      moving distance, calorie burned, last speed,
225                      last stepping frequency (steps per sec),
226                      last step status (walking, running, ...)} */
227         /* Additional data attributes (not in sensor_data_t)*/
228         int diffs_count;
229         struct differences {
230                 int timestamp;
231                 int steps;
232                 int walk_steps;
233                 int run_steps;
234                 int walk_up_steps;
235                 int walk_down_steps;
236                 int run_up_steps;
237                 int run_down_steps;
238                 float distance;
239                 float calories;
240                 float speed;
241         } diffs[SENSOR_PEDOMETER_DATA_DIFFS_SIZE];
242 } sensor_pedometer_data_t;
243
244 #define CONVERT_TYPE_ATTR(type, index) ((type) << 8 | 0x80 | (index))
245
246 enum sensor_attribute {
247         SENSOR_ATTR_ACCELEROMETER_INJECTION = CONVERT_TYPE_ATTR(SENSOR_DEVICE_ACCELEROMETER, 0xFF),
248         SENSOR_ATTR_ACTIVITY = CONVERT_TYPE_ATTR(SENSOR_DEVICE_ACTIVITY_TRACKER, 0x1),
249
250         SENSOR_ATTR_PEDOMETER_HEIGHT = CONVERT_TYPE_ATTR(SENSOR_DEVICE_HUMAN_PEDOMETER, 0x1),
251         SENSOR_ATTR_PEDOMETER_WEIGHT = CONVERT_TYPE_ATTR(SENSOR_DEVICE_HUMAN_PEDOMETER, 0x2),
252         SENSOR_ATTR_PEDOMETER_GENDER = CONVERT_TYPE_ATTR(SENSOR_DEVICE_HUMAN_PEDOMETER, 0x3),
253         SENSOR_ATTR_PEDOMETER_AGE = CONVERT_TYPE_ATTR(SENSOR_DEVICE_HUMAN_PEDOMETER, 0x4),
254         SENSOR_ATTR_PEDOMETER_FLUSH = CONVERT_TYPE_ATTR(SENSOR_DEVICE_HUMAN_PEDOMETER, 0x2F),
255
256         SENSOR_ATTR_STRESS_MONITOR_AGE = CONVERT_TYPE_ATTR(SENSOR_DEVICE_HUMAN_STRESS_MONITOR, 0x1),
257
258         SENSOR_ATTR_EXERCISE_TYPE = CONVERT_TYPE_ATTR(SENSOR_DEVICE_EXERCISE_STANDALONE, 0x1),
259         SENSOR_ATTR_EXERCISE_GPS = CONVERT_TYPE_ATTR(SENSOR_DEVICE_EXERCISE_STANDALONE, 0x2),
260         SENSOR_ATTR_EXERCISE_BATCH_INTERVAL = CONVERT_TYPE_ATTR(SENSOR_DEVICE_EXERCISE_STANDALONE, 0x3),
261         SENSOR_ATTR_EXERCISE_PSERVICE = CONVERT_TYPE_ATTR(SENSOR_DEVICE_EXERCISE_STANDALONE, 0x4),
262
263         SENSOR_ATTR_CYCLE_DURATION = CONVERT_TYPE_ATTR(SENSOR_DEVICE_CYCLE_MONITOR, 0x1),
264         SENSOR_ATTR_CYCLE_HOLDING_POSITION = CONVERT_TYPE_ATTR(SENSOR_DEVICE_CYCLE_MONITOR, 0x2),
265         SENSOR_ATTR_CYCLE_VELOCITY = CONVERT_TYPE_ATTR(SENSOR_DEVICE_CYCLE_MONITOR, 0x3),
266         SENSOR_ATTR_CYCLE_GET_DATA_TYPE = CONVERT_TYPE_ATTR(SENSOR_DEVICE_CYCLE_MONITOR, 0x4),
267         SENSOR_ATTR_CYCLE_DATA_FLUSH = CONVERT_TYPE_ATTR(SENSOR_DEVICE_CYCLE_MONITOR, 0x5),
268         SENSOR_ATTR_CYCLE_GPS_AGREEMENT = CONVERT_TYPE_ATTR(SENSOR_DEVICE_CYCLE_MONITOR, 0x6),
269
270         SENSOR_ATTR_WORKOUT_TYPE = CONVERT_TYPE_ATTR(SENSOR_DEVICE_WORKOUT, 0x1),
271         SENSOR_ATTR_WORKOUT_DURATION = CONVERT_TYPE_ATTR(SENSOR_DEVICE_WORKOUT, 0x2),
272
273         SENSOR_ATTR_RESTING_HR_OPR_MODE = CONVERT_TYPE_ATTR(SENSOR_DEVICE_RESTING_HR, 0x1),
274         SENSOR_ATTR_RESTING_HR_MAX_RHR = CONVERT_TYPE_ATTR(SENSOR_DEVICE_RESTING_HR, 0x2),
275         SENSOR_ATTR_RESTING_HR_MIN_RHR = CONVERT_TYPE_ATTR(SENSOR_DEVICE_RESTING_HR, 0x3),
276         SENSOR_ATTR_RESTING_HR_AVG_RHR = CONVERT_TYPE_ATTR(SENSOR_DEVICE_RESTING_HR, 0x4),
277         SENSOR_ATTR_RESTING_HR_HOUR = CONVERT_TYPE_ATTR(SENSOR_DEVICE_RESTING_HR, 0x5),
278         SENSOR_ATTR_RESTING_HR_MIN = CONVERT_TYPE_ATTR(SENSOR_DEVICE_RESTING_HR, 0x6),
279         SENSOR_ATTR_RESTING_HR_SEC = CONVERT_TYPE_ATTR(SENSOR_DEVICE_RESTING_HR, 0x7),
280         SENSOR_ATTR_RESTING_HR_PROPERTY_TYPE = CONVERT_TYPE_ATTR(SENSOR_DEVICE_RESTING_HR, 0x10),
281         SENSOR_ATTR_RESTING_HR_PROPERTY_HR_TYPE = CONVERT_TYPE_ATTR(SENSOR_DEVICE_RESTING_HR, 0x11),
282         SENSOR_ATTR_RESTING_HR_PROPERTY_HR_VALUE = CONVERT_TYPE_ATTR(SENSOR_DEVICE_RESTING_HR, 0x12),
283         SENSOR_ATTR_RESTING_HR_PROPERTY_DURATION = CONVERT_TYPE_ATTR(SENSOR_DEVICE_RESTING_HR, 0x13),
284         SENSOR_ATTR_RESTING_HR_PROPERTY_ACT_TYPE = CONVERT_TYPE_ATTR(SENSOR_DEVICE_RESTING_HR, 0x14),
285         SENSOR_ATTR_RESTING_HR_PROPERTY_ACT_DUR = CONVERT_TYPE_ATTR(SENSOR_DEVICE_RESTING_HR, 0x15),
286         SENSOR_ATTR_RESTING_HR_PROPERTY_CONT_DUR = CONVERT_TYPE_ATTR(SENSOR_DEVICE_RESTING_HR, 0x16),
287         SENSOR_ATTR_RESTING_HR_DATA_TYPE = CONVERT_TYPE_ATTR(SENSOR_DEVICE_RESTING_HR, 0x20),
288         SENSOR_ATTR_RESTING_HR_DATA_FLUSH = CONVERT_TYPE_ATTR(SENSOR_DEVICE_RESTING_HR, 0x21),
289
290         SENSOR_ATTR_STEP_LEVEL_MONITOR_DW_DURATION = CONVERT_TYPE_ATTR(SENSOR_DEVICE_STEP_LEVEL_MONITOR, 0x1),
291
292         SENSOR_ATTR_EXERCISE_HR_OPR_MODE = CONVERT_TYPE_ATTR(SENSOR_DEVICE_EXERCISE_HR, 0x1),
293         SENSOR_ATTR_EXERCISE_HR_ACTIVITY_TYPE = CONVERT_TYPE_ATTR(SENSOR_DEVICE_EXERCISE_HR, 0x2),
294         SENSOR_ATTR_EXERCISE_HR_BATCH_DUR = CONVERT_TYPE_ATTR(SENSOR_DEVICE_EXERCISE_HR, 0x3),
295         SENSOR_ATTR_EXERCISE_HR_FLUSH = CONVERT_TYPE_ATTR(SENSOR_DEVICE_EXERCISE_HR, 0x4),
296         SENSOR_ATTR_EXERCISE_HR_ELEVATED_DUR = CONVERT_TYPE_ATTR(SENSOR_DEVICE_EXERCISE_HR, 0x5),
297         SENSOR_ATTR_EXERCISE_HR_ELEVATED_THR = CONVERT_TYPE_ATTR(SENSOR_DEVICE_EXERCISE_HR, 0x6),
298         SENSOR_ATTR_EXERCISE_HR_BPM_RAW = CONVERT_TYPE_ATTR(SENSOR_DEVICE_EXERCISE_HR, 0x7),
299         SENSOR_ATTR_EXERCISE_HR_LOW_ALERT_DUR = CONVERT_TYPE_ATTR(SENSOR_DEVICE_EXERCISE_HR, 0x8),
300         SENSOR_ATTR_EXERCISE_HR_LOW_ALERT_THR = CONVERT_TYPE_ATTR(SENSOR_DEVICE_EXERCISE_HR, 0x9),
301
302         SENSOR_ATTR_PRESSURE_INDICATOR_START = CONVERT_TYPE_ATTR(SENSOR_DEVICE_PRESSURE_INDICATOR, 0x1),
303         SENSOR_ATTR_PRESSURE_INDICATOR_STOP = CONVERT_TYPE_ATTR(SENSOR_DEVICE_PRESSURE_INDICATOR, 0x2),
304         SENSOR_ATTR_PRESSURE_INDICATOR_FLUSH = CONVERT_TYPE_ATTR(SENSOR_DEVICE_PRESSURE_INDICATOR, 0x3),
305         SENSOR_ATTR_PRESSURE_INDICATOR_RESTORE_TIME = CONVERT_TYPE_ATTR(SENSOR_DEVICE_PRESSURE_INDICATOR, 0x4),
306         SENSOR_ATTR_PRESSURE_INDICATOR_RESTORE_VALUE = CONVERT_TYPE_ATTR(SENSOR_DEVICE_PRESSURE_INDICATOR, 0x5),
307         SENSOR_ATTR_PRESSURE_INDICATOR_CURRENT_TIME = CONVERT_TYPE_ATTR(SENSOR_DEVICE_PRESSURE_INDICATOR, 0x6),
308
309         SENSOR_ATTR_PRESSURE_ALERT_START = CONVERT_TYPE_ATTR(SENSOR_DEVICE_PRESSURE_ALERT, 0x1),
310         SENSOR_ATTR_PRESSURE_ALERT_STOP = CONVERT_TYPE_ATTR(SENSOR_DEVICE_PRESSURE_ALERT, 0x2),
311
312         SENSOR_ATTR_HR_CALORIE_AGE = CONVERT_TYPE_ATTR(SENSOR_DEVICE_HR_CALORIE, 0x1),
313         SENSOR_ATTR_HR_CALORIE_HEIGHT = CONVERT_TYPE_ATTR(SENSOR_DEVICE_HR_CALORIE, 0x2),
314         SENSOR_ATTR_HR_CALORIE_WEIGHT = CONVERT_TYPE_ATTR(SENSOR_DEVICE_HR_CALORIE, 0x3),
315         SENSOR_ATTR_HR_CALORIE_GENDER = CONVERT_TYPE_ATTR(SENSOR_DEVICE_HR_CALORIE, 0x4),
316         SENSOR_ATTR_HR_CALORIE_INST = CONVERT_TYPE_ATTR(SENSOR_DEVICE_HR_CALORIE, 0x10),
317         SENSOR_ATTR_HR_CALORIE_EXERCISE_TYPE = CONVERT_TYPE_ATTR(SENSOR_DEVICE_HR_CALORIE, 0x11),
318         SENSOR_ATTR_HR_CALORIE_TARGET_CAL = CONVERT_TYPE_ATTR(SENSOR_DEVICE_HR_CALORIE, 0x12),
319         SENSOR_ATTR_HR_CALORIE_MAX_HEARTRATE = CONVERT_TYPE_ATTR(SENSOR_DEVICE_HR_CALORIE, 0x13),
320         SENSOR_ATTR_HR_CALORIE_FLUSH = CONVERT_TYPE_ATTR(SENSOR_DEVICE_HR_CALORIE, 0x20),
321
322         SENSOR_ATTR_SWIMMING_TRACKER_PLACE = CONVERT_TYPE_ATTR(SENSOR_DEVICE_SWIMMING_TRACKER, 0x1),
323         SENSOR_ATTR_SWIMMING_TRACKER_DISTANCE = CONVERT_TYPE_ATTR(SENSOR_DEVICE_SWIMMING_TRACKER, 0x2),
324         SENSOR_ATTR_SWIMMING_TRACKER_FLUSH = CONVERT_TYPE_ATTR(SENSOR_DEVICE_SWIMMING_TRACKER, 0x3),
325         SENSOR_ATTR_SWIMMING_TRACKER_BATCH = CONVERT_TYPE_ATTR(SENSOR_DEVICE_SWIMMING_TRACKER, 0x4),
326         SENSOR_ATTR_SWIMMING_TRACKER_GOAL_CALORIES = CONVERT_TYPE_ATTR(SENSOR_DEVICE_SWIMMING_TRACKER, 0x5),
327         SENSOR_ATTR_SWIMMING_TRACKER_GOAL_LAPS = CONVERT_TYPE_ATTR(SENSOR_DEVICE_SWIMMING_TRACKER, 0x6),
328         SENSOR_ATTR_SWIMMING_TRACKER_TIME_REST = CONVERT_TYPE_ATTR(SENSOR_DEVICE_SWIMMING_TRACKER, 0x7),
329         SENSOR_ATTR_SWIMMING_TRACKER_TIME_TURN = CONVERT_TYPE_ATTR(SENSOR_DEVICE_SWIMMING_TRACKER, 0x8),
330
331         SENSOR_ATTR_SWIMMING_OUTDOOR_SET_BATCH_LAP_COUNT = CONVERT_TYPE_ATTR(SENSOR_DEVICE_SWIMMING_OUTDOOR, 0x1),
332         SENSOR_ATTR_SWIMMING_OUTDOOR_SETGOAL_LENGTH = CONVERT_TYPE_ATTR(SENSOR_DEVICE_SWIMMING_OUTDOOR, 0x2),
333         SENSOR_ATTR_SWIMMING_OUTDOOR_SETGOAL_TIME = CONVERT_TYPE_ATTR(SENSOR_DEVICE_SWIMMING_OUTDOOR, 0x3),
334         SENSOR_ATTR_SWIMMING_OUTDOOR_SET_GPS_PERMISSION = CONVERT_TYPE_ATTR(SENSOR_DEVICE_SWIMMING_OUTDOOR, 0x4),
335         SENSOR_ATTR_SWIMMING_OUTDOOR_FLUSH = CONVERT_TYPE_ATTR(SENSOR_DEVICE_SWIMMING_OUTDOOR, 0x6),
336
337         SENSOR_ATTR_AUTO_SWIMMING_DURATION = CONVERT_TYPE_ATTR(SENSOR_DEVICE_AUTO_SWIMMING, 0x1),
338
339         SENSOR_ATTR_INACTIVITY_DETECTOR_LEVEL = CONVERT_TYPE_ATTR(SENSOR_DEVICE_INACTIVITY_DETECTOR, 0x1),
340         SENSOR_ATTR_INACTIVITY_DETECTOR_DURATION = CONVERT_TYPE_ATTR(SENSOR_DEVICE_INACTIVITY_DETECTOR, 0x2),
341
342         SENSOR_ATTR_STRESS_TRACKER_DUR = CONVERT_TYPE_ATTR(SENSOR_DEVICE_STRESS_TRACKER, 0x1),
343         SENSOR_ATTR_STRESS_TRACKER_FLUSH = CONVERT_TYPE_ATTR(SENSOR_DEVICE_STRESS_TRACKER, 0x2),
344
345         SENSOR_ATTR_STRESS_MONITOR_BASE_HR = CONVERT_TYPE_ATTR(SENSOR_DEVICE_HUMAN_STRESS_MONITOR, 0x1),
346         SENSOR_ATTR_STRESS_MONITOR_HISTO_INDEX = CONVERT_TYPE_ATTR(SENSOR_DEVICE_HUMAN_STRESS_MONITOR, 0x2),
347         SENSOR_ATTR_STRESS_MONITOR_HISTO_VALUE = CONVERT_TYPE_ATTR(SENSOR_DEVICE_HUMAN_STRESS_MONITOR, 0x3),
348         SENSOR_ATTR_STRESS_MONITOR_TUNE_INDEX = CONVERT_TYPE_ATTR(SENSOR_DEVICE_HUMAN_STRESS_MONITOR, 0x4),
349         SENSOR_ATTR_STRESS_MONITOR_TUNE_VALUE = CONVERT_TYPE_ATTR(SENSOR_DEVICE_HUMAN_STRESS_MONITOR, 0x5),
350         SENSOR_ATTR_STRESS_MONITOR_FLUSH = CONVERT_TYPE_ATTR(SENSOR_DEVICE_HUMAN_STRESS_MONITOR, 0x6),
351         SENSOR_ATTR_STRESS_MONITOR_OPERATION = CONVERT_TYPE_ATTR(SENSOR_DEVICE_HUMAN_STRESS_MONITOR, 0x7),
352
353         SENSOR_ATTR_SLEEP_MONITOR_STOP = CONVERT_TYPE_ATTR(SENSOR_DEVICE_HUMAN_SLEEP_MONITOR, 0x1),
354         SENSOR_ATTR_SLEEP_MONITOR_FLUSH = CONVERT_TYPE_ATTR(SENSOR_DEVICE_HUMAN_SLEEP_MONITOR, 0x2),
355
356         SENSOR_ATTR_SLEEP_DETECTOR_STOP = CONVERT_TYPE_ATTR(SENSOR_DEVICE_HUMAN_SLEEP_DETECTOR, 0x1),
357         SENSOR_ATTR_SLEEP_DETECTOR_SETTING = CONVERT_TYPE_ATTR(SENSOR_DEVICE_HUMAN_SLEEP_DETECTOR, 0x2),
358
359         SENSOR_ATTR_DATA_JOURNAL_START = CONVERT_TYPE_ATTR(SENSOR_DEVICE_DATA_JOURNAL, 0x1),
360         SENSOR_ATTR_DATA_JOURNAL_STOP = CONVERT_TYPE_ATTR(SENSOR_DEVICE_DATA_JOURNAL, 0x2),
361
362         SENSOR_ATTR_GPS_BATCH_OPR_MODE = CONVERT_TYPE_ATTR(SENSOR_DEVICE_GPS_BATCH, 0x1),
363
364         SENSOR_ATTR_PPG_BATCH_POLLING_INTERVAL = CONVERT_TYPE_ATTR(SENSOR_DEVICE_PPG_BATCH, 0x1),
365         SENSOR_ATTR_PPG_BATCH_FLUSH = CONVERT_TYPE_ATTR(SENSOR_DEVICE_PPG_BATCH, 0x2),
366
367         SENSOR_ATTR_REG_CTRL_TYPE = CONVERT_TYPE_ATTR(SENSOR_DEVICE_REG_CTRL, 0x1),
368         SENSOR_ATTR_REG_CTRL_ADDRESS = CONVERT_TYPE_ATTR(SENSOR_DEVICE_REG_CTRL, 0x2),
369         SENSOR_ATTR_REG_CTRL_VALUE = CONVERT_TYPE_ATTR(SENSOR_DEVICE_REG_CTRL, 0x3),
370         SENSOR_ATTR_REG_CTRL_MODE = CONVERT_TYPE_ATTR(SENSOR_DEVICE_REG_CTRL, 0x4),
371
372         SENSOR_ATTR_GPS_CTRL_SETTING = CONVERT_TYPE_ATTR(SENSOR_DEVICE_GPS_CTRL, 0x1),
373
374         SENSOR_ATTR_FAKE_MOTION_EVENT_INTERVAL = CONVERT_TYPE_ATTR(SENSOR_DEVICE_FAKE_MOTION, 0x1),
375         SENSOR_ATTR_FAKE_MOTION_EVENT_COUNT = CONVERT_TYPE_ATTR(SENSOR_DEVICE_FAKE_MOTION, 0x2),
376         SENSOR_ATTR_FAKE_MOTION_PAUSE_INTERVAL = CONVERT_TYPE_ATTR(SENSOR_DEVICE_FAKE_MOTION, 0x3),
377
378         SENSOR_ATTR_GEOFENCE_ID = CONVERT_TYPE_ATTR(SENSOR_DEVICE_GEOFENCE, 0x1),
379         SENSOR_ATTR_GEOFENCE_LAT = CONVERT_TYPE_ATTR(SENSOR_DEVICE_GEOFENCE, 0x2),
380         SENSOR_ATTR_GEOFENCE_LON = CONVERT_TYPE_ATTR(SENSOR_DEVICE_GEOFENCE, 0x3),
381         SENSOR_ATTR_GEOFENCE_RADIUS = CONVERT_TYPE_ATTR(SENSOR_DEVICE_GEOFENCE, 0x4),
382         SENSOR_ATTR_GEOFENCE_PROVIDER = CONVERT_TYPE_ATTR(SENSOR_DEVICE_GEOFENCE, 0x5),
383         SENSOR_ATTR_GEOFENCE_ACCURACY = CONVERT_TYPE_ATTR(SENSOR_DEVICE_GEOFENCE, 0x6),
384         SENSOR_ATTR_GEOFENCE_TIMESTAMP = CONVERT_TYPE_ATTR(SENSOR_DEVICE_GEOFENCE, 0x7),
385         SENSOR_ATTR_GEOFENCE_CONNECT = CONVERT_TYPE_ATTR(SENSOR_DEVICE_GEOFENCE, 0x8),
386         SENSOR_ATTR_GEOFENCE_START = CONVERT_TYPE_ATTR(SENSOR_DEVICE_GEOFENCE, 0x10),
387         SENSOR_ATTR_GEOFENCE_STOP = CONVERT_TYPE_ATTR(SENSOR_DEVICE_GEOFENCE, 0x11),
388         SENSOR_ATTR_GEOFENCE_SET_LOCATION = CONVERT_TYPE_ATTR(SENSOR_DEVICE_GEOFENCE, 0x12),
389         SENSOR_ATTR_GEOFENCE_BT_CONNECT = CONVERT_TYPE_ATTR(SENSOR_DEVICE_GEOFENCE, 0x13),
390
391         SENSOR_ATTR_FALL_DETECTION_OPR_MODE = CONVERT_TYPE_ATTR(SENSOR_DEVICE_FALL_DETECTION, 0x1),
392 };
393
394 enum sensor_activity {
395         SENSOR_ACTIVITY_UNKNOWN = 1,
396         SENSOR_ACTIVITY_STILL = 2,
397         SENSOR_ACTIVITY_WALKING = 4,
398         SENSOR_ACTIVITY_RUNNING = 8,
399         SENSOR_ACTIVITY_IN_VEHICLE = 16,
400         SENSOR_ACTIVITY_ON_BICYCLE = 32,
401 };
402
403 #ifdef __cplusplus
404 }
405 #endif /* __cplusplus */
406
407 #endif /* _SENSOR_HAL_TYPES_H_ */