00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef __USB_DEVICES_H__
00013 #define __USB_DEVICES_H__
00014
00015
00016 #include <tqstring.h>
00017 #include <tqptrlist.h>
00018
00019 #ifdef Q_OS_FREEBSD
00020 #include <dev/usb/usb.h>
00021 #endif
00022
00023 class USBDB;
00024
00025
00026 class USBDevice
00027 {
00028 public:
00029
00030 USBDevice();
00031
00032 void parseLine(TQString line);
00033 void parseSysDir(int bus, int parent, int level, TQString line);
00034
00035 int level() { return _level; };
00036 int device() { return _device; };
00037 int parent() { return _parent; };
00038 int bus() { return _bus; };
00039 TQString product();
00040
00041 TQString dump();
00042
00043 static TQPtrList<USBDevice> &devices() { return _devices; };
00044 static USBDevice *find(int bus, int device);
00045 static bool parse(TQString fname);
00046 static bool parseSys(TQString fname);
00047
00048
00049 private:
00050
00051 static TQPtrList<USBDevice> _devices;
00052
00053 static USBDB *_db;
00054
00055 int _bus, _level, _parent, _port, _count, _device, _channels, _power;
00056 float _speed;
00057
00058 TQString _manufacturer, _product, _serial;
00059
00060 int _bwTotal, _bwUsed, _bwPercent, _bwIntr, _bwIso;
00061 bool _hasBW;
00062
00063 unsigned int _verMajor, _verMinor, _class, _sub, _prot, _maxPacketSize, _configs;
00064 TQString _className;
00065
00066 unsigned int _vendorID, _prodID, _revMajor, _revMinor;
00067
00068 #ifdef Q_OS_FREEBSD
00069 void collectData( int fd, int level, usb_device_info &di, int parent );
00070 TQStringList _devnodes;
00071 #endif
00072 };
00073
00074
00075 #endif