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

Source Code for Module phones.com_lgpm325

  1  ### BITPIM 
  2  ### 
  3  ### Copyright (C) 2005, 2006 Brent Roettger <broettge@msn.com> 
  4  ### 
  5  ### This program is free software; you can redistribute it and/or modify 
  6  ### it under the terms of the BitPim license as detailed in the LICENSE file. 
  7  ### 
  8  ### $Id: com_lgpm325.py 3918 2007-01-19 05:15:12Z djpham $ 
  9   
 10  """Communicate with the LG LX325/PM325 (Sprint) cell phone""" 
 11   
 12  # standard modules 
 13  import re 
 14  import time 
 15  import cStringIO 
 16  import sha 
 17   
 18  # my modules 
 19  import p_lgpm225 
 20  import p_lgpm325 
 21  import p_brew 
 22  import common 
 23  import commport 
 24  import com_brew 
 25  import com_phone 
 26  import com_lg 
 27  import com_lgpm225 
 28  import prototypes 
 29  import call_history 
 30  import sms 
 31  import fileinfo 
 32  import memo 
 33   
34 -class Phone(com_lgpm225.Phone):
35 "Talk to the LG LX325/PM325 cell phone" 36 37 desc="LG PM325" 38 helpid=None 39 protocolclass=p_lgpm325 40 serialsname='lgpm325' 41 42 # read only locations, for regular ringers/wallpaper this phone stores 43 # the information in a different location 44 imagelocations=( 45 # offset, index file, files location, type, maximumentries 46 (0x600, "setas/dcamIndex.map", "Dcam/Wallet", "camera", 50, 6), 47 ) 48 49 ringtonelocations=( 50 # offset, index file, files location, type, maximumentries 51 (0x1100, "setas/voicememoRingerIndex.map", "VoiceDB/All/Memos", "voice_memo", 50, 11), 52 ) 53 54 # builtinimages=('Starfish', 'Goldfish', 'Leaves', 'Bicycle', 'Speed', 55 # 'Autumn', 'Island', 'Winter', 'Bamboo', 'Yellow Flowers', 'Snow') 56 builtinimages=( ) 57 58 builtinringtones=( 'Tone 1', 'Tone 2', 'Tone 3', 'Tone 4', 'Tone 5', 'Tone 6', 59 'Alert 1', 'Alert 2', 'Alert 3', 'Alert 4', 'Alert 5', 'Alert 6', 60 'Jazztic', 'Rock & Roll', 'Grand Waltz', 'Toccata and Fugue', 61 'Sunday Afternoon', 'Bumble Bee', 'Circus Band', 'Cuckoo Waltz', 62 'Latin', 'CanCan', 'Play tag', 'Eine kleine Nachtmusik', 63 'Symphony No.25 in G Minor', 'Capriccio a minor', 'Moonlight', 64 'A Nameless Girl', 'From the New World', 'They Called Me Elvis') 65
66 - def __init__(self, logtarget, commport):
67 "Calls all the constructors and sets initial modes" 68 com_phone.Phone.__init__(self, logtarget, commport) 69 com_brew.BrewProtocol.__init__(self) 70 com_lg.LGPhonebook.__init__(self) 71 self.log("Attempting to contact phone") 72 self._cal_has_voice_id=hasattr(self.protocolclass, 'cal_has_voice_id') \ 73 and self.protocolclass.cal_has_voice_id 74 self.mode=self.MODENONE
75 76 77 #----- Phone Detection ----------------------------------------------------------- 78 79 brew_version_file='ams/version.txt' 80 brew_version_txt_key='ams_version.txt' 81 my_model='LX325' # AKA the PM325 from Sprint
82 83 #----- Profile Class ------------------------------------------------------------- 84 parentprofile=com_lgpm225.Profile
85 -class Profile(parentprofile):
86 protocolclass=Phone.protocolclass 87 serialsname=Phone.serialsname 88 BP_Calendar_Version=3 89 phone_manufacturer='LG Electronics Inc' 90 phone_model='LX325' # aka the PM325 from Sprint 91 brew_required=True 92 93 DIALSTRING_CHARS="[^0-9PT#*]" 94 95 96 _supportedsyncs=( 97 ('phonebook', 'read', None), # all phonebook reading 98 ('calendar', 'read', None), # all calendar reading 99 ('wallpaper', 'read', None), # all wallpaper reading 100 ('ringtone', 'read', None), # all ringtone reading 101 ('call_history', 'read', None),# all call history list reading 102 ('memo', 'read', None), # all memo list reading 103 ('sms', 'read', None), # all SMS list reading 104 ('phonebook', 'write', 'OVERWRITE'), # only overwriting phonebook 105 ('calendar', 'write', 'OVERWRITE'), # only overwriting calendar 106 ('wallpaper', 'write', 'MERGE'), # merge and overwrite wallpaper 107 ('wallpaper', 'write', 'OVERWRITE'), 108 ('ringtone', 'write', 'MERGE'), # merge and overwrite ringtone 109 ('ringtone', 'write', 'OVERWRITE'), 110 ('memo', 'write', 'OVERWRITE'), # all memo list writing 111 ('sms', 'write', 'OVERWRITE'), # all SMS list writing 112 )
113