diff options
author | Kevron Rees <kevron.m.rees@intel.com> | 2014-12-29 13:12:40 -0800 |
---|---|---|
committer | Kevron Rees <kevron.m.rees@intel.com> | 2014-12-29 13:12:40 -0800 |
commit | 1db07a1c93698354e3d8d50192a619ff21888339 (patch) | |
tree | 0599a738bf035eb22ba2389c3bfe4bbd1b2412bd | |
parent | 1048dfaa2744058787fe50f733cad51ec8c1304e (diff) | |
download | automotive-message-broker-1db07a1c93698354e3d8d50192a619ff21888339.tar.gz |
README's for all plugins, cmake fixes
-rw-r--r-- | CMakeLists.txt | 30 | ||||
-rw-r--r-- | ambd/CMakeLists.txt | 31 | ||||
-rw-r--r-- | ambd/core.cpp | 14 | ||||
-rw-r--r-- | ambd/core.h | 2 | ||||
-rw-r--r-- | lib/abstractroutingengine.h | 17 | ||||
-rw-r--r-- | plugins/CMakeLists.txt | 4 | ||||
-rw-r--r-- | plugins/bluemonkey/CMakeLists.txt | 9 | ||||
-rw-r--r-- | plugins/bluemonkey/README | 8 | ||||
-rw-r--r-- | plugins/database/README | 2 | ||||
-rw-r--r-- | plugins/dbus/CMakeLists.txt | 3 | ||||
-rw-r--r-- | plugins/dbus/README | 3 | ||||
-rw-r--r-- | plugins/dbus/abstractdbusinterface.cpp | 9 | ||||
-rw-r--r-- | plugins/exampleplugins.README.txt | 36 | ||||
-rw-r--r-- | plugins/gpsnmea/CMakeLists.txt | 4 | ||||
-rw-r--r-- | plugins/gpsnmea/README | 5 | ||||
-rw-r--r-- | plugins/obd2plugin/CMakeLists.txt | 4 | ||||
-rw-r--r-- | plugins/obd2plugin/README | 3 | ||||
-rw-r--r-- | plugins/opencvlux/CMakeLists.txt | 9 | ||||
-rw-r--r-- | plugins/opencvlux/README | 3 | ||||
-rw-r--r-- | plugins/opencvlux/opencvluxplugin.cpp | 2 | ||||
-rw-r--r-- | plugins/websocket/CMakeLists.txt | 10 | ||||
-rw-r--r-- | plugins/websocket/README | 9 | ||||
-rw-r--r-- | plugins/websocket/websocketsinkmanager.cpp | 2 | ||||
-rw-r--r-- | plugins/wheel/CMakeLists.txt | 4 | ||||
-rw-r--r-- | plugins/wheel/README | 29 | ||||
-rw-r--r-- | tools/ambctl.py | 25 |
26 files changed, 196 insertions, 81 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 040c6cd8..1a8141e2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,7 @@ cmake_minimum_required(VERSION 2.8) set(CMAKE_BUILD_TYPE, Debug) include(FindPkgConfig) +include(CMakeDependentOption) set(PROJECT_NAME "automotive-message-broker") set(PROJECT_PRETTY_NAME "Automotive Message Broker") @@ -74,33 +75,6 @@ add_definitions(-DDBusServiceName="org.automotive.message.broker") set(include_dirs ${libtool_INCLUDE_DIR} ${glib_INCLUDE_DIRS} ${gio_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${json_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/lib) set(link_libraries -lamb ${glib_LIBRARIES} ${json_LIBRARIES} -L${CMAKE_CURRENT_BINARY_DIR}/lib) -if(qtmainloop) - message(STATUS "using Qt mainloop") - - find_package(Qt5Core) - if(Qt5Core_FOUND) - message(STATUS "using Qt5") - set(QT_INCLUDE_DIRS ${Qt5Core_INCLUDE_DIRS}) - set(QT_LIBRARIES ${Qt5Core_LIBRARIES}) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}") - # if(CMAKE_SIZEOF_VOID_P MATCHES "8") - # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcmodel=large") - # endif(CMAKE_SIZEOF_VOID_P MATCHES "8") - add_definitions(${Qt5Core_DEFINITIONS}) - else(Qt5Core_FOUND) - message(STATUS "using Qt4") - find_package( Qt4 REQUIRED ) - include(${QT_USE_FILE}) - - endif(Qt5Core_FOUND) - - set(include_dirs ${include_dirs} ${QT_INCLUDE_DIRS}) - set(link_libraries ${link_libraries} ${QT_LIBRARIES}) - - add_definitions(-DQT_NO_KEYWORDS) - add_definitions(-DUSE_QT_CORE) -endif(qtmainloop) - if(usebluez5) add_definitions(-DUSE_BLUEZ5) @@ -135,8 +109,8 @@ INCLUDE(CPack) configure_file (${CMAKE_CURRENT_SOURCE_DIR}/packaging.in/config.tizen.in ${CMAKE_CURRENT_BINARY_DIR}/packaging.in/config.tizen @ONLY) add_subdirectory(lib) -add_subdirectory(ambd) add_subdirectory(plugins) +add_subdirectory(ambd) add_subdirectory(docs) add_subdirectory(tests) add_subdirectory(tools) diff --git a/ambd/CMakeLists.txt b/ambd/CMakeLists.txt index 184fc4d5..d1af5653 100644 --- a/ambd/CMakeLists.txt +++ b/ambd/CMakeLists.txt @@ -1,15 +1,32 @@ set(ambd_headers core.h imainloop.h pluginloader.h glibmainloop.h) -set(ambd_sources core.cpp main.cpp pluginloader.cpp glibmainloop.cpp) +set(ambd_sources core.cpp main.cpp pluginloader.cpp glibmainloop.cpp imainloop.h) if(qtmainloop) - set(qtmainloopplugin_headers qtmainloop.h) - set(qtmainloopplugin_sources qtmainloop.cpp) - add_library(qtmainloopplugin MODULE ${qtmainloopplugin_sources}) - set_target_properties(qtmainloopplugin PROPERTIES PREFIX "") - target_link_libraries(qtmainloopplugin amb -L${CMAKE_CURRENT_BINARY_DIR}/lib ${link_libraries}) + message(STATUS "using Qt mainloop") - install(TARGETS qtmainloopplugin LIBRARY DESTINATION ${LIB_INSTALL_DIR}/automotive-message-broker) + find_package(Qt5Core) + if(Qt5Core_FOUND) + set(QT_INCLUDE_DIRS ${Qt5Core_INCLUDE_DIRS}) + set(QT_LIBRARIES ${Qt5Core_LIBRARIES}) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}") + add_definitions(${Qt5Core_DEFINITIONS}) + + set(include_dirs ${include_dirs} ${QT_INCLUDE_DIRS}) + set(link_libraries ${link_libraries} ${QT_LIBRARIES}) + + add_definitions(-DQT_NO_KEYWORDS) + add_definitions(-DUSE_QT_CORE) + + set(qtmainloopplugin_headers qtmainloop.h) + set(qtmainloopplugin_sources qtmainloop.cpp) + + add_library(qtmainloopplugin MODULE ${qtmainloopplugin_sources}) + set_target_properties(qtmainloopplugin PROPERTIES PREFIX "") + target_link_libraries(qtmainloopplugin amb -L${CMAKE_CURRENT_BINARY_DIR}/lib ${link_libraries}) + + install(TARGETS qtmainloopplugin LIBRARY DESTINATION ${LIB_INSTALL_DIR}/automotive-message-broker) + endif(Qt5Core_FOUND) endif(qtmainloop) add_executable(ambd ${ambd_sources}) diff --git a/ambd/core.cpp b/ambd/core.cpp index 4402bfff..979cf778 100644 --- a/ambd/core.cpp +++ b/ambd/core.cpp @@ -304,20 +304,26 @@ AsyncPropertyReply *Core::getPropertyAsync(AsyncPropertyRequest request) return reply; } -AsyncRangePropertyReply * Core::getRangePropertyAsync(AsyncRangePropertyRequest request) +void Core::getRangePropertyAsync(AsyncRangePropertyRequest request) { AsyncRangePropertyReply * reply = new AsyncRangePropertyReply(request); - for(auto itr = mSources.begin(); itr != mSources.end(); ++itr) + bool anySupport = false; + for(auto src : mSources) { - AbstractSource* src = *itr; if(((src->supportedOperations() & AbstractSource::GetRanged) == AbstractSource::GetRanged)) { + anySupport = true; src->getRangePropertyAsync(reply); } } - return reply; + if(!anySupport) + { + reply->success = false; + reply->error = AsyncPropertyReply::InvalidOperation; + reply->completed(reply); + } } AsyncPropertyReply * Core::setProperty(AsyncSetPropertyRequest request) diff --git a/ambd/core.h b/ambd/core.h index ed0872b7..9a1f23a1 100644 --- a/ambd/core.h +++ b/ambd/core.h @@ -46,7 +46,7 @@ public: void registerSink(AbstractSink *self); void unregisterSink(AbstractSink *self); AsyncPropertyReply* getPropertyAsync(AsyncPropertyRequest request); - AsyncRangePropertyReply* getRangePropertyAsync(AsyncRangePropertyRequest request); + void getRangePropertyAsync(AsyncRangePropertyRequest request); AsyncPropertyReply * setProperty(AsyncSetPropertyRequest request); uint subscribeToProperty(const VehicleProperty::Property &, AbstractRoutingEngine::PropertyChangedType, std::string pid=""); bool subscribeToProperty(const VehicleProperty::Property &, AbstractSink* self); diff --git a/lib/abstractroutingengine.h b/lib/abstractroutingengine.h index 7afae61d..3c4bc8d0 100644 --- a/lib/abstractroutingengine.h +++ b/lib/abstractroutingengine.h @@ -142,6 +142,20 @@ public: ZoneNotSupported }; + static std::string errorToStr(Error err) + { + if(err == NoError) + return "NoError"; + else if(err == Timeout) + return "Timeout"; + else if(err == InvalidOperation) + return "InvalidOperation"; + else if(err == PermissionDenied) + return "PermissionDenied"; + else if(err == ZoneNotSupported) + return "ZoneNotSupported"; + } + /*! * \brief value of the reply. This may be null if success = false. This is owned by the source. */ @@ -399,7 +413,8 @@ public: * routingEngine->getRangePropertyAsync(vehicleSpeedFromLastWeek); * */ - virtual AsyncRangePropertyReply * getRangePropertyAsync(AsyncRangePropertyRequest request) = 0; + + virtual void getRangePropertyAsync(AsyncRangePropertyRequest request) = 0; /*! * \brief setProperty sets a property to a value. diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index b7b9b245..45802660 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -19,6 +19,10 @@ target_link_libraries(examplesinkplugin amb -L${CMAKE_CURRENT_BINARY_DIR}/lib ${ install(TARGETS examplesinkplugin LIBRARY DESTINATION ${PLUGIN_INSTALL_PATH}) install(TARGETS examplesourceplugin LIBRARY DESTINATION ${PLUGIN_INSTALL_PATH}) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/exampleplugins.README.txt ${CMAKE_CURRENT_BINARY_DIR}/exampleplugins.README @ONLY) + +install (FILES ${CMAKE_CURRENT_BINARY_DIR}/exampleplugins.README DESTINATION ${DOC_INSTALL_DIR}/plugins) + add_subdirectory(common) add_subdirectory(wheel) diff --git a/plugins/bluemonkey/CMakeLists.txt b/plugins/bluemonkey/CMakeLists.txt index ec6962a6..797ce476 100644 --- a/plugins/bluemonkey/CMakeLists.txt +++ b/plugins/bluemonkey/CMakeLists.txt @@ -1,16 +1,19 @@ if(bluemonkey_plugin) +message(STATUS "enabling bluemonkey plugin") + +set(qtmainloop ON CACHE INTERNAL "") + find_package(Qt5Core REQUIRED) find_package(Qt5Network REQUIRED) find_package(Qt5Qml REQUIRED) if(Qt5Core_FOUND) - message(STATUS "using Qt5") - set(QT_INCLUDE_DIRS ${Qt5Core_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS} ${Qt5Qml_INCLUDE_DIRS}) set(QT_LIBRARIES ${Qt5Core_LIBRARIES} ${Qt5Network_LIBRARIES} ${Qt5Qml_LIBRARIES}) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}") add_definitions(${Qt5Core_DEFINITIONS}) - + add_definitions(-DQT_NO_KEYWORDS) + add_definitions(-DUSE_QT_CORE) endif(Qt5Core_FOUND) set(CMAKE_AUTOMOC ON) diff --git a/plugins/bluemonkey/README b/plugins/bluemonkey/README index 27f47052..98ba61fc 100644 --- a/plugins/bluemonkey/README +++ b/plugins/bluemonkey/README @@ -1,14 +1,16 @@ Bluemonkey Source Plugin +Version: @PROJECT_VERSION@ Bluemonkey is a javascript rendering engine that allows the scripting of source plugin behavior in javascript. To use the OBD-II Source plugin, add the following config to your /etc/ambd/config: -"sources" : [ +"sources" : + [ { "name" : "bluemonkey", - "path" : "/usr/lib/automotive-message-broker/bluemonkeyplugin.so", + "path" : "@PLUGIN_INSTALL_PATH@/bluemonkeyplugin.so", "config" : "/etc/ambd/bluemonkey/config.js" } ] @@ -26,5 +28,5 @@ path to the bluemonkey configuration script. Bluemonkey Javascript API: -see bluemonkey.idl (installed to ${PREFIX}share/doc/packages/automotive-meassage-broker/plugins/ +see bluemonkey.idl (installed to @DOC_INSTALL_DIR@/plugins/bluemonkey diff --git a/plugins/database/README b/plugins/database/README index d18e9148..78a5330c 100644 --- a/plugins/database/README +++ b/plugins/database/README @@ -12,7 +12,7 @@ To use the Database plugin, add the following to the "sources" array in /etc/amb { "name" : "Database", - "path" : "/usr/lib/automotive-message-broker/databasesinkplugin.so", + "path" : "@PLUGIN_INSTALL_PATH@/databasesinkplugin.so", "databaseFile" : "storage", "bufferLength" : "100", "properties" : "{ 'properties' : ['VehicleSpeed','EngineSpeed'] }", diff --git a/plugins/dbus/CMakeLists.txt b/plugins/dbus/CMakeLists.txt index fc3b6e54..7c1a3928 100644 --- a/plugins/dbus/CMakeLists.txt +++ b/plugins/dbus/CMakeLists.txt @@ -20,4 +20,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/amb.conf ${CMAKE_CURRENT_SOURCE_DIR}/ set(dbus_mapping_headers ${CMAKE_CURRENT_SOURCE_DIR}/runningstatus.h ${CMAKE_CURRENT_SOURCE_DIR}/environmentproperties.h ${CMAKE_CURRENT_SOURCE_DIR}/vehicleinfo.h ${CMAKE_CURRENT_SOURCE_DIR}/maintenance.h ${CMAKE_CURRENT_SOURCE_DIR}/parking.h ${CMAKE_CURRENT_SOURCE_DIR}/drivingsafety.h ${CMAKE_CURRENT_SOURCE_DIR}/personalization.h CACHE INTERNAL "dbus mapping headers") +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/README ${CMAKE_CURRENT_BINARY_DIR}/dbus.README @ONLY) +install (FILES ${CMAKE_CURRENT_BINARY_DIR}/dbus.README DESTINATION ${DOC_INSTALL_DIR}/plugins) + add_subdirectory(amb-qt) diff --git a/plugins/dbus/README b/plugins/dbus/README index b8d3b03d..2c80deeb 100644 --- a/plugins/dbus/README +++ b/plugins/dbus/README @@ -1,4 +1,5 @@ DBus plugin +Version: @PROJECT_VERSION@ This plugin provides a nice DBus API to application who want access to AMB data. @@ -6,7 +7,7 @@ To use the DBus plugin, add the following to the "sinks" array in /etc/ambd/conf { "name" : "dbussink", - "path" : "/usr/lib/automotive-message-broker/dbussinkplugin.so", + "path" : "@PLUGIN_INSTALL_PATH@/dbussinkplugin.so", "frequency" : "60" } diff --git a/plugins/dbus/abstractdbusinterface.cpp b/plugins/dbus/abstractdbusinterface.cpp index c8dcdf17..9933be38 100644 --- a/plugins/dbus/abstractdbusinterface.cpp +++ b/plugins/dbus/abstractdbusinterface.cpp @@ -117,12 +117,13 @@ static void handleMyMethodCall(GDBusConnection *connection, request.zone = iface->zone(); //request.sourceUuid = iface->source(); - request.completed = [&invocation,&ifaceName](AsyncRangePropertyReply* reply) + request.completed = [&invocation,&ifaceName](AsyncRangePropertyReply* r) { + auto reply = amb::make_unique(r); if(!reply->success) { stringstream str; - str<<"Error during request: "<<reply->error; + str<<"Error during request: "<<AsyncPropertyReply::errorToStr(reply->error); ifaceName += ".Error"; g_dbus_method_invocation_return_dbus_error(invocation, ifaceName.c_str(), str.str().c_str()); return; @@ -150,9 +151,11 @@ static void handleMyMethodCall(GDBusConnection *connection, }; iface->re->getRangePropertyAsync(request); + + return; } - else if(boost::algorithm::starts_with(method,"Get")) + else if(boost::algorithm::starts_with(method, "Get")) { std::string propertyName = method.substr(3); auto propertyMap = iface->getProperties(); diff --git a/plugins/exampleplugins.README.txt b/plugins/exampleplugins.README.txt new file mode 100644 index 00000000..dbee43ec --- /dev/null +++ b/plugins/exampleplugins.README.txt @@ -0,0 +1,36 @@ +example source and sink plugins +Version: @PROJECT_VERSION@ + +The example plugins are source and sink plugin that provide a simple example of how to create a plugin. +They are useful for testing AMB but only support a limited number of properties. + +The example plugins is enabled by default. + + +To use the example source plugin, add the following to the "sources" array in /etc/ambd/config: + +{ + "name" : "ExampleSouce", + "path" : "@PLUGIN_INSTALL_PATH@/examplesourceplugin.so", + "delay" : "1" +} + +To use the example sink, add the following to the "sinks" array in /etc/ambd/config: + +{ + "name" : "ExampleSink", + "path" : "@PLUGIN_INSTALL_PATH@/examplesinkplugin.so" +} + +Configuration Key Definitions: + +"name" +name of plugin. This key is not used by the plugin at this moment. + +"path" +path to plugin on the filesystem. + +"delay" (source plugin only) +Delay in miliseconds when the source will generate a changed event + +default: 1000 diff --git a/plugins/gpsnmea/CMakeLists.txt b/plugins/gpsnmea/CMakeLists.txt index c59b6082..123eb9c1 100644 --- a/plugins/gpsnmea/CMakeLists.txt +++ b/plugins/gpsnmea/CMakeLists.txt @@ -12,4 +12,8 @@ target_link_libraries(gpsnmea.so amb -L${CMAKE_CURRENT_BINARY_DIR}/lib amb-plug install(TARGETS gpsnmea.so RUNTIME DESTINATION ${PLUGIN_INSTALL_PATH}) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/README ${CMAKE_CURRENT_BINARY_DIR}/gpsnmea.README @ONLY) + +install (FILES ${CMAKE_CURRENT_BINARY_DIR}/gpsnmea.README DESTINATION ${DOC_INSTALL_DIR}/plugins) + endif(gpsnmea_plugin) diff --git a/plugins/gpsnmea/README b/plugins/gpsnmea/README index e538b9c6..aefcda94 100644 --- a/plugins/gpsnmea/README +++ b/plugins/gpsnmea/README @@ -1,4 +1,5 @@ -gps nmea plugin +GPS NMEA plugin +Version: @PROJECT_VERSION@ This plugin uses NMEA-compatible devices to provide location information to AMB. @@ -10,7 +11,7 @@ To use the Database plugin, add the following to the "sources" array in /etc/amb { "name" : "gpsnmea", - "path" : "/usr/lib/automotive-message-broker/gpsnmea.so", + "path" : "@PLUGIN_INSTALL_PATH@/gpsnmea.so", "device" : "/dev/ttyUSB0", "baudrate" : "4800", "bluetoothAdapter" : "00:00:00:00:00:00" diff --git a/plugins/obd2plugin/CMakeLists.txt b/plugins/obd2plugin/CMakeLists.txt index 9f3a5c54..350d2f4f 100644 --- a/plugins/obd2plugin/CMakeLists.txt +++ b/plugins/obd2plugin/CMakeLists.txt @@ -15,4 +15,8 @@ target_link_libraries(obd2sourceplugin amb -L${CMAKE_CURRENT_BINARY_DIR}/lib amb install(TARGETS obd2sourceplugin LIBRARY DESTINATION ${PLUGIN_INSTALL_PATH}) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/README ${CMAKE_CURRENT_BINARY_DIR}/obd2.README @ONLY) + +install (FILES ${CMAKE_CURRENT_BINARY_DIR}/obd2.README DESTINATION ${DOC_INSTALL_DIR}/plugins) + endif(obd2_plugin) diff --git a/plugins/obd2plugin/README b/plugins/obd2plugin/README index e555704f..7dcfa34e 100644 --- a/plugins/obd2plugin/README +++ b/plugins/obd2plugin/README @@ -1,4 +1,5 @@ OBD-II Source Plugin +Version: @PROJECT_VERSION@ The OBD-II Source plugin uses ELM compatible scantools to get vehicle information. It is known to work with a number of commercial scantools including: @@ -13,7 +14,7 @@ To use the OBD-II Source plugin, add the following config to your /etc/ambd/conf "sources" : [ { "name" : "OBD2Source", - "path" : "/usr/lib/automotive-message-broker/obd2sourceplugin.so", + "path" : "@PLUGIN_INSTALL_PATH@/obd2sourceplugin.so", "device" : "/dev/ttyUSB0", "baud" : "9600", "bluetoothAdapter" : "" diff --git a/plugins/opencvlux/CMakeLists.txt b/plugins/opencvlux/CMakeLists.txt index a4c6d852..de3645c3 100644 --- a/plugins/opencvlux/CMakeLists.txt +++ b/plugins/opencvlux/CMakeLists.txt @@ -1,7 +1,5 @@ if(opencvlux_plugin) -set(qtmainloop "ON") - find_package(OpenCV REQUIRED) if(OpenCV_LIBS) @@ -10,7 +8,7 @@ else(OpenCV_LIBS) message(FATAL_ERROR "opencv missing. please install opencv") endif(OpenCV_LIBS) -option(ocl "enable opencl" OFF) +set(qtmainloop ON CACHE INTERNAL "") add_definitions(-DCV_DATA="${OpenCV_CONFIG_PATH}") @@ -39,7 +37,6 @@ if(Qt5Core_FOUND) set(QT_INCLUDE_DIRS ${Qt5Core_INCLUDE_DIRS} ) set(QT_LIBRARIES ${Qt5Core_LIBRARIES} ) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}") - message(STATUS "size of void_p: ${CMAKE_SIZEOF_VOID_P}") add_definitions(${Qt5Core_DEFINITIONS}) add_definitions(-DQT_NO_KEYWORDS) @@ -57,6 +54,8 @@ target_link_libraries(opencvluxplugin amb -L${CMAKE_CURRENT_BINARY_DIR}/lib ${li install(TARGETS opencvluxplugin LIBRARY DESTINATION ${PLUGIN_INSTALL_PATH}) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/README ${CMAKE_CURRENT_SOURCE_DIR}/README @ONLY) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/README ${CMAKE_CURRENT_BINARY_DIR}/opencvlux.README @ONLY) +set(opencvlux_doc_files ${CMAKE_CURRENT_BINARY_DIR}/opencvlux.README) +install (FILES ${opencvlux_doc_files} DESTINATION ${DOC_INSTALL_DIR}/plugins) endif(opencvlux_plugin) diff --git a/plugins/opencvlux/README b/plugins/opencvlux/README index 3dcb32ba..96c7b2f5 100644 --- a/plugins/opencvlux/README +++ b/plugins/opencvlux/README @@ -1,4 +1,5 @@ OpenCV "lux" plugin +Version: @PROJECT_VERSION@ This plugin simulates the ExteriorBrigtness property using a traditional webcamera. It works by taking the mean pixel intensity of the web camera image and estimating lux. The particular @@ -14,7 +15,7 @@ To use the OpenCV plugin, add the following to the "sources" array in /etc/ambd/ { "name" : "OpenCV LUX", - "path" : "/usr/lib/automotive-message-broker/opencvluxplugin.so", + "path" : "@PLUGIN_INSTALL_PATH@/opencvluxplugin.so", "threaded" : "true", "pixelLowerBound" : "0", "pixelUpperBound" : "255", diff --git a/plugins/opencvlux/opencvluxplugin.cpp b/plugins/opencvlux/opencvluxplugin.cpp index c23ec775..5205d076 100644 --- a/plugins/opencvlux/opencvluxplugin.cpp +++ b/plugins/opencvlux/opencvluxplugin.cpp @@ -32,9 +32,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA #include <QtConcurrent/QtConcurrent> -#ifdef OPENCL #include <opencv2/core/ocl.hpp> -#endif using namespace std; diff --git a/plugins/websocket/CMakeLists.txt b/plugins/websocket/CMakeLists.txt index 0e290353..12ebe299 100644 --- a/plugins/websocket/CMakeLists.txt +++ b/plugins/websocket/CMakeLists.txt @@ -13,12 +13,8 @@ if(Qt5Core_FOUND) set(QT_INCLUDE_DIRS ${Qt5Core_INCLUDE_DIRS} ) set(QT_LIBRARIES ${Qt5Core_LIBRARIES} ) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}") - message(STATUS "size of void_p: ${CMAKE_SIZEOF_VOID_P}") - if(CMAKE_SIZEOF_VOID_P MATCHES "8") - message(STATUS "64bit enabled") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcmodel=large") - endif(CMAKE_SIZEOF_VOID_P MATCHES "8") add_definitions(${Qt5Core_DEFINITIONS} -DQTBINARY_DATA) + add_definitions(-DQT_NO_KEYWORDS) set(CMAKE_AUTOMOC ON) endif(Qt5Core_FOUND) @@ -47,4 +43,8 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test/events.js ${CMAKE_CURRENT_SOURCE install(TARGETS websocketsource LIBRARY DESTINATION ${PLUGIN_INSTALL_PATH}) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/README ${CMAKE_CURRENT_BINARY_DIR}/websocket.README @ONLY) + +install (FILES ${CMAKE_CURRENT_BINARY_DIR}/websocket.README DESTINATION ${DOC_INSTALL_DIR}/plugins) + endif(websocket_plugin) diff --git a/plugins/websocket/README b/plugins/websocket/README index e0cd6db7..d2a255c1 100644 --- a/plugins/websocket/README +++ b/plugins/websocket/README @@ -1,6 +1,7 @@ -websocket plugins +Websocket plugins +Version: @PROJECT_VERSION@ -The websocket sink and source plugins are designed to relay data between devices and +The websocket sink and source plugins are designed to relay data between devices and potentially to web pages. To enable the websocket plugins, run cmake and enable the websocket_plugin option: @@ -12,7 +13,7 @@ To use the websocket sink plugin, add the following to the "sinks" array in /etc { "name" : "websocket sink", - "path" : "/usr/lib/automotive-message-broker/websocketsink.so", + "path" : "@PLUGIN_INSTALL_PATH@/websocketsink.so", "interface" : "lo", "useExtensions" : "true", "binaryProtocol" : "false", @@ -25,7 +26,7 @@ To use the websocket source plugin, add the following to the "sources" array in { "name" : "WebsocketSource", - "path" : "/usr/lib/automotive-message-broker/websocketsource.so", + "path" : "@PLUGIN_INSTALL_PATH@/websocketsource.so", "port" : "23000", "ssl" : "false", "ip" : "192.168.1.40", diff --git a/plugins/websocket/websocketsinkmanager.cpp b/plugins/websocket/websocketsinkmanager.cpp index 10d064d3..1bc74c93 100644 --- a/plugins/websocket/websocketsinkmanager.cpp +++ b/plugins/websocket/websocketsinkmanager.cpp @@ -221,7 +221,7 @@ void WebSocketSinkManager::addSingleShotRangedSink(libwebsocket* socket, Propert delete reply; }; - AsyncRangePropertyReply* reply = routingEngine->getRangePropertyAsync(rangedRequest); + routingEngine->getRangePropertyAsync(rangedRequest); } void WebSocketSinkManager::removeSink(libwebsocket* socket,VehicleProperty::Property property, string uuid) diff --git a/plugins/wheel/CMakeLists.txt b/plugins/wheel/CMakeLists.txt index 9157ee74..fddc58c0 100644 --- a/plugins/wheel/CMakeLists.txt +++ b/plugins/wheel/CMakeLists.txt @@ -14,3 +14,7 @@ set_target_properties(wheelsourceplugin PROPERTIES PREFIX "") target_link_libraries(wheelsourceplugin amb -L${CMAKE_CURRENT_BINARY_DIR}/lib ${link_libraries}) install(TARGETS wheelsourceplugin LIBRARY DESTINATION ${PLUGIN_INSTALL_PATH}) + +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/README ${CMAKE_CURRENT_BINARY_DIR}/wheel.README @ONLY) + +install (FILES ${CMAKE_CURRENT_BINARY_DIR}/wheel.README DESTINATION ${DOC_INSTALL_DIR}/plugins) diff --git a/plugins/wheel/README b/plugins/wheel/README new file mode 100644 index 00000000..85560fd5 --- /dev/null +++ b/plugins/wheel/README @@ -0,0 +1,29 @@ +Wheel source plugin +Version: @PROJECT_VERSION@ + +The wheel source plugin uses the Logitech G27 (or similar) racing wheel for data. + +The wheel source plugin is enabled by default. + + +To use the wheel source plugin, add the following to the "sources" array in /etc/ambd/config: + +{ + "name" : "WheelSource", + "path" : "@PLUGIN_INSTALL_PATH@/wheelsourceplugin.so", + "device" : "/dev/input/js0" +} + +Configuration Key Definitions: + +"name" +name of plugin. This key is not used by the plugin at this moment. + +"path" +path to plugin on the filesystem. + +"device" +Path to the racing wheel device + +default: "/dev/input/js0" + diff --git a/tools/ambctl.py b/tools/ambctl.py index de2cad1c..ad95324f 100644 --- a/tools/ambctl.py +++ b/tools/ambctl.py @@ -69,6 +69,8 @@ def processCommand(command, commandArgs, noMain=True): print json.dumps(propertiesInterface.GetAll("org.automotive."+objectName), indent=2) return 1 elif command == "listen": + if len(commandArgs) == 0: + commandArgs = ['help'] if commandArgs[0] == "help": print "ObjectName [ObjectName...]" return 1 @@ -85,6 +87,8 @@ def processCommand(command, commandArgs, noMain=True): except KeyboardInterrupt: return 1 elif command == "set": + if len(commandArgs) == 0: + commandArgs = ['help'] if len(commandArgs) and commandArgs[0] == "help": print "ObjectName PropertyName VALUE [ZONE]" return 1 @@ -109,22 +113,24 @@ def processCommand(command, commandArgs, noMain=True): print "Error setting property" return 1 elif command == "getHistory": + if len(commandArgs) == 0: + commandArgs = ['help'] if commandArgs[0] == "help": - print "ObjectName [STARTTIME] [ENDTIME] [ZONE]" + print "ObjectName [ZONE] [STARTTIME] [ENDTIME] " return 1 if len(commandArgs) < 1: print "getHistory requires more arguments (see getHistory help)" return 1 objectName = commandArgs[0] start = 1 - if len(commandArgs) >= 2: - start = float(commandArgs[1]) - end = 9999999999 if len(commandArgs) >= 3: - end = float(commandArgs[2]) + start = float(commandArgs[2]) + end = 9999999999 + if len(commandArgs) >= 4: + end = float(commandArgs[3]) zone = 0 - if len(commandArgs) == 4: - zone = int(commandArgs[3]) + if len(commandArgs) >= 2: + zone = int(commandArgs[1]) object = managerInterface.FindObjectForZone(objectName, zone); propertiesInterface = dbus.Interface(bus.get_object("org.automotive.message.broker", object),"org.automotive."+objectName) print json.dumps(propertiesInterface.GetHistory(start, end), indent=2) @@ -342,4 +348,7 @@ if args.command == "stdin": sys.exit() else: - processCommand(args.command, args.commandArgs, False) + try: + processCommand(args.command, args.commandArgs, False) + except dbus.exceptions.DBusException, error: + print error |