*/
int usb_host_set_config(usb_host_config_h configuration);
+/**
+ * @ingroup CAPI_USB_HOST_DEV_MODULE
+ * @brief Puts a device in unconfigured state.
+ * @since_tizen 4.0
+ * @param[in] dev Device to be unconfigured
+ * @return 0 on success, otherwise a negative error value
+ * @retval #USB_HOST_ERROR_NONE Successful
+ * @retval #USB_HOST_ERROR_NOT_SUPPORTED Not supported
+ * @retval #USB_HOST_ERROR_RESOURCE_BUSY Interfaces are currently claimed
+ * @retval #USB_HOST_ERROR_NO_SUCH_DEVICE Device has beed disconnected
+ */
+int usb_host_device_unconfigure(usb_host_device_h dev);
+
/**
* @ingroup CAPI_USB_HOST_DEV_MODULE
* @brief Gets USB specification release number.
return ret;
}
+int usb_host_device_unconfigure(usb_host_device_h dev)
+{
+ int ret;
+
+ if (!usb_host_feature_enabled())
+ return USB_HOST_ERROR_NOT_SUPPORTED;
+
+ if (!dev) {
+ _E("Ivalid parameter was passed");
+ return USB_HOST_ERROR_INVALID_PARAMETER;
+ }
+
+ ret = libusb_set_configuration(dev->lusb_dev_handle, -1);
+ if (ret < 0) {
+ _E("Could not put device in unconfigured state");
+ return translate_error(ret);
+ }
+
+ return USB_HOST_ERROR_NONE;
+}
+
int usb_host_claim_interface(usb_host_interface_h interface, bool force)
{
int ret = USB_HOST_ERROR_INVALID_PARAMETER;