From c37749a458820a36a77b59068faaa561c256f3e7 Mon Sep 17 00:00:00 2001 From: Patrick McIlroy Date: Sun, 24 Feb 2008 04:34:57 +0000 Subject: [PATCH] git-svn-id: https://openitg.svn.sourceforge.net/svnroot/openitg@42 83fadc84-e282-4d84-a09a-c4228d6ae7e5 --- src/io/USBDevice.h | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/src/io/USBDevice.h b/src/io/USBDevice.h index c1653023..edfb5f63 100644 --- a/src/io/USBDevice.h +++ b/src/io/USBDevice.h @@ -1,8 +1,12 @@ #ifndef IO_USBDEVICE_H #define IO_USBDEVICE_H +#include "global.h" #include +// XXX: we probably need to move this to arch or archutils in preparation for windows portability +// --infamouspat + /* A class we can use to characterize all USB devices on the system */ class USBDevice { @@ -10,22 +14,40 @@ public: USBDevice(); ~USBDevice(); - bool Load(); + bool Load(const CString &nDeviceDir, const vector &interfaces); - CString GetDeviceProperty( CString sProperty ); - CString GetInterfaceProperty( CString sProperty, int iInterface ); - CString GetClassDescription( int iClass ); + bool GetDeviceProperty( const CString &sProperty, CString &out ); + bool GetInterfaceProperty( const CString &sProperty, const unsigned iInterface, CString &out); + CString GetClassDescription( unsigned iClass ); CString GetDescription(); + int GetIdVendor() { return iIdVendor; } + int GetIdProduct() { return iIdProduct; } + int GetMaxPower() { return iMaxPower; } + + CString GetDeviceDir() { return sDeviceDir; } + bool IsHub(); bool IsITGIO(); bool IsPIUIO(); + +private: + int iIdVendor; + int iIdProduct; + int iMaxPower; + CString sDeviceDir; + + vector sInterfaceDeviceDirs; + vector iInterfaceClasses; + }; +bool GetUSBDeviceList(vector &pDevList); + #endif /* IO_USBDEVICE_H */ /* - * (c) 2008 BoXoRRoXoRs + * (c) 2005 Glenn Maynard reimplemented by nice people @ BoXoRRoXoRs * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a -- 2.11.0