Adding latest timestamp for virtual sensor polling events 97/35997/1
authorRamasamy <ram.kannan@samsung.com>
Fri, 27 Feb 2015 09:23:07 +0000 (14:53 +0530)
committerRamasamy <ram.kannan@samsung.com>
Fri, 27 Feb 2015 09:23:15 +0000 (14:53 +0530)
- Fixing timestamp issue for polling based virtual sensor
events.
- cleanup.

Change-Id: Ie1c18f8f2b94b48eae7c84a723ddf0b56e0059f6

src/gravity/gravity_sensor.cpp
src/orientation/orientation_sensor.cpp
src/rotation_vector/gaming_rv/gaming_rv_sensor.cpp
src/rotation_vector/geomagnetic_rv/geomagnetic_rv_sensor.cpp
src/rotation_vector/rv/rv_sensor.cpp

index d6dc7d7..48fddf4 100755 (executable)
@@ -185,7 +185,6 @@ void gravity_sensor::synthesize(const sensor_event_t &event, vector<sensor_event
                        return;
 
                m_time = get_timestamp();
-
                gravity_event.sensor_id = get_id();
                gravity_event.event_type = GRAVITY_RAW_DATA_EVENT;
                if ((roll >= (M_PI/2)-DEVIATION && roll <= (M_PI/2)+DEVIATION) ||
index 708ca92..500217a 100755 (executable)
@@ -353,7 +353,6 @@ void orientation_sensor::synthesize(const sensor_event_t &event, vector<sensor_e
                }
 
                m_time = get_timestamp();
-
                orientation_event.sensor_id = get_id();
                orientation_event.event_type = ORIENTATION_RAW_DATA_EVENT;
                orientation_event.data.accuracy = SENSOR_ACCURACY_GOOD;
index acfd003..51a0a4b 100755 (executable)
@@ -250,7 +250,6 @@ void gaming_rv_sensor::synthesize(const sensor_event_t& event, vector<sensor_eve
                }
 
                m_time = get_timestamp();
-
                rv_event.sensor_id = get_id();
                rv_event.event_type = GAMING_RV_RAW_DATA_EVENT;
                rv_event.data.accuracy = SENSOR_ACCURACY_GOOD;
@@ -294,7 +293,7 @@ int gaming_rv_sensor::get_sensor_data(unsigned int event_type, sensor_data_t &da
        }
 
        data.accuracy = SENSOR_ACCURACY_GOOD;
-       data.timestamp = m_time;
+       data.timestamp = get_timestamp();
        data.value_count = 4;
        data.values[0] = quaternion_gaming_rv.m_quat.m_vec[1];
        data.values[1] = quaternion_gaming_rv.m_quat.m_vec[2];
index ab60019..ae0348f 100755 (executable)
@@ -261,7 +261,6 @@ void geomagnetic_rv_sensor::synthesize(const sensor_event_t& event, vector<senso
                }
 
                m_time = get_timestamp();
-
                rv_event.sensor_id = get_id();
                rv_event.event_type = GEOMAGNETIC_RV_RAW_DATA_EVENT;
                rv_event.data.accuracy = SENSOR_ACCURACY_GOOD;
@@ -307,7 +306,7 @@ int geomagnetic_rv_sensor::get_sensor_data(unsigned int event_type, sensor_data_
        }
 
        data.accuracy = SENSOR_ACCURACY_GOOD;
-       data.timestamp = m_time;
+       data.timestamp = get_timestamp();
        data.value_count = 4;
        data.values[0] = quaternion_geo_rv.m_quat.m_vec[1];
        data.values[1] = quaternion_geo_rv.m_quat.m_vec[2];
index a998873..958042e 100755 (executable)
@@ -311,7 +311,6 @@ void rv_sensor::synthesize(const sensor_event_t& event, vector<sensor_event_t> &
                }
 
                m_time = get_timestamp();
-
                rv_event.sensor_id = get_id();
                rv_event.event_type = ROTATION_VECTOR_EVENT_RAW_DATA_REPORT_ON_TIME;
                rv_event.data.accuracy = SENSOR_ACCURACY_GOOD;
@@ -365,7 +364,7 @@ int rv_sensor::get_sensor_data(unsigned int event_type, sensor_data_t &data)
        }
 
        data.accuracy = SENSOR_ACCURACY_GOOD;
-       data.timestamp = m_time;
+       data.timestamp = get_timestamp();
        data.value_count = 4;
        data.values[0] = quaternion_orientation.m_quat.m_vec[1];
        data.values[1] = quaternion_orientation.m_quat.m_vec[2];