indexes()
📖 Method Description
Get the index list of all connected devices. Indexes can be used for quick access and identification of devices.
📝 Syntax
device_indexes = finder.indexes()
🔧 Parameters
No parameters
📤 Return Type
List[int] - Device index list
💡 Example Code
from pyvitaisdk import VTSDeviceFinder
# Create VTSDeviceFinder instance
finder = VTSDeviceFinder()
# Get index list of all devices
device_indexes = finder.indexes()
print(f"Device indexes: {device_indexes}") # e.g.: [0, 1, 2]
# Iterate through all device indexes
for idx in device_indexes:
print(f"Device {idx} is available")
⚠️ Notes
Index Description
- Indexes start from 0 and increment
- Index order is related to device connection order
- Indexes may change after device reconnection
Use Cases
Suitable for scenarios where devices need to be accessed by index, such as parallel processing of multiple devices.
🔗 Related Methods
- get_devices - Get all device configurations
- count - Get device count
- get_sns - Get device serial number list