Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to use Labgrid with XFCP #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions python/xfcp/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,20 @@ def get_root(self):


class SerialInterface(Interface):
def __init__(self, port='/dev/ttyUSB0', baud=115200, timeout=10):
def __init__(self, port='/dev/ttyUSB0', baud=115200, timeout=10, driver=None):
"""
driver is expected to be a SerialDriver class from the labgrid module
"""
super().__init__()

self.port = port
self.baud = baud
self.serial_port = serial.Serial(port, baud, timeout=timeout)

# if labgrid driver is given, use labgrid driver
if driver is None:
self.serial_port = serial.Serial(port, baud, timeout=timeout)
else:
self.serial_port = driver.serial

@property
def timeout(self):
Expand Down