+++ /dev/null
-/*
- * PASS
- *
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef __CORE_COMMON_H__
-#define __CORE_COMMON_H__
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <error.h>
-#include <stdbool.h>
-#include <unistd.h>
-
-#include <json-c/json.h>
-#include <json-c/arraylist.h>
-
-typedef unsigned int uint32;
-typedef unsigned long long uint64;
-
-#define BUFF_MAX 255
-#define ARRAY_SIZE(name) (sizeof(name)/sizeof(name[0]))
-
-/*
- * One byte digit has 3 position in decimal representation
- * 2 - 5
- * 4 - 10
- * 8 - 20
- * >8 - compile time error
- * plus 1 null termination byte
- * plus 1 for negative prefix
- */
-#define MAX_DEC_SIZE(type) \
- (2 + (sizeof(type) <= 1 ? 3 : \
- sizeof(type) <= 2 ? 5 : \
- sizeof(type) <= 4 ? 10 : \
- sizeof(type) <= 8 ? 20 : \
- sizeof(int[-2*(sizeof(type) > 8)])))
-
-#ifndef __CONSTRUCTOR__
-#define __CONSTRUCTOR__ __attribute__ ((constructor))
-#endif
-
-#ifndef __DESTRUCTOR__
-#define __DESTRUCTOR__ __attribute__ ((destructor))
-#endif
-
-#ifndef __WEAK__
-#define __WEAK__ __attribute__ ((weak))
-#endif
-
-#ifndef max
-#define max(a, b) \
- __extension__ ({ \
- typeof(a) _a = (a); \
- typeof(b) _b = (b); \
- _a > _b ? _a : _b; \
- })
-#endif
-
-#ifndef min
-#define min(a, b) \
- __extension__ ({ \
- typeof(a) _a = (a); \
- typeof(b) _b = (b); \
- _a < _b ? _a : _b; \
- })
-#endif
-
-#ifndef SEC_TO_MSEC
-#define SEC_TO_MSEC(x) ((x)*1000)
-#endif
-#ifndef MSEC_TO_USEC
-#define MSEC_TO_USEC(x) ((unsigned int)(x)*1000)
-#endif
-#ifndef NSEC_TO_MSEC
-#define NSEC_TO_MSEC(x) ((double)x/1000000)
-#endif
-#ifndef USEC_TO_MSEC
-#define USEC_TO_MSEC(x) ((double)x/1000)
-#endif
-
-int sys_get_str(const char *fname, char *str);
-
-const char *get_string_from_object(json_object *obj, const char *key);
-const int get_int_from_object(json_object *obj, const char *key);
-const double get_double_from_object(json_object *obj, const char *key);
-const int get_boolean_from_object(json_object *obj, const char *key);
-json_object *get_object_from_object(json_object *obj, const char *key);
-#endif /* __CORE_COMMON_H__ */
+++ /dev/null
-/*
- * PASS
- *
- * Copyright (c) 2017 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef __DEVICE_NOTIFIER_H__
-#define __DEVICE_NOTIFIER_H__
-
-#include <stdbool.h>
-#include <pass/common.h>
-
-enum device_notifier_type {
- DEVICE_NOTIFIER_INIT_DONE,
- DEVICE_NOTIFIER_PMQOS,
- DEVICE_NOTIFIER_THERMAL,
- DEVICE_NOTIFIER_THERMAL_GET_SCENARIO,
- DEVICE_NOTIFIER_MAX,
-};
-
-struct device_notifier {
- bool is_used;
- enum device_notifier_type status;
- int (*func)(void *data, void *user_data);
- void *user_data;
-};
-
-/* data structure for DEVICE_NOTIFIER_THERMAL */
-struct device_notifier_thermal_data {
- char *name;
- char scenario[BUFF_MAX];
- int priority;
-};
-
-/*
- * This is for internal callback method.
- */
-int register_notifier(enum device_notifier_type status,
- int (*func)(void *data, void *user_data), void *user_data);
-int unregister_notifier(enum device_notifier_type status,
- int (*func)(void *data, void *user_data), void *user_data);
-void device_notify(enum device_notifier_type status, void *value);
-
-#endif /* __DEVICE_NOTIFIER_H__ */
+++ /dev/null
-/*
- * PASS
- *
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef __DEVICES_H__
-#define __DEVICES_H__
-
-#include <errno.h>
-#include "common.h"
-
-enum device_priority {
- DEVICE_PRIORITY_NORMAL = 0,
- DEVICE_PRIORITY_HIGH,
-};
-
-enum device_flags {
- NORMAL_MODE = 0x00000001,
-};
-
-struct device_ops {
- enum device_priority priority;
- char *name;
- int (*probe) (void *data);
- void (*init) (void *data);
- void (*exit) (void *data);
- int (*start) (enum device_flags flags);
- int (*stop) (enum device_flags flags);
- int (*status) (void);
- int (*execute) (void *data);
-};
-
-enum device_ops_status {
- DEVICE_OPS_STATUS_UNINIT,
- DEVICE_OPS_STATUS_START,
- DEVICE_OPS_STATUS_STOP,
- DEVICE_OPS_STATUS_MAX,
-};
-
-#define DEVICE_OPS_REGISTER(dev) \
-static void __CONSTRUCTOR__ module_init(void) \
-{ \
- add_device(dev); \
-} \
-static void __DESTRUCTOR__ module_exit(void) \
-{ \
- remove_device(dev); \
-}
-
-void init_devices(void *data);
-void exit_devices(void *data);
-void add_device(const struct device_ops *dev);
-void remove_device(const struct device_ops *dev);
-#endif
+++ /dev/null
-/*
- * PASS (Power Aware System Service)
- *
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __GDBUS_DEFINITION_H__
-#define __GDBUS_DEFINITION_H__
-
-typedef enum {
- PASS_DBUS_CORE,
- PASS_DBUS_THERMAL,
- PASS_DBUS_MAX,
-} passdbus;
-
-/* Dbus definition for PASS */
-#define DBUS_PASS_BUS_NAME "org.tizen.system.pass"
-#define DBUS_PASS_PATH "/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_PMQOS_I_SET_SCENARIO_HANDLER "handle_set_scenario"
-
-#define DBUS_THERMAL_BUS_NAME "org.tizen.system.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_SIGNAL "CoolDownModeChanged"
-#define DBUS_THERMAL_METHOD "handle_get_cool_down_status"
-
-/* 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"
-#define SYSTEMD_DBUS_METHOD_GET_PROP "Get"
-#define SYSTEMD_DBUS_METHOD_GET_PROP_ARG_TYPE "(ss)"
-#define SYSTEMD_DBUS_METHOD_GET_PROP_RET_TYPE "(v)"
-#define SYSTEMD_DBUS_IFACE_MANAGER SYSTEMD_DBUS_NAME ".Manager"
-
-#endif /* __GDBUS_DEFINITION_H__ */
+++ /dev/null
-/*
- * PASS (Power Aware System Service)
- *
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __GDBUS_UTIL_H__
-#define __GDBUS_UTIL_H__
-
-#include <glib.h>
-#include <gio/gio.h>
-#include <stdbool.h>
-
-#include "pass/pass-dbus-stub.h"
-#include "pmqos/pmqos-dbus-stub.h"
-#include "thermal/thermal-dbus-stub.h"
-
-#include "gdbus-definition.h"
-
-struct pass_gdbus_signal_info {
- const gchar *handler;
- GCallback cb;
- gpointer cb_data;
- gulong ret_id;
-};
-
-int pass_gdbus_register_systemd_startup_callback(GDBusSignalCallback cb,
- gpointer user_data, guint *id);
-int pass_gdbus_unregister_systemd_startup_callback(guint id);
-int pass_gdbus_get_systemd_dbus_property_string(const char *iface,
- const char *prop, const char **value);
-int pass_gdbus_export_interface(passdbus idx, gpointer instance, const char *obj_path);
-int pass_gdbus_get_name(passdbus idx, const char *name);
-int pass_gdbus_connect_signal(gpointer instance, int num_signals,
- struct pass_gdbus_signal_info *signal_infos);
-void pass_gdbus_disconnect_signal(gpointer instance, int num_signals,
- struct pass_gdbus_signal_info *signal_infos);
-int pass_gdbus_send_broadcast_signal(passdbus idx, char *path, char *interface,
- char *method, GVariant *arg);
-
-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);
-SystemThermal *pass_gdbus_get_instance_thermal(void);
-void pass_gdbus_put_instance_thermal(SystemThermal **instance);
-
-int pass_gdbus_get_system_connection(passdbus idx);
-void pass_gdbus_put_system_connection(passdbus idx);
-#endif /* __GDBUS_UTIL_H__ */
+++ /dev/null
-/*
- * PASS (Power Aware System Service)
- *
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __LOG_H__
-#define __LOG_H__
-
-#include <dlog.h>
-
-#define _D(fmt, arg...) do { SLOGD(fmt, ##arg); } while (0)
-#define _I(fmt, arg...) do { SLOGI(fmt, ##arg); } while (0)
-#define _W(fmt, arg...) do { SLOGW(fmt, ##arg); } while (0)
-#define _E(fmt, arg...) do { SLOGE(fmt, ##arg); } while (0)
-#endif
--- /dev/null
+/*
+ * PASS
+ *
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef __CORE_COMMON_H__
+#define __CORE_COMMON_H__
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <error.h>
+#include <stdbool.h>
+#include <unistd.h>
+
+#include <json-c/json.h>
+#include <json-c/arraylist.h>
+
+typedef unsigned int uint32;
+typedef unsigned long long uint64;
+
+#define BUFF_MAX 255
+#define ARRAY_SIZE(name) (sizeof(name)/sizeof(name[0]))
+
+/*
+ * One byte digit has 3 position in decimal representation
+ * 2 - 5
+ * 4 - 10
+ * 8 - 20
+ * >8 - compile time error
+ * plus 1 null termination byte
+ * plus 1 for negative prefix
+ */
+#define MAX_DEC_SIZE(type) \
+ (2 + (sizeof(type) <= 1 ? 3 : \
+ sizeof(type) <= 2 ? 5 : \
+ sizeof(type) <= 4 ? 10 : \
+ sizeof(type) <= 8 ? 20 : \
+ sizeof(int[-2*(sizeof(type) > 8)])))
+
+#ifndef __CONSTRUCTOR__
+#define __CONSTRUCTOR__ __attribute__ ((constructor))
+#endif
+
+#ifndef __DESTRUCTOR__
+#define __DESTRUCTOR__ __attribute__ ((destructor))
+#endif
+
+#ifndef __WEAK__
+#define __WEAK__ __attribute__ ((weak))
+#endif
+
+#ifndef max
+#define max(a, b) \
+ __extension__ ({ \
+ typeof(a) _a = (a); \
+ typeof(b) _b = (b); \
+ _a > _b ? _a : _b; \
+ })
+#endif
+
+#ifndef min
+#define min(a, b) \
+ __extension__ ({ \
+ typeof(a) _a = (a); \
+ typeof(b) _b = (b); \
+ _a < _b ? _a : _b; \
+ })
+#endif
+
+#ifndef SEC_TO_MSEC
+#define SEC_TO_MSEC(x) ((x)*1000)
+#endif
+#ifndef MSEC_TO_USEC
+#define MSEC_TO_USEC(x) ((unsigned int)(x)*1000)
+#endif
+#ifndef NSEC_TO_MSEC
+#define NSEC_TO_MSEC(x) ((double)x/1000000)
+#endif
+#ifndef USEC_TO_MSEC
+#define USEC_TO_MSEC(x) ((double)x/1000)
+#endif
+
+int sys_get_str(const char *fname, char *str);
+
+const char *get_string_from_object(json_object *obj, const char *key);
+const int get_int_from_object(json_object *obj, const char *key);
+const double get_double_from_object(json_object *obj, const char *key);
+const int get_boolean_from_object(json_object *obj, const char *key);
+json_object *get_object_from_object(json_object *obj, const char *key);
+#endif /* __CORE_COMMON_H__ */
--- /dev/null
+/*
+ * PASS
+ *
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef __DEVICE_NOTIFIER_H__
+#define __DEVICE_NOTIFIER_H__
+
+#include <stdbool.h>
+#include <util/common.h>
+
+enum device_notifier_type {
+ DEVICE_NOTIFIER_INIT_DONE,
+ DEVICE_NOTIFIER_PMQOS,
+ DEVICE_NOTIFIER_THERMAL,
+ DEVICE_NOTIFIER_THERMAL_GET_SCENARIO,
+ DEVICE_NOTIFIER_MAX,
+};
+
+struct device_notifier {
+ bool is_used;
+ enum device_notifier_type status;
+ int (*func)(void *data, void *user_data);
+ void *user_data;
+};
+
+/* data structure for DEVICE_NOTIFIER_THERMAL */
+struct device_notifier_thermal_data {
+ char *name;
+ char scenario[BUFF_MAX];
+ int priority;
+};
+
+/*
+ * This is for internal callback method.
+ */
+int register_notifier(enum device_notifier_type status,
+ int (*func)(void *data, void *user_data), void *user_data);
+int unregister_notifier(enum device_notifier_type status,
+ int (*func)(void *data, void *user_data), void *user_data);
+void device_notify(enum device_notifier_type status, void *value);
+
+#endif /* __DEVICE_NOTIFIER_H__ */
--- /dev/null
+/*
+ * PASS
+ *
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef __DEVICES_H__
+#define __DEVICES_H__
+
+#include <errno.h>
+#include "common.h"
+
+enum device_priority {
+ DEVICE_PRIORITY_NORMAL = 0,
+ DEVICE_PRIORITY_HIGH,
+};
+
+enum device_flags {
+ NORMAL_MODE = 0x00000001,
+};
+
+struct device_ops {
+ enum device_priority priority;
+ char *name;
+ int (*probe) (void *data);
+ void (*init) (void *data);
+ void (*exit) (void *data);
+ int (*start) (enum device_flags flags);
+ int (*stop) (enum device_flags flags);
+ int (*status) (void);
+ int (*execute) (void *data);
+};
+
+enum device_ops_status {
+ DEVICE_OPS_STATUS_UNINIT,
+ DEVICE_OPS_STATUS_START,
+ DEVICE_OPS_STATUS_STOP,
+ DEVICE_OPS_STATUS_MAX,
+};
+
+#define DEVICE_OPS_REGISTER(dev) \
+static void __CONSTRUCTOR__ module_init(void) \
+{ \
+ add_device(dev); \
+} \
+static void __DESTRUCTOR__ module_exit(void) \
+{ \
+ remove_device(dev); \
+}
+
+void init_devices(void *data);
+void exit_devices(void *data);
+void add_device(const struct device_ops *dev);
+void remove_device(const struct device_ops *dev);
+#endif
--- /dev/null
+/*
+ * PASS (Power Aware System Service)
+ *
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __GDBUS_DEFINITION_H__
+#define __GDBUS_DEFINITION_H__
+
+typedef enum {
+ PASS_DBUS_CORE,
+ PASS_DBUS_THERMAL,
+ PASS_DBUS_MAX,
+} passdbus;
+
+/* Dbus definition for PASS */
+#define DBUS_PASS_BUS_NAME "org.tizen.system.pass"
+#define DBUS_PASS_PATH "/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_PMQOS_I_SET_SCENARIO_HANDLER "handle_set_scenario"
+
+#define DBUS_THERMAL_BUS_NAME "org.tizen.system.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_SIGNAL "CoolDownModeChanged"
+#define DBUS_THERMAL_METHOD "handle_get_cool_down_status"
+
+/* 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"
+#define SYSTEMD_DBUS_METHOD_GET_PROP "Get"
+#define SYSTEMD_DBUS_METHOD_GET_PROP_ARG_TYPE "(ss)"
+#define SYSTEMD_DBUS_METHOD_GET_PROP_RET_TYPE "(v)"
+#define SYSTEMD_DBUS_IFACE_MANAGER SYSTEMD_DBUS_NAME ".Manager"
+
+#endif /* __GDBUS_DEFINITION_H__ */
--- /dev/null
+/*
+ * PASS (Power Aware System Service)
+ *
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __GDBUS_UTIL_H__
+#define __GDBUS_UTIL_H__
+
+#include <glib.h>
+#include <gio/gio.h>
+#include <stdbool.h>
+
+#include "pass/pass-dbus-stub.h"
+#include "pmqos/pmqos-dbus-stub.h"
+#include "thermal/thermal-dbus-stub.h"
+
+#include "gdbus-definition.h"
+
+struct pass_gdbus_signal_info {
+ const gchar *handler;
+ GCallback cb;
+ gpointer cb_data;
+ gulong ret_id;
+};
+
+int pass_gdbus_register_systemd_startup_callback(GDBusSignalCallback cb,
+ gpointer user_data, guint *id);
+int pass_gdbus_unregister_systemd_startup_callback(guint id);
+int pass_gdbus_get_systemd_dbus_property_string(const char *iface,
+ const char *prop, const char **value);
+int pass_gdbus_export_interface(passdbus idx, gpointer instance, const char *obj_path);
+int pass_gdbus_get_name(passdbus idx, const char *name);
+int pass_gdbus_connect_signal(gpointer instance, int num_signals,
+ struct pass_gdbus_signal_info *signal_infos);
+void pass_gdbus_disconnect_signal(gpointer instance, int num_signals,
+ struct pass_gdbus_signal_info *signal_infos);
+int pass_gdbus_send_broadcast_signal(passdbus idx, char *path, char *interface,
+ char *method, GVariant *arg);
+
+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);
+SystemThermal *pass_gdbus_get_instance_thermal(void);
+void pass_gdbus_put_instance_thermal(SystemThermal **instance);
+
+int pass_gdbus_get_system_connection(passdbus idx);
+void pass_gdbus_put_system_connection(passdbus idx);
+#endif /* __GDBUS_UTIL_H__ */
--- /dev/null
+/*
+ * PASS (Power Aware System Service)
+ *
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __LOG_H__
+#define __LOG_H__
+
+#include <dlog.h>
+
+#define _D(fmt, arg...) do { SLOGD(fmt, ##arg); } while (0)
+#define _I(fmt, arg...) do { SLOGI(fmt, ##arg); } while (0)
+#define _W(fmt, arg...) do { SLOGW(fmt, ##arg); } while (0)
+#define _E(fmt, arg...) do { SLOGE(fmt, ##arg); } while (0)
+#endif
#include <gio/gio.h>
#include <sys/reboot.h>
-#include <pass/common.h>
-#include <pass/device-notifier.h>
-#include <pass/devices.h>
-#include <pass/gdbus-util.h>
-#include <pass/log.h>
+#include <util/common.h>
+#include <util/device-notifier.h>
+#include <util/devices.h>
+#include <util/gdbus-util.h>
+#include <util/log.h>
GMainLoop *g_mainloop;
#include <stdlib.h>
#include <sys/time.h>
-#include <pass/device-notifier.h>
+#include <util/device-notifier.h>
#include "pass.h"
#include "pass-rescon.h"
#include <errno.h>
#include <fcntl.h>
-#include <pass/common.h>
+#include <util/common.h>
#include "pass.h"
#include "pass-hal.h"
#include <hal/hal-power.h>
-#include <pass/common.h>
+#include <util/common.h>
#include "pass.h"
#include <sys/time.h>
#include <inttypes.h>
-#include <pass/device-notifier.h>
+#include <util/device-notifier.h>
#include "pass.h"
#include "pass-rescon.h"
#include <inttypes.h>
-#include <pass/log.h>
+#include <util/log.h>
#include "pass.h"
#include "pass-hal.h"
#include <glib-unix.h>
#include <libudev.h>
-#include <pass/log.h>
+#include <util/log.h>
#include "pass.h"
#include "pass-hal.h"
* @ingroup COM_POWER_MGNT
*/
-#include <pass/log.h>
-#include <pass/device-notifier.h>
+#include <util/log.h>
+#include <util/device-notifier.h>
#include "pass.h"
#include "pass-rescon.h"
#include <stdio.h>
#include <stdlib.h>
-#include <pass/common.h>
-#include <pass/device-notifier.h>
-#include <pass/devices.h>
-#include <pass/gdbus-util.h>
+#include <util/common.h>
+#include <util/device-notifier.h>
+#include <util/devices.h>
+#include <util/gdbus-util.h>
#include "pass.h"
#include "pass-parser.h"
#include <stdio.h>
#include <glib.h>
-#include <pass/common.h>
-#include <pass/log.h>
+#include <util/common.h>
+#include <util/log.h>
#define PASS_LEVEL_COND_MAX 3
#include <gio/gio.h>
#include <glib-object.h>
-#include <pass/log.h>
-#include <pass/common.h>
+#include <util/log.h>
+#include <util/common.h>
#include "pmqos.h"
#include <stdio.h>
#include <limits.h>
-#include <pass/common.h>
-#include <pass/devices.h>
-#include <pass/device-notifier.h>
-#include <pass/gdbus-util.h>
-#include <pass/log.h>
+#include <util/common.h>
+#include <util/devices.h>
+#include <util/device-notifier.h>
+#include <util/gdbus-util.h>
+#include <util/log.h>
#include "pmqos.h"
#include <errno.h>
#include <string.h>
-#include <pass/log.h>
-#include <pass/common.h>
+#include <util/log.h>
+#include <util/common.h>
#include "thermal.h"
#include <string.h>
#include <limits.h>
-#include <pass/common.h>
-#include <pass/devices.h>
-#include <pass/device-notifier.h>
-#include <pass/gdbus-util.h>
-#include <pass/log.h>
+#include <util/common.h>
+#include <util/devices.h>
+#include <util/device-notifier.h>
+#include <util/gdbus-util.h>
+#include <util/log.h>
#include "thermal.h"
#include <mntent.h>
#include <limits.h>
-#include <pass/log.h>
-#include <pass/common.h>
+#include <util/log.h>
+#include <util/common.h>
#define BUFF_MAX 255
#include <glib.h>
-#include <pass/common.h>
-#include <pass/device-notifier.h>
-#include <pass/log.h>
+#include <util/common.h>
+#include <util/device-notifier.h>
+#include <util/log.h>
#define DEVICE_NOTIFIER_MAX_COUNT 255
#include <glib.h>
#include <stdio.h>
-#include <pass/common.h>
-#include <pass/devices.h>
-#include <pass/log.h>
+#include <util/common.h>
+#include <util/devices.h>
+#include <util/log.h>
static GList *dev_head;
#include <stdbool.h>
#include <systemd/sd-daemon.h>
-#include <pass/gdbus-util.h>
-#include <pass/log.h>
+#include <util/gdbus-util.h>
+#include <util/log.h>
static GDBusConnection *g_dbus_sys_conn[PASS_DBUS_MAX] = {NULL, };
static int dbus_name_owned;
#include <gio/gio.h>
#include <gtest/gtest.h>
-#include <pass/gdbus-definition.h>
+#include <util/gdbus-definition.h>
class PowerMgntTest : public testing::Test {
public:
#include <gio/gio.h>
#include <gtest/gtest.h>
-#include <pass/gdbus-definition.h>
+
+#include <util/gdbus-definition.h>
extern "C" {
#include "pass-hal.h"