code: def _ReadPacket(self):
          
          len_char = self.ser.read(1)
          if not len_char:
              logging.error("Reading from serial port timed out.")
              return None
  
          data_len = ord(len_char)
          if not data_len:
              return ""
          result = self.ser.read(int(data_len))
          result = bytearray(result)
          if len(result) != data_len:
              logging.error("Length mismatch, expected %d bytes, got %d bytes.",
                            data_len, len(result))
              return None
          body = result[:-1]
          checksum = (sum(struct.unpack("B" * len(body), body)) + data_len) % 256
          if result[-1] != checksum:
              logging.error(
                  "Invalid checksum from serial port! Expected %s, got %s",
                  hex(checksum), hex(result[-1]))
              return None
          return result[:-1]
docs: Read a single data record as a string (without length or checksum).