From: Theodore K. <ki...@ba...> - 2003-06-26 16:40:39
|
> From: christophe barbe <chr...@ca...> > To: gph...@li... > Subject: Re: [gphoto-devel] 0x2770:0x9120 camlib attached > > On Tue, Jun 24, 2003 at 08:54:38PM -0500, Theodore Kilgore wrote: > > > (4) Please use the GPFilesystem. > > > > Good idea. If I knew exactly what it is supposed to do, and how, and why, > > and in what order it is supposed to do things. > > Did you have a look to the api doc? > > Christophe > Yes. Right now I am not in front of this document (at the office instead of at home) but if I am not mistaken this is the document with a schematic in it, showing the filesystem in between the camera and the computer? Unfortunately this does not help yet. And I have other problems: Going in the direction I went with the second version of the driver is intended as an evolution by degrees toward the conformity which everone considers desirable (me too, in spite of some amusement about indentation done by someone who is just learning to code!). As well as the fact that this second version is already improved now from what I sent, there are two other problems: 1. The second version of the driver which I posted (yesterday?) to the list will not work any more on the computer I was developing on. it corrupts the data during download of more than two or three pictures. And it leaves the camera in a non-reset state. But the same code works just fine on two other computers! At the same time, the older version which is in the same tarball (seen as sq905.c with some suffix on it) will give a driver which works on all three computers. I must be doing something wrong, but I don't know what. 2. I tried, in the process of further evolution, to separate the hardware layer from the filesystem layer. Doing this one step at a time. So the first step I am trying is to create a new function called sq905_get_num_pics and to move that code (which is an analysis of the setup data to determine the number of pictures on the camera) out of the camera_init function. Following some advice, I looked at the ricoh driver and tried to follow pretty much the steps which were done there, though I had to change a lot of stuff because the ricoh obviously does a whole lot more on its side than an SQ does. Anyway, having set up my new file-counting function, I obviously I want to call the new function while doing the file system setup, in order to fit its data in ath the filesystem level.. I gave a prototype of the function in sq905.h. Inside of the function, I told it to return num_pics just like before. Then I try to call the function in the filesystem setup function, just before gp_filesytem_populate (sorry if I am not calling this by the right name, but I don't have the right name in front of my face and surely you know what function I mean!). I get a compile warning which says that the function is now "implicitly defined" on that line where I am trying to get it to execute and give me the **** number. And indeed. if I am trying to download pictures it does not because it did not count them! It seems that this bad result occurs no matter what I try to do or try to work around it. I messed with this for about 3 hours last night and could not get past it. I looked at my book on C and it seems to me that I am doing the "calling" routine as it would, in the simple examples there. But it does not work. So I guess the next problem I am having is a very basic, mechanical problem: How do I define a function somewhere else and then get another function to execute it instead of complaining that I am illegally trying for a second time to define the function, and since I did not define it again when I try to use it, it says the "new definition" is "implicit"? No doubt, it would help a great deal in getting the project done if I could overcome this obstacle. I have succeeded on previous occasions in overcoming similar problems. But on some of those occasions I did not understand what in the **** the problem was before I fixed it and I do not understand why the fooling around which I did in order to fix the problem, fixed it! I just know that after I did things in some different order, or introduced global variables (1970 style C coding and now a big no-no and yes I actually do understand why) the problem went away. So may be that my problem is more basic than the gphoto file system. Except that the code for the gphoto file system is so big that it is very difficult for me to follow all of its comings and goings and exactly where it is supposed to fit. But if I could just do this piece by piece and make it work, understanding each step, then probably it will come out right in the end. Theodore Kilgore |