Package phones ::
Module com_lglx260
|
|
1
2
3
4
5
6
7
8
9
10
11 """Communicate with the LG LX260 cell phone
12
13 The LX260 is like other LG phones, I got this to import and export phonebook data
14 which is all I care about at the moment, extending should be straightforward
15
16
17 """
18
19
20 import time
21 import cStringIO
22 import sha
23
24
25 import common
26 import copy
27 import p_brew
28 import p_lglx260
29 import com_lgvx4400
30 import com_brew
31 import com_phone
32 import com_lg
33 import prototypes
34
35 -class Phone(com_lgvx4400.Phone):
36 "Talk to the LG LX260 cell phone"
37
38 desc="LG-LX260"
39 helpid=None
40 protocolclass=p_lglx260
41 serialsname='lglx260'
42
43
44 imagelocations=(
45
46 ( 10, "download/dloadindex/brewImageIndex.map", "brew/shared", "images", 30) ,
47 ( 0xc8, "download/dloadindex/mmsImageIndex.map", "brew/shared/mms", "mms", 20),
48 ( 0xdc, "download/dloadindex/mmsDrmImageIndex.map", "brew/shared/mms/d", "drm", 20),
49 ( 0x82, None, None, "camera", 20)
50 )
51
52 ringtonelocations=(
53
54 ( 50, "download/dloadindex/brewRingerIndex.map", "user/sound/ringer", "ringers", 30),
55 ( 150, "download/dloadindex/mmsRingerIndex.map", "mms/sound", "mms", 20),
56 ( 180, "download/dloadindex/mmsDrmRingerIndex.map", "mms/sound/drm", "drm", 20)
57 )
58
59 builtinimages= ('Beach Ball', 'Towerbridge', 'Sunflower', 'Beach', 'Fish',
60 'Sea', 'Snowman')
61
62 builtinringtones= ('Ring 1', 'Ring 2', 'Ring 3', 'Ring 4', 'Ring 5', 'Ring 6',
63 'Annen Polka', 'Beethoven Symphony No. 9', 'Pachelbel Canon',
64 'Hallelujah', 'La Traviata', 'Leichte Kavallerie Overture',
65 'Mozart Symphony No.40', 'Bach Minuet', 'Farewell',
66 'Mozart Piano Sonata', 'Sting', 'Trout', 'O solemio',
67 'Pizzicata Polka', 'Stars and Stripes Forever',
68 'Pineapple Rag', 'When the Saints Go Marching In', 'Latin',
69 'Carol 1', 'Carol 2')
70
71
72 - def __init__(self, logtarget, commport):
75
79
80
90
111
112
114 found=False
115 try:
116 s=self.getfilecontents('brew/version.txt')
117 if s[:5]==self.my_model:
118 found=True
119 res['model']=self.my_model
120 res['manufacturer']='LG Electronics Inc'
121 res['esn'] = self.get_brew_esn()
122 except:
123 pass
124 return
125
126 my_model='LX260'
127
128 parentprofile=com_lgvx4400.Profile
130 protocolclass=Phone.protocolclass
131 serialsname=Phone.serialsname
132 phone_manufacturer='LG Electronics Inc'
133 phone_model='LX260'
134
135 WALLPAPER_WIDTH=120
136 WALLPAPER_HEIGHT=131
137 MAX_WALLPAPER_BASENAME_LENGTH=32
138 WALLPAPER_FILENAME_CHARS="_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 ."
139 WALLPAPER_CONVERT_FORMAT="bmp"
140
141 MAX_RINGTONE_BASENAME_LENGTH=32
142 RINGTONE_FILENAME_CHARS="_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 ."
143
144
145 imageorigins={}
146 imageorigins.update(common.getkv(parentprofile.stockimageorigins, "images"))
147 imageorigins.update(common.getkv(parentprofile.stockimageorigins, "mms"))
148 imageorigins.update(common.getkv(parentprofile.stockimageorigins, "drm"))
151
152 ringtoneorigins=('ringers', 'mms', 'drm')
153 excluded_ringtone_origins=('mms', 'drm')
154 excluded_wallpaper_origins=('mms', 'drm')
155
156
157 imagetargets={}
158 imagetargets.update(common.getkv(parentprofile.stockimagetargets, "wallpaper",
159 {'width': 120, 'height': 131, 'format': "BMP"}))
160
163
164 _supportedsyncs=(
165 ('sms', 'read', None),
166 ('sms', 'write', 'OVERWRITE'),
167 ('phonebook', 'read', None),
168 ('phonebook', 'write', 'OVERWRITE'),
169 ('calendar', 'write', 'OVERWRITE'),
170 ('calendar', 'read', None),
171 ('wallpaper', 'read', None),
172 ('wallpaper', 'write', 'MERGE'),
173 ('wallpaper', 'write', 'OVERWRITE'),
174 ('ringtone', 'read', None),
175 ('ringtone', 'write', 'MERGE'),
176 ('ringtone', 'write', 'OVERWRITE'),
177 ('memo', 'read', None),
178 ('memo', 'write', 'OVERWRITE'),
179 ('call_history', 'read', None),
180 )
181
184