iblrig.serial_singleton.filter_ports
- iblrig.serial_singleton.filter_ports(**kwargs)[source]
Filter serial ports based on specified criteria.
- Parameters:
**kwargs (
keyword arguments
) – Filtering criteria for serial ports. Each keyword should correspond to an attribute of the serial port object (ListPortInfo). The values associated with the keywords are used to filter the ports based on various conditions.- Yields:
str
– The device name of a filtered serial port that meets all specified criteria.- Parameters:
- Return type:
Examples
To filter ports by manufacturer and product:
>>> for port in filter_ports(manufacturer="Arduino", product="Uno"): ... print(port)
- Raises:
ValueError – If a specified attribute does not exist for a port.
- Parameters:
- Return type:
Notes
The function uses regular expressions for string matching when both actual and expected values are strings.