Lines Matching +full:m +full:- +full:bus
3 # SPDX-License-Identifier: Apache-2.0
13 from can import Bus, BusABC
19 def pytest_addoption(parser) -> None:
21 parser.addoption('--can-context', default=None,
22 help='Configuration context to use for python-can (default: None)')
25 def fixture_context(request, dut: DeviceAdapter) -> str:
26 """Return the name of the python-can configuration context to use."""
27 ctx = request.config.getoption('--can-context')
35 logger.info('using python-can configuration context "%s"', ctx)
39 def fixture_chosen(shell: Shell) -> str:
45 m = chosen_regex.match(line)
46 if m:
47 chosen = m.groups()[0]
55 def can_dut(dut: DeviceAdapter, shell: Shell, chosen: str) -> BusABC:
56 """Return DUT CAN bus."""
57 bus = CanShellBus(dut, shell, chosen)
58 yield bus
59 bus.shutdown()
63 def can_host(context: str) -> BusABC:
64 """Return host CAN bus."""
65 bus = Bus(config_context = context)
66 yield bus
67 bus.shutdown()