#include <libsyscommon/list.h>
#include <libsyscommon/log.h>
#include <system/syscommon-plugin-deviced-common-interface.h>
+#include <system/syscommon-plugin-deviced-power-interface.h>
#include <linux/input.h>
* Otherwise, ieu->id won't be defined at this point.*/
ti->reason = ieu->id;
- ti->curr = convert_action_string_to_power_state(curr);
- ti->next = convert_action_string_to_power_state(next);
+ ti->curr = syscommon_plugin_deviced_power_convert_to_power_state(curr);
+ ti->next = syscommon_plugin_deviced_power_convert_to_power_state(next);
SYS_G_LIST_APPEND(*action_list, ti);
}
#include <libsyscommon/list.h>
#include <libsyscommon/file.h>
#include <libsyscommon/ini-parser.h>
+#include <system/syscommon-plugin-deviced-power-interface.h>
#include <hal/device/hal-board.h>
#include "core/log.h"
char next[16] = { 0, };
if (sscanf(action, "%15[^,],%15s", curr, next) == 2) {
- init_ti.curr = convert_action_string_to_power_state(curr);
- init_ti.next = convert_action_string_to_power_state(next);
+ init_ti.curr = syscommon_plugin_deviced_power_convert_to_power_state(curr);
+ init_ti.next = syscommon_plugin_deviced_power_convert_to_power_state(next);
}
}
void power_state_manager_init(void *data);
-static inline uint64_t convert_action_string_to_power_state(const char *str)
-{
- if (MATCH(str, "start"))
- return DEVICED_POWER_STATE_START;
- else if (MATCH(str, "sleep"))
- return DEVICED_POWER_STATE_SLEEP;
- else if (MATCH(str, "normal"))
- return DEVICED_POWER_STATE_NORMAL;
- else if (MATCH(str, "poweroff"))
- return DEVICED_POWER_STATE_POWEROFF;
- else if (MATCH(str, "reboot"))
- return DEVICED_POWER_STATE_REBOOT;
- else if (MATCH(str, "exit"))
- return DEVICED_POWER_STATE_EXIT;
- else if (MATCH(str, "current"))
- return DEVICED_POWER_STATE_ALL;
-
- return DEVICED_POWER_STATE_UNDEFINED;
-}
-
static inline const char *state_name(uint64_t state)
{
if (state == DEVICED_POWER_STATE_START)