Device enumeration#

One of the key functionalities of the system is to enumerate and provide usable devices to the client code. Opto Engineering devices are controlled via the itala.itala.IDevice class.

Warning

The maximum number of enumerated devices is 255. The maximum number of simultaneously created devices is 50.

Enumerate all available devices#

The quickest way to be up and running is to make the system look for devices across all network interfaces available. The result of the enumeration performed by the system is a list of itala.itala.DeviceInfo containing useful information about available devices. To start using a specific device, the client code must pick the proper itala.itala.DeviceInfo and provide it to the system so that it can create the device instance.

Warning

The client code is responsible for device instances lifetime. The client code must destroy the device instances when they are no longer required.

# Look for connected devices across all network interfaces on the host.
# Stop the enumeration after an elapsed time of 700 milliseconds.
device_infos = system.enumerate_devices(700)
first_device_info = device_infos[0]

print("First device found is: " + str(first_device_info.serial_number))

device = system.create_device(first_device_info)

# Use the device

device.dispose()

Enumerate devices under specific network interfaces#

A more precise enumeration can be performed by specifing a target network interface. The proper itala.itala.InterfaceInfo data must be passed to the system to specify under which interface the device enumeration must be performed. To obtain the list of itala.itala.InterfaceInfo, an interface enumeration must be accomplished, via itala.itala.ISystem.enumerate_interfaces().

# Look for available network interfaces on the host.
interface_infos = system.enumerate_interfaces()
first_interface_info = interface_infos[0]

pritn("First interface found is " + str(first_interface_info.display_name))

# Looks for connected devices under the specified interface.
# Stops the enumeration after an elapsed time of 700 milliseconds.
device_infos = system.enumeratedevices(first_interface_info, 700)
first_device_info = device_infos[0]

print("First device found under " + str(first_interface_info.display_name)
   + " is: " + str(first_device_info.serial_number))

device = system.create_device(first_device_info)

# Use the device

device.dispose()