From: Ken S. <ken...@co...> - 2008-12-14 18:44:25
|
### BITPIM ### ### Copyright (C) 2007 Stephen Wood <sa...@us...> ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of the BitPim license as detailed in the LICENSE file. ### ### $Id:$ """Talk to the Sanyo Katana Dlx (SCP-8500) cell phone""" # standard modules import re import time import sha # my modules import common import p_brew import p_sanyo8300 import p_sanyo4930 import p_sanyo6600 import p_sanyo8400 import p_sanyo8500 import com_brew import com_phone import com_sanyo import com_sanyomedia import com_sanyonewer # import com_sanyoseries8000 import com_sanyo3100 import com_sanyo6600 import com_sanyo8400 import prototypes import bpcalendar numbertypetab=( 'Mobile', 'Home', 'Work', 'Pager', 'Fax', 'Other') class Phone(com_sanyo6600.Phone): "Talk to the Sanyo Katana Dlx (SCP-8500) cell phone" desc="SCP-8500" FIRST_MEDIA_DIRECTORY=1 LAST_MEDIA_DIRECTORY=6 WALLPAPER_WIDTH=144 WALLPAPER_HEIGHT=196 imagelocations=( # offset, directory #, indexflag, type, maximumentries ) wallpaperexts=(".jpg", ".png", ".mp4", ".3g2",".JPG") protocolclass=p_sanyo8500 serialsname='scp8500' builtinringtones=( 'Ringer & Voice', 'Vibrate', 'None ', 'Normal', 'Single Tones', 'Ring Tones', 'Melodies', 'Single Tone 1', 'Single Tone 2', 'Single Tone 3', 'Single Tone 4', 'Single Tone 5', 'Single Tone 6', 'Single Tone 7', 'Single Tone 8', '', '', '', '', '', 'Ring Tone 1', 'Ring Tone 2', 'Ring Tone 3', 'Ring Tone 4', 'Ring Tone 5', 'Ring Tone 6', 'Ring Tone 7', 'Ring Tone 8', '', '', '', '', '', 'KATANA', 'Je Te Veux', 'The Entertainer', 'Smooth Funk', 'Agnus Dei', 'BRANDENBURG', 'Etude Op.10 No.3', 'Good Morning', 'Calling!', '') # rintones and wallpaper info, copy from VX8500, may need to change to match # what the phone actually has external_storage_root='mmc1/' builtinringtones= ('Low Beep Once', 'Low Beeps', 'Loud Beep Once', 'Loud Beeps', 'VZW Default Ringtone') + \ tuple(['Ringtone '+`n` for n in range(1,13)]) + \ ('No Ring',) # ringtonelocations= ( # type index file default dir external dir max type Index # ( 'ringers', 'dload/myringtone.dat','brew/16452/lk/mr','mmc1/ringers', 100, 0x01, 100), # ( 'sounds', 'dload/mysound.dat', 'brew/16452/ms', '', 100, 0x02, None), # ( 'sounds(sd)', 'dload/sd_sound.dat', 'mmc1/my_sounds', '', 100, 0x02, None), # ( 'music', 'dload/efs_music.dat', 'my_music', '', 100, 0x104, None), # ( 'music(sd)', 'dload/sd_music.dat', 'mmc1/my_music', '', 100, 0x14, None), # ) # wallpaperlocations= ( # # type index file default dir external dir max type Index # ( 'images', 'dload/image.dat', 'brew/16452/mp', '', 100, 0x00, 100), # ( 'images(sd)', 'dload/sd_image.dat', 'mmc1/my_pix', '', 100, 0x10, None), # ( 'video', 'dload/video.dat', 'brew/16452/mf', '', 100, 0x03, None), # ( 'video(sd)', 'dload/sd_video.dat', 'mmc1/my_flix', '', 100, 0x13, None), # ) calendar_defaultringtone=3 calendar_defaultcaringtone=3 calendar_toneoffset=33 calendar_tonerange=xrange(4,100) def __init__(self, logtarget, commport): com_sanyo6600.Phone.__init__(self, logtarget, commport) self.mode=self.MODENONE self.numbertypetab=numbertypetab def getfundamentals(self, results): """Gets information fundamental to interopating with the phone and UI.""" req=self.protocolclass.esnrequest() res=self.sendpbcommand(req, self.protocolclass.esnresponse) results['uniqueserial']=sha.new(self.get_esn()).hexdigest() self.getmediaindices(results) #results['groups']=self.read_groups() self.log("Fundamentals retrieved") return results my_model='SCP-8500/US' my_manufacturer='SANYO' parentprofile=com_sanyo6600.Profile class Profile(parentprofile): protocolclass=Phone.protocolclass serialsname=Phone.serialsname phone_manufacturer=Phone.my_manufacturer phone_model=Phone.my_model usbids=( ( 0x0474, 0x0748, 1),) # VID=Sanyo, 8500,1 deviceclasses=("modem", "serial") imageorigins={} imageorigins.update(common.getkv(parentprofile.stockimageorigins, "images")) imageorigins.update(common.getkv(parentprofile.stockimageorigins, "video")) imageorigins.update(common.getkv(parentprofile.stockimageorigins, "images(sd)")) imageorigins.update(common.getkv(parentprofile.stockimageorigins, "video(sd)")) def GetImageOrigins(self): return self.imageorigins ringtoneorigins=('ringers', 'sounds', 'sounds(sd)',' music', 'music(sd)') excluded_ringtone_origins=('sounds', 'sounds(sd)', 'music', 'music(sd)') # our targets are the same for all origins imagetargets={} imagetargets.update(common.getkv(parentprofile.stockimagetargets, "wallpaper", {'width': 320, 'height': 204, 'format': "JPEG"})) imagetargets.update(common.getkv(parentprofile.stockimagetargets, "outsidelcd", {'width': 160, 'height': 99, 'format': "JPEG"})) # _supportedsyncs=( # ('phonebook', 'read', None), # all phonebook reading # ('calendar', 'read', None), # all calendar reading # #('phonebook', 'write', 'OVERWRITE'), # only overwriting phonebook # #('calendar', 'write', 'OVERWRITE'), # only overwriting calendar # ('wallpaper', 'read', None), # all wallpaper reading # ('ringtone', 'read', None), # all ringtone reading # ('call_history', 'read', None),# all call history list reading # ('sms', 'read', None), # Read sms messages # ('todo', 'read', None), # Read todos # ) _supportedsyncs=( ('phonebook', 'read', None), # all phonebook reading ('calendar', 'read', None), # all calendar reading ('wallpaper', 'read', None), # all wallpaper reading ('ringtone', 'read', None), # all ringtone reading ('call_history', 'read', None),# all call history list reading ('sms', 'read', None), # all SMS list reading ('memo', 'read', None), # all memo list reading ('phonebook', 'write', 'OVERWRITE'), # only overwriting phonebook ('calendar', 'write', 'OVERWRITE'), # only overwriting calendar ('wallpaper', 'write', 'MERGE'), # merge and overwrite wallpaper ('wallpaper', 'write', 'OVERWRITE'), ('ringtone', 'write', 'MERGE'), # merge and overwrite ringtone ('ringtone', 'write', 'OVERWRITE'), ## ('sms', 'write', 'OVERWRITE'), # all SMS list writing ('memo', 'write', 'OVERWRITE'), # all memo list writing ## ('playlist', 'read', 'OVERWRITE'), ## ('playlist', 'write', 'OVERWRITE'), ) def __init__(self): parentprofile.__init__(self) com_sanyonewer.Profile.__init__(self) self.numbertypetab=numbertypetab |