manager.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:pyTeliumManager 作者: Ousret 项目源码 文件源码
def __init__(self,
                 path='/dev/ttyACM0',
                 baudrate=9600,
                 bytesize=EIGHTBITS,
                 parity=PARITY_NONE,
                 stopbits=STOPBITS_ONE,
                 timeout=1,
                 open_on_create=True,
                 debugging=False):
        """
        Create Telium device instance
        :param str path: str Path to serial emulated device
        :param int baudrate: Set baud rate
        :param int timeout: Maximum delai before hanging out.
        :param bool open_on_create: Define if device has to be opened on instance creation
        :param bool debugging: Enable print device <-> host com trace. (stdout)
        """
        self._path = path
        self._baud = baudrate
        self._debugging = debugging
        self._device_timeout = timeout
        self._device = None

        self._device = Serial(
            self._path if open_on_create else None,
            baudrate=self._baud,
            bytesize=bytesize,
            parity=parity,
            stopbits=stopbits,
            timeout=timeout
        )

        if not open_on_create:
            self._device.setPort(self._path)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号