Method

GUsbDevicecontrol_transfer

Declaration

gboolean
g_usb_device_control_transfer (
  GUsbDevice* self,
  GUsbDeviceDirection direction,
  GUsbDeviceRequestType request_type,
  GUsbDeviceRecipient recipient,
  guint8 request,
  guint16 value,
  guint16 idx,
  guint8* data,
  gsize length,
  gsize* actual_length,
  guint timeout,
  GCancellable* cancellable,
  GError** error
)

Description

Perform a USB control transfer.

Warning: this function is synchronous, and cannot be cancelled.

Available since:0.1.0

Parameters

direction GUsbDeviceDirection
  No description available.
request_type GUsbDeviceRequestType
 

The request type field for the setup packet.

recipient GUsbDeviceRecipient
  No description available.
request guint8
 

The request field for the setup packet.

value guint16
 

The value field for the setup packet.

idx guint16
 

The index field for the setup packet.

data An array of guint8
 

A suitably-sized data buffer for either input or output.

 The length of the array is specified in the length argument.
 The data is owned by the caller of the function.
length gsize
 

The length field for the setup packet.

actual_length gsize*
 

The actual number of bytes sent, or NULL.

 The argument will be set by the function.
 The argument can be NULL.
 The instance takes ownership of the data, and is responsible for freeing it.
timeout guint
 

Timeout timeout (in milliseconds) that this function should wait before giving up due to no response being received. For an unlimited timeout, use 0.

cancellable GCancellable
 

A GCancellable, or NULL.

 The argument can be NULL.
 The data is owned by the caller of the function.
error GError **
  The return location for a GError*, or NULL.

Return value

Returns: gboolean
 

TRUE on success.