sync with tizen_2.2
[sdk/emulator-plugin-accel.git] / include / caccel_sim.h
1 /*
2  * emulator-plugin-accel
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact:
7  * SooYoung Ha <yoosah.ha@samsnung.com>
8  * Sungmin Ha <sungmin82.ha@samsung.com>
9  * 
10  * This library is free software; you can redistribute it and/or modify it under
11  * the terms of the GNU Lesser General Public License as published by the
12  * Free Software Foundation; either version 2.1 of the License, or (at your option)
13  * any later version.
14  * 
15  * This library is distributed in the hope that it will be useful, but WITHOUT ANY
16  * WARRANTY; without even the implied warranty of MERCHANTABILITY or
17  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
18  * License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * along with this library; if not, write to the Free Software Foundation, Inc., 51
22  * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23  *
24  */
25
26 class caccel_sim : public csensor_module
27 {
28 public:
29         enum accel_sim_cmd_property_t {
30                 PROPERTY_CMD_START = 0,
31                 PROPERTY_CMD_1,
32                 PROPERTY_CMD_2,
33                 PROPERTY_CMD_3,
34                 PROPERTY_CMD_4,
35                 PROPERTY_CMD_5,
36         };
37
38         caccel_sim();
39         virtual ~caccel_sim();
40
41         const char *name(void);
42         int version(void);
43         int id(void);
44
45         bool is_data_ready(bool wait=false);
46
47         long value(const char *port);
48         long value(int id);
49
50         bool update_name(char *name);
51         bool update_version(int ver);
52         bool update_id(int id);
53
54         int port_count(void);
55         const char *port(int idx);
56
57         bool need_polling(void);
58         long polling_interval(void);
59         bool update_polling_interval(unsigned long val);
60         int get_sensor_type(void);
61         long set_cmd(int type , int property , long input_value);
62         int get_property(unsigned int property_level , void *property_data);
63         int get_struct_value(unsigned int struct_type , void *struct_values);   
64
65         bool calibration(int iteration);
66         
67         int check_hw_node(void);
68         
69         bool start(void);
70         bool stop(void);
71
72         void reset(void);       
73         
74 private:
75
76         static const char *m_port[];
77
78         char *m_name;
79         long m_id;
80         long m_version;
81         unsigned long m_polling_interval;
82
83         int m_x;
84         int m_y;
85         int m_z;
86
87         int m_offset_x;
88         int m_offset_y;
89         int m_offset_z;
90         int m_calibration_flag;
91
92         unsigned long long m_fired_time;
93
94         bool update_value(void);
95
96         int m_client;
97         int m_sensor_type;
98         char *m_resource;
99 };
100
101
102
103 //! End of a file