1 /***************************************************************************
2 * Copyright (C) 2001 by Matthias Hoelzer-Kluepfel <mhk@caldera.de> *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
9 ***************************************************************************/
12 #ifndef __USB_DEVICES_H__
13 #define __USB_DEVICES_H__
17 #include <Qt3Support/Q3PtrList>
19 #if defined(__DragonFly__)
20 #include <bus/usb/usb.h>
21 #elif defined(Q_OS_FREEBSD) || defined(Q_OS_NETBSD)
22 #include <dev/usb/usb.h>
34 void parseLine(const QString
&line
);
35 void parseSysDir(int bus
, int parent
, int level
, const QString
&line
);
37 int level() const { return _level
; }
38 int device() const { return _device
; }
39 int parent() const { return _parent
; }
40 int bus() const { return _bus
; }
45 static Q3PtrList
<USBDevice
> &devices() { return _devices
; }
46 static USBDevice
*find(int bus
, int device
);
47 static bool parse(const QString
& fname
);
48 static bool parseSys(const QString
& fname
);
53 static Q3PtrList
<USBDevice
> _devices
;
57 int _bus
, _level
, _parent
, _port
, _count
, _device
, _channels
, _power
;
60 QString _manufacturer
, _product
, _serial
;
62 int _bwTotal
, _bwUsed
, _bwPercent
, _bwIntr
, _bwIso
;
65 unsigned int _verMajor
, _verMinor
, _class
, _sub
, _prot
, _maxPacketSize
, _configs
;
68 unsigned int _vendorID
, _prodID
, _revMajor
, _revMinor
;
70 #if defined(Q_OS_FREEBSD) || defined(Q_OS_NETBSD)
71 void collectData( int fd
, int level
, usb_device_info
&di
, int parent
);
72 QStringList _devnodes
;