From: bfaye <bf...@ya...> - 2004-02-24 22:54:29
|
It seems the wallpaper index number (XX in scp8100Index_xx) in the bitpim phonebook is also a number in the filename response packet. Its "num2" in my filename response packet definition. What happens is that if you save a camera taken picture to the "wallet", it makes a smaller copy of the picture with the same filename(!), so you get two files with the same name back when you read off the filenames. Also, it seems that wallet pics would get an index of 153 (0x99) or higher, and pics saved from the web (through vision download tools), get a lower index. I had one that was 58 (0x3a). So if you want, you can try to grab the pic for a pic assigned to a phonebook entry, but that "index" is not the "main" file index. You have to read all the filename entries until you get to the one with a "num2" that matches the one in the phonebook. I was wrong about the indexes in the filename not corresponding with the files themselves. I must of confused myself when I was looking at different log files. So if you read the filecontents back in order, you'll have the correct file name. The following code will write out all the camera pics from the phone. It doesn't handle the case where there are 2 files found on the phone with the same name yet. def getcamerapics(self): req=self.protocolclass.sanyoinitcampicread() res=self.sendpbcommand(req, self.protocolclass.sanyocamresponse) req=self.protocolclass.sanyonumofcamerapicrequest() res=self.sendpbcommand(req, self.protocolclass.sanyonumofcamerapicresponse) self.log("got %d camera pics" % (res.numcampics,)) for c in range(0, res.numcampics): req=self.protocolclass.sanyocampicfilenamerequest() req.reqindex=c res=self.sendpbcommand(req, self.protocolclass.sanyocampicfilenameresponse) self.log("campic filename: " + res.filename) self.log("campic num1: %d" % (res.num1,)) self.log("campic num2: %d" % (res.num2,)) self.log("campic num3: %d" % (res.num3,)) filename=res.filename outfile=open(filename, "wb") d=1 while d==1: req=self.protocolclass.sanyocampicfilerequest() req.fileindexnum=c res=self.sendpbcommand(req, self.protocolclass.sanyocampicfileresponse) self.log("campicfile indexnum: %d" % (res.indexnum,)) self.log("campicfile moredata: %d" % (res.moredata,)) self.log("campicfile packetlength: %d" % (res.packetlength,)) outfile.write(res.data[0:res.packetlength]) outfile.flush() d=res.moredata outfile.close() return And here is the updated packet defs I'm using: PACKET sanyonumofcamerapicrequest: * sanyomediaheader {'command': 0x09, 'subcommand': 0x0072} +header 2 UINT {'constant': 0xffff} +word 172 UNKNOWN +pad PACKET sanyonumofcamerapicresponse: 172 UNKNOWN +pad 1 UINT numcampics 6 UNKNOWN +pad2 PACKET sanyocampicfilenamerequest: * sanyomediaheader {'command': 0x09, 'subcommand': 0x0073} +header 2 UINT {'constant': 0xffff} +word 161 UNKNOWN +pad 1 UINT reqindex 10 UNKNOWN +pad2 PACKET sanyocampicfilenameresponse: 8 UNKNOWN +headerstuff 154 STRING +filename 1 UINT num1 3 UNKNOWN +pad 1 UINT num2 1 UNKNOWN +pad2 1 UINT num3 10 UNKNOWN +pad3 PACKET sanyocampicfilerequest: * sanyomediaheader {'command': 0x09, 'subcommand': 0x0074} +header 2 UINT {'constant': 0xffff} +word 155 UNKNOWN +pad1 1 UINT fileindexnum 16 UNKNOWN +pad2 PACKET sanyocampicfileresponse: 8 UNKNOWN +headerstuff 150 DATA data 1 UINT packetlength 3 UNKNOWN +pad1 1 UINT indexnum 15 UNKNOWN +pad2 1 UINT moredata --- Stephen Wood <sa...@us...> wrote: > While you are looking at this, could you look at assignment of camera > pictures to phonebook entries. If you assign a camera picture to a name > in your phonebook, and then dump the phonebook with Bitpim, you will see > in the index file that BitPim makes a line like > > 'wallpapers': 'scp8100Index_XX', > > for each phonebook entry you assign a picture to. The XX is the index > number that the phone reports for the wallpaper. What would be nice is > to find out if these index numbers can be related to the picture > filenames that you are getting from the phone. > > > Stephen __________________________________ Do you Yahoo!? Yahoo! Mail SpamGuard - Read only the mail you want. http://antispam.yahoo.com/tools |