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

Source Code for Module phones.com_lgvx8800

  1  #!/usr/bin/env python 
  2   
  3  ### BITPIM 
  4  ### 
  5  ### Copyright (C) 2007 Nathan Hjelm <hjelmn@users.sourceforge.net> 
  6  ### 
  7  ### This program is free software; you can redistribute it and/or modify 
  8  ### it under the terms of the BitPim license as detailed in the LICENSE file. 
  9  ### $Id: com_lgvx8800.py 4671 2008-08-11 21:20:21Z djpham $ 
 10   
 11   
 12  """ 
 13  Communicate with the LG VX8800 cell phone. 
 14  """ 
 15   
 16  # BitPim modules 
 17  import common 
 18  import com_brew 
 19  import prototypes 
 20  import com_lgvx8550 
 21  import p_lgvx8800 
 22  import helpids 
 23   
 24  #------------------------------------------------------------------------------- 
 25  parentphone=com_lgvx8550.Phone 
26 -class Phone(parentphone):
27 desc="LG-VX8800" 28 helpid=helpids.ID_PHONE_LGVX8800 29 protocolclass=p_lgvx8800 30 serialsname='lgvx8800' 31 32 my_model='VX8800' 33 34 builtinringtones= ('Low Beep Once', 'Low Beeps', 'Loud Beep Once', 'Loud Beeps', 'Door Bell', 'VZW Default Ringtone') + \ 35 tuple(['Ringtone '+`n` for n in range(1,20)]) + \ 36 ('No Ring',) 37
38 - def setDMversion(self):
39 self._DMv6=True 40 self._DMv5=False 41 self._timeout=5 # The Voyager/Venus time out fast
42 43 # Fundamentals: 44 # - get_esn - same as LG VX-8300 45 # - getgroups - same as LG VX-8700 46 # - getwallpaperindices - LGUncountedIndexedMedia 47 # - getringtoneindices - LGUncountedIndexedMedia 48 # - DM Version - 5 49 # - phonebook - same as LG VX-8550 50
51 - def _readsms(self):
52 res={} 53 # The Voyager and Venus use index files to keep track of SMS messages 54 for item in self.getindex(self.protocolclass.drafts_index): 55 buf=prototypes.buffer(self.getfilecontents(item.filename, True)) 56 self.logdata("SMS message file " +item.filename, buf.getdata()) 57 sf=self.protocolclass.sms_saved() 58 sf.readfrombuffer(buf, logtitle="SMS saved item") 59 entry=self._getoutboxmessage(sf.outbox) 60 entry.folder=entry.Folder_Saved 61 res[entry.id]=entry 62 for item in self.getindex(self.protocolclass.inbox_index): 63 buf=prototypes.buffer(self.getfilecontents(item.filename, True)) 64 self.logdata("SMS message file " +item.filename, buf.getdata()) 65 sf=self.protocolclass.sms_in() 66 sf.readfrombuffer(buf, logtitle="SMS inbox item") 67 entry=self._getinboxmessage(sf) 68 res[entry.id]=entry 69 for item in self.getindex(self.protocolclass.outbox_index): 70 buf=prototypes.buffer(self.getfilecontents(item.filename, True)) 71 self.logdata("SMS message file " +item.filename, buf.getdata()) 72 sf=self.protocolclass.sms_out() 73 sf.readfrombuffer(buf, logtitle="SMS sent item") 74 entry=self._getoutboxmessage(sf) 75 res[entry.id]=entry 76 return res
77
78 - def _scheduleextras(self, data, fwversion):
79 data.serial_number = '000000cc-00000000-00000000-' + fwversion 80 data.unknown3 = 0x00f9
81 82 #------------------------------------------------------------------------------- 83 parentprofile=com_lgvx8550.Profile
84 -class Profile(parentprofile):
85 protocolclass=Phone.protocolclass 86 serialsname=Phone.serialsname 87 88 BP_Calendar_Version=3 89 phone_manufacturer='LG Electronics Inc' 90 phone_model='VX8800' 91 # inside screen resoluation 92 WALLPAPER_WIDTH = 240 93 WALLPAPER_HEIGHT = 320 94 95 imageorigins={} 96 imageorigins.update(common.getkv(parentprofile.stockimageorigins, "images")) 97 imageorigins.update(common.getkv(parentprofile.stockimageorigins, "video")) 98 imageorigins.update(common.getkv(parentprofile.stockimageorigins, "images(sd)")) 99 imageorigins.update(common.getkv(parentprofile.stockimageorigins, "video(sd)")) 100 101 # our targets are the same for all origins 102 imagetargets={} 103 imagetargets.update(common.getkv(parentprofile.stockimagetargets, "fullscreen", 104 {'width': 240, 'height': 320, 'format': "JPEG"})) 105 imagetargets.update(common.getkv(parentprofile.stockimagetargets, "wallpaper", 106 {'width': 240, 'height': 496, 'format': "JPEG"})) 107 imagetargets.update(common.getkv(parentprofile.stockimagetargets, "pictureid", 108 {'width': 120, 'height': 100, 'format': "JPEG"})) 109 110 _supportedsyncs=( 111 ('phonebook', 'read', None), # all phonebook reading 112 ('calendar', 'read', None), # all calendar reading 113 ('wallpaper', 'read', None), # all wallpaper reading 114 ('ringtone', 'read', None), # all ringtone reading 115 ('call_history', 'read', None),# all call history list reading 116 ('sms', 'read', None), # all SMS list reading 117 ('memo', 'read', None), # all memo list reading 118 ('phonebook', 'write', 'OVERWRITE'), # only overwriting phonebook 119 ('calendar', 'write', 'OVERWRITE'), # only overwriting calendar 120 ('wallpaper', 'write', 'MERGE'), # merge and overwrite wallpaper 121 ('wallpaper', 'write', 'OVERWRITE'), 122 ('ringtone', 'write', 'MERGE'), # merge and overwrite ringtone 123 ('ringtone', 'write', 'OVERWRITE'), 124 ('sms', 'write', 'OVERWRITE'), # all SMS list writing 125 ('memo', 'write', 'OVERWRITE'), # all memo list writing 126 ## ('playlist', 'read', 'OVERWRITE'), 127 ## ('playlist', 'write', 'OVERWRITE'), 128 ('t9_udb', 'write', 'OVERWRITE'), 129 ) 130 if __debug__: 131 _supportedsyncs+=( 132 ('t9_udb', 'read', 'OVERWRITE'), 133 )
134