本文整理匯總了Python中serial.win32.SetCommBreak方法的典型用法代碼示例。如果您正苦於以下問題:Python win32.SetCommBreak方法的具體用法?Python win32.SetCommBreak怎麽用?Python win32.SetCommBreak使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類serial.win32
的用法示例。
在下文中一共展示了win32.SetCommBreak方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _update_break_state
# 需要導入模塊: from serial import win32 [as 別名]
# 或者: from serial.win32 import SetCommBreak [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 SetCommBreak [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 SetCommBreak [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 SetCommBreak [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 SetCommBreak [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)