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