summaryrefslogtreecommitdiff
path: root/test/html-based-panel/node-cpp-lbs-modules/dbus-proxies/NavigationCoreProxy.cpp
blob: c5402acc976e5d4afaba49ad2c21ddb6c9e05e32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
/**
* @licence app begin@
* SPDX-License-Identifier: MPL-2.0
*
* \copyright Copyright (C) 2016, PCA Peugeot Citroen
*
* \file main.cpp
*
* \brief This file is part of the Navigation Web API proof of concept.
*
* \author Philippe Colliot <philippe.colliot@mpsa.com>
*
* \version 0.1
*
* This Source Code Form is subject to the terms of the
* Mozilla Public License (MPL), v. 2.0.
* If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*
* For further information see http://www.genivi.org/.
*
* List of changes:
* <date>, <name>, <description of change>
*
* @licence end@
*/
#include <node.h>

#include "NavigationCoreProxy.hpp"
#include "../NavigationCoreWrapper.hpp"

using namespace v8;
using namespace std;

static DBus::Glib::BusDispatcher *dispatcher;
static DBus::Connection *connection;

NavigationCoreMapMatchedPositionProxy::NavigationCoreMapMatchedPositionProxy(DBus::Connection &connection, NavigationCoreProxy *navigationCoreProxy)
    :    DBus::ObjectProxy(connection,
                           "/org/genivi/navigationcore",
                           "org.genivi.navigationcore.MapMatchedPosition")
{
    mp_navigationCoreProxy = navigationCoreProxy;
}

void NavigationCoreMapMatchedPositionProxy::SimulationStatusChanged(const int32_t& simulationStatus)
{
    mp_navigationCoreProxy->SimulationStatusChanged(simulationStatus);
}

void NavigationCoreMapMatchedPositionProxy::SimulationSpeedChanged(const uint8_t& speedFactor)
{

}

void NavigationCoreMapMatchedPositionProxy::PositionUpdate(const std::vector< int32_t >& changedValues)
{

}

void NavigationCoreMapMatchedPositionProxy::AddressUpdate(const std::vector< int32_t >& changedValues)
{

}

void NavigationCoreMapMatchedPositionProxy::PositionOnSegmentUpdate(const std::vector< int32_t >& changedValues)
{

}

void NavigationCoreMapMatchedPositionProxy::StatusUpdate(const std::vector< int32_t >& changedValues)
{

}

void NavigationCoreMapMatchedPositionProxy::OffRoadPositionChanged(const uint32_t& distance, const int32_t& direction)
{

}

NavigationCoreGuidanceProxy::NavigationCoreGuidanceProxy(DBus::Connection &connection, NavigationCoreProxy *navigationCoreProxy)
    :    DBus::ObjectProxy(connection,
                           "/org/genivi/navigationcore",
                           "org.genivi.navigationcore.Guidance")
{
    mp_navigationCoreProxy = navigationCoreProxy;
}

void NavigationCoreGuidanceProxy::VehicleLeftTheRoadNetwork()
{

}

void NavigationCoreGuidanceProxy::GuidanceStatusChanged(const int32_t& guidanceStatus, const uint32_t& routeHandle)
{
    mp_navigationCoreProxy->GuidanceStatusChanged(guidanceStatus,routeHandle);
}

void NavigationCoreGuidanceProxy::WaypointReached(const bool& isDestination)
{

}

void NavigationCoreGuidanceProxy::ManeuverChanged(const int32_t& maneuver)
{

}

void NavigationCoreGuidanceProxy::PositionOnRouteChanged(const uint32_t& offsetOnRoute)
{

}

void NavigationCoreGuidanceProxy::VehicleLeftTheRoute()
{

}

void NavigationCoreGuidanceProxy::PositionToRouteChanged(const uint32_t& distance, const int32_t& direction)
{

}

void NavigationCoreGuidanceProxy::ActiveRouteChanged(const int32_t& changeCause)
{

}

NavigationCoreProxy::NavigationCoreProxy(NavigationCoreWrapper *navigationCoreWrapper)
{
    dispatcher = new DBus::Glib::BusDispatcher();
    DBus::default_dispatcher = dispatcher;
    dispatcher->attach(NULL);
    connection = new DBus::Connection(DBus::Connection::SessionBus());
    connection->setup(dispatcher);
    mp_navigationCoreWrapper = navigationCoreWrapper;
    mp_navigationCoreGuidanceProxy = new NavigationCoreGuidanceProxy(*connection,this);
    mp_navigationCoreMapMatchedPositionProxy = new NavigationCoreMapMatchedPositionProxy(*connection,this);
}

NavigationCoreProxy::~NavigationCoreProxy()
{
    delete mp_navigationCoreGuidanceProxy;
    delete connection;
    delete dispatcher;
}

void NavigationCoreProxy::GuidanceStatusChanged(const int32_t& guidanceStatus, const uint32_t& routeHandle)
{
    mp_navigationCoreWrapper->GuidanceStatusChanged(guidanceStatus,routeHandle);
}

void NavigationCoreProxy::SimulationStatusChanged(const int32_t& simulationStatus)
{
   mp_navigationCoreWrapper->SimulationStatusChanged(simulationStatus);
}