From ff14217dd4535fb3045fbf5c3d506af32faedfd9 Mon Sep 17 00:00:00 2001 From: Mu-Woong Lee Date: Mon, 21 Mar 2016 12:01:49 +0900 Subject: [PATCH] sensor_base: add data length parameter to on_event() Change-Id: I7b29eb919534e741816ceeb06fd5ddb72919707e Signed-off-by: Mu-Woong Lee --- src/server/physical_sensor.cpp | 2 +- src/server/physical_sensor.h | 2 +- src/server/sensor_event_poller.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/physical_sensor.cpp b/src/server/physical_sensor.cpp index 7964065..f7135ee 100644 --- a/src/server/physical_sensor.cpp +++ b/src/server/physical_sensor.cpp @@ -77,7 +77,7 @@ int physical_sensor::get_poll_fd() return m_sensor_device->get_poll_fd(); } -bool physical_sensor::on_event(const sensor_data_t *data, int remains) +bool physical_sensor::on_event(const sensor_data_t *data, int data_len, int remains) { return true; } diff --git a/src/server/physical_sensor.h b/src/server/physical_sensor.h index 393e4d7..d8628c1 100644 --- a/src/server/physical_sensor.h +++ b/src/server/physical_sensor.h @@ -40,7 +40,7 @@ public: int get_poll_fd(); - virtual bool on_event(const sensor_data_t *data, int remains); + virtual bool on_event(const sensor_data_t *data, int data_len, int remains); virtual bool read_fd(std::vector &ids); virtual int get_data(sensor_data_t **data, int *length); diff --git a/src/server/sensor_event_poller.cpp b/src/server/sensor_event_poller.cpp index a7ec9a4..f4a68c4 100644 --- a/src/server/sensor_event_poller.cpp +++ b/src/server/sensor_event_poller.cpp @@ -137,7 +137,7 @@ bool sensor_event_poller::process_event(int fd, const std::vector &ids break; } - if (!sensor->on_event(data, remains)) { + if (!sensor->on_event(data, data_length, remains)) { free(event); free(data); break; -- 2.7.4