OpenCores
URL https://opencores.org/ocsvn/usb_fpga_1_2/usb_fpga_1_2/trunk

Subversion Repositories usb_fpga_1_2

[/] [usb_fpga_1_2/] [trunk/] [libusbJava-src/] [ch/] [ntb/] [usb/] [Device.java] - Diff between revs 2 and 8

Show entire file | Details | Blame | View Log

Rev 2 Rev 8
Line 34... Line 34...
         */
         */
        private String filename;
        private String filename;
 
 
        private int dev_configuration, dev_interface, dev_altinterface;
        private int dev_configuration, dev_interface, dev_altinterface;
 
 
        private int usbDevHandle;
        private long usbDevHandle;
 
 
        private boolean resetOnFirstOpen, resetDone;
        private boolean resetOnFirstOpen, resetDone;
 
 
        private int resetTimeout = 2000;
        private int resetTimeout = 2000;
 
 
Line 192... Line 192...
                }
                }
 
 
                dev = initDevice(idVendor, idProduct, filename);
                dev = initDevice(idVendor, idProduct, filename);
 
 
                if (dev != null) {
                if (dev != null) {
                        int res = LibusbJava.usb_open(dev);
                        long res = LibusbJava.usb_open(dev);
                        if (res == 0) {
                        if (res == 0) {
                                throw new USBException("LibusbJava.usb_open: "
                                throw new USBException("LibusbJava.usb_open: "
                                                + LibusbJava.usb_strerror());
                                                + LibusbJava.usb_strerror());
                        }
                        }
                        usbDevHandle = res;
                        usbDevHandle = res;
Line 595... Line 595...
         *            the alternate interface to use. If no alternate interface must
         *            the alternate interface to use. If no alternate interface must
         *            be set <i>-1</i> can be used.
         *            be set <i>-1</i> can be used.
         * @throws USBException
         * @throws USBException
         *             throws an USBException if the action fails
         *             throws an USBException if the action fails
         */
         */
        private void claim_interface(int usb_dev_handle, int configuration,
        private void claim_interface(long usb_dev_handle, int configuration,
                        int interface_, int altinterface) throws USBException {
                        int interface_, int altinterface) throws USBException {
                if (LibusbJava.usb_set_configuration(usb_dev_handle, configuration) < 0) {
                if (LibusbJava.usb_set_configuration(usb_dev_handle, configuration) < 0) {
                        usbDevHandle = 0;
                        usbDevHandle = 0;
                        throw new USBException("LibusbJava.usb_set_configuration: "
                        throw new USBException("LibusbJava.usb_set_configuration: "
                                        + LibusbJava.usb_strerror());
                                        + LibusbJava.usb_strerror());
Line 632... Line 632...
         * @param interface_
         * @param interface_
         *            the interface to claim
         *            the interface to claim
         * @throws USBException
         * @throws USBException
         *             throws an USBException if the action fails
         *             throws an USBException if the action fails
         */
         */
        private void release_interface(int dev_handle, int interface_)
        private void release_interface(long dev_handle, int interface_)
                        throws USBException {
                        throws USBException {
                if (LibusbJava.usb_release_interface(dev_handle, interface_) < 0) {
                if (LibusbJava.usb_release_interface(dev_handle, interface_) < 0) {
                        usbDevHandle = 0;
                        usbDevHandle = 0;
                        throw new USBException("LibusbJava.usb_release_interface: "
                        throw new USBException("LibusbJava.usb_release_interface: "
                                        + LibusbJava.usb_strerror());
                                        + LibusbJava.usb_strerror());

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.