0001 #!/usr/bin/env python 0002 0003 ### BITPIM 0004 ### 0005 ### Copyright (C) 2007 Nathan Hjelm <hjelmn@users.sourceforge.net> 0006 ### 0007 ### This program is free software; you can redistribute it and/or modify 0008 ### it under the terms of the BitPim license as detailed in the LICENSE file. 0009 ### $Id: com_lgvx8800.py 4671 2008-08-11 21:20:21Z djpham $ 0010 0011 0012 """ 0013 Communicate with the LG VX8800 cell phone. 0014 """ 0015 0016 # BitPim modules 0017 import common 0018 import com_brew 0019 import prototypes 0020 import com_lgvx8550 0021 import p_lgvx8800 0022 import helpids 0023 0024 #------------------------------------------------------------------------------- 0025 parentphone=com_lgvx8550.Phone 0026 class Phone(parentphone): 0027 desc="LG-VX8800" 0028 helpid=helpids.ID_PHONE_LGVX8800 0029 protocolclass=p_lgvx8800 0030 serialsname='lgvx8800' 0031 0032 my_model='VX8800' 0033 0034 builtinringtones= ('Low Beep Once', 'Low Beeps', 'Loud Beep Once', 'Loud Beeps', 'Door Bell', 'VZW Default Ringtone') + \ 0035 tuple(['Ringtone '+`n` for n in range(1,20)]) + \ 0036 ('No Ring',) 0037 0038 def setDMversion(self): 0039 self._DMv6=True 0040 self._DMv5=False 0041 self._timeout=5 # The Voyager/Venus time out fast 0042 0043 # Fundamentals: 0044 # - get_esn - same as LG VX-8300 0045 # - getgroups - same as LG VX-8700 0046 # - getwallpaperindices - LGUncountedIndexedMedia 0047 # - getringtoneindices - LGUncountedIndexedMedia 0048 # - DM Version - 5 0049 # - phonebook - same as LG VX-8550 0050 0051 def _readsms(self): 0052 res={} 0053 # The Voyager and Venus use index files to keep track of SMS messages 0054 for item in self.getindex(self.protocolclass.drafts_index): 0055 buf=prototypes.buffer(self.getfilecontents(item.filename, True)) 0056 self.logdata("SMS message file " +item.filename, buf.getdata()) 0057 sf=self.protocolclass.sms_saved() 0058 sf.readfrombuffer(buf, logtitle="SMS saved item") 0059 entry=self._getoutboxmessage(sf.outbox) 0060 entry.folder=entry.Folder_Saved 0061 res[entry.id]=entry 0062 for item in self.getindex(self.protocolclass.inbox_index): 0063 buf=prototypes.buffer(self.getfilecontents(item.filename, True)) 0064 self.logdata("SMS message file " +item.filename, buf.getdata()) 0065 sf=self.protocolclass.sms_in() 0066 sf.readfrombuffer(buf, logtitle="SMS inbox item") 0067 entry=self._getinboxmessage(sf) 0068 res[entry.id]=entry 0069 for item in self.getindex(self.protocolclass.outbox_index): 0070 buf=prototypes.buffer(self.getfilecontents(item.filename, True)) 0071 self.logdata("SMS message file " +item.filename, buf.getdata()) 0072 sf=self.protocolclass.sms_out() 0073 sf.readfrombuffer(buf, logtitle="SMS sent item") 0074 entry=self._getoutboxmessage(sf) 0075 res[entry.id]=entry 0076 return res 0077 0078 def _scheduleextras(self, data, fwversion): 0079 data.serial_number = '000000cc-00000000-00000000-' + fwversion 0080 data.unknown3 = 0x00f9 0081 0082 #------------------------------------------------------------------------------- 0083 parentprofile=com_lgvx8550.Profile 0084 class Profile(parentprofile): 0085 protocolclass=Phone.protocolclass 0086 serialsname=Phone.serialsname 0087 0088 BP_Calendar_Version=3 0089 phone_manufacturer='LG Electronics Inc' 0090 phone_model='VX8800' 0091 # inside screen resoluation 0092 WALLPAPER_WIDTH = 240 0093 WALLPAPER_HEIGHT = 320 0094 0095 imageorigins={} 0096 imageorigins.update(common.getkv(parentprofile.stockimageorigins, "images")) 0097 imageorigins.update(common.getkv(parentprofile.stockimageorigins, "video")) 0098 imageorigins.update(common.getkv(parentprofile.stockimageorigins, "images(sd)")) 0099 imageorigins.update(common.getkv(parentprofile.stockimageorigins, "video(sd)")) 0100 0101 # our targets are the same for all origins 0102 imagetargets={} 0103 imagetargets.update(common.getkv(parentprofile.stockimagetargets, "fullscreen", 0104 {'width': 240, 'height': 320, 'format': "JPEG"})) 0105 imagetargets.update(common.getkv(parentprofile.stockimagetargets, "wallpaper", 0106 {'width': 240, 'height': 496, 'format': "JPEG"})) 0107 imagetargets.update(common.getkv(parentprofile.stockimagetargets, "pictureid", 0108 {'width': 120, 'height': 100, 'format': "JPEG"})) 0109 0110 _supportedsyncs=( 0111 ('phonebook', 'read', None), # all phonebook reading 0112 ('calendar', 'read', None), # all calendar reading 0113 ('wallpaper', 'read', None), # all wallpaper reading 0114 ('ringtone', 'read', None), # all ringtone reading 0115 ('call_history', 'read', None),# all call history list reading 0116 ('sms', 'read', None), # all SMS list reading 0117 ('memo', 'read', None), # all memo list reading 0118 ('phonebook', 'write', 'OVERWRITE'), # only overwriting phonebook 0119 ('calendar', 'write', 'OVERWRITE'), # only overwriting calendar 0120 ('wallpaper', 'write', 'MERGE'), # merge and overwrite wallpaper 0121 ('wallpaper', 'write', 'OVERWRITE'), 0122 ('ringtone', 'write', 'MERGE'), # merge and overwrite ringtone 0123 ('ringtone', 'write', 'OVERWRITE'), 0124 ('sms', 'write', 'OVERWRITE'), # all SMS list writing 0125 ('memo', 'write', 'OVERWRITE'), # all memo list writing 0126 ## ('playlist', 'read', 'OVERWRITE'), 0127 ## ('playlist', 'write', 'OVERWRITE'), 0128 ('t9_udb', 'write', 'OVERWRITE'), 0129 ) 0130 if __debug__: 0131 _supportedsyncs+=( 0132 ('t9_udb', 'read', 'OVERWRITE'), 0133 ) 0134
Generated by PyXR 0.9.4