remove usb_host_device_get_string_descriptor_ascii() from the api list 58/87958/1
authortaeyoung <ty317.kim@samsung.com>
Mon, 12 Sep 2016 09:10:09 +0000 (18:10 +0900)
committertaeyoung <ty317.kim@samsung.com>
Mon, 12 Sep 2016 09:15:25 +0000 (18:15 +0900)
it can be replaced to usb_host_device_get_serial_number_str(),
usb_host_device_get_product_str(), usb_host_device_get_manufacturer_str().

Change-Id: I4bf8fd54eb3138e11e72b0ff65a56ee107356700
Signed-off-by: taeyoung <ty317.kim@samsung.com>
include/usb_host.h
src/usb_host.c

index 55c489ce8f8348928498eb8b9f43918e8dd66e93..67c3dda9de33202f520d36dd04901ab28b6d4179 100644 (file)
@@ -597,26 +597,6 @@ int usb_host_device_get_product_str(usb_host_device_h dev, int *length, unsigned
  */
 int usb_host_device_get_serial_number_str(usb_host_device_h dev, int *length, unsigned char *data);
 
-/**
- * @ingroup CAPI_USB_HOST_DEV_MODULE
- * @brief Gets string descriptor.
- * @details Retrieves a string descriptor in ASCII.
- * @since_tizen 3.0
- * @param[in] dev An opened device
- * @param[in] desc_index Index of descriptor to retrieve
- * @param[in, out] length Data buffer size/how much was actually used
- * @param[out] data Out buffer for ASCII string descriptor
- * @return 0 on success, otherwise a negative error value
- * @retval #USB_HOST_ERROR_NONE Successful
- * @retval #USB_HOST_ERROR_OVERFLOW There was no space in buffer
- * @retval #USB_HOST_ERROR_NOT_SUPPORTED Not supported
- * @retval #USB_HOST_ERROR_INVALID_PARAMETER Invalid parameter was passed
- * @retval #USB_HOST_ERROR_PERMISSION_DENIED Permission denied
- * @pre dev must point to device opened by usb_host_device_open() or usb_host_device_open_with_vid_pid().
- */
-int usb_host_device_get_string_descriptor_ascii(usb_host_device_h dev,
-       int desc_index, int *length, unsigned char *data);
-
 /**
  * @ingroup CAPI_USB_HOST_CONFIG_MODULE
  * @brief Gets number of interfaces for given configuration.
index b74c8281d83971d679d1f3d2a35a220ee2ee8df4..53cebc5b5018244f6065955e5c60fcde581980d2 100644 (file)
@@ -1004,6 +1004,35 @@ int usb_host_is_device_opened(usb_host_device_h dev, bool *is_opened)
        return USB_HOST_ERROR_NONE;
 }
 
+static int usb_host_device_get_string_descriptor_ascii(usb_host_device_h dev,
+       int desc_index, int *length, unsigned char *data)
+{
+       int ret;
+
+       if (!usb_host_feature_enabled())
+               return USB_HOST_ERROR_NOT_SUPPORTED;
+
+       if (!dev || !data || !length) {
+               _E("Invalid parameter was passed");
+               return USB_HOST_ERROR_INVALID_PARAMETER;
+       }
+
+       if (dev->lusb_dev_handle == NULL) {
+               _E("Device is not opened");
+               return USB_HOST_ERROR_DEVICE_NOT_OPENED;
+       }
+
+       ret = libusb_get_string_descriptor_ascii(dev->lusb_dev_handle, desc_index, data, *length);
+       if (ret < 0) {
+               ret = translate_error(ret);
+               _E("Failed to get descriptor(%d)", ret);
+               return ret;
+       }
+
+       *length = ret;
+       return USB_HOST_ERROR_NONE;
+}
+
 int usb_host_device_get_manufacturer_str(usb_host_device_h dev, int *length, unsigned char *data)
 {
        if (!usb_host_feature_enabled())
@@ -1419,35 +1448,6 @@ out:
        return ret;
 }
 
-int usb_host_device_get_string_descriptor_ascii(usb_host_device_h dev,
-       int desc_index, int *length, unsigned char *data)
-{
-       int ret;
-
-       if (!usb_host_feature_enabled())
-               return USB_HOST_ERROR_NOT_SUPPORTED;
-
-       if (!dev || !data || !length) {
-               _E("Invalid parameter was passed");
-               return USB_HOST_ERROR_INVALID_PARAMETER;
-       }
-
-       if (dev->lusb_dev_handle == NULL) {
-               _E("Device is not opened");
-               return USB_HOST_ERROR_DEVICE_NOT_OPENED;
-       }
-
-       ret = libusb_get_string_descriptor_ascii(dev->lusb_dev_handle, desc_index, data, *length);
-       if (ret < 0) {
-               ret = translate_error(ret);
-               _E("Failed to get descriptor(%d)", ret);
-               return ret;
-       }
-
-       *length = ret;
-       return USB_HOST_ERROR_NONE;
-}
-
 int usb_host_control_transfer(usb_host_device_h dev, uint8_t bmRequestType,
                             uint8_t bRequest, uint16_t wValue, uint16_t wIndex,
                             unsigned char *data, uint16_t wLength, unsigned int timeout, int *transfered)