4 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
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
10 * http://www.apache.org/licenses/LICENSE-2.0
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.
20 #ifndef _PROXI_SENSOR_HAL_H_
21 #define _PROXI_SENSOR_HAL_H_
23 #include <sensor_hal.h>
26 #define IIO_DIR "/sys/bus/iio/devices/"
27 #define NAME_NODE "/name"
28 #define EVENT_DIR "/events"
29 #define EVENT_EN_NODE "/in_proximity_thresh_either_en"
30 #define DEV_DIR "/dev/"
32 #define IIO_DEV_BASE_NAME "iio:device"
33 #define IIO_DEV_STR_LEN 10
35 #define PROXIMITY_NODE_STATE_NEAR 1
36 #define PROXIMITY_NODE_STATE_FAR 2
37 #define PROXIMITY_TYPE 8
41 class proxi_sensor_hal : public sensor_hal
45 virtual ~proxi_sensor_hal();
46 string get_model_id(void);
47 sensor_type_t get_type(void);
50 bool is_data_ready(bool wait);
51 virtual int get_sensor_data(sensor_data_t &data);
52 bool get_properties(sensor_properties_t &properties);
53 bool check_hw_node(void);
58 unsigned long long m_fired_time;
59 bool m_sensorhub_supported;
68 string m_enable_resource;
69 string m_event_resource;
75 bool enable_resource(bool enable);
76 bool update_value(bool wait);
77 bool is_sensorhub_supported(void);
79 #endif /*_PROXI_SENSOR_HAL_H_*/