code: def read(self):
          
          data = bytearray()
          while True:
              incoming_bytes = self.comport.inWaiting()
              if incoming_bytes == 0:
                  break
              else:
                  content = self.comport.read(size=incoming_bytes)
                  data.extend(bytearray(content))
          return data
docs: Read data from serial port and returns a ``bytearray``.