sensor: re-sample pressure data and perform lazy insertions to reduce DB overhead
[platform/core/context/context-provider.git] / src / sensor / TypesInternal.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 #ifndef __CONTEXT_SENSOR_RECORDER_TYPES_INTERNAL_H__
18 #define __CONTEXT_SENSOR_RECORDER_TYPES_INTERNAL_H__
19
20 /* Tables */
21 #define CLIENT_INFO                     "SensorClientInfo"
22
23 #define PEDOMETER_RECORD                "SensorPedometerRecord"
24 #define PRESSURE_RECORD                 "SensorPressureRecord"
25 #define SLEEP_MONITOR_RECORD    "SensorSleepMonitorRecord"
26 #define HEART_RATE_RECORD               "SensorHeartRateRecord"
27
28 /* Privileges */
29 #define PRIV_HEALTHINFO         "healthinfo"
30
31 /* Constants */
32 #define SECONDS_PER_MINUTE      60
33 #define SECONDS_PER_HOUR        3600
34 #define SECONDS_PER_DAY         86400
35
36 #define MAX_RETENTION_PERIOD    2678400                         /* 1 month (31 days) */
37 #define DEFAULT_RETENTION               SECONDS_PER_HOUR        /* 1 hour */
38 #define DEFAULT_QUERY_PERIOD    SECONDS_PER_DAY         /* 1 day */
39
40 /* Time Conversions */
41 #define SEC_TO_MS(X)    ((X) * 1000)
42
43 #endif  /* __CONTEXT_SENSOR_RECORDER_TYPES_INTERNAL_H__ */