4 * Copyright (c) 2013 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 _SENSOR_INFO_H_
21 #define _SENSOR_INFO_H_
24 #include <sensor_types.h>
28 typedef std::vector<char> raw_data_t;
29 typedef raw_data_t::iterator raw_data_iterator;
33 sensor_type_t get_type(void);
34 sensor_id_t get_id(void);
35 sensor_privilege_t get_privilege(void);
36 const char* get_name(void);
37 const char* get_vendor(void);
38 float get_min_range(void);
39 float get_max_range(void);
40 float get_resolution(void);
41 int get_min_interval(void);
42 int get_fifo_count(void);
43 int get_max_batch_count(void);
44 unsigned int get_supported_event(void);
45 bool is_supported_event(unsigned int event);
46 bool is_wakeup_supported(void);
48 void set_type(sensor_type_t type);
49 void set_id(sensor_id_t id);
50 void set_privilege(sensor_privilege_t privilege);
51 void set_name(const char *name);
52 void set_vendor(const char *vendor);
53 void set_min_range(float min_range);
54 void set_max_range(float max_range);
55 void set_resolution(float resolution);
56 void set_min_interval(int min_interval);
57 void set_fifo_count(int fifo_count);
58 void set_max_batch_count(int max_batch_count);
59 void set_supported_event(unsigned int event);
60 void set_wakeup_supported(bool supported);
64 void get_raw_data(raw_data_t &data);
65 void set_raw_data(const char *data, int data_len);
70 sensor_privilege_t m_privilege;
78 int m_max_batch_count;
79 unsigned int m_supported_event;
80 bool m_wakeup_supported;
82 void put(raw_data_t &data, int value);
83 void put(raw_data_t &data, unsigned int value);
84 void put(raw_data_t &data, int64_t value);
85 void put(raw_data_t &data, float value);
86 void put(raw_data_t &data, std::string &value);
87 void put(raw_data_t &data, bool value);
89 raw_data_iterator get(raw_data_iterator it, int &value);
90 raw_data_iterator get(raw_data_iterator it, unsigned int &value);
91 raw_data_iterator get(raw_data_iterator it, int64_t &value);
92 raw_data_iterator get(raw_data_iterator it, float &value);
93 raw_data_iterator get(raw_data_iterator it, std::string &value);
94 raw_data_iterator get(raw_data_iterator it, bool &value);
97 #endif /* _SENSOR_INFO_H_ */