MCPcopy Create free account
hub / github.com/LabPy/lantz / __init__

Method __init__

lantz/drivers/legacy/serial.py:72–89  ·  view source on GitHub ↗
(self, port=1, timeout=1, write_timeout=1, **kwargs)

Source from the content-addressed store, hash-verified

70 XONXOFF = False
71
72 def __init__(self, port=1, timeout=1, write_timeout=1, **kwargs):
73 super().__init__(**kwargs)
74 self.TIMEOUT = timeout
75
76 kw = {}
77 for key in ('baudrate', 'bytesize', 'parity', 'stopbits',
78 'rtscts', 'dsrdtr', 'xonxoff'):
79 kw[key] = kwargs.get(key, getattr(self, key.upper()))
80
81 kw['bytesize'] = BYTESIZE[kw['bytesize']]
82 kw['parity'] = PARITY[kw['parity']]
83 kw['stopbits'] = STOPBITS[kw['stopbits']]
84
85 self.serial = serial.Serial(None, timeout=timeout, writeTimeout=write_timeout, **kw)
86
87 self.serial.port = port
88
89 self.log_debug('Created pyserial port {}', self.serial.port)
90
91 def raw_send(self, data):
92 """Send raw bytes to the instrument.

Callers

nothing calls this directly

Calls 2

getMethod · 0.80
log_debugMethod · 0.80

Tested by

no test coverage detected