ret = vconf_get_int(VCONFKEY_SYSMAN_USB_STATUS, &val);
if (ret != VCONF_OK) {
- _E("Failed to get vconf value for usb_status: %d", vconf_get_ext_errno());
+ _E("Failed to get vconf value for USB status: %d", vconf_get_ext_errno());
return ret;
}
SIGNAL_STATE_CHANGED,
g_variant_new("(u)", state));
if (ret < 0)
- _E("Failed to send dbus signal.");
+ _E("Failed to send USB dbus signal.");
}
static void change_usb_client_mode(GDBusConnection *conn,
g_variant_get(param, "(i)", &req_vconf);
if (req_vconf < 0) {
- _E("Failed to get req_vconf.");
+ _E("Failed to get USB req_vconf.");
return;
}
mode = get_mode_bitmap_from_vconf(req_vconf);
if (mode == USB_FUNCTION_INVALID) {
- _E("Failed to convert vconf to mode. There is no mode matches up with vconf %d.", req_vconf);
+ _E("Failed to convert vconf to USB mode. There is no mode matches up with vconf %d.", req_vconf);
return;
}
ret = dbus_handle_add_dbus_object(NULL, DEVICED_PATH_USB, &dbus_interface);
if (ret < 0)
- _E("Failed to init dbus method: %d", ret);
+ _E("Failed to init dbus method for USB: %d", ret);
ret = subscribe_dbus_signal(NULL, DEVICED_PATH_USB,
DEVICED_INTERFACE_USB, "ChangeUsbMode",
change_usb_client_mode, NULL, NULL);
if (ret <= 0) {
- _E("Failed to subscribe dbus signal: %d", ret);
+ _E("Failed to subscribe dbus signal for USB: %d", ret);
return ret;
}
if (vconf_notify_key_changed(VCONFKEY_SETAPPL_USB_DEBUG_MODE_BOOL,
usb_debug_changed, NULL) != VCONF_OK)
- _E("Failed to add usb debug handler.");
+ _E("Failed to add USB debug handler.");
register_notifier(DEVICE_NOTIFIER_USB_DEBUG_MODE, usb_debug_mode_changed);
return;
}
- _I("system_event(%s)", str);
+ _I("USB system_event (%s)", str);
b = bundle_create();
bundle_add_str(b, EVT_KEY_USB_STATUS, str);
mode_v = get_mode_vconf_from_bitmap(mode);
if (mode_v == SET_USB_INVALID) {
- _E("Failed to convert selected_mode to vconf. There is no vconf matches up with mode 0x%x", mode);
+ _E("Failed to convert USB selected_mode to vconf. There is no vconf matches up with USB mode 0x%x", mode);
return -EINVAL;
}
mode_v = get_mode_vconf_from_bitmap(mode);
if (mode_v == SET_USB_INVALID) {
- _E("Failed to convert current_mode to vconf. There is no vconf matches up with mode 0x%x", mode);
+ _E("Failed to convert USB current_mode to vconf. There is no vconf matches up with mode 0x%x", mode);
return -EINVAL;
}
if (!var) {
if (err)
- _E("Error: %s", err->message);
+ _E("USB media notification error: %s", err->message);
return;
}
if (!dh_get_param_from_var(var, "(i)", &id)) {
- _E("Failed to get variant(%s): no message", g_variant_get_type_string(var));
+ _E("Failed to get variant(%s): no USB notification message", g_variant_get_type_string(var));
goto out;
}
noti_id = id;
- _D("Media noti(%d)", noti_id);
+ _D("USB media notification message(%d)", noti_id);
out:
g_variant_unref(var);
if (noti_id < 0) {
ret = add_async_notification("MediaDeviceNotiOn", media_noti_cb, NULL, NULL);
if (ret < 0)
- _E("Failed to show notification for usb connection.");
+ _E("Failed to add USB notification for usb connection: %d", ret);
}
}
if (noti_id >= 0) {
ret = remove_notification("MediaDeviceNotiOff", noti_id);
if (ret < 0)
- _E("Failed to remove event_noti: %d", ret);
+ _E("Failed to remove USB notification for usb connection: %d", ret);
else
noti_id = -1;
}
}
if (!info->open) {
- _E("Failed to open USB gadget translator: open(NULL)");
+ _E("USB gadget does not have open() ");
return NULL;
}
_I("Loading USB client. id=%s", id);
if (hw_get_info(id, (const struct hw_info **)&info)) {
- _I("No usb_client. id=%s", id);
+ _I("No USB client. id=%s", id);
return NULL;
}
if (!info->open) {
- _E("Failed to open USB client(%s): open(NULL)", id);
+ _E("USB client does not have open(). id=%s", id);
return NULL;
}
ret = gadget_translator->id_to_gadget(&gadget_id, &gadget);
if (ret) {
- _E("Unable to translate id into gadget: %d", ret);
+ _E("Unable to translate USB mode id into gadget: %d", ret);
goto out;
}
ret = usb_client->reconfigure_gadget(usb_client, gadget);
gadget_translator->cleanup_gadget(gadget);
if (ret) {
- _E("Unable to configure gadget: %d", ret);
+ _E("Unable to configure USB gadget: %d", ret);
goto out;
}
ret = usb_config_disable();
if (ret < 0) {
- _E("Failed to disable usb config: %d", ret);
+ _E("Failed to disable USB config: %d", ret);
return ret;
}
*/
ret = usb_change_gadget(new_mode);
if (ret < 0) {
- _E("Failed to change gadget: %d", ret);
+ _E("Failed to change USB gadget: %d", ret);
return ret;
}
if (strncmp(state, "CONFIGURED", strlen(state) + 1))
return;
- _I("usb_mode udev event happend : CONFIGURED");
+ _I("USB udev event happend : CONFIGURED USB_STATE");
if (usb_state_get_selected_mode() & USB_FUNCTION_ACM)
systemd_start_unit_wait_started ("data-router.service", NULL, -1);
ret = register_udev_uevent_control(&uh);
if (ret < 0)
- _E("Failed to register udev event(%d)", ret);
+ _E("Failed to register udev event(%d) for USB", ret);
ret = usb_dbus_init();
if (ret < 0)
- _E("Failed to init dbus: %d", ret);
+ _E("Failed to init dbus(%d) for USB", ret);
add_usb_tethering_handler();
add_usb_debug_handler();