GUsb.DeviceList

g GObject.Object GObject.Object GUsb.DeviceList GUsb.DeviceList GObject.Object->GUsb.DeviceList

Subclasses:None

Methods

Inherited:GObject.Object (37)
Structs:GObject.ObjectClass (5)
class new (context)
  coldplug ()
  find_by_bus_address (bus, address)
  find_by_vid_pid (vid, pid)
  get_devices ()

Virtual Methods

Inherited:GObject.Object (7)
  do_device_added (device)
  do_device_removed (device)

Properties

Name Type Flags Short Description
context GUsb.Context r/w/co  

Signals

Inherited:GObject.Object (1)
Name Short Description
device-added This signal is emitted when a USB device is added.
device-removed This signal is emitted when a USB device is removed.

Fields

Inherited:GObject.Object (1)
Name Type Access Description
parent GObject.Object r  

Class Details

class GUsb.DeviceList(**kwargs)
Bases:GObject.Object
Abstract:No
Structure:GUsb.DeviceListClass
classmethod new(context)
Parameters:context (GUsb.Context) – a GUsb.Context
Returns:a new GUsb.DeviceList
Return type:GUsb.DeviceList

Creates a new device list.

You will need to call GUsb.DeviceList.coldplug() to coldplug the list of devices after creating a device list.

New in version 0.1.0.

coldplug()

This function does nothing.

New in version 0.1.0.

find_by_bus_address(bus, address)
Parameters:
  • bus (int) – a bus number
  • address (int) – a bus address
Raises:

GLib.Error

Returns:

a new GUsb.Device, or None if not found.

Return type:

GUsb.Device

Finds a device based on its bus and address values.

New in version 0.1.0.

find_by_vid_pid(vid, pid)
Parameters:
  • vid (int) – a vendor ID
  • pid (int) – a product ID
Raises:

GLib.Error

Returns:

a new GUsb.Device, or None if not found.

Return type:

GUsb.Device

Finds a device based on its bus and address values.

New in version 0.1.0.

get_devices()
Returns:a new GLib.PtrArray of GUsb.Device’s.
Return type:[GUsb.Device]

New in version 0.1.0.

do_device_added(device) virtual
Parameters:device (GUsb.Device) –
do_device_removed(device) virtual
Parameters:device (GUsb.Device) –

Signal Details

GUsb.DeviceList.signals.device_added(device_list, device)
Signal Name:

device-added

Flags:

RUN_LAST

Parameters:

This signal is emitted when a USB device is added.

GUsb.DeviceList.signals.device_removed(device_list, device)
Signal Name:

device-removed

Flags:

RUN_LAST

Parameters:

This signal is emitted when a USB device is removed.

Property Details

GUsb.DeviceList.props.context
Name:context
Type:GUsb.Context
Default Value:None
Flags:READABLE, WRITABLE, CONSTRUCT_ONLY