summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevron Rees <kevron.m.rees@intel.com>2015-01-05 09:50:58 -0800
committerKevron Rees <kevron.m.rees@intel.com>2015-01-05 09:50:58 -0800
commita596b5c11e353948d15009facb7fa8d7933080e0 (patch)
tree343ca84994f9d06f1b2ff254b672aea41bfce0d1
parent8d6a738f536839d5d19239ac55f25416e1c7fa67 (diff)
parentc1a53dde103babf4a4990e3b2bfb2f911b6a5c2b (diff)
downloadautomotive-message-broker-a596b5c11e353948d15009facb7fa8d7933080e0.tar.gz
merge of 0.12.903. Generated new spec for new version
Change-Id: Iff3eaef81aedf9696cf021cac0a248d391166115
-rw-r--r--CMakeLists.txt53
-rw-r--r--RELEASE5
-rw-r--r--ambd/CMakeLists.txt31
-rw-r--r--ambd/core.cpp14
-rw-r--r--ambd/core.h2
-rw-r--r--docs/CMakeLists.txt8
-rw-r--r--docs/Doxyfile.idl.in5
-rw-r--r--docs/Doxyfile.mainpage.in4
-rw-r--r--docs/amb.in.fidl (renamed from docs/amb.in.idl)509
-rw-r--r--docs/dbus.idl35
-rw-r--r--docs/images/AMBArchitecture.pngbin0 -> 71850 bytes
-rw-r--r--docs/mainpage.in.idl14
-rw-r--r--docs/plugins/bluemonkey/bluemonkey.idl156
-rw-r--r--examples/CMakeLists.txt44
-rw-r--r--examples/democonfig24
-rw-r--r--examples/gpsdconfig15
-rw-r--r--examples/openxcconfig17
-rw-r--r--lib/abstractroutingengine.h17
-rw-r--r--lib/asyncqueue.hpp9
-rw-r--r--packaging.in/CMakeLists.txt18
-rw-r--r--packaging.in/automotive-message-broker.changes.in (renamed from packaging/automotive-message-broker.changes)0
-rw-r--r--packaging.in/automotive-message-broker.spec.in (renamed from packaging/automotive-message-broker.spec.in)39
-rw-r--r--packaging.in/config.tizen.in20
-rw-r--r--packaging.in/debian/automotive-message-broker-plugins.debian.install5
-rw-r--r--packaging.in/debian/automotive-message-broker.debian.install3
-rw-r--r--packaging.in/debian/changelog5
-rw-r--r--packaging.in/debian/control.debian.in41
-rw-r--r--packaging.in/debian/libamb-dev.debian.install3
-rw-r--r--packaging.in/debian/libamb.debian.install1
-rwxr-xr-xpackaging.in/debian/rules19
-rw-r--r--packaging/CMakeLists.txt1
-rw-r--r--packaging/automotive-message-broker.spec43
-rw-r--r--plugins/CMakeLists.txt4
-rw-r--r--plugins/bluemonkey/CMakeLists.txt14
-rw-r--r--plugins/bluemonkey/Doxyfile.in1
-rw-r--r--plugins/bluemonkey/README8
-rw-r--r--plugins/bluemonkey/bluemonkey.in.idl40
-rw-r--r--plugins/database/README2
-rw-r--r--plugins/database/databasesink.cpp38
-rw-r--r--plugins/database/databasesink.h2
-rw-r--r--plugins/dbus/CMakeLists.txt3
-rw-r--r--plugins/dbus/README3
-rw-r--r--plugins/dbus/abstractdbusinterface.cpp11
-rw-r--r--plugins/exampleplugins.README.txt36
-rw-r--r--plugins/gpsnmea/CMakeLists.txt4
-rw-r--r--plugins/gpsnmea/README5
-rw-r--r--plugins/gpsnmea/gpsnmea.cpp8
-rw-r--r--plugins/obd2plugin/CMakeLists.txt4
-rw-r--r--plugins/obd2plugin/README3
-rw-r--r--plugins/opencvlux/CMakeLists.txt9
-rw-r--r--plugins/opencvlux/README3
-rw-r--r--plugins/opencvlux/opencvluxplugin.cpp2
-rw-r--r--plugins/websocket/CMakeLists.txt10
-rw-r--r--plugins/websocket/README9
-rw-r--r--plugins/websocket/websocketsinkmanager.cpp2
-rw-r--r--plugins/wheel/CMakeLists.txt4
-rw-r--r--plugins/wheel/README29
-rw-r--r--tests/CMakeLists.txt2
-rw-r--r--tools/CMakeLists.txt4
-rw-r--r--tools/ambctl.py81
-rw-r--r--xwalk/vehicle.html36
61 files changed, 967 insertions, 570 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2e488d6a..44402266 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,10 +4,11 @@ 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")
-set(PROJECT_VERSION "0.12.902")
+set(PROJECT_VERSION "0.12.903")
set(PROJECT_CODENAME "agera")
set(PROJECT_QUALITY "beta")
@@ -17,10 +18,10 @@ add_definitions(-DPROJECT_CODENAME="${PROJECT_CODENAME}")
add_definitions(-DPROJECT_QUALITY="${PROJECT_QUALITY}")
set (LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" )
-set (LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/${CMAKE_LIBRARY_ARCHITECTURE}" CACHE STRING "Directory where lib will install")
+set (LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/${CMAKE_LIBRARY_ARCHITECTURE}" )
set (PLUGIN_INSTALL_PATH "${LIB_INSTALL_DIR}/${PROJECT_NAME}")
-set (INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "The directory the headers are installed in")
-set (DOC_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/doc/packages/${PROJECT_NAME}" CACHE PATH "The directory the docs will be installed to")
+set (INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include")
+set (DOC_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/doc/packages/${PROJECT_NAME}")
option(qtmainloop "Use QCoreApplication mainloop " OFF)
option(websocket_plugin "websocket source and sink plugins" OFF)
@@ -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)
@@ -114,7 +88,7 @@ add_custom_target(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/c
# packaging stuff:
# Common things to every type of package
-SET(CPACK_PACKAGE_DESCRIPTION "daemon to access vehicle data")
+SET(CPACK_PACKAGE_DESCRIPTION "daemon that provides access vehicle data")
SET(CPACK_PACKAGE_NAME "automotive-message-broker")
SET(CPACK_PACKAGE_EXECUTABLES "ambd")
SET(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}")
@@ -122,24 +96,15 @@ SET(CPACK_STRIP_FILES true)
SET(CPACK_PACKAGE_CONTACT "tripzero.kev@gmail.com")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")
-
# Always build .tar.gz and .sh files
-SET(CPACK_GENERATOR "STGZ;TGZ")
-
-SET(CPACK_GENERATOR "${CPACK_GENERATOR};DEB")
-SET(CPACK_DEBIAN_PACKAGE_DEPENDS "gpsd (>=2.0), libopencv, libjson0, libltdl7")
-SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION})
-
-INCLUDE(CPack)
-
-configure_file (${CMAKE_CURRENT_SOURCE_DIR}/packaging.in/config.tizen.in ${CMAKE_CURRENT_BINARY_DIR}/packaging.in/config.tizen @ONLY)
+SET(CPACK_GENERATOR "STGZ;TGZ;TBZ2")
add_subdirectory(lib)
-add_subdirectory(ambd)
add_subdirectory(plugins)
+add_subdirectory(ambd)
add_subdirectory(docs)
add_subdirectory(tests)
add_subdirectory(tools)
add_subdirectory(examples)
add_subdirectory(xwalk)
-add_subdirectory(packaging)
+add_subdirectory(packaging.in)
diff --git a/RELEASE b/RELEASE
index beec7245..cf1650e2 100644
--- a/RELEASE
+++ b/RELEASE
@@ -11,9 +11,12 @@ New features:
Changes:
- OpenCV plugin experimental options for cuda and kinect are removed
- Removed unmaintained plugins: tpms, websocket{sink,source}
-- AbstractSource::getPropertyInfo() is now mandatory
+- Implementing AbstractSource::getPropertyInfo() is now mandatory
- [websocket plugin] protocol changes: getSupportedEventTypes is getSupported. 'data' changed type to array of objects
instead of array of strings. See plugins/websocket/protocol
+- Removed old ButtonEvent interface as it conflicted with the new ButtonEvent.
+- Extensive documentation improvements. Plugin docs install to @DOC_INSTALL_PREFIX@/plugins/.
+- Bluemonkey JS API docs @DOC_INSTALL_PREFIX@/plugins/bluemonkey/html/.
Fixes:
- [DBus plugin] Fix exporting properties in zones that really don't have support
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/docs/CMakeLists.txt b/docs/CMakeLists.txt
index 2ebb4879..445856cf 100644
--- a/docs/CMakeLists.txt
+++ b/docs/CMakeLists.txt
@@ -1,6 +1,8 @@
if(enable_docs)
install (DIRECTORY amb DESTINATION ${DOC_INSTALL_DIR} COMPONENT Docs)
install (DIRECTORY dbus DESTINATION ${DOC_INSTALL_DIR} COMPONENT Docs)
+ install (DIRECTORY html DESTINATION ${DOC_INSTALL_DIR} COMPONENT Docs)
+ install (DIRECTORY latex DESTINATION ${DOC_INSTALL_DIR} COMPONENT Docs)
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/amb.fidl DESTINATION ${DOC_INSTALL_DIR}/dbus/html/ COMPONENT Docs)
add_custom_target(doc_idl ALL mkdir -p ${CMAKE_CURRENT_SOURCE_DIR}/dbus/html/ && cp ${CMAKE_CURRENT_SOURCE_DIR}/amb.fidl ${CMAKE_CURRENT_SOURCE_DIR}/dbus/html/amb.fidl WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMENT "Moving amb.fidl" VERBATIM)
@@ -10,8 +12,10 @@ find_package(Doxygen)
if(DOXYGEN_FOUND)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.idl.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile.idl @ONLY)
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.mainpage.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile.mainpage @ONLY)
add_custom_target(libamb_docs ALL ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/docs/amb COMMENT "Generating API documentation with Doxygen" VERBATIM)
add_custom_target(idl ALL ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile.idl WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/docs/dbus COMMENT "Generating DBus API documentation with Doxygen" VERBATIM)
+ add_custom_target(mainpage_docs ALL ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile.mainpage WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/docs COMMENT "Generating mainpage documentation with Doxygen" VERBATIM)
#generate mappings documentation
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/libamb.in ${CMAKE_CURRENT_BINARY_DIR}/libamb.h @ONLY)
@@ -27,6 +31,6 @@ endif(DOXYGEN_FOUND)
endif(enable_docs)
-configure_file (${CMAKE_CURRENT_SOURCE_DIR}/amb.in.idl ${CMAKE_CURRENT_SOURCE_DIR}/amb.fidl @ONLY)
-configure_file (${CMAKE_CURRENT_SOURCE_DIR}/dbus.idl ${CMAKE_CURRENT_SOURCE_DIR}/dbus.idl @ONLY)
+configure_file (${CMAKE_CURRENT_SOURCE_DIR}/amb.in.fidl ${CMAKE_CURRENT_SOURCE_DIR}/amb.fidl @ONLY)
+configure_file (${CMAKE_CURRENT_SOURCE_DIR}/mainpage.in.idl ${CMAKE_CURRENT_SOURCE_DIR}/mainpage.idl @ONLY)
diff --git a/docs/Doxyfile.idl.in b/docs/Doxyfile.idl.in
index cf05b696..55235849 100644
--- a/docs/Doxyfile.idl.in
+++ b/docs/Doxyfile.idl.in
@@ -1,3 +1,6 @@
PROJECT_NAME = @PROJECT_NAME@
PROJECT_NUMBER = @PROJECT_VERSION@
-INPUT = @CMAKE_CURRENT_SOURCE_DIR@ @CMAKE_CURRENT_BINARY_DIR@/ambdbusmappings.idl
+FILE_PATTERNS = *.fidl
+EXTENSION_MAPPING = fidl=IDL
+INPUT = @CMAKE_CURRENT_SOURCE_DIR@/amb.fidl @CMAKE_CURRENT_BINARY_DIR@/ambdbusmappings.idl
+
diff --git a/docs/Doxyfile.mainpage.in b/docs/Doxyfile.mainpage.in
new file mode 100644
index 00000000..bb8e6882
--- /dev/null
+++ b/docs/Doxyfile.mainpage.in
@@ -0,0 +1,4 @@
+PROJECT_NAME = @PROJECT_NAME@
+PROJECT_NUMBER = @PROJECT_VERSION@
+INPUT = @CMAKE_SOURCE_DIR@/docs/mainpage.idl
+IMAGE_PATH = @CMAKE_SOURCE_DIR@/docs/images
diff --git a/docs/amb.in.idl b/docs/amb.in.fidl
index ded521e5..d0381900 100644
--- a/docs/amb.in.idl
+++ b/docs/amb.in.fidl
@@ -1,9 +1,88 @@
-/*! amb.idl
+/*!
+* \mainpage Automotive Message Broker DBus API Documentation
+*
+* \section intro Introduction
+* AMB organizes the API into two general interface categories. First the Manager interface (see manager.txt)
+* which includes tools for using the other interfaces. Second is a number of interfaces that
+* represent vehicle data. The latter follows the schema of "org.automotive.DataType" and are
+* contained in verious DBus paths. The DBus paths are generally organized by
+* /{source}/{zone}/DataType. "source" refers to the AMB source that produces the data. "zone"
+* refers to the zone in which the data type is located in the vehicle or "0" for no zone.
+*
+* The interfaces and data types are documented in <a href="amb.fidl">amb.fidl</a>. Franca IDL
+* tools can be used to generate DBus introspection xml which can be used to generate bindings
+* for your language of choice. These interfaces types map to internal AMB properties. To understand the mappings,
+* see the <a href="ambdbusmappings_8idl.html">mapping documentation</a>
+*
+* \section basic_usage Basic Recommended Usage
+*
+* It is recommended that the Manager interface be used to find the DBus Object that contains the
+* data type you need. This is done through the FindObject() call. It is expected that DBus
+* Object Paths may change and so it is not appropriate to hard code DBus Object Paths.
+*
+* Here is a pseudo-code example of how the api is to be used:
+*
+* \code
+* var manager = dbus.interface("org.automotive.Manager", "/");
+*
+* var speedObjectPaths = manager.FindObject("VehicleSpeed");
+*
+* var speedObject = dbus.interface("org.automotive.VehicleSpeed", speedObjectPaths[0]);
+*
+* console.log("Vehicle Speed: " + speedObject.Speed);
+* \endcode
+* \section automotive_manager Automotive Manager
+* Manager is a helper interface for discovering and finding available objects. Manager also helps users look up objects by zone and get additional information about a data type (ieorg.automotive.Manager.ZonesForObjectName).
+* \section zones Zones
+*
+* 'Zone' describes the position in the vehicle where the object is located. The Zone type is a bitfield of values that can be combined to describe a specific location. For example
+*
+* \code
+* Zone.Front | Zone.Left
+* \endcode
+*
+* (which is '9') may represent the driver position.
+*
+* \code
+* enumeration Zone {
+* None = 0,
+* Front = 1,
+* Middle = 1 << 1,
+* Right = 1 << 2,
+* Left = 1 << 3,
+* Rear = 1 << 4,
+* Center = 1 << 5
+* }
+* \endcode
+*
+* \section vehicle_property_type Vehicle Property Type
+* Vehicle Property Type is the common interface which all Data types are derived. This interface is as follows:
+*
+* \code
+* interface VehiclePropertyType {
+* attribute Double Time readonly
+* attribute Zone Zone readonly
+* method GetHistory(Double beginTime, Double endTime) {
+* out{ Dictionary result}
+* }
+* }
+* \endcode
+*
+* \section data_types Data types
+*
+* The data types try to conform to the [http://w3c.github.io/automotive-bg/data_spec.html W3C Automotive Business Group Vehicle Data Specification] as much as possible. There are differences in the Zone type, and this vehicle API contains some additional data types that the W3C Business Group has not yet defined. 'Time' also represents relative time in seconds rather than time in ms since epoch (DOMTimeStamp). The names of the attributes are also different because of Web vs. DBus conventions. In this Vehicle API, DBus properties use CamelCase (ie Speed vs speed) vs lowerCamelCase. Units and types are the same where possible.
+*
+* Also note that many types have been marked "deprecated" and replaced with the W3C version of the type. Deprecated types should not be used in new projects.
+*
+*/
+
+/*!
+* \file amb.fidl
* \name @PROJECT_NAME@
* \version @PROJECT_VERSION@
* \brief This document describes the DBus interfaces and data types for the
* Automotive Message Broker API. The data types are intended to as-close-as-
-* possible be compatible with the W3C vehicle <a href="https://rawgit.com/w3c/automotive-bg/master/data_spec.html>data spec</a>.
+* possible be compatible with the W3C vehicle <a href="https://rawgit.com/w3c/automotive-bg/master/data_spec.html">data spec</a>.
*/
/*!
@@ -56,7 +135,7 @@ interface VehiclePropertyType {
* \arg endTime time stamp in Seconds since Unix Epoc
*/
method GetHistory(Double beginTime, Double endTime) {
- out{ Dictionary result}
+ out{ Dictionary result}
}
}
@@ -80,7 +159,7 @@ interface org.automotive.Manager {
* \brief return supported properties
*/
method List {
- out {array of String objectNames}
+ out {array of String objectNames}
}
/*!
@@ -96,12 +175,12 @@ interface org.automotive.Manager {
* \return list of object paths that provide the given object Name.
*/
method FindObject {
- in {
- String objectName
- }
- out {
- array of String objectPaths
- }
+ in {
+ String objectName
+ }
+ out {
+ array of String objectPaths
+ }
}
/*!
@@ -110,19 +189,19 @@ interface org.automotive.Manager {
* except that it takes an addition zone argument and only return the path for that zone.
* \arg String property is the requested property to be retrieved.
* \arg Zone zone is the zone which the object
- * \return string representing the DBus Object path.
+ * \return string representing the DBus Object path.
* Possible errors:
* "org.automotive.Manager.InvalidZone"
* "org.automotive.Manager.ObjectNotFound"
*/
method FindObjectForZone {
- in {
- String objectName
- Zone zone
- }
- out {
- String objectPath
- }
+ in {
+ String objectName
+ Zone zone
+ }
+ out {
+ String objectPath
+ }
}
/*!
@@ -132,12 +211,12 @@ interface org.automotive.Manager {
* \return list of zones for the given objectName (@see Zone)
*/
method ZonesForObjectName {
- in {
- String objectName
- }
- out {
- array of UInt32 zones
- }
+ in {
+ String objectName
+ }
+ out {
+ array of UInt32 zones
+ }
}
/*!
@@ -147,12 +226,12 @@ interface org.automotive.Manager {
* \return true if Property exists
*/
method SupportsProperty {
- in {
- String propertyName
- }
- out {
- Boolean supported
- }
+ in {
+ String propertyName
+ }
+ out {
+ Boolean supported
+ }
}
}
@@ -205,7 +284,7 @@ interface org.automotive.TripMeter extends VehiclePropertyType {
/*! TripMeters
* \brief MUST return trip meters. Changing any items in the array will reset the item's value to '0'.
*/
- attribute array TripMeters of UInt16;
+ attribute array TripMeters of UInt16
}
/*! org.automotive.Acceleration
@@ -279,7 +358,7 @@ interface org.automotive.Transmission extends VehiclePropertyType {
* \brief MUST return transmission gear type of either Automatic, Manual or Constant Variable (CV).
* See TRANSMISSIONGEARTYPE
*/
- attribute TransmissionGearType Type;
+ attribute TransmissionGearType Type
/*! Gear
* \brief MUST return transmission gear position 1-10
@@ -404,7 +483,7 @@ interface org.automotive.InteriorLightStatus extends VehiclePropertyType {
/*! Status
* \brief MUST return interior light status for the zone. on = true, off = false
*/
- attribute Boolean Status
+ attribute Boolean Status
}
@@ -442,22 +521,22 @@ interface org.automotive.Fuel extends VehiclePropertyType {
/*! AverageEconomy
* \brief MUST return average fuel 'economy' in kilometers per liter of fuel since last reset. Setting this to any value should reset the counter to '0'
*/
- attribute UInt16 AverageEconomy;
+ attribute UInt16 AverageEconomy
/*! AverageConsumption
* \brief MUST return average fuel consumption in per distance travelled (Unit: milliliters per 100 kilometers). Setting this to any value should reset the counter to '0'
*/
- attribute UInt32 AverageConsumption;
+ attribute UInt32 AverageConsumption
/*! FuelConsumedSinceRestart
- * \brief MUST return fuel consumed since engine start; (Unit: milliliters per 100 kilometers) resets to 0 each restart
+ * \brief MUST return fuel consumed since engine start (Unit: milliliters per 100 kilometers) resets to 0 each restart
*/
- attribute UInt32 FuelConsumedSinceRestart readonly;
+ attribute UInt32 FuelConsumedSinceRestart readonly
/*! TimeSinceRestart
* \brief MUST return time elapsed since vehicle restart (Unit: seconds)
*/
- attribute UInt32 TimeSinceRestart readonly;
+ attribute UInt32 TimeSinceRestart readonly
}
@@ -589,7 +668,7 @@ enumeration WiperControl {
fast = "fast",
fastest = "fastest",
auto = "auto"
-};
+}
interface org.automotive.WiperStatus extends VehiclePropertyType {
@@ -607,55 +686,55 @@ interface org.automotive.WiperStatus extends VehiclePropertyType {
/*! Deprecated. Use ClimateControl interface. Remove in 0.14
*/
interface org.automotive.HVAC extends VehiclePropertyType {
- const UInt16 AIRFLOWDIRECTION_FRONTPANEL = 0;
- const UInt16 AIRFLOWDIRECTION_FLOORDUCT= 1;
- const UInt16 AIRFLOWDIRECTION_FRONT = 0x02;
- const UInt16 AIRFLOWDIRECTION_DEFROSTER = 0x04;
+ const UInt16 AIRFLOWDIRECTION_FRONTPANEL = 0
+ const UInt16 AIRFLOWDIRECTION_FLOORDUCT= 1
+ const UInt16 AIRFLOWDIRECTION_FRONT = 0x02
+ const UInt16 AIRFLOWDIRECTION_DEFROSTER = 0x04
/*! AirflowDirection
* \brief MUST return airflow direction. See
*/
- attribute UInt16 AirflowDirection;
+ attribute UInt16 AirflowDirection
/*! FanSpeed
* \brief MUST return speed of the fan (0-7)
*/
- attribute UInt16 FanSpeed;
+ attribute UInt16 FanSpeed
/*! TargetTemperature
* \brief MUST return target desired temperature in celcius.
*/
- attribute UInt16 TargetTemperature;
+ attribute UInt16 TargetTemperature
/*! AirConditioning
* \brief MUST return air conditioning on (true) / off (false).
*/
- attribute Boolean AirConditioning;
+ attribute Boolean AirConditioning
/*! AirRecirculation
* \brief MUST return air recirculation on (true) / off (false).
*/
- attribute Boolean AirRecirculation;
+ attribute Boolean AirRecirculation
/*! Heater
* \brief MUST return heater on (true) / off (false).
*/
- attribute Boolean Heater;
+ attribute Boolean Heater
/*! SteeringWheelHeater
* \brief MUST return air recirculation on (true) / off (false).
*/
- attribute Boolean SteeringWheelHeater;
+ attribute Boolean SteeringWheelHeater
/*! SeatHeater
* \brief MUST return seat heater status: 0-100%.
*/
- attribute UInt16 SeatHeater;
+ attribute UInt16 SeatHeater
/*! SeatCooler
* \brief MUST return seat heater status: on (true) / off (false).
*/
- attribute Boolean SeatCooler;
+ attribute Boolean SeatCooler
}
enumeration AirflowDirectionType
@@ -670,47 +749,47 @@ interface org.automotive.ClimateControl extends VehiclePropertyType {
/*! AirflowDirection
* \brief MUST return current status of the direction of the air flow through the ventilation system
*/
- attribute AirflowDirectionType AirflowDirection;
+ attribute AirflowDirectionType AirflowDirection
/*! FanSpeedLevel
* \brief MUST return seat heater status: on (true) / off (false).
*/
- attribute UInt8 FanSpeedLevel;
+ attribute UInt8 FanSpeedLevel
/*! TargetTemperature
* \brief MUST return current setting of the desired temperature (Unit: celsius)
*/
- attribute Int8 TargetTemperature;
+ attribute Int8 TargetTemperature
/*! AirConditioning
* \brief MUST return current status of the air conditioning system: on (true) or off (false)
*/
- attribute Boolean AirConditioning;
+ attribute Boolean AirConditioning
/*! Heater
* \brief MUST return current status of the heating system: on (true) or off (false)
*/
- attribute Boolean Heater;
+ attribute Boolean Heater
/*! SeatHeater
* \brief MUST return current status of the seat warmer ( 0: off, 1: least warm, 10: warmest )
*/
- attribute UInt8 SeatHeater;
+ attribute UInt8 SeatHeater
/*! SeatCooler
* \brief MUST return current status of the seat ventilation ( 0: off, 1: least warm, 10: warmest )
*/
- attribute UInt8 SeatCooler;
+ attribute UInt8 SeatCooler
/*! AirRecirculation
* \brief MUST return current setting of air recirculation: on (true) or pulling in outside air (false).
*/
- attribute Boolean AirRecirculation;
+ attribute Boolean AirRecirculation
/*! SteeringWheelHeater
* \brief MUST return current status of steering wheel heater ( 0: off, 1: least warm, 10: warmest ).
*/
- attribute UInt8 SteeringWheelHeater;
+ attribute UInt8 SteeringWheelHeater
}
/// Deprecated in 0.14. Use SideWindow
@@ -720,13 +799,13 @@ interface org.automotive.WindowStatus extends VehiclePropertyType {
* \brief MUST return window openness percentage (100% fully open, 0% fully closed)
* for the window location see "zone" attribute
*/
- attribute UInt16 Openness;
+ attribute UInt16 Openness
/*! Defrost
* \brief MUST return the defroster status of the window. On = true, Off = false.
* Deprecated. Use Defrost interface. Remove in 0.14.
*/
- attribute Boolean Defrost;
+ attribute Boolean Defrost
}
interface org.automotive.SideWindow extends VehiclePropertyType {
@@ -734,12 +813,12 @@ interface org.automotive.SideWindow extends VehiclePropertyType {
/*! Openness
* \brief MUST return window openness percentage (100% fully open, 0% fully closed)
*/
- attribute UInt16 Openness;
+ attribute UInt16 Openness
/*! Lock
* \brief MUST return whether or not the window is locked (true) or unlocked (false)
*/
- attribute Boolean Lock;
+ attribute Boolean Lock
}
interface org.automotive.Defrost extends VehiclePropertyType {
@@ -748,13 +827,13 @@ interface org.automotive.Defrost extends VehiclePropertyType {
* \brief MUST return current status of the defrost switch for mirrors. It can be
* used to send user's request for changing setting.
*/
- attribute Boolean DefrostWindow;
+ attribute Boolean DefrostWindow
/*! DefrostMirrors
* \brief MUST return current status of the defrost switch for window. It can be
* used to send user's request for changing setting.
*/
- attribute Boolean DefrostMirrors;
+ attribute Boolean DefrostMirrors
}
interface org.automotive.Sunroof extends VehiclePropertyType {
@@ -762,34 +841,34 @@ interface org.automotive.Sunroof extends VehiclePropertyType {
/*! Openness
* \brief MUST return window status for sunroof openness percentage.
*/
- attribute UInt16 Openness;
+ attribute UInt16 Openness
/*! Tilt
* \brief MUST return tilt status for sunroof percentage.
*/
- attribute UInt16 Tilt;
+ attribute UInt16 Tilt
}
enumeration ConvertibleRoofStatus {
- closed = "closed",
- closing = "closing",
- opening = "opening",
- opened = "opened"
-};
+ closed = "closed",
+ closing = "closing",
+ opening = "opening",
+ opened = "opened"
+}
interface org.automotive.ConvertibleRoof extends VehiclePropertyType {
/*! Status
* \brief MUST return current status of Convertible Roof.
*
*/
- attribute ConvertibleRoofStatus Status readonly;
+ attribute ConvertibleRoofStatus Status readonly
/*! Setting
* \brief MUST return current setting of Convertible Roof. This is used to open (true) and close (false).
*
*/
- attribute Boolean Setting;
+ attribute Boolean Setting
}
@@ -828,15 +907,15 @@ interface org.automotive.Size extends VehiclePropertyType {
interface org.automotive.FuelInfo extends VehiclePropertyType {
- const UInt16 FUELTYPE_GASOLINE = 0;
- const UInt16 FUELTYPE_HIGH_OCTANE= 1;
- const UInt16 FUELTYPE_DIESEL = 2;
- const UInt16 FUELTYPE_ELECTRIC = 3;
- const UInt16 FUELTYPE_HYDROGEN = 4;
- const UInt16 REFUELPOSITION_LEFT = 0;
- const UInt16 REFUELPOSITION_RIGHT= 1;
- const UInt16 REFUELPOSITION_FRONT = 2;
- const UInt16 REFUELPOSITION_REAR = 3;
+ const UInt16 FUELTYPE_GASOLINE = 0
+ const UInt16 FUELTYPE_HIGH_OCTANE= 1
+ const UInt16 FUELTYPE_DIESEL = 2
+ const UInt16 FUELTYPE_ELECTRIC = 3
+ const UInt16 FUELTYPE_HYDROGEN = 4
+ const UInt16 REFUELPOSITION_LEFT = 0
+ const UInt16 REFUELPOSITION_RIGHT= 1
+ const UInt16 REFUELPOSITION_FRONT = 2
+ const UInt16 REFUELPOSITION_REAR = 3
/*! Type
* \brief MUST return type of fuel. integer 0-4 (see
@@ -851,12 +930,12 @@ interface org.automotive.FuelInfo extends VehiclePropertyType {
interface org.automotive.VehicleType extends VehiclePropertyType {
- const UInt16 VEHICLETYPE_SEDAN = 0;
- const UInt16 VEHICLETYPE_COUPE= 1;
- const UInt16 VEHICLETYPE_CABRIOLE = 2;
- const UInt16 VEHICLETYPE_ROADSTER = 3;
- const UInt16 VEHICLETYPE_SUV = 4;
- const UInt16 VEHICLETYPE_TRUCK = 5;
+ const UInt16 VEHICLETYPE_SEDAN = 0
+ const UInt16 VEHICLETYPE_COUPE= 1
+ const UInt16 VEHICLETYPE_CABRIOLE = 2
+ const UInt16 VEHICLETYPE_ROADSTER = 3
+ const UInt16 VEHICLETYPE_SUV = 4
+ const UInt16 VEHICLETYPE_TRUCK = 5
/*! Type
* \brief MUST return type of Vehicle. Integer 0-5 (see
@@ -1012,7 +1091,7 @@ interface org.automotive.ParkingBrake extends VehiclePropertyType {
/*!
* \brief MUST return the current status of parking brake.
*/
- attribute ParkingBrakeStatus Status;
+ attribute ParkingBrakeStatus Status
}
/// Deprecated. Use LightStatus. remove in 0.14
@@ -1045,12 +1124,12 @@ interface org.automotive.AntilockBrakingSystem extends VehiclePropertyType {
/*!
* \brief MUST return whether or not the ABS Setting is enabled: enabled (true) or disabled (false)
*/
- attribute Boolean Enabled readonly;
+ attribute Boolean Enabled readonly
/*!
* \brief MUST return whether or not the ABS is engaged: engaged (true) or idle (false)
*/
- attribute Boolean Engaged readonly;
+ attribute Boolean Engaged readonly
}
@@ -1065,12 +1144,12 @@ interface org.automotive.TractionControlSystem extends VehiclePropertyType {
/*!
* \brief MUST return whether or not the TCS Setting is enabled: enabled (true) or disabled (false)
*/
- attribute Boolean Enabled readonly;
+ attribute Boolean Enabled readonly
/*!
* \brief MUST return whether or not the TCS is engaged: engaged (true) or idle (false)
*/
- attribute Boolean Engaged readonly;
+ attribute Boolean Engaged readonly
}
@@ -1094,12 +1173,12 @@ interface org.automotive.AirbagStatus extends VehiclePropertyType {
/*!
* \brief MUST return whether or not the airbag is activaged: activated (true) or deactivated (false)
*/
- attribute Boolean Activated readonly;
+ attribute Boolean Activated readonly
/*!
* \brief MUST return whether the airbag is deployed: deployed (true) or not (false)
*/
- attribute Boolean Deployed readonly;
+ attribute Boolean Deployed readonly
}
/// TODO: deprecated. Remove in 0.14
@@ -1125,7 +1204,7 @@ interface org.automotive.DoorStatus extends VehiclePropertyType {
/*! DoorLockStatus
* \brief MUST return Door status (bool locked = true, unlocked = false).
*/
- attribute Boolean DoorLockStatus;
+ attribute Boolean DoorLockStatus
/*! ChildLockStatus
* \brief MUST return Child lock status of rear doors. active = true, inactive = false.
@@ -1133,7 +1212,7 @@ interface org.automotive.DoorStatus extends VehiclePropertyType {
* from the inside.
*/
///TODO: Deprecated in 0.14. Use org.automotive.ChildLockStatus
- attribute Boolean ChildLockStatus;
+ attribute Boolean ChildLockStatus
}
enumeration DoorStatus {
@@ -1152,14 +1231,14 @@ interface org.automotive.Door extends VehiclePropertyType {
/*! Lock
* \brief MUST return Door status (bool locked = true, unlocked = false).
*/
- attribute Boolean Lock;
+ attribute Boolean Lock
/*! ChildLock
* \brief MUST return Child lock status of rear doors. active = true, inactive = false.
* Setting this to 'true' will prevent the rear doors from being opened
* from the inside.
*/
- attribute Boolean ChildLock;
+ attribute Boolean ChildLock
}
///TODO: Deprecated in 0.14. Use org.automotive.Seat
@@ -1264,7 +1343,7 @@ interface org.automotive.SeatPosition extends VehiclePropertyType {
*/
attribute UInt16 Recline readonly
- /*!
+ /*!
* \brief MUST return
*/
attribute UInt16 Slide readonly
@@ -1343,30 +1422,6 @@ interface org.automotive.SteeringWheel extends VehiclePropertyType {
attribute Int16 Angle readonly
}
-
-interface org.automotive.ButtoneEvent extends VehiclePropertyType {
-
- /*!
- * \brief MUST return button event:
- * NoButton =0
- * PlayButton = 1,
- * SkipButton = 1 << 1,
- * PrevButton = 1 << 2,
- * PauseButton = 1 << 3,
- * Preset1Button = 1 << 4,
- * Preset2Button = 1 << 5,
- * Preset3Button = 1 << 6,
- * Preset4Button = 1 << 7,
- * StopButton = 1 << 8,
- * NavigateUpButton = 1 << 9,
- * NavigateDownButton = 1 << 10,
- * NavigateLeftButton = 1 << 11,
- * NavigateRightButton = 1 << 12
- */
- attribute UInt32 ButtonEvent readonly
-}
-
-
interface org.automotive.DriverId extends VehiclePropertyType {
/*!
@@ -1423,15 +1478,15 @@ interface org.automotive.WheelTick extends VehiclePropertyType {
interface IgnitionTime : VehicleCommonDataType {
/*!
- * \brief MUST return time at ignition on
- */
- attribute UInt64 ignitionOnTime readonly
+ * \brief MUST return time at ignition on
+ */
+ attribute UInt64 ignitionOnTime readonly
- /*!
- * \brief MUST return time at ignition off
- */
- attribute UInt64 ignitionOffTime readonly
-};
+ /*!
+ * \brief MUST return time at ignition off
+ */
+ attribute UInt64 ignitionOffTime readonly
+}
interface org.automotive.YawRate extends VehiclePropertyType {
@@ -1450,39 +1505,39 @@ interface org.automotive.BrakeOperation extends VehiclePropertyType {
}
enumeration Button {
- home = "home",
- back = "back",
- search = "search",
- call = "call",
- end_call = "end_call",
- media_play = "media_play",
- media_next = "media_next",
- media_previous = "media_previous",
- media_pause = "media_pause",
- voice_recognize = "voice_recognize",
- enter = "enter",
- left = "left",
- right = "right",
- up = "up",
- down = "down"
+ home = "home",
+ back = "back",
+ search = "search",
+ call = "call",
+ end_call = "end_call",
+ media_play = "media_play",
+ media_next = "media_next",
+ media_previous = "media_previous",
+ media_pause = "media_pause",
+ voice_recognize = "voice_recognize",
+ enter = "enter",
+ left = "left",
+ right = "right",
+ up = "up",
+ down = "down"
}
enumeration ButtonEventType {
- press = "press",
- long_press = "long_press",
- release = "release"
-};
+ press = "press",
+ long_press = "long_press",
+ release = "release"
+}
interface VehicleButton {
- /*!
- * \brief MUST return the button corresponding to the event.
- */
- attribute Button button readonly;
+ /*!
+ * \brief MUST return the button corresponding to the event.
+ */
+ attribute Button button readonly
- /*!
- * \brief MUST return the type of event
- */
- attribute ButtonEventType state readonly;
+ /*!
+ * \brief MUST return the type of event
+ */
+ attribute ButtonEventType state readonly
}
interface org.automotive.ButtonEvent extends VehiclePropertyType {
@@ -1490,7 +1545,7 @@ interface org.automotive.ButtonEvent extends VehiclePropertyType {
/*!
* \brief MUST return the button events that occured. This supports multiple simultanious button events.
*/
- attribute array Button of VehicleButton readonly;
+ attribute array Button of VehicleButton readonly
}
interface org.automotive.TransmissionOil extends VehiclePropertyType {
@@ -1498,12 +1553,12 @@ interface org.automotive.TransmissionOil extends VehiclePropertyType {
/*!
* \brief MUST return current temperature of the transmission oil(Unit: celsius).
*/
- attribute Int8 Temperature readonly;
+ attribute Int8 Temperature readonly
/*!
* \brief MUST return transmission oil wear (Unit: percentage, 0: no wear, 100: completely worn).
*/
- attribute UInt8 Wear readonly;
+ attribute UInt8 Wear readonly
}
interface org.automotive.TransmissionClutch extends VehiclePropertyType {
@@ -1511,7 +1566,7 @@ interface org.automotive.TransmissionClutch extends VehiclePropertyType {
/*!
* \brief MUST return transmission clutch wear (Unit: percentage, 0: no wear, 100: completely worn).
*/
- attribute UInt8 Wear readonly;
+ attribute UInt8 Wear readonly
}
interface org.automotive.BrakeMaintenance extends VehiclePropertyType {
@@ -1519,22 +1574,22 @@ interface org.automotive.BrakeMaintenance extends VehiclePropertyType {
/*!
* \brief MUST return brake pad wear (Unit: percentage, 0%: no wear, 100%: completely worn).
*/
- attribute UInt8 PadWear readonly;
+ attribute UInt8 PadWear readonly
/*!
* \brief MUST return brake fluid level (Unit: percentage, 0%: empty, 100%: full).
*/
- attribute UInt8 FluidLevel readonly;
+ attribute UInt8 FluidLevel readonly
/*!
* \brief MUST return true if brake fluid level: low (true), not low (false)
*/
- attribute Boolean FluidLevelLow readonly;
+ attribute Boolean FluidLevelLow readonly
/*!
* \brief MUST return true if brakes are worn: worn (true), not worn (false)
*/
- attribute Boolean BrakesWorn readonly;
+ attribute Boolean BrakesWorn readonly
}
interface org.automotive.WasherFluid extends VehiclePropertyType {
@@ -1542,12 +1597,12 @@ interface org.automotive.WasherFluid extends VehiclePropertyType {
/*!
* \brief MUST return washer fluid level (Unit: percentage, 0%: empty, 100%: full).
*/
- attribute UInt8 Level readonly;
+ attribute UInt8 Level readonly
/*!
* \brief MUST return true if washer fluid level is low: low (true), not low: (false)
*/
- attribute Boolean LevelLow readonly;
+ attribute Boolean LevelLow readonly
}
interface org.automotive.MalfunctionIndicator extends VehiclePropertyType {
@@ -1555,7 +1610,7 @@ interface org.automotive.MalfunctionIndicator extends VehiclePropertyType {
/*!
* \brief MUST return true if washer fluid level is low: low (true), not low: (false)
*/
- attribute Boolean On readonly;
+ attribute Boolean On readonly
}
interface org.automotive.Diagnostic extends VehiclePropertyType {
@@ -1563,27 +1618,27 @@ interface org.automotive.Diagnostic extends VehiclePropertyType {
/*!
* \brief MUST return engine runtime (Unit: seconds)
*/
- attribute UInt32 AccumulatedEngineRuntime readonly;
+ attribute UInt32 AccumulatedEngineRuntime readonly
/*!
- * \brief MUST return distance travelled since the codes were last cleared (Unit: meters)
- */
- attribute UInt32 DistanceSinceCodeCleared readonly;
+ * \brief MUST return distance travelled since the codes were last cleared (Unit: meters)
+ */
+ attribute UInt32 DistanceSinceCodeCleared readonly
/*!
- * \brief MUST return distance travelled with the malfunction indicator light on (Unit: meters)
- */
- attribute UInt32 DistanceWithMILOn readonly;
+ * \brief MUST return distance travelled with the malfunction indicator light on (Unit: meters)
+ */
+ attribute UInt32 DistanceWithMILOn readonly
/*!
- * \brief MUST return time elapsed with the malfunction indicator light on (Unit: seconds)
- */
- attribute UInt32 TimeRunMILOn readonly;
+ * \brief MUST return time elapsed with the malfunction indicator light on (Unit: seconds)
+ */
+ attribute UInt32 TimeRunMILOn readonly
/*!
- * \brief MUST return time elapsed since the trouble codes were last cleared (Unit: seconds)
- */
- attribute UInt32 TimeTroubleCodeClear readonly;
+ * \brief MUST return time elapsed since the trouble codes were last cleared (Unit: seconds)
+ */
+ attribute UInt32 TimeTroubleCodeClear readonly
}
interface org.automotive.Mirror extends VehiclePropertyType {
@@ -1591,12 +1646,12 @@ interface org.automotive.Mirror extends VehiclePropertyType {
/*!
* \brief MUST return mirror pan position in percentage distance travelled, from left to right position (Unit: percentage, %0: center position, -100%: fully left, 100%: fully right)
*/
- attribute UInt8 MirrorPan;
+ attribute UInt8 MirrorPan
/*!
* \brief MUST return mirror tilt position in percentage distance travelled, from downward-facing to upward-facing position (Unit: percentage, 0%:center position, -100%:fully downward, 100%:full upward)
*/
- attribute UInt8 MirrorTilt;
+ attribute UInt8 MirrorTilt
}
interface org.automotive.SeatAdjustment extends VehiclePropertyType {
@@ -1604,32 +1659,32 @@ interface org.automotive.SeatAdjustment extends VehiclePropertyType {
/*!
* \brief MUST return seat back recline position as percent to completely reclined (Unit: percentage, 0%: fully forward, 100%: fully reclined)
*/
- attribute UInt8 ReclineSeatBack;
+ attribute UInt8 ReclineSeatBack
/*!
* \brief MUST return seat slide position as percentage of distance travelled away from forwardmost position (Unit: percentage, 0%: farthest forward, 100%: farthest back)
*/
- attribute UInt8 SeatSlide;
+ attribute UInt8 SeatSlide
/*!
* \brief MUST return seat cushion height position as a percentage of upward distance travelled (Unit: percentage, 0%:lowest. 100%:highest)
*/
- attribute UInt8 SeatCushionHeight;
+ attribute UInt8 SeatCushionHeight
/*!
* \brief MUST return headrest position as a percentage of upward distance travelled (Unit: percentage, 0%: lowest, 100%: highest)
*/
- attribute UInt8 SeatHeadrest;
+ attribute UInt8 SeatHeadrest
/*!
* \brief MUST return back cushion position as a percentage of lumbar curvature (Unit: percentage, 0%: flat, 100%: maximum curvature)
*/
- attribute UInt8 SeatBackCushion;
+ attribute UInt8 SeatBackCushion
/*!
* \brief MUST return sides of back cushion position as a percentage of curvature (Unit: percentage, 0%: flat, 100%: maximum curvature)
*/
- attribute UInt8 SeatSideCushion;
+ attribute UInt8 SeatSideCushion
}
enumeration DriveModeType {
@@ -1639,70 +1694,70 @@ enumeration DriveModeType {
eco = "eco",
manual = "manual",
winter = "winter"
-};
+}
interface org.automotive.DriveMode extends VehiclePropertyType {
/*!
* \brief MUST return vehicle drive mode. See http://w3c.github.io/automotive-bg/data_spec.html#idl-def-DriveModeEnum
*/
- attribute DriveModeType DriveMode;
+ attribute DriveModeType DriveMode
}
interface org.automotive.DashboardIllumination extends VehiclePropertyType {
/*!
* \brief MUST return illumination of dashboard as a percentage (Unit: percentage, 0%: none, 100%: maximum illumination)
*/
- attribute UInt8 DashboardIllumination;
+ attribute UInt8 DashboardIllumination
}
interface org.automotive.VehicleSound extends VehiclePropertyType {
/*!
* \brief MUST return active noise control status: not-activated (false), activated (true)
*/
- attribute Boolean ActiveNoiseControlMode;
+ attribute Boolean ActiveNoiseControlMode
/*!
* \brief MUST return active noise control status: not-activated (false), activated (true)
*/
- attribute Boolean EngineSoundEnhancementMode;
+ attribute Boolean EngineSoundEnhancementMode
/*!
* \brief MUST return array of available sounds. See EngineSoundEnhancementMode
*/
- attribute array EngineSoundEnhancementMode of String readonly;
+ attribute array EngineSoundEnhancementMode of String readonly
}
interface org.automotive.ElectronicStabilityControl extends VehiclePropertyType {
/*!
* \brief MUST return whether or not the ESC Setting is enabled: enabled (true) or disabled (false)
*/
- attribute Boolean Enabled readonly;
+ attribute Boolean Enabled readonly
/*!
* \brief MUST return whether or not the ESC is engaged: engaged (true) or idle (false)
*/
- attribute Boolean Engaged readonly;
+ attribute Boolean Engaged readonly
}
interface org.automotive.TopSpeedLimit extends VehiclePropertyType {
/*!
* \brief MUST return whether or not the ESC Setting is enabled: enabled (true) or disabled (false)
*/
- attribute UInt16 Speed readonly;
+ attribute UInt16 Speed readonly
}
interface org.automotive.ChildSafetyLock extends VehiclePropertyType {
/*!
* \brief MUST return whether or not the Child Safety Lock is locked: locked (true) or unlocked (false)
*/
- attribute Boolean Lock;
+ attribute Boolean Lock
}
enumeration OccupantStatus {
adult = "adult",
child = "child",
vacant = "vacant"
-};
+}
enumeration IdentificationTypeEnum {
pin = "pin",
@@ -1712,73 +1767,73 @@ enumeration IdentificationTypeEnum {
fingerprint = "fingerprint",
camera = "camera",
voice = "voice"
-};
+}
interface org.automotive.Seat extends VehiclePropertyType {
/*!
* \brief MUST return the status of seat occupant
*/
- attribute OccupantStatus Occupant;
+ attribute OccupantStatus Occupant
/*!
* \brief MUST return whether or not the seat belt is fastened: fastened (true) or unfastened (false)
*/
- attribute Boolean SeatBelt;
+ attribute Boolean SeatBelt
/*!
* \brief MUST return occupant identifier
*/
- attribute String OccupantName;
+ attribute String OccupantName
/*!
* \brief MUST return identification type
*/
- attribute IdentificationTypeEnum IdentificationType;
+ attribute IdentificationTypeEnum IdentificationType
}
interface org.automotive.AtmosphericPressure extends VehiclePropertyType {
/*!
* \brief MUST return the current atmospheric pressure outside of the vehicle (Unit: hectopascal)
*/
- attribute UInt16 Pressure;
+ attribute UInt16 Pressure
}
enumeration LaneDepartureStatus {
- off = "off",
- pause = "pause",
- running = "running"
-};
+ off = "off",
+ pause = "pause",
+ running = "running"
+}
interface org.automotive.LaneDepartureDetection extends VehiclePropertyType {
/*!
* \brief MUST return current status of Lane departure warning function.
*/
- attribute LaneDepartureStatus Status readonly;
+ attribute LaneDepartureStatus Status readonly
}
enumeration AlarmStatus {
- disarmed = "disarmed",
- prearmed = "prearmed",
- armed = "armed",
- alarmed = "alarmed"
-};
+ disarmed = "disarmed",
+ prearmed = "prearmed",
+ armed = "armed",
+ alarmed = "alarmed"
+}
interface org.automotive.Alarm extends VehiclePropertyType {
/*!
* \brief MUST return the current status of vehicle Alarm System.
*/
- attribute AlarmStatus Status;
+ attribute AlarmStatus Status
}
enumeration ParkingBrakeStatus {
- inactive = "inactive",
- active = "active",
- error = "error"
-};
+ inactive = "inactive",
+ active = "active",
+ error = "error"
+}
interface org.automotive.ParkingBrake extends VehiclePropertyType {
/*!
* \brief MUST return the current status of vehicle Alarm System.
*/
- attribute ParkingBrakeStatus Status readonly;
+ attribute ParkingBrakeStatus Status readonly
}
diff --git a/docs/dbus.idl b/docs/dbus.idl
deleted file mode 100644
index 519ef9f1..00000000
--- a/docs/dbus.idl
+++ /dev/null
@@ -1,35 +0,0 @@
-/*!
-* \mainpage Automotive Message Broker DBus API Documentation
-*
-* \section intro Introduction
-* AMB organizes the API into two general interface categories. First the Manager interface (see manager.txt)
-* which includes tools for using the other interfaces. Second is a number of interfaces that
-* represent vehicle data. The latter follows the schema of "org.automotive.DataType" and are
-* contained in verious DBus paths. The DBus paths are generally organized by
-* /{source}/{zone}/DataType. "source" refers to the AMB source that produces the data. "zone"
-* refers to the zone in which the data type is located in the vehicle or "0" for no zone.
-*
-* The interfaces and data types are documented in <a href="amb.fidl">amb.fidl</a>. Franca IDL
-* tools can be used to generate DBus introspection xml which can be used to generate bindings
-* for your language of choice. These interfaces types map to internal AMB properties. To understand the mappings,
-* see the <a href="ambdbusmappings_8idl.html">mapping documentation</a>
-*
-* \section basic_usage Basic Recommended Usage
-*
-* It is recommended that the Manager interface be used to find the DBus Object that contains the
-* data type you need. This is done through the FindObject() call. It is expected that DBus
-* Object Paths may change and so it is not appropriate to hard code DBus Object Paths.
-*
-* \section example Usage Example
-* Here is a pseudo-code example of how the api is to be used:
-*
-* \code
-* var manager = dbus.interface("org.automotive.Manager", "/");
-*
-* var speedObjectPaths = manager.FindObject("VehicleSpeed");
-*
-* var speedObject = dbus.interface("org.automotive.VehicleSpeed", speedObjectPaths[0]);
-*
-* console.log("Vehicle Speed: " + speedObject.Speed);
-* \endcode
-*/
diff --git a/docs/images/AMBArchitecture.png b/docs/images/AMBArchitecture.png
new file mode 100644
index 00000000..69a9a077
--- /dev/null
+++ b/docs/images/AMBArchitecture.png
Binary files differ
diff --git a/docs/mainpage.in.idl b/docs/mainpage.in.idl
new file mode 100644
index 00000000..0e29a6f1
--- /dev/null
+++ b/docs/mainpage.in.idl
@@ -0,0 +1,14 @@
+/*!
+* \mainpage Automotive Message Broker Documentation
+* \version @PROJECT_VERSION@
+* \section links AMB Documentation Sections
+* - <a href="../dbus/html/index.html">DBus API documentation</a>
+* - <a href="../amb/html/index.html">libamb internal API documentation</a>
+* - <a href="../plugins/bluemonkey/html/index.html">Bluemonkey Javascript API documentation</a>
+*
+* \section intro Introduction
+* Automotive Message Broker (AMB) is a framework for providing applications with standardized access to vehicle data.
+* It uses a plugin architecture to allow customization for different vehicles and devices. Here is a diagram of how
+* AMB is architected:
+* \image html AMBArchitecture.png
+*/
diff --git a/docs/plugins/bluemonkey/bluemonkey.idl b/docs/plugins/bluemonkey/bluemonkey.idl
new file mode 100644
index 00000000..2029c3c3
--- /dev/null
+++ b/docs/plugins/bluemonkey/bluemonkey.idl
@@ -0,0 +1,156 @@
+/*!
+ * \mainpage Automotive Message Broker Library Documentation - Bluemonkey Plugin
+ * \version 0.12.903
+ * \section intro Introduction
+ * Bluemonkey is a javascript rendering engine that allows the scripting of source plugin behavior in javascript.
+ * It allows developers a quick way to prototype plugin code as well as a way to create custom properties.
+ * \section properties Properties
+ * Bluemonkey uses internal property names (not DBus API interface names). These properties are defined in
+ * lib/vehicleproperty.h. There are mappings from AMB internal property names to DBus API properties in the
+ * <a href="ambdbusmappings_8idl">mappings documentation</a>. The mappings comes in handy when you want to implement properties that are
+ * exported as an DBus API interface (ie, org.automotive.VehicleSpeed).
+ * \section example Example bluemonkey script
+ * \code
+ * var speedProperty = bluemonkey.subscribeTo("VehicleSpeed");
+ *
+ * var testTimer = bluemonkey.createTimer();
+ * testTimer.interval = 3000;
+ * testTimer.singleShot = false;
+ * testTimer.timeout.connect(function() {
+ * //VehicleSpeed
+ * speedProperty.value = Math.floor((Math.random() * 100) + 1);
+ * });
+ * testTimer.start();
+ * \endcode
+ * \section Javascript API documentation
+ * Javascript API documentation is found in bluemonkey.idl and is described using WebIDL. Plugin configuration documentation can be found in bluemonkey.README.
+ */
+
+ /*!
+ * \name automotive-message-broker Bluemonkey interface documentation
+ * \version 0.12.903
+ * \brief the bluemonkey script engine is powered by Qt QML's javascript engine. It supports QObject types as well
+ * as ECMA script (javascript). All QObject properties, slots, and signals are available in javascript.
+ * \see Qt's QMetaObject system for additional details
+ */
+
+/*!
+ * \brief Entry point for bluemonkey
+ */
+partial interface Navigator {
+ readonly attribute Bluemonkey bluemonkey;
+};
+
+/*!
+ * \brief Bluemonkey interface
+ * Bluemonkey provides AMB plugin-like interfaces and allows the loading of other modules, timers, and QObject creation.
+ * Typical usage is such:
+ * \code
+ * var speedProperty = bluemonkey.subscribeTo("VehicleSpeed");
+ * bluemonkey.log("Current speed: " + speedProperty.value);
+ * \endcode
+ */
+interface Bluemonkey {
+ /*!
+ * \brief subscribe to a property
+ * \returns PropertyInterface representing the property
+ */
+ PropertyInterface subscribeTo(DOMString propertyName, optional unsigned short zone, optional DOMString source);
+
+ /*!
+ * \brief return the AMB sources that provide propertyName
+ */
+ DOMString[] sourcesForProperty(DOMString propertyName);
+
+ /*!
+ * \brief returns the available zones that contians propertyName
+ */
+ unsigned short[] zonesForProperty(DOMString propertyName);
+
+ /*!
+ * \brief return supported properties
+ */
+ DOMString[] supportedProperties();
+
+ /*!
+ * \brief load another script
+ */
+ void loadConfig(DOMString configFile);
+
+ /*!
+ * \brief load a bluemonkey module
+ */
+ void loadModule(DOMString moduleFile);
+
+ /*!
+ * \brief log text to AMB output
+ */
+ void log(DOMString text);
+
+ /*!
+ * \brief
+ */
+ QTimer createTimer();
+
+ /*!
+ * \brief
+ */
+ QObject createQObject();
+
+ /*!
+ * \brief return logged data between "begin" and "end"
+ */
+ void getHistory(DOMString[] properties, Date begin, Date end, HistoryCallback callback);
+
+ /*!
+ * \brief
+ */
+ void createCustomProperty(DOMString name, any value, optional unsigned short zone);
+
+};
+
+interface PropertyInterface {
+ /*!
+ * \brief
+ */
+ readonly attribute DOMString type;
+
+ /*!
+ * \brief
+ */
+ readonly attribute unsigned short zone;
+
+ /*!
+ * \brief
+ */
+ readonly attribute any value;
+
+ /*!
+ * \brief
+ */
+ readonly attribute DOMString source;
+
+ /*!
+ * \brief
+ */
+ readonly attribute DOMTimestamp timestamp;
+
+ /*!
+ * \brief
+ */
+ readonly attribute Signal changed;
+
+ void getHistory(Date begin, Date end, HistoryCallback callback);
+};
+
+interface Signal {
+ /*!
+ * \brief
+ */
+ void connect(ChangedCallback callback)
+};
+
+callback ChangedCallback = void(any value); ();
+
+callback HistoryCallback = void(PropertyInterface[] data); ();
+
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index 54cea0b6..f3733fdb 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -1,21 +1,31 @@
-set(amb_examples configwheel databasesource dbusconfig exampleconfig
- gpsnmea obdsourceconfig opencvluxconfig opencvdbusconfig qtmainloopconfig websocketsink2 websocketsource2
- testsourceconfig bluemonkey/bluemonkeyconfig)
+set(amb_examples ${CMAKE_CURRENT_BINARY_DIR}/configwheel
+ ${CMAKE_CURRENT_BINARY_DIR}/databasesource
+ ${CMAKE_CURRENT_BINARY_DIR}/dbusconfig
+ ${CMAKE_CURRENT_BINARY_DIR}/exampleconfig
+ ${CMAKE_CURRENT_BINARY_DIR}/gpsnmea
+ ${CMAKE_CURRENT_BINARY_DIR}/obdsourceconfig
+ ${CMAKE_CURRENT_BINARY_DIR}/opencvluxconfig
+ ${CMAKE_CURRENT_BINARY_DIR}/opencvdbusconfig
+ ${CMAKE_CURRENT_BINARY_DIR}/qtmainloopconfig
+ ${CMAKE_CURRENT_BINARY_DIR}/websocketsink2
+ ${CMAKE_CURRENT_BINARY_DIR}/websocketsource2
+ ${CMAKE_CURRENT_BINARY_DIR}/testsourceconfig
+ ${CMAKE_CURRENT_BINARY_DIR}/bluemonkey/bluemonkeyconfig)
-configure_file (${CMAKE_CURRENT_SOURCE_DIR}/configwheel.in ${CMAKE_CURRENT_SOURCE_DIR}/configwheel @ONLY)
-configure_file (${CMAKE_CURRENT_SOURCE_DIR}/databasesource.in ${CMAKE_CURRENT_SOURCE_DIR}/databasesource @ONLY)
-configure_file (${CMAKE_CURRENT_SOURCE_DIR}/dbusconfig.in ${CMAKE_CURRENT_SOURCE_DIR}/dbusconfig @ONLY)
-configure_file (${CMAKE_CURRENT_SOURCE_DIR}/exampleconfig.in ${CMAKE_CURRENT_SOURCE_DIR}/exampleconfig @ONLY)
-configure_file (${CMAKE_CURRENT_SOURCE_DIR}/gpsnmea.in ${CMAKE_CURRENT_SOURCE_DIR}/gpsnmea @ONLY)
-configure_file (${CMAKE_CURRENT_SOURCE_DIR}/obdsourceconfig.in ${CMAKE_CURRENT_SOURCE_DIR}/obdsourceconfig @ONLY)
-configure_file (${CMAKE_CURRENT_SOURCE_DIR}/opencvluxconfig.in ${CMAKE_CURRENT_SOURCE_DIR}/opencvluxconfig @ONLY)
-configure_file (${CMAKE_CURRENT_SOURCE_DIR}/opencvdbusconfig.in ${CMAKE_CURRENT_SOURCE_DIR}/opencvdbusconfig @ONLY)
-configure_file (${CMAKE_CURRENT_SOURCE_DIR}/qtmainloopconfig.in ${CMAKE_CURRENT_SOURCE_DIR}/qtmainloopconfig @ONLY)
-configure_file (${CMAKE_CURRENT_SOURCE_DIR}/websocketsink2.in ${CMAKE_CURRENT_SOURCE_DIR}/websocketsink2 @ONLY)
-configure_file (${CMAKE_CURRENT_SOURCE_DIR}/websocketsource2.in ${CMAKE_CURRENT_SOURCE_DIR}/websocketsource2 @ONLY)
-configure_file (${CMAKE_CURRENT_SOURCE_DIR}/testsourceconfig.in ${CMAKE_CURRENT_SOURCE_DIR}/testsourceconfig @ONLY)
-configure_file (${CMAKE_CURRENT_SOURCE_DIR}/cangenconfig.in ${CMAKE_CURRENT_SOURCE_DIR}/cangenconfig @ONLY)
-configure_file (${CMAKE_CURRENT_SOURCE_DIR}/bluemonkey/bluemonkeyconfig.in ${CMAKE_CURRENT_SOURCE_DIR}/bluemonkey/bluemonkeyconfig @ONLY)
+configure_file (${CMAKE_CURRENT_SOURCE_DIR}/configwheel.in ${CMAKE_CURRENT_BINARY_DIR}/configwheel @ONLY)
+configure_file (${CMAKE_CURRENT_SOURCE_DIR}/databasesource.in ${CMAKE_CURRENT_BINARY_DIR}/databasesource @ONLY)
+configure_file (${CMAKE_CURRENT_SOURCE_DIR}/dbusconfig.in ${CMAKE_CURRENT_BINARY_DIR}/dbusconfig @ONLY)
+configure_file (${CMAKE_CURRENT_SOURCE_DIR}/exampleconfig.in ${CMAKE_CURRENT_BINARY_DIR}/exampleconfig @ONLY)
+configure_file (${CMAKE_CURRENT_SOURCE_DIR}/gpsnmea.in ${CMAKE_CURRENT_BINARY_DIR}/gpsnmea @ONLY)
+configure_file (${CMAKE_CURRENT_SOURCE_DIR}/obdsourceconfig.in ${CMAKE_CURRENT_BINARY_DIR}/obdsourceconfig @ONLY)
+configure_file (${CMAKE_CURRENT_SOURCE_DIR}/opencvluxconfig.in ${CMAKE_CURRENT_BINARY_DIR}/opencvluxconfig @ONLY)
+configure_file (${CMAKE_CURRENT_SOURCE_DIR}/opencvdbusconfig.in ${CMAKE_CURRENT_BINARY_DIR}/opencvdbusconfig @ONLY)
+configure_file (${CMAKE_CURRENT_SOURCE_DIR}/qtmainloopconfig.in ${CMAKE_CURRENT_BINARY_DIR}/qtmainloopconfig @ONLY)
+configure_file (${CMAKE_CURRENT_SOURCE_DIR}/websocketsink2.in ${CMAKE_CURRENT_BINARY_DIR}/websocketsink2 @ONLY)
+configure_file (${CMAKE_CURRENT_SOURCE_DIR}/websocketsource2.in ${CMAKE_CURRENT_BINARY_DIR}/websocketsource2 @ONLY)
+configure_file (${CMAKE_CURRENT_SOURCE_DIR}/testsourceconfig.in ${CMAKE_CURRENT_BINARY_DIR}/testsourceconfig @ONLY)
+configure_file (${CMAKE_CURRENT_SOURCE_DIR}/cangenconfig.in ${CMAKE_CURRENT_BINARY_DIR}/cangenconfig @ONLY)
+configure_file (${CMAKE_CURRENT_SOURCE_DIR}/bluemonkey/bluemonkeyconfig.in ${CMAKE_CURRENT_BINARY_DIR}/bluemonkey/bluemonkeyconfig @ONLY)
install (FILES ${amb_examples} DESTINATION /etc/ambd/examples)
diff --git a/examples/democonfig b/examples/democonfig
deleted file mode 100644
index 11fc7a5f..00000000
--- a/examples/democonfig
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "sources" : [
- {
- "name" : "WheelSource",
- "path" : "/usr/lib/automotive-message-broker/wheelsourceplugin.so",
- "device" : "/dev/input/js0"
- }
- ],
- "sinks": [
- {
- "name" : "WebSocketSink",
- "path" : "/usr/lib/automotive-message-broker/websocketsinkplugin.so",
- "interface" : "lo"
- } ,
- {
- "path" : "/usr/lib/automotive-message-broker/dbussinkplugin.so"
- },
- {
- "path" : "/usr/lib/automotive-message-broker/demosinkplugin.so",
- "script" : "./rundemo %1"
- }
- ]
-}
-
diff --git a/examples/gpsdconfig b/examples/gpsdconfig
deleted file mode 100644
index 3d6c09df..00000000
--- a/examples/gpsdconfig
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "sources" : [
- {
- "name" : "gpsd plugin",
- "path" : "/usr/lib/automotive-message-broker/gpsdplugin.so",
- "updateVelocity" : "true"
- }
- ],
- "sinks": [
- {
- "path" : "/usr/lib/automotive-message-broker/dbussinkplugin.so"
- }
- ]
-}
-
diff --git a/examples/openxcconfig b/examples/openxcconfig
deleted file mode 100644
index f507c307..00000000
--- a/examples/openxcconfig
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "sources" : [
- {
- "name" : "openxc plugin",
- "path" : "/usr/lib/automotive-message-broker/openxcplugin.so",
- "test" : "true",
- "device" : "10:C6:FC:27:C3:1C",
- "bluetoothAdapter" : ""
- }
- ],
- "sinks": [
- {
- "path" : "/usr/lib/automotive-message-broker/dbussinkplugin.so"
- }
- ]
-}
-
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/lib/asyncqueue.hpp b/lib/asyncqueue.hpp
index 3602bb97..ed0c69b4 100644
--- a/lib/asyncqueue.hpp
+++ b/lib/asyncqueue.hpp
@@ -62,6 +62,9 @@ public:
}
}
+ if(!mQueue.size())
+ throw std::runtime_error("nothing in queue");
+
auto itr = mQueue.begin();
T item = *itr;
@@ -73,9 +76,11 @@ public:
virtual void append(T item)
{
- std::lock_guard<std::mutex> lock(mutex);
+ {
+ std::lock_guard<std::mutex> lock(mutex);
- mQueue.insert(item);
+ mQueue.insert(item);
+ }
if(mBlocking)
{
diff --git a/packaging.in/CMakeLists.txt b/packaging.in/CMakeLists.txt
new file mode 100644
index 00000000..5276ca80
--- /dev/null
+++ b/packaging.in/CMakeLists.txt
@@ -0,0 +1,18 @@
+
+find_program(rpmbuild rpmbuild /usr/bin)
+if(rpmbuild)
+ configure_file (${CMAKE_CURRENT_SOURCE_DIR}/automotive-message-broker.spec.in ${CMAKE_SOURCE_DIR}/packaging/automotive-message-broker.spec @ONLY)
+ configure_file (${CMAKE_CURRENT_SOURCE_DIR}/config.tizen.in ${CMAKE_SOURCE_DIR}/packaging/config.tizen @ONLY)
+ configure_file (${CMAKE_CURRENT_SOURCE_DIR}/automotive-message-broker.changes.in ${CMAKE_SOURCE_DIR}/packaging/automotive-message-broker.changes @ONLY)
+endif(rpmbuild)
+
+find_program(debuild debuild /usr/bin)
+if(debuild)
+ configure_file (${CMAKE_CURRENT_SOURCE_DIR}/debian/control.debian.in ${CMAKE_SOURCE_DIR}/debian/control @ONLY)
+ configure_file (${CMAKE_CURRENT_SOURCE_DIR}/debian/libamb.debian.install ${CMAKE_SOURCE_DIR}/debian/libamb.install @ONLY)
+ configure_file (${CMAKE_CURRENT_SOURCE_DIR}/debian/libamb-dev.debian.install ${CMAKE_SOURCE_DIR}/debian/libamb-dev.install @ONLY)
+ configure_file (${CMAKE_CURRENT_SOURCE_DIR}/debian/automotive-message-broker.debian.install ${CMAKE_SOURCE_DIR}/debian/automotive-message-broker.install @ONLY)
+ configure_file (${CMAKE_CURRENT_SOURCE_DIR}/debian/automotive-message-broker-plugins.debian.install ${CMAKE_SOURCE_DIR}/debian/automotive-message-broker-plugins.install @ONLY)
+ configure_file (${CMAKE_CURRENT_SOURCE_DIR}/debian/changelog ${CMAKE_SOURCE_DIR}/debian/changelog @ONLY)
+ configure_file (${CMAKE_CURRENT_SOURCE_DIR}/debian/rules ${CMAKE_SOURCE_DIR}/debian/rules @ONLY)
+endif(debuild)
diff --git a/packaging/automotive-message-broker.changes b/packaging.in/automotive-message-broker.changes.in
index 74722e89..74722e89 100644
--- a/packaging/automotive-message-broker.changes
+++ b/packaging.in/automotive-message-broker.changes.in
diff --git a/packaging/automotive-message-broker.spec.in b/packaging.in/automotive-message-broker.spec.in
index 6db8792d..1ad1cf76 100644
--- a/packaging/automotive-message-broker.spec.in
+++ b/packaging.in/automotive-message-broker.spec.in
@@ -12,9 +12,8 @@ Requires: automotive-message-broker-plugins
Requires: automotive-message-broker-plugins-murphy
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
-
-Requires: default-ac-domains
-Requires: dbus-python
+Requires: default-ac-domains
+Requires: dbus-python
Requires: python-curses
Requires: python-gobject
BuildRequires: cmake
@@ -220,24 +219,24 @@ Crosswalk vehicle API extension based on the W3C Automotive Business Group Vehic
%build
%cmake \
- -Dxwalk_vehicle_extension=ON \
- -DXWALK_EXTENSION_PATH=/tizen-extensions-crosswalk \
+ -Dxwalk_vehicle_extension=ON \
+ -DXWALK_EXTENSION_PATH=/tizen-extensions-crosswalk \
%if %{with qt5}
- -Dqtmainloop=ON \
- -Dopencvlux_plugin=ON \
- -Dwebsocket_plugin=ON \
- -Dbluetooth_plugin=ON \
- -Dbluemonkey_plugin=ON \
+ -Dqtmainloop=ON \
+ -Dopencvlux_plugin=ON \
+ -Dwebsocket_plugin=ON \
+ -Dbluetooth_plugin=ON \
+ -Dbluemonkey_plugin=ON \
%endif
- -Ddatabase_plugin=ON \
- -Dmurphy_plugin=ON \
- -Dobd2_plugin=ON \
- -Dtest_plugin=ON \
- -Dgpsnmea_plugin=ON \
- -Dcangen_plugin=ON \
- -Dcansim_plugin=ON \
- -Dusebluez5=ON \
- -Denable_docs=ON
+ -Ddatabase_plugin=ON \
+ -Dmurphy_plugin=ON \
+ -Dobd2_plugin=ON \
+ -Dtest_plugin=ON \
+ -Dgpsnmea_plugin=ON \
+ -Dcangen_plugin=ON \
+ -Dcansim_plugin=ON \
+ -Dusebluez5=ON \
+ -Denable_docs=ON
%__make %{?jobs:-j%jobs}
@@ -251,7 +250,7 @@ cp packaging.in/ambd.service.systemd.tizen %{buildroot}%{_unitdir}/ambd.service
ln -s ../ambd.service %{buildroot}%{_unitdir}/network.target.wants/ambd.service
%install_service multi-user.target.wants ambd.service
-cp packaging.in/config.tizen %{buildroot}%{_sysconfdir}/ambd/
+cp packaging/config.tizen %{buildroot}%{_sysconfdir}/ambd/
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
diff --git a/packaging.in/config.tizen.in b/packaging.in/config.tizen.in
index 77cbb110..e299cb3b 100644
--- a/packaging.in/config.tizen.in
+++ b/packaging.in/config.tizen.in
@@ -1,18 +1,14 @@
{
- "sources" : [
+"sources" :
+ [
{
- "name" : "Murphy Source",
- "path" : "@PLUGIN_INSTALL_PATH@/murphysourceplugin.so",
- "address" : "unxs:/tmp/murphy/amb"
- },
- {
- "name" : "VehicleSource",
- "path" : "@PLUGIN_INSTALL_PATH@/vehicleplugin.so",
- "configfile" : "/etc/ambd/AMBformat.conf"
- }
-
+ "name" : "Murphy Source",
+ "path" : "@PLUGIN_INSTALL_PATH@/murphysourceplugin.so",
+ "address" : "unxs:/tmp/murphy/amb"
+ }
],
- "sinks": [
+"sinks":
+ [
{
"name" : "DBusSink",
"path" : "@PLUGIN_INSTALL_PATH@/dbussinkplugin.so"
diff --git a/packaging.in/debian/automotive-message-broker-plugins.debian.install b/packaging.in/debian/automotive-message-broker-plugins.debian.install
new file mode 100644
index 00000000..3253b6b3
--- /dev/null
+++ b/packaging.in/debian/automotive-message-broker-plugins.debian.install
@@ -0,0 +1,5 @@
+debian/tmp/@PLUGIN_INSTALL_PATH@/examplesourceplugin.so
+debian/tmp/@PLUGIN_INSTALL_PATH@/examplesinkplugin.so
+debian/tmp/@PLUGIN_INSTALL_PATH@/dbussinkplugin.so
+debian/tmp/@PLUGIN_INSTALL_PATH@/demosinkplugin.so
+debian/tmp/etc/dbus-1/system.d/amb.conf
diff --git a/packaging.in/debian/automotive-message-broker.debian.install b/packaging.in/debian/automotive-message-broker.debian.install
new file mode 100644
index 00000000..99738b44
--- /dev/null
+++ b/packaging.in/debian/automotive-message-broker.debian.install
@@ -0,0 +1,3 @@
+debian/tmp/usr/bin/ambd
+debian/tmp/usr/bin/ambctl
+debian/tmp/etc/ambd/config
diff --git a/packaging.in/debian/changelog b/packaging.in/debian/changelog
new file mode 100644
index 00000000..365f092a
--- /dev/null
+++ b/packaging.in/debian/changelog
@@ -0,0 +1,5 @@
+automotive-message-broker (@PROJECT_VERSION@) utopic; urgency=low
+
+ * @PROJECT_VERSION@ release
+
+ -- Kevron Rees <tripzero.kev@gmail.com> Tue, 30 Dec 2014 15:17:51 -0700
diff --git a/packaging.in/debian/control.debian.in b/packaging.in/debian/control.debian.in
new file mode 100644
index 00000000..6a2c5df4
--- /dev/null
+++ b/packaging.in/debian/control.debian.in
@@ -0,0 +1,41 @@
+Source: automotive-message-broker
+Section: Utilities
+Priority: extra
+Maintainer: Kevron Rees <tripzero.kev@gmail.com>
+Build-Depends: build-essential, debhelper (>= 8.0.0), cdbs, pkg-config, libltdl-dev, cmake, libboost-dev, uuid-dev, libjson-c-dev, libglib2.0-dev
+Standards-Version: 3.9.2
+Homepage: https://01.org/automotive-message-broker
+Vcs-Git: git@github.com:otcshare/automotive-message-broker.git
+Vcs-Browser: http://github.com/otcshare/automotive-message-broker.git
+
+Package: libamb
+Architecture: i386
+Version: @PROJECT_VERSION@
+Depends: ${shlibs:Depends}, ${misc:Despends}
+Description: Supporting amb library
+
+Package: libamb-dev
+Section: devel
+Architecture: i386
+Version: @PROJECT_VERSION@
+Depends: libamb, uuid-dev, libjson-c-dev
+Description: Vehicle data abstraction and multiplexing daemon
+ Vehicle data abstraction and multiplexing plugin framework
+ which provides a communications interface to CAN, OBDII and GPS devices using
+ TCP, bluetooth or USB
+
+Package: automotive-message-broker
+Architecture: i386
+Version: @PROJECT_VERSION@
+Depends: ${shlibs:Depends}, ${misc:Depends}, libamb
+Description: Vehicle data abstraction and multiplexing daemon
+ Vehicle data abstraction and multiplexing daemon implemented as
+ plugin framework that communicates to OBDII and GPS devices
+
+Package: automotive-message-broker-plugins
+Architecture: i386
+Version: @PROJECT_VERSION@
+Depends: ${shlibs:Depends}, ${misc:Depends}, libamb
+Description: Vehicle data abstraction and multiplexing daemon
+ Vehicle data abstraction and multiplexing daemon implemented as
+ plugin framework that communicates to OBDII and GPS devices
diff --git a/packaging.in/debian/libamb-dev.debian.install b/packaging.in/debian/libamb-dev.debian.install
new file mode 100644
index 00000000..455bf20a
--- /dev/null
+++ b/packaging.in/debian/libamb-dev.debian.install
@@ -0,0 +1,3 @@
+debian/tmp/@INCLUDE_INSTALL_DIR@/amb/*.h
+debian/tmp/@INCLUDE_INSTALL_DIR@/amb/*.hpp
+debian/tmp/@LIB_INSTALL_DIR@/pkgconfig/*.pc
diff --git a/packaging.in/debian/libamb.debian.install b/packaging.in/debian/libamb.debian.install
new file mode 100644
index 00000000..53f200d8
--- /dev/null
+++ b/packaging.in/debian/libamb.debian.install
@@ -0,0 +1 @@
+debian/tmp/@LIB_INSTALL_DIR@/libamb.so*
diff --git a/packaging.in/debian/rules b/packaging.in/debian/rules
new file mode 100755
index 00000000..b5f12a4a
--- /dev/null
+++ b/packaging.in/debian/rules
@@ -0,0 +1,19 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+export DH_VERBOSE=1
+
+# in template file --AC
+#%:
+# dh $@
+
+#all the rest copied from trip0's libobd debian/rules file --AC
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/class/cmake.mk
+
diff --git a/packaging/CMakeLists.txt b/packaging/CMakeLists.txt
deleted file mode 100644
index cdadb9be..00000000
--- a/packaging/CMakeLists.txt
+++ /dev/null
@@ -1 +0,0 @@
-configure_file (${CMAKE_CURRENT_SOURCE_DIR}/automotive-message-broker.spec.in ${CMAKE_CURRENT_SOURCE_DIR}/automotive-message-broker.spec @ONLY)
diff --git a/packaging/automotive-message-broker.spec b/packaging/automotive-message-broker.spec
index 559fae63..6e3d5ac7 100644
--- a/packaging/automotive-message-broker.spec
+++ b/packaging/automotive-message-broker.spec
@@ -2,7 +2,7 @@
Name: automotive-message-broker
Summary: Automotive Message Broker is a vehicle network abstraction system
-Version: 0.12.902
+Version: 0.12.903
Release: 0
Group: Automotive/Service
License: LGPL-2.1
@@ -12,9 +12,10 @@ Requires: automotive-message-broker-plugins
Requires: automotive-message-broker-plugins-murphy
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
-
-Requires: default-ac-domains
-Requires: dbus-python
+Requires: default-ac-domains
+Requires: dbus-python
+Requires: python-curses
+Requires: python-gobject
BuildRequires: cmake
BuildRequires: boost-devel
BuildRequires: pkgconfig(json)
@@ -218,24 +219,24 @@ Crosswalk vehicle API extension based on the W3C Automotive Business Group Vehic
%build
%cmake \
- -Dxwalk_vehicle_extension=ON \
- -DXWALK_EXTENSION_PATH=/tizen-extensions-crosswalk \
+ -Dxwalk_vehicle_extension=ON \
+ -DXWALK_EXTENSION_PATH=/tizen-extensions-crosswalk \
%if %{with qt5}
- -Dqtmainloop=ON \
- -Dopencvlux_plugin=ON \
- -Dwebsocket_plugin=ON \
- -Dbluetooth_plugin=ON \
- -Dbluemonkey_plugin=ON \
+ -Dqtmainloop=ON \
+ -Dopencvlux_plugin=ON \
+ -Dwebsocket_plugin=ON \
+ -Dbluetooth_plugin=ON \
+ -Dbluemonkey_plugin=ON \
%endif
- -Ddatabase_plugin=ON \
- -Dmurphy_plugin=ON \
- -Dobd2_plugin=ON \
- -Dtest_plugin=ON \
- -Dgpsnmea_plugin=ON \
- -Dcangen_plugin=ON \
- -Dcansim_plugin=ON \
- -Dusebluez5=ON \
- -Denable_docs=ON
+ -Ddatabase_plugin=ON \
+ -Dmurphy_plugin=ON \
+ -Dobd2_plugin=ON \
+ -Dtest_plugin=ON \
+ -Dgpsnmea_plugin=ON \
+ -Dcangen_plugin=ON \
+ -Dcansim_plugin=ON \
+ -Dusebluez5=ON \
+ -Denable_docs=ON
%__make %{?jobs:-j%jobs}
@@ -249,7 +250,7 @@ cp packaging.in/ambd.service.systemd.tizen %{buildroot}%{_unitdir}/ambd.service
ln -s ../ambd.service %{buildroot}%{_unitdir}/network.target.wants/ambd.service
%install_service multi-user.target.wants ambd.service
-cp packaging.in/config.tizen %{buildroot}%{_sysconfdir}/ambd/
+cp packaging/config.tizen %{buildroot}%{_sysconfdir}/ambd/
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
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..bde4e189 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)
@@ -63,7 +66,7 @@ if(enable_docs)
find_package(Doxygen)
if(DOXYGEN_FOUND)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
- add_custom_target(bluemonkey_docs ALL ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ add_custom_target(bluemonkey_docs ALL ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating Bluemonkey javascript API documentation with Doxygen" VERBATIM)
#generate mappings documentation
@@ -72,8 +75,7 @@ if(enable_docs)
COMMENT "running genmapping")
add_dependencies(bluemonkey_docs genmappings_bluemonkey)
- install (DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/html DESTINATION ${DOC_INSTALL_DIR}/plugins/bluemonkey COMPONENT Docs)
- install (DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/latex DESTINATION ${DOC_INSTALL_DIR}/plugins/bluemonkey COMPONENT Docs)
+ install (DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION ${DOC_INSTALL_DIR}/plugins/bluemonkey COMPONENT Docs)
endif(DOXYGEN_FOUND)
endif(enable_docs)
diff --git a/plugins/bluemonkey/Doxyfile.in b/plugins/bluemonkey/Doxyfile.in
index 2a9ada12..ee0e2735 100644
--- a/plugins/bluemonkey/Doxyfile.in
+++ b/plugins/bluemonkey/Doxyfile.in
@@ -1,3 +1,4 @@
PROJECT_NAME = @PROJECT_NAME@
PROJECT_NUMBER = @PROJECT_VERSION@
+GENERATE_LATEX = NO
INPUT = @CMAKE_CURRENT_BINARY_DIR@/docs/
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/bluemonkey/bluemonkey.in.idl b/plugins/bluemonkey/bluemonkey.in.idl
index 4cef21f2..5d3b5a79 100644
--- a/plugins/bluemonkey/bluemonkey.in.idl
+++ b/plugins/bluemonkey/bluemonkey.in.idl
@@ -4,6 +4,7 @@
* \section intro Introduction
* Bluemonkey is a javascript rendering engine that allows the scripting of source plugin behavior in javascript.
* It allows developers a quick way to prototype plugin code as well as a way to create custom properties.
+ *
* \section properties Properties
* Bluemonkey uses internal property names (not DBus API interface names). These properties are defined in
* lib/vehicleproperty.h. There are mappings from AMB internal property names to DBus API properties in the
@@ -20,12 +21,14 @@
* //VehicleSpeed
* speedProperty.value = Math.floor((Math.random() * 100) + 1);
* });
+ * testTimer.start();
* \endcode
* \section Javascript API documentation
* Javascript API documentation is found in bluemonkey.idl and is described using WebIDL. Plugin configuration documentation can be found in bluemonkey.README.
*/
/*!
+ * \file bluemonkey.idl
* \name @PROJECT_NAME@ Bluemonkey interface documentation
* \version @PROJECT_VERSION@
* \brief the bluemonkey script engine is powered by Qt QML's javascript engine. It supports QObject types as well
@@ -33,11 +36,22 @@
* \see Qt's QMetaObject system for additional details
*/
-
+/*!
+ * \brief Entry point for bluemonkey
+ */
partial interface Navigator {
readonly attribute Bluemonkey bluemonkey;
};
+/*!
+ * \brief Bluemonkey interface
+ * Bluemonkey provides AMB plugin-like interfaces and allows the loading of other modules, timers, and QObject creation.
+ * Typical usage is such:
+ * \code
+ * var speedProperty = bluemonkey.subscribeTo("VehicleSpeed");
+ * bluemonkey.log("Current speed: " + speedProperty.value);
+ * \endcode
+ */
interface Bluemonkey {
/*!
* \brief subscribe to a property
@@ -76,12 +90,12 @@ interface Bluemonkey {
void log(DOMString text);
/*!
- * \brief
+ * \brief create a QTimer
*/
QTimer createTimer();
/*!
- * \brief
+ * \brief create a QObject
*/
QObject createQObject();
@@ -91,7 +105,7 @@ interface Bluemonkey {
void getHistory(DOMString[] properties, Date begin, Date end, HistoryCallback callback);
/*!
- * \brief
+ * \brief creates a custom property
*/
void createCustomProperty(DOMString name, any value, optional unsigned short zone);
@@ -99,41 +113,45 @@ interface Bluemonkey {
interface PropertyInterface {
/*!
- * \brief
+ * \brief type AMB property name
*/
readonly attribute DOMString type;
/*!
- * \brief
+ * \brief zone in the vehicle where this property is located
*/
readonly attribute unsigned short zone;
/*!
- * \brief
+ * \brief value of the property
*/
readonly attribute any value;
/*!
- * \brief
+ * \brief source plugin UUID for this property
*/
readonly attribute DOMString source;
/*!
- * \brief
+ * \brief timestamp when this property last changed
*/
readonly attribute DOMTimestamp timestamp;
/*!
- * \brief
+ * \brief changed signal
*/
readonly attribute Signal changed;
void getHistory(Date begin, Date end, HistoryCallback callback);
};
+/*!
+* \brief Signal represents an way to connect to Qt signals and get a javascript callback
+*/
interface Signal {
/*!
- * \brief
+ * \brief connect to this signal.
+ * callback will be called whenever the signal is emitted.
*/
void connect(ChangedCallback callback)
};
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/database/databasesink.cpp b/plugins/database/databasesink.cpp
index 9bfe5b25..b2a3ba9b 100644
--- a/plugins/database/databasesink.cpp
+++ b/plugins/database/databasesink.cpp
@@ -22,7 +22,7 @@ static void * cbFunc(Shared* shared)
{
if(!shared)
{
- throw std::runtime_error("Could not cast shared object.");
+ throw std::runtime_error("Could not get shared object.");
}
///new tripID:
@@ -61,7 +61,7 @@ static void * cbFunc(Shared* shared)
insertList.push_back(dict);
- if(insertList.size() > bufferLength)
+ if(insertList.size() >= bufferLength)
{
shared->db->exec("BEGIN IMMEDIATE TRANSACTION");
for(int i=0; i< insertList.size(); i++)
@@ -175,6 +175,7 @@ DatabaseSink::DatabaseSink(AbstractRoutingEngine *engine, map<std::string, std::
if(config.find("startOnLoad")!= config.end())
{
+ DebugOut() << "start on load? " << config["startOnLoad"] << endl;
databaseLogging->setValue(config["startOnLoad"] == "true");
}
@@ -247,6 +248,8 @@ void DatabaseSink::parseConfig()
void DatabaseSink::stopDb()
{
+ databaseLogging->setValue(false);
+
if(!shared)
return;
@@ -259,19 +262,21 @@ void DatabaseSink::stopDb()
delete shared;
shared = NULL;
+
+ routingEngine->updateProperty(databaseLogging.get(), source.uuid());
}
void DatabaseSink::startDb()
{
if(playback->value<bool>())
{
- DebugOut(0)<<"ERROR: tried to start logging during playback. Only logging or playback can be used at one time"<<endl;
+ DebugOut(DebugOut::Error)<<"ERROR: tried to start logging during playback. Only logging or playback can be used at one time"<<endl;
return;
}
if(shared)
{
- DebugOut(0)<<"WARNING: logging already started. doing nothing."<<endl;
+ DebugOut(DebugOut::Warning)<<"WARNING: logging already started. doing nothing."<<endl;
return;
}
@@ -281,6 +286,9 @@ void DatabaseSink::startDb()
thread->detach();
thread = amb::make_unique(new std::thread(cbFunc, shared));
+
+ databaseLogging->setValue(true);
+ routingEngine->updateProperty(databaseLogging.get(), source.uuid());
}
void DatabaseSink::startPlayback()
@@ -296,9 +304,7 @@ void DatabaseSink::startPlayback()
vector<vector<string> > results = shared->db->select("SELECT * FROM "+tablename);
- /// we are done with shared. clean up:
- delete shared;
- shared = NULL;
+ stopDb();
if(playbackShared)
{
@@ -339,6 +345,9 @@ void DatabaseSink::initDb()
void DatabaseSink::setDatabaseFileName(string filename)
{
+ bool isLogging = databaseLogging->value<bool>();
+
+ stopDb();
initDb();
vector<vector<string> > supportedStr = shared->db->select("SELECT DISTINCT key, zone, source FROM " + tablename);
@@ -360,8 +369,11 @@ void DatabaseSink::setDatabaseFileName(string filename)
}
}
- delete shared;
- shared = NULL;
+ if(isLogging)
+ {
+ stopDb();
+ startDb();
+ }
routingEngine->updateSupported(supported(), PropertyList(), &source);
}
@@ -404,6 +416,8 @@ void DatabaseSink::init()
setDatabaseFileName(configuration["databaseFile"]);
}
+ DebugOut() << "databaseLogging: " << databaseLogging->value<bool>() << endl;
+
routingEngine->updateSupported(supported(), PropertyList(), &source);
}
@@ -487,13 +501,13 @@ void DatabaseSink::getRangePropertyAsync(AsyncRangePropertyReply *reply)
delete db;
}
-AsyncPropertyReply *DatabaseSink::setProperty(AsyncSetPropertyRequest request)
+AsyncPropertyReply *DatabaseSink::setProperty(const AsyncSetPropertyRequest &request)
{
AsyncPropertyReply* reply = AmbPluginImpl::setProperty(request);
if(request.property == DatabaseLogging)
{
- if(request.value->value<bool>())
+ if(databaseLogging->value<bool>())
{
startDb();
}
@@ -508,7 +522,7 @@ AsyncPropertyReply *DatabaseSink::setProperty(AsyncSetPropertyRequest request)
}
else if( request.property == DatabasePlayback)
{
- if(request.value->value<bool>())
+ if(playback->value<bool>())
{
startPlayback();
}
diff --git a/plugins/database/databasesink.h b/plugins/database/databasesink.h
index 2e9709d9..8976f416 100644
--- a/plugins/database/databasesink.h
+++ b/plugins/database/databasesink.h
@@ -151,7 +151,7 @@ public:
///source role:
virtual void getRangePropertyAsync(AsyncRangePropertyReply *reply);
- virtual AsyncPropertyReply * setProperty(AsyncSetPropertyRequest request);
+ virtual AsyncPropertyReply * setProperty(const AsyncSetPropertyRequest & request);
virtual void subscribeToPropertyChanges(VehicleProperty::Property property);
virtual void unsubscribeToPropertyChanges(VehicleProperty::Property property);
int supportedOperations() const { return AbstractSource::GetRanged | AbstractSource::Get | AbstractSource::Set;}
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..f4c575c1 100644
--- a/plugins/dbus/abstractdbusinterface.cpp
+++ b/plugins/dbus/abstractdbusinterface.cpp
@@ -55,7 +55,7 @@ const uint getPid(const char *owner)
if(error)
{
- throw std::runtime_error(error->message);
+ DebugOut(DebugOut::Error)<< error->message << endl;
}
uint thePid=0;
@@ -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/gpsnmea/gpsnmea.cpp b/plugins/gpsnmea/gpsnmea.cpp
index 695e15df..494535eb 100644
--- a/plugins/gpsnmea/gpsnmea.cpp
+++ b/plugins/gpsnmea/gpsnmea.cpp
@@ -577,6 +577,7 @@ void GpsNmeaSource::test()
location.parse("GPRMC,061211,A,2351.9605,S,15112.5239,E,000.0,053.4,170303,009.9,E*6E");
DebugOut(0)<<"lat: "<<location.latitude()->toString()<<endl;
+ DebugOut(0)<<"time: "<<location.gpsTime()->toString()<<endl;
g_assert(location.latitude()->toString() == "-23.86600833");
g_assert(location.gpsTime()->toString() == "1050585131");
@@ -641,6 +642,7 @@ bool GpsNmeaSource::tryParse(string data)
{
if(checksum(line))
{
+ DebugOut(7) << "checksome checks out for: " << line << endl;
buffer = line;
}
else
@@ -652,7 +654,7 @@ bool GpsNmeaSource::tryParse(string data)
if(pos != std::string::npos && pos != 0)
{
- ///Throw the incomplete stuff away. if it doesn't begin with "G" it'll never be complete
+ DebugOut(7) << "Throwing the incomplete stuff away. if it doesn't begin with 'G'' it'll never be complete: " << buffer << endl;
buffer = buffer.substr(pos);
}
@@ -668,10 +670,10 @@ bool GpsNmeaSource::tryParse(string data)
{
if(pos == 0 )
{
- uint cs = buffer.find('*');
+ std::string::size_type cs = buffer.find('*');
if (cs != std::string::npos && cs != buffer.length()-1)
{
- ///This means we have a false flag somewhere.
+ DebugOut(7) << "false flag somewhere: "<< cs << " " << buffer << endl;
buffer = buffer.substr(cs+(buffer.length() - cs));
}
}
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/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 36d50cf8..ab924e20 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -6,7 +6,7 @@ configure_file (${CMAKE_CURRENT_SOURCE_DIR}/amb-get.py ${CMAKE_CURRENT_BINARY_DI
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/amb-set.py ${CMAKE_CURRENT_BINARY_DIR}/amb-set @ONLY)
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/amb-get-history.py ${CMAKE_CURRENT_BINARY_DIR}/amb-get-history @ONLY)
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/amb-listen.py ${CMAKE_CURRENT_BINARY_DIR}/amb-listen @ONLY)
-configure_file (${CMAKE_CURRENT_SOURCE_DIR}/gen-set.py ${CMAKE_CURRENT_SOURCE_DIR}/gen-set @ONLY)
+configure_file (${CMAKE_CURRENT_SOURCE_DIR}/gen-set.py ${CMAKE_CURRENT_BINARY_DIR}/gen-set @ONLY)
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/gendb.sh ${CMAKE_CURRENT_SOURCE_DIR}/gendb @ONLY)
install (PROGRAMS ${amb_tests} DESTINATION bin)
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
index 32f49b9f..2d1e6029 100644
--- a/tools/CMakeLists.txt
+++ b/tools/CMakeLists.txt
@@ -1,4 +1,4 @@
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/genmapping.py ${CMAKE_CURRENT_SOURCE_DIR}/genmapping @ONLY)
-configure_file (${CMAKE_CURRENT_SOURCE_DIR}/ambctl.py ${CMAKE_CURRENT_SOURCE_DIR}/ambctl @ONLY)
+configure_file (${CMAKE_CURRENT_SOURCE_DIR}/ambctl.py ${CMAKE_CURRENT_BINARY_DIR}/ambctl @ONLY)
-install (PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/ambctl DESTINATION bin)
+install (PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/ambctl DESTINATION bin)
diff --git a/tools/ambctl.py b/tools/ambctl.py
index c49cbc31..3d79a7fe 100644
--- a/tools/ambctl.py
+++ b/tools/ambctl.py
@@ -11,15 +11,26 @@ import glib
import curses.ascii
from dbus.mainloop.glib import DBusGMainLoop
+class bcolors:
+ HEADER = '\x1b[95m'
+ OKBLUE = '\x1b[94m'
+ OKGREEN = '\x1b[92m'
+ WARNING = '\x1b[93m'
+ FAIL = '\x1b[91m'
+ ENDC = '\x1b[0m'
+ GREEN = '\x1b[32m'
+ WHITE = '\x1b[37m'
+ BLUE = '\x1b[34m'
+
def help():
help = ("Available commands:\n"
- "help Prints help data\n"
- "list List supported ObjectNames\n"
- "get Get properties from an ObjectName\n"
- "listen Listen for changes on an ObjectName\n"
- "set Set a property for an ObjectName\n"
- "getHistory Get logged data within a time range\n"
- "quit Exit ambctl\n")
+ +bcolors.HEADER+ "help" +bcolors.WHITE+ " Prints help data\n"
+ +bcolors.HEADER+ "list" +bcolors.WHITE+ " List supported ObjectNames\n"
+ +bcolors.HEADER+ "get" +bcolors.WHITE+ " Get properties from an ObjectName\n"
+ +bcolors.HEADER+ "listen" +bcolors.WHITE+ " Listen for changes on an ObjectName\n"
+ +bcolors.HEADER+ "set" +bcolors.WHITE+ " Set a property for an ObjectName\n"
+ +bcolors.HEADER+ "getHistory" +bcolors.WHITE+ " Get logged data within a time range\n"
+ +bcolors.HEADER+ "quit" +bcolors.WHITE+ " Exit ambctl\n")
return help
def changed(interface, properties, invalidated):
@@ -58,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
@@ -74,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
@@ -89,6 +104,8 @@ def processCommand(command, commandArgs, noMain=True):
object = managerInterface.FindObjectForZone(objectName, zone)
propertiesInterface = dbus.Interface(bus.get_object("org.automotive.message.broker", object),"org.freedesktop.DBus.Properties")
property = propertiesInterface.Get("org.automotive."+objectName, propertyName)
+ if property.__class__ == dbus.Boolean:
+ value = value.lower() == "true"
realValue = property.__class__(value)
propertiesInterface.Set("org.automotive."+objectName, propertyName, realValue)
property = propertiesInterface.Get("org.automotive."+objectName, propertyName)
@@ -98,22 +115,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)
@@ -123,14 +142,20 @@ def processCommand(command, commandArgs, noMain=True):
-parser = argparse.ArgumentParser(description='Process DBus mappings.')
+parser = argparse.ArgumentParser(prog="ambctl", description='Process DBus mappings.', add_help=False)
parser.add_argument('command', metavar='COMMAND [help]', nargs='?', default='stdin', help='amb dbus command')
-
parser.add_argument('commandArgs', metavar='ARG', nargs='*',
help='amb dbus command arguments')
+parser.add_argument('-h', '--help', help='print help', action='store_true')
args = parser.parse_args()
+if args.help:
+ parser.print_help()
+ print
+ print help()
+ sys.exit()
+
if args.command == "stdin":
class Data:
history = []
@@ -211,19 +236,6 @@ if args.command == "stdin":
self.set("")
templist = ""
-
-
- class bcolors:
- HEADER = '\x1b[95m'
- OKBLUE = '\x1b[94m'
- OKGREEN = '\x1b[92m'
- WARNING = '\x1b[93m'
- FAIL = '\x1b[91m'
- ENDC = '\x1b[0m'
- GREEN = '\x1b[32m'
- WHITE = '\x1b[37m'
- BLUE = '\x1b[34m'
-
def erase_line():
sys.stdout.write('\x1b[2K\x1b[80D')
@@ -288,7 +300,9 @@ if args.command == "stdin":
print ""
words = data.line.split(' ')
if words[0] == "quit":
- sys.exit()
+ termios.tcsetattr(fd, termios.TCSAFLUSH, old)
+ fcntl.fcntl(fd, fcntl.F_SETFL, oldflags)
+ sys.exit()
try:
if len(words) > 1:
processCommand(words[0], words[1:])
@@ -335,7 +349,10 @@ if args.command == "stdin":
finally:
termios.tcsetattr(fd, termios.TCSAFLUSH, old)
fcntl.fcntl(fd, fcntl.F_SETFL, oldflags)
+ sys.exit()
else:
- processCommand(args.command, args.commandArgs, False)
-
+ try:
+ processCommand(args.command, args.commandArgs, False)
+ except dbus.exceptions.DBusException, error:
+ print error
diff --git a/xwalk/vehicle.html b/xwalk/vehicle.html
index dd8961a3..cd875030 100644
--- a/xwalk/vehicle.html
+++ b/xwalk/vehicle.html
@@ -1,3 +1,4 @@
+<!DOCTYPE text/html>
<html>
<h1>Hello,Vehicle API!</h1>
@@ -15,35 +16,30 @@ function get(objName) {
return;
}
+ getSuccess = function(data) {
+ try {
+ debug("get " + objName + ": " + JSON.stringify(data));
+ } catch(error) {
+ debug("error " + error.message);
+ }
+ }
+
+ getError = function(error) {
+ debug("error getting " + objName + ": " + error.message);
+ }
+
var zones = vehicle[objName].zones;
+
if(zones.length !== 0)
{
for(var zone in zones)
{
- vehicle[objName].get(zone).then(function(data) {
- try {
- debug("get " + objName + ": " + JSON.stringify(data));
- } catch(error) {
- debug("error " + error.message);
- }
- },
- function(error) {
- debug("error getting " + objName + ": " + error.message);
- });
+ vehicle[objName].get(zone).then(getSuccess, getError);
}
}
else
{
- vehicle[objName].get().then(function(data) {
- try {
- debug("get " + objName + ": " + JSON.stringify(data));
- } catch(error) {
- debug("error " + error.message);
- }
- },
- function(error) {
- debug("error getting " + objName + ": " + error.message);
- });
+ vehicle[objName].get().then(getSuccess, getError);
}
}