Connect to the device.

        Args:
            logfile (file): Optional file descriptor for session logging. The file must be open for write.
                The session is logged only if ``log_session=True`` was passed to the constructor.
                If *None* then the default *session.log* file is created in `log_dir`.

            force_discovery (Bool): Optional. If True the device discover process will start after getting connected.

        Raises:
            ConnectionError: If the discovery method was not called first or there was a problem with getting
                the connection.

            ConnectionAuthenticationError: If the authentication failed.

            ConnectionTimeoutError: If the connection timeout happened.

def connect(self, logfile=None, force_discovery=False, tracefile=None):
        """Connect to the device.

        Args:
            logfile (file): Optional file descriptor for session logging. The file must be open for write.
                The session is logged only if ``log_session=True`` was passed to the constructor.
                If *None* then the default *session.log* file is created in `log_dir`.

            force_discovery (Bool): Optional. If True the device discover process will start after getting connected.

        Raises:
            ConnectionError: If the discovery method was not called first or there was a problem with getting
                the connection.

            ConnectionAuthenticationError: If the authentication failed.

            ConnectionTimeoutError: If the connection timeout happened.

        """
        self.reconnect(logfile=logfile, max_timeout=120, force_discovery=force_discovery, tracefile=tracefile,
                       retry=False)

        return