diff options
author | Scott Murray <scott.murray@konsulko.com> | 2019-08-30 11:40:23 -0400 |
---|---|---|
committer | Scott Murray <scott.murray@konsulko.com> | 2019-08-30 11:42:40 -0400 |
commit | f14ecdd52975ae365af5ed32648bf55dddacb8d9 (patch) | |
tree | e33d2af8d2e129b372caf34afac37366b641553a /libnavi/include/libnavicore.hpp | |
parent | dd61aa309b3a082488c9d3c383c1601fd3efbc2a (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/include/libnavicore.hpp')
-rw-r--r-- | libnavi/include/libnavicore.hpp | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/libnavi/include/libnavicore.hpp b/libnavi/include/libnavicore.hpp new file mode 100644 index 0000000..66200d9 --- /dev/null +++ b/libnavi/include/libnavicore.hpp @@ -0,0 +1,69 @@ +// Copyright 2017 AISIN AW CO.,LTD + +#pragma once + +#include <map> +#include <string> +#include <tuple> +#include <vector> + +#include <stdint.h> + +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<double, double> 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<int32_t> 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<Waypoint>); + void calculateRoute(uint32_t session, uint32_t routeHandle); + +}; // class Navicore + +}; // namespace naviapi + |