sensor-hal: re-organize build procedure
[platform/adaptation/tm1/sensor-hal-tm1.git] / src / proximity / proxi_sensor_device.h
1 /*
2  * proxi_sensor_device
3  *
4  * Copyright (c) 2014 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 #ifndef _PROXI_SENSOR_DEVICE_H_
21 #define _PROXI_SENSOR_DEVICE_H_
22
23 #include <sensor_device_base.h>
24
25 class proxi_sensor_device : public sensor_device_base
26 {
27 public:
28         proxi_sensor_device();
29         virtual ~proxi_sensor_device();
30
31         int get_poll_fd(void);
32         bool get_sensors(std::vector<sensor_handle_t> &sensors);
33         bool enable(uint32_t id);
34         bool disable(uint32_t id);
35         bool set_interval(uint32_t id, unsigned long ms_interval);
36         bool set_batch_latency(uint32_t id, unsigned long val);
37         bool set_command(uint32_t id, std::string command, std::string value);
38         bool is_data_ready(void);
39         bool get_sensor_data(uint32_t id, sensor_data_t &data);
40         int get_sensor_event(uint32_t id, sensor_event_t **event);
41         bool get_properties(uint32_t id, sensor_properties_s &properties);
42
43 private:
44         int m_node_handle;
45         unsigned int m_state;
46         unsigned long long m_fired_time;
47         bool m_sensorhub_controlled;
48
49         std::string m_data_node;
50         std::string m_enable_node;
51
52         bool update_value(void);
53 };
54 #endif /*_PROXI_SENSOR_DEVICE_H_*/