esptest.devices.attenuator module

exception esptest.devices.attenuator.AttenuatorError[source]

Bases: OSError

class esptest.devices.attenuator.AttType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: StrEnum

WUYOU = 'wuyou'
RIDGESTONE = 'ridgestone'
FUTURE_TECHNOLOGY = 'future_technology'
MINI_CIRCUITS = 'mini_circuits'
class esptest.devices.attenuator.AttDevice(device, att_type)[source]

Bases: object

Parameters:
SUPPORTED_TYPES: List[AttType] = []
READ_DELAY: float = 0.5
property min: float
property max: float
set_att(att, att_fix=False)[source]
Parameters:
Return type:

bool

classmethod get_type_by_id(vid, pid)[source]
Parameters:
Return type:

AttType

class esptest.devices.attenuator.SerialAttDev(device, att_type)[source]

Bases: AttDevice

Parameters:
SUPPORTED_TYPES: List[AttType] = [AttType.WUYOU, AttType.RIDGESTONE, AttType.FUTURE_TECHNOLOGY]
classmethod get_ser_port_info(device=None)[source]
Parameters:

device (str | None)

Return type:

ListPortInfo

open_ser()[source]
Return type:

Generator[Serial, None, None]

set_att(att, att_fix=False)[source]
Parameters:
Return type:

bool

classmethod create(device=None, att_type=None)[source]
Parameters:
Return type:

Self

class esptest.devices.attenuator.USBAttDev(device, att_type)[source]

Bases: AttDevice

Parameters:
SUPPORTED_TYPES: List[AttType] = [AttType.MINI_CIRCUITS]
DEV_LOCATION_PATTERN = re.compile('(\\d)-([\\d\\.]*\\d)')
classmethod parse_location(location)[source]
Parameters:

location (str)

Return type:

Tuple[int, Tuple[int, …]]

classmethod find_usb_dev(location, att_type)[source]
Parameters:
Return type:

usb.core.Device

config_usb()[source]
Return type:

Generator[usb.core.Device, None, None]

set_att(att, att_fix=False)[source]
Parameters:
Return type:

bool

classmethod create(device=None, att_type=None)[source]
Parameters:
Return type:

Self

esptest.devices.attenuator.find_att_port(port=None)[source]
Parameters:

port (str | None)

Return type:

ListPortInfo

esptest.devices.attenuator.find_att_dev(device=None, att_type=None)[source]
Parameters:
Return type:

AttDevice

esptest.devices.attenuator.set_att(port, att, att_fix=False)[source]
Parameters:
Return type:

bool