diff options
-rw-r--r-- | serial/urlhandler/protocol_loop.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/serial/urlhandler/protocol_loop.py b/serial/urlhandler/protocol_loop.py index 526583f..8ac8ddf 100644 --- a/serial/urlhandler/protocol_loop.py +++ b/serial/urlhandler/protocol_loop.py @@ -227,6 +227,17 @@ class Serial(SerialBase): except queue.Empty: pass + @property + def out_waiting(self): + """Return how many bytes the in the outgoing buffer""" + if not self.is_open: + raise PortNotOpenError() + if self.logger: + # attention the logged value can differ from return value in + # threaded environments... + self.logger.debug('out_waiting -> {:d}'.format(self.queue.qsize())) + return self.queue.qsize() + def _update_break_state(self): """\ Set break: Controls TXD. When active, to transmitting is |