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/] [java/] [ztex/] [InvalidFirmwareException.java] - Blame information for rev 4

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 ZTEX
/*!
2
   Java Driver API for the ZTEX Firmware Kit
3 4 ZTEX
   Copyright (C) 2009-2010 ZTEX e.K.
4 2 ZTEX
   http://www.ztex.de
5
 
6
   This program is free software; you can redistribute it and/or modify
7
   it under the terms of the GNU General Public License version 3 as
8
   published by the Free Software Foundation.
9
 
10
   This program is distributed in the hope that it will be useful, but
11
   WITHOUT ANY WARRANTY; without even the implied warranty of
12
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
   General Public License for more details.
14
 
15
   You should have received a copy of the GNU General Public License
16
   along with this program; if not, see http://www.gnu.org/licenses/.
17
!*/
18
 
19
package ztex;
20
 
21 3 ZTEX
import ch.ntb.usb.*;
22
 
23
/**
24
  * Thrown if a device runs with no or the wrong firmware, i.e. if the ZTEX descriptor is not found or damaged. */
25 2 ZTEX
public class InvalidFirmwareException extends Exception {
26 3 ZTEX
/**
27
 * Constructs an instance from the given device and error message.
28
 * @param ztex The device.
29
 * @param msg The error message.
30
 */
31 2 ZTEX
    public InvalidFirmwareException ( Ztex1 ztex, String msg) {
32 3 ZTEX
        this( ztex.dev().dev(), msg );
33 2 ZTEX
    }
34
 
35 3 ZTEX
/**
36
 * Constructs an instance from the given device and error message.
37
 * @param dev The device.
38
 * @param msg The error message.
39
 */
40
    public InvalidFirmwareException ( ZtexDevice1 dev, String msg) {
41
        this( dev.dev(), msg );
42
    }
43
 
44
/**
45
 * Constructs an instance from the given device and error message.
46
 * @param dev The device.
47
 * @param msg The error message.
48
 */
49
    public InvalidFirmwareException (Usb_Device dev, String msg) {
50
        super( "bus=" + dev.getBus().getDirname() + "  device=" + dev.getFilename() + ": Invalid Firmware: "+ msg );
51
    }
52
 
53
/**
54
 * Constructs an instance from the given device and error message.
55
 * @param ztex The device.
56
 */
57 2 ZTEX
    public InvalidFirmwareException ( Ztex1 ztex ) {
58 3 ZTEX
        this( ztex.dev().dev() );
59 2 ZTEX
    }
60 3 ZTEX
 
61
/**
62
 * Constructs an instance from the given device and error message.
63
 * @param dev The device.
64
 */
65
    public InvalidFirmwareException ( ZtexDevice1 dev ) {
66
        this( dev.dev() );
67
    }
68
 
69
/**
70
 * Constructs an instance from the given device and error message.
71
 * @param dev The device.
72
 */
73
    public InvalidFirmwareException (Usb_Device dev ) {
74
        super( "bus=" + dev.getBus().getDirname() + "  device=" + dev.getFilename() + ": Invalid Firmware" );
75
    }
76 2 ZTEX
}

powered by: WebSVN 2.1.0

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