esptest.adapter.dut.esp_mixin module

class esptest.adapter.dut.esp_mixin.EspSerial(esp)[source]

Bases: object

Add RawPort methods to esp serial

Parameters:

esp (ESPLoader)

property esp: ESPLoader
property read_timeout: float
read_bytes(timeout=0.001)[source]
Parameters:

timeout (float)

Return type:

bytes

write_bytes(data)[source]
Parameters:

data (AnyStr)

Return type:

None

class esptest.adapter.dut.esp_mixin.EspMixin(*args, **kwargs)[source]

Bases: object

Parameters:
property esp: ESPLoader
hard_reset()[source]
Return type:

None

change_serial_config(**kwargs)[source]

Change the underlying serial config (baudrate/timeout/parity/…).

For an esptool-backed port the settings are applied to the esp serial port; otherwise the request is delegated to the serial port proxy. Only settings supported by pyserial apply_settings take effect.

Parameters:

kwargs (Any)

Return type:

None

download_bin(erase_nvs=True, *, bin_path='', baud=0, force_no_stub=False, log_port_baudrate=0)[source]

Download bin to the dut. Note: this method will update downbin_tool attribute.

Parameters:
  • erase_nvs (bool, optional) – Whether to erase nvs before flashing.

  • bin_path (str, optional) – Path to the bin file, overwrite the bin_path attribute if provided.

  • baud (Union[int, List[int]], optional) – Download baud rate to use. If given a list, will try each baud rate in order.

  • force_no_stub (bool, optional) – Whether to force no stub.

  • log_port_baudrate (int, optional) – If > 0, set the log/monitor serial port baud rate after downloading.

Return type:

None

download_partition(partition_bins)[source]

Download partitions to the dut. :param partition_bins: A dictionary of partition names and bin paths.

Parameters:

partition_bins (Dict[str, str])

Return type:

None

start_redirect_thread()[source]
Return type:

None

stop_redirect_thread()[source]
Return type:

bool