Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

ezusb_loader.h

Go to the documentation of this file.
00001 /*
00002  * This file is part of Jelie,
00003  * (c) 2002 Julien Pilet <julien.pilet@epfl.ch> and
00004  * Stephane Magnenat <stephane.magnenat@epfl.ch>
00005  *
00006  * Jelie is free software; you can redistribute it
00007  * and/or modify it under the terms of the GNU General Public License as
00008  * published by the Free Software Foundation; either version 2 of the License,
00009  * or (at your option) any later version.
00010  *
00011  * Jelie is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with Foobar; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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

Generated on Fri May 16 13:01:45 2003 for Jelie by doxygen1.2.15