def interface_required(interface):
        """Decorator to specify that a particular interface type is required
        for the given method to be used.

        Args:
          interface (int): attribute of ``JLinkInterfaces``

        Returns:
          A decorator function.
        """
        def _interface_required(func):
            """Internal decorator that wraps around the decorated function.

            Args:
              func (function): function being decorated

            Returns:
              The wrapper function.
            """
            @functools.wraps(func)
            def wrapper(self, *args, **kwargs):
                """Wrapper function to check that the given ``JLink`` has the
                same interface as the one specified by the decorator.

                Args:
                  self (JLink): the ``JLink`` instance
                  args: list of arguments to pass to ``func``
                  kwargs: key-word arguments dict to pass to ``func``

                Returns:
                  The return value of the wrapped function.

                Raises:
                  JLinkException: if the current interface is not supported by
                      the wrapped method.
                """
                if self.tif != interface:
                    raise errors.JLinkException('Unsupported for current interface.')
                return func(self, *args, **kwargs)
            return wrapper
        return _interface_required
Decorator to specify that a particular interface type is required
        for the given method to be used.

        Args:
          interface (int): attribute of ``JLinkInterfaces``

        Returns:
          A decorator function.