aboutsummaryrefslogtreecommitdiffstats
path: root/app/dbus_server.cpp
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2019-10-17 06:34:09 -0700
committerMatt Ranostay <matt.ranostay@konsulko.com>2019-11-11 01:05:08 -0800
commitca2db695f1258e0b325c7454a8f79c6d7b2eb48b (patch)
tree57a1779ae7e8c4ae6e6946f76e81a81512f7d4e2 /app/dbus_server.cpp
parent7d7a2abc459456aa261f53d1f07ff54a2e6a810a (diff)
ondemandnavi: remove DBus interface
For proper afb interfae to function the DBus support needs to be removed. Bug-AGL: SPEC-2880 Change-Id: Ib501583e5cb3821bf5479d875e447411477c7da3 Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Diffstat (limited to 'app/dbus_server.cpp')
-rw-r--r--app/dbus_server.cpp108
1 files changed, 0 insertions, 108 deletions
diff --git a/app/dbus_server.cpp b/app/dbus_server.cpp
deleted file mode 100644
index 99ae363..0000000
--- a/app/dbus_server.cpp
+++ /dev/null
@@ -1,108 +0,0 @@
-#include"dbus_server.h"
-#include <QDebug>
-
-DBus_Server::DBus_Server(QObject *parent) :
- m_serverName("naviapi"),
- m_pathName("org.agl.naviapi"),
- m_objName("/org/agl/naviapi")
-{
- initDBus();
- initAPIs(parent);
-}
-
-DBus_Server::~DBus_Server(){
- QDBusConnection::sessionBus().unregisterObject(m_objName);
- QDBusConnection::sessionBus().unregisterService(m_pathName);
-}
-
-void DBus_Server::initDBus(){
-
- new NaviapiAdaptor(this);
-
- if (!QDBusConnection::sessionBus().registerService(m_pathName))
- qWarning() << m_serverName << "registerService() failed";
-
- if (!QDBusConnection::sessionBus().registerObject(m_objName, this))
- qWarning() << m_serverName << "registerObject() failed";
-
- QDBusConnection sessionBus = QDBusConnection::connectToBus(QDBusConnection::SessionBus, m_serverName);
- if (!sessionBus.isConnected()) {
- qWarning() << m_serverName << "connectToBus() failed";
- }
-
- //for receive dbus signal
- org::agl::naviapi *mInterface;
- mInterface = new org::agl::naviapi(QString(),QString(),QDBusConnection::sessionBus(),this);
- if (!connect(mInterface,SIGNAL(getRouteInfo()),this,SLOT(getRouteInfoSlot()))){
- qWarning() << m_serverName << "sessionBus.connect():getRouteInfoSlot failed";
- }
-
-}
-
-void DBus_Server::initAPIs(QObject *parent){
-
- if(!QObject::connect(this,SIGNAL(doGetRouteInfo()),
- parent,SLOT(doGetRouteInfoSlot()))) {
- qWarning() << m_serverName << "cppSIGNAL:doGetRouteInfo to qmlSLOT:doGetRouteInfoSlot connect failed";
- }
-
- if(!QObject::connect(parent,SIGNAL(qmlSignalRouteInfo(double,double,double,double)),
- this,SLOT(sendSignalRouteInfo(double,double,double,double)))) {
- qWarning() << m_serverName << "qmlSIGNAL:qmlSignalRouteInfo to cppSLOT:sendSignalRouteInfo connect failed";
- }
-
- if(!QObject::connect(parent,SIGNAL(qmlSignalPosInfo(double,double,double,double)),
- this,SLOT(sendSignalPosInfo(double,double,double,double)))) {
- qWarning() << m_serverName << "qmlSIGNAL:qmlSignalPosInfo to cppSLOT:sendSignalPosInfo connect failed";
- }
-
- if(!QObject::connect(parent,SIGNAL(qmlSignalStopDemo()),
- this,SLOT(sendSignalStopDemo()))) {
- qWarning() << m_serverName << "qmlSIGNAL:qmlSignalStopDemo to cppSLOT:sendSignalStopDemo connect failed";
- }
-
- if(!QObject::connect(parent,SIGNAL(qmlSignalArrived()),
- this,SLOT(sendSignalArrived()))) {
- qWarning() << m_serverName << "qmlSIGNAL:qmlSignalArrived to cppSLOT:sendSignalArrived connect failed";
- }
-}
-
-void DBus_Server::getRouteInfoSlot(){
- emit doGetRouteInfo();
- return;
-}
-
-// Signal
-void DBus_Server::sendSignalRouteInfo(double srt_lat, double srt_lon, double end_lat, double end_lon){
- QDBusMessage message = QDBusMessage::createSignal(m_objName,
- org::agl::naviapi::staticInterfaceName(),
- "signalRouteInfo");
- message << srt_lat << srt_lon << end_lat << end_lon;
- QDBusConnection::sessionBus().send(message);
- return;
-}
-
-void DBus_Server::sendSignalPosInfo(double lat, double lon, double drc, double dst){
- QDBusMessage message = QDBusMessage::createSignal(m_objName,
- org::agl::naviapi::staticInterfaceName(),
- "signalPosInfo");
- message << lat << lon << drc << dst;
- QDBusConnection::sessionBus().send(message);
- return;
-}
-
-void DBus_Server::sendSignalStopDemo(void){
- QDBusMessage message = QDBusMessage::createSignal(m_objName,
- org::agl::naviapi::staticInterfaceName(),
- "signalStopDemo");
- QDBusConnection::sessionBus().send(message);
- return;
-}
-
-void DBus_Server::sendSignalArrived(void){
- QDBusMessage message = QDBusMessage::createSignal(m_objName,
- org::agl::naviapi::staticInterfaceName(),
- "signalArrived");
- QDBusConnection::sessionBus().send(message);
- return;
-}