本文整理匯總了Python中serial.win32.ERROR_IO_INCOMPLETE屬性的典型用法代碼示例。如果您正苦於以下問題:Python win32.ERROR_IO_INCOMPLETE屬性的具體用法?Python win32.ERROR_IO_INCOMPLETE怎麽用?Python win32.ERROR_IO_INCOMPLETE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類serial.win32
的用法示例。
在下文中一共展示了win32.ERROR_IO_INCOMPLETE屬性的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _cancel_overlapped_io
# 需要導入模塊: from serial import win32 [as 別名]
# 或者: from serial.win32 import ERROR_IO_INCOMPLETE [as 別名]
def _cancel_overlapped_io(self, overlapped):
"""Cancel a blocking read operation, may be called from other thread"""
# check if read operation is pending
rc = win32.DWORD()
err = win32.GetOverlappedResult(
self._port_handle,
ctypes.byref(overlapped),
ctypes.byref(rc),
False)
if not err and win32.GetLastError() in (win32.ERROR_IO_PENDING, win32.ERROR_IO_INCOMPLETE):
# cancel, ignoring any errors (e.g. it may just have finished on its own)
win32.CancelIoEx(self._port_handle, overlapped)