From 3e94024998c1615bd30306aab7537db22161a9ce Mon Sep 17 00:00:00 2001 From: Matt Ranostay Date: Sat, 19 Oct 2019 13:45:11 -0700 Subject: [PATCH] binding: navigation: rewrite of navigation binding To remove dependency on DBus the binding needed to be rewritten to output pure JSON output to subscribed consumers. Bug-AGL: SPEC-2880 Change-Id: Ie85dfccd42ca36119116a0fbfb16bf4e96efc184 Signed-off-by: Matt Ranostay --- CMakeLists.txt | 85 +- README.md | 64 +- autobuild/agl/autobuild | 4 +- autobuild/linux/autobuild | 30 +- binding/CMakeLists.txt | 35 + binding/navigation-api.c | 245 ++++++ binding/navigation-api.h | 53 ++ conf.d/cmake/config.cmake | 167 ++++ conf.d/wgt/config.xml.in | 22 + config.xml.in | 19 - include/analyze_request.h | 31 - include/binder_reply.h | 34 - include/genivi/genivi-navicore-constants.h | 199 ----- include/genivi/genivi-navigationcore-proxy.h | 1147 -------------------------- include/genivi/navicore.h | 140 ---- include/genivi_request.h | 37 - libnavi/include/BinderClient.h | 57 -- libnavi/include/JsonRequestGenerator.h | 29 - libnavi/include/JsonResponseAnalyzer.h | 25 - libnavi/include/RequestManage.h | 64 -- libnavi/include/RequestManageListener.h | 17 - libnavi/include/libnavicore.hpp | 69 -- libnavi/include/traces.h | 38 - libnavi/src/BinderClient.cpp | 315 ------- libnavi/src/JsonRequestGenerator.cpp | 188 ----- libnavi/src/JsonResponseAnalyzer.cpp | 254 ------ libnavi/src/RequestManage.cpp | 204 ----- libnavi/src/navicore.cpp | 81 -- libnavi/src/navicorelistener.cpp | 28 - libnaviapi-agl.pc.in | 14 - navigation.png | Bin 38244 -> 0 bytes src/analyze_request.cpp | 296 ------- src/api.cpp | 419 ---------- src/binder_reply.cpp | 168 ---- src/genivi_request.cpp | 350 -------- src/traces.h | 38 - 36 files changed, 619 insertions(+), 4347 deletions(-) create mode 100644 binding/CMakeLists.txt create mode 100644 binding/navigation-api.c create mode 100644 binding/navigation-api.h create mode 100644 conf.d/cmake/config.cmake create mode 100644 conf.d/wgt/config.xml.in delete mode 100644 config.xml.in delete mode 100644 include/analyze_request.h delete mode 100644 include/binder_reply.h delete mode 100644 include/genivi/genivi-navicore-constants.h delete mode 100644 include/genivi/genivi-navigationcore-proxy.h delete mode 100644 include/genivi/navicore.h delete mode 100644 include/genivi_request.h delete mode 100644 libnavi/include/BinderClient.h delete mode 100644 libnavi/include/JsonRequestGenerator.h delete mode 100644 libnavi/include/JsonResponseAnalyzer.h delete mode 100644 libnavi/include/RequestManage.h delete mode 100644 libnavi/include/RequestManageListener.h delete mode 100644 libnavi/include/libnavicore.hpp delete mode 100644 libnavi/include/traces.h delete mode 100644 libnavi/src/BinderClient.cpp delete mode 100644 libnavi/src/JsonRequestGenerator.cpp delete mode 100644 libnavi/src/JsonResponseAnalyzer.cpp delete mode 100644 libnavi/src/RequestManage.cpp delete mode 100644 libnavi/src/navicore.cpp delete mode 100644 libnavi/src/navicorelistener.cpp delete mode 100644 libnaviapi-agl.pc.in delete mode 100644 navigation.png delete mode 100644 src/analyze_request.cpp delete mode 100644 src/api.cpp delete mode 100644 src/binder_reply.cpp delete mode 100644 src/genivi_request.cpp delete mode 100644 src/traces.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 9bd545b..b485097 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,64 +1,21 @@ -cmake_minimum_required(VERSION 2.8.11) - -INCLUDE(FindPkgConfig) - -set(PROJECT_NAME "agl-service-navigation") -set(PROJECT_PRETTY_NAME "AFM binding for navigation service") -set(PROJECT_DESCRIPTION "Binding for AGL Navigation API") -set(PROJECT_INCLUDEDIR ${CMAKE_INSTALL_PREFIX}/include) -set(PROJECT_LIBDIR ${CMAKE_INSTALL_PREFIX}/lib) -set(PROJECT_API_VERSION 0.1.0) -set(PROJECT_URL "https://wiki.automotivelinux.org/eg-navi") - -# Set a default build type if none was specified -if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) - message(STATUS "Setting build type to 'Release' as none was specified.") - set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE) -endif() - -project(navi_binder) - -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fPIC ") - -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -pkg_check_modules(DBUSCXX REQUIRED dbus-c++-1) -pkg_check_modules(JSON REQUIRED json-c) -pkg_check_modules(AFBWSC REQUIRED libafbwsc) - -include_directories( ${PROJECT_SOURCE_DIR}/libnavi/include ${PROJECT_SOURCE_DIR}/include ${DBUSCXX_INCLUDE_DIRS} ${JSON_INCLUDE_DIRS} ${AFBWSC_INCLUDE_DIRS} ) - -add_library( naviapi-agl SHARED libnavi/src/navicore.cpp libnavi/src/navicorelistener.cpp libnavi/src/BinderClient.cpp libnavi/src/JsonRequestGenerator.cpp libnavi/src/JsonResponseAnalyzer.cpp libnavi/src/RequestManage.cpp ) -target_link_libraries( naviapi-agl ${JSON_LIBRARIES} ${AFBWSC_LIBRARIES} ) -set_target_properties(naviapi-agl PROPERTIES VERSION 0.1.0 SOVERSION 0) - -install(TARGETS naviapi-agl LIBRARY DESTINATION ${PROJECT_LIBDIR}) -install(FILES ${PROJECT_SOURCE_DIR}/libnavi/include/libnavicore.hpp DESTINATION ${PROJECT_INCLUDEDIR}) - -add_library( NaviAPIService SHARED src/api.cpp src/analyze_request.cpp src/binder_reply.cpp src/genivi_request.cpp ) - -target_link_libraries( NaviAPIService ${DBUSCXX_LIBRARIES} ${JSON_LIBRARIES} ${AFBWSC_LIBRARIES} ) - -########################################################################## -# AGL binding -configure_file(config.xml.in config.xml) -set(BINARY_NAME "naviapi.wgt") - -add_custom_command( - OUTPUT ${BINARY_NAME} - DEPENDS NaviAPIService - COMMAND rm -rf package - COMMAND mkdir -p package/root - COMMAND mkdir -p package/root/lib - COMMAND mv config.xml package/root/ - COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/navigation.png package/root/icon.png - COMMAND mv libNaviAPIService.so package/root/lib - COMMAND wgtpkg-pack -f -o package/${BINARY_NAME} package/root -) -add_custom_target(widget ALL DEPENDS ${BINARY_NAME}) - -#generate configure file -configure_file(libnaviapi-agl.pc.in libnaviapi-agl.pc @ONLY) -INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libnaviapi-agl.pc - DESTINATION - ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig) +########################################################################### +# Copyright 2015, 2016, 2017 IoT.bzh +# +# author: Romain Forlot +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +########################################################################### + +CMAKE_MINIMUM_REQUIRED(VERSION 3.3) + +include(${CMAKE_CURRENT_SOURCE_DIR}/conf.d/cmake/config.cmake) diff --git a/README.md b/README.md index 7a27f6d..8c5e3d3 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,59 @@ -AGL Navigation API Binder -=============== +# Navigation Service -Copyright 2017 AISIN AW +## Overview -author: Yoshito Momiyama +Navigation service keeps track of application data that allows other clients to share location, waypoints, +and state between each other. - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at +## Verbs - http://www.apache.org/licenses/LICENSE-2.0 +| Name | Description | JSON Response | +|---------------------|---------------------------------------------|------------------------------------| +| subscribe | subscribe to an navigation service | *Request:* {"value": "status"} | +| unsubscribe | unsubscribe to an navigation service | *Request:* {"value": "status"} | +| broadcast_status | broadcast status event to other clients | *Request:* {"state": "stop"} | +| broadcast_position | broadcast position event to other clients | See *position Verb* section | +| broadcast_waypoints | broadcast waypoints events to other clients | See *waypoints Verb* section | - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. +### broadcast_position Verb -=============== +Populate same data referenced in *position Event* section for the event -This component is a reference implementation of the AGL Navigation API. +### broadcast_waypoints Verb +Populate same data referenced in *waypoints Event* section for the event +## Events + +| Name | Description | +|----------------|-------------------------------------| +| status | status of the navigation engine | +| position | current route or car position event | +| waypoints | waypoints for routing engine | + +### position Event + +
+{
+  "points": [
+    {
+      "latitude": 36.12906,
+      "longitude": -115.17908
+    }
+  ]
+}
+
+ +### waypoints Event + +
+{
+  "points": [
+    {
+      "latitude": 36.12906,
+      "longitude": -115.17908
+    }
+  ]
+}
+
diff --git a/autobuild/agl/autobuild b/autobuild/agl/autobuild index a086c89..db00c1a 100755 --- a/autobuild/agl/autobuild +++ b/autobuild/agl/autobuild @@ -59,8 +59,8 @@ package: build @mkdir -p ${BUILD_DIR}/$@/htdocs @mkdir -p ${BUILD_DIR}/$@/var @cmake --build ${BUILD_DIR} ${PACKAGE_ARGS} --target widget - @if [ "${DEST}" != "${BUILD_DIR}/$@" ]; then \ - mkdir -p ${DEST} && cp ${BUILD_DIR}/$@/*.wgt ${DEST}; \ + @if [ "${DEST}" != "${BUILD_DIR}" ]; then \ + mkdir -p ${DEST} && cp ${BUILD_DIR}/*.wgt ${DEST}; \ fi package-test: build diff --git a/autobuild/linux/autobuild b/autobuild/linux/autobuild index 512adda..db00c1a 100755 --- a/autobuild/linux/autobuild +++ b/autobuild/linux/autobuild @@ -16,7 +16,7 @@ THISFILE := $(lastword $(MAKEFILE_LIST)) BUILD_DIR := $(abspath $(dir $(THISFILE))/../../build) -DESTDIR := ${BUILD_DIR} +DEST := ${BUILD_DIR} .PHONY: all clean distclean configure build package help update @@ -33,8 +33,11 @@ help: @echo "- package: output a widget file '*.wgt'" @echo "- install: install in your ${CMAKE_INSTALL_DIR} directory" @echo "" - @echo "Usage: ./autobuild/linux/autobuild package DESTDIR=${HOME}/opt" - @echo "Don't use your build dir as DESTDIR as wgt file is generated at this location" + @echo "Usage: ./autobuild/agl/autobuild package DEST=${HOME}/opt" + @echo "Don't use your build dir as DEST as wgt file is generated at this location" + +update: configure + @cmake --build ${BUILD_DIR} --target autobuild clean: @([ -d ${BUILD_DIR} ] && make -C ${BUILD_DIR} ${CLEAN_ARGS} clean) || echo Nothing to clean @@ -50,9 +53,26 @@ build: configure @cmake --build ${BUILD_DIR} ${BUILD_ARGS} --target all package: build + @mkdir -p ${BUILD_DIR}/$@/bin + @mkdir -p ${BUILD_DIR}/$@/etc + @mkdir -p ${BUILD_DIR}/$@/lib + @mkdir -p ${BUILD_DIR}/$@/htdocs + @mkdir -p ${BUILD_DIR}/$@/var + @cmake --build ${BUILD_DIR} ${PACKAGE_ARGS} --target widget + @if [ "${DEST}" != "${BUILD_DIR}" ]; then \ + mkdir -p ${DEST} && cp ${BUILD_DIR}/*.wgt ${DEST}; \ + fi + +package-test: build + @mkdir -p ${BUILD_DIR}/$@/bin + @mkdir -p ${BUILD_DIR}/$@/etc + @mkdir -p ${BUILD_DIR}/$@/lib + @mkdir -p ${BUILD_DIR}/$@/htdocs + @mkdir -p ${BUILD_DIR}/$@/var @cmake --build ${BUILD_DIR} ${PACKAGE_ARGS} --target widget - @if [ "${DESTDIR}" != "${BUILD_DIR}" ]; then \ - mkdir -p ${DESTDIR} && cp ${BUILD_DIR}/*.wgt ${DESTDIR}; \ + @cmake --build ${BUILD_DIR} ${PACKAGE_ARGS} --target test_widget + @if [ "${DEST}" != "${BUILD_DIR}" ]; then \ + mkdir -p ${DEST} && cp ${BUILD_DIR}/*.wgt ${DEST}; \ fi install: build diff --git a/binding/CMakeLists.txt b/binding/CMakeLists.txt new file mode 100644 index 0000000..9088825 --- /dev/null +++ b/binding/CMakeLists.txt @@ -0,0 +1,35 @@ +########################################################################### +# Copyright 2015, 2016, 2017 IoT.bzh +# +# author: Fulup Ar Foll +# contrib: Romain Forlot +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +########################################################################### + +# Add target to project dependency list +PROJECT_TARGET_ADD(afm-navigation-binding) + + # Define project Targets + add_library(afm-navigation-binding MODULE navigation-api.c) + + # Binder exposes a unique public entry point + SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES + PREFIX "lib" + LABELS "BINDING" + LINK_FLAGS ${BINDINGS_LINK_FLAG} + OUTPUT_NAME ${TARGET_NAME} + ) + + # Library dependencies (include updates automatically) + TARGET_LINK_LIBRARIES(${TARGET_NAME} ${link_libraries}) diff --git a/binding/navigation-api.c b/binding/navigation-api.c new file mode 100644 index 0000000..d9ea285 --- /dev/null +++ b/binding/navigation-api.c @@ -0,0 +1,245 @@ +/* + * Copyright (C) 2019 Konsulko Group + * Author: Matt Ranostay + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#define AFB_BINDING_VERSION 3 +#include + +#include "navigation-api.h" + +struct navigation_state *navigation_get_userdata(afb_req_t request) { + afb_api_t api = afb_req_get_api(request); + return afb_api_get_userdata(api); +} + +static afb_event_t get_event_from_value(struct navigation_state *ns, + const char *value) +{ + if (!g_strcmp0(value, "status")) + return ns->status_event; + + if (!g_strcmp0(value, "position")) + return ns->position_event; + + if (!g_strcmp0(value, "waypoints")) + return ns->waypoints_event; + + return NULL; +} + +static json_object **get_storage_from_value(struct navigation_state *ns, + const char *value) +{ + if (!g_strcmp0(value, "status")) + return &ns->status_storage; + + if (!g_strcmp0(value, "position")) + return &ns->position_storage; + + if (!g_strcmp0(value, "waypoints")) + return &ns->waypoints_storage; + + return NULL; +} + +static void navigation_subscribe_unsubscribe(afb_req_t request, + gboolean unsub) +{ + struct navigation_state *ns = navigation_get_userdata(request); + json_object *jresp = json_object_new_object(); + const char *value; + afb_event_t event; + int rc; + + value = afb_req_value(request, "value"); + if (!value) { + afb_req_fail_f(request, "failed", "Missing \"value\" event"); + return; + } + + event = get_event_from_value(ns, value); + if (!event) { + afb_req_fail_f(request, "failed", "Bad \"value\" event \"%s\"", + value); + return; + } + + if (!unsub) { + json_object *storage; + rc = afb_req_subscribe(request, event); + + g_rw_lock_reader_lock(&ns->rw_lock); + storage = *get_storage_from_value(ns, value); + if (storage) { + // increment reference counter, and send out cached value + json_object_get(storage); + afb_event_push(event, storage); + } + g_rw_lock_reader_unlock(&ns->rw_lock); + } else { + rc = afb_req_unsubscribe(request, event); + } + if (rc != 0) { + afb_req_fail_f(request, "failed", + "%s error on \"value\" event \"%s\"", + !unsub ? "subscribe" : "unsubscribe", + value); + return; + } + + afb_req_success_f(request, jresp, "Navigation %s to event \"%s\"", + !unsub ? "subscribed" : "unsubscribed", + value); +} + +static void subscribe(afb_req_t request) +{ + navigation_subscribe_unsubscribe(request, FALSE); +} + +static void unsubscribe(afb_req_t request) +{ + navigation_subscribe_unsubscribe(request, TRUE); +} + +static void broadcast(afb_req_t request, const char *name, gboolean cache) +{ + struct navigation_state *ns = navigation_get_userdata(request); + afb_event_t event = get_event_from_value(ns, name); + json_object *jresp = afb_req_json(request); + + if (cache) { + json_object **storage = get_storage_from_value(ns, name); + + g_rw_lock_writer_lock(&ns->rw_lock); + + if (*storage) + json_object_put(*storage); + + // increment reference for storage + json_object_get(jresp); + *storage = jresp; + + g_rw_lock_writer_unlock(&ns->rw_lock); + } + + // increment reference for event + json_object_get(jresp); + afb_event_push(event, jresp); +} + +static void broadcast_status(afb_req_t request) +{ + broadcast(request, "status", TRUE); + + afb_req_success(request, NULL, "Broadcast status send"); +} + +static void broadcast_position(afb_req_t request) +{ + const char *position = afb_req_value(request, "position"); + gboolean cache = FALSE; + + // only send out a car position event on subscribe + if (position && !g_strcmp0(position, "car")) + cache = TRUE; + + broadcast(request, "position", cache); + + afb_req_success(request, NULL, "Broadcast position send"); +} + +static void broadcast_waypoints(afb_req_t request) +{ + broadcast(request, "waypoints", TRUE); + + afb_req_success(request, NULL, "Broadcast waypoints send"); +} + +static int init(afb_api_t api) +{ + struct navigation_state *ns; + + ns = g_try_malloc0(sizeof(*ns)); + if (!ns) { + AFB_ERROR("out of memory allocating navigation state"); + return -ENOMEM; + } + + ns->status_event = afb_daemon_make_event("status"); + ns->position_event = afb_daemon_make_event("position"); + ns->waypoints_event = afb_daemon_make_event("waypoints"); + + if (!afb_event_is_valid(ns->status_event) || + !afb_event_is_valid(ns->position_event) || + !afb_event_is_valid(ns->waypoints_event)) { + AFB_ERROR("Cannot create events"); + return -EINVAL; + } + + afb_api_set_userdata(api, ns); + + g_rw_lock_init(&ns->rw_lock); + + return 0; +} + +static const afb_verb_t binding_verbs[] = { + { + .verb = "subscribe", + .callback = subscribe, + .info = "Subscribe to event" + }, { + .verb = "unsubscribe", + .callback = unsubscribe, + .info = "Unsubscribe to event" + }, { + .verb = "broadcast_status", + .callback = broadcast_status, + .info = "Allows clients to broadcast status events" + }, { + .verb = "broadcast_position", + .callback = broadcast_position, + .info = "Broadcast out position event" + }, { + .verb = "broadcast_waypoints", + .callback = broadcast_waypoints, + .info = "Broadcast out waypoint event" + }, + {} +}; + +/* + * description of the binding for afb-daemon + */ +const afb_binding_t afbBindingV3 = { + .api = "navigation", + .verbs = binding_verbs, + .init = init, +}; diff --git a/binding/navigation-api.h b/binding/navigation-api.h new file mode 100644 index 0000000..457a87d --- /dev/null +++ b/binding/navigation-api.h @@ -0,0 +1,53 @@ +/* + * Copyright 2019 Konsulko Group + * Author: Matt Ranostay + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef NAVIGATION_API_H +#define NAVIGATION_API_H + +#include + +#define _GNU_SOURCE +#include +#include +#include +#include + +#include + +#define AFB_BINDING_VERSION 3 +#include + +#include + +struct call_work; + +struct navigation_state { + // events + afb_event_t status_event; + afb_event_t position_event; + afb_event_t waypoints_event; + + // storage + json_object *status_storage; + json_object *position_storage; + json_object *waypoints_storage; + + // locking + GRWLock rw_lock; +}; + +#endif diff --git a/conf.d/cmake/config.cmake b/conf.d/cmake/config.cmake new file mode 100644 index 0000000..e096705 --- /dev/null +++ b/conf.d/cmake/config.cmake @@ -0,0 +1,167 @@ +########################################################################### +# Copyright 2015, 2016, 2017 IoT.bzh +# +# author: Fulup Ar Foll +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +########################################################################### + +# Project Info +# ------------------ +set(PROJECT_NAME agl-service-navigation) +set(PROJECT_VERSION "1.0") +set(PROJECT_PRETTY_NAME "Navigation service for AGL") +set(PROJECT_DESCRIPTION "Navigation reporting proxy for consumers") +set(PROJECT_URL "https://gerrit.automotivelinux.org/gerrit/apps/agl-service-navigation") +set(PROJECT_ICON "icon.png") +set(PROJECT_AUTHOR "Matt Ranostay") +set(PROJECT_AUTHOR_MAIL "matt.ranostay@konsulko.com") +set(PROJECT_LICENSE "APL2.0") +set(PROJECT_LANGUAGES,"C") +set(API_NAME "navigation") + +# Where the project configuration files are stored +set(PROJECT_CMAKE_CONF_DIR "conf.d") + +# Where are stored your external libraries for your project. This is 3rd party library that you don't maintain +# but used and must be built and linked. +# set(PROJECT_LIBDIR "libs") + +# Where are stored data for your application. Pictures, static resources must be placed in that folder. +# set(PROJECT_RESOURCES "data") + +# Which directories inspect to find CMakeLists.txt target files +# set(PROJECT_SRC_DIR_PATTERN "*") + +# Compilation Mode (DEBUG, RELEASE) +# ---------------------------------- +set(BUILD_TYPE "RELEASE") + +# Kernel selection if needed. You can choose between a +# mandatory version to impose a minimal version. +# Or check Kernel minimal version and just print a Warning +# about missing features and define a preprocessor variable +# to be used as preprocessor condition in code to disable +# incompatibles features. Preprocessor define is named +# KERNEL_MINIMAL_VERSION_OK. +# +# NOTE*** FOR NOW IT CHECKS KERNEL Yocto environment and +# Yocto SDK Kernel version. +# ----------------------------------------------- +#set(kernel_mandatory_version 4.8) + +# Compiler selection if needed. Impose a minimal version. +# ----------------------------------------------- +set (gcc_minimal_version 4.9) + +# PKG_CONFIG required packages +# ----------------------------- +set (PKG_REQUIRED_LIST + json-c + libsystemd>=222 + afb-daemon + json-c + glib-2.0 + gio-2.0 + gobject-2.0 + gio-unix-2.0 + zlib +) + +# Static constante definition +# ----------------------------- +add_compile_options(-DPB_FIELD_16BIT) +add_compile_options($<$:-pthread>) + +# Customize link option +# ----------------------------- +list (APPEND link_libraries -pthread) + +# (BUG!!!) as PKG_CONFIG_PATH does not work [should be an env variable] +# --------------------------------------------------------------------- +set(INSTALL_PREFIX $ENV{HOME}/opt) +set(CMAKE_PREFIX_PATH ${CMAKE_INSTALL_PREFIX}/lib64/pkgconfig ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig) +set(LD_LIBRARY_PATH ${CMAKE_INSTALL_PREFIX}/lib64 ${CMAKE_INSTALL_PREFIX}/lib) + +# Optional location for config.xml.in +# ----------------------------------- +set(WIDGET_CONFIG_TEMPLATE ${CMAKE_CURRENT_SOURCE_DIR}/conf.d/wgt/config.xml.in) + +# Mandatory widget Mimetype specification of the main unit +# -------------------------------------------------------------------------- +# Choose between : +#- text/html : HTML application, +# content.src designates the home page of the application +# +#- application/vnd.agl.native : AGL compatible native, +# content.src designates the relative path of the binary. +# +# - application/vnd.agl.service: AGL service, content.src is not used. +# +#- ***application/x-executable***: Native application, +# content.src designates the relative path of the binary. +# For such application, only security setup is made. +# +set(WIDGET_TYPE application/vnd.agl.service) + +# Mandatory Widget entry point file of the main unit +# -------------------------------------------------------------- +# This is the file that will be executed, loaded, +# at launch time by the application framework. +# +set(WIDGET_ENTRY_POINT lib/libafm-navigation-binding.so) + +# Print a helper message when every thing is finished +# ---------------------------------------------------- +set(CLOSING_MESSAGE "Test with: afb-daemon --rootdir=\$\$(pwd)/package --binding=\$\$(pwd)/package/${WIDGET_ENTRY_POINT} --port=1234 --tracereq=common --token=\"1\" --verbose") +set(PACKAGE_MESSAGE "Install widget file using in the target : afm-util install ${PROJECT_NAME}.wgt") + + + +# Optional dependencies order +# --------------------------- +#set(EXTRA_DEPENDENCIES_ORDER) + +# Optional Extra global include path +# ----------------------------------- +#set(EXTRA_INCLUDE_DIRS) + +# Optional extra libraries +# ------------------------- +#set(EXTRA_LINK_LIBRARIES) + +# Optional force binding installation +# ------------------------------------ +# set(BINDINGS_INSTALL_PREFIX PrefixPath ) + +# Optional force binding Linking flag +# ------------------------------------ +# set(BINDINGS_LINK_FLAG LinkOptions ) + +# Optional force package prefix generation, like widget +# ----------------------------------------------------- +# set(PKG_PREFIX DestinationPath) + +# Optional Application Framework security token +# and port use for remote debugging. +#------------------------------------------------------------ +#set(AFB_TOKEN "" CACHE PATH "Default AFB_TOKEN") +#set(AFB_REMPORT "1234" CACHE PATH "Default AFB_TOKEN") + +# This include is mandatory and MUST happens at the end +# of this file, else you expose you to unexpected behavior +# +# This CMake module could be found at the following url: +# https://gerrit.automotivelinux.org/gerrit/#/admin/projects/src/cmake-apps-module +# ----------------------------------------------------------- +include(CMakeAfbTemplates) diff --git a/conf.d/wgt/config.xml.in b/conf.d/wgt/config.xml.in new file mode 100644 index 0000000..485407e --- /dev/null +++ b/conf.d/wgt/config.xml.in @@ -0,0 +1,22 @@ + + + @PROJECT_NAME@ + + + @PROJECT_DESCRIPTION@ + @PROJECT_AUTHOR@ <@PROJECT_AUTHOR_MAIL@> + @PROJECT_LICENSE@ + + + + + + + + + + + + + + diff --git a/config.xml.in b/config.xml.in deleted file mode 100644 index 25b9e53..0000000 --- a/config.xml.in +++ /dev/null @@ -1,19 +0,0 @@ - - - naviapi-binding-service - - - naviapi binding service - AISIN AW - GPL - - - - - - - - - - - diff --git a/include/analyze_request.h b/include/analyze_request.h deleted file mode 100644 index f570a1c..0000000 --- a/include/analyze_request.h +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2017 AW SOFTWARE CO.,LTD -// Copyright 2017 AISIN AW CO.,LTD - -#pragma once - -#include -#include -#include - -#include "genivi_request.h" - -/** - * @brief Analyze requests from BinderClient and create arguments to pass to Genivi API. - */ -class AnalyzeRequest -{ -public: - bool CreateParamsGetPosition( const char* req_json_str, std::vector< int32_t >& Params ); - bool CreateParamsCreateRoute( const char* req_json_str, uint32_t& sessionHdl ); - bool CreateParamsPauseSimulation( const char* req_json_str, uint32_t& sessionHdl ); - bool CreateParamsSetSimulationMode( const char* req_json_str, uint32_t& sessionHdl, bool& simuMode ); - bool CreateParamsCancelRouteCalculation( const char* req_json_str, uint32_t& sessionHdl, uint32_t& routeHdl ); - bool CreateParamsSetWaypoints( const char* req_json_str, uint32_t& sessionHdl, uint32_t& routeHdl, - bool& currentPos, std::vector& waypointsList ); - bool CreateParamsCalculateRoute( const char* req_json_str, uint32_t& sessionHdl, uint32_t& routeHdl ); - -private: - bool JsonObjectGetSessionHdl( const char* req_json_str, uint32_t& sessionHdl); - bool JsonObjectGetSessionHdlRouteHdl( const char* req_json_str, uint32_t& sessionHdl, uint32_t& routeHdl); -}; - diff --git a/include/binder_reply.h b/include/binder_reply.h deleted file mode 100644 index 44e20d0..0000000 --- a/include/binder_reply.h +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2017 AW SOFTWARE CO.,LTD -// Copyright 2017 AISIN AW CO.,LTD - -#pragma once - -#include -#include -#include -#include -#include -#include - -/** - * @brief Response to return to Binder client. - */ -typedef struct APIResponse_ -{ - bool isSuccess; - std::string errMessage; - json_object* json_data; -}APIResponse; - -/** - * @brief Convert information acquired by Genevi API to JSON format. - */ -class BinderReply -{ -public: - APIResponse ReplyNavicoreGetPosition( std::map& posList ); - APIResponse ReplyNavicoreGetAllRoutes( std::vector< uint32_t > &allRoutes ); - APIResponse ReplyNavicoreCreateRoute( uint32_t route ); - APIResponse ReplyNavicoreGetAllSessions( std::map &allSessions ); -}; - diff --git a/include/genivi/genivi-navicore-constants.h b/include/genivi/genivi-navicore-constants.h deleted file mode 100644 index 4021006..0000000 --- a/include/genivi/genivi-navicore-constants.h +++ /dev/null @@ -1,199 +0,0 @@ -// Copyright 2017 AISIN AW CO.,LTD - -#ifndef GENIVI_NAVICORE_CONSTANTS_H -#define GENIVI_NAVICORE_CONSTANTS_H - -#define NAVICORE_INVALID 0x0000 -#define NAVICORE_DEFAULT 0xfffe -#define NAVICORE_ALL 0xffff -#define NAVICORE_AVAILABLE 0x0001 -#define NAVICORE_NOT_AVAILABLE 0x0002 -#define NAVICORE_TIME_FORMAT 0x0003 -#define NAVICORE_12H 0x0004 -#define NAVICORE_24H 0x0005 -#define NAVICORE_COORDINATES_FORMAT 0x0006 -#define NAVICORE_DEGREES 0x0007 -#define NAVICORE_MINUTES 0x0008 -#define NAVICORE_SECONDS 0x0009 -#define NAVICORE_TIMESTAMP 0x0010 -#define NAVICORE_TIMEZONE_OFFSET 0x0011 -#define NAVICORE_DAYLIGHT_OFFSET 0x0012 -#define NAVICORE_LOCALE 0x0025 -#define NAVICORE_UNITS_OF_MEASUREMENT 0x0030 -#define NAVICORE_LENGTH 0x0031 -#define NAVICORE_METER 0x0032 -#define NAVICORE_MILE 0x0033 -#define NAVICORE_KM 0x0034 -#define NAVICORE_YARD 0x0035 -#define NAVICORE_FOOT 0x0036 -#define NAVICORE_DISABLED_PROMPT 0x0041 -#define NAVICORE_AUTOMATIC_PROMPT 0x0042 -#define NAVICORE_MANUAL_PROMPT 0x0043 -#define NAVICORE_CRUISE 0x0050 -#define NAVICORE_MANEUVER_APPEARED 0x0051 -#define NAVICORE_PRE_ADVICE 0x0052 -#define NAVICORE_ADVICE 0x0053 -#define NAVICORE_PASSED 0x0054 -#define NAVICORE_ACTIVE 0x0060 -#define NAVICORE_INACTIVE 0x0061 -#define NAVICORE_STRAIGHT_ON 0x0070 -#define NAVICORE_CROSSROAD 0x0071 -#define NAVICORE_ROUNDABOUT 0x0072 -#define NAVICORE_HIGHWAY_ENTER 0x0073 -#define NAVICORE_HIGHWAY_EXIT 0x0074 -#define NAVICORE_FOLLOW_SPECIFIC_LANE 0x0075 -#define NAVICORE_DESTINATION 0x0076 -#define NAVICORE_WAYPOINT 0x0077 -#define NAVICORE_TURN 0x0078 -#define NAVICORE_BIFURCATION 0x0079 -#define NAVICORE_LEFT 0x0080 -#define NAVICORE_SLIGHT_LEFT 0x0081 -#define NAVICORE_HARD_LEFT 0x0082 -#define NAVICORE_RIGHT 0x0083 -#define NAVICORE_SLIGHT_RIGHT 0x0084 -#define NAVICORE_HARD_RIGHT 0x0085 -#define NAVICORE_UTURN_RIGHT 0x0086 -#define NAVICORE_UTURN_LEFT 0x0087 -#define NAVICORE_ALL_MANUAL 0x0090 -#define NAVICORE_ALL_AUTOMATIC 0x0091 -#define NAVICORE_TRAFFIC_MANUAL 0x0092 -#define NAVICORE_OFF_ROUTE_MANUAL 0x0093 -#define NAVICORE_LATITUDE 0x00a0 -#define NAVICORE_LONGITUDE 0x00a1 -#define NAVICORE_ALTITUDE 0x00a2 -#define NAVICORE_HEADING 0x00a3 -#define NAVICORE_SPEED 0x00a4 -#define NAVICORE_CLIMB 0x00a5 -#define NAVICORE_COUNTRY 0x00a6 -#define NAVICORE_STATE 0x00a7 -#define NAVICORE_CITY 0x00a8 -#define NAVICORE_ZIPCODE 0x00a9 -#define NAVICORE_STREET 0x00aa -#define NAVICORE_HOUSENUMBER 0x00ab -#define NAVICORE_CROSSING 0x00ac -#define NAVICORE_DISTRICT 0x00ad -#define NAVICORE_PHONENUMBER 0x00ae -#define NAVICORE_POINAME 0x00af -#define NAVICORE_TOWNCENTER 0x00b0 -#define NAVICORE_LOCATION_INPUT 0x00b1 -#define NAVICORE_FULL_ADDRESS 0x00b2 -#define NAVICORE_COUNTRYCODE 0x00b3 -#define NAVICORE_HOUSENAME 0x00b4 -#define NAVICORE_POSTAL_CODE 0x00b5 -#define NAVICORE_NOT_STARTED 0x0c0 -#define NAVICORE_SEARCHING 0x00c1 -#define NAVICORE_FINISHED 0x00c2 -#define NAVICORE_OK 0x00d0 -#define NAVICORE_UNKNOWN 0x00d1 -#define NAVICORE_AMBIGUOUS 0x00d2 -#define NAVICORE_INCONSISTENT 0x00d3 -#define NAVICORE_GNSS_FIX_STATUS 0x00e0 -#define NAVICORE_DR_STATUS 0x00e1 -#define NAVICORE_MM_STATUS 0x00e2 -#define NAVICORE_SIMULATION_MODE 0x00e3 -#define NAVICORE_MATCH_TYPE 0x00f0 -#define NAVICORE_ON_ROAD 0x00f1 -#define NAVICORE_OFF_ROAD 0x00f2 -#define NAVICORE_ON_FERRY 0x00f3 -#define NAVICORE_IN_TUNNEL 0x00f4 -#define NAVICORE_ON_CARPARK 0x00f5 -#define NAVICORE_NO_FIX 0x0100 -#define NAVICORE_TIME_FIX 0x0101 -#define NAVICORE_2D_FIX 0x0102 -#define NAVICORE_3D_FIX 0x0103 -#define NAVICORE_SEGMENT_ID 0x0110 -#define NAVICORE_DIRECTION_ON_SEGMENT 0x0112 -#define NAVICORE_DISTANCE_ON_SEGMENT 0x0113 -#define NAVICORE_INTERMEDIATE_POINTS 0x0120 -#define NAVICORE_WAYPOINT_TYPE 0x0121 -#define NAVICORE_SOFT_POINT 0x0122 -#define NAVICORE_HARD_POINT 0x0123 -#define NAVICORE_CALCULATION_OK 0x0130 -#define NAVICORE_NO_POSITION 0x0131 -#define NAVICORE_UNMATCHED_POSITION 0x0132 -#define NAVICORE_UNREACHABLE_DESTINATION 0x0133 -#define NAVICORE_UNFULFILLED_PREFERENCE_MODE 0x0134 -#define NAVICORE_LINK_ID 0x0140 -#define NAVICORE_START_LATITUDE 0x0141 -#define NAVICORE_END_LATITUDE 0x0142 -#define NAVICORE_START_LONGITUDE 0x0143 -#define NAVICORE_END_LONGITUDE 0x0144 -#define NAVICORE_START_ALTITUDE 0x0145 -#define NAVICORE_END_ALTITUDE 0x0146 -#define NAVICORE_ROAD_NAME 0x0147 -#define NAVICORE_DISTANCE 0x0148 -#define NAVICORE_TIME 0x0149 -#define NAVICORE_MANEUVER 0x014a -#define NAVICORE_INSTRUCTION 0x014b -#define NAVICORE_BORDER_CROSSING 0x014c -#define NAVICORE_ADDITIONAL_INFORMATION 0x014d -#define NAVICORE_ROAD_NUMBER 0x014e -#define NAVICORE_START_OFFSET 0x014f -#define NAVICORE_FASTEST 0x0160 -#define NAVICORE_SHORTEST 0x0161 -#define NAVICORE_ECOLOGICAL 0x0162 -#define NAVICORE_SCENIC 0x0163 -#define NAVICORE_EASY 0x0164 -#define NAVICORE_BALANCED 0x0166 -#define NAVICORE_CHEAPEST 0x0167 -#define NAVICORE_FERRY 0x0170 -#define NAVICORE_TOLL_ROADS 0x0171 -#define NAVICORE_TUNNELS 0x0172 -#define NAVICORE_HIGHWAYS_MOTORWAYS 0x0173 -#define NAVICORE_VEHICLE_SIZE_LIMIT 0x0174 -#define NAVICORE_CRIME_AREAS 0x0175 -#define NAVICORE_BY_CAR 0x0180 -#define NAVICORE_ON_FOOT 0x0181 -#define NAVICORE_LONG_RANGE_TRAINS 0x0182 -#define NAVICORE_PUBLIC_TRANSPORTATION 0x0183 -#define NAVICORE_BY_BICYCLE 0x0184 -#define NAVICORE_BY_TRUCK 0x0185 -#define NAVICORE_BLOCK_NUMBER 0x0186 -#define NAVICORE_UNIT_NUMBER 0x0187 -#define NAVICORE_BEGIN_STREET 0x0188 -#define NAVICORE_ROAD_INTERSECTION 0x0189 -#define NAVICORE_ARRIVAL_TIME 0x018a -#define NAVICORE_ARRIVAL_DATE 0x018b -#define NAVICORE_DEPARTURE_TIME 0x018c -#define NAVICORE_DEPARTURE_DATE 0x018d -#define NAVICORE_TOTAL_TIME 0x018e -#define NAVICORE_TOTAL_DISTANCE 0x018f -#define NAVICORE_PROHIBIT 0x0190 -#define NAVICORE_AVOID 0x0191 -#define NAVICORE_USE 0x0192 -#define NAVICORE_PREFER 0x0193 -#define NAVICORE_IGNORE 0x0194 -#define NAVICORE_TRAFFIC_REALTIME 0x0200 -#define NAVICORE_TRAFFIC 0x0210 -#define NAVICORE_OFF_ROUTE 0x0211 -#define NAVICORE_MANUAL 0x0212 -#define NAVICORE_SIMULATION_STATUS_NO_SIMULATION 0x0220 -#define NAVICORE_SIMULATION_STATUS_RUNNING 0x0221 -#define NAVICORE_SIMULATION_STATUS_PAUSED 0x0222 -#define NAVICORE_SIMULATION_STATUS_FIXED_POSITION 0x0223 -#define NAVICORE_ROAD_FORM_CHANGE 0x0230 -#define NAVICORE_ROAD_REGULAR 0x0231 -#define NAVICORE_ROAD_HIGHWAY_MOTORWAY 0x0232 -#define NAVICORE_ROAD_FERRY 0x0233 -#define NAVICORE_DIRECTION 0x0240 -#define NAVICORE_EXIT_NUMBER 0x0241 -#define NAVICORE_ROAD_FORM 0x0242 -#define NAVICORE_LANE_INFO 0x0243 -#define NAVICORE_LANE_INFO_BITMASK_STRAIGHT 0x0001 -#define NAVICORE_LANE_INFO_BITMASK_SLIGHTRIGHT 0x0002 -#define NAVICORE_LANE_INFO_BITMASK_RIGHT 0x0004 -#define NAVICORE_LANE_INFO_BITMASK_SHARPRIGHT 0x0008 -#define NAVICORE_LANE_INFO_BITMASK_RIGHTUTURN 0x0010 -#define NAVICORE_LANE_INFO_BITMASK_SLIGHTLEFT 0x0020 -#define NAVICORE_LANE_INFO_BITMASK_LEFT 0x0040 -#define NAVICORE_LANE_INFO_BITMASK_SHARPLEFT 0x0080 -#define NAVICORE_LANE_INFO_BITMASK_LEFTUTURN 0x0100 -#define NAVICORE_DIVIDER_UNDEFINED 0x0250 -#define NAVICORE_DIVIDER_INTERRUPTEDLONG 0x0251 -#define NAVICORE_DIVIDER_INTERRUPTEDSHORT 0x0252 -#define NAVICORE_DIVIDER_SOLIDSINGLE 0x0253 -#define NAVICORE_DIVIDER_SOLIDDOUBLE 0x0254 -#define NAVICORE_DIVIDER_SOLIDINTERRUPTED 0x0255 -#define NAVICORE_DIVIDER_INTERRUPTEDSOLID 0x0256 - -#endif diff --git a/include/genivi/genivi-navigationcore-proxy.h b/include/genivi/genivi-navigationcore-proxy.h deleted file mode 100644 index 2322fa0..0000000 --- a/include/genivi/genivi-navigationcore-proxy.h +++ /dev/null @@ -1,1147 +0,0 @@ - -/* - * This file was automatically generated by dbusxx-xml2cpp; DO NOT EDIT! - */ - -#ifndef __dbusxx__genivi_navigationcore_proxy_h__PROXY_MARSHAL_H -#define __dbusxx__genivi_navigationcore_proxy_h__PROXY_MARSHAL_H - -#include -#include - -namespace org { -namespace genivi { -namespace navigationcore { - -class Session_proxy -: public ::DBus::InterfaceProxy -{ -public: - - Session_proxy() - : ::DBus::InterfaceProxy("org.genivi.navigationcore.Session") - { - connect_signal(Session_proxy, SessionDeleted, _SessionDeleted_stub); - } - -public: - - /* properties exported by this interface */ -public: - - /* methods exported by this interface, - * this functions will invoke the corresponding methods on the remote objects - */ - ::DBus::Struct< uint16_t, uint16_t, uint16_t, std::string > SessionGetVersion() - { - ::DBus::CallMessage call; - call.member("GetVersion"); - ::DBus::Message ret = invoke_method (call); - ::DBus::MessageIter ri = ret.reader(); - - ::DBus::Struct< uint16_t, uint16_t, uint16_t, std::string > argout; - ri >> argout; - return argout; - } - - uint32_t CreateSession(const std::string& client) - { - ::DBus::CallMessage call; - ::DBus::MessageIter wi = call.writer(); - - wi << client; - call.member("CreateSession"); - ::DBus::Message ret = invoke_method (call); - ::DBus::MessageIter ri = ret.reader(); - - uint32_t argout; - ri >> argout; - return argout; - } - - void DeleteSession(const uint32_t& sessionHandle) - { - ::DBus::CallMessage call; - ::DBus::MessageIter wi = call.writer(); - - wi << sessionHandle; - call.member("DeleteSession"); - ::DBus::Message ret = invoke_method (call); - } - - int32_t GetSessionStatus(const uint32_t& sessionHandle) - { - ::DBus::CallMessage call; - ::DBus::MessageIter wi = call.writer(); - - wi << sessionHandle; - call.member("GetSessionStatus"); - ::DBus::Message ret = invoke_method (call); - ::DBus::MessageIter ri = ret.reader(); - - int32_t argout; - ri >> argout; - return argout; - } - - std::vector< ::DBus::Struct< uint32_t, std::string > > GetAllSessions() - { - ::DBus::CallMessage call; - call.member("GetAllSessions"); - ::DBus::Message ret = invoke_method (call); - ::DBus::MessageIter ri = ret.reader(); - - std::vector< ::DBus::Struct< uint32_t, std::string > > argout; - ri >> argout; - return argout; - } - - -public: - - /* signal handlers for this interface - */ - virtual void SessionDeleted(const uint32_t& sessionHandle) = 0; - -private: - - /* unmarshalers (to unpack the DBus message before calling the actual signal handler) - */ - void _SessionDeleted_stub(const ::DBus::SignalMessage &sig) - { - ::DBus::MessageIter ri = sig.reader(); - - uint32_t sessionHandle; - ri >> sessionHandle; - SessionDeleted(sessionHandle); - } -}; - -} } } -namespace org { -namespace genivi { -namespace navigationcore { - -class Routing_proxy -: public ::DBus::InterfaceProxy -{ -public: - - Routing_proxy() - : ::DBus::InterfaceProxy("org.genivi.navigationcore.Routing") - { - connect_signal(Routing_proxy, RouteDeleted, _RouteDeleted_stub); - connect_signal(Routing_proxy, RouteCalculationCancelled, _RouteCalculationCancelled_stub); - connect_signal(Routing_proxy, RouteCalculationSuccessful, _RouteCalculationSuccessful_stub); - connect_signal(Routing_proxy, RouteCalculationFailed, _RouteCalculationFailed_stub); - connect_signal(Routing_proxy, RouteCalculationProgressUpdate, _RouteCalculationProgressUpdate_stub); - connect_signal(Routing_proxy, AlternativeRoutesAvailable, _AlternativeRoutesAvailable_stub); - } - -public: - - /* properties exported by this interface */ -public: - - /* methods exported by this interface, - * this functions will invoke the corresponding methods on the remote objects - */ - ::DBus::Struct< uint16_t, uint16_t, uint16_t, std::string > RoutingGetVersion() - { - ::DBus::CallMessage call; - call.member("GetVersion"); - ::DBus::Message ret = invoke_method (call); - ::DBus::MessageIter ri = ret.reader(); - - ::DBus::Struct< uint16_t, uint16_t, uint16_t, std::string > argout; - ri >> argout; - return argout; - } - - uint32_t CreateRoute(const uint32_t& sessionHandle) - { - ::DBus::CallMessage call; - ::DBus::MessageIter wi = call.writer(); - - wi << sessionHandle; - call.member("CreateRoute"); - ::DBus::Message ret = invoke_method (call); - ::DBus::MessageIter ri = ret.reader(); - - uint32_t argout; - ri >> argout; - return argout; - } - - void DeleteRoute(const uint32_t& sessionHandle, const uint32_t& routeHandle) - { - ::DBus::CallMessage call; - ::DBus::MessageIter wi = call.writer(); - - wi << sessionHandle; - wi << routeHandle; - call.member("DeleteRoute"); - ::DBus::Message ret = invoke_method (call); - } - - void SetCostModel(const uint32_t& sessionHandle, const uint32_t& routeHandle, const int32_t& costModel) - { - ::DBus::CallMessage call; - ::DBus::MessageIter wi = call.writer(); - - wi << sessionHandle; - wi << routeHandle; - wi << costModel; - call.member("SetCostModel"); - ::DBus::Message ret = invoke_method (call); - } - - int32_t GetCostModel(const uint32_t& routeHandle) - { - ::DBus::CallMessage call; - ::DBus::MessageIter wi = call.writer(); - - wi << routeHandle; - call.member("GetCostModel"); - ::DBus::Message ret = invoke_method (call); - ::DBus::MessageIter ri = ret.reader(); - - int32_t argout; - ri >> argout; - return argout; - } - - std::vector< int32_t > GetSupportedCostModels() - { - ::DBus::CallMessage call; - call.member("GetSupportedCostModels"); - ::DBus::Message ret = invoke_method (call); - ::DBus::MessageIter ri = ret.reader(); - - std::vector< int32_t > argout; - ri >> argout; - return argout; - } - - void SetRoutePreferences(const uint32_t& sessionHandle, const uint32_t& routeHandle, const std::string& countryCode, const std::vector< ::DBus::Struct< int32_t, int32_t > >& roadPreferenceList, const std::vector< ::DBus::Struct< int32_t, int32_t > >& conditionPreferenceList) - { - ::DBus::CallMessage call; - ::DBus::MessageIter wi = call.writer(); - - wi << sessionHandle; - wi << routeHandle; - wi << countryCode; - wi << roadPreferenceList; - wi << conditionPreferenceList; - call.member("SetRoutePreferences"); - ::DBus::Message ret = invoke_method (call); - } - - void GetRoutePreferences(const uint32_t& routeHandle, const std::string& countryCode, std::vector< ::DBus::Struct< int32_t, int32_t > >& roadPreferenceList, std::vector< ::DBus::Struct< int32_t, int32_t > >& conditionPreferenceList) - { - ::DBus::CallMessage call; - ::DBus::MessageIter wi = call.writer(); - - wi << routeHandle; - wi << countryCode; - call.member("GetRoutePreferences"); - ::DBus::Message ret = invoke_method (call); - ::DBus::MessageIter ri = ret.reader(); - - ri >> roadPreferenceList; - ri >> conditionPreferenceList; - } - - void GetSupportedRoutePreferences(std::vector< ::DBus::Struct< int32_t, int32_t > >& routePreferencesList, std::vector< ::DBus::Struct< int32_t, int32_t > >& conditionPreferenceList) - { - ::DBus::CallMessage call; - call.member("GetSupportedRoutePreferences"); - ::DBus::Message ret = invoke_method (call); - ::DBus::MessageIter ri = ret.reader(); - - ri >> routePreferencesList; - ri >> conditionPreferenceList; - } - - void SetRouteSchedule(const uint32_t& sessionHandle, const uint32_t& routeHandle, const std::map< int32_t, uint32_t >& routeSchedule) - { - ::DBus::CallMessage call; - ::DBus::MessageIter wi = call.writer(); - - wi << sessionHandle; - wi << routeHandle; - wi << routeSchedule; - call.member("SetRouteSchedule"); - ::DBus::Message ret = invoke_method (call); - } - - std::map< int32_t, uint32_t > GetRouteSchedule(const uint32_t& routeHandle, const std::vector< int32_t >& valuesToReturn) - { - ::DBus::CallMessage call; - ::DBus::MessageIter wi = call.writer(); - - wi << routeHandle; - wi << valuesToReturn; - call.member("GetRouteSchedule"); - ::DBus::Message ret = invoke_method (call); - ::DBus::MessageIter ri = ret.reader(); - - std::map< int32_t, uint32_t > argout; - ri >> argout; - return argout; - } - - void SetTransportationMeans(const uint32_t& sessionHandle, const uint32_t& routeHandle, const std::vector< int32_t >& transportationMeansList) - { - ::DBus::CallMessage call; - ::DBus::MessageIter wi = call.writer(); - - wi << sessionHandle; - wi << routeHandle; - wi << transportationMeansList; - call.member("SetTransportationMeans"); - ::DBus::Message ret = invoke_method (call); - } - - std::vector< int32_t > GetTransportationMeans(const uint32_t& routeHandle) - { - ::DBus::CallMessage call; - ::DBus::MessageIter wi = call.writer(); - - wi << routeHandle; - call.member("GetTransportationMeans"); - ::DBus::Message ret = invoke_method (call); - ::DBus::MessageIter ri = ret.reader(); - - std::vector< int32_t > argout; - ri >> argout; - return argout; - } - - std::vector< int32_t > GetSupportedTransportationMeans() - { - ::DBus::CallMessage call; - call.member("GetSupportedTransportationMeans"); - ::DBus::Message ret = invoke_method (call); - ::DBus::MessageIter ri = ret.reader(); - - std::vector< int32_t > argout; - ri >> argout; - return argout; - } - - void SetExcludedAreas(const uint32_t& sessionHandle, const uint32_t& routeHandle, const std::vector< std::vector< ::DBus::Struct< double, double > > >& excludedAreas) - { - ::DBus::CallMessage call; - ::DBus::MessageIter wi = call.writer(); - - wi << sessionHandle; - wi << routeHandle; - wi << excludedAreas; - call.member("SetExcludedAreas"); - ::DBus::Message ret = invoke_method (call); - } - - std::vector< std::vector< ::DBus::Struct< double, double > > > GetExcludedAreas(const uint32_t& routeHandle) - { - ::DBus::CallMessage call; - ::DBus::MessageIter wi = call.writer(); - - wi << routeHandle; - call.member("GetExcludedAreas"); - ::DBus::Message ret = invoke_method (call); - ::DBus::MessageIter ri = ret.reader(); - - std::vector< std::vector< ::DBus::Struct< double, double > > > argout; - ri >> argout; - return argout; - } - - void SetWaypoints(const uint32_t& sessionHandle, const uint32_t& routeHandle, const bool& startFromCurrentPosition, const std::vector< std::map< int32_t, ::DBus::Struct< uint8_t, ::DBus::Variant > > >& waypointsList) - { - ::DBus::CallMessage call; - ::DBus::MessageIter wi = call.writer(); - - wi << sessionHandle; - wi << routeHandle; - wi << startFromCurrentPosition; - wi << waypointsList; - call.member("SetWaypoints"); - ::DBus::Message ret = invoke_method (call); - } - - void GetWaypoints(const uint32_t& routeHandle, bool& startFromCurrentPosition, std::vector< std::map< int32_t, ::DBus::Struct< uint8_t, ::DBus::Variant > > >& waypointsList) - { - ::DBus::CallMessage call; - ::DBus::MessageIter wi = call.writer(); - - wi << routeHandle; - call.member("GetWaypoints"); - ::DBus::Message ret = invoke_method (call); - ::DBus::MessageIter ri = ret.reader(); - - ri >> startFromCurrentPosition; - ri >> waypointsList; - } - - void CalculateRoute(const uint32_t& sessionHandle, const uint32_t& routeHandle) - { - ::DBus::CallMessage call; - ::DBus::MessageIter wi = call.writer(); - - wi << sessionHandle; - wi << routeHandle; - call.member("CalculateRoute"); - ::DBus::Message ret = invoke_method (call); - } - - void CancelRouteCalculation(const uint32_t& sessionHandle, const uint32_t& routeHandle) - { - ::DBus::CallMessage call; - ::DBus::MessageIter wi = call.writer(); - - wi << sessionHandle; - wi << routeHandle; - call.member("CancelRouteCalculation"); - ::DBus::Message ret = invoke_method (call); - } - - std::vector< uint32_t > CalculateRoutes(const uint32_t& sessionHandle, const std::vector< uint32_t >& calculatedRoutesList) - { - ::DBus::CallMessage call; - ::DBus::MessageIter wi = call.writer(); - - wi << sessionHandle; - wi << calculatedRoutesList; - call.member("CalculateRoutes"); - ::DBus::Message ret = invoke_method (call); - ::DBus::MessageIter ri = ret.reader(); - - std::vector< uint32_t > argout; - ri >> argout; - return argout; - } - - void GetRouteSegments(const uint32_t& routeHandle, const int16_t& detailLevel, const std::vector< int32_t >& valuesToReturn, const uint32_t& numberOfSegments, const uint32_t& offset, uint32_t& totalNumberOfSegments, std::vector< std::map< int32_t, ::DBus::Struct< uint8_t, ::DBus::Variant > > >& routeSegments) - { - ::DBus::CallMessage call; - ::DBus::MessageIter wi = call.writer(); - - wi << routeHandle; - wi << detailLevel; - wi << valuesToReturn; - wi << numberOfSegments; - wi << offset; - call.member("GetRouteSegments"); - ::DBus::Message ret = invoke_method (call); - ::DBus::MessageIter ri = ret.reader(); - - ri >> totalNumberOfSegments; - ri >> routeSegments; - } - - std::map< int32_t, ::DBus::Struct< uint8_t, ::DBus::Variant > > GetRouteOverview(const uint32_t& routeHandle, const std::vector< int32_t >& valuesToReturn) - { - ::DBus::CallMessage call; - ::DBus::MessageIter wi = call.writer(); - - wi << routeHandle; - wi << valuesToReturn; - call.member("GetRouteOverview"); - ::DBus::Message ret = invoke_method (call); - ::DBus::MessageIter ri = ret.reader(); - - std::map< int32_t, ::DBus::Struct< uint8_t, ::DBus::Variant > > argout; - ri >> argout; - return argout; - } - - ::DBus::Struct< ::DBus::Struct< double, double >, ::DBus::Struct< double, double > > GetRouteBoundingBox(const uint32_t& routeHandle) - { - ::DBus::CallMessage call; - ::DBus::MessageIter wi = call.writer(); - - wi << routeHandle; - call.member("GetRouteBoundingBox"); - ::DBus::Message ret = invoke_method (call); - ::DBus::MessageIter ri = ret.reader(); - - ::DBus::Struct< ::DBus::Struct< double, double >, ::DBus::Struct< double, double > > argout; - ri >> argout; - return argout; - } - - std::vector< uint32_t > GetAllRoutes() - { - ::DBus::CallMessage call; - call.member("GetAllRoutes"); - ::DBus::Message ret = invoke_method (call); - ::DBus::MessageIter ri = ret.reader(); - - std::vector< uint32_t > argout; - ri >> argout; - return argout; - } - - void SetBlockedRouteStretches(const uint32_t& sessionHandle, const uint32_t& routeHandle, const std::vector< ::DBus::Struct< uint32_t, uint32_t > >& blockParameters) - { - ::DBus::CallMessage call; - ::DBus::MessageIter wi = call.writer(); - - wi << sessionHandle; - wi << routeHandle; - wi << blockParameters; - call.member("SetBlockedRouteStretches"); - ::DBus::Message ret = invoke_method (call); - } - - std::vector< ::DBus::Struct< uint32_t, uint32_t > > GetBlockedRouteStretches(const uint32_t& routeHandle) - { - ::DBus::CallMessage call; - ::DBus::MessageIter wi = call.writer(); - - wi << routeHandle; - call.member("GetBlockedRouteStretches"); - ::DBus::Message ret = invoke_method (call); - ::DBus::MessageIter ri = ret.reader(); - - std::vector< ::DBus::Struct< uint32_t, uint32_t > > argout; - ri >> argout; - return argout; - } - - -public: - - /* signal handlers for this interface - */ - virtual void RouteDeleted(const uint32_t& routeHandle) = 0; - virtual void RouteCalculationCancelled(const uint32_t& routeHandle) = 0; - virtual void RouteCalculationSuccessful(const uint32_t& routeHandle, const std::map< int32_t, int32_t >& unfullfilledPreferences) = 0; - virtual void RouteCalculationFailed(const uint32_t& routeHandle, const int32_t& errorCode, const std::map< int32_t, int32_t >& unfullfilledPreferences) = 0; - virtual void RouteCalculationProgressUpdate(const uint32_t& routeHandle, const int32_t& status, const uint8_t& percentage) = 0; - virtual void AlternativeRoutesAvailable(const std::vector< uint32_t >& routeHandlesList) = 0; - -private: - - /* unmarshalers (to unpack the DBus message before calling the actual signal handler) - */ - void _RouteDeleted_stub(const ::DBus::SignalMessage &sig) - { - ::DBus::MessageIter ri = sig.reader(); - - uint32_t routeHandle; - ri >> routeHandle; - RouteDeleted(routeHandle); - } - void _RouteCalculationCancelled_stub(const ::DBus::SignalMessage &sig) - { - ::DBus::MessageIter ri = sig.reader(); - - uint32_t routeHandle; - ri >> routeHandle; - RouteCalculationCancelled(routeHandle); - } - void _RouteCalculationSuccessful_stub(const ::DBus::SignalMessage &sig) - { - ::DBus::MessageIter ri = sig.reader(); - - uint32_t routeHandle; - ri >> routeHandle; - std::map< int32_t, int32_t > unfullfilledPreferences; - ri >> unfullfilledPreferences; - RouteCalculationSuccessful(routeHandle, unfullfilledPreferences); - } - void _RouteCalculationFailed_stub(const ::DBus::SignalMessage &sig) - { - ::DBus::MessageIter ri = sig.reader(); - - uint32_t routeHandle; - ri >> routeHandle; - int32_t errorCode; - ri >> errorCode; - std::map< int32_t, int32_t > unfullfilledPreferences; - ri >> unfullfilledPreferences; - RouteCalculationFailed(routeHandle, errorCode, unfullfilledPreferences); - } - void _RouteCalculationProgressUpdate_stub(const ::DBus::SignalMessage &sig) - { - ::DBus::MessageIter ri = sig.reader(); - - uint32_t routeHandle; - ri >> routeHandle; - int32_t status; - ri >> status; - uint8_t percentage; - ri >> percentage; - RouteCalculationProgressUpdate(routeHandle, status, percentage); - } - void _AlternativeRoutesAvailable_stub(const ::DBus::SignalMessage &sig) - { - ::DBus::MessageIter ri = sig.reader(); - - std::vector< uint32_t > routeHandlesList; - ri >> routeHandlesList; - AlternativeRoutesAvailable(routeHandlesList); - } -}; - -} } } -namespace org { -namespace genivi { -namespace navigationcore { - -class MapMatchedPosition_proxy -: public ::DBus::InterfaceProxy -{ -public: - - MapMatchedPosition_proxy() - : ::DBus::InterfaceProxy("org.genivi.navigationcore.MapMatchedPosition") - { - connect_signal(MapMatchedPosition_proxy, SimulationStatusChanged, _SimulationStatusChanged_stub); - connect_signal(MapMatchedPosition_proxy, SimulationSpeedChanged, _SimulationSpeedChanged_stub); - connect_signal(MapMatchedPosition_proxy, PositionUpdate, _PositionUpdate_stub); - connect_signal(MapMatchedPosition_proxy, AddressUpdate, _AddressUpdate_stub); - connect_signal(MapMatchedPosition_proxy, PositionOnSegmentUpdate, _PositionOnSegmentUpdate_stub); - connect_signal(MapMatchedPosition_proxy, StatusUpdate, _StatusUpdate_stub); - connect_signal(MapMatchedPosition_proxy, OffRoadPositionChanged, _OffRoadPositionChanged_stub); - } - -public: - - /* properties exported by this interface */ -public: - - /* methods exported by this interface, - * this functions will invoke the corresponding methods on the remote objects - */ - ::DBus::Struct< uint16_t, uint16_t, uint16_t, std::string > MapMatchedPositionGetVersion() - { - ::DBus::CallMessage call; - call.member("GetVersion"); - ::DBus::Message ret = invoke_method (call); - ::DBus::MessageIter ri = ret.reader(); - - ::DBus::Struct< uint16_t, uint16_t, uint16_t, std::string > argout; - ri >> argout; - return argout; - } - - void SetSimulationMode(const uint32_t& sessionHandle, const bool& activate) - { - ::DBus::CallMessage call; - ::DBus::MessageIter wi = call.writer(); - - wi << sessionHandle; - wi << activate; - call.member("SetSimulationMode"); - ::DBus::Message ret = invoke_method (call); - } - - int32_t GetSimulationStatus() - { - ::DBus::CallMessage call; - call.member("GetSimulationStatus"); - ::DBus::Message ret = invoke_method (call); - ::DBus::MessageIter ri = ret.reader(); - - int32_t argout; - ri >> argout; - return argout; - } - - void AddSimulationStatusListener() - { - ::DBus::CallMessage call; - call.member("AddSimulationStatusListener"); - ::DBus::Message ret = invoke_method (call); - } - - void RemoveSimulationStatusListener() - { - ::DBus::CallMessage call; - call.member("RemoveSimulationStatusListener"); - ::DBus::Message ret = invoke_method (call); - } - - void SetSimulationSpeed(const uint32_t& sessionHandle, const uint8_t& speedFactor) - { - ::DBus::CallMessage call; - ::DBus::MessageIter wi = call.writer(); - - wi << sessionHandle; - wi << speedFactor; - call.member("SetSimulationSpeed"); - ::DBus::Message ret = invoke_method (call); - } - - uint8_t GetSimulationSpeed() - { - ::DBus::CallMessage call; - call.member("GetSimulationSpeed"); - ::DBus::Message ret = invoke_method (call); - ::DBus::MessageIter ri = ret.reader(); - - uint8_t argout; - ri >> argout; - return argout; - } - - void AddSimulationSpeedListener() - { - ::DBus::CallMessage call; - call.member("AddSimulationSpeedListener"); - ::DBus::Message ret = invoke_method (call); - } - - void RemoveSimulationSpeedListener() - { - ::DBus::CallMessage call; - call.member("RemoveSimulationSpeedListener"); - ::DBus::Message ret = invoke_method (call); - } - - void StartSimulation(const uint32_t& sessionHandle) - { - ::DBus::CallMessage call; - ::DBus::MessageIter wi = call.writer(); - - wi << sessionHandle; - call.member("StartSimulation"); - ::DBus::Message ret = invoke_method (call); - } - - void PauseSimulation(const uint32_t& sessionHandle) - { - ::DBus::CallMessage call; - ::DBus::MessageIter wi = call.writer(); - - wi << sessionHandle; - call.member("PauseSimulation"); - ::DBus::Message ret = invoke_method (call); - } - - std::map< int32_t, ::DBus::Struct< uint8_t, ::DBus::Variant > > GetPosition(const std::vector< int32_t >& valuesToReturn) - { - ::DBus::CallMessage call; - ::DBus::MessageIter wi = call.writer(); - - wi << valuesToReturn; - call.member("GetPosition"); - ::DBus::Message ret = invoke_method (call); - ::DBus::MessageIter ri = ret.reader(); - - std::map< int32_t, ::DBus::Struct< uint8_t, ::DBus::Variant > > argout; - ri >> argout; - return argout; - } - - void SetPosition(const uint32_t& sessionHandle, const std::map< int32_t, ::DBus::Struct< uint8_t, ::DBus::Variant > >& position) - { - ::DBus::CallMessage call; - ::DBus::MessageIter wi = call.writer(); - - wi << sessionHandle; - wi << position; - call.member("SetPosition"); - ::DBus::Message ret = invoke_method (call); - } - - std::map< int32_t, ::DBus::Struct< uint8_t, ::DBus::Variant > > GetAddress(const std::vector< int32_t >& valuesToReturn) - { - ::DBus::CallMessage call; - ::DBus::MessageIter wi = call.writer(); - - wi << valuesToReturn; - call.member("GetAddress"); - ::DBus::Message ret = invoke_method (call); - ::DBus::MessageIter ri = ret.reader(); - - std::map< int32_t, ::DBus::Struct< uint8_t, ::DBus::Variant > > argout; - ri >> argout; - return argout; - } - - std::map< int32_t, ::DBus::Struct< uint8_t, ::DBus::Variant > > GetPositionOnSegment(const std::vector< int32_t >& valuesToReturn) - { - ::DBus::CallMessage call; - ::DBus::MessageIter wi = call.writer(); - - wi << valuesToReturn; - call.member("GetPositionOnSegment"); - ::DBus::Message ret = invoke_method (call); - ::DBus::MessageIter ri = ret.reader(); - - std::map< int32_t, ::DBus::Struct< uint8_t, ::DBus::Variant > > argout; - ri >> argout; - return argout; - } - - std::map< int32_t, ::DBus::Struct< uint8_t, ::DBus::Variant > > GetStatus(const std::vector< int32_t >& valuesToReturn) - { - ::DBus::CallMessage call; - ::DBus::MessageIter wi = call.writer(); - - wi << valuesToReturn; - call.member("GetStatus"); - ::DBus::Message ret = invoke_method (call); - ::DBus::MessageIter ri = ret.reader(); - - std::map< int32_t, ::DBus::Struct< uint8_t, ::DBus::Variant > > argout; - ri >> argout; - return argout; - } - - -public: - - /* signal handlers for this interface - */ - virtual void SimulationStatusChanged(const int32_t& simulationStatus) = 0; - virtual void SimulationSpeedChanged(const uint8_t& speedFactor) = 0; - virtual void PositionUpdate(const std::vector< int32_t >& changedValues) = 0; - virtual void AddressUpdate(const std::vector< int32_t >& changedValues) = 0; - virtual void PositionOnSegmentUpdate(const std::vector< int32_t >& changedValues) = 0; - virtual void StatusUpdate(const std::vector< int32_t >& changedValues) = 0; - virtual void OffRoadPositionChanged(const uint32_t& distance, const int32_t& direction) = 0; - -private: - - /* unmarshalers (to unpack the DBus message before calling the actual signal handler) - */ - void _SimulationStatusChanged_stub(const ::DBus::SignalMessage &sig) - { - ::DBus::MessageIter ri = sig.reader(); - - int32_t simulationStatus; - ri >> simulationStatus; - SimulationStatusChanged(simulationStatus); - } - void _SimulationSpeedChanged_stub(const ::DBus::SignalMessage &sig) - { - ::DBus::MessageIter ri = sig.reader(); - - uint8_t speedFactor; - ri >> speedFactor; - SimulationSpeedChanged(speedFactor); - } - void _PositionUpdate_stub(const ::DBus::SignalMessage &sig) - { - ::DBus::MessageIter ri = sig.reader(); - - std::vector< int32_t > changedValues; - ri >> changedValues; - PositionUpdate(changedValues); - } - void _AddressUpdate_stub(const ::DBus::SignalMessage &sig) - { - ::DBus::MessageIter ri = sig.reader(); - - std::vector< int32_t > changedValues; - ri >> changedValues; - AddressUpdate(changedValues); - } - void _PositionOnSegmentUpdate_stub(const ::DBus::SignalMessage &sig) - { - ::DBus::MessageIter ri = sig.reader(); - - std::vector< int32_t > changedValues; - ri >> changedValues; - PositionOnSegmentUpdate(changedValues); - } - void _StatusUpdate_stub(const ::DBus::SignalMessage &sig) - { - ::DBus::MessageIter ri = sig.reader(); - - std::vector< int32_t > changedValues; - ri >> changedValues; - StatusUpdate(changedValues); - } - void _OffRoadPositionChanged_stub(const ::DBus::SignalMessage &sig) - { - ::DBus::MessageIter ri = sig.reader(); - - uint32_t distance; - ri >> distance; - int32_t direction; - ri >> direction; - OffRoadPositionChanged(distance, direction); - } -}; - -} } } -namespace org { -namespace genivi { -namespace navigationcore { - -class Guidance_proxy -: public ::DBus::InterfaceProxy -{ -public: - - Guidance_proxy() - : ::DBus::InterfaceProxy("org.genivi.navigationcore.Guidance") - { - connect_signal(Guidance_proxy, VehicleLeftTheRoadNetwork, _VehicleLeftTheRoadNetwork_stub); - connect_signal(Guidance_proxy, GuidanceStatusChanged, _GuidanceStatusChanged_stub); - connect_signal(Guidance_proxy, WaypointReached, _WaypointReached_stub); - connect_signal(Guidance_proxy, ManeuverChanged, _ManeuverChanged_stub); - connect_signal(Guidance_proxy, PositionOnRouteChanged, _PositionOnRouteChanged_stub); - connect_signal(Guidance_proxy, VehicleLeftTheRoute, _VehicleLeftTheRoute_stub); - connect_signal(Guidance_proxy, PositionToRouteChanged, _PositionToRouteChanged_stub); - connect_signal(Guidance_proxy, ActiveRouteChanged, _ActiveRouteChanged_stub); - } - -public: - - /* properties exported by this interface */ -public: - - /* methods exported by this interface, - * this functions will invoke the corresponding methods on the remote objects - */ - ::DBus::Struct< uint16_t, uint16_t, uint16_t, std::string > GuidanceGetVersion() - { - ::DBus::CallMessage call; - call.member("GetVersion"); - ::DBus::Message ret = invoke_method (call); - ::DBus::MessageIter ri = ret.reader(); - - ::DBus::Struct< uint16_t, uint16_t, uint16_t, std::string > argout; - ri >> argout; - return argout; - } - - void StartGuidance(const uint32_t& sessionHandle, const uint32_t& routeHandle) - { - ::DBus::CallMessage call; - ::DBus::MessageIter wi = call.writer(); - - wi << sessionHandle; - wi << routeHandle; - call.member("StartGuidance"); - ::DBus::Message ret = invoke_method (call); - } - - void StopGuidance(const uint32_t& sessionHandle) - { - ::DBus::CallMessage call; - ::DBus::MessageIter wi = call.writer(); - - wi << sessionHandle; - call.member("StopGuidance"); - ::DBus::Message ret = invoke_method (call); - } - - void SetVoiceGuidance(const bool& activate, const std::string& voice) - { - ::DBus::CallMessage call; - ::DBus::MessageIter wi = call.writer(); - - wi << activate; - wi << voice; - call.member("SetVoiceGuidance"); - ::DBus::Message ret = invoke_method (call); - } - - void GetGuidanceDetails(bool& voiceGuidance, bool& vehicleOnTheRoad, bool& isDestinationReached, int32_t& maneuver) - { - ::DBus::CallMessage call; - call.member("GetGuidanceDetails"); - ::DBus::Message ret = invoke_method (call); - ::DBus::MessageIter ri = ret.reader(); - - ri >> voiceGuidance; - ri >> vehicleOnTheRoad; - ri >> isDestinationReached; - ri >> maneuver; - } - - void PlayVoiceManeuver() - { - ::DBus::CallMessage call; - call.member("PlayVoiceManeuver"); - ::DBus::Message ret = invoke_method (call); - } - - void GetWaypointInformation(const uint16_t& requestedNumberOfWaypoints, uint16_t& numberOfWaypoints, std::vector< ::DBus::Struct< uint32_t, uint32_t, int32_t, int32_t, int16_t, int16_t, bool, uint16_t > >& waypointsList) - { - ::DBus::CallMessage call; - ::DBus::MessageIter wi = call.writer(); - - wi << requestedNumberOfWaypoints; - call.member("GetWaypointInformation"); - ::DBus::Message ret = invoke_method (call); - ::DBus::MessageIter ri = ret.reader(); - - ri >> numberOfWaypoints; - ri >> waypointsList; - } - - void GetDestinationInformation(uint32_t& offset, uint32_t& travelTime, int32_t& direction, int32_t& side, int16_t& timeZone, int16_t& daylightSavingTime) - { - ::DBus::CallMessage call; - call.member("GetDestinationInformation"); - ::DBus::Message ret = invoke_method (call); - ::DBus::MessageIter ri = ret.reader(); - - ri >> offset; - ri >> travelTime; - ri >> direction; - ri >> side; - ri >> timeZone; - ri >> daylightSavingTime; - } - - void GetManeuversList(const uint16_t& requestedNumberOfManeuvers, const uint32_t& maneuverOffset, uint16_t& numberOfManeuvers, std::vector< ::DBus::Struct< std::string, std::string, uint16_t, int32_t, uint32_t, std::vector< ::DBus::Struct< uint32_t, uint32_t, int32_t, int32_t, std::map< int32_t, ::DBus::Struct< uint8_t, ::DBus::Variant > > > > > >& maneuversList) - { - ::DBus::CallMessage call; - ::DBus::MessageIter wi = call.writer(); - - wi << requestedNumberOfManeuvers; - wi << maneuverOffset; - call.member("GetManeuversList"); - ::DBus::Message ret = invoke_method (call); - ::DBus::MessageIter ri = ret.reader(); - - ri >> numberOfManeuvers; - ri >> maneuversList; - } - - void SetRouteCalculationMode(const uint32_t& sessionHandle, const int32_t& routeCalculationMode) - { - ::DBus::CallMessage call; - ::DBus::MessageIter wi = call.writer(); - - wi << sessionHandle; - wi << routeCalculationMode; - call.member("SetRouteCalculationMode"); - ::DBus::Message ret = invoke_method (call); - } - - void SkipNextManeuver(const uint32_t& sessionHandle) - { - ::DBus::CallMessage call; - ::DBus::MessageIter wi = call.writer(); - - wi << sessionHandle; - call.member("SkipNextManeuver"); - ::DBus::Message ret = invoke_method (call); - } - - void GetGuidanceStatus(int32_t& guidanceStatus, uint32_t& routeHandle) - { - ::DBus::CallMessage call; - call.member("GetGuidanceStatus"); - ::DBus::Message ret = invoke_method (call); - ::DBus::MessageIter ri = ret.reader(); - - ri >> guidanceStatus; - ri >> routeHandle; - } - - void SetVoiceGuidanceSettings(const int32_t& promptMode) - { - ::DBus::CallMessage call; - ::DBus::MessageIter wi = call.writer(); - - wi << promptMode; - call.member("SetVoiceGuidanceSettings"); - ::DBus::Message ret = invoke_method (call); - } - - int32_t GetVoiceGuidanceSettings() - { - ::DBus::CallMessage call; - call.member("GetVoiceGuidanceSettings"); - ::DBus::Message ret = invoke_method (call); - ::DBus::MessageIter ri = ret.reader(); - - int32_t argout; - ri >> argout; - return argout; - } - - -public: - - /* signal handlers for this interface - */ - virtual void VehicleLeftTheRoadNetwork() = 0; - virtual void GuidanceStatusChanged(const int32_t& guidanceStatus, const uint32_t& routeHandle) = 0; - virtual void WaypointReached(const bool& isDestination) = 0; - virtual void ManeuverChanged(const int32_t& maneuver) = 0; - virtual void PositionOnRouteChanged(const uint32_t& offsetOnRoute) = 0; - virtual void VehicleLeftTheRoute() = 0; - virtual void PositionToRouteChanged(const uint32_t& distance, const int32_t& direction) = 0; - virtual void ActiveRouteChanged(const int32_t& changeCause) = 0; - -private: - - /* unmarshalers (to unpack the DBus message before calling the actual signal handler) - */ - void _VehicleLeftTheRoadNetwork_stub(const ::DBus::SignalMessage &sig) - { - VehicleLeftTheRoadNetwork(); - } - void _GuidanceStatusChanged_stub(const ::DBus::SignalMessage &sig) - { - ::DBus::MessageIter ri = sig.reader(); - - int32_t guidanceStatus; - ri >> guidanceStatus; - uint32_t routeHandle; - ri >> routeHandle; - GuidanceStatusChanged(guidanceStatus, routeHandle); - } - void _WaypointReached_stub(const ::DBus::SignalMessage &sig) - { - ::DBus::MessageIter ri = sig.reader(); - - bool isDestination; - ri >> isDestination; - WaypointReached(isDestination); - } - void _ManeuverChanged_stub(const ::DBus::SignalMessage &sig) - { - ::DBus::MessageIter ri = sig.reader(); - - int32_t maneuver; - ri >> maneuver; - ManeuverChanged(maneuver); - } - void _PositionOnRouteChanged_stub(const ::DBus::SignalMessage &sig) - { - ::DBus::MessageIter ri = sig.reader(); - - uint32_t offsetOnRoute; - ri >> offsetOnRoute; - PositionOnRouteChanged(offsetOnRoute); - } - void _VehicleLeftTheRoute_stub(const ::DBus::SignalMessage &sig) - { - VehicleLeftTheRoute(); - } - void _PositionToRouteChanged_stub(const ::DBus::SignalMessage &sig) - { - ::DBus::MessageIter ri = sig.reader(); - - uint32_t distance; - ri >> distance; - int32_t direction; - ri >> direction; - PositionToRouteChanged(distance, direction); - } - void _ActiveRouteChanged_stub(const ::DBus::SignalMessage &sig) - { - ::DBus::MessageIter ri = sig.reader(); - - int32_t changeCause; - ri >> changeCause; - ActiveRouteChanged(changeCause); - } -}; - -} } } -#endif //__dbusxx__genivi_navigationcore_proxy_h__PROXY_MARSHAL_H diff --git a/include/genivi/navicore.h b/include/genivi/navicore.h deleted file mode 100644 index a80bc1f..0000000 --- a/include/genivi/navicore.h +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright 2017 AISIN AW CO.,LTD - -#ifndef NAVICORE_H -#define NAVICORE_H - -#include -#include "genivi-navigationcore-proxy.h" -#include - -class Navicore : - public org::genivi::navigationcore::Session_proxy, - public org::genivi::navigationcore::Routing_proxy, - public org::genivi::navigationcore::MapMatchedPosition_proxy, - public org::genivi::navigationcore::Guidance_proxy, - public DBus::IntrospectableProxy, - public DBus::ObjectProxy -{ -public: - Navicore(DBus::Connection &connection, const char *path, const char *name) - : DBus::ObjectProxy(connection, path, name) - { - }; - - // Session - void SessionDeleted(const uint32_t& sessionHandle) - { - printf("NavicoreSession - Session %d deleted\n",sessionHandle); - }; - - // Routing - void RouteDeleted(const uint32_t& routeHandle) - { - // TODO - }; - - void RouteCalculationCancelled(const uint32_t& routeHandle) - { - // TODO - }; - - void RouteCalculationSuccessful(const uint32_t& routeHandle, const std::map< int32_t, int32_t >& unfullfilledPreferences) - { - // TODO - }; - - void RouteCalculationFailed(const uint32_t& routeHandle, const int32_t& errorCode, const std::map< int32_t, int32_t >& unfullfilledPreferences) - { - // TODO - }; - - void RouteCalculationProgressUpdate(const uint32_t& routeHandle, const int32_t& status, const uint8_t& percentage) - { - // TODO - }; - - void AlternativeRoutesAvailable(const std::vector< uint32_t >& routeHandlesList) - { - // TODO - }; - - // MapMatchedPosition - void SimulationStatusChanged(const int32_t& simulationStatus) - { - // TODO - }; - - void SimulationSpeedChanged(const uint8_t& speedFactor) - { - // TODO - }; - - void PositionUpdate(const std::vector< int32_t >& changedValues) - { - // TODO - }; - - void AddressUpdate(const std::vector< int32_t >& changedValues) - { - // TODO - }; - - void PositionOnSegmentUpdate(const std::vector< int32_t >& changedValues) - { - // TODO - }; - - void StatusUpdate(const std::vector< int32_t >& changedValues) - { - // TODO - }; - - void OffRoadPositionChanged(const uint32_t& distance, const int32_t& direction) - { - // TODO - }; - - // Guidance - void VehicleLeftTheRoadNetwork() - { - // TODO - }; - - void GuidanceStatusChanged(const int32_t& guidanceStatus, const uint32_t& routeHandle) - { - // TODO - }; - - void WaypointReached(const bool& isDestination) - { - // TODO - }; - - void ManeuverChanged(const int32_t& maneuver) - { - // TODO - }; - - void PositionOnRouteChanged(const uint32_t& offsetOnRoute) - { - // TODO - }; - - void VehicleLeftTheRoute() - { - // TODO - }; - - void PositionToRouteChanged(const uint32_t& distance, const int32_t& direction) - { - // TODO - }; - - void ActiveRouteChanged(const int32_t& changeCause) - { - // TODO - }; - -}; - -#endif diff --git a/include/genivi_request.h b/include/genivi_request.h deleted file mode 100644 index 75201c7..0000000 --- a/include/genivi_request.h +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2017 AW SOFTWARE CO.,LTD -// Copyright 2017 AISIN AW CO.,LTD - -#pragma once - -#include -#include -#include - -typedef std::tuple Waypoint; - -/** - * @brief Genivi API call. - */ -class GeniviRequest -{ -public: - ~GeniviRequest(); - - std::map< int32_t, double > NavicoreGetPosition( const std::vector< int32_t >& valuesToReturn ); - std::vector< uint32_t > NavicoreGetAllRoutes(); - uint32_t NavicoreCreateRoute( const uint32_t& sessionHandle ); - void NavicorePauseSimulation( const uint32_t& sessionHandle ); - void NavicoreSetSimulationMode( const uint32_t& sessionHandle, const bool& activate ); - void NavicoreCancelRouteCalculation( const uint32_t& sessionHandle, const uint32_t& routeHandle ); - void NavicoreSetWaypoints( const uint32_t& sessionHandle, const uint32_t& routeHandle, - const bool& startFromCurrentPosition, const std::vector& waypointsList ); - void NavicoreCalculateRoute( const uint32_t& sessionHandle, const uint32_t& routeHandle ); - std::map NavicoreGetAllSessions(); - -private: - void* navicore_; - - void CreateDBusSession(); - bool CheckSession(); -}; - diff --git a/libnavi/include/BinderClient.h b/libnavi/include/BinderClient.h deleted file mode 100644 index 70a6558..0000000 --- a/libnavi/include/BinderClient.h +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2017 AISIN AW CO.,LTD - -#pragma once - -#include -#include -#include -#include - -#include "libnavicore.hpp" - -#include "RequestManageListener.h" -#include "RequestManage.h" - -#define API_NAME "naviapi" - -/** - * @brief API name - */ -#define VERB_GETPOSITION "navicore_getposition" -#define VERB_GETALLROUTES "navicore_getallroutes" -#define VERB_CREATEROUTE "navicore_createroute" -#define VERB_PAUSESIMULATION "navicore_pausesimulation" -#define VERB_SETSIMULATIONMODE "navicore_setsimulationmode" -#define VERB_CANCELROUTECALCULATION "navicore_cancelroutecalculation" -#define VERB_SETWAYPOINTS "navicore_setwaypoints" -#define VERB_CALCULATEROUTE "navicore_calculateroute" -#define VERB_GETALLSESSIONS "navicore_getallsessions" - -/** - * @brief Binder client class - */ -class BinderClient : public RequestManageListener -{ -public: - BinderClient(); - ~BinderClient(); - - bool ConnectServer(std::string url , naviapi::NavicoreListener* listener); - void NavicoreGetPosition(const std::vector< int32_t >& valuesToReturn); - void NavicoreGetAllRoutes(); - void NavicoreCreateRoute(const uint32_t& sessionHandle); - void NavicorePauseSimulation(const uint32_t& sessionHandle); - void NavicoreSetSimulationMode(const uint32_t& sessionHandle, const bool& activate); - void NavicoreCancelRouteCalculation(const uint32_t& sessionHandle, const uint32_t& routeHandle); - void NavicoreSetWaypoints(const uint32_t& sessionHandle, const uint32_t& routeHandle, const bool& startFromCurrentPosition, const std::vector& waypointsList); - void NavicoreCalculateRoute(const uint32_t& sessionHandle, const uint32_t& routeHandle); - void NavicoreGetAllSessions(); - -private: - void OnReply(struct json_object *reply); - -private: - naviapi::NavicoreListener* navicoreListener; - RequestManage* requestMng; -}; - diff --git a/libnavi/include/JsonRequestGenerator.h b/libnavi/include/JsonRequestGenerator.h deleted file mode 100644 index 7cd6979..0000000 --- a/libnavi/include/JsonRequestGenerator.h +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2017 AW SOFTWARE CO.,LTD -// Copyright 2017 AISIN AW CO.,LTD - -#pragma once - -#include -#include -#include - -#include "libnavicore.hpp" - -/** -* @brief Class for generating Json request -*/ -class JsonRequestGenerator -{ -public: - static std::string CreateRequestGetPosition(const std::vector< int32_t >& valuesToReturn); - static std::string CreateRequestGetAllRoutes(); - static std::string CreateRequestCreateRoute(const uint32_t* sessionHandle); - static std::string CreateRequestPauseSimulation(const uint32_t* sessionHandle); - static std::string CreateRequestSetSimulationMode(const uint32_t* sessionHandle, const bool* activate); - static std::string CreateRequestCancelRouteCalculation(const uint32_t* sessionHandle, const uint32_t* routeHandle); - static std::string CreateRequestSetWaypoints(const uint32_t* sessionHandle, const uint32_t* routeHandle, - const bool* startFromCurrentPosition, const std::vector* waypointsList); - static std::string CreateRequestCalculateroute(const uint32_t* sessionHandle, const uint32_t* routeHandle); - static std::string CreateRequestGetAllSessions(); -}; - diff --git a/libnavi/include/JsonResponseAnalyzer.h b/libnavi/include/JsonResponseAnalyzer.h deleted file mode 100644 index 50b2cd2..0000000 --- a/libnavi/include/JsonResponseAnalyzer.h +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2017 AW SOFTWARE CO.,LTD -// Copyright 2017 AISIN AW CO.,LTD - -#pragma once - -#include -#include -#include -#include -#include - -#include "libnavicore.hpp" - -/** -* @brief JSON response analysis class -*/ -class JsonResponseAnalyzer -{ -public: - static std::map< int32_t, naviapi::variant > AnalyzeResponseGetPosition( std::string& res_json ); - static std::vector< uint32_t > AnalyzeResponseGetAllRoutes( std::string& res_json ); - static uint32_t AnalyzeResponseCreateRoute( std::string& res_json ); - static std::map AnalyzeResponseGetAllSessions( std::string& res_json ); -}; - diff --git a/libnavi/include/RequestManage.h b/libnavi/include/RequestManage.h deleted file mode 100644 index 05ffcdf..0000000 --- a/libnavi/include/RequestManage.h +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2017 AISIN AW CO.,LTD - -#pragma once - -#include -#include -#include - -extern "C" { - #include - #include -} - -#include "RequestManageListener.h" - -/** -* @brief Class for request -*/ -class RequestManage -{ -public: - pthread_cond_t cond; - pthread_mutex_t mutex; - - struct afb_wsj1* wsj1; - std::string* requestURL; - struct afb_wsj1_itf wsj1_itf; - -private: - RequestManageListener* listener; - int request_cnt; - uint32_t sessionHandle; - uint32_t routeHandle; - - // Function called from thread - static void* BinderThread(void* param); - - // Callback function - void OnReply(struct afb_wsj1_msg *msg); - void OnHangup(struct afb_wsj1 *wsj1); - void OnCallStatic(const char *api, const char *verb, struct afb_wsj1_msg *msg); - void OnEventStatic(const char *event, struct afb_wsj1_msg *msg); - - static void OnReplyStatic(void *closure, struct afb_wsj1_msg *msg); - static void OnHangupStatic(void *closure, struct afb_wsj1 *wsj1); - static void OnCallStatic(void *closure, const char *api, const char *verb, struct afb_wsj1_msg *msg); - static void OnEventStatic(void *closure, const char *event, struct afb_wsj1_msg *msg); - -// ================================================================================================== -// public -// ================================================================================================== -public: - RequestManage(); - ~RequestManage(); - - bool Connect(const char* api_url, RequestManageListener* listener); - bool IsConnect(); - bool CallBinderAPI(const char *api, const char *verb, const char *object); - void SetSessionHandle(uint32_t session); - uint32_t GetSessionHandle(); - void SetRouteHandle(uint32_t route); - uint32_t GetRouteHandle(); -}; - diff --git a/libnavi/include/RequestManageListener.h b/libnavi/include/RequestManageListener.h deleted file mode 100644 index 3b0c932..0000000 --- a/libnavi/include/RequestManageListener.h +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2017 AISIN AW CO.,LTD - -#pragma once - -#include - -class RequestManageListener -{ -public: - RequestManageListener() { - } - virtual ~RequestManageListener() { - } - - virtual void OnReply(struct json_object *reply) = 0; -}; - diff --git a/libnavi/include/libnavicore.hpp b/libnavi/include/libnavicore.hpp deleted file mode 100644 index 66200d9..0000000 --- a/libnavi/include/libnavicore.hpp +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2017 AISIN AW CO.,LTD - -#pragma once - -#include -#include -#include -#include - -#include - -namespace naviapi { - -static const uint32_t NAVICORE_TIMESTAMP = 0x0010; -static const uint32_t NAVICORE_LATITUDE = 0x00a0; -static const uint32_t NAVICORE_LONGITUDE = 0x00a1; -static const uint32_t NAVICORE_HEADING = 0x00a3; -static const uint32_t NAVICORE_SPEED = 0x00a4; -static const uint32_t NAVICORE_SIMULATION_MODE = 0x00e3; - -typedef union -{ - bool _bool; - int32_t _int32_t; - uint32_t _uint32_t; - double _double; -} variant; - -typedef std::tuple Waypoint; - -class NavicoreListener -{ -public: - NavicoreListener(); - virtual ~NavicoreListener(); - - virtual void getAllSessions_reply(const std::map< uint32_t, std::string >& allSessions); - virtual void getPosition_reply(std::map< int32_t, variant > position); - virtual void getAllRoutes_reply(std::vector< uint32_t > allRoutes); - virtual void createRoute_reply(uint32_t routeHandle); -}; // class NavicoreListener - -class Navicore -{ -private: - NavicoreListener* mListener; - -public: - Navicore(); - virtual ~Navicore(); - - bool connect(int argc, char *argv[], NavicoreListener* listener); - void disconnect(); - - void getAllSessions(); - void getPosition(std::vector params); - void getAllRoutes(); - void createRoute(uint32_t session); - - void pauseSimulation(uint32_t session); - void setSimulationMode(uint32_t session, bool activate); - void cancelRouteCalculation(uint32_t session, uint32_t routeHandle); - void setWaypoints(uint32_t session, uint32_t routeHandle, bool flag, std::vector); - void calculateRoute(uint32_t session, uint32_t routeHandle); - -}; // class Navicore - -}; // namespace naviapi - diff --git a/libnavi/include/traces.h b/libnavi/include/traces.h deleted file mode 100644 index a1f96ec..0000000 --- a/libnavi/include/traces.h +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2017 AISIN AW CO.,LTD - -#ifndef __TRACE_H__ -#define __TRACE_H__ - -#include - -#define BLACK "\033[30m" -#define RED "\033[31m" -#define GREEN "\033[32m" -#define YELLOW "\033[33m" -#define BLUE "\033[34m" -#define PURPLE "\033[35m" -#define DGREEN "\033[6m" -#define WHITE "\033[7m" -#define CYAN "\x1b[36m" -#define NONE "\033[0m" - -#ifdef NDEBUG - -#define TRACE_DEBUG_JSON(fmt, args...) -#define TRACE_DEBUG(fmt, args...) -#define TRACE_INFO(fmt, args...) -#define TRACE_WARN(fmt, args...) -#define TRACE_ERROR(fmt, args...) - -#else - -#define TRACE_DEBUG(fmt, args...) do { fprintf(stderr, "[%s:%d] " CYAN "DEBUG" NONE ": " fmt "\n", __func__, __LINE__, ##args); } while(0) -#define TRACE_INFO(fmt, args...) do { fprintf(stderr, "[%s:%d] " GREEN "INFO" NONE ": " fmt "\n", __func__, __LINE__, ##args); } while(0) -#define TRACE_WARN(fmt, args...) do { fprintf(stderr, "[%s:%d] " YELLOW "WARN" NONE": " fmt "\n", __func__, __LINE__, ##args); } while(0) -#define TRACE_ERROR(fmt, args...) do { fprintf(stderr, "[%s:%d] " RED "ERROR" NONE ": " fmt "\n", __func__, __LINE__, ##args); } while(0) - -#define TRACE_DEBUG_JSON(fmt, args...) - -#endif - -#endif // __TRACE_H__ diff --git a/libnavi/src/BinderClient.cpp b/libnavi/src/BinderClient.cpp deleted file mode 100644 index 1e1e9e9..0000000 --- a/libnavi/src/BinderClient.cpp +++ /dev/null @@ -1,315 +0,0 @@ -// Copyright 2017 AW SOFTWARE CO.,LTD -// Copyright 2017 AISIN AW CO.,LTD - -#include - -#include "BinderClient.h" -#include "JsonRequestGenerator.h" -#include "JsonResponseAnalyzer.h" - -#include "traces.h" - -/** - * @brief constructor - */ -BinderClient::BinderClient() : navicoreListener(nullptr) -{ - requestMng = new RequestManage(); -} - -/** - * @brief Destructor - */ -BinderClient::~BinderClient() -{ - delete requestMng; -} - -/** - * @brief Connect with the Binder server - */ -bool BinderClient::ConnectServer(std::string url, naviapi::NavicoreListener* listener) -{ - this->navicoreListener = listener; - - if( !requestMng->Connect(url.c_str(), this)) - { - TRACE_ERROR("cannot connect to binding service.\n"); - return false; - } - - return true; -} - -/** - * @brief Call Genivi's GetPosition via Binder and get the result - */ -void BinderClient::NavicoreGetPosition(const std::vector< int32_t >& valuesToReturn) -{ - // Check if it is connected - if( requestMng->IsConnect() ) - { - // JSON request generation - std::string req_json = JsonRequestGenerator::CreateRequestGetPosition(valuesToReturn); - - // Send request - if( requestMng->CallBinderAPI(API_NAME, VERB_GETPOSITION, req_json.c_str()) ) - { - TRACE_DEBUG("navicore_getposition success.\n"); - } - else - { - TRACE_ERROR("navicore_getposition failed.\n"); - } - } -} - -/** - * @brief Get route handle - */ -void BinderClient::NavicoreGetAllRoutes() -{ - // Check if it is connected - if( requestMng->IsConnect() ) - { - // JSON request generation - std::string req_json = JsonRequestGenerator::CreateRequestGetAllRoutes(); - - // Send request - if( requestMng->CallBinderAPI(API_NAME, VERB_GETALLROUTES, req_json.c_str()) ) - { - TRACE_DEBUG("navicore_getallroutes success.\n"); - } - else - { - TRACE_ERROR("navicore_getallroutes failed.\n"); - } - } -} - -/** - * @brief Generate route handle - */ -void BinderClient::NavicoreCreateRoute(const uint32_t& sessionHandle) -{ - // Check if it is connected - if( requestMng->IsConnect() ) - { - // JSON request generation - uint32_t session = requestMng->GetSessionHandle(); - std::string req_json = JsonRequestGenerator::CreateRequestCreateRoute(&session); - - // Send request - if( requestMng->CallBinderAPI(API_NAME, VERB_CREATEROUTE, req_json.c_str()) ) - { - TRACE_DEBUG("navicore_createroute success.\n"); - } - else - { - TRACE_ERROR("navicore_createroute failed.\n"); - } - } -} - -/** - * @brief Pause demo - */ -void BinderClient::NavicorePauseSimulation(const uint32_t& sessionHandle) -{ - // Check if it is connected - if( requestMng->IsConnect() ) - { - // JSON request generation - uint32_t session = requestMng->GetSessionHandle(); - std::string req_json = JsonRequestGenerator::CreateRequestPauseSimulation(&session); - - // Send request - if( requestMng->CallBinderAPI(API_NAME, VERB_PAUSESIMULATION, req_json.c_str()) ) - { - TRACE_DEBUG("navicore_pausesimulationmode success.\n"); - } - else - { - TRACE_ERROR("navicore_pausesimulationmode failed.\n"); - } - } -} - -/** - * @brief Simulation mode setting - */ -void BinderClient::NavicoreSetSimulationMode(const uint32_t& sessionHandle, const bool& activate) -{ - // Check if it is connected - if( requestMng->IsConnect() ) - { - // JSON request generation - uint32_t session = requestMng->GetSessionHandle(); - std::string req_json = JsonRequestGenerator::CreateRequestSetSimulationMode(&session, &activate); - - // Send request - if( requestMng->CallBinderAPI(API_NAME, VERB_SETSIMULATIONMODE, req_json.c_str()) ) - { - TRACE_DEBUG("navicore_setsimulationmode success.\n"); - } - else - { - TRACE_ERROR("navicore_setsimulationmode failed.\n"); - } - } -} - -/** - * @brief Delete route information - */ -void BinderClient::NavicoreCancelRouteCalculation(const uint32_t& sessionHandle, const uint32_t& routeHandle) -{ - // Check if it is connected - if( requestMng->IsConnect() ) - { - // JSON request generation - uint32_t session = requestMng->GetSessionHandle(); - std::string req_json = JsonRequestGenerator::CreateRequestCancelRouteCalculation(&session, &routeHandle); - - // Send request - if( requestMng->CallBinderAPI(API_NAME, VERB_CANCELROUTECALCULATION, req_json.c_str()) ) - { - TRACE_DEBUG("navicore_cancelroutecalculation success.\n"); - } - else - { - TRACE_ERROR("navicore_cancelroutecalculation failed.\n"); - } - } -} - -/** - * @brief Destination setting - */ -void BinderClient::NavicoreSetWaypoints(const uint32_t& sessionHandle, const uint32_t& routeHandle, const bool& startFromCurrentPosition, const std::vector& waypointsList) -{ - // Check if it is connected - if( requestMng->IsConnect() ) - { - // JSON request generation - uint32_t session = requestMng->GetSessionHandle(); - uint32_t route = requestMng->GetRouteHandle(); - std::string req_json = JsonRequestGenerator::CreateRequestSetWaypoints(&session, &route, - &startFromCurrentPosition, &waypointsList); - - // Send request - if( requestMng->CallBinderAPI(API_NAME, VERB_SETWAYPOINTS, req_json.c_str()) ) - { - TRACE_DEBUG("navicore_setwaypoints success.\n"); - } - else - { - TRACE_ERROR("navicore_setwaypoints failed.\n"); - } - } -} - -/** - * @brief Route calculation processing - */ -void BinderClient::NavicoreCalculateRoute(const uint32_t& sessionHandle, const uint32_t& routeHandle) -{ - // Check if it is connected - if( requestMng->IsConnect() ) - { - // JSON request generation - uint32_t session = requestMng->GetSessionHandle(); - uint32_t route = requestMng->GetRouteHandle(); - std::string req_json = JsonRequestGenerator::CreateRequestCalculateroute(&session, &route); - - // Send request - if( requestMng->CallBinderAPI(API_NAME, VERB_CALCULATEROUTE, req_json.c_str()) ) - { - TRACE_DEBUG("navicore_calculateroute success.\n"); - } - else - { - TRACE_ERROR("navicore_calculateroute failed.\n"); - } - } -} - -/** - * @brief Retrieve session information - * @return Map of session information - */ -void BinderClient::NavicoreGetAllSessions() -{ - // Check if it is connected - if( requestMng->IsConnect() ) - { - // JSON request generation - std::string req_json = JsonRequestGenerator::CreateRequestGetAllSessions(); - - // Send request - if( requestMng->CallBinderAPI(API_NAME, VERB_GETALLSESSIONS, req_json.c_str()) ) - { - TRACE_DEBUG("navicore_getallsessions success.\n"); - } - else - { - TRACE_ERROR("navicore_getallsessions failed.\n"); - } - } -} - -void BinderClient::OnReply(struct json_object* reply) -{ - struct json_object* requestObject = nullptr; - json_object_object_get_ex(reply, "request", &requestObject); - - struct json_object* infoObject = nullptr; - json_object_object_get_ex(requestObject, "info", &infoObject); - - const char* info = json_object_get_string(infoObject); - - char tmpVerb[256]; - strcpy(tmpVerb, info); - - // Create a new JSON response - const char* json_str = json_object_to_json_string_ext(reply, JSON_C_TO_STRING_PRETTY); - std::string response_json = std::string( json_str ); - - if (strcmp(VERB_GETALLSESSIONS, tmpVerb) == 0) - { - std::map ret = JsonResponseAnalyzer::AnalyzeResponseGetAllSessions(response_json); - - // keep session handle - requestMng->SetSessionHandle( ret.begin()->first ); - - this->navicoreListener->getAllSessions_reply(ret); - } - else if (strcmp(VERB_GETPOSITION, tmpVerb) == 0) - { - std::map< int32_t, naviapi::variant > ret = JsonResponseAnalyzer::AnalyzeResponseGetPosition(response_json); - - this->navicoreListener->getPosition_reply(ret); - } - else if (strcmp(VERB_GETALLROUTES, tmpVerb) == 0) - { - std::vector< uint32_t > ret = JsonResponseAnalyzer::AnalyzeResponseGetAllRoutes(response_json); - - // route handle - if(ret.size() > 0) - { - requestMng->SetRouteHandle(ret[0]); - } - - this->navicoreListener->getAllRoutes_reply(ret); - } - else if (strcmp(VERB_CREATEROUTE, tmpVerb) == 0) - { - uint32_t ret = JsonResponseAnalyzer::AnalyzeResponseCreateRoute(response_json); - - // keep route handle - requestMng->SetRouteHandle(ret); - - this->navicoreListener->createRoute_reply(ret); - } -} - diff --git a/libnavi/src/JsonRequestGenerator.cpp b/libnavi/src/JsonRequestGenerator.cpp deleted file mode 100644 index 09d68c0..0000000 --- a/libnavi/src/JsonRequestGenerator.cpp +++ /dev/null @@ -1,188 +0,0 @@ -// Copyright 2017 AW SOFTWARE CO.,LTD -// Copyright 2017 AISIN AW CO.,LTD - -#include -#include -#include "JsonRequestGenerator.h" - -/** - * @brief Generate request for navicore_getposition - * @param valuesToReturn Key information you want to obtain - * @return json string - */ -std::string JsonRequestGenerator::CreateRequestGetPosition(const std::vector< int32_t >& valuesToReturn) -{ - std::vector< int32_t >::const_iterator itr; - - struct json_object* request_json = json_object_new_object(); - struct json_object* json_array = json_object_new_array(); - - for (itr = valuesToReturn.begin(); itr != valuesToReturn.end(); itr++) - { - json_object_array_add(json_array, json_object_new_int(*itr)); - } - - json_object_object_add(request_json, "valuesToReturn", json_array); - TRACE_DEBUG("CreateRequestGetPosition request_json:\n%s\n", json_object_to_json_string(request_json)); - - return std::string( json_object_to_json_string( request_json ) ); -} - -/** - * @brief Generate request for navicore_getallroutes - * @return json strin - */ -std::string JsonRequestGenerator::CreateRequestGetAllRoutes() -{ - // Request is empty and OK - struct json_object* request_json = json_object_new_object(); - TRACE_DEBUG("CreateRequestGetAllRoutes request_json:\n%s\n", json_object_to_json_string(request_json)); - - return std::string( json_object_to_json_string( request_json ) ); -} - -/** - * @brief Generate request for navicore_createroute - * @param sessionHandle session handle - * @return json string - */ -std::string JsonRequestGenerator::CreateRequestCreateRoute(const uint32_t* sessionHandle) -{ - struct json_object* request_json = json_object_new_object(); - json_object_object_add(request_json, "sessionHandle", json_object_new_int(*sessionHandle)); - TRACE_DEBUG("CreateRequestCreateRoute request_json:\n%s\n", json_object_to_json_string(request_json)); - - return std::string( json_object_to_json_string( request_json ) ); -} - -/** - * @brief Generate request for navicore_pausesimulation - * @param sessionHandle session handle - * @return json string - */ -std::string JsonRequestGenerator::CreateRequestPauseSimulation(const uint32_t* sessionHandle) -{ - struct json_object* request_json = json_object_new_object(); - // sessionHandle - json_object_object_add(request_json, "sessionHandle", json_object_new_int(*sessionHandle)); - TRACE_DEBUG("CreateRequestPauseSimulation request_json:\n%s\n", json_object_to_json_string(request_json)); - - return std::string( json_object_to_json_string( request_json ) ); -} - -/** - * @brief Generate request for navicore_pausesimulation - * @param sessionHandle session handle - * @param active Simulation state - * @return json string - */ -std::string JsonRequestGenerator::CreateRequestSetSimulationMode(const uint32_t* sessionHandle, const bool* activate) -{ - struct json_object* request_json = json_object_new_object(); - - // "sessionHandle" - json_object_object_add(request_json, "sessionHandle", json_object_new_int(*sessionHandle)); - - // "simulationMode" - json_object_object_add(request_json, "simulationMode", json_object_new_boolean(*activate)); - TRACE_DEBUG("CreateRequestSetSimulationMode request_json:\n%s\n", json_object_to_json_string(request_json)); - - return std::string( json_object_to_json_string( request_json ) ); -} - -/** - * @brief Generate request for navicore_pausesimulation - * @param sessionHandle session handle - * @param routeHandle route handle - * @return json string - */ -std::string JsonRequestGenerator::CreateRequestCancelRouteCalculation(const uint32_t* sessionHandle, const uint32_t* routeHandle) -{ - struct json_object* request_json = json_object_new_object(); - - // "sessionHandle" - json_object_object_add(request_json, "sessionHandle", json_object_new_int(*sessionHandle)); - - // "route" - json_object_object_add(request_json, "route", json_object_new_int(*routeHandle)); - TRACE_DEBUG("CreateRequestCancelRouteCalculation request_json:\n%s\n", json_object_to_json_string(request_json)); - - return std::string( json_object_to_json_string( request_json ) ); -} - -/** - * @brief Generate request for navicore_setwaypoints - * @param sessionHandle session handle - * @param routeHandle route handle - * @return json string - */ -std::string JsonRequestGenerator::CreateRequestSetWaypoints(const uint32_t* sessionHandle, const uint32_t* routeHandle, - const bool* startFromCurrentPosition, const std::vector* waypointsList) -{ - naviapi::Waypoint destWp; - - struct json_object* request_json = json_object_new_object(); - struct json_object* json_array = json_object_new_array(); - - // "sessionHandle" - json_object_object_add(request_json, "sessionHandle", json_object_new_int(*sessionHandle)); - - // "route" - json_object_object_add(request_json, "route", json_object_new_int(*routeHandle)); - - // "startFromCurrentPosition" - json_object_object_add(request_json, "startFromCurrentPosition", json_object_new_boolean(*startFromCurrentPosition)); - - // "latitude", "longitude" - std::vector::const_iterator it; - for (it = waypointsList->begin(); it != waypointsList->end(); ++it) - { - struct json_object* destpoint = json_object_new_object(); - - double latitude = std::get<0>(*it); - json_object_object_add(destpoint, "latitude", json_object_new_double(latitude)); - - double longitude = std::get<1>(*it); - json_object_object_add(destpoint, "longitude", json_object_new_double(longitude)); - - json_object_array_add(json_array, destpoint); - } - - json_object_object_add(request_json, "", json_array); - TRACE_DEBUG("CreateRequestSetWaypoints request_json:\n%s\n", json_object_to_json_string(request_json)); - - return std::string( json_object_to_json_string( request_json ) ); -} - -/** - * @brief Generate request for navicore_calculateroute - * @param sessionHandle session handle - * @param routeHandle route handle - * @return json string - */ -std::string JsonRequestGenerator::CreateRequestCalculateroute(const uint32_t* sessionHandle, const uint32_t* routeHandle) -{ - struct json_object* request_json = json_object_new_object(); - // "sessionHandle" - json_object_object_add(request_json, "sessionHandle", json_object_new_int(*sessionHandle)); - - // "route" - json_object_object_add(request_json, "route", json_object_new_int(*routeHandle)); - TRACE_DEBUG("CreateRequestCalculateroute request_json:\n%s\n", json_object_to_json_string(request_json)); - - return std::string( json_object_to_json_string( request_json ) ); -} - -/** - * @brief Generate request for navicore_getallsessions - * @return json string - */ -std::string JsonRequestGenerator::CreateRequestGetAllSessions() -{ - // Request is empty and OK - struct json_object* request_json = json_object_new_object(); - TRACE_DEBUG("CreateRequestGetAllSessions request_json:\n%s\n", json_object_to_json_string(request_json)); - - return std::string( json_object_to_json_string( request_json ) ); -} - diff --git a/libnavi/src/JsonResponseAnalyzer.cpp b/libnavi/src/JsonResponseAnalyzer.cpp deleted file mode 100644 index b0d943f..0000000 --- a/libnavi/src/JsonResponseAnalyzer.cpp +++ /dev/null @@ -1,254 +0,0 @@ -// Copyright 2017 AW SOFTWARE CO.,LTD -// Copyright 2017 AISIN AW CO.,LTD - -#include - -#include "JsonResponseAnalyzer.h" - -/** - * @brief Response analysis of navicore_getallroutes - * @param res_json JSON string of response - * @return Map information for the key sent in the request - */ -std::map< int32_t, naviapi::variant > JsonResponseAnalyzer::AnalyzeResponseGetPosition( std::string& res_json ) -{ - std::map< int32_t, naviapi::variant > ret; - - TRACE_DEBUG("AnalyzeResponseGetPosition json_obj:\n%s\n", json_object_to_json_string(json_obj)); - - // convert to Json Object - struct json_object *json_obj = json_tokener_parse( res_json.c_str() ); - - // Check key - struct json_object *json_map_ary = NULL; - if( json_object_object_get_ex(json_obj, "response", &json_map_ary) ) - { - // Check if the response is array information - if( json_object_is_type(json_map_ary, json_type_array) ) - { - for (int i = 0; i < json_object_array_length(json_map_ary); ++i) - { - struct json_object* j_elem = json_object_array_get_idx(json_map_ary, i); - - if( json_object_is_type( j_elem, json_type_object) ) - { - // Check key - struct json_object* key = NULL; - struct json_object* value = NULL; - if( json_object_object_get_ex(j_elem, "key", &key) - && json_object_object_get_ex(j_elem, "value", &value) ) - { - if( json_object_is_type(key, json_type_int) ) - { - uint32_t req_key = (uint32_t)json_object_get_int(key); - - switch( req_key ) - { - case naviapi::NAVICORE_LATITUDE: - ret[req_key]._double = json_object_get_double(value); - break; - - case naviapi::NAVICORE_LONGITUDE: - ret[req_key]._double = json_object_get_double(value); - break; - - case naviapi::NAVICORE_TIMESTAMP: - ret[req_key]._uint32_t = (uint32_t)json_object_get_int(value); - break; - - case naviapi::NAVICORE_HEADING: - ret[req_key]._uint32_t = (uint32_t)json_object_get_int(value); - break; - - case naviapi::NAVICORE_SPEED: - ret[req_key]._int32_t = json_object_get_int(value); - break; - - case naviapi::NAVICORE_SIMULATION_MODE: - ret[req_key]._bool = json_object_get_boolean(value); - break; - - default: - TRACE_WARN("unknown key type.\n"); - break; - } - } - } - } - else - { - TRACE_WARN("element type is not object.\n"); - break; - } - } - } - else - { - TRACE_WARN("response type is not array.\n"); - } - } - - json_object_put(json_obj); - return ret; -} - -/** - * @brief Response analysis of navicore_getallroutes - * @param res_json JSON string of response - * @return Route handle array - */ -std::vector< uint32_t > JsonResponseAnalyzer::AnalyzeResponseGetAllRoutes( std::string& res_json ) -{ - std::vector< uint32_t > routeList; - - TRACE_DEBUG("AnalyzeResponseGetAllRoutes json_obj:\n%s\n", json_object_to_json_string(json_obj)); - - // convert to Json Object - struct json_object *json_obj = json_tokener_parse( res_json.c_str() ); - - // Check key - struct json_object *json_route_ary = NULL; - if( json_object_object_get_ex(json_obj, "response", &json_route_ary) ) - { - // Check if the response is array information - if( json_object_is_type(json_route_ary, json_type_array) ) - { - for (int i = 0; i < json_object_array_length(json_route_ary); ++i) - { - struct json_object* j_elem = json_object_array_get_idx(json_route_ary, i); - - // Check that it is an element - struct json_object *json_route_obj = NULL; - if( json_object_object_get_ex(j_elem, "route", &json_route_obj) ) - { - // Check if it is an int value - if( json_object_is_type(json_route_obj, json_type_int) ) - { - uint32_t routeHandle = (uint32_t)json_object_get_int(json_route_obj); - routeList.push_back( routeHandle ); - } - else - { - TRACE_WARN("route value is not integer.\n"); - break; - } - } - else - { - TRACE_WARN("key route is not found.\n"); - break; - } - } - } - else - { - TRACE_WARN("response type is not array.\n"); - } - } - - json_object_put(json_obj); - return routeList; -} - -/** - * @brief Response analysis of navicore_createroute - * @param res_json JSON string of response - * @return Route handle - */ -uint32_t JsonResponseAnalyzer::AnalyzeResponseCreateRoute( std::string& res_json ) -{ - uint32_t routeHandle = 0; - - TRACE_DEBUG("AnalyzeResponseCreateRoute json_obj:\n%s\n", json_object_to_json_string(json_obj)); - - // convert to Json Object - struct json_object *json_obj = json_tokener_parse( res_json.c_str() ); - - // Check key - struct json_object *json_root_obj = NULL; - struct json_object *json_route_obj = NULL; - if( json_object_object_get_ex(json_obj, "response", &json_root_obj) - && json_object_object_get_ex(json_root_obj, "route", &json_route_obj) ) - { - // Check if the response is array information - if( json_object_is_type(json_route_obj, json_type_int) ) - { - // Get route handle - routeHandle = (uint32_t)json_object_get_int(json_route_obj); - } - else - { - TRACE_WARN("response type is not integer.\n"); - } - } - - json_object_put(json_obj); - return routeHandle; -} - -/** - * @brief Response analysis of navicore_getallsessions - * @param res_json JSON string of response - * @return Map of session information - */ -std::map JsonResponseAnalyzer::AnalyzeResponseGetAllSessions( std::string& res_json ) -{ - std::map session_map; - - TRACE_DEBUG("AnalyzeResponseGetAllSessions json_obj:\n%s\n", json_object_to_json_string(json_obj)); - - // convert to Json Object - struct json_object *json_obj = json_tokener_parse( res_json.c_str() ); - - // Check key - struct json_object *json_map_ary = NULL; - if( json_object_object_get_ex(json_obj, "response", &json_map_ary) ) - { - // Check if the response is array information - if( json_object_is_type(json_map_ary, json_type_array) ) - { - for (int i = 0; i < json_object_array_length(json_map_ary); ++i) - { - struct json_object* j_elem = json_object_array_get_idx(json_map_ary, i); - - if( json_object_is_type( j_elem, json_type_object) ) - { - // Check key - struct json_object* handle = NULL; - struct json_object* client = NULL; - if( json_object_object_get_ex(j_elem, "sessionHandle", &handle) - && json_object_object_get_ex(j_elem, "client", &client) ) - { - if( json_object_is_type(handle, json_type_int) - && json_object_is_type(client, json_type_string) ) - { - uint32_t sessionHandle = (uint32_t)json_object_get_int(handle); - std::string clientName = std::string( json_object_get_string(client) ); - - // add to map - session_map[sessionHandle] = clientName; - } - else - { - TRACE_WARN("invalid response.\n"); - break; - } - } - } - else - { - TRACE_WARN("element type is not object.\n"); - break; - } - } - } - else - { - TRACE_WARN("response type is not array.\n"); - } - } - - json_object_put(json_obj); - return session_map; -} - diff --git a/libnavi/src/RequestManage.cpp b/libnavi/src/RequestManage.cpp deleted file mode 100644 index 7db34e1..0000000 --- a/libnavi/src/RequestManage.cpp +++ /dev/null @@ -1,204 +0,0 @@ -// Copyright 2017 AW SOFTWARE CO.,LTD -// Copyright 2017 AISIN AW CO.,LTD - -#include -#include -#include -#include -#include -#include -#include -#include -#include "RequestManage.h" - -/** - * @brief constructor - */ -RequestManage::RequestManage() : listener(nullptr) -{ - // Callback setting - this->wsj1_itf.on_hangup = RequestManage::OnHangupStatic; - this->wsj1_itf.on_call = RequestManage::OnCallStatic; - this->wsj1_itf.on_event = RequestManage::OnEventStatic; - - pthread_cond_init(&this->cond, nullptr); - pthread_mutex_init(&this->mutex, nullptr); -} - -/** - * @brief Destructor - */ -RequestManage::~RequestManage() -{ -} - -void* RequestManage::BinderThread(void* param) -{ - RequestManage* instance = (RequestManage*) param; - sd_event *loop; - - int rc = sd_event_default(&loop); - if (rc < 0) { - TRACE_ERROR("connection to default event loop failed: %s\n", strerror(-rc)); - return nullptr; - } - - instance->wsj1 = afb_ws_client_connect_wsj1(loop, instance->requestURL->c_str(), &instance->wsj1_itf, nullptr); - if (instance->wsj1 == nullptr) - { - TRACE_ERROR("connection to %s failed: %m\n", api_url); - return nullptr; - } - - // Signal - pthread_mutex_unlock(&instance->mutex); - pthread_cond_signal(&instance->cond); - - while (1) - { - sd_event_run(loop, 1000 * 1000); // 1sec - } - - return nullptr; -} - -/** - * @brief Connect with a service - * @param URL - * @return Success or failure of connection - */ -bool RequestManage::Connect(const char* api_url, RequestManageListener* listener) -{ - this->listener = listener; - this->requestURL = new std::string(api_url); - - pthread_t thread_id; - pthread_create(&thread_id, nullptr, RequestManage::BinderThread, (void*)this); - - // Wait until response comes - pthread_mutex_lock(&this->mutex); - pthread_cond_wait(&this->cond, &this->mutex); - pthread_mutex_unlock(&this->mutex); - - if (this->wsj1 == nullptr) - { - return false; - } - - return true; -} - -/** - * @brief Connection status check with service - * @return Connection status - */ -bool RequestManage::IsConnect(){ - return (this->wsj1 != NULL); -} - -/** - * @brief Call Binder's API - * @param api api - * @param verb method - * @param req_json Json style request - * @return Success or failure of processing - */ -bool RequestManage::CallBinderAPI(const char* api, const char* verb, const char* req_json) -{ - // Send request - int rc = afb_wsj1_call_s(this->wsj1, api, verb, req_json, RequestManage::OnReplyStatic, this); - if (rc < 0) - { - TRACE_ERROR("calling %s/%s(%s) failed: %m\n", api, verb, req_json); - return false; - } - - return true; -} - -/** - * @brief Set session handle - * @param session Session handle - */ -void RequestManage::SetSessionHandle( uint32_t session ) -{ - this->sessionHandle = session; -} - -/** - * @brief Get session handle - * @return Session handle - */ -uint32_t RequestManage::GetSessionHandle() -{ - return this->sessionHandle; -} - -/** - * @brief Set route handle - * @param route Route handle - */ -void RequestManage::SetRouteHandle( uint32_t route ) -{ - this->routeHandle = route; -} - -/** - * @brief Get route handle - * @return Route handle - */ -uint32_t RequestManage::GetRouteHandle() -{ - return this->routeHandle; -} - -void RequestManage::OnReply(struct afb_wsj1_msg *msg) -{ - struct json_object * json = afb_wsj1_msg_object_j(msg); - - this->listener->OnReply(json); -} - -void RequestManage::OnHangup(struct afb_wsj1 *wsj1) -{ -} - -void RequestManage::OnCallStatic(const char *api, const char *verb, struct afb_wsj1_msg *msg) -{ -} - -void RequestManage::OnEventStatic(const char *event, struct afb_wsj1_msg *msg) -{ -} - - -/** - * @brief Answer callback from service - */ -void RequestManage::OnReplyStatic(void *closure, struct afb_wsj1_msg *msg) -{ - RequestManage* instance = (RequestManage *)closure; - instance->OnReply(msg); -} - -/** - * @brief Service hang notification - */ -void RequestManage::OnHangupStatic(void *closure, struct afb_wsj1 *wsj1) -{ - printf("DEBUG:%s:%d (%p,%p)\n", __func__, __LINE__, closure, wsj1); - fflush(stdout); -} - -void RequestManage::OnCallStatic(void *closure, const char *api, const char *verb, struct afb_wsj1_msg *msg) -{ - printf("DEBUG:%s:%d (%p,%s,%s,%p)\n", __func__, __LINE__, closure, api, verb, msg); - fflush(stdout); -} - -void RequestManage::OnEventStatic(void *closure, const char *event, struct afb_wsj1_msg *msg) -{ - printf("DEBUG:%s:%d (%p,%s,%p)\n", __func__, __LINE__, closure, event, msg); - fflush(stdout); -} - diff --git a/libnavi/src/navicore.cpp b/libnavi/src/navicore.cpp deleted file mode 100644 index 5402aa8..0000000 --- a/libnavi/src/navicore.cpp +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2017 AISIN AW CO.,LTD - -#include "libnavicore.hpp" -#include "BinderClient.h" - -static BinderClient mBinderClient; - -naviapi::Navicore::Navicore() -{ -} - -naviapi::Navicore::~Navicore() -{ -} - -bool naviapi::Navicore::connect(int argc, char *argv[], NavicoreListener* listener) -{ - this->mListener = listener; - - if (argc != 3) - { - printf("Error: argc != 3 : argc = %d\n", argc); - return false; - } - - char url[1024]; - sprintf(url, "ws://localhost:%d/api?token=%s", atoi(argv[1]), argv[2]); - - return mBinderClient.ConnectServer(url, this->mListener); -} - -void naviapi::Navicore::disconnect() -{ - // TODO -} - -void naviapi::Navicore::getAllSessions() -{ - mBinderClient.NavicoreGetAllSessions(); -} - -void naviapi::Navicore::getPosition(std::vector params) -{ - mBinderClient.NavicoreGetPosition(params); -} - -void naviapi::Navicore::getAllRoutes() -{ - mBinderClient.NavicoreGetAllRoutes(); -} - -void naviapi::Navicore::createRoute(uint32_t session) -{ - mBinderClient.NavicoreCreateRoute(session); -} - -void naviapi::Navicore::pauseSimulation(uint32_t session) -{ - mBinderClient.NavicorePauseSimulation(session); -} - -void naviapi::Navicore::setSimulationMode(uint32_t session, bool activate) -{ - mBinderClient.NavicoreSetSimulationMode(session, activate); -} - -void naviapi::Navicore::cancelRouteCalculation(uint32_t session, uint32_t routeHandle) -{ - mBinderClient.NavicoreCancelRouteCalculation(session, routeHandle); -} - -void naviapi::Navicore::setWaypoints(uint32_t session, uint32_t routeHandle, bool flag, std::vector waypoints) -{ - mBinderClient.NavicoreSetWaypoints(session, routeHandle, flag, waypoints); -} - -void naviapi::Navicore::calculateRoute(uint32_t session, uint32_t routeHandle) -{ - mBinderClient.NavicoreCalculateRoute(session, routeHandle); -} - diff --git a/libnavi/src/navicorelistener.cpp b/libnavi/src/navicorelistener.cpp deleted file mode 100644 index 2aa2b5d..0000000 --- a/libnavi/src/navicorelistener.cpp +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2017 AISIN AW CO.,LTD - -#include "libnavicore.hpp" - -naviapi::NavicoreListener::NavicoreListener() -{ -} - -naviapi::NavicoreListener::~NavicoreListener() -{ -} - -void naviapi::NavicoreListener::getAllSessions_reply(const std::map< uint32_t, std::string >& allSessions) -{ -} - -void naviapi::NavicoreListener::getPosition_reply(std::map< int32_t, variant > position) -{ -} - -void naviapi::NavicoreListener::getAllRoutes_reply(std::vector< uint32_t > allRoutes) -{ -} - -void naviapi::NavicoreListener::createRoute_reply(uint32_t routeHandle) -{ -} - diff --git a/libnaviapi-agl.pc.in b/libnaviapi-agl.pc.in deleted file mode 100644 index b7dcb60..0000000 --- a/libnaviapi-agl.pc.in +++ /dev/null @@ -1,14 +0,0 @@ -prefix=@CMAKE_INSTALL_PREFIX@ -exec_prefix=${prefix} -includedir=@PROJECT_INCLUDEDIR@ -libdir=@PROJECT_LIBDIR@ -binding_install_dir=@binding_install_dir@ - -Name: @PROJECT_PRETTY_NAME@ -Description: @PROJECT_DESCRIPTION@ -Version: @PROJECT_VERSION@ -URL: @PROJECT_URL@ - -Requires: json-c libafbwsc -Cflags: -I${includedir} -Libs: -L${libdir} -lnaviapi-agl diff --git a/navigation.png b/navigation.png deleted file mode 100644 index e7ad085b7f69407205ef04bb1a986c535529a13a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 38244 zcmd42g;yKh_dOh(Hc%*(26rzI8VZ!+1d3bH;uLqcpalY@6fY9=p)KyN0g6-HlHyR@ z-R+mp_x&f{tjwBZX3b>ox#ym<_c=RJ8fx;yPpO{*003e|1=$Y(0G8DMHbQ*Nk>U8f zV$2TLMp{)G0H}%s-kIZJzB5`Vd{6}dVC(=uNH_p+gEi$GongEy0-G6IX?g9++Q4|8K*R;mq*GTna*CzhKYeHuH@UGkhGgo1}=w1{W_MFE2ED zGhkDjf|OAz1b~H&OZfl84*&ha4&)@q#|EE`fS@y7rXg#5!LYZ_Y#INCVznYI0h$IDEwEN5eGyjdWd~$D zseRIc4=^vWY?3cccVe@02gG2%mGAh-{tnnHlK8Kdo}2cbW>&lb+_OsAU^vn+h2&Fb{);6-R~qO>HQS;J+?$ro3Ilf8)bWd8;S5Yg!=k)-|- za;+_qg&4H~dNi%wwQ8ENNJ{2J;Qr;LY`S)Qrcw%*G2nb26&l4-H{QsYZ|kJ0+9+f| z6D#K+Gp^wD_PKiazm@mm)XpqFG`v{#KWq?%wc+Kvy!5<}8Xeo%GiV45sgsim*?n=i zsYmvF()SfmOzK+>Zv0V@amQ1OjyFS=LI|q#3PANyo~Y^+QR#1v7oUkoaCogL?zbMxv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wcbaNY6-dU-9h3RgeG6EB<7PE=kIzplK4D}XUDEdOwvi&U!2D|T*_8;8apRR968p{ zIF_@Ejx$gJ^XxXck{B;&w0Ceu^WgQ zgqaZ&<+gi-O%$5%E&=zTtXo}eqA|X$&}wsJRL=*8tNSsj)NSu40k&jEHP~1%^Bw6M z)-q6+@@T*_Lav*IZntylvBxYXZP+)#1?nSH2ki~o@{c`^P9@HRG2fVr!;67yXC=%c z%l&x-f#g{vUO&n6-mZAgO#BJy1t^g!cNNmJwjw@hzIe;-dtNHjF>q6?x~S%1IuxQ3 z>EbocPI1fuZoKLD8byE|HT`9mW&Htx3NPie?#-b>cMGaFPxXSbUeAbq z!xoF0S?+4y3Lj?{WA8?0NYxhG;=$d5g&KXQmp{c8;NrH0$DVY@vW!D88A)yG*by(L zWy?bFg?K9o4jg&6Ve$-kmeW_191HgSn;b3f)C7w^#u(x!wwvPxS zIoCk3euTwpDdd7X_GO1aX;Vp_RzU>)Et=amzd~~v#yK0Si}+5^TzTq^BKhFx6lA~OQ-4PAlkhxrJzC#8 zd2k6;E1iRu7S)DY4GzzYNW38?65a>!)iDIlIeZw15f*guv_dB{CCC{3(rAHav4LS| zIssBCFTCzqY={s>gQ`3wMnVyKaAsE2E)=SlZqPxu08 zX=ol-)6`Pa(6Z9fI(h8GN$ulsq31~r4b^lx+yB=f5bNRV75SeVIDUTe8*U)}&l@bU qUZD}L!Ja@wL -#include -#include -#include - - -/** - * @brief Create arguments to pass to Genivi API GetPosition. - * @param[in] req_json_str JSON request from BinderClient - * @param[out] Params An array of key information you want to obtain - * @return Success or failure of processing - */ -bool AnalyzeRequest::CreateParamsGetPosition( const char* req_json_str, std::vector< int32_t >& Params) -{ - struct json_object *req_json = json_tokener_parse(req_json_str); - struct json_object* jValuesToReturn = NULL; - if( json_object_object_get_ex(req_json, "valuesToReturn", &jValuesToReturn) ) - { - if( json_object_is_type(jValuesToReturn, json_type_array) ) - { - for (int i = 0; i < json_object_array_length(jValuesToReturn); ++i) - { - struct json_object* j_elem = json_object_array_get_idx(jValuesToReturn, i); - - // JSON type acquisition - if( json_object_is_type(j_elem, json_type_int ) ) - { - int32_t req_key = json_object_get_int (j_elem); - - // no supported. - if ((NAVICORE_TIMESTAMP == req_key) || (NAVICORE_SPEED == req_key)) - { - continue; - } - Params.push_back(req_key); - } - else - { - fprintf(stdout, "key is not integer type.\n"); - return false; - } - } - } - else - { - fprintf(stdout, "request is not array type.\n"); - return false; - } - } - else - { - fprintf(stdout, "key valuesToReturn not found.\n"); - return false; - } - - return true; -} - - -/** - * @brief Create arguments to pass to Genivi API CreateRoute - * @param[in] req_json_str JSON request from BinderClient - * @param[out] sessionHdl Session handle - * @return Success or failure of processing - */ -bool AnalyzeRequest::CreateParamsCreateRoute( const char* req_json_str, uint32_t& sessionHdl ) -{ - // Get sessionHandle information - return JsonObjectGetSessionHdl(req_json_str, sessionHdl); -} - - -/** - * @brief Create arguments to pass to Genivi API PauseSimulation - * @param[in] req_json_str JSON request from BinderClient - * @param[out] sessionHdl Session handle - * @return Success or failure of processing - */ -bool AnalyzeRequest::CreateParamsPauseSimulation( const char* req_json_str, uint32_t& sessionHdl ) -{ - // Get sessionHandle information - return JsonObjectGetSessionHdl(req_json_str, sessionHdl); -} - - -/** - * @brief Create arguments to pass to Genivi API CreateRoute - * @param[in] req_json_str JSON request from BinderClient - * @param[out] sessionHdl Session handle - * @param[out] simuMode Simulation mode - * @return Success or failure of processing - */ -bool AnalyzeRequest::CreateParamsSetSimulationMode( const char* req_json_str, uint32_t& sessionHdl, bool& simuMode ) -{ - bool ret = false; - struct json_object *sess = NULL; - struct json_object *simu = NULL; - - struct json_object *req_json = json_tokener_parse(req_json_str); - if ((json_object_object_get_ex(req_json, "sessionHandle", &sess)) && - (json_object_object_get_ex(req_json, "simulationMode", &simu))) - { - if (json_object_is_type(sess, json_type_int) && - json_object_is_type(simu, json_type_boolean)) - { - sessionHdl = json_object_get_int(sess); - simuMode = json_object_get_int(simu); - ret = true; - } - else - { - fprintf(stdout, "key is invalid type.\n"); - } - } - else - { - fprintf(stdout, "key sessionHandle or simulationMode not found.\n"); - } - - return ret; -} - - -/** - * @brief Create arguments to pass to Genivi API CancelRouteCalculation - * @param[in] req_json_str JSON request from BinderClient - * @param[out] sessionHdl Session handle - * @param[out] routeHdl Route handle - * @return Success or failure of processing - */ -bool AnalyzeRequest::CreateParamsCancelRouteCalculation( const char* req_json_str, uint32_t& sessionHdl, uint32_t& routeHdl ) -{ - // Get sessionHandle, RouteHandle - return JsonObjectGetSessionHdlRouteHdl(req_json_str, sessionHdl, routeHdl); -} - - -/** - * @brief Create arguments to pass to Genivi API SetWaypoints - * @param[in] req_json_str JSON request from BinderClient - * @param[out] sessionHdl Session handle - * @param[out] routeHdl Route handle - * @param[out] currentPos Whether or not to draw a route from the position of the vehicle - * @param[out] waypointsList Destination coordinates - * @return Success or failure of processing - */ -bool AnalyzeRequest::CreateParamsSetWaypoints( const char* req_json_str, uint32_t& sessionHdl, uint32_t& routeHdl, - bool& currentPos, std::vector& waypointsList ) -{ - bool ret = false; - struct json_object *sess = NULL; - struct json_object *rou = NULL; - struct json_object *current = NULL; - struct json_object *wpl = NULL; - - struct json_object *req_json = json_tokener_parse(req_json_str); - if ((json_object_object_get_ex(req_json, "sessionHandle", &sess)) && - (json_object_object_get_ex(req_json, "route", &rou)) && - (json_object_object_get_ex(req_json, "startFromCurrentPosition", ¤t)) && - (json_object_object_get_ex(req_json, "", &wpl))) - { - if (json_object_is_type(sess, json_type_int) && - json_object_is_type(rou, json_type_int) && - json_object_is_type(current, json_type_boolean) && - json_object_is_type(wpl, json_type_array)) - { - sessionHdl = json_object_get_int(sess); - routeHdl = json_object_get_int(rou); - currentPos = json_object_get_boolean(current); - - // Get latitude, longitude - for (int i = 0; i < json_object_array_length(wpl); ++i) - { - struct json_object *array = json_object_array_get_idx(wpl, i); - struct json_object *lati = NULL; - struct json_object *longi = NULL; - - if (json_object_object_get_ex(array, "latitude", &lati) && - json_object_object_get_ex(array, "longitude", &longi)) { - - double latitude = json_object_get_double(lati); - double longitude = json_object_get_double(longi); - Waypoint destWp(latitude, longitude); - waypointsList.push_back(destWp); - ret = true; - } - else - { - fprintf(stdout, "key latitude or longitude not found.\n"); - } - } - } - else - { - fprintf(stdout, "key is invalid type.\n"); - } - } - else - { - fprintf(stdout, "key valuesToReturn not found.\n"); - } - - return ret; -} - - -/** - * @brief Create arguments to pass to Genivi API CalculateRoute - * @param[in] req_json_str JSON request from BinderClient - * @param[out] sessionHdl Session handle - * @param[out] routeHdl Route handle - * @return Success or failure of processing - */ -bool AnalyzeRequest::CreateParamsCalculateRoute( const char* req_json_str, uint32_t& sessionHdl, uint32_t& routeHdl ) -{ - // Get sessionHandle, RouteHandle - return JsonObjectGetSessionHdlRouteHdl(req_json_str, sessionHdl, routeHdl); -} - - -/** - * @brief Get session handle and route handle information from JSON - * @param[in] req_json_str JSON request from BinderClient - * @param[out] Session handle value - * @return Success or failure of processing - */ - -bool AnalyzeRequest::JsonObjectGetSessionHdl( const char* req_json_str, uint32_t& sessionHdl) -{ - bool ret = false; - struct json_object *sess = NULL; - - struct json_object *req_json = json_tokener_parse(req_json_str); - if (json_object_object_get_ex(req_json, "sessionHandle", &sess)) - { - if (json_object_is_type(sess, json_type_int)) - { - sessionHdl = json_object_get_int(sess); - ret = true; - } - else - { - fprintf(stdout, "key is not integer type.\n"); - } - } - else - { - fprintf(stdout, "key sessionHandle not found.\n"); - } - - return ret; -} - - -/** - * @brief Get session handle and route handle information from JSON - * @param[in] req_json_str JSON request from BinderClient - * @param[out] Session handle value - * @param[out] Route handle value - * @return Success or failure of processing - */ - -bool AnalyzeRequest::JsonObjectGetSessionHdlRouteHdl( const char* req_json_str, uint32_t& sessionHdl, uint32_t& routeHdl) -{ - bool ret = false; - struct json_object *sess = NULL; - struct json_object *rou = NULL; - - struct json_object *req_json = json_tokener_parse(req_json_str); - if ((json_object_object_get_ex(req_json, "sessionHandle", &sess)) && - (json_object_object_get_ex(req_json, "route", &rou))) - { - if (json_object_is_type(sess, json_type_int) && - json_object_is_type(rou, json_type_int)) - { - sessionHdl = json_object_get_int(sess); - routeHdl = json_object_get_int(rou); - ret = true; - } - else - { - fprintf(stdout, "key is not integer type.\n"); - } - } - else - { - fprintf(stdout, "key sessionHandle or route not found.\n"); - } - - return ret; -} diff --git a/src/api.cpp b/src/api.cpp deleted file mode 100644 index 8573b47..0000000 --- a/src/api.cpp +++ /dev/null @@ -1,419 +0,0 @@ -// Copyright 2017 AW SOFTWARE CO.,LTD -// Copyright 2017 AISIN AW CO.,LTD - -#include - -#include "binder_reply.h" -#include "genivi_request.h" -#include "analyze_request.h" -#include "genivi/genivi-navicore-constants.h" - -#define AFB_BINDING_VERSION 2 - -extern "C" { - #include -} - -/** - * Variable declaration - */ -GeniviRequest* geniviRequest; // Send request to Genivi -BinderReply* binderReply; // Convert Genivi response result to json format -AnalyzeRequest* analyzeRequest; // Analyze BinderClient's request and create arguments to pass to GeniviAPI - -/** - * @brief navicore_getposition request callback - * @param[in] req Request from client - */ -void OnRequestNavicoreGetPosition(afb_req req) -{ - AFB_REQ_NOTICE(req, "--> Start %s()", __func__); - AFB_REQ_DEBUG(req, "request navicore_getposition"); - - // Request of Json format request - json_object* req_json = afb_req_json(req); - const char* req_json_str = json_object_to_json_string(req_json); - AFB_REQ_NOTICE(req, "req_json_str = %s", req_json_str); - - // Request analysis and create arguments to pass to Genivi - std::vector< int32_t > Params; - if( !analyzeRequest->CreateParamsGetPosition( req_json_str, Params )) - { - afb_req_fail(req, "failed", "navicore_getposition Bad Request"); - return; - } - - // GENIVI API call - std::map< int32_t, double > posList = geniviRequest->NavicoreGetPosition( Params ); - - // Convert to json style response - APIResponse response = binderReply->ReplyNavicoreGetPosition( posList ); - - // On success - if(response.isSuccess) - { - AFB_REQ_NOTICE(req, "res_json_str = %s", json_object_to_json_string(response.json_data)); - // Return success to BinderClient - afb_req_success(req, response.json_data, "navicore_getposition"); - } - else - { - AFB_REQ_ERROR(req, "%s - %s:%d", response.errMessage.c_str(), __FILE__, __LINE__); - afb_req_fail(req, "failed", "navicore_getposition Bad Request"); - - // Json object release - json_object_put(response.json_data); - } - - AFB_REQ_NOTICE(req, "<-- End %s()", __func__); -} - - -/** - * @brief navicore_getallroutes request callback - * @param[in] req Request from client - */ -void OnRequestNavicoreGetAllRoutes(afb_req req) -{ - AFB_REQ_NOTICE(req, "--> Start %s()", __func__); - AFB_REQ_DEBUG(req, "request navicore_getallroutes"); - - // No request information in json format - AFB_REQ_NOTICE(req, "req_json_str = none"); - - // GENEVI API call - std::vector< uint32_t > allRoutes = geniviRequest->NavicoreGetAllRoutes(); - - // Convert to json style response - APIResponse response = binderReply->ReplyNavicoreGetAllRoutes( allRoutes ); - - // On success - if(response.isSuccess) - { - AFB_REQ_NOTICE(req, "res_json_str = %s", json_object_to_json_string(response.json_data)); - // Return success to BinderClient - afb_req_success(req, response.json_data, "navicore_getallroutes"); - } - else - { - AFB_REQ_ERROR(req, "%s - %s:%d", response.errMessage.c_str(), __FILE__, __LINE__); - afb_req_fail(req, "failed", "navicore_getallroutes Bad Request"); - - // json object release - json_object_put(response.json_data); - } - - AFB_REQ_NOTICE(req, "<-- End %s()", __func__); -} - - -/** - * @brief navicore_createroute request callback - * @param[in] req Request from client - */ -void OnRequestNavicoreCreateRoute(afb_req req) -{ - AFB_REQ_NOTICE(req, "--> Start %s ", __func__); - AFB_REQ_DEBUG(req, "request navicore_createroute"); - - // Request of json format request - json_object* req_json = afb_req_json(req); - const char* req_json_str = json_object_to_json_string(req_json); - AFB_REQ_NOTICE(req, "req_json_str = %s", req_json_str); - - // Request analysis and create arguments to pass to Genivi - uint32_t sessionHdl = 0; - if( !analyzeRequest->CreateParamsCreateRoute( req_json_str, sessionHdl )) - { - afb_req_fail(req, "failed", "navicore_createroute Bad Request"); - return; - } - - // GENEVI API call - uint32_t routeHdl = geniviRequest->NavicoreCreateRoute( sessionHdl ); - - // Convert to json style response - APIResponse response = binderReply->ReplyNavicoreCreateRoute( routeHdl ); - - // On success - if(response.isSuccess) - { - AFB_REQ_NOTICE(req, "res_json_str = %s", json_object_to_json_string(response.json_data)); - // Return success to BinderClient - afb_req_success(req, response.json_data, "navicore_createroute"); - } - else - { - AFB_REQ_ERROR(req, "%s - %s:%d", response.errMessage.c_str(), __FILE__, __LINE__); - afb_req_fail(req, "failed", "navicore_createroute Bad Request"); - - // json object release - json_object_put(response.json_data); - } - - AFB_REQ_NOTICE(req, "<-- End %s()", __func__); -} - - -/** - * @brief navicore_pausesimulation request callback - * @param[in] req Request from client - */ -void OnRequestNavicorePauseSimulation(afb_req req) -{ - AFB_REQ_NOTICE(req, "--> Start %s()", __func__); - AFB_REQ_DEBUG(req, "request navicore_pausesimulation"); - - // Request of json format request - json_object* req_json = afb_req_json(req); - const char* req_json_str = json_object_to_json_string(req_json); - AFB_REQ_NOTICE(req, "req_json_str = %s", req_json_str); - - // Request analysis and create arguments to pass to Genivi - uint32_t sessionHdl = 0; - if( !analyzeRequest->CreateParamsPauseSimulation( req_json_str, sessionHdl )) - { - afb_req_fail(req, "failed", "navicore_pausesimulation Bad Request"); - return; - } - - // GENEVI API call - geniviRequest->NavicorePauseSimulation( sessionHdl ); - - // No reply unnecessary API for conversion to json format response is unnecessary - AFB_REQ_NOTICE(req, "res_json_str = none"); - - // Return success to BinderClient - afb_req_success(req, NULL, "navicore_pausesimulation"); - - AFB_REQ_NOTICE(req, "<-- End %s()", __func__); -} - - -/** - * @brief navicore_setsimulationmode request callback - * @param[in] req Request from client - */ -void OnRequestNavicoreSetSimulationMode(afb_req req) -{ - AFB_REQ_NOTICE(req, "--> Start %s()", __func__); - AFB_REQ_DEBUG(req, "request navicore_setsimulationmode"); - - // Request of json format request - json_object* req_json = afb_req_json(req); - const char* req_json_str = json_object_to_json_string(req_json); - AFB_REQ_NOTICE(req, "req_json_str = %s", req_json_str); - - // Request analysis and create arguments to pass to Genivi - uint32_t sessionHdl = 0; - bool simuMode = false; - if( !analyzeRequest->CreateParamsSetSimulationMode( req_json_str, sessionHdl, simuMode )) - { - afb_req_fail(req, "failed", "navicore_setsimulationmode Bad Request"); - return; - } - - // GENEVI API call - geniviRequest->NavicoreSetSimulationMode( sessionHdl, simuMode ); - - // No reply unnecessary API for conversion to json format response is unnecessary - AFB_REQ_NOTICE(req, "res_json_str = none"); - - // Return success to BinderClient - afb_req_success(req, NULL, "navicore_setsimulationmode"); - - AFB_REQ_NOTICE(req, "<-- End %s()", __func__); -} - - -/** - * @brief navicore_cancelroutecalculation request callback - * @param[in] req Request from client - */ -void OnRequestNavicoreCancelRouteCalculation(afb_req req) -{ - AFB_REQ_NOTICE(req, "--> Start %s()", __func__); - AFB_REQ_DEBUG(req, "request navicore_cancelroutecalculation"); - - // Request of Json format request - json_object* req_json = afb_req_json(req); - const char* req_json_str = json_object_to_json_string(req_json); - AFB_REQ_NOTICE(req, "req_json_str = %s", req_json_str); - - // Request analysis and create arguments to pass to Genivi - uint32_t sessionHdl = 0; - uint32_t routeHdl = 0; - if( !analyzeRequest->CreateParamsCancelRouteCalculation( req_json_str, sessionHdl, routeHdl )) - { - afb_req_fail(req, "failed", "navicore_cancelroutecalculation Bad Request"); - return; - } - - // GENEVI API call - geniviRequest->NavicoreCancelRouteCalculation( sessionHdl, routeHdl ); - - // No reply unnecessary API for conversion to json format response is unnecessary - AFB_REQ_NOTICE(req, "res_json_str = none"); - - // Return success to BinderClient - afb_req_success(req, NULL, "navicore_cancelroutecalculation"); - - AFB_REQ_NOTICE(req, "<-- End %s()", __func__); -} - - -/** - * @brief navicore_setwaypoints request callback - * @param[in] req Request from client - */ -void OnRequestNavicoreWaypoints(afb_req req) -{ - AFB_REQ_NOTICE(req, "--> Start %s()", __func__); - AFB_REQ_DEBUG(req, "request navicore_setwaypoints"); - - // Request of Json format request - json_object* req_json = afb_req_json(req); - const char* req_json_str = json_object_to_json_string(req_json); - AFB_REQ_NOTICE(req, "req_json_str = %s", req_json_str); - - // Request analysis and create arguments to pass to Genivi - uint32_t sessionHdl = 0; - uint32_t routeHdl = 0; - bool currentPos = false; - std::vector waypointsList; - if( !analyzeRequest->CreateParamsSetWaypoints( req_json_str, sessionHdl, routeHdl, currentPos, waypointsList )) - { - afb_req_fail(req, "failed", "navicore_setwaypoints Bad Request"); - return; - } - - // GENEVI API call - geniviRequest->NavicoreSetWaypoints( sessionHdl, routeHdl, currentPos, waypointsList ); - - // No reply unnecessary API for conversion to json format response is unnecessary - AFB_REQ_NOTICE(req, "res_json_str = none"); - - // Return success to BinderClient - afb_req_success(req, NULL, "navicore_setwaypoints"); - - AFB_REQ_NOTICE(req, "<-- End %s()", __func__); -} - - -/** - * @brief navicore_calculateroute request callback - * @param[in] req Request from client - */ -void OnRequestNavicoreCalculateRoute(afb_req req) -{ - AFB_REQ_NOTICE(req, "--> Start %s()", __func__); - AFB_REQ_DEBUG(req, "request navicore_calculateroute"); - - // Request of Json format request - json_object* req_json = afb_req_json(req); - const char* req_json_str = json_object_to_json_string(req_json); - AFB_REQ_NOTICE(req, "req_json_str = %s", req_json_str); - - // Request analysis and create arguments to pass to Genivi - uint32_t sessionHdl = 0; - uint32_t routeHdl = 0; - if( !analyzeRequest->CreateParamsCalculateRoute( req_json_str, sessionHdl, routeHdl )) - { - afb_req_fail(req, "failed", "navicore_calculateroute Bad Request"); - return; - } - - // GENEVI API call - geniviRequest->NavicoreCalculateRoute( sessionHdl, routeHdl ); - - // No reply unnecessary API for conversion to json format response is unnecessary - AFB_REQ_NOTICE(req, "res_json_str = none"); - - // Return success to BinderClient - afb_req_success(req, NULL, "navicore_calculateroute"); - - AFB_REQ_NOTICE(req, "<-- End %s()", __func__); -} - - -/** - * @brief navicore_getallsessions request callback - * @param[in] req Request from client - */ -void OnRequestNavicoreGetAllSessions(afb_req req) -{ - AFB_REQ_NOTICE(req, "--> Start %s()", __func__); - AFB_REQ_DEBUG(req, "request navicore_getallsessions"); - - // No request information in Json format - AFB_REQ_NOTICE(req, "req_json_str = none"); - - // GENEVI API call - std::map allSessions = geniviRequest->NavicoreGetAllSessions(); - - // Convert to json style response - APIResponse response = binderReply->ReplyNavicoreGetAllSessions( allSessions ); - - // On success - if(response.isSuccess) - { - AFB_REQ_NOTICE(req, "res_json_str = %s", json_object_to_json_string(response.json_data)); - // Return success to BinderClient - afb_req_success(req, response.json_data, "navicore_getallsessions"); - } - else - { - AFB_REQ_ERROR(req, "%s - %s:%d", response.errMessage.c_str(), __FILE__, __LINE__); - afb_req_fail(req, "failed", "navicore_getallsessions Bad Request"); - - // json object release - json_object_put(response.json_data); - } - - AFB_REQ_NOTICE(req, "<-- End %s()", __func__); -} - - -/** - * @brief Callback called at service startup - */ -int Init() -{ - // Create instance - geniviRequest = new GeniviRequest(); - binderReply = new BinderReply(); - analyzeRequest = new AnalyzeRequest(); - - return 0; -} - -/** - * @brief API definition - */ -const afb_verb_v2 verbs[] = -{ - { verb : "navicore_getposition", callback : OnRequestNavicoreGetPosition }, - { verb : "navicore_getallroutes", callback : OnRequestNavicoreGetAllRoutes }, - { verb : "navicore_createroute", callback : OnRequestNavicoreCreateRoute }, - { verb : "navicore_pausesimulation", callback : OnRequestNavicorePauseSimulation }, - { verb : "navicore_setsimulationmode", callback : OnRequestNavicoreSetSimulationMode }, - { verb : "navicore_cancelroutecalculation", callback : OnRequestNavicoreCancelRouteCalculation }, - { verb : "navicore_setwaypoints", callback : OnRequestNavicoreWaypoints }, - { verb : "navicore_calculateroute", callback : OnRequestNavicoreCalculateRoute }, - { verb : "navicore_getallsessions", callback : OnRequestNavicoreGetAllSessions }, - { verb : NULL } -}; - -/** - * @brief Service definition - */ -const afb_binding_v2 afbBindingV2 = -{ - "naviapi", - "", - "", - verbs, - NULL, - Init -}; - diff --git a/src/binder_reply.cpp b/src/binder_reply.cpp deleted file mode 100644 index 172a22a..0000000 --- a/src/binder_reply.cpp +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright 2017 AW SOFTWARE CO.,LTD -// Copyright 2017 AISIN AW CO.,LTD - -#include "binder_reply.h" -#include "genivi/genivi-navicore-constants.h" - -/** - * @brief GeniviAPI GetPosition call - * @param[in] posList Map information on key and value of information acquired from Genivi - * @return Response information - */ -APIResponse BinderReply::ReplyNavicoreGetPosition( std::map& posList ) -{ - APIResponse response = {0}; - - // Json information to return as a response - struct json_object* response_json = json_object_new_array(); - std::map::iterator it; - - // If the argument map is empty return - if(posList.empty()) - { - response.isSuccess = false; - response.errMessage = "posList is empty"; - response.json_data = response_json; - return response; - } - - // Make the passed Genivi response json format - for (it = posList.begin(); it != posList.end(); it++) - { - struct json_object* obj = json_object_new_object(); - - switch(it->first) - { - case NAVICORE_LATITUDE: - json_object_object_add(obj, "key", json_object_new_int(NAVICORE_LATITUDE)); - json_object_object_add(obj, "value", json_object_new_double(it->second) ); - json_object_array_add(response_json, obj); - break; - - case NAVICORE_LONGITUDE: - json_object_object_add(obj, "key", json_object_new_int(NAVICORE_LONGITUDE)); - json_object_object_add(obj, "value", json_object_new_double(it->second)); - json_object_array_add(response_json, obj); - break; - - case NAVICORE_HEADING: - json_object_object_add(obj, "key", json_object_new_int(NAVICORE_HEADING)); - json_object_object_add(obj, "value", json_object_new_boolean (it->second)); - json_object_array_add(response_json, obj); - break; -#if 0 - // no support - case NAVICORE_TIMESTAMP: - json_object_object_add(obj, "key", json_object_new_int(NAVICORE_TIMESTAMP)); - json_object_object_add(obj, "value", json_object_new_int(it->second)); - json_object_array_add(response_json, obj); - break; - - // no support - case NAVICORE_SPEED: - json_object_object_add(obj, "key", json_object_new_int(NAVICORE_SPEED)); - json_object_object_add(obj, "value", json_object_new_int(it->second)); - json_object_array_add(response_json, obj); - break; -#endif - - case NAVICORE_SIMULATION_MODE: - json_object_object_add(obj, "key", json_object_new_int(NAVICORE_SIMULATION_MODE)); - json_object_object_add(obj, "value", json_object_new_boolean (it->second)); - json_object_array_add(response_json, obj); - break; - - default: - fprintf(stderr, "Unknown key."); - json_object_put(obj); - break; - } - } - - response.json_data = response_json; - response.isSuccess = true; - return response; -} - -/** - * @brief GeniviAPI GetAllRoutes call - * @param[in] allRoutes Route handle information - * @return Response information - */ -APIResponse BinderReply::ReplyNavicoreGetAllRoutes( std::vector< uint32_t > &allRoutes ) -{ - APIResponse response = {0}; - - // Json information to return as a response - struct json_object* response_json = json_object_new_array(); - - if (0 < allRoutes.size()) - { - std::vector< uint32_t >::iterator it; - - for (it = allRoutes.begin(); it != allRoutes.end(); it++) - { - struct json_object* obj = json_object_new_object(); - json_object_object_add(obj, "route", json_object_new_int(*it)); - json_object_array_add(response_json, obj); - } - } - - response.json_data = response_json; - response.isSuccess = true; - return response; -} - -/** - * @brief GeniviAPI CreateRoute call - * @param[in] route Route handle - * @return Response information - */ -APIResponse BinderReply::ReplyNavicoreCreateRoute( uint32_t route ) -{ - APIResponse response; - - // Json information to return as a response - struct json_object* response_json = json_object_new_object(); - json_object_object_add(response_json, "route", json_object_new_int(route)); - - response.json_data = response_json; - response.isSuccess = true; - return response; -} - -/** - * @brief GeniviAPI GetAllSessions call - * @param[in] allSessions Map information on key and value of information acquired from Genivi - * @return Response information - */ -APIResponse BinderReply::ReplyNavicoreGetAllSessions( std::map &allSessions ) -{ - APIResponse response = {0}; - - // Json information to return as a response - struct json_object* response_json = json_object_new_array(); - std::map::iterator it; - - for (it = allSessions.begin(); it != allSessions.end(); it++) - { - struct json_object* obj = json_object_new_object(); - - if (NAVICORE_INVALID != it->first) - { - json_object_object_add(obj, "sessionHandle", json_object_new_int(it->first)); - json_object_object_add(obj, "client", json_object_new_string(it->second.c_str())); - json_object_array_add(response_json, obj); - } - else - { - fprintf(stderr, "invalid key."); - json_object_put(obj); - } - } - - response.json_data = response_json; - response.isSuccess = true; - return response; -} - diff --git a/src/genivi_request.cpp b/src/genivi_request.cpp deleted file mode 100644 index a485667..0000000 --- a/src/genivi_request.cpp +++ /dev/null @@ -1,350 +0,0 @@ -// Copyright 2017 AW SOFTWARE CO.,LTD -// Copyright 2017 AISIN AW CO.,LTD - -#include "genivi/navicore.h" -#include "genivi/genivi-navicore-constants.h" -#include "genivi_request.h" -#include -#include -#include - -/** - * @brief Destructor - */ -GeniviRequest::~GeniviRequest() -{ - delete (Navicore*)navicore_; - navicore_ = NULL; -} - -/** - * @brief DBus session creation - */ -void GeniviRequest::CreateDBusSession( ) -{ - try - { - static DBus::BusDispatcher dispatcher; - DBus::default_dispatcher = &dispatcher; - DBus::Connection conn = DBus::Connection::SessionBus(); - - navicore_ = new Navicore(conn, "/org/genivi/navicore", "org.agl.naviapi"); - } - catch(const std::exception& e) - { - fprintf(stderr, "Error:%s\n", e.what()); - } -} - -/** - * @brief Check connection status - * @return Presence / absence of connection - */ -bool GeniviRequest::CheckSession() -{ - if(this->navicore_ == NULL) - { - this->CreateDBusSession(); - } - - try - { - // Get connection status - DBus::Connection conn = ((Navicore*)navicore_)->conn(); - bool isConnect = conn.connected(); - - // If it is not connected, it issues an error - if(!isConnect) - { - fprintf(stderr, "Service has no session.\n"); - } - - return isConnect; - } - catch(const std::exception& e) - { - fprintf(stderr, "Error:%s\n", e.what()); - return false; - } -} - -/** - * @brief Call GeniviAPI GetPosition to get information - * @param[in] valuesToReturn Key arrangement of information acquired from Genivi - * @return Map information on key and value of information acquired from Genivi - */ -std::map< int32_t, double > GeniviRequest::NavicoreGetPosition( const std::vector< int32_t >& valuesToReturn ) -{ - std::map< int32_t, double > ret; - - if( !CheckSession() ) - { - return ret; - } - - try - { - std::map< int32_t, ::DBus::Struct< uint8_t, ::DBus::Variant > >::iterator it; - std::map< int32_t, ::DBus::Struct< uint8_t, ::DBus::Variant > > PosList = - ((Navicore*)navicore_)->GetPosition(valuesToReturn); - for (it = PosList.begin(); it != PosList.end(); it++) - { - if (it->first == NAVICORE_LATITUDE || it->second._1 == NAVICORE_LATITUDE) - { - ret[it->first] = it->second._2.reader().get_double(); - } - else if (it->first == NAVICORE_LONGITUDE || it->second._1 == NAVICORE_LONGITUDE) - { - ret[it->first] = it->second._2.reader().get_double(); - } - else if (it->first == NAVICORE_HEADING || it->second._1 == NAVICORE_HEADING) - { - ret[it->first] = it->second._2.reader().get_uint32(); - } -#if 0 // no supported - else if (it->first == NAVICORE_TIMESTAMP || it->second._1 == NAVICORE_TIMESTAMP) - { - ret[it->first] = it->second._2.reader().get_uint32(); - } - else if (it->first == NAVICORE_SPEED || it->second._1 == NAVICORE_SPEED) - { - ret[it->first] = it->second._2.reader().get_int32(); - } -#endif - else if (it->first == NAVICORE_SIMULATION_MODE || it->second._1 == NAVICORE_SIMULATION_MODE) - { - ret[it->first] = it->second._2.reader().get_bool(); - } - } - } - catch(const std::exception& e) - { - fprintf(stderr, "Error:%s\n", e.what()); - } - - return ret; -} - -/** - * @brief Call GeniviAPI GetPosition to get information - * @return Route handle acquired from Genivi - */ -std::vector< uint32_t > GeniviRequest::NavicoreGetAllRoutes( void ) -{ - if( !CheckSession() ) - { - std::vector< uint32_t > no_route; - return no_route; - } - - std::vector< uint32_t > allRoutes; - try - { - allRoutes = ((Navicore*)navicore_)->GetAllRoutes(); - } - catch(const std::exception& e) - { - fprintf(stderr, "Error:%s\n", e.what()); - } - - return allRoutes; -} - - -/** - * @brief Call GeniviAPI GetPosition to get information - * @param[in] sessionHandle Session handle - * @return Route handle acquired from Genivi - */ -uint32_t GeniviRequest::NavicoreCreateRoute( const uint32_t& sessionHandle ) -{ - if( !CheckSession() ) - { - return 0; - } - - uint32_t routeHandle = 0; - try - { - routeHandle = ((Navicore*)navicore_)->CreateRoute(sessionHandle); - } - catch(const std::exception& e) - { - fprintf(stderr, "Error:%s\n", e.what()); - } - - return routeHandle; -} - -/** - * @brief Call GeniviAPI PauseSimulation - * @param[in] sessionHandle Session handle - */ -void GeniviRequest::NavicorePauseSimulation( const uint32_t& sessionHandle ) -{ - if( !CheckSession() ) - { - return; - } - - try - { - ((Navicore*)navicore_)->PauseSimulation(sessionHandle); - } - catch(const std::exception& e) - { - fprintf(stderr, "Error:%s\n", e.what()); - } -} - - -/** - * @brief Call GeniviAPI SetSimulationMode - * @param[in] sessionHandle Session handle - * @param[in] activate Simulation mode enabled / disabled - */ -void GeniviRequest::NavicoreSetSimulationMode( const uint32_t& sessionHandle, const bool& activate ) -{ - if( !CheckSession() ) - { - return; - } - - try - { - ((Navicore*)navicore_)->SetSimulationMode(sessionHandle, activate); - } - catch(const std::exception& e) - { - fprintf(stderr, "Error:%s\n", e.what()); - } -} - - -/** - * @brief Call GeniviAPI SetSimulationMode - * @param[in] sessionHandle Session handle - * @param[in] routeHandle Route handle - */ -void GeniviRequest::NavicoreCancelRouteCalculation( const uint32_t& sessionHandle, const uint32_t& routeHandle ) -{ - if( !CheckSession() ) - { - return; - } - - try - { - ((Navicore*)navicore_)->CancelRouteCalculation(sessionHandle, routeHandle); - } - catch(const std::exception& e) - { - fprintf(stderr, "Error:%s\n", e.what()); - } -} - -/** - * @brief Call GeniviAPI SetWaypoints - * @param[in] sessionHandle Session handle - * @param[in] routeHandle Route handle - * @param[in] startFromCurrentPosition Whether or not to draw a route from the position of the vehicle - * @param[in] waypointsList Destination coordinates - */ -void GeniviRequest::NavicoreSetWaypoints( const uint32_t& sessionHandle, const uint32_t& routeHandle, - const bool& startFromCurrentPosition, const std::vector& waypointsList ) -{ - if( !CheckSession() ) - { - return; - } - - std::vector::const_iterator it; - std::vector< std::map< int32_t, ::DBus::Struct< uint8_t, ::DBus::Variant > > > wpl; - - fprintf(stdout, "session: %d, route: %d, startFromCurrentPosition: %d\n", - sessionHandle, routeHandle, startFromCurrentPosition); - - for (it = waypointsList.begin(); it != waypointsList.end(); it++) - { - std::map< int32_t, ::DBus::Struct< uint8_t, ::DBus::Variant > > Point; - ::DBus::Struct< uint8_t, ::DBus::Variant > VarLat, VarLon; - - VarLat._1 = NAVICORE_LATITUDE; - VarLat._2.writer().append_double(std::get<0>(*it)); - fprintf(stdout, "VarLat._1 : %x, VarLat._2 : %lf\n", VarLat._1, VarLat._2.reader().get_double()); - - VarLon._1 = NAVICORE_LONGITUDE; - VarLon._2.writer().append_double(std::get<1>(*it)); - fprintf(stdout, "VarLon._1 : %x, VarLon._2 : %lf\n", VarLon._1, VarLon._2.reader().get_double()); - - Point[NAVICORE_LATITUDE] = VarLat; - Point[NAVICORE_LONGITUDE] = VarLon; - - wpl.push_back(Point); - } - - try - { - ((Navicore*)navicore_)->SetWaypoints(sessionHandle, routeHandle, startFromCurrentPosition, wpl); - } - catch(const std::exception& e) - { - fprintf(stderr, "Error:%s\n", e.what()); - } -} - -/** - * @brief Call GeniviAPI CalculateRoute - * @param[in] sessionHandle Session handle - * @param[in] routeHandle Route handle - */ -void GeniviRequest::NavicoreCalculateRoute( const uint32_t& sessionHandle, const uint32_t& routeHandle ) -{ - if( !CheckSession() ) - { - return; - } - - try - { - ((Navicore*)navicore_)->CalculateRoute(sessionHandle, routeHandle); - } - catch(const std::exception& e) - { - fprintf(stderr, "Error:%s\n", e.what()); - } -} - - -/** - * @brief Call GeniviAPI CalculateRoute - * @return Map information on key and value of information acquired from Genivi - */ -std::map GeniviRequest::NavicoreGetAllSessions() -{ - std::map ret; - - if( !CheckSession() ) - { - return ret; - } - - std::vector< ::DBus::Struct< uint32_t, std::string > > ncAllSessions; - std::vector< ::DBus::Struct< uint32_t, std::string > >::iterator it; - - try - { - ncAllSessions = ((Navicore*)navicore_)->GetAllSessions(); - for (it = ncAllSessions.begin(); it != ncAllSessions.end(); it++) - { - ret[it->_1] = it->_2; - } - } - catch(const std::exception& e) - { - fprintf(stderr, "Error:%s\n", e.what()); - } - - return ret; -} - diff --git a/src/traces.h b/src/traces.h deleted file mode 100644 index a1f96ec..0000000 --- a/src/traces.h +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2017 AISIN AW CO.,LTD - -#ifndef __TRACE_H__ -#define __TRACE_H__ - -#include - -#define BLACK "\033[30m" -#define RED "\033[31m" -#define GREEN "\033[32m" -#define YELLOW "\033[33m" -#define BLUE "\033[34m" -#define PURPLE "\033[35m" -#define DGREEN "\033[6m" -#define WHITE "\033[7m" -#define CYAN "\x1b[36m" -#define NONE "\033[0m" - -#ifdef NDEBUG - -#define TRACE_DEBUG_JSON(fmt, args...) -#define TRACE_DEBUG(fmt, args...) -#define TRACE_INFO(fmt, args...) -#define TRACE_WARN(fmt, args...) -#define TRACE_ERROR(fmt, args...) - -#else - -#define TRACE_DEBUG(fmt, args...) do { fprintf(stderr, "[%s:%d] " CYAN "DEBUG" NONE ": " fmt "\n", __func__, __LINE__, ##args); } while(0) -#define TRACE_INFO(fmt, args...) do { fprintf(stderr, "[%s:%d] " GREEN "INFO" NONE ": " fmt "\n", __func__, __LINE__, ##args); } while(0) -#define TRACE_WARN(fmt, args...) do { fprintf(stderr, "[%s:%d] " YELLOW "WARN" NONE": " fmt "\n", __func__, __LINE__, ##args); } while(0) -#define TRACE_ERROR(fmt, args...) do { fprintf(stderr, "[%s:%d] " RED "ERROR" NONE ": " fmt "\n", __func__, __LINE__, ##args); } while(0) - -#define TRACE_DEBUG_JSON(fmt, args...) - -#endif - -#endif // __TRACE_H__ -- 2.16.6