summaryrefslogtreecommitdiffstats
path: root/libnavi/src/navicore.cpp
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2019-08-30 11:40:23 -0400
committerScott Murray <scott.murray@konsulko.com>2019-08-30 11:42:40 -0400
commitf14ecdd52975ae365af5ed32648bf55dddacb8d9 (patch)
treee33d2af8d2e129b372caf34afac37366b641553a /libnavi/src/navicore.cpp
parentdd61aa309b3a082488c9d3c383c1601fd3efbc2a (diff)
Initial check in
Initial check in of contents of the original repository: git://github.com/AGLExport/agl-service-navigation as of commit 1f1ffc92fcc882aa5e885badbc91a3384f5d77b1. Bug-AGL: SPEC-2787 Signed-off-by: Scott Murray <scott.murray@konsulko.com> Change-Id: I02d008ee73cdfd88f1e7587ee57101187b9c4d6d
Diffstat (limited to 'libnavi/src/navicore.cpp')
-rw-r--r--libnavi/src/navicore.cpp81
1 files changed, 81 insertions, 0 deletions
diff --git a/libnavi/src/navicore.cpp b/libnavi/src/navicore.cpp
new file mode 100644
index 0000000..5402aa8
--- /dev/null
+++ b/libnavi/src/navicore.cpp
@@ -0,0 +1,81 @@
+// 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<int32_t> 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<Waypoint> waypoints)
+{
+ mBinderClient.NavicoreSetWaypoints(session, routeHandle, flag, waypoints);
+}
+
+void naviapi::Navicore::calculateRoute(uint32_t session, uint32_t routeHandle)
+{
+ mBinderClient.NavicoreCalculateRoute(session, routeHandle);
+}
+