本文整理汇总了Python中serial.win32.EscapeCommFunction方法的典型用法代码示例。如果您正苦于以下问题:Python win32.EscapeCommFunction方法的具体用法?Python win32.EscapeCommFunction怎么用?Python win32.EscapeCommFunction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类serial.win32
的用法示例。
在下文中一共展示了win32.EscapeCommFunction方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _update_rts_state
# 需要导入模块: from serial import win32 [as 别名]
# 或者: from serial.win32 import EscapeCommFunction [as 别名]
def _update_rts_state(self):
"""Set terminal status line: Request To Send"""
if self._rts_state:
win32.EscapeCommFunction(self._port_handle, win32.SETRTS)
else:
win32.EscapeCommFunction(self._port_handle, win32.CLRRTS)
示例2: _update_dtr_state
# 需要导入模块: from serial import win32 [as 别名]
# 或者: from serial.win32 import EscapeCommFunction [as 别名]
def _update_dtr_state(self):
"""Set terminal status line: Data Terminal Ready"""
if self._dtr_state:
win32.EscapeCommFunction(self._port_handle, win32.SETDTR)
else:
win32.EscapeCommFunction(self._port_handle, win32.CLRDTR)
示例3: set_output_flow_control
# 需要导入模块: from serial import win32 [as 别名]
# 或者: from serial.win32 import EscapeCommFunction [as 别名]
def set_output_flow_control(self, enable=True):
"""\
Manually control flow - when software flow control is enabled.
This will do the same as if XON (true) or XOFF (false) are received
from the other device and control the transmission accordingly.
WARNING: this function is not portable to different platforms!
"""
if not self._port_handle:
raise portNotOpenError
if enable:
win32.EscapeCommFunction(self._port_handle, win32.SETXON)
else:
win32.EscapeCommFunction(self._port_handle, win32.SETXOFF)
示例4: setRTS
# 需要导入模块: from serial import win32 [as 别名]
# 或者: from serial.win32 import EscapeCommFunction [as 别名]
def setRTS(self, level=1):
"""Set terminal status line: Request To Send"""
# remember level for reconfigure
if level:
self._rtsState = win32.RTS_CONTROL_ENABLE
else:
self._rtsState = win32.RTS_CONTROL_DISABLE
# also apply now if port is open
if self.hComPort:
if level:
win32.EscapeCommFunction(self.hComPort, win32.SETRTS)
else:
win32.EscapeCommFunction(self.hComPort, win32.CLRRTS)
示例5: setDTR
# 需要导入模块: from serial import win32 [as 别名]
# 或者: from serial.win32 import EscapeCommFunction [as 别名]
def setDTR(self, level=1):
"""Set terminal status line: Data Terminal Ready"""
# remember level for reconfigure
if level:
self._dtrState = win32.DTR_CONTROL_ENABLE
else:
self._dtrState = win32.DTR_CONTROL_DISABLE
# also apply now if port is open
if self.hComPort:
if level:
win32.EscapeCommFunction(self.hComPort, win32.SETDTR)
else:
win32.EscapeCommFunction(self.hComPort, win32.CLRDTR)
示例6: setXON
# 需要导入模块: from serial import win32 [as 别名]
# 或者: from serial.win32 import EscapeCommFunction [as 别名]
def setXON(self, level=True):
"""\
Manually control flow - when software flow control is enabled.
This will send XON (true) and XOFF (false) to the other device.
WARNING: this function is not portable to different platforms!
"""
if not self.hComPort: raise portNotOpenError
if level:
win32.EscapeCommFunction(self.hComPort, win32.SETXON)
else:
win32.EscapeCommFunction(self.hComPort, win32.SETXOFF)
示例7: set_output_flow_control
# 需要导入模块: from serial import win32 [as 别名]
# 或者: from serial.win32 import EscapeCommFunction [as 别名]
def set_output_flow_control(self, enable=True):
"""\
Manually control flow - when software flow control is enabled.
This will do the same as if XON (true) or XOFF (false) are received
from the other device and control the transmission accordingly.
WARNING: this function is not portable to different platforms!
"""
if not self.is_open:
raise portNotOpenError
if enable:
win32.EscapeCommFunction(self._port_handle, win32.SETXON)
else:
win32.EscapeCommFunction(self._port_handle, win32.SETXOFF)
示例8: setRTS
# 需要导入模块: from serial import win32 [as 别名]
# 或者: from serial.win32 import EscapeCommFunction [as 别名]
def setRTS(self, level=1):
"""Set terminal status line: Request To Send"""
if not self.hComPort: raise portNotOpenError
if level:
self._rtsState = win32.RTS_CONTROL_ENABLE
win32.EscapeCommFunction(self.hComPort, win32.SETRTS)
else:
self._rtsState = win32.RTS_CONTROL_DISABLE
win32.EscapeCommFunction(self.hComPort, win32.CLRRTS)
示例9: setDTR
# 需要导入模块: from serial import win32 [as 别名]
# 或者: from serial.win32 import EscapeCommFunction [as 别名]
def setDTR(self, level=1):
"""Set terminal status line: Data Terminal Ready"""
if not self.hComPort: raise portNotOpenError
if level:
self._dtrState = win32.DTR_CONTROL_ENABLE
win32.EscapeCommFunction(self.hComPort, win32.SETDTR)
else:
self._dtrState = win32.DTR_CONTROL_DISABLE
win32.EscapeCommFunction(self.hComPort, win32.CLRDTR)
示例10: setXON
# 需要导入模块: from serial import win32 [as 别名]
# 或者: from serial.win32 import EscapeCommFunction [as 别名]
def setXON(self, level=True):
"""Platform specific - set flow state."""
if not self.hComPort: raise portNotOpenError
if level:
win32.EscapeCommFunction(self.hComPort, win32.SETXON)
else:
win32.EscapeCommFunction(self.hComPort, win32.SETXOFF)