From a33200bbbe14a6a33e935e6a71408c3872dbdc09 Mon Sep 17 00:00:00 2001 From: Dongwoo Lee Date: Thu, 11 Apr 2019 16:44:13 +0900 Subject: [PATCH] pass: Change DBUS interface of thermal monitor This patch changes DBUS interface as following thermal interface standard like below: - Interface: org.tizen.system.thermal - Path: /Org/Tizen/System/Thermal - Broadcast name: CoolDownModeChanged Change-Id: Iedf5a1d78536a10829d37e84fadae0e51706f886 Signed-off-by: Dongwoo Lee --- include/pass/gdbus-definition.h | 6 +++--- include/pass/gdbus-util.h | 4 ++-- scripts/pass-thermal.conf | 6 +++--- scripts/thermal-dbus.xml | 4 ++-- src/core/gdbus-util.c | 6 +++--- src/thermal/thermal.c | 8 ++++---- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/include/pass/gdbus-definition.h b/include/pass/gdbus-definition.h index cca8b3f..16da516b6 100644 --- a/include/pass/gdbus-definition.h +++ b/include/pass/gdbus-definition.h @@ -35,11 +35,11 @@ #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_INTERFACE "org.tizen.system.thermal" +#define DBUS_THERMAL_PATH "/Org/Tizen/System/Thermal" #define DBUS_THERMAL_I_START_HANDLER "handle_start" #define DBUS_THERMAL_I_STOP_HANDLER "handle_stop" -#define DBUS_THERMAL_METHOD "thermal_scenario" +#define DBUS_THERMAL_SIGNAL "CoolDownModeChanged" /* Dbus definition for systemd */ #define SYSTEMD_DBUS_NAME "org.freedesktop.systemd1" diff --git a/include/pass/gdbus-util.h b/include/pass/gdbus-util.h index 130e237..c85c228 100644 --- a/include/pass/gdbus-util.h +++ b/include/pass/gdbus-util.h @@ -54,8 +54,8 @@ SystemPassCore *pass_gdbus_get_instance_core(void); void pass_gdbus_put_instance_core(SystemPassCore **instance); SystemPassPmqos *pass_gdbus_get_instance_pmqos(void); void pass_gdbus_put_instance_pmqos(SystemPassPmqos **instance); -SystemPassMonitorThermal *pass_gdbus_get_instance_thermal(void); -void pass_gdbus_put_instance_thermal(SystemPassMonitorThermal **instance); +SystemThermal *pass_gdbus_get_instance_thermal(void); +void pass_gdbus_put_instance_thermal(SystemThermal **instance); int pass_gdbus_get_system_connection(void); void pass_gdbus_put_system_connection(void); diff --git a/scripts/pass-thermal.conf b/scripts/pass-thermal.conf index ad0f02d..bc0c656 100644 --- a/scripts/pass-thermal.conf +++ b/scripts/pass-thermal.conf @@ -9,11 +9,11 @@ thermal_number_of_scenario=4 #name=ReleaseAction #support=yes [thermal.scenario0] -name=ReleaseAction +name=Release support=yes [thermal.scenario1] -name=WarningAction +name=Warning support=yes [thermal.scenario2] @@ -21,5 +21,5 @@ name=LimitAction support=yes [thermal.scenario3] -name=ShutdownAction +name=Shutdown support=yes diff --git a/scripts/thermal-dbus.xml b/scripts/thermal-dbus.xml index 0b4b6f1..535a33f 100644 --- a/scripts/thermal-dbus.xml +++ b/scripts/thermal-dbus.xml @@ -1,6 +1,6 @@ - - + + diff --git a/src/core/gdbus-util.c b/src/core/gdbus-util.c index 7909a7d..e7774e2 100644 --- a/src/core/gdbus-util.c +++ b/src/core/gdbus-util.c @@ -253,12 +253,12 @@ void pass_gdbus_put_instance_pmqos(SystemPassPmqos **instance) put_instance((gpointer *)instance); } -SystemPassMonitorThermal *pass_gdbus_get_instance_thermal(void) +SystemThermal *pass_gdbus_get_instance_thermal(void) { - return system_pass_monitor_thermal_skeleton_new(); + return system_thermal_skeleton_new(); } -void pass_gdbus_put_instance_thermal(SystemPassMonitorThermal **instance) +void pass_gdbus_put_instance_thermal(SystemThermal **instance) { put_instance((gpointer *)instance); } diff --git a/src/thermal/thermal.c b/src/thermal/thermal.c index a123ef9..76207c3 100644 --- a/src/thermal/thermal.c +++ b/src/thermal/thermal.c @@ -44,7 +44,7 @@ * @brief Global instance indicating the Thermal Monitor D-Bus interface * for PASS (Power Aware System Service) */ -static SystemPassMonitorThermal *g_gdbus_instance = NULL; +static SystemThermal *g_gdbus_instance = NULL; /** * @brief Global instance indicating Thermal Monitor feature for PASS @@ -128,7 +128,7 @@ static int thermal_init_done(void *data, void *user_data) * @param [in] user_data Not used * @return @c true if success, otherwise @c false if fail */ -static gboolean dbus_cb_thermal_start(SystemPassMonitorThermal *obj, +static gboolean dbus_cb_thermal_start(SystemThermal *obj, GDBusMethodInvocation *invoc, gpointer user_data) { int ret = 0; @@ -157,7 +157,7 @@ static gboolean dbus_cb_thermal_start(SystemPassMonitorThermal *obj, * @param [in] user_data Unused parameter * @return @c true if success, otherwise @c false if fail */ -static gboolean dbus_cb_thermal_stop(SystemPassMonitorThermal *obj, +static gboolean dbus_cb_thermal_stop(SystemThermal *obj, GDBusMethodInvocation *invoc, gpointer user_data) { if (!g_thermal) @@ -229,7 +229,7 @@ static int thermal_notifier_cb(void *data, void *user_data) gvar = g_variant_new("(s)", data); ret = pass_gdbus_send_broadcast_signal(DBUS_THERMAL_PATH, DBUS_THERMAL_INTERFACE, - DBUS_THERMAL_METHOD, + DBUS_THERMAL_SIGNAL, gvar); if (ret < 0) { _E("failed to send broadcast signal of thermal monitor(%d)\n", -- 2.34.1