From 56a3a2bab95676964e599a6b38a79a9fc73d6aa2 Mon Sep 17 00:00:00 2001 From: Kevron Rees Date: Fri, 28 Sep 2012 13:52:03 -0700 Subject: [PATCH] obdII is b0rked but getting closer --- TODO | 3 ++- plugins/obd2plugin/CMakeLists.txt | 5 +++-- plugins/obd2plugin/asyncqueuewatcher.cpp | 5 +++-- plugins/obd2plugin/obd2source.cpp | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/TODO b/TODO index 6b9ee1a..81855a9 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,4 @@ - test for memory leaks in websocket sink plugin - per-source property filtering in routing engine - +- historic data "get" interface in routing engine +- sqlite database storage plugin diff --git a/plugins/obd2plugin/CMakeLists.txt b/plugins/obd2plugin/CMakeLists.txt index de71fab..7783d5d 100644 --- a/plugins/obd2plugin/CMakeLists.txt +++ b/plugins/obd2plugin/CMakeLists.txt @@ -3,13 +3,14 @@ include(CheckIncludeFiles) pkg_check_modules(gio REQUIRED gio-2.0) pkg_check_modules(gio-unix REQUIRED gio-unix-2.0) +pkg_check_modules(glibmm REQUIRED glibmm-2.4) -include_directories(${CMAKE_SOURCE_DIR}/lib ${include_dirs} ${gio_INCLUDE_DIRS} ${gio-unix_INCLUDE_DIRS}) +include_directories(${CMAKE_SOURCE_DIR}/lib ${include_dirs} ${gio_INCLUDE_DIRS} ${gio-unix_INCLUDE_DIRS} ${glibmm_INCLUDE_DIRS}) set(obd2sourceplugin_headers obd2source.h obdlib.h bluetoothmanagerproxy.h bluetoothadapterproxy.h bluetoothserialproxy.h asyncqueuewather.h) set(obd2sourceplugin_sources obd2source.cpp obdlib.cpp bluetooth.hpp bluetoothmanagerproxy.c bluetoothadapterproxy.c bluetoothserialproxy.c asyncqueuewatcher.cpp) add_library(obd2sourceplugin MODULE ${obd2sourceplugin_sources}) set_target_properties(obd2sourceplugin PROPERTIES PREFIX "") -target_link_libraries(obd2sourceplugin amb -L${CMAKE_CURRENT_BINARY_DIR}/lib ${link_libraries} ${gio_LIBRARIES} ${gio-unix_LIBRARIES}) +target_link_libraries(obd2sourceplugin amb -L${CMAKE_CURRENT_BINARY_DIR}/lib ${link_libraries} ${gio_LIBRARIES} ${gio-unix_LIBRARIES} ${glibmm_LIBRARIES}) install(TARGETS obd2sourceplugin LIBRARY DESTINATION lib/automotive-message-broker) diff --git a/plugins/obd2plugin/asyncqueuewatcher.cpp b/plugins/obd2plugin/asyncqueuewatcher.cpp index 30bbf91..f8ed09f 100644 --- a/plugins/obd2plugin/asyncqueuewatcher.cpp +++ b/plugins/obd2plugin/asyncqueuewatcher.cpp @@ -19,15 +19,16 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA #include "asyncqueuewatcher.h" struct QueueWatch{ - GAsyncQueue* queue; GSource source; + GAsyncQueue* queue; }; static gboolean prepare (GSource *source, gint *timeout) { QueueWatch *watch = (QueueWatch *)source; *timeout = -1; - return (g_async_queue_length (watch->queue) > 0); + int size = g_async_queue_length (watch->queue); + return (size > 0); } static gboolean check (GSource *source) diff --git a/plugins/obd2plugin/obd2source.cpp b/plugins/obd2plugin/obd2source.cpp index c80c00b..f86df36 100644 --- a/plugins/obd2plugin/obd2source.cpp +++ b/plugins/obd2plugin/obd2source.cpp @@ -269,7 +269,7 @@ void threadLoop(gpointer data) } - DebugOut()<<"Reply: "<