summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt6
-rw-r--r--sensorlogd.cpp24
2 files changed, 27 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 44db130..c4c22c1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.10.0)
-project(healthd
+project(sensorlogd
VERSION 1.0.0
- DESCRIPTION "A health tracker daemon for AsteroidOS"
+ DESCRIPTION "A sensor logger daemon for AsteroidOS oriented towards health tracking"
)
find_package(ECM REQUIRED NO_MODULE)
@@ -12,7 +12,7 @@ find_package(Qt5 COMPONENTS Core DBus Qml Positioning Sensors REQUIRED)
add_executable(healthd
- healthd.cpp
+ sensorlogd.cpp
logger.cpp
logger.h
sensorPlugins/stepCounter.cpp
diff --git a/sensorlogd.cpp b/sensorlogd.cpp
new file mode 100644
index 0000000..884b55c
--- /dev/null
+++ b/sensorlogd.cpp
@@ -0,0 +1,24 @@
+#include <QCoreApplication>
+#include <QDBusConnection>
+#include <QDebug>
+#include "logger.h"
+
+int main(int argc, char **argv)
+{
+ QCoreApplication qcoreapp(argc, argv);
+ if (!QDBusConnection::systemBus().isConnected()) {
+ fprintf(stderr, "Cannot connect to the D-Bus system bus.\n");
+ return 3;
+ }
+ if (!QDBusConnection::sessionBus().isConnected()) {
+ fprintf(stderr, "Cannot connect to the D-Bus session bus.\n");
+ return 2;
+ }
+ Logger sensorsLogger;
+ QCoreApplication::setOrganizationName("asteroid");
+ QCoreApplication::setOrganizationDomain("asteroidos.org");
+ QCoreApplication::setApplicationName("healthd");
+ qDebug() << "healthd started";
+ qcoreapp.exec();
+ return 0;
+}