def _get_response(self, ip=None):
    try:
        while True:
            (raw_response, addr) = self.server_socket.recvfrom(1024)
            if ((ip is not None) and (addr[0] != ip)):
                continue
            self.log.debug('Received response: %s, address: %s', raw_response, addr)
            data = raw_response.decode()
            if self._is_from_irobot(data):
                return _decode_data(data)
    except socket.timeout:
        self.log.info('Socket timeout')
        return None
def _get_response(self, ip=None):
    try:
        while True:
            (raw_response, addr) = self.server_socket.recvfrom(1024)
            if ((ip is not None) and (addr[0] != ip)):
                continue
            self.log.debug('Received response: %s, address: %s', raw_response, addr)
            data = raw_response.decode()
            if self._is_from_irobot(data):
                return _decode_data(data)
    except socket.timeout:
        self.log.info('Socket timeout')
        return None