#include "pmqos/pmqos-dbus-stub.h"
#include "thermal/thermal-dbus-stub.h"
+/* Dbus definition for PASS */
+#define DBUS_PASS_BUS_NAME "org.tizen.system.pass"
+
+#define DBUS_CORE_INTERFACE "org.tizen.system.pass.core"
+#define DBUS_CORE_PATH "/Org/Tizen/System/Pass/Core"
+#define DBUS_CORE_I_START_HANDLER "handle_start"
+#define DBUS_CORE_I_STOP_HANDLER "handle_stop"
+
+#define DBUS_PMQOS_INTERFACE "org.tizen.system.pass.pmqos"
+#define DBUS_PMQOS_PATH "/Org/Tizen/System/Pass/Pmqos"
+#define DBUS_PMQOS_I_START_HANDLER "handle_start"
+#define DBUS_PMQOS_I_STOP_HANDLER "handle_stop"
+#define DBUS_PMQOS_I_APPLAUNCH_HANDLER "handle_app_launch"
+#define DBUS_PMQOS_I_ULTRAPOWERSAVING_HANDLER "handle_ultra_power_saving"
+
+#define DBUS_THERMAL_INTERFACE "org.tizen.system.pass.monitor.thermal"
+#define DBUS_THERMAL_PATH "/Org/Tizen/System/Pass/Monitor/Thermal"
+#define DBUS_THERMAL_I_START_HANDLER "handle_start"
+#define DBUS_THERMAL_I_STOP_HANDLER "handle_stop"
+#define DBUS_THERMAL_METHOD "thermal_scenario"
+
+/* Dbus definition for systemd */
#define SYSTEMD_DBUS_NAME "org.freedesktop.systemd1"
#define SYSTEMD_DBUS_OBJECT_PATH "/org/freedesktop/systemd1"
#define SYSTEMD_DBUS_IFACE_FOR_PROPS "org.freedesktop.DBus.Properties"
#include <pass/gdbus-util.h>
#include <pass/log.h>
-#define PASS_DBUS_BUS_NAME "org.tizen.system.pass"
-
unsigned int g_startup_cb_id;
GMainLoop *g_mainloop;
signal(SIGTERM, sig_quit);
signal(SIGUSR1, sig_usr1);
- ret = pass_gdbus_get_name(PASS_DBUS_BUS_NAME);
+ ret = pass_gdbus_get_name(DBUS_PASS_BUS_NAME);
if (ret < 0)
return ret;
#include "pass-parser.h"
#include "pass-hal.h"
-#define DBUS_CORE_I_START_HANDLER "handle_start"
-#define DBUS_CORE_I_STOP_HANDLER "handle_stop"
-#define DBUS_CORE_I_NUM_SIGNALS 2
-#define DBUS_CORE_INTERFACE "org.tizen.system.pass.core"
-#define DBUS_CORE_PATH "/Org/Tizen/System/Pass/Core"
#define PASS_CONF_PATH "/etc/pass/pass.conf"
static uint64 supported_module[] = {
pass_init_done, NULL);
pass_gdbus_disconnect_signal(g_gdbus_instance,
- DBUS_CORE_I_NUM_SIGNALS, g_gdbus_signal_infos);
+ ARRAY_SIZE(g_gdbus_signal_infos), g_gdbus_signal_infos);
pass_gdbus_put_instance_core(&g_gdbus_instance);
pass_exit_done();
}
ret = pass_gdbus_connect_signal(g_gdbus_instance,
- DBUS_CORE_I_NUM_SIGNALS, g_gdbus_signal_infos);
+ ARRAY_SIZE(g_gdbus_signal_infos), g_gdbus_signal_infos);
if (ret < 0) {
_E("cannot register callbacks as the dbus method invocation "
"handlers\n");
out_disconnect:
pass_gdbus_disconnect_signal(g_gdbus_instance,
- DBUS_CORE_I_NUM_SIGNALS, g_gdbus_signal_infos);
+ ARRAY_SIZE(g_gdbus_signal_infos), g_gdbus_signal_infos);
out:
pass_gdbus_put_instance_core(&g_gdbus_instance);
#define MILLISECONDS(tv) ((tv.tv_sec)*1000 + (tv.tv_nsec)/1000000)
#define DELTA(a, b) (MILLISECONDS(a) - MILLISECONDS(b))
-#define DBUS_PMQOS_I_APPLAUNCH_HANDLER "handle_app_launch"
-#define DBUS_PMQOS_I_ULTRAPOWERSAVING_HANDLER "handle_ultra_power_saving"
-#define DBUS_PMQOS_I_START_HANDLER "handle_start"
-#define DBUS_PMQOS_I_STOP_HANDLER "handle_stop"
-#define DBUS_PMQOS_I_NUM_SIGNALS 4
-#define DBUS_PMQOS_INTERFACE "org.tizen.system.pass.pmqos"
-#define DBUS_PMQOS_PATH "/Org/Tizen/System/Pass/Pmqos"
-
static SystemPassPmqos *g_gdbus_instance = NULL;
static struct pmqos_scenario *g_pmqos = NULL;
pmqos_init_done, NULL);
pass_gdbus_disconnect_signal(g_gdbus_instance,
- DBUS_PMQOS_I_NUM_SIGNALS, g_gdbus_signal_infos);
+ ARRAY_SIZE(g_gdbus_signal_infos), g_gdbus_signal_infos);
pass_gdbus_put_instance_pmqos(&g_gdbus_instance);
pmqos_free();
}
ret = pass_gdbus_connect_signal(g_gdbus_instance,
- DBUS_PMQOS_I_NUM_SIGNALS, g_gdbus_signal_infos);
+ ARRAY_SIZE(g_gdbus_signal_infos), g_gdbus_signal_infos);
if (ret < 0) {
_E("cannot register callbacks as the dbus method invocation "
"handlers\n");
out_disconnect:
pass_gdbus_disconnect_signal(g_gdbus_instance,
- DBUS_PMQOS_I_NUM_SIGNALS, g_gdbus_signal_infos);
+ ARRAY_SIZE(g_gdbus_signal_infos), g_gdbus_signal_infos);
out:
pass_gdbus_put_instance_pmqos(&g_gdbus_instance);
#define THERMAL_CONF_PATH "/etc/pass/pass-thermal.conf"
-#define DBUS_THERMAL_I_START_HANDLER "handle_start"
-#define DBUS_THERMAL_I_STOP_HANDLER "handle_stop"
-#define DBUS_THERMAL_INTERFACE "org.tizen.system.pass.monitor.thermal"
-#define DBUS_THERMAL_PATH "/Org/Tizen/System/Pass/Monitor/Thermal"
-#define DBUS_THERMAL_METHOD "thermal_scenario"
-
static SystemPassMonitorThermal *g_gdbus_instance = NULL;
static struct thermal_scenario *g_thermal = NULL;