_javaserialport.py 文件源码

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

项目:hostapd-mana 作者: adde88 项目源码 文件源码
def __init__(self, protocol, deviceNameOrPortNumber, reactor, 
        baudrate = 9600, bytesize = EIGHTBITS, parity = PARITY_NONE,
        stopbits = STOPBITS_ONE, timeout = 3, xonxoff = 0, rtscts = 0):
        # do NOT use timeout = 0 !!
        self._serial = serial.Serial(deviceNameOrPortNumber, baudrate = baudrate, bytesize = bytesize, parity = parity, stopbits = stopbits, timeout = timeout, xonxoff = xonxoff, rtscts = rtscts)
        javareactor.JConnection.__init__(self, self._serial.sPort, protocol, None)
        self.flushInput()
        self.flushOutput()

        self.reactor = reactor
        self.protocol = protocol
        self.protocol.makeConnection(self)
        wb = javareactor.WriteBlocker(self, reactor.q)
        wb.start()
        self.writeBlocker = wb
        javareactor.ReadBlocker(self, reactor.q).start()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号