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

Source Code for Module phones.com_lgvi5225

  1  ### BITPIM 
  2  ### 
  3  ### Copyright (C) 2006 Stephen A. 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: com_lgvi5225.py 3918 2007-01-19 05:15:12Z djpham $ 
  9   
 10  """Communicate with the LG VI5225 cell phone 
 11   
 12  Also known as the LG-VX5400.  Operates on STI-Mobile, a virtual carrier 
 13  reselling Sprint airtime. 
 14  """ 
 15   
 16  # standard modules 
 17  import time 
 18  import cStringIO 
 19  import sha 
 20   
 21  # my modules 
 22  import common 
 23  import copy 
 24  import p_lgvi5225 
 25  import com_lgvx4400 
 26  import com_brew 
 27  import com_phone 
 28  import com_lg 
 29  import prototypes 
 30   
31 -class Phone(com_lgvx4400.Phone):
32 "Talk to the LG VI5225 cell phone" 33 34 desc="LG-VI5225" 35 helpid=None 36 protocolclass=p_lgvi5225 37 serialsname='lgvi5225' 38 39 # more VI5225 indices 40 imagelocations=( 41 # offset, index file, files location, type, maximumentries 42 ( 10, "download/dloadindex/brewImageIndex.map", "brew/shared", "images", 30) , 43 ( 0xc8, "download/dloadindex/mmsImageIndex.map", "brew/shared/mms", "mms", 20), 44 ( 0xdc, "download/dloadindex/mmsDrmImageIndex.map", "brew/shared/mms/d", "drm", 20), 45 ) 46 47 ringtonelocations=( 48 # offset, index file, files location, type, maximumentries 49 ( 50, "download/dloadindex/brewRingerIndex.map", "user/sound/ringer", "ringers", 30), 50 ( 150, "download/dloadindex/mmsRingerIndex.map", "mms/sound", "mms", 20), 51 ( 180, "download/dloadindex/mmsDrmRingerIndex.map", "mms/sound/drm", "drm", 20) 52 ) 53 54 builtinimages= ('Beach Ball', 'Towerbridge', 'Sunflower', 'Beach', 'Fish', 55 'Sea', 'Snowman') 56 57 builtinringtones= ('Ring 1', 'Ring 2', 'Ring 3', 'Ring 4', 'Ring 5', 'Ring 6', 58 'Annen Polka', 'Beethoven Symphony No. 9', 'Pachelbel Canon', 59 'Hallelujah', 'La Traviata', 'Leichte Kavallerie Overture', 60 'Mozart Symphony No.40', 'Bach Minuet', 'Farewell', 61 'Mozart Piano Sonata', 'Sting', 'Trout', 'Pineapple Rag', 62 'Latin', 'Carol') 63 64
65 - def __init__(self, logtarget, commport):
66 com_lgvx4400.Phone.__init__(self,logtarget,commport) 67 self.mode=self.MODENONE
68 69 # def getfundamentals(self, results): 70 # """Do some test reads.""" 71 72
73 - def eval_detect_data(self, res):
74 found=False 75 if res.get(self.brew_version_txt_key, None) is not None: 76 found=res[self.brew_version_txt_key][:len(self.my_version_txt)]==self.my_version_txt 77 if found: 78 res['model']=self.my_model 79 res['manufacturer']='LG Electronics Inc' 80 s=res.get(self.esn_file_key, None) 81 if s: 82 res['esn']=self.get_esn(s)
83 84 85 my_version_txt='AX545V' 86 my_model='VI5225'
87 88 parentprofile=com_lgvx4400.Profile
89 -class Profile(parentprofile):
90 protocolclass=Phone.protocolclass 91 serialsname=Phone.serialsname 92 phone_manufacturer='LG Electronics Inc' 93 phone_model='LG-LX5400V' 94 95 usbids_straight=( ( 0x1004, 0x6000, 2), )# VID=LG Electronics, PID=LG VX4400/VX6000 -internal USB diagnostics interface 96 usbids_usbtoserial=( 97 ( 0x067b, 0x2303, None), # VID=Prolific, PID=USB to serial 98 ( 0x0403, 0x6001, None), # VID=FTDI, PID=USB to serial 99 ( 0x0731, 0x2003, None), # VID=Susteen, PID=Universal USB to serial 100 ( 0x6547, 0x0232, None), # VID=ArkMicro, PID=USB to serial 101 ) 102 usbids=usbids_straight+usbids_usbtoserial 103 104 WALLPAPER_WIDTH=120 105 WALLPAPER_HEIGHT=131 106 MAX_WALLPAPER_BASENAME_LENGTH=32 107 WALLPAPER_FILENAME_CHARS="_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 ." 108 WALLPAPER_CONVERT_FORMAT="bmp" 109 110 MAX_RINGTONE_BASENAME_LENGTH=32 111 RINGTONE_FILENAME_CHARS="_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 ." 112 113 # nb we don't allow save to camera so it isn't listed here 114 imageorigins={} 115 imageorigins.update(common.getkv(parentprofile.stockimageorigins, "images")) 116 imageorigins.update(common.getkv(parentprofile.stockimageorigins, "mms")) 117 imageorigins.update(common.getkv(parentprofile.stockimageorigins, "drm"))
118 - def GetImageOrigins(self):
119 return self.imageorigins
120 121 ringtoneorigins=('ringers', 'mms', 'drm') 122 excluded_ringtone_origins=('mms', 'drm') 123 excluded_wallpaper_origins=('mms', 'drm') 124 125 # our targets are the same for all origins 126 imagetargets={} 127 imagetargets.update(common.getkv(parentprofile.stockimagetargets, "wallpaper", 128 {'width': 120, 'height': 131, 'format': "BMP"})) 129
130 - def GetTargetsForImageOrigin(self, origin):
131 return self.imagetargets
132 133 _supportedsyncs=( 134 #('sms', 'read', None), 135 #('sms', 'write', 'OVERWRITE'), 136 ('phonebook', 'read', None), # all phonebook reading 137 ('phonebook', 'write', 'OVERWRITE'), # only overwriting phonebook 138 #('calendar', 'write', 'OVERWRITE'), # only overwriting calendar 139 #('calendar', 'read', None), # all calendar reading 140 #('wallpaper', 'read', None), # all wallpaper reading 141 #('wallpaper', 'write', 'MERGE'), # merge and overwrite wallpaper 142 #('wallpaper', 'write', 'OVERWRITE'), 143 #('ringtone', 'read', None), # all ringtone reading 144 #('ringtone', 'write', 'MERGE'), # merge and overwrite ringtone 145 #('ringtone', 'write', 'OVERWRITE'), 146 #('memo', 'read', None), # all memo list reading DJP 147 #('memo', 'write', 'OVERWRITE'), # all memo list writing DJP 148 #('call_history', 'read', None), 149 ) 150
151 - def __init__(self):
152 parentprofile.__init__(self)
153