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.
24 #include <sensor_common.h>
27 #include <sensor_logs.h>
29 #define COMMAND_CHANNEL_PATH "/tmp/sensord_command_socket"
30 #define EVENT_CHANNEL_PATH "/tmp/sensord_event_socket"
32 #define MAX_HANDLE 256
33 #define MAX_HANDLE_REACHED -2
35 #define CLIENT_ID_INVALID -1
54 CMD_SEND_SENSORHUB_DATA,
59 SENSOR_STATE_UNKNOWN = -1,
60 SENSOR_STATE_STOPPED = 0,
61 SENSOR_STATE_STARTED = 1,
62 SENSOR_STATE_PAUSED = 2
65 enum poll_interval_t {
73 POLL_MAX_HZ_MS = POLL_1HZ_MS,
81 } cmd_get_sensor_list_t;
108 } cmd_get_sensor_list_done_t;
112 sensor_data_t base_data;
113 } cmd_get_data_done_t;
122 unsigned int event_type;
126 unsigned int event_type;
130 unsigned int interval;
131 unsigned int latency;
153 } cmd_send_sensorhub_data_t;
155 #define EVENT_CHANNEL_MAGIC 0xCAFECAFE
160 } event_channel_ready_t;
162 typedef struct sensor_event_t {
163 unsigned int event_type;
164 sensor_id_t sensor_id;
165 unsigned int data_length;
169 typedef struct sensorhub_event_t {
170 unsigned int event_type;
171 sensor_id_t sensor_id;
172 unsigned int data_length;
173 sensorhub_data_t data;
176 typedef void *(*cmd_func_t)(void *data, void *cb_data);
178 typedef std::vector<unsigned int> event_type_vector;
180 enum sensor_permission_t {
181 SENSOR_PERMISSION_NONE = 0,
182 SENSOR_PERMISSION_STANDARD = (1 << 0),
183 SENSOR_PERMISSION_BIO = (1 << 1),
186 #define BIO_SENSOR_PRIVELEGE_NAME "sensord::bio"
187 #define BIO_SENSOR_ACCESS_RIGHT "rw"
189 #endif /* _SF_COMMON_H_ */