summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArseniy-Movshev <dodoradio@outlook.com>2023-03-12 14:10:23 +0000
committerArseniy-Movshev <dodoradio@outlook.com>2023-03-12 14:10:23 +0000
commitbfe0c3f7a03c53cff7a4050a42f14eaa210364f8 (patch)
tree17e460fe4fe554b851df6c474231f03a2f9e7f39
parent55339aacf03642657e1f9c7d087f9b9fd319de4a (diff)
Rename project to sensorlogd
-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;
+}