当前位置: 首页>>代码示例>>Python>>正文


Python win32.CloseHandle方法代码示例

本文整理汇总了Python中serial.win32.CloseHandle方法的典型用法代码示例。如果您正苦于以下问题:Python win32.CloseHandle方法的具体用法?Python win32.CloseHandle怎么用?Python win32.CloseHandle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在serial.win32的用法示例。


在下文中一共展示了win32.CloseHandle方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _close

# 需要导入模块: from serial import win32 [as 别名]
# 或者: from serial.win32 import CloseHandle [as 别名]
def _close(self):
        """internal close port helper"""
        if self._port_handle:
            # Restore original timeout values:
            win32.SetCommTimeouts(self._port_handle, self._orgTimeouts)
            # Close COM-Port:
            win32.CloseHandle(self._port_handle)
            if self._overlapped_read is not None:
                win32.CloseHandle(self._overlapped_read.hEvent)
                self._overlapped_read = None
            if self._overlapped_write is not None:
                win32.CloseHandle(self._overlapped_write.hEvent)
                self._overlapped_write = None
            self._port_handle = None 
开发者ID:sketchpunk,项目名称:android3dblendermouse,代码行数:16,代码来源:serialwin32.py

示例2: _close

# 需要导入模块: from serial import win32 [as 别名]
# 或者: from serial.win32 import CloseHandle [as 别名]
def _close(self):
        """internal close port helper"""
        if self.hComPort:
            # Restore original timeout values:
            win32.SetCommTimeouts(self.hComPort, self._orgTimeouts)
            # Close COM-Port:
            win32.CloseHandle(self.hComPort)
            if self._overlappedRead is not None:
                win32.CloseHandle(self._overlappedRead.hEvent)
                self._overlappedRead = None
            if self._overlappedWrite is not None:
                win32.CloseHandle(self._overlappedWrite.hEvent)
                self._overlappedWrite = None
            self.hComPort = None 
开发者ID:whaleygeek,项目名称:microbit-gateway,代码行数:16,代码来源:serialwin32.py

示例3: _close

# 需要导入模块: from serial import win32 [as 别名]
# 或者: from serial.win32 import CloseHandle [as 别名]
def _close(self):
        """internal close port helper"""
        if self._port_handle is not None:
            # Restore original timeout values:
            win32.SetCommTimeouts(self._port_handle, self._orgTimeouts)
            if self._overlapped_read is not None:
                self.cancel_read()
                win32.CloseHandle(self._overlapped_read.hEvent)
                self._overlapped_read = None
            if self._overlapped_write is not None:
                self.cancel_write()
                win32.CloseHandle(self._overlapped_write.hEvent)
                self._overlapped_write = None
            win32.CloseHandle(self._port_handle)
            self._port_handle = None 
开发者ID:arpruss,项目名称:gcodeplot,代码行数:17,代码来源:serialwin32.py

示例4: close

# 需要导入模块: from serial import win32 [as 别名]
# 或者: from serial.win32 import CloseHandle [as 别名]
def close(self):
        """Close port"""
        if self._isOpen:
            if self.hComPort:
                # Restore original timeout values:
                win32.SetCommTimeouts(self.hComPort, self._orgTimeouts)
                # Close COM-Port:
                win32.CloseHandle(self.hComPort)
                win32.CloseHandle(self._overlappedRead.hEvent)
                win32.CloseHandle(self._overlappedWrite.hEvent)
                self.hComPort = None
            self._isOpen = False 
开发者ID:respeaker,项目名称:get_started_with_respeaker,代码行数:14,代码来源:serialwin32.py


注:本文中的serial.win32.CloseHandle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。