Update of /cvsroot/libphidget/libphidget/src/libphidget
In directory sc8-pr-cvs1:/tmp/cvs-serv20240
Modified Files:
phidget.c phidget.h
Log Message:
Added the concept of devices styles, in this case they can be either libusb or HID. Now have to add support to HID.
Index: phidget.c
===================================================================
RCS file: /cvsroot/libphidget/libphidget/src/libphidget/phidget.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** phidget.c 13 Dec 2002 05:01:09 -0000 1.10
--- phidget.c 13 Dec 2002 05:15:13 -0000 1.11
***************
*** 60,63 ****
--- 60,64 ----
int productID; /**< USB Product ID. See the USB specification for more information. */
enum EDeviceClass deviceClass; /**< Device class */
+ enum EStyle style; /**< Style of device, libusb or HID, hope to get away from HID totally */
};
***************
*** 402,406 ****
* Private function to register a new device type
*/
! void _registerDeviceType(const char *name, int vendorID, int productID, int deviceClass)
{
int len;
--- 403,407 ----
* Private function to register a new device type
*/
! void _registerDeviceType(const char *name, int vendorID, int productID, int deviceClass, enum EStyle style)
{
int len;
***************
*** 413,416 ****
--- 414,418 ----
_typeList[_typeCount].productID = productID;
_typeList[_typeCount].deviceClass = deviceClass;
+ _typeList[_typeCount].style = style;
len = strlen(name);
***************
*** 907,925 ****
_clearDeviceTypes();
! _registerDeviceType("RFID VID/PID", 0x06C2, 0x0030, LP_OTHER);
! _registerDeviceType("QuadServo .1 Degree", 0x06C2, 0x0038, LP_SERVO_CONTROLLER);
! _registerDeviceType("UniServo .1 Degree", 0x06C2, 0x0039, LP_SERVO_CONTROLLER);
! _registerDeviceType("8-AdvancedServo", 0x06C2, 0x003B, LP_SERVO_CONTROLLER);
! _registerDeviceType("Interface Kit 884", 0x0925, 0x8201, LP_INTERFACE_KIT);
! _registerDeviceType("Interface Kit 884", 0x06C2, 0x0040, LP_INTERFACE_KIT);
! _registerDeviceType("Interface Kit 088", 0x06C2, 0x0041, LP_INTERFACE_KIT);
! _registerDeviceType("Interface Kit 32-32-0", 0x06C2, 0x0042, LP_INTERFACE_KIT);
! _registerDeviceType("Interface Kit 0-256-0", 0x06C2, 0x0043, LP_INTERFACE_KIT);
! _registerDeviceType("Receiver Ver 1.0", 0x06C2, 0x0048, LP_OTHER);
! _registerDeviceType("PhidgetLED Ver 1.0", 0x06C2, 0x0049, LP_OTHER);
! _registerDeviceType("PhidgetEncoder Ver 1.0", 0x06C2, 0x004B, LP_OTHER);
! _registerDeviceType("PhidgetPower Ver 1.01", 0x06C2, 0x004E, LP_OTHER);
! _registerDeviceType("PhidgetTextLCD ECMA1010 Ver 1.0", 0x06C2, 0x0050, LP_OTHER);
! _registerDeviceType("PhidgetGraphicLCD Ver 1.0", 0x06C2, 0x0058, LP_OTHER);
//_registerDeviceType("SoftPhidget", 0x06C2, 0x0060, LP_OTHER);
--- 909,927 ----
_clearDeviceTypes();
! _registerDeviceType("QuadServo .1 Degree", 0x06C2, 0x0038, LP_SERVO_CONTROLLER, LIBUSB);
! _registerDeviceType("UniServo .1 Degree", 0x06C2, 0x0039, LP_SERVO_CONTROLLER, LIBUSB);
! _registerDeviceType("Interface Kit 884", 0x0925, 0x8201, LP_INTERFACE_KIT, HID);
! _registerDeviceType("Interface Kit 884", 0x06C2, 0x0040, LP_INTERFACE_KIT, HID);
! _registerDeviceType("Interface Kit 088", 0x06C2, 0x0041, LP_INTERFACE_KIT, HID);
! //_registerDeviceType("RFID VID/PID", 0x06C2, 0x0030, LP_OTHER);
! //_registerDeviceType("8-AdvancedServo", 0x06C2, 0x003B, LP_SERVO_CONTROLLER);
! //_registerDeviceType("Interface Kit 32-32-0", 0x06C2, 0x0042, LP_INTERFACE_KIT);
! //_registerDeviceType("Interface Kit 0-256-0", 0x06C2, 0x0043, LP_INTERFACE_KIT);
! //_registerDeviceType("Receiver Ver 1.0", 0x06C2, 0x0048, LP_OTHER);
! //_registerDeviceType("PhidgetLED Ver 1.0", 0x06C2, 0x0049, LP_OTHER);
! //_registerDeviceType("PhidgetEncoder Ver 1.0", 0x06C2, 0x004B, LP_OTHER);
! //_registerDeviceType("PhidgetPower Ver 1.01", 0x06C2, 0x004E, LP_OTHER);
! //_registerDeviceType("PhidgetTextLCD ECMA1010 Ver 1.0", 0x06C2, 0x0050, LP_OTHER);
! //_registerDeviceType("PhidgetGraphicLCD Ver 1.0", 0x06C2, 0x0058, LP_OTHER);
//_registerDeviceType("SoftPhidget", 0x06C2, 0x0060, LP_OTHER);
Index: phidget.h
===================================================================
RCS file: /cvsroot/libphidget/libphidget/src/libphidget/phidget.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** phidget.h 13 Dec 2002 05:01:09 -0000 1.6
--- phidget.h 13 Dec 2002 05:15:13 -0000 1.7
***************
*** 106,109 ****
--- 106,119 ----
};
+ /**
+ * Style of device, libusb or HID, hope to get away from HID totally
+ */
+ enum EStyle
+ {
+ LIBUSB=0, /**< This device uses libusb */
+ HID=1 /**< This device uses HID driver */
+ };
+
+
#ifdef __cplusplus
extern "C"
|