/
main.cpp
34 lines (29 loc) · 856 Bytes
/
main.cpp
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
#include "CRpmsgInterface.h"
#include <QCoreApplication>
#include <QDBusConnection>
#include <QDebug>
#define SERVICE_NAME "iot.service.rpmsg"
#define PROPERTY_PATH "/"
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
/**
* Création de l'interface
**/
CRpmsgInterface* interface = new CRpmsgInterface();
/**
* DBUS INIT
**/
if (!QDBusConnection::systemBus().isConnected())
{
qDebug() << "DBUS not started !";
}
if (!QDBusConnection::systemBus().registerService(SERVICE_NAME))
{
qDebug() << " Already Registered !";
}
QDBusConnection::systemBus().registerObject(PROPERTY_PATH,
interface,
QDBusConnection::ExportAllInvokables);
return a.exec();
}