Device
Object Hierarchy:
Description:
Namespace: GUsb
Package: gusb
Content:
Properties:
- public Context context { construct; }
- public void* libusb_device { get; construct; }
- public string platform_id { construct; }
Static methods:
- public static Quark error_quark ()
Creation methods:
- protected Device ()
Methods:
- public void add_tag (string tag)
Adds a tag, which is included in the JSON log to identify the specific device.
- public bool bulk_transfer (uint8 endpoint, uint8[] data, out size_t actual_length, uint timeout, Cancellable? cancellable = null) throws Error
Perform a USB bulk transfer.
- public async ssize_t bulk_transfer_async (uint8 endpoint, uint8[] data, uint timeout, Cancellable? cancellable) throws Error
Do an async bulk transfer
- public bool claim_interface (int @interface, DeviceClaimInterfaceFlags flags) throws Error
Claim an interface of the device.
- public void clear_events ()
Clear all the events saved by the device.
- public bool close () throws Error
Closes the device when it is no longer required.
- public bool control_transfer (DeviceDirection direction, DeviceRequestType request_type, DeviceRecipient recipient, uint8 request, uint16 value, uint16 idx, uint8[] data, out size_t actual_length, uint timeout, Cancellable? cancellable = null) throws Error
Perform a USB control transfer.
- public async ssize_t control_transfer_async (DeviceDirection direction, DeviceRequestType request_type, DeviceRecipient recipient, uint8 request, uint16 value, uint16 idx, uint8[] data, uint timeout, Cancellable? cancellable) throws Error
Do an async control transfer
- public uint8 get_address ()
Gets the USB address for the device.
- public BosDescriptor get_bos_descriptor (uint8 capability) throws Error
Gets the first bos_descriptor that matches the descriptor capability.
- public GenericArray<unowned BosDescriptor> get_bos_descriptors () throws Error
Gets all the BOS descriptors exported by the device.
- public uint8 get_bus ()
Gets the USB bus number for the device.
- public GenericArray<Device> get_children ()
Gets the device children if any exist.
- public int get_configuration () throws Error
Get the bConfigurationValue for the active configuration of the device.
- public uint8 get_configuration_index ()
Get the index for the active Configuration string descriptor ie, iConfiguration.
- public unowned DateTime get_created ()
Gets the date and time that the Device was created.
- public uint8 get_custom_index (uint8 class_id, uint8 subclass_id, uint8 protocol_id) throws Error
Gets the string index from the vendor class interface descriptor.
- public uint8 get_device_class ()
Gets the device class, typically a DeviceClassCode.
- public uint8 get_device_protocol ()
Gets the device protocol qualified by the class and subclass numbers.
- public uint8 get_device_subclass ()
Gets the device subclass qualified by the class number.
- public GenericArray<unowned DeviceEvent> get_events ()
Gets all the events saved by the device.
- public Bytes get_hid_descriptor_default () throws Error
Gets the default HID descriptors exported by the device.
- public GenericArray<unowned Bytes> get_hid_descriptors () throws Error
Gets all the HID descriptors exported by the device.
- public Interface get_interface (uint8 class_id, uint8 subclass_id, uint8 protocol_id) throws Error
Gets the first interface that matches the vendor class interface descriptor.
- public GenericArray<unowned Interface> get_interfaces () throws Error
Gets all the interfaces exported by the device.
- public uint8 get_manufacturer_index ()
Gets the index for the Manufacturer string descriptor.
- public Device get_parent ()
Gets the device parent if one exists.
- public uint16 get_pid ()
Gets the product ID for the device.
- public unowned string get_pid_as_str ()
Gets the product ID for the device as a string.
- public unowned string get_platform_id ()
Gets the platform identifier for the device.
- public uint8 get_port_number ()
Gets the USB port number for the device.
- public uint8 get_product_index ()
Gets the index for the Product string descriptor.
- public uint16 get_release ()
Gets the BCD firmware version number for the device.
- public uint8 get_serial_number_index ()
Gets the index for the Serial Number string descriptor.
- public uint16 get_spec ()
Gets the BCD specification revision for the device.
- public string get_string_descriptor (uint8 desc_index) throws Error
Get a string descriptor from the device.
- public Bytes get_string_descriptor_bytes (uint8 desc_index, uint16 langid) throws Error
Get a raw string descriptor from the device.
- public Bytes get_string_descriptor_bytes_full (uint8 desc_index, uint16 langid, size_t length) throws Error
Get a raw string descriptor from the device.
- public GenericArray<unowned string> get_tags ()
Gets all the tags.
- public uint16 get_vid ()
Gets the vendor ID for the device.
- public unowned string get_vid_as_str ()
Gets the vendor ID for the device as a string.
- public bool has_tag (string tag)
Checks if a tag has been used to identify the specific device.
- public bool interrupt_transfer (uint8 endpoint, uint8[] data, out size_t actual_length, uint timeout, Cancellable? cancellable = null) throws Error
Perform a USB interrupt transfer.
- public async ssize_t interrupt_transfer_async (uint8 endpoint, uint8[] data, uint timeout, Cancellable? cancellable) throws Error
Do an async interrupt transfer
- public void invalidate ()
Invalidates the caches used in get_interfaces.
- public bool is_emulated ()
Gets if the device is emulated.
- public bool open () throws Error
Opens the device for use.
- public bool release_interface (int @interface, DeviceClaimInterfaceFlags flags) throws Error
Release an interface of the device.
- public void remove_tag (string tag)
Removes a tag, which is included in the JSON log to identify the specific device.
- public bool reset () throws Error
Perform a USB port reset to reinitialize a device.
- public bool set_configuration (int configuration) throws Error
Set the active bConfigurationValue for the device.
- public bool set_interface_alt (int @interface, uint8 alt) throws Error
Sets an alternate setting on an interface.
Inherited Members:
All known members inherited from class GLib.Object
All known members inherited from interface GLib.Initable