本文整理汇总了Python中serial.win32.ClearCommBreak方法的典型用法代码示例。如果您正苦于以下问题:Python win32.ClearCommBreak方法的具体用法?Python win32.ClearCommBreak怎么用?Python win32.ClearCommBreak使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类serial.win32
的用法示例。
在下文中一共展示了win32.ClearCommBreak方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _update_break_state
# 需要导入模块: from serial import win32 [as 别名]
# 或者: from serial.win32 import ClearCommBreak [as 别名]
def _update_break_state(self):
"""Set break: Controls TXD. When active, to transmitting is possible."""
if not self._port_handle:
raise portNotOpenError
if self._break_state:
win32.SetCommBreak(self._port_handle)
else:
win32.ClearCommBreak(self._port_handle)
示例2: sendBreak
# 需要导入模块: from serial import win32 [as 别名]
# 或者: from serial.win32 import ClearCommBreak [as 别名]
def sendBreak(self, duration=0.25):
"""Send break condition. Timed, returns to idle state after given duration."""
if not self.hComPort: raise portNotOpenError
import time
win32.SetCommBreak(self.hComPort)
time.sleep(duration)
win32.ClearCommBreak(self.hComPort)
示例3: setBreak
# 需要导入模块: from serial import win32 [as 别名]
# 或者: from serial.win32 import ClearCommBreak [as 别名]
def setBreak(self, level=1):
"""Set break: Controls TXD. When active, to transmitting is possible."""
if not self.hComPort: raise portNotOpenError
if level:
win32.SetCommBreak(self.hComPort)
else:
win32.ClearCommBreak(self.hComPort)
示例4: _update_break_state
# 需要导入模块: from serial import win32 [as 别名]
# 或者: from serial.win32 import ClearCommBreak [as 别名]
def _update_break_state(self):
"""Set break: Controls TXD. When active, to transmitting is possible."""
if not self.is_open:
raise portNotOpenError
if self._break_state:
win32.SetCommBreak(self._port_handle)
else:
win32.ClearCommBreak(self._port_handle)
示例5: sendBreak
# 需要导入模块: from serial import win32 [as 别名]
# 或者: from serial.win32 import ClearCommBreak [as 别名]
def sendBreak(self, duration=0.25):
"""\
Send break condition. Timed, returns to idle state after given duration.
"""
if not self.hComPort: raise portNotOpenError
import time
win32.SetCommBreak(self.hComPort)
time.sleep(duration)
win32.ClearCommBreak(self.hComPort)