Package phones :: Module com_sanyo7050
[hide private]
[frames] | no frames]

Source Code for Module phones.com_sanyo7050

  1  ### BITPIM 
  2  ### 
  3  ### Copyright (C) 2008 Stephen Wood <sawecw@users.sf.net> 
  4  ### 
  5  ### This program is free software; you can redistribute it and/or modify 
  6  ### it under the terms of the BitPim license as detailed in the LICENSE file. 
  7  ### 
  8  ### $Id$ 
  9   
 10  """Talk to the Sanyo SCP-7050 cell phone""" 
 11  # standard modules 
 12  import re 
 13  import time 
 14  import sha 
 15   
 16  # my modules 
 17  import common 
 18  import p_brew 
 19  import p_sanyo8300 
 20  import p_sanyo4930 
 21  import p_sanyo6600 
 22  import p_sanyo7050 
 23  import com_brew 
 24  import com_phone 
 25  import com_sanyo 
 26  import com_sanyomedia 
 27  import com_sanyonewer 
 28  import com_sanyo3100 
 29  import com_sanyo6600 
 30  import prototypes 
 31  import bpcalendar 
 32   
 33  numbertypetab=( 'cell', 'home', 'office', 'pager', 
 34                      'fax', 'none') 
 35   
36 -class Phone(com_sanyo6600.Phone):
37 "Talk to the Sanyo Katana-II (SCP-7050) cell phone" 38 39 desc="SCP-7050" 40 41 FIRST_MEDIA_DIRECTORY=1 42 LAST_MEDIA_DIRECTORY=2 43 44 imagelocations=( 45 # offset, directory #, indexflag, type, maximumentries 46 ) 47 wallpaperexts=(".jpg", ".png", ".mp4", ".3g2",".JPG") 48 49 50 protocolclass=p_sanyo7050 51 serialsname='scp7050' 52 53 builtinringtones=( 'None', 'Vibrate', '', '', '', '', '', '', '', 54 'Tone 1', 'Tone 2', 'Tone 3', 'Tone 4', 'Tone 5', 55 'Tone 6', 'Tone 7', 'Tone 8', '', '', '', '', '', 56 '', '', '', '', 57 'Requiem:Dies Irae', 'Minute Waltz', 'Hungarian Dance', 58 'Military March', 'Ten Little Indians', 59 'Head,Shoulders,Knees&Toes', 'The Moment', 'Asian Jingle', 60 'Kung-fu','','','','','','','','','','','','','','','','','', 61 '','','','','','', 62 'Voice Alarm') 63 64 65 calendar_defaultringtone=0 66 calendar_defaultcaringtone=0 67 calendar_toneoffset=33 68 calendar_tonerange=xrange(4,100) 69
70 - def __init__(self, logtarget, commport):
71 com_sanyo6600.Phone.__init__(self, logtarget, commport) 72 self.mode=self.MODENONE 73 self.numbertypetab=numbertypetab
74
75 - def getfundamentals(self, results):
76 """Gets information fundamental to interopating with the phone and UI.""" 77 req=self.protocolclass.sanyoreset() 78 res=self.sendpbcommand(req, p_brew.testing0cresponse) 79 80 results['uniqueserial']=sha.new(self.get_esn()).hexdigest() 81 self.getmediaindices(results) 82 83 results['groups']=self.read_groups() 84 85 self.log("Fundamentals retrieved") 86 87 return results
88 89 my_model='SCP7050' 90 detected_model='SCP-7050/US' 91 my_manufacturer='SANYO'
92 93 parentprofile=com_sanyo6600.Profile
94 -class Profile(parentprofile):
95 96 protocolclass=Phone.protocolclass 97 serialsname=Phone.serialsname 98 phone_manufacturer=Phone.my_manufacturer 99 phone_model=Phone.my_model 100 101 usbids=( ( 0x0474, 0x0743, 2),) # VID=Sanyo, 102 deviceclasses=("serial",) 103 104 _supportedsyncs=( 105 ('phonebook', 'read', None), # all phonebook reading 106 #('calendar', 'read', None), # all calendar reading 107 ('phonebook', 'write', 'OVERWRITE'), # only overwriting phonebook 108 #('calendar', 'write', 'OVERWRITE'), # only overwriting calendar 109 ('wallpaper', 'read', None), # all wallpaper reading 110 ('ringtone', 'read', None), # all ringtone reading 111 ('call_history', 'read', None),# all call history list reading 112 ('sms', 'read', None), # Read sms messages 113 ('todo', 'read', None), # Read todos 114 ) 115
116 - def __init__(self):
117 parentprofile.__init__(self) 118 com_sanyonewer.Profile.__init__(self) 119 self.numbertypetab=numbertypetab
120