def parse(self):
<EOL>while True:<EOL><INDENT>status, self._buffer, packet = Packet.parse_msg(self._buffer)<EOL>if status == PARSE_RESULT.INCOMPLETE:<EOL><INDENT>return status<EOL><DEDENT>if status == PARSE_RESULT.OK and packet:<EOL><INDENT>packet.received = datetime.datetime.now()<EOL>if isinstance(packet, UTETeachInPacket) and self.teach_in:<EOL><INDENT>response_packet = packet.create_response_packet(self.base_id)<EOL>self.logger.info('<STR_LIT>')<EOL>self.send(response_packet)<EOL><DEDENT>if self.__callback is None:<EOL><INDENT>self.receive.put(packet)<EOL><DEDENT>else:<EOL><INDENT>self.__callback(packet)<EOL><DEDENT>self.logger.debug(packet)<EOL><DEDENT><DEDENT>
Parses messages and puts them to receive queue