sensord: compare previous interval with current interval
[platform/core/system/sensord.git] / src / server / application_sensor_handler.cpp
1 /*
2  * sensord
3  *
4  * Copyright (c) 2017 Samsung Electronics Co., Ltd.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  */
19
20 #include "application_sensor_handler.h"
21
22 #include <sensor_log.h>
23 #include <algorithm>
24
25 using namespace sensor;
26
27 application_sensor_handler::application_sensor_handler(const sensor_info &info)
28 : m_info(info)
29 {
30 }
31
32 application_sensor_handler::~application_sensor_handler()
33 {
34 }
35
36 int application_sensor_handler::post(sensor_data_t *data, int len)
37 {
38         std::string uri = m_info.get_type_uri();
39
40         return notify(uri.c_str(), data, len);
41 }
42
43 const sensor_info &application_sensor_handler::get_sensor_info(void)
44 {
45         return m_info;
46 }
47
48 int application_sensor_handler::start(sensor_observer *ob)
49 {
50         add_observer(ob);
51
52         return OP_SUCCESS;
53 }
54
55 int application_sensor_handler::stop(sensor_observer *ob)
56 {
57         remove_observer(ob);
58
59         return OP_SUCCESS;
60 }
61
62 int application_sensor_handler::set_interval(sensor_observer *ob, int32_t interval)
63 {
64         return OP_SUCCESS;
65 }
66
67 int application_sensor_handler::set_batch_latency(sensor_observer *ob, int32_t latency)
68 {
69         return OP_SUCCESS;
70 }
71
72 int application_sensor_handler::set_attribute(sensor_observer *ob, int32_t attr, int32_t value)
73 {
74         return OP_SUCCESS;
75 }
76
77 int application_sensor_handler::set_attribute(sensor_observer *ob, int32_t attr, const char *value, int len)
78 {
79         return OP_SUCCESS;
80 }
81
82 int application_sensor_handler::flush(sensor_observer *ob)
83 {
84         return OP_SUCCESS;
85 }
86
87 int application_sensor_handler::get_data(sensor_data_t **data, int *len)
88 {
89         return OP_SUCCESS;
90 }