02-10-2007, 05:22 AM | #16 | |
Banned
Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
|
Quote:
Result in bulk transfer was: Code:
02 00 01 00 00 00 00 00 00 00 00 00 08 00 00 00 ................ 00 00 02 01 00 00 00 00 ....... Code:
53 00 00 00 01 00 00 00 00 00 00 00 07 00 00 00 S............... 03 00 00 00 62 3A 2f ....b:/ Hmm, did the Reader suddenly announce "I've got a SD card!"??? I'll have to try this again with MS and nothing... |
|
02-10-2007, 01:05 PM | #17 | |
creator of calibre
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
EDIT: Looking at my code, I always sent 8bytes as the key, never 4
Hmm the screen lock code is still 4 characters in length, so this seems to be pretty pointless. Quote:
Last edited by kovidgoyal; 02-10-2007 at 01:23 PM. |
|
02-10-2007, 01:24 PM | #18 | |
creator of calibre
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You are correct that does cause the do not disconnect to show up. Interestingly, sending the end session changes the text to 'USB Connected' but not the icon. A SONY bug?
Quote:
Last edited by kovidgoyal; 02-10-2007 at 01:27 PM. |
|
02-10-2007, 02:13 PM | #19 | |
Banned
Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
|
Quote:
Code:
class UnlockDevice(ShortCommand): """ Unlock the device """ NUMBER = 0x106 #: Command number def __init__(self, key=0x312d): ShortCommand.__init__(self, \ number=UnlockDevice.NUMBER, type=0x01, command=key) class ShortCommand(Command): """ A L{Command} whoose data section is 4 bytes long """ SIZE = 20 #: Packet size in bytes # Usually carries additional information command = field(start=16, fmt=DWORD) def __init__(self, number=0x00, type=0x00, command=0x00): """ @param number: L{Command.number} @param type: L{Command.type} @param command: L{ShortCommand.command} """ Command.__init__(self, ShortCommand.SIZE) self.number = number self.type = type self.length = 4 self.command = command Code:
res = self.send_validated_command(SetBulkSize(size=0x028000)) if res.code != 0: raise ProtocolError("Unable to set bulk size.") self.send_validated_command(UnlockDevice(key=0x312d)) |
|
02-10-2007, 03:09 PM | #20 |
creator of calibre
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
I'm not sure what vintage your copy of the code is, but revision 209 https://libprs500.kovidgoyal.net/changeset/209 (when I implemented device unlocking) had the following structure for UnlockDevice commands. May have been 4 before that.
class UnlockDevice(Command): """ Unlock the device """ NUMBER = 0x106 #: Command number key = stringfield(8, start=16) #: The key defaults to -1 def __init__(self, key='-1\0\0\0\0\0\0'): Command.__init__(self, 24) self.number = UnlockDevice.NUMBER self.type = 0x01 self.length = 8 self.key = key Last edited by kovidgoyal; 02-10-2007 at 03:18 PM. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
PRS-600 Serial console (i.e. shell) over USB | Xaphiosis | Sony Reader Dev Corner | 6 | 08-22-2010 11:06 PM |
Kindle's USB Serial Gadget: What is it? | yifanlu | Kindle Developer's Corner | 0 | 08-05-2010 09:31 PM |
Is this reader's anonymous? | motormaroon | Introduce Yourself | 9 | 05-21-2010 01:30 PM |
Which reader's best for me? | mistermouse | Which one should I buy? | 2 | 04-11-2010 05:15 AM |
iLiad USB serial modules | drazvan | iRex Developer's Corner | 8 | 07-30-2007 05:43 PM |