dwfpy.device_info.DeviceInfo

class DeviceInfo(device_index=None)[source]

Bases: object

Device information gathered during device enumeration.

Methods

get_device_name

Gets the device name.

get_properties

Read all device properties.

get_serial_number

Gets the device serial number.

get_user_name

Gets the user-defined device name.

normalize_serial_number

Normalizes the serial number, i.e. strip the leading 'SN:' and convert to uppercase.

Attributes

configurations

Returns a list of device configurations.

has_properties

Returns True, if the device properties have been read.

id

Gets the device ID.

is_open

Returns true if the device has been opened.

name

Gets the device name.

revision

Gets the device revision.

serial_number

Gets the 12-digit, unique device serial number.

user_name

Gets the user-defined device name.

property configurations: Tuple[Configuration, ...]

Returns a list of device configurations.

Return type

Tuple[Configuration, ...]

static get_device_name(device_index)[source]

Gets the device name.

Return type

str

get_properties(device_index)[source]

Read all device properties.

Return type

None

static get_serial_number(device_index)[source]

Gets the device serial number.

Return type

str

static get_user_name(device_index)[source]

Gets the user-defined device name.

Return type

str

property has_properties: bool

Returns True, if the device properties have been read.

Return type

bool

property id: int

Gets the device ID.

Return type

int

property is_open: bool

Returns true if the device has been opened.

Return type

bool

property name: str

Gets the device name.

Return type

str

static normalize_serial_number(serial_number)[source]

Normalizes the serial number, i.e. strip the leading ‘SN:’ and convert to uppercase.

Return type

str

property revision: int

Gets the device revision.

Return type

int

property serial_number: str

Gets the 12-digit, unique device serial number.

Return type

str

property user_name: str

Gets the user-defined device name.

Return type

str