SET(PREFIX ${CMAKE_INSTALL_PREFIX})
SET(VERSION 0.0.1)
-SET(dependents "dlog glib-2.0 gio-2.0 gio-unix-2.0 iniparser libudev")
+SET(dependents "dlog glib-2.0 gio-2.0 gio-unix-2.0 libsystemd-daemon iniparser libudev")
FIND_PROGRAM(GDBUS_CODEGEN NAMES gdbus-codegen)
EXEC_PROGRAM(${GDBUS_CODEGEN} ARGS
#include <stdlib.h>
#include <string.h>
#include <gio/gio.h>
+#include <systemd/sd-daemon.h>
#include <peripheral_io.h>
#include <peripheral_gdbus.h>
_E("Dbus name is lost!");
}
+static gboolean peripheral_bus_notify(gpointer data)
+{
+ _D("sd_notify(READY=1)");
+ sd_notify(0, "READY=1");
+
+ return G_SOURCE_REMOVE;
+}
+
int main(int argc, char *argv[])
{
GMainLoop *loop;
loop = g_main_loop_new(NULL, FALSE);
+ g_idle_add(peripheral_bus_notify, NULL);
+
_D("Enter main loop!");
g_main_loop_run(loop);