1 /* sane - Scanner Access Now Easy. 2 3 pieusb.h 4 5 Copyright (C) 2012-2015 Jan Vleeshouwers, Michael Rickmann, Klaus Kaempf 6 7 This file is part of the SANE package. 8 9 This program is free software; you can redistribute it and/or 10 modify it under the terms of the GNU General Public License as 11 published by the Free Software Foundation; either version 2 of the 12 License, or (at your option) any later version. 13 14 This program is distributed in the hope that it will be useful, but 15 WITHOUT ANY WARRANTY; without even the implied warranty of 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 General Public License for more details. 18 19 You should have received a copy of the GNU General Public License 20 along with this program. If not, see <https://www.gnu.org/licenses/>. 21 22 As a special exception, the authors of SANE give permission for 23 additional uses of the libraries contained in this release of SANE. 24 25 The exception is that, if you link a SANE library with other files 26 to produce an executable, this does not by itself cause the 27 resulting executable to be covered by the GNU General Public 28 License. Your use of that executable is in no way restricted on 29 account of linking the SANE library code into it. 30 31 This exception does not, however, invalidate any other reasons why 32 the executable file might be covered by the GNU General Public 33 License. 34 35 If you submit changes to SANE to the maintainers to be included in 36 a subsequent release, you agree by submitting the changes that 37 those changes may be distributed with this exception intact. 38 39 If you write modifications of your own for SANE, it is your choice 40 whether to permit this exception to apply to your modifications. 41 If you do not wish that, delete this exception notice. */ 42 43 #ifndef PIEUSB_H 44 #define PIEUSB_H 45 46 #include "../include/sane/config.h" 47 #include <stdio.h> 48 #include <stdlib.h> 49 #include <string.h> 50 #ifdef HAVE_UNISTD_H 51 #include <unistd.h> 52 #endif 53 54 #define BACKEND_NAME pieusb 55 56 #include "../include/sane/sane.h" 57 #include "../include/sane/sanei_usb.h" 58 #include "../include/sane/sanei_debug.h" 59 60 61 #include "pieusb_scancmd.h" 62 #include "pieusb_usb.h" 63 64 65 /* -------------------------------------------------------------------------- 66 * 67 * SUPPORTED DEVICES SPECIFICS 68 * 69 * --------------------------------------------------------------------------*/ 70 71 /* List of default supported scanners by vendor-id, product-id and model number. 72 * A default list will be created in sane_init(), and entries in the config file 73 * will be added to it. */ 74 75 struct Pieusb_USB_Device_Entry 76 { 77 SANE_Word vendor; /* USB vendor identifier */ 78 SANE_Word product; /* USB product identifier */ 79 SANE_Word model; /* USB model number */ 80 SANE_Int device_number; /* USB device number if the device is present */ 81 SANE_Int flags; /* flags */ 82 }; 83 84 extern struct Pieusb_USB_Device_Entry* pieusb_supported_usb_device_list; 85 extern struct Pieusb_USB_Device_Entry pieusb_supported_usb_device; /* for searching */ 86 87 struct Pieusb_Device_Definition; 88 extern struct Pieusb_Device_Definition *pieusb_definition_list_head; 89 90 /* Debug error levels */ 91 #define DBG_error 1 /* errors */ 92 #define DBG_warning 3 /* warnings */ 93 #define DBG_info 5 /* information */ 94 #define DBG_info_sane 7 /* information sane interface level */ 95 #define DBG_inquiry 8 /* inquiry data */ 96 #define DBG_info_proc 9 /* information pieusb backend functions */ 97 #define DBG_info_scan 11 /* information scanner commands */ 98 #define DBG_info_usb 13 /* information usb level functions */ 99 #define DBG_info_buffer 15 /* information buffer functions */ 100 101 /* R G B I */ 102 #define PLANES 4 103 104 #endif /* PIEUSB_H */ 105