summaryrefslogtreecommitdiff
path: root/src/modules/eeze
diff options
context:
space:
mode:
authorStefan Schmidt <s.schmidt@samsung.com>2013-03-28 13:52:58 +0000
committerStefan Schmidt <s.schmidt@samsung.com>2013-03-28 14:38:12 +0000
commitbc93fd6aa7b14a5935d03e7d6ca30d596dbcffc6 (patch)
tree1978b9cbb169f7d36514a67bcbb734621b0da91b /src/modules/eeze
parentad9fbb41d2a70646175c873ecac18536e28a8d2a (diff)
eeze/sensor/fake: Finally fix fake module to send out correct ecore events.
Sensor type is completely different from event type.
Diffstat (limited to 'src/modules/eeze')
-rw-r--r--src/modules/eeze/sensor/fake/fake.c44
1 files changed, 31 insertions, 13 deletions
diff --git a/src/modules/eeze/sensor/fake/fake.c b/src/modules/eeze/sensor/fake/fake.c
index 61234589fb..b8ccc2f228 100644
--- a/src/modules/eeze/sensor/fake/fake.c
+++ b/src/modules/eeze/sensor/fake/fake.c
@@ -114,30 +114,48 @@ fake_async_read(Eeze_Sensor_Type sensor_type, void *user_data EINA_UNUSED)
114 return EINA_FALSE; 114 return EINA_FALSE;
115 } 115 }
116 116
117 /* Default values for sensor objects with three data points */
118 obj->accuracy = -1;
119 obj->data[0] = 7;
120 obj->data[1] = 23;
121 obj->data[2] = 42;
122 gettimeofday(&tv, NULL);
123 obj->timestamp = ((tv.tv_sec * 1000000) + tv.tv_usec);
124
117 switch (sensor_type) 125 switch (sensor_type)
118 { 126 {
119 case EEZE_SENSOR_TYPE_ACCELEROMETER: 127 case EEZE_SENSOR_TYPE_ACCELEROMETER:
128 ecore_event_add(EEZE_SENSOR_EVENT_ACCELEROMETER, obj, NULL, NULL);
129 break;
120 case EEZE_SENSOR_TYPE_MAGNETIC: 130 case EEZE_SENSOR_TYPE_MAGNETIC:
131 ecore_event_add(EEZE_SENSOR_EVENT_MAGNETIC, obj, NULL, NULL);
132 break;
121 case EEZE_SENSOR_TYPE_ORIENTATION: 133 case EEZE_SENSOR_TYPE_ORIENTATION:
134 ecore_event_add(EEZE_SENSOR_EVENT_ORIENTATION, obj, NULL, NULL);
135 break;
122 case EEZE_SENSOR_TYPE_GYROSCOPE: 136 case EEZE_SENSOR_TYPE_GYROSCOPE:
123 obj->accuracy = -1; 137 ecore_event_add(EEZE_SENSOR_EVENT_GYROSCOPE, obj, NULL, NULL);
124 obj->data[0] = 7;
125 obj->data[1] = 23;
126 obj->data[2] = 42;
127 gettimeofday(&tv, NULL);
128 obj->timestamp = ((tv.tv_sec * 1000000) + tv.tv_usec);
129 ecore_event_add(sensor_type, obj, NULL, NULL);
130 break; 138 break;
131
132 case EEZE_SENSOR_TYPE_LIGHT: 139 case EEZE_SENSOR_TYPE_LIGHT:
140 /* Reset values that are not used for sensor object with one data point */
141 obj->data[1] = 0;
142 obj->data[2] = 0;
143 ecore_event_add(EEZE_SENSOR_EVENT_LIGHT, obj, NULL, NULL);
144 break;
133 case EEZE_SENSOR_TYPE_PROXIMITY: 145 case EEZE_SENSOR_TYPE_PROXIMITY:
146 obj->data[1] = 0;
147 obj->data[2] = 0;
148 ecore_event_add(EEZE_SENSOR_EVENT_PROXIMITY, obj, NULL, NULL);
149 break;
134 case EEZE_SENSOR_TYPE_BAROMETER: 150 case EEZE_SENSOR_TYPE_BAROMETER:
151 obj->data[1] = 0;
152 obj->data[2] = 0;
153 ecore_event_add(EEZE_SENSOR_EVENT_BAROMETER, obj, NULL, NULL);
154 break;
135 case EEZE_SENSOR_TYPE_TEMPERATURE: 155 case EEZE_SENSOR_TYPE_TEMPERATURE:
136 obj->accuracy = -1; 156 obj->data[1] = 0;
137 obj->data[0] = 7; 157 obj->data[2] = 0;
138 gettimeofday(&tv, NULL); 158 ecore_event_add(EEZE_SENSOR_EVENT_TEMPERATURE, obj, NULL, NULL);
139 obj->timestamp = ((tv.tv_sec * 1000000) + tv.tv_usec);
140 ecore_event_add(sensor_type, obj, NULL, NULL);
141 break; 159 break;
142 160
143 default: 161 default: