def read(self):
data = bytearray()<EOL>while True:<EOL><INDENT>incoming_bytes = self.comport.inWaiting()<EOL>if incoming_bytes == <NUM_LIT:0>:<EOL><INDENT>break<EOL><DEDENT>else:<EOL><INDENT>content = self.comport.read(size=incoming_bytes)<EOL>data.extend(bytearray(content))<EOL><DEDENT><DEDENT>return data<EOL>
Read data from serial port and returns a ``bytearray``.