diff options
author | cliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a> | 2014-08-03 21:57:45 +0000 |
---|---|---|
committer | cliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a> | 2014-08-03 21:57:45 +0000 |
commit | ccf48ac4938cb2817050fa71dbeb8d28d218e6f7 (patch) | |
tree | be8a5721926b1943e69965b4d6812529642d29b5 /serial/serialwin32.py | |
parent | 1355dcb2daf8f6e9b2a41688d06f1b72044dc400 (diff) | |
download | pyserial-ccf48ac4938cb2817050fa71dbeb8d28d218e6f7.tar.gz |
doc update
git-svn-id: http://svn.code.sf.net/p/pyserial/code/trunk/pyserial@504 f19166aa-fa4f-0410-85c2-fa1106f25c8a
Diffstat (limited to 'serial/serialwin32.py')
-rw-r--r-- | serial/serialwin32.py | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/serial/serialwin32.py b/serial/serialwin32.py index dfdd953..a640fa4 100644 --- a/serial/serialwin32.py +++ b/serial/serialwin32.py @@ -38,8 +38,10 @@ class Win32Serial(SerialBase): SerialBase.__init__(self, *args, **kwargs) def open(self): - """Open port with current settings. This may throw a SerialException - if the port cannot be opened.""" + """\ + Open port with current settings. This may throw a SerialException + if the port cannot be opened. + """ if self._port is None: raise SerialException("Port must be configured before it can be used.") if self._isOpen: @@ -240,9 +242,10 @@ class Win32Serial(SerialBase): return comstat.cbInQue def read(self, size=1): - """Read size bytes from the serial port. If a timeout is set it may - return less characters as requested. With no timeout it will block - until the requested number of bytes is read.""" + """\ + Read size bytes from the serial port. If a timeout is set it may + return less characters as requested. With no timeout it will block + until the requested number of bytes is read.""" if not self.hComPort: raise portNotOpenError if size > 0: win32.ResetEvent(self._overlappedRead.hEvent) @@ -298,8 +301,10 @@ class Win32Serial(SerialBase): return 0 def flush(self): - """Flush of file like objects. In this case, wait until all data - is written.""" + """\ + Flush of file like objects. In this case, wait until all data + is written. + """ while self.outWaiting(): time.sleep(0.05) # XXX could also use WaitCommEvent with mask EV_TXEMPTY, but it would @@ -312,13 +317,17 @@ class Win32Serial(SerialBase): win32.PurgeComm(self.hComPort, win32.PURGE_RXCLEAR | win32.PURGE_RXABORT) def flushOutput(self): - """Clear output buffer, aborting the current output and - discarding all that is in the buffer.""" + """\ + Clear output buffer, aborting the current output and discarding all + that is in the buffer. + """ if not self.hComPort: raise portNotOpenError win32.PurgeComm(self.hComPort, win32.PURGE_TXCLEAR | win32.PURGE_TXABORT) def sendBreak(self, duration=0.25): - """Send break condition. Timed, returns to idle state after given duration.""" + """\ + Send break condition. Timed, returns to idle state after given duration. + """ if not self.hComPort: raise portNotOpenError import time win32.SetCommBreak(self.hComPort) @@ -409,7 +418,7 @@ class Win32Serial(SerialBase): win32.EscapeCommFunction(self.hComPort, win32.SETXOFF) def outWaiting(self): - """return how many characters the in the outgoing buffer""" + """Return how many characters the in the outgoing buffer""" flags = win32.DWORD() comstat = win32.COMSTAT() if not win32.ClearCommError(self.hComPort, ctypes.byref(flags), ctypes.byref(comstat)): |