1. First letter to uppercase.
2. Period at the end.
3. Rearrange parameters.
Change-Id: I2619def99f7a1eb80020894a27f7d0d39232eda7
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
method, param);
if (!msg) {
- _E("fail (%s): no reply", method);
+ _E("Failed to call %s: no reply", method);
return ret;
}
if (!dh_get_param_from_var(msg, "(i)", &val))
- _E("fail (%s): no message", method);
+ _E("Failed to call %s: no message", method);
else {
if ((val == -ENOTSUP) || (val == -ENOSYS)) {
- _I("Not supported feature! (%s): %d", method, val);
+ _I("Not supported feature(%s): %d", method, val);
ret = TRUE;
} else if (val == -ENODEV) {
- _E("fail (%s): device open fail (%d)", method, val);
+ _E("Failed to call %s. Device open fail: %d", method, val);
} else if (val < 0) {
- _E("fail (%s): returned fail (%d)", method, val);
+ _E("Failed to call %s. Returned fail: %d", method, val);
} else {
- _I("success (%s): %d", method, val);
+ _I("Success. %s: %d", method, val);
ret = TRUE;
}
}
g_variant_new("(i)", 0));
if (!msg) {
- _E("fail (%s): no reply", METHOD_HAPTIC_OPENDEVICE);
+ _E("Failed to call dbus method(%s): no reply", METHOD_HAPTIC_OPENDEVICE);
return ret;
}
if (!dh_get_param_from_var(msg, "(i)", &handle)) {
- _E("fail (%s): no message", METHOD_HAPTIC_OPENDEVICE);
+ _E("Failed to call dbus method(%s): no message", METHOD_HAPTIC_OPENDEVICE);
return ret;
}
g_variant_unref(msg);
g_variant_new("(i)", 0));
if (!msg) {
- _E("fail (%s): no reply", METHOD_HAPTIC_OPENDEVICE);
+ _E("Failed to call dbus method(%s): no reply", METHOD_HAPTIC_OPENDEVICE);
return ret;
}
if (!dh_get_param_from_var(msg, "(i)", &handle)) {
- _E("fail (%s): no message", METHOD_HAPTIC_OPENDEVICE);
+ _E("Failed to call dbus method(%s): no message", METHOD_HAPTIC_OPENDEVICE);
return ret;
}
g_variant_unref(msg);
g_variant_new("(i)", 0));
if (!msg) {
- _E("fail (%s): no reply", METHOD_HAPTIC_OPENDEVICE);
+ _E("Failed to call dbus method(%s): no reply", METHOD_HAPTIC_OPENDEVICE);
return ret;
}
if (!dh_get_param_from_var(msg, "(i)", &handle)) {
- _E("fail (%s): no message", METHOD_HAPTIC_OPENDEVICE);
+ _E("Failed to call dbus method(%s): no message", METHOD_HAPTIC_OPENDEVICE);
return ret;
}
g_variant_unref(msg);
g_variant_new("(i)", 0));
if (!msg) {
- _E("fail (%s): no reply", METHOD_HAPTIC_OPENDEVICE);
+ _E("Failed to call dbus method(%s): no reply", METHOD_HAPTIC_OPENDEVICE);
return ret;
}
if (!dh_get_param_from_var(msg, "(i)", &handle)) {
- _E("fail (%s): no message", METHOD_HAPTIC_OPENDEVICE);
+ _E("Failed to call dbus method(%s): no message", METHOD_HAPTIC_OPENDEVICE);
return ret;
}
g_variant_unref(msg);
g_variant_new("(uiii)", handle, 1000, 100, 0));
if (!msg) {
- _E("fail (%s): no reply", METHOD_HAPTIC_VIBRATEMONOTONE);
+ _E("Failed to call dbus method(%s): no reply", METHOD_HAPTIC_VIBRATEMONOTONE);
return ret;
}
- _D("sleep 300ms");
+ _D("Sleep 300ms.");
time.tv_nsec = 300 * NANO_SECOND_MULTIPLIER;
nanosleep(&time, NULL);
- _D("wakeup");
+ _D("Wakeup.");
return request_haptic_method(METHOD_HAPTIC_STOPDEVICE, g_variant_new("(u)", handle));
}
NULL);
if (!msg) {
- _E("fail (%s): no reply", METHOD_HAPTIC_OPENDEVICE);
+ _E("Failed to call dbus method(%s): no reply", METHOD_HAPTIC_OPENDEVICE);
return FALSE;
}
g_variant_unref(msg);
int success = 0;
int fail = 0;
- _I("start test");
+ _I("Start test.");
haptic_test_all(&success, &fail);
- _I("Total: %d, Success: %d, Fail: %d", success+fail, success, fail);
+ _I("Total=%d Success=%d Fail=%d", success+fail, success, fail);
}
static void haptic_exit(void *data)
{
- _I("end test");
+ _I("End test.");
}
static int haptic_unit(int argc, char **argv)
int success = 0;
int fail = 0;
- _I("start test");
+ _I("Start test.");
haptic_test_all(&success, &fail);
- _I("Total: %d, Success: %d, Fail: %d", success+fail, success, fail);
+ _I("Total=%d Success=%d Fail=%d", success+fail, success, fail);
} else if (0 == strcasecmp(argv[1], METHOD_HAPTIC_GETCOUNT)) {
haptic_getcount();
} else if (0 == strcasecmp(argv[1], METHOD_HAPTIC_OPENDEVICE)) {
} else if (0 == strcasecmp(argv[1], METHOD_HAPTIC_ISSUPPORTED)) {
haptic_issupported(argv[2]);
} else {
- _E("Unknown test case!!!");
+ _E("Unknown test case.");
}
return 0;
static void test_main(int argc, char **argv)
{
- _I("auto test all");
+ _I("Auto test all.");
test_init((void *)NULL);
test_exit((void *)NULL);
}
ops = find_test("haptic");
if (!ops) {
- _E("there is no test ops : haptic");
+ _E("There is no test ops: haptic");
return;
}
ops->unit(argc, argv);
dd_list *elem;
const struct test_ops *d;
- _D("test module count(%d)", DD_LIST_LENGTH(dd_head));
+ _D("Test module count(%d)", DD_LIST_LENGTH(dd_head));
DD_LIST_FOREACH(dd_head, elem, d) {
- _D("[%s] initialize", d->name);
+ _D("'%s' initialize", d->name);
if (d->init)
d->init(data);
}
const struct test_ops *d;
DD_LIST_FOREACH(dd_head, elem, d) {
- _D("[%s] deinitialize", d->name);
+ _D("'%s' deinitialize", d->name);
if (d->exit)
d->exit(data);
}
ret = system_info_get_platform_string(MODEL_NAME, &model_name);
if (ret < 0) {
- _E("Cannot get model name(%d)", ret);
+ _E("Cannot get model name: %d", ret);
return emul;
}
/* open conf file */
f = fopen(file_name, "r");
if (!f) {
- _E("Failed to open file %s", file_name);
+ _E("Failed to open file '%s'.", file_name);
ret = -EIO;
goto error;
}
}
}
}
- _D("Success to load %s", file_name);
+ _D("Success to load '%s'.", file_name);
fclose(f);
return 0;
error:
if (f)
fclose(f);
- _E("Failed to read %s:%d!", file_name, lineno);
+ _E("Failed to read '%s': %d", file_name, lineno);
return ret;
}
* so it just prints out error log.
*/
if (!idler)
- _E("fail to add request to idler");
+ _E("Failed to add request to idler.");
}
int add_idle_request(void (*func)(void *data), void *data)
struct device_request *req;
if (!func) {
- _E("invalid argumet : func(NULL)");
+ _E("Invalid argumet: func(NULL)");
return -EINVAL;
}
req = calloc(1, sizeof(struct device_request));
if (!req) {
- _E("fail to allocate request : %d", errno);
+ _E("Failed to allocate request: %d", errno);
return -errno;
}
static void sig_quit(int signo)
{
- _D("received SIGTERM signal %d", signo);
+ _D("Received SIGTERM signal(%d)", signo);
}
static void sig_usr1(int signo)
{
- _D("received SIGUSR1 signal %d, feedbackd'll be finished!", signo);
+ _D("Received SIGUSR1 signal(%d), feedbackd'll be finished.", signo);
if (mainloop) {
if (g_main_loop_is_running(mainloop))
handle = dbus_handle_get_connection(G_BUS_TYPE_SYSTEM, FALSE);
if (!handle)
- _E("Fail to get dbus connection");;
+ _E("Failed to get dbus connection.");;
ret = haptic_probe();
if (ret != 0) {
- _E("[haptic] probe fail");
+ _E("'Haptic' probe fail.");
return ret;
}
haptic_init();
ret = dbus_handle_request_bus_name(handle, VIBRATOR_BUS_NAME, dbus_name_acquired, NULL);
if (ret <= 0) {
- _E("Fail to request bus name");
+ _E("Failed to request bus name.");
dbus_handle_check_owner_name(NULL, VIBRATOR_BUS_NAME);
}
/* g_main_loop */
g_main_loop_run(mainloop);
- _D("[haptic] deinitialize");
+ _D("'Haptic' deinitialize.");
haptic_exit();
g_main_loop_unref(mainloop);
mainloop = NULL;
char buf[BUF_SIZE];
bool found;
- _I("stop vibration by timer");
+ _I("Stop vibration by timer.");
found = find_from_list(device_handle);
if (!found)
}
ret = read(fd_stop, buf, BUF_SIZE);
if (ret < 0) {
- _E("failed to stop");
+ _E("Failed to stop.");
return G_SOURCE_REMOVE;
}
stop_timer = 0;
/* if it is the first element */
n = DD_LIST_LENGTH(handle_list);
if (n == 0) {
- _I("Open");
+ _I("Open.");
if (fd_play < 0) {
fd_play = open(CIRCLE_ON_PATH, O_RDONLY);
if (fd_play < 0) {
- _E("Failed to open %s : %d", CIRCLE_ON_PATH, errno);
+ _E("Failed to open '%s': %d", CIRCLE_ON_PATH, errno);
return -errno;
}
}
if (fd_stop < 0) {
fd_stop = open(CIRCLE_OFF_PATH, O_RDONLY);
if (fd_stop < 0) {
- _E("Failed to open %s : %d", CIRCLE_OFF_PATH, errno);
+ _E("Failed to open '%s': %d", CIRCLE_OFF_PATH, errno);
return -errno;
}
}
found = find_from_list(device_handle);
if (!found) {
- _E("Handle %d fail to check info", device_handle);
+ _E("Handle(%d) fail to check info.", device_handle);
return -EINVAL;
}
if (fd_stop < 0) {
fd_stop = open(CIRCLE_OFF_PATH, O_RDONLY);
if (fd_stop < 0) {
- _E("Handle %d fail to check fd", device_handle);
+ _E("Handle(%d) fail to check fd.", device_handle);
return -ENODEV;
}
}
/* stop vibration */
r = stop_device(device_handle);
if (r < 0)
- _I("Handle %d already stopped or failed to stop effect : %d", device_handle, r);
+ _I("Handle(%d) already stopped or failed to stop effect: %d", device_handle, r);
DD_LIST_REMOVE(handle_list, (gpointer)(long)device_handle);
/* if it is the last element */
n = DD_LIST_LENGTH(handle_list);
if (n == 0) {
- _I("Close");
+ _I("Close.");
if (fd_play > 0) {
close(fd_play);
fd_play = -1;
found = find_from_list(device_handle);
if (!found) {
- _E("Handle %d fail to check list", device_handle);
+ _E("Handle(%d) fail to check list.", device_handle);
return -EINVAL;
}
if (fd_play < 0) {
fd_play = open(CIRCLE_ON_PATH, O_RDONLY);
if (fd_play < 0) {
- _E("Handle %d fail to check handle", device_handle);
+ _E("Handle(%d) fail to check handle.", device_handle);
return -ENODEV;
}
}
if (duration <= 0) {
- _E("handle %d skip requested with 0", device_handle);
+ _E("Handle(%d) skip requested with 0.", device_handle);
return -EINVAL;
}
/* play vibration */
ret = read(fd_play, buf, BUF_SIZE);
if (ret < 0) {
- _E("Handle %d failed to play", device_handle);
+ _E("Handle(%d) failed to play.", device_handle);
return -errno;
}
stop_timer = g_timeout_add(duration, timer_cb, (void *)(long)device_handle);
if (!stop_timer)
- _E("Handle %d Failed to add timer callback", device_handle);
+ _E("Handle(%d) Failed to add timer callback.", device_handle);
}
- _D("device handle %d %dms", device_handle, duration);
+ _D("Device handle(%d) %dms.", device_handle, duration);
return 0;
}
found = find_from_list(device_handle);
if (!found) {
- _E("Handle %d fail to check info", device_handle);
+ _E("Handle(%d) fail to check info.", device_handle);
return -EINVAL;
}
if (cur_h_data.handle > 0 && cur_h_data.handle != device_handle) {
- _E("Only same handle can stop current vibration");
+ _E("Only same handle can stop current vibration.");
return -EPERM;
}
if (fd_stop < 0) {
fd_stop = open(CIRCLE_OFF_PATH, O_RDONLY);
if (fd_stop < 0) {
- _E("Handle %d fail to check fd", device_handle);
+ _E("Handle(%d) fail to check fd.", device_handle);
return -ENODEV;
}
}
ret = read(fd_stop, buf, BUF_SIZE);
if (ret < 0) {
- _E("Failed to stop");
+ _E("Failed to stop.");
return -errno;
}
if (stop_timer) {
{
if ((access(CIRCLE_ON_PATH, R_OK) != 0) ||
(access(CIRCLE_OFF_PATH, R_OK) != 0)) {
- _E("Do not support wearable haptic device");
+ _E("Do not support wearable haptic device.");
state = false;
return false;
}
state = true;
- _I("Support wearable haptic device");
+ _I("Support wearable haptic device.");
return true;
}
static bool is_valid(void)
{
if (is_emulator()) {
- _I("Support emulator haptic device");
+ _I("Support emulator haptic device.");
return true;
}
- _E("Do not support emulator haptic device");
+ _E("Do not support emulator haptic device.");
return false;
}
ret = stat(HAPTIC_MODULE_PATH, &buf);
if (ret < 0) {
- _E("stat file(%s) error : %d", HAPTIC_MODULE_PATH, errno);
+ _E("Failed to stat file(%s): %d", HAPTIC_MODULE_PATH, errno);
goto error;
}
dlopen_handle = dlopen(HAPTIC_MODULE_PATH, RTLD_NOW);
if (!dlopen_handle) {
- _E("dlopen failed");
+ _E("Failed to dlopen.");
goto error;
}
get_haptic_plugin_interface = dlsym(dlopen_handle, "get_haptic_plugin_interface");
if (!get_haptic_plugin_interface) {
- _E("dlsym failed");
+ _E("Failed to dlsym.");
goto error;
}
plugin_intf = get_haptic_plugin_interface();
if (!plugin_intf) {
- _E("get_haptic_plugin_interface() failed");
+ _E("Failed to get_haptic_plugin_interface().");
goto error;
}
- _I("Support external haptic device");
+ _I("Support external haptic device.");
return true;
error:
dlopen_handle = NULL;
}
- _I("Do not support external haptic device");
+ _I("Do not support external haptic device.");
return false;
}
int handle = (int)(long)data;
bool found;
- _I("stop vibration by timer");
+ _I("Stop vibration by timer.");
found = find_from_list(handle);
if (!found)
if (device_handle == NULL) {
if (peripheral_i2c_open(GPIO_I2C_BUS_INDEX, DRV2605L_DEFAULT_ADDR, &device_handle) < PERIPHERAL_ERROR_NONE) {
- _E("Failed to open I2C");
+ _E("Failed to open I2C.");
return -EIO;
}
}
static int gpio_haptic_get_device_count(int *count)
{
- _I("HAL: The max number of DRV2605L is %d", (int)MAX_HAPIC);
+ _I("HAL: The max number of DRV2605L is %d.", (int)MAX_HAPIC);
if (count)
*count = MAX_HAPIC;
/* if it is the first element */
n = DD_LIST_LENGTH(handle_list);
if (n == 0) {
- _I("Peripheral Device Open");
+ _I("Peripheral Device Open.");
if (device_handle == NULL) {
if (peripheral_i2c_open(GPIO_I2C_BUS_INDEX, DRV2605L_DEFAULT_ADDR, &device_handle) < PERIPHERAL_ERROR_NONE) {
- _E("Failed to open I2C");
+ _E("Failed to open I2C.");
return -EIO;
}
}
if (device_handle == NULL) {
if (peripheral_i2c_open(GPIO_I2C_BUS_INDEX, DRV2605L_DEFAULT_ADDR, &device_handle) < PERIPHERAL_ERROR_NONE) {
- _E("Failed to open I2C");
+ _E("Failed to open I2C.");
return -EIO;
}
}
/* stop vibration */
r = gpio_haptic_stop_device(handle);
if (r < 0)
- _I("already stopped or failed to stop effect : %d", r);
+ _I("Already stopped or failed to stop effect: %d", r);
- _D("handle %d is closed and timer deleted", handle);
+ _D("Handle(%d) is closed and timer deleted.", handle);
DD_LIST_REMOVE(handle_list, (gpointer)(long)handle);
/* if it is the last element */
n = DD_LIST_LENGTH(handle_list);
if (n == 0) {
- _I("Peripheral Device Close");
+ _I("Peripheral Device Close.");
if (device_handle != NULL) {
if (peripheral_i2c_close(device_handle) < PERIPHERAL_ERROR_NONE) {
- _E("Failed to close peripheral I2C");
+ _E("Failed to close peripheral I2C.");
return -EIO;
}
device_handle = NULL;
if (device_handle == NULL) {
if (peripheral_i2c_open(GPIO_I2C_BUS_INDEX, DRV2605L_DEFAULT_ADDR, &device_handle) < PERIPHERAL_ERROR_NONE) {
- _E("Failed to open I2C");
+ _E("Failed to open I2C.");
return -EIO;
}
}
//stop_timer = ecore_timer_add(duration/1000.f, gpio_haptic_timer_cb, (void *)(long)handle);
stop_timer = g_timeout_add(duration, gpio_haptic_timer_cb, (void *)(long)handle);
if (!stop_timer)
- _E("Failed to add timer callback");
+ _E("Failed to add timer callback.");
}
- _D("device handle %d %dms", handle, duration);
+ _D("Device handle(%d) %dms", handle, duration);
return 0;
}
return -EINVAL;
if (cur_h_data.handle > 0 && cur_h_data.handle != handle) {
- _E("Only same handle can stop current vibration");
+ _E("Only same handle can stop current vibration.");
return -EPERM;
}
if (device_handle == NULL) {
if (peripheral_i2c_open(GPIO_I2C_BUS_INDEX, DRV2605L_DEFAULT_ADDR, &device_handle) < PERIPHERAL_ERROR_NONE) {
- _E("Failed to open I2C");
+ _E("Failed to open I2C.");
return -EIO;
}
}
peripheral_i2c_h handle;
if (peripheral_i2c_open(GPIO_I2C_BUS_INDEX, DRV2605L_DEFAULT_ADDR, &handle) < PERIPHERAL_ERROR_NONE) {
- _E("Failed to open I2C");
+ _E("Failed to open I2C.");
state = false;
return false;
}
if (peripheral_i2c_read_register_byte(handle, DRV2605L_REGISTER_STATUS, &result) < PERIPHERAL_ERROR_NONE) {
- _E("Failed to read peripheral I2C");
+ _E("Failed to read peripheral I2C.");
if (peripheral_i2c_close(handle) < PERIPHERAL_ERROR_NONE)
- _E("Failed to close peripheral I2C");
+ _E("Failed to close peripheral I2C.");
state = false;
return false;
}
if (peripheral_i2c_close(handle) < PERIPHERAL_ERROR_NONE) {
- _E("Failed to close peripheral I2C");
+ _E("Failed to close peripheral I2C.");
state = false;
return false;
}
state = true;
- _I("Support gpio haptic device");
+ _I("Support gpio haptic device.");
return true;
}
static const struct haptic_plugin_ops *load(void)
{
- _I("gpio haptic device module loaded");
+ _I("Gpio haptic device module loaded.");
return &default_plugin;
}
data = (struct duration_data *)calloc(1, sizeof(struct duration_data));
if (!data) {
- _E("not enough memory");
+ _E("Not enough memory.");
return -ENOMEM;
}
memcpy(data, update, sizeof(struct duration_data));
pattern_duration += (update.duration + update.wait);
if (pattern_duration > VIB_LOCK_TIMEOUT_MAX) {
- _D("Max pattern duration");
+ _D("Max pattern duration.");
pattern_duration = VIB_LOCK_TIMEOUT_MAX;
}
duration = value;
*pattern_duration += duration;
if (*pattern_duration > VIB_LOCK_TIMEOUT_MAX) {
- _D("Max pattern duration");
+ _D("Max pattern duration.");
*pattern_duration = VIB_LOCK_TIMEOUT_MAX;
}
conf = (struct vibration_config *)calloc(1, sizeof(struct vibration_config));
if (!conf) {
- _E("fail to alloc");
+ _E("Failed to alloc.");
ret = -errno;
goto error_out;
}
conf->pattern = strdup(pattern);
if (!conf->pattern) {
- _E("fail to copy %s pattern data", pattern);
+ _E("Failed to copy pattern data(%s).", pattern);
ret = -errno;
goto error_out;
}
if (index < (VALUE_MAX_LEN - 2)) /* Temporal limit */
val[index++] = elem;
else
- _E("Pattern %s is out of bound: %s", pattern, val);
+ _E("Pattern(%s) is out of bound: %s", pattern, val);
}
}
close(fd);
conf = (struct vibration_config *)calloc(1, sizeof(struct vibration_config));
if (!conf) {
- _E("fail to alloc");
+ _E("Failed to alloc.");
return -ENOMEM;
}
conf->pattern_duration = 0;
conf->pattern = strdup(result->name);
if (!conf->pattern) {
- _E("fail to copy %s pattern data", result->name);
+ _E("Failed to copy pattern data(%s).", result->name);
goto error_out;
}
value = check + 1;
conf->standard = strdup(value);
if (!conf->standard) {
- _E("fail to copy standard name");
+ _E("Failed to copy standard name.");
goto error_out;
}
DD_LIST_APPEND(vib_conf_list, conf);
dir = opendir(STANDARD_FILE_PATH);
if (!dir) {
- _E("Failed to load %s Use default value!", STANDARD_FILE_PATH);
+ _E("Failed to load '%s' Use default value.", STANDARD_FILE_PATH);
return;
}
while ((dent = readdir(dir))) {
_E("Failed to parse %s: %d", dent->d_name, ret);
}
closedir(dir);
- _D("Success to load %s", STANDARD_FILE_PATH);
+ _D("Success to load '%s'", STANDARD_FILE_PATH);
}
void pattern_config_parse(void)
ret = config_parse(VIBRATION_CONF_PATH, vibration_load_config, NULL);
if (ret < 0)
- _E("Failed to load %s, %d Use default value!", VIBRATION_CONF_PATH, ret);
+ _E("Failed to load '%s'. Use default value: %d", VIBRATION_CONF_PATH, ret);
load_standard_vibration_patterns();
}
}
if (!CHECK_VALID_OPS(h_ops, r)) {
- _E("Can't find the valid haptic device");
+ _E("Can't find the valid haptic device.");
return r;
}
step = 100 / (haptic_conf.level-1);
for (i = 0; i < haptic_conf.level; ++i) {
if (level <= i*step) {
- _D("Level changed : %d -> %d", level, haptic_conf.level_arr[i]);
+ _D("Level changed. %d -> %d", level, haptic_conf.level_arr[i]);
return haptic_conf.level_arr[i];
}
}
- _D("Play default level");
+ _D("Play default level.");
return DEFAULT_FEEDBACK_LEVEL * HAPTIC_FEEDBACK_STEP;
}
struct haptic_info *info = user_data;
int handle;
- _I("%s (sender:%s)", __func__, name);
+ _I("%s (sender=%s)", __func__, name);
if (!info)
return;
if (!info) {
info = add_haptic_info(sender);
if (!info) {
- _E("fail to create haptic information");
+ _E("Failed to create haptic information.");
ret = -EPERM;
h_ops->close_device(handle);
goto exit;
cur_h_data.priority = PRIORITY_MIN;
if (duration_timer) {
- _I("Remove duration_timer");
+ _I("Remove duration_timer.");
g_source_remove(duration_timer);
duration_timer = 0;
}
g_variant_get(param, "(u)", &handle);
if (!sender) {
- _E("fail to get sender from dbus message");
+ _E("Failed to get sender from dbus message.");
ret = -EPERM;
goto exit;
}
info = get_matched_haptic_info(sender);
if (!info) {
- _E("fail to find the matched haptic info.");
+ _E("Failed to find the matched haptic info.");
goto exit;
}
vibrate_info = (struct vibrate_monotone_info *)data;
if (vibrate_info->priority < cur_h_data.priority) {
- _I("Handle %d skip low priority(pre:%d now:%d)", vibrate_info->handle, cur_h_data.priority, vibrate_info->priority);
+ _I("Handle(%d) skip low priority. pre=%d now=%d", vibrate_info->handle, cur_h_data.priority, vibrate_info->priority);
free(vibrate_info);
return;
}
ret = device_power_request_lock(POWER_LOCK_CPU, vibrate_info->duration);
if (ret != DEVICE_ERROR_NONE)
- _E("Failed to request power lock");
+ _E("Failed to request power lock.");
duration_timer = g_timeout_add(vibrate_info->duration, _cb, NULL);
h_ops->vibrate_monotone(cur_h_data.handle, vibrate_info->duration, cur_h_data.level, cur_h_data.priority);
priority = PRIORITY_TOP;
if (duration <= 0) {
- _E("Skip vibrate handle %d requested less than 0", handle);
+ _E("Skip vibrate handle(%d) requested less than 0.", handle);
ret = -EINVAL;
goto exit;
}
vibrate_info = calloc(1, sizeof(struct vibrate_monotone_info));
if (!vibrate_info) {
- _E("failed to allocate memory for vibrate_info");
+ _E("Failed to allocate memory for vibrate_info.");
ret = -errno;
goto exit;
}
head = (dd_list *)data;
if (cur_h_data.stop) {
- _I("Stop currunt vibration");
+ _I("Stop currunt vibration.");
cur_h_data.stop = false;
cur_h_data.handle = INVALID_HANDLE;
cur_h_data.priority = PRIORITY_MIN;
}
DD_LIST_FOREACH_SAFE(head, n, next, node) {
- _D("Handle %d play: %dms and Wait: %dms %s type",
+ _D("Handle(%d) play=%dms and Wait=%dms %s type.",
cur_h_data.handle, node->duration, node->wait,
cur_h_data.unlimit ? "Unlimit" : "Once");
if ((node->duration + node->wait) <= 0) {
break;
}
if (ret != 0) {
- _D("auto stop vibration");
+ _D("Auto stop vibration.");
cur_h_data.stop = true;
}
out:
/* Same or higher priority pattern should be played */
if (vibrate_info->priority < cur_h_data.priority) {
- _I("Handle %d skip low priority(pre:%d now:%d)", vibrate_info->handle, cur_h_data.priority, vibrate_info->priority);
+ _I("Handle(%d) skip low priority. pre=%d now=%d", vibrate_info->handle, cur_h_data.priority, vibrate_info->priority);
goto out;
}
cur_h_data.level = vibrate_info->level;
cur_h_data.priority = vibrate_info->priority;
cur_h_data.stop = false;
- _I("Handle %d play %s pri %d %s", cur_h_data.handle, conf->pattern, cur_h_data.priority,
+ _I("Handle(%d) play=%s pri=%d %s", cur_h_data.handle, conf->pattern, cur_h_data.priority,
cur_h_data.unlimit ? "Unlimit" : "Once");
if (conf->pattern_duration <= 0)
if (!cur_h_data.unlimit && conf->pattern_duration > 0) {
ret = device_power_request_lock(POWER_LOCK_CPU, (int)conf->pattern_duration);
if (ret != DEVICE_ERROR_NONE)
- _E("Failed to request power lock");
+ _E("Failed to request power lock.");
}
haptic_duration_play((void *)cur_h_data.vibration_data);
goto out;
}
- _E("Handle %d %s is not supported", vibrate_info->handle, pattern);
+ _E("Handle(%d) %s is not supported.", vibrate_info->handle, pattern);
out:
free(vibrate_info->pattern);
vibrate_info = calloc(1, sizeof(struct vibrate_effect_info));
if (!vibrate_info) {
- _E("failed to allocate memory for vibrate_info");
+ _E("Failed to allocate memory for vibrate_info.");
ret = -errno;
goto exit;
}
vibrate_info->pattern = pattern;
pattern = NULL;
if (!vibrate_info->pattern) {
- _E("failed to allocate memory for pattern");
+ _E("Failed to allocate memory for pattern.");
ret = -errno;
free(vibrate_info);
goto exit;
goto exit;
if (haptic_disabled) {
- _I("Haptic disabled");
+ _I("Haptic disabled.");
goto exit;
}
g_variant_get(param, "(u)", &handle);
if (cur_h_data.handle != handle) {
- _D("Not the request from current vibration handle :%d. Skip", handle);
+ _D("Not the request from current vibration handle(%d). Skip.", handle);
goto exit;
}
dd_list *elem;
struct haptic_info *info;
- _D("sender handle");
+ _D("Sender Handle");
DD_LIST_FOREACH(haptic_handle_list, n, info) {
for (elem = info->handle_list; elem; elem = elem->next)
- _D("%s %d", info->sender, (int)(long)elem->data);
+ _D("%s %d", info->sender, (int)(long)elem->data);
}
return g_variant_new_tuple(NULL, 0);
ret = pattern_is_supported(data);
- _I("%s is supported : %d", data, ret);
+ _I("%s is supported: %d", data, ret);
exit:
g_free(data);
return;
if (vconf_get_bool(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, &status) < 0) {
- _E("fail to get VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL");
+ _E("Failed to get VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL.");
status = 1;
}
ret = vconf_get_int(VCONFKEY_SETAPPL_TOUCH_FEEDBACK_VIBRATION_LEVEL_INT, &level);
if (ret < 0) {
- _E("fail to get VCONFKEY_SETAPPL_TOUCH_FEEDBACK_VIBRATION_LEVEL_INT");
+ _E("Failed to get VCONFKEY_SETAPPL_TOUCH_FEEDBACK_VIBRATION_LEVEL_INT.");
level = HARDKEY_VIB_FEEDBACK;
}
ret = h_ops->vibrate_monotone(g_handle, HARDKEY_VIB_DURATION,
level*HAPTIC_FEEDBACK_STEP, PRIORITY_HIGH);
if (ret < 0)
- _E("fail to vibrate buffer : %d", ret);
+ _E("Failed to vibrate buffer: %d", ret);
return;
}
haptic_internal_init();
/* power off vibration */
- _I("Handle %d dur %dms pri %d level %d",
+ _I("Handle=%d dur=%dms pri=%d level=%d",
g_handle, POWER_OFF_VIB_DURATION, PRIORITY_HIGH, POWER_VIB_FEEDBACK);
ret = h_ops->vibrate_monotone(g_handle, POWER_OFF_VIB_DURATION,
POWER_VIB_FEEDBACK, PRIORITY_HIGH);
if (ret < 0) {
- _E("fail to vibrate_monotone : %d", ret);
+ _E("Failed to vibrate_monotone: %d", ret);
return;
}
} else if (MATCH(result->name, "level")) {
conf->level = atoi(result->value);
if (conf->level < 0 || conf->level >= INT_MAX - 1) {
- _E("You must set level with positive number in integer range");
+ _E("You must set level with positive number in integer range.");
return -EINVAL;
}
conf->level_arr = calloc(sizeof(int), conf->level);
if (!conf->level_arr) {
- _E("failed to allocate memory for level");
+ _E("Failed to allocate memory for level.");
return -errno;
}
} else if (MATCH(result->name, "value")) {
if (MATCH(result->section, "Haptic")) {
ret = parse_section(result, user_data, -1);
if (ret < 0) {
- _E("failed to parse [Haptic] section : %d", ret);
+ _E("Failed to parse 'Haptic' section: %d", ret);
return ret;
}
goto out;
if (MATCH(result->section, name)) {
ret = parse_section(result, user_data, index);
if (ret < 0) {
- _E("failed to parse [level] section : %d", ret);
+ _E("Failed to parse 'level' section: %d", ret);
return ret;
}
goto out;
/* get haptic data from configuration file */
r = config_parse(HAPTIC_CONF_PATH, haptic_load_config, &haptic_conf);
if (r < 0) {
- _E("failed to load configuration file(%s) : %d", HAPTIC_CONF_PATH, r);
+ _E("Failed to load configuration file(%s): %d", HAPTIC_CONF_PATH, r);
safe_free(haptic_conf.level_arr);
}
/* init dbus interface */
r = dbus_handle_register_dbus_object(NULL, VIBRATOR_PATH_HAPTIC, &dbus_interface);
if (r < 0)
- _E("fail to init hdbus interface and method(%d)", r);
+ _E("Failed to init hdbus interface and method: %d", r);
/* register notifier for below each event */
id_sig_change_hardkey = subscribe_dbus_signal(NULL, DEVICED_PATH_KEY, DEVICED_INTERFACE_KEY, SIGNAL_CHANGE_HARDKEY, haptic_hardkey_changed_cb, NULL, NULL);
if (id_sig_change_hardkey <= 0) {
- _E("Failed to register signal handler! %d", r);
+ _E("Failed to register signal handler: %d", r);
return;
}
id_sig_pwr_off_state = subscribe_dbus_signal(NULL, DEVICED_PATH_POWEROFF, DEVICED_INTERFACE_POWEROFF, SIGNAL_POWEROFF_STATE, haptic_poweroff_cb, NULL, NULL);
if (id_sig_pwr_off_state <= 0) {
- _E("Failed to register signal handler! %d", r);
+ _E("Failed to register signal handler: %d", r);
return;
}
if (haptic_conf.sound_capture) {
r = vconf_notify_key_changed(VCONFKEY_RECORDER_STATE, sound_capturing_cb, NULL);
if (r != 0)
- _W("Add watch for VCONFKEY_RECORDER_STATE failed");
+ _W("Add watch for VCONFKEY_RECORDER_STATE failed.");
}
/* Initialize vibration_handle (Use vibration now) */
if (haptic_conf.sound_capture) {
r = vconf_ignore_key_changed(VCONFKEY_RECORDER_STATE, sound_capturing_cb);
if (r != 0)
- _W("Remove watch for VCONFKEY_RECORDER_STATE failed");
+ _W("Remove watch for VCONFKEY_RECORDER_STATE failed.");
}
/* unregister notifier for below each event */
static int haptic_start(void)
{
- _I("start");
+ _I("Start");
haptic_disabled = false;
return 0;
}
static int haptic_stop(void)
{
- _I("stop");
+ _I("Stop");
haptic_disabled = true;
return 0;
}
struct ff_info *info = (struct ff_info *)data;
if (!info) {
- _E("Failed to check info");
+ _E("Failed to check info.");
return G_SOURCE_REMOVE;
}
if (!check_valid_handle(info)) {
- _E("Failed to check valied info");
+ _E("Failed to check valied info.");
return G_SOURCE_REMOVE;
}
- _I("stop vibration by timer : id(%d)", info->effect.id);
+ _I("Stop vibration by timer. id(%d)", info->effect.id);
/* stop previous vibration */
ff_stop(ff_fd, &info->effect);
fd = open(ev_path, O_RDWR);
if (fd < 0) {
- _E("Failed to open %s(%d)", ev_path, errno);
+ _E("Failed to open '%s'.: %d", ev_path, errno);
continue;
}
}
if (test_bit(FF_CONSTANT, features))
- _D("%s type : constant", ev_path);
+ _D("'%s' type: constant", ev_path);
if (test_bit(FF_PERIODIC, features))
- _D("%s type : periodic", ev_path);
+ _D("'%s' type: periodic", ev_path);
if (test_bit(FF_SPRING, features))
- _D("%s type : spring", ev_path);
+ _D("'%s' type: spring", ev_path);
if (test_bit(FF_FRICTION, features))
- _D("%s type : friction", ev_path);
+ _D("'%s' type: friction", ev_path);
if (test_bit(FF_RUMBLE, features))
- _D("%s type : rumble", ev_path);
+ _D("'%s' type: rumble", ev_path);
if (test_bit(FF_RUMBLE, features)) {
memcpy(ff_path, ev_path, strlen(ev_path));
double magnitude;
if (!effect) {
- _E("There is no valid effect");
+ _E("There is no valid effect.");
return -EINVAL;
}
magnitude = (double)level/HAPTIC_MODULE_FEEDBACK_MAX;
magnitude *= RUMBLE_MAX_MAGNITUDE;
- _I("info : magnitude(%d) length(%d)", (int)magnitude, length);
+ _I("magnitude=%d length=%d", (int)magnitude, length);
/* set member variables in effect struct */
effect->u.rumble.strong_magnitude = (int)magnitude;