@staticmethod
    def getConnectedInterfaces(vid, pid):
        """
        returns all the connected devices which matches HidApiUSB.vid/HidApiUSB.pid.
        returns an array of HidApiUSB (Interface) objects
        """

        devices = hid.enumerate(vid, pid)

        if not devices:
            logging.debug("No Mbed device connected")
            return

        boards = []

        for deviceInfo in devices:
            try:
                dev = hid.device(vendor_id=vid, product_id=pid, path = deviceInfo['path'])
            except __HOLE__:
                logging.debug("Failed to open Mbed device")
                return

            # Create the USB interface object for this device.
            new_board = HidApiUSB()
            new_board.vendor_name = deviceInfo['manufacturer_string']
            new_board.product_name = deviceInfo['product_string']
            new_board.serial_number = deviceInfo['serial_number']
            new_board.vid = deviceInfo['vendor_id']
            new_board.pid = deviceInfo['product_id']
            new_board.path = deviceInfo['path']
            new_board.device = dev

            boards.append(new_board)

        return boards
dataset/ETHPy150Open geky/pyDAPLink/pyDAPLink/interface/hidapi_backend.py/HidApiUSB.getConnectedInterfaces