Output the given string over the serial port.
(self, data)
| 166 | return bytes(read) |
| 167 | |
| 168 | def write(self, data): |
| 169 | """Output the given string over the serial port.""" |
| 170 | if not self.sPort: raise portNotOpenError |
| 171 | if not isinstance(data, (bytes, bytearray)): |
| 172 | raise TypeError('expected %s or bytearray, got %s' % (bytes, type(data))) |
| 173 | self._outstream.write(data) |
| 174 | return len(data) |
| 175 | |
| 176 | def flushInput(self): |
| 177 | """Clear input buffer, discarding all that is in the buffer.""" |