00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00028 #ifndef _EZUSB_H_
00029 #define _EZUSB_H_
00030
00031 #include <stdio.h>
00032 #include <ctype.h>
00033 #include <usb.h>
00034
00036
00041 class EzUSB
00042 {
00043 protected:
00045 struct usb_dev_handle* devHandle;
00047 int idVendor;
00049 int idProduct;
00051 char filename[1024];
00052
00053 protected:
00055 struct intels
00056 {
00057 int addr, len;
00058 unsigned char * data;
00059 struct intels * nxt;
00060 } intels;
00061
00063 int read_head(FILE * fh, struct intels * * doutp );
00064
00066 int shunt(usb_dev_handle *pdev, int at, void *d, int len);
00067
00068 public:
00070
00071 EzUSB(const char *filename=NULL);
00073
00074 virtual ~EzUSB();
00075
00077 virtual void forceClose(void);
00078
00080
00083 void parseCmdLine(int argc, char *argv[]);
00085
00086 bool findDevice(void);
00088
00093 bool downloadFirmware(const char *firmware);
00094 };
00095
00096 #endif