#include <glib.h>
#include <vconf.h>
-#include <hal/hal-led.h>
+#include <hal/hal-device-led.h>
#include <libsyscommon/libgdbus.h>
#include <libsyscommon/list.h>
struct rgb_request {
pid_t pid;
- struct led_state state;
+ hal_device_led_state_s state;
};
/* enum values defined in capi-system-device */
return -EINVAL;
}
-static int add_req_to_list(pid_t pid, struct led_state *state)
+static int add_req_to_list(pid_t pid, hal_device_led_state_s *state)
{
int ret;
struct rgb_request *req;
return 0;
}
-static int rgb_play(struct led_state *state)
+static int rgb_play(hal_device_led_state_s *state)
{
- struct led_state off = { 0, };
+ hal_device_led_state_s off = { 0, };
if (!rgb_dev_available) {
_E("There is no HAL for rgb.");
}
if (state)
- return hal_device_led_set_state(NOTIFICATION, state);
+ return hal_device_led_set_state(HAL_DEVICE_LED_NOTIFICATION, state);
- return hal_device_led_set_state(NOTIFICATION, &off);
+ return hal_device_led_set_state(HAL_DEVICE_LED_NOTIFICATION, &off);
}
static gboolean remove_not_handled_req(gpointer data)
int ret;
int on, off;
unsigned int color, flags;
- struct led_state state;
+ hal_device_led_state_s state;
pid_t pid;
static pid_t old_pid;
state.duty_on = on;
state.duty_off = off;
if (flags & LED_CUSTOM_DUTY_ON)
- state.type = LED_TYPE_BLINK;
+ state.type = HAL_DEVICE_LED_TYPE_BLINK;
else
- state.type = LED_TYPE_MANUAL;
+ state.type = HAL_DEVICE_LED_TYPE_MANUAL;
ret = rgb_play(&state);
if (ret < 0) {
GVariantIter *iter = NULL;
pid_t pid;
static pid_t old_pid;
- struct led_state state;
+ hal_device_led_state_s state;
pid = gdbus_connection_get_sender_pid(conn, sender);
if (pid == -1 || kill(pid, 0) == -1) {
i = 0;
state.duty_on = 0;
state.duty_off = 0;
- state.type = LED_TYPE_MANUAL;
+ state.type = HAL_DEVICE_LED_TYPE_MANUAL;
while (g_variant_iter_next(iter, "u", &color[i])) {
if (rgb_dev_available)
#include <errno.h>
#include <assert.h>
#include <vconf.h>
-#include <hal/hal-led.h>
+#include <hal/hal-device-led.h>
#include <libsyscommon/libgdbus.h>
#include "core/log.h"
#define SIGNAL_FLASH_STATE "ChangeFlashState"
static bool torch_dev_available = false;
-static struct led_state led_state = {
- .type = LED_TYPE_MANUAL,
+static hal_device_led_state_s led_state = {
+ .type = HAL_DEVICE_LED_TYPE_MANUAL,
.color = 0x0,
.duty_on = 0,
.duty_off = 0,
GVariant *param, GDBusMethodInvocation *invocation, gpointer user_data)
{
int val, enable, ret;
- struct led_state tmp = {0,};
+ hal_device_led_state_s tmp = {0,};
g_variant_get(param, "(ii)", &val, &enable);
tmp.color = (((int)(val * 255.f) / LED_MAX_BRIGHTNESS) & 0xFF) << 24;
_D("Set brightness. val=%d color=%#x", val, tmp.color);
- ret = hal_device_led_set_state(CAMERA_BACK, &tmp);
+ ret = hal_device_led_set_state(HAL_DEVICE_LED_CAMERA_BACK, &tmp);
if (ret < 0)
goto error;
#include <stdio.h>
#include <vconf.h>
-#include <hal/hal-led.h>
+#include <hal/hal-device-led.h>
#include <libsyscommon/libgdbus.h>
#include "core/log.h"
static int touchled_set_state(bool on)
{
- struct led_state tmp = {0,};
+ hal_device_led_state_s tmp = {0,};
int r;
if (!touchkey_dev_available) {
else
tmp.color = SET_BRIGHTNESS(0);
- r = hal_device_led_set_state(TOUCH_KEY, &tmp);
+ r = hal_device_led_set_state(HAL_DEVICE_LED_TOUCH_KEY, &tmp);
if (r < 0) {
_E("Failed to set touch led state: %d", r);
return r;