summaryrefslogtreecommitdiff
path: root/src/modules/eeze
diff options
context:
space:
mode:
authorStefan Schmidt <s.schmidt@samsung.com>2013-04-11 11:58:13 +0100
committerStefan Schmidt <s.schmidt@samsung.com>2013-04-11 13:11:08 +0100
commit25843ac65e058a5119cbc4742682d79ce778c2ba (patch)
treee9d827082b6e8c4a1ad9c1dca8e2a3b166fdf5c5 /src/modules/eeze
parent7ccc9f20ba6a5fd56edf22129c955f0a9238233e (diff)
eeze/sensor/tizen: Fix bug where we set the wrong sensor type to the object.
Eeze sensor and Tizen types can't be in sync as the order have been changed several times in Tizen already. We need to keep the order stable for ABI compliance though after 1.8. While we did the translation in one direction we did not in the other. Fix this bug that shows now.
Diffstat (limited to 'src/modules/eeze')
-rw-r--r--src/modules/eeze/sensor/tizen/tizen.c71
1 files changed, 70 insertions, 1 deletions
diff --git a/src/modules/eeze/sensor/tizen/tizen.c b/src/modules/eeze/sensor/tizen/tizen.c
index 50cabaee2b..9dfe34d7f7 100644
--- a/src/modules/eeze/sensor/tizen/tizen.c
+++ b/src/modules/eeze/sensor/tizen/tizen.c
@@ -96,6 +96,75 @@ eeze_to_tizen(Eeze_Sensor_Type type)
96 } 96 }
97} 97}
98 98
99/* Reverse mapping from Tizen to eeze sensor types */
100static Eeze_Sensor_Type
101tizen_to_eeze(sesnor_type_e type)
102{
103 switch (type)
104 {
105 case SENSOR_ACCELEROMETER:
106 return EEZE_SENSOR_TYPE_ACCELEROMETER;
107
108 case SENSOR_GRAVITY:
109 return EEZE_SENSOR_TYPE_GRAVITY;
110
111 case SENSOR_LINEAR_ACCELERATION:
112 return EEZE_SENSOR_TYPE_LINEAR_ACCELERATION;
113
114 case SENSOR_DEVICE_ORIENTATION:
115 return EEZE_SENSOR_TYPE_DEVICE_ORIENTATION;
116
117 case SENSOR_MAGNETIC:
118 return EEZE_SENSOR_TYPE_MAGNETIC;
119
120 case SENSOR_ORIENTATION:
121 return EEZE_SENSOR_TYPE_ORIENTATION;
122
123 case SENSOR_GYROSCOPE:
124 return EEZE_SENSOR_TYPE_GYROSCOPE;
125
126 case SENSOR_LIGHT:
127 return EEZE_SENSOR_TYPE_LIGHT;
128
129 case SENSOR_PROXIMITY:
130 return EEZE_SENSOR_TYPE_PROXIMITY;
131
132 case SENSOR_MOTION_SNAP:
133 return EEZE_SENSOR_TYPE_MOTION_SNAP;
134
135 case SENSOR_MOTION_SHAKE:
136 return EEZE_SENSOR_TYPE_MOTION_SHAKE;
137
138 case SENSOR_MOTION_DOUBLETAP:
139 return EEZE_SENSOR_TYPE_MOTION_DOUBLETAP;
140
141 case SENSOR_MOTION_PANNING:
142 return EEZE_SENSOR_TYPE_MOTION_PANNING;
143
144 case SENSOR_MOTION_PANNING_BROWSE:
145 return EEZE_SENSOR_TYPE_MOTION_PANNING_BROWSE;
146
147 case SENSOR_MOTION_TILT:
148 return EEZE_SENSOR_TYPE_MOTION_TILT;
149
150 case SENSOR_MOTION_FACEDOWN:
151 return EEZE_SENSOR_TYPE_MOTION_FACEDOWN;
152
153 case SENSOR_MOTION_DIRECTCALL:
154 return EEZE_SENSOR_TYPE_MOTION_DIRECT_CALL;
155
156 case SENSOR_MOTION_SMART_ALERT:
157 return EEZE_SENSOR_TYPE_MOTION_SMART_ALERT;
158
159 case SENSOR_MOTION_NO_MOVE:
160 return EEZE_SENSOR_TYPE_MOTION_NO_MOVE;
161
162 default:
163 ERR("No matching eeze sensor type available.");
164 return -1;
165 }
166}
167
99/* All following callback function work with the same scheme. 168/* All following callback function work with the same scheme.
100 * They are callbacks coming in from the tizen system sensor library. With the 169 * They are callbacks coming in from the tizen system sensor library. With the
101 * data we receive we update the matching sensor object to always have the 170 * data we receive we update the matching sensor object to always have the
@@ -1230,7 +1299,7 @@ eeze_sensor_tizen_sensors_find(void)
1230 if (supported) 1299 if (supported)
1231 { 1300 {
1232 Eeze_Sensor_Obj *obj = calloc(1, sizeof(Eeze_Sensor_Obj)); 1301 Eeze_Sensor_Obj *obj = calloc(1, sizeof(Eeze_Sensor_Obj));
1233 obj->type = type; 1302 obj->type = tizen_to_eeze(type);
1234 esensor_module->sensor_list = eina_list_append(esensor_module->sensor_list, obj); 1303 esensor_module->sensor_list = eina_list_append(esensor_module->sensor_list, obj);
1235 } 1304 }
1236 } 1305 }