Interface (Class)

class usbx.Interface(number: int, alternates: list[AlternateInterface])

USB interface information.

The information originates from the configuration descriptor provided by the USB device.

alternates: list[AlternateInterface]

USB alternate interfaces.

property current_alternate: AlternateInterface

Currently active alternate interface.

This property is not information from the configuration descriptor but rather represents the current state of the device.

get_alternate(number: int) AlternateInterface | None

Get the USB alternate interface settings with number number.

Parameters:

number – USB alternate setting number.

Returns:

USB alternate interface, or None if there is no alternate setting with the given number.

property is_claimed: bool

Boolean indicating if the interface is claimed.

Before communication on endpoints is possible, the interface must be claimed for exclusive use by the application.

This property is not information from the configuration descriptor but rather represents the current state of the device.

number: int

USB interface number (bInterfaceNumber of USB interface descriptor).