From bfe0c3f7a03c53cff7a4050a42f14eaa210364f8 Mon Sep 17 00:00:00 2001 From: Arseniy-Movshev Date: Sun, 12 Mar 2023 14:10:23 +0000 Subject: Rename project to sensorlogd --- CMakeLists.txt | 6 +++--- sensorlogd.cpp | 24 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 sensorlogd.cpp 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 +#include +#include +#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; +} -- cgit v1.2.3-70-g09d2