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