Package phones ::
Module com_lgvx8300
|
|
1
2
3
4
5
6
7
8
9 """Communicate with the LG VX8300 cell phone
10
11
12 The code in this file mainly inherits from VX8100 code and then extends where
13 the 8300 has different functionality
14
15 """
16
17
18 import time
19 import cStringIO
20 import sha
21
22
23 import common
24 import commport
25 import copy
26 import com_lgvx4400
27 import p_brew
28 import p_lgvx8300
29 import com_lgvx8100
30 import com_brew
31 import com_phone
32 import com_lg
33 import prototypes
34 import bpcalendar
35 import call_history
36 import sms
37 import memo
38 import fileinfo
39 import helpids
40
41 -class Phone(com_lg.LGUncountedIndexedMedia, com_lgvx8100.Phone):
42 "Talk to the LG VX8300 cell phone"
43
44 desc="LG-VX8300"
45 helpid=helpids.ID_PHONE_LGVX8300
46 protocolclass=p_lgvx8300
47 serialsname='lgvx8300'
48
49 external_storage_root='mmc1/'
50
51 builtinringtones= ('Low Beep Once', 'Low Beeps', 'Loud Beep Once', 'Loud Beeps', 'VZW Default Ringtone') + \
52 tuple(['Ringtone '+`n` for n in range(1,11)]) + \
53 ('No Ring',)
54
55 ringtonelocations= (
56
57 ( 'ringers', 'dload/myringtone.dat','brew/16452/lk/mr','mmc1/ringers', 100, 0x01, None),
58 ( 'sounds', 'dload/mysound.dat', 'brew/16452/ms', '', 100, 0x02, None),
59 ( 'mp3', 'dload/my_mp3.dat', 'mmc1/my_mp3', '', 100, 0x15, None),
60
61 )
62
63 calendarlocation="sch/schedule.dat"
64 calendarexceptionlocation="sch/schexception.dat"
65 calenderrequiresreboot=1
66 memolocation="sch/memo.dat"
67
68 builtinwallpapers = ()
69
70 wallpaperlocations= (
71
72 ( 'images', 'dload/image.dat', 'brew/16452/mp', '', 100, 0x00, None),
73 ( 'images(sd)', 'dload/sd_image.dat', 'mmc1/my_pix', '', 100, 0x10, None),
74 ( 'video', 'dload/video.dat', 'brew/16452/mf', '', 100, 0x03, None),
75 ( 'video(sd)', 'dload/sd_video.dat', 'mmc1/my_flix', '', 100, 0x13, None),
76 )
77
78 - def __init__(self, logtarget, commport):
82
86
88 _fw_version=self.get_firmware_version()[-1]
89
90 self._DMv5=self.my_model=='VX8300' and _fw_version>'3'
91 if self._DMv5:
92
93 self._timeout = 30
94
98
99 my_model='VX8300'
100
101
102
103
104
105
106
107
108 parentprofile=com_lgvx8100.Profile
110 protocolclass=Phone.protocolclass
111 serialsname=Phone.serialsname
112
113 BP_Calendar_Version=3
114 phone_manufacturer='LG Electronics Inc'
115 phone_model='VX8300'
116
117 WALLPAPER_WIDTH=275
118 WALLPAPER_HEIGHT=175
119 MAX_WALLPAPER_BASENAME_LENGTH=32
120 WALLPAPER_FILENAME_CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_() ."
121 WALLPAPER_CONVERT_FORMAT="jpg"
122
123
124 DIALSTRING_CHARS="[^0-9PW#*]"
125
126 MAX_RINGTONE_BASENAME_LENGTH=32
127 RINGTONE_FILENAME_CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_() ."
128
129 imageorigins={}
130 imageorigins.update(common.getkv(parentprofile.stockimageorigins, "images"))
131 imageorigins.update(common.getkv(parentprofile.stockimageorigins, "video"))
132 imageorigins.update(common.getkv(parentprofile.stockimageorigins, "images(sd)"))
133 imageorigins.update(common.getkv(parentprofile.stockimageorigins, "video(sd)"))
136
137 ringtoneorigins=('ringers', 'sounds', 'mp3')
138 excluded_ringtone_origins=('sounds', 'mp3')
139
140
141 imagetargets={}
142 imagetargets.update(common.getkv(parentprofile.stockimagetargets, "wallpaper",
143 {'width': 176, 'height': 184, 'format': "JPEG"}))
144 imagetargets.update(common.getkv(parentprofile.stockimagetargets, "outsidelcd",
145 {'width': 96, 'height': 81, 'format': "JPEG"}))
146
149
150 - def QueryAudio(self, origin, currentextension, afi):
151
152 if afi.format in ("MIDI", "QCP", "PMD", "WMA"):
153 return currentextension, afi
154
155 if afi.format=="MP3":
156 if afi.channels==1 and 8<=afi.bitrate<=64 and 16000<=afi.samplerate<=22050:
157 return currentextension, afi
158
159 return ("mp3", fileinfo.AudioFileInfo(afi, **{'format': 'MP3', 'channels': 1, 'bitrate': 32, 'samplerate': 22050}))
160
163
164 _supportedsyncs=(
165 ('phonebook', 'read', None),
166 ('calendar', 'read', None),
167 ('wallpaper', 'read', None),
168 ('ringtone', 'read', None),
169 ('call_history', 'read', None),
170 ('sms', 'read', None),
171 ('memo', 'read', None),
172 ('phonebook', 'write', 'OVERWRITE'),
173 ('calendar', 'write', 'OVERWRITE'),
174 ('wallpaper', 'write', 'MERGE'),
175 ('wallpaper', 'write', 'OVERWRITE'),
176 ('ringtone', 'write', 'MERGE'),
177 ('ringtone', 'write', 'OVERWRITE'),
178 ('sms', 'write', 'OVERWRITE'),
179 ('memo', 'write', 'OVERWRITE'),
180 )
181
182 field_color_data={
183 'phonebook': {
184 'name': {
185 'first': 1, 'middle': 1, 'last': 1, 'full': 1,
186 'nickname': 0, 'details': 1 },
187 'number': {
188 'type': 5, 'speeddial': 5, 'number': 5, 'details': 5 },
189 'email': 2,
190 'address': {
191 'type': 0, 'company': 0, 'street': 0, 'street2': 0,
192 'city': 0, 'state': 0, 'postalcode': 0, 'country': 0,
193 'details': 0 },
194 'url': 0,
195 'memo': 0,
196 'category': 1,
197 'wallpaper': 0,
198 'ringtone': 2,
199 'storage': 0,
200 },
201 'calendar': {
202 'description': True, 'location': False, 'allday': False,
203 'start': True, 'end': True, 'priority': False,
204 'alarm': True, 'vibrate': True,
205 'repeat': True,
206 'memo': False,
207 'category': False,
208 'wallpaper': False,
209 'ringtone': True,
210 },
211 'memo': {
212 'subject': True,
213 'date': True,
214 'secret': False,
215 'category': False,
216 'memo': True,
217 },
218 'todo': {
219 'summary': False,
220 'status': False,
221 'due_date': False,
222 'percent_complete': False,
223 'completion_date': False,
224 'private': False,
225 'priority': False,
226 'category': False,
227 'memo': False,
228 },
229 }
230