Revert "sensord: extra data embedding" 75/54775/1
authorkibak.yoon <kibak.yoon@samsung.com>
Fri, 18 Dec 2015 01:30:46 +0000 (10:30 +0900)
committerkibak.yoon <kibak.yoon@samsung.com>
Fri, 18 Dec 2015 01:37:52 +0000 (10:37 +0900)
This reverts commit 8baf020bc0e5ecff210e01a362560111edbefd4c.

Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
Change-Id: I8ad082398dac42728e1ea321972527ab663e4804

src/client/csensor_event_listener.cpp
src/server/csensor_event_dispatcher.cpp [changed mode: 0644->0755]
src/shared/sensor_common.h [changed mode: 0644->0755]
src/shared/sensor_logs.cpp

index 053ae17..aad9c89 100644 (file)
@@ -196,9 +196,6 @@ void csensor_event_listener::handle_events(void* event)
                        event_data.event_data = &(sensor_event->data);
                        event_data.event_data_size = sizeof(sensor_event->data);
                }
-
-               if (sensor_event->data.extra_data_size > 0)
-                       sensor_event->data.extra_data = (void *)event + sizeof(sensor_event_t);
        }
 
        {       /* scope for the lock */
old mode 100644 (file)
new mode 100755 (executable)
index e82b6e2..605b9e7
@@ -227,22 +227,10 @@ void csensor_event_dispatcher::send_sensor_events(void* events, int event_cnt, b
 
                        bool ret;
 
-                       if (is_hub_event) {
+                       if (is_hub_event)
                                ret = (client_socket.send(sensor_hub_events + i, sizeof(sensorhub_event_t)) > 0);
-                       } else if (sensor_events[i].data.extra_data_size > 0) {
-                               void *extended_event;
-                               int extended_size = sizeof(sensor_event_t) + sensor_events[i].data.extra_data_size;
-
-                               extended_event = (void *)malloc(extended_size);
-                               memcpy(extended_event, sensor_events + i, sizeof(sensor_event_t));
-                               memcpy(extended_event + sizeof(sensor_event_t), sensor_events[i].data.extra_data, sensor_events[i].data.extra_data_size);
-
-                               ret = (client_socket.send(extended_event, extended_size) > 0);
-
-                               free(extended_event);
-                       } else {
+                       else
                                ret = (client_socket.send(sensor_events + i, sizeof(sensor_event_t)) > 0);
-                       }
 
                        if (ret)
                                DBG("Event[0x%x] sent to %s on socket[%d]", event_type, client_info_manager.get_client_info(*it_client_id), client_socket.get_socket_fd());
old mode 100644 (file)
new mode 100755 (executable)
index 170c26e..02cbfd3
@@ -82,13 +82,6 @@ typedef struct sensor_data_t {
        };
 
        float values[SENSOR_DATA_VALUE_SIZE];
-
-/*
- *     If extra_data_size > 0,
- *     then use extra_data.
- */
-       int extra_data_size;
-       void *extra_data;
 } sensor_data_t;
 
 #define SENSOR_HUB_DATA_SIZE   4096
index 28e19bb..4be987f 100644 (file)
@@ -185,9 +185,6 @@ void copy_sensor_data(sensor_data_t *dest, sensor_data_t *src)
 {
        memcpy(dest, src, offsetof(sensor_data_t, values));
        memcpy(dest->values, src->values, src->value_count * sizeof(src->values[0]));
-
-       dest->extra_data_size = src->extra_data_size;
-       dest->extra_data = src->extra_data;
 }
 
 void copy_sensorhub_data(sensorhub_data_t *dest, sensorhub_data_t *src)