diff options
author | Scott Murray <scott.murray@konsulko.com> | 2019-10-20 11:50:59 -0400 |
---|---|---|
committer | Scott Murray <scott.murray@konsulko.com> | 2019-10-20 14:33:21 -0400 |
commit | fe954c9dd641e45e429b423714c22ef1da5beb16 (patch) | |
tree | e489c776c62d3ef015596bbedce7b01349c3fcef /app/dbus_server.cpp | |
parent | 15b51bbb886dd0870521fa1bcc6f5d2493271438 (diff) |
Fixes to improve interoperation with tbtnavihalibut_8.0.3halibut/8.0.38.0.3
Changes include:
- Add support for actually sending stopDemo and Arrived DBus signals.
- Fix typo in Arrived signal name in org.agl.naviapi.xml and
dbus_server.cpp.
- Change some qDebug messages in dbus_server.cpp to qWarning as it
seems more appropriate.
- Actually use Mapbox style URL from naviconfig.ini.
Bug-AGL: SPEC-2916
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Change-Id: Ibc4c77ffa1bf74787cf02ad4e64a87b48d2e30fe
Diffstat (limited to 'app/dbus_server.cpp')
-rw-r--r-- | app/dbus_server.cpp | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/app/dbus_server.cpp b/app/dbus_server.cpp index ea3acad..99ae363 100644 --- a/app/dbus_server.cpp +++ b/app/dbus_server.cpp @@ -20,21 +20,21 @@ void DBus_Server::initDBus(){ new NaviapiAdaptor(this); if (!QDBusConnection::sessionBus().registerService(m_pathName)) - qDebug() << m_serverName << "registerService() failed"; + qWarning() << m_serverName << "registerService() failed"; if (!QDBusConnection::sessionBus().registerObject(m_objName, this)) - qDebug() << m_serverName << "registerObject() failed"; + qWarning() << m_serverName << "registerObject() failed"; - QDBusConnection sessionBus = QDBusConnection::connectToBus(QDBusConnection::SessionBus, m_serverName); + QDBusConnection sessionBus = QDBusConnection::connectToBus(QDBusConnection::SessionBus, m_serverName); if (!sessionBus.isConnected()) { - qDebug() << m_serverName << "connectToBus() failed"; + 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()))){ - qDebug() << m_serverName << "sessionBus.connect():getRouteInfoSlot failed"; + qWarning() << m_serverName << "sessionBus.connect():getRouteInfoSlot failed"; } } @@ -43,39 +43,37 @@ void DBus_Server::initAPIs(QObject *parent){ if(!QObject::connect(this,SIGNAL(doGetRouteInfo()), parent,SLOT(doGetRouteInfoSlot()))) { - qDebug() << m_serverName << "cppSIGNAL:doGetRouteInfo to qmlSLOT:doGetRouteInfoSlot connect is failed"; + 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)))) { - qDebug() << m_serverName << "qmlSIGNAL:qmlSignalRouteInfo to cppSLOT:sendSignalRouteInfo connect is failed"; + 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)))) { - qDebug() << m_serverName << "qmlSIGNAL:qmlSignalPosInfo to cppSLOT:sendSignalPosInfo connect is failed"; + qWarning() << m_serverName << "qmlSIGNAL:qmlSignalPosInfo to cppSLOT:sendSignalPosInfo connect failed"; } if(!QObject::connect(parent,SIGNAL(qmlSignalStopDemo()), this,SLOT(sendSignalStopDemo()))) { - qDebug() << m_serverName << "qmlSIGNAL:qmlSignalStopDemo to cppSLOT:sendSignalStopDemo connect is failed"; + qWarning() << m_serverName << "qmlSIGNAL:qmlSignalStopDemo to cppSLOT:sendSignalStopDemo connect failed"; } - if(!QObject::connect(parent,SIGNAL(qmlSignalArrvied()), - this,SLOT(sendSignalArrvied()))) { - qDebug() << m_serverName << "qmlSIGNAL:qmlSignalArrvied to cppSLOT:sendSignalArrvied connect is failed"; + if(!QObject::connect(parent,SIGNAL(qmlSignalArrived()), + this,SLOT(sendSignalArrived()))) { + qWarning() << m_serverName << "qmlSIGNAL:qmlSignalArrived to cppSLOT:sendSignalArrived connect failed"; } } void DBus_Server::getRouteInfoSlot(){ - qDebug() << "call getRouteInfoSlot "; emit doGetRouteInfo(); return; } // Signal void DBus_Server::sendSignalRouteInfo(double srt_lat, double srt_lon, double end_lat, double end_lon){ - qDebug() << "call sendSignalRouteInfo "; QDBusMessage message = QDBusMessage::createSignal(m_objName, org::agl::naviapi::staticInterfaceName(), "signalRouteInfo"); @@ -93,8 +91,7 @@ void DBus_Server::sendSignalPosInfo(double lat, double lon, double drc, double d return; } -void DBus_Server::sendSignalStopDemo(){ - qDebug() << "call sendSignalStopDemo "; +void DBus_Server::sendSignalStopDemo(void){ QDBusMessage message = QDBusMessage::createSignal(m_objName, org::agl::naviapi::staticInterfaceName(), "signalStopDemo"); @@ -102,12 +99,10 @@ void DBus_Server::sendSignalStopDemo(){ return; } -void DBus_Server::sendSignalArrvied(){ - qDebug() << "call sendSignalArrvied "; +void DBus_Server::sendSignalArrived(void){ QDBusMessage message = QDBusMessage::createSignal(m_objName, org::agl::naviapi::staticInterfaceName(), - "signalArrvied"); + "signalArrived"); QDBusConnection::sessionBus().send(message); return; } -// Method |