From: bfaye <bf...@ya...> - 2004-02-24 20:30:49
|
I just want to add in more packet descriptions so we got it in the mailing list archive. I got a rough grasp of the how the camera file reading request and response packets look like, unfortunately, I only have my phone to try. So if anyone else other there want to splice in some code to test with their 8100, it'd be cool to see if I'm on the right track. Here are the additions: p_sanyo8100.p (don't forget to do makepackets after you add in the changes): 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 unknum The following method can be added into com_sanyo8100.py, and you can test it by calling it at the beginning of getcalendar (at least thats how I've been testing it, I'm a Python noob). It assumes you have at least one picture, since it tries to grab the contents of the file at index 0 (which doesn't seem to match the fileNAME at index 0, probably 2 separate indices): 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,)) d=150 while d==150: req=self.protocolclass.sanyocampicfilerequest() req.fileindexnum=0 res=self.sendpbcommand(req, self.protocolclass.sanyocampicfileresponse) self.log("campicfile indexnum: %d" % (res.indexnum,) ) self.log("campicfile unknum: %d" % (res.unknum,) ) self.log("campicfile packetlength: %d" % (res.packetlength,) ) d=res.packetlength return You can modify getcalendar so it starts like this (optional): def getcalendar(self,result): self.getcamerapics() result=com_sanyo.Phone.getcalendar(self,result) ... Billy > Billy, keep up your work on decoding the 8100 media transfer protocol! > I am maintainer for Sanyo support in BitPim, and I am following your > posts, but probably won't comment too much as I am putting my efforts to > the SCP-5500 phonebook right now. > > The "fa 00 xx" header on packets seems to be a common theme for media > transfer for Sanyo phones and phonebook transfer for newer phones. The > 8100 camera download packets start with "fa 00 09", while the wallpaper > upload starts with "fa 00 05". The phonebook packets on the SCP-5500 > start with "fa 00 02". > I'll send you some real sketchy notes on the 8100 protocol privately. > Ignore them if they don't make any sense. > > Stephen __________________________________ Do you Yahoo!? Yahoo! Mail SpamGuard - Read only the mail you want. http://antispam.yahoo.com/tools |