Method

GUsbDeviceget_string_descriptor_bytes

Declaration

GBytes*
g_usb_device_get_string_descriptor_bytes (
  GUsbDevice* self,
  guint8 desc_index,
  guint16 langid,
  GError** error
)

Description

Get a raw string descriptor from the device. The returned string should be freed with g_bytes_unref() when no longer needed. The descriptor will be at most 128 btes in length, if you need to issue a request with either a smaller or larger descriptor, you can use g_usb_device_get_string_descriptor_bytes_full instead.

Available since:0.3.6

Parameters

desc_index guint8
 

The index for the string descriptor to retrieve.

langid guint16
 

The language ID.

error GError **
  The return location for a GError*, or NULL.

Return value

Returns: GBytes
 

A possibly UTF-16 string, or NULL on error.

 The caller of the method takes ownership of the data, and is responsible for freeing it.