PyXR

c:\projects\bitpim\src \ phones \ com_lgvi5225.py



0001 ### BITPIM
0002 ###
0003 ### Copyright (C) 2006 Stephen A. Wood <sawecw@users.sf.net>
0004 ###
0005 ### This program is free software; you can redistribute it and/or modify
0006 ### it under the terms of the BitPim license as detailed in the LICENSE file.
0007 ###
0008 ### $Id: com_lgvi5225.py 3918 2007-01-19 05:15:12Z djpham $
0009 
0010 """Communicate with the LG VI5225 cell phone
0011 
0012 Also known as the LG-VX5400.  Operates on STI-Mobile, a virtual carrier
0013 reselling Sprint airtime.
0014 """
0015 
0016 # standard modules
0017 import time
0018 import cStringIO
0019 import sha
0020 
0021 # my modules
0022 import common
0023 import copy
0024 import p_lgvi5225
0025 import com_lgvx4400
0026 import com_brew
0027 import com_phone
0028 import com_lg
0029 import prototypes
0030 
0031 class Phone(com_lgvx4400.Phone):
0032     "Talk to the LG VI5225 cell phone"
0033 
0034     desc="LG-VI5225"
0035     helpid=None
0036     protocolclass=p_lgvi5225
0037     serialsname='lgvi5225'
0038 
0039     # more VI5225 indices
0040     imagelocations=(
0041         # offset, index file, files location, type, maximumentries
0042         ( 10, "download/dloadindex/brewImageIndex.map", "brew/shared", "images", 30) ,
0043         ( 0xc8, "download/dloadindex/mmsImageIndex.map", "brew/shared/mms", "mms", 20),
0044         ( 0xdc, "download/dloadindex/mmsDrmImageIndex.map", "brew/shared/mms/d", "drm", 20), 
0045         )
0046 
0047     ringtonelocations=(
0048         # offset, index file, files location, type, maximumentries
0049         ( 50, "download/dloadindex/brewRingerIndex.map", "user/sound/ringer", "ringers", 30),
0050         ( 150, "download/dloadindex/mmsRingerIndex.map", "mms/sound", "mms", 20),
0051         ( 180, "download/dloadindex/mmsDrmRingerIndex.map", "mms/sound/drm", "drm", 20)
0052         )
0053 
0054     builtinimages= ('Beach Ball', 'Towerbridge', 'Sunflower', 'Beach', 'Fish', 
0055                     'Sea', 'Snowman')
0056 
0057     builtinringtones= ('Ring 1', 'Ring 2', 'Ring 3', 'Ring 4', 'Ring 5', 'Ring 6',
0058                        'Annen Polka', 'Beethoven Symphony No. 9', 'Pachelbel Canon', 
0059                        'Hallelujah', 'La Traviata', 'Leichte Kavallerie Overture', 
0060                        'Mozart Symphony No.40', 'Bach Minuet', 'Farewell', 
0061                        'Mozart Piano Sonata', 'Sting', 'Trout', 'Pineapple Rag', 
0062                        'Latin', 'Carol')
0063                        
0064     
0065     def __init__(self, logtarget, commport):
0066         com_lgvx4400.Phone.__init__(self,logtarget,commport)
0067         self.mode=self.MODENONE
0068 
0069 #    def getfundamentals(self, results):
0070 #        """Do some test reads."""
0071 
0072 
0073     def eval_detect_data(self, res):
0074         found=False
0075         if res.get(self.brew_version_txt_key, None) is not None:
0076             found=res[self.brew_version_txt_key][:len(self.my_version_txt)]==self.my_version_txt
0077         if found:
0078             res['model']=self.my_model
0079             res['manufacturer']='LG Electronics Inc'
0080             s=res.get(self.esn_file_key, None)
0081             if s:
0082                 res['esn']=self.get_esn(s)
0083 
0084 
0085     my_version_txt='AX545V'
0086     my_model='VI5225'
0087 
0088 parentprofile=com_lgvx4400.Profile
0089 class Profile(parentprofile):
0090     protocolclass=Phone.protocolclass
0091     serialsname=Phone.serialsname
0092     phone_manufacturer='LG Electronics Inc'
0093     phone_model='LG-LX5400V'
0094 
0095     usbids_straight=( ( 0x1004, 0x6000, 2), )# VID=LG Electronics, PID=LG VX4400/VX6000 -internal USB diagnostics interface
0096     usbids_usbtoserial=(
0097         ( 0x067b, 0x2303, None), # VID=Prolific, PID=USB to serial
0098         ( 0x0403, 0x6001, None), # VID=FTDI, PID=USB to serial
0099         ( 0x0731, 0x2003, None), # VID=Susteen, PID=Universal USB to serial
0100         ( 0x6547, 0x0232, None), # VID=ArkMicro, PID=USB to serial
0101         )
0102     usbids=usbids_straight+usbids_usbtoserial
0103 
0104     WALLPAPER_WIDTH=120
0105     WALLPAPER_HEIGHT=131
0106     MAX_WALLPAPER_BASENAME_LENGTH=32
0107     WALLPAPER_FILENAME_CHARS="_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 ."
0108     WALLPAPER_CONVERT_FORMAT="bmp"
0109    
0110     MAX_RINGTONE_BASENAME_LENGTH=32
0111     RINGTONE_FILENAME_CHARS="_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 ."
0112 
0113     # nb we don't allow save to camera so it isn't listed here
0114     imageorigins={}
0115     imageorigins.update(common.getkv(parentprofile.stockimageorigins, "images"))
0116     imageorigins.update(common.getkv(parentprofile.stockimageorigins, "mms"))
0117     imageorigins.update(common.getkv(parentprofile.stockimageorigins, "drm"))
0118     def GetImageOrigins(self):
0119         return self.imageorigins
0120 
0121     ringtoneorigins=('ringers', 'mms', 'drm')
0122     excluded_ringtone_origins=('mms', 'drm')
0123     excluded_wallpaper_origins=('mms', 'drm')
0124 
0125     # our targets are the same for all origins
0126     imagetargets={}
0127     imagetargets.update(common.getkv(parentprofile.stockimagetargets, "wallpaper",
0128                                       {'width': 120, 'height': 131, 'format': "BMP"}))
0129 
0130     def GetTargetsForImageOrigin(self, origin):
0131         return self.imagetargets
0132     
0133     _supportedsyncs=(
0134         #('sms', 'read', None),
0135         #('sms', 'write', 'OVERWRITE'),
0136         ('phonebook', 'read', None),  # all phonebook reading
0137         ('phonebook', 'write', 'OVERWRITE'),  # only overwriting phonebook
0138         #('calendar', 'write', 'OVERWRITE'),   # only overwriting calendar
0139         #('calendar', 'read', None),   # all calendar reading
0140         #('wallpaper', 'read', None),  # all wallpaper reading
0141         #('wallpaper', 'write', 'MERGE'),      # merge and overwrite wallpaper
0142         #('wallpaper', 'write', 'OVERWRITE'),
0143         #('ringtone', 'read', None),   # all ringtone reading
0144         #('ringtone', 'write', 'MERGE'),      # merge and overwrite ringtone
0145         #('ringtone', 'write', 'OVERWRITE'),
0146         #('memo', 'read', None),     # all memo list reading DJP
0147         #('memo', 'write', 'OVERWRITE'),  # all memo list writing DJP
0148         #('call_history', 'read', None),
0149        )
0150  
0151     def __init__(self):
0152         parentprofile.__init__(self)
0153 
0154 

Generated by PyXR 0.9.4