Utils

obdii.utils.scan.scan_transports(candidates: List[Dict[str, Any]], transport_cls: Type[TransportBase], probe: bytes = ..., return_first: bool = False, **kwargs) List[TransportBase][source]

Attempt to detect working transports from a list of candidates.

Parameters:
  • candidates (List[Dict[str, Any]]) – List of transport configuration dictionaries. For example, for serial: [{“port”: “COM3”}], for WiFi: [{“address”: “192.168.0.10”, “port”: 35000}]

  • transport_cls (Type[TransportBase]) – Transport class to instantiate for probing (e.g., TransportSerial, TransportSocket).

  • probe (bytes) – Byte sequence to send to test the transport. Defaults to at_commands.VERSION_ID.build().

  • return_first (bool) – If True, stop scanning and return after the first valid transport is found.

  • **kwargs (dict) – Additional keyword arguments forwarded to the transport’s connect method.

obdii.utils.scan.scan_ports(return_first: bool = True, **kwargs)[source]

Scan available serial ports for ELM327 compatible devices.

obdii.utils.scan.scan_network(return_first: bool = True, **kwargs)[source]

Scan common WiFi endpoints for ELM327 compatible devices.