code: def _readLoop(self):
          
          try:
              readTermSeq = list(self.RX_EOL_SEQ)
              readTermLen = len(readTermSeq)
              rxBuffer = []
              while self.alive:
                  data = self.serial.read(1)
                  if data != '': # check for timeout
                      #print >> sys.stderr, ' RX:', data,'({0})'.format(ord(data))
                      rxBuffer.append(data)
                      if rxBuffer[-readTermLen:] == readTermSeq:                        
                          # A line (or other logical segment) has been read
                          line = ''.join(rxBuffer[:-readTermLen])
                          rxBuffer = []
                          if len(line) > 0:                          
                              #print 'calling handler'                      
                              self._handleLineRead(line)
                      elif self._expectResponseTermSeq:
                          if rxBuffer[-len(self._expectResponseTermSeq):] == self._expectResponseTermSeq:
                              line = ''.join(rxBuffer) 
                              rxBuffer = []
                              self._handleLineRead(line, checkForResponseTerm=False)                                                
              #else:
                  #' <RX timeout>'
          except serial.SerialException as e:
              self.alive = False
              try:
                  self.serial.close()
              except Exception: #pragma: no cover
                  pass
              # Notify the fatal error handler
              self.fatalErrorCallback(e)
docs: Read thread main loop
          
          Reads lines from the connected device