From 9d893054aae0229aea504337c34ff9c7138953d9 Mon Sep 17 00:00:00 2001 From: Chris Liechti Date: Wed, 18 May 2016 22:03:29 +0200 Subject: doc: update/extend cancel_read/write, mention new Posix support --- documentation/pyserial_api.rst | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/documentation/pyserial_api.rst b/documentation/pyserial_api.rst index e0101d1..b038f91 100644 --- a/documentation/pyserial_api.rst +++ b/documentation/pyserial_api.rst @@ -523,17 +523,29 @@ Native ports .. method:: cancel_read() + :platform: Posix :platform: Windows - Cancel a pending read operation from an other thread. + Cancel a pending read operation from an other thread. A blocking + :meth:`read` call is aborted immediately. :meth:`read` will not report + any error but return all data received up to that point (similar to a + timeout). + + On Posix a call to `cancel_read()` may cancel a future :meth:`read` call. .. versionadded:: 3.1 .. method:: cancel_write() + :platform: Posix :platform: Windows - Cancel a pending write operation from an other thread. + Cancel a pending write operation from an other thread. The + :meth:`write` method will return immediately (no error indicated). + However the OS may still be sending from the buffer, a separate call to + :meth:`reset_output_buffer` may be needed. + + On Posix a call to `cancel_write()` may cancel a future :meth:`write` call. .. versionadded:: 3.1 -- cgit v1.2.1