freemyipod r805 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r804‎ | r805 | r806 >
Date:16:37, 20 November 2011
Author:theseven
Status:new
Tags:
Comment:
libipoddfu.py: Add iPod Classic WTF mode USB IDs
Modified paths:
  • /tools/ipoddfu/libipoddfu.py (modified) (history)

Diff [purge]

Index: tools/ipoddfu/libipoddfu.py
@@ -66,6 +66,31 @@
6767 return
6868 except usb.core.USBError: pass
6969 try:
 70+ self.dev = usb.core.find(idVendor=0x05ac, idProduct=0x1241)
 71+ if self.dev and generation in [0, 11] and type in [0, 2]:
 72+ self.dev.set_configuration(1)
 73+ self.generation = 11;
 74+ self.type = 2;
 75+ print("Connected to iPod Classic 1G WTF mode, USB version %s" % self.dev.bcdDevice)
 76+ return
 77+ try:
 78+ self.dev = usb.core.find(idVendor=0x05ac, idProduct=0x1245)
 79+ if self.dev and generation in [0, 12] and type in [0, 2]:
 80+ self.dev.set_configuration(1)
 81+ self.generation = 12;
 82+ self.type = 2;
 83+ print("Connected to iPod Classic 2G WTF mode, USB version %s" % self.dev.bcdDevice)
 84+ return
 85+ try:
 86+ self.dev = usb.core.find(idVendor=0x05ac, idProduct=0x1247)
 87+ if self.dev and generation in [0, 13] and type in [0, 2]:
 88+ self.dev.set_configuration(1)
 89+ self.generation = 13;
 90+ self.type = 2;
 91+ print("Connected to iPod Classic 3G WTF mode, USB version %s" % self.dev.bcdDevice)
 92+ return
 93+ except usb.core.USBError: pass
 94+ try:
7095 self.dev = usb.core.find(idVendor=0x05ac, idProduct=0x1225)
7196 if self.dev and generation in [0, 4] and type in [0, 1]:
7297 self.dev.set_configuration(1)