PyXR

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



0001 ### BITPIM
0002 ###
0003 ### Copyright (C) 2006 Joe Pham <djpham@bitpim.org>
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_lgvx9900.py 4305 2007-07-16 04:05:25Z djpham $
0009 
0010 """
0011 Communicate with the LG VX9900 cell phone, which is a cross between the
0012 VX9800 and the VX8500
0013 """
0014 
0015 # BitPim modules
0016 import common
0017 import com_lg
0018 import com_lgvx9800
0019 import p_lgvx9900
0020 import helpids
0021 
0022 #-------------------------------------------------------------------------------
0023 parentphone=com_lgvx9800.Phone
0024 class Phone(com_lg.LGUncountedIndexedMedia, parentphone):
0025     "Talk to the LG VX9900 cell phone"
0026 
0027     desc="LG-VX9900"
0028     helpid=helpids.ID_PHONE_LGVX9900
0029     protocolclass=p_lgvx9900
0030     serialsname='lgvx9900'
0031     my_model='VX9900'
0032 
0033     # rintones and wallpaper info, copy from VX8500, may need to change to match
0034     # what the phone actually has
0035     external_storage_root='mmc1/'
0036     builtinringtones= ('Low Beep Once', 'Low Beeps', 'Loud Beep Once', 'Loud Beeps', 'VZW Default Ringtone') + \
0037                       tuple(['Ringtone '+`n` for n in range(1,13)]) + \
0038                       ('No Ring',)
0039 
0040     ringtonelocations= (
0041         #  type          index file            default dir        external dir    max  type Index
0042         ( 'ringers',    'dload/myringtone.dat','brew/16452/lk/mr','mmc1/ringers', 100, 0x01, 100),
0043         ( 'sounds',     'dload/mysound.dat',   'brew/16452/ms',   '',             100, 0x02, None),
0044         ( 'sounds(sd)', 'dload/sd_sound.dat',  'mmc1/my_sounds',  '',             100, 0x02, None),
0045         ( 'music',      'dload/efs_music.dat', 'my_music',        '',             100, 0x104, None),
0046         ( 'music(sd)',  'dload/sd_music.dat',  'mmc1/my_music',   '',             100, 0x14, None),
0047         )
0048 
0049     wallpaperlocations= (
0050         #  type          index file            default dir     external dir  max  type Index
0051         ( 'images',     'dload/image.dat',    'brew/16452/mp', '',           100, 0x00, 100),
0052         ( 'images(sd)', 'dload/sd_image.dat', 'mmc1/my_pix',   '',           100, 0x10, None),
0053         ( 'video',      'dload/video.dat',    'brew/16452/mf', '',           100, 0x03, None),
0054         ( 'video(sd)',  'dload/sd_video.dat', 'mmc1/my_flix',  '',           100, 0x13, None),
0055         )
0056 
0057     def __init__(self, logtarget, commport):
0058         parentphone.__init__(self, logtarget, commport)
0059 
0060     def setDMversion(self):
0061         _fw_version=self.get_firmware_version()[-1]
0062         # T99VZV02 uses DMv5
0063         self._DMv5=self.my_model=='VX9900' and _fw_version>'1'
0064 
0065     # Fundamentals:
0066     #  - get_esn             - same as LG VX-8300
0067     #  - getgroups           - same as LG VX-8100
0068     #  - getwallpaperindices - LGUncountedIndexedMedia
0069     #  - getrintoneindices   - LGUncountedIndexedMedia
0070     #  - DM Version          - T99VZV01: N/A, T99VZV02: 5
0071         
0072 #-------------------------------------------------------------------------------
0073 parentprofile=com_lgvx9800.Profile
0074 class Profile(parentprofile):
0075     protocolclass=Phone.protocolclass
0076     serialsname=Phone.serialsname
0077 
0078     BP_Calendar_Version=3
0079     phone_manufacturer='LG Electronics Inc'
0080     phone_model='VX9900'
0081 
0082     WALLPAPER_WIDTH=320
0083     WALLPAPER_HEIGHT=256
0084 
0085     imageorigins={}
0086     imageorigins.update(common.getkv(parentprofile.stockimageorigins, "images"))
0087     imageorigins.update(common.getkv(parentprofile.stockimageorigins, "video"))
0088     imageorigins.update(common.getkv(parentprofile.stockimageorigins, "images(sd)"))
0089     imageorigins.update(common.getkv(parentprofile.stockimageorigins, "video(sd)"))
0090     def GetImageOrigins(self):
0091         return self.imageorigins
0092 
0093 
0094     ringtoneorigins=('ringers', 'sounds', 'sounds(sd)',' music', 'music(sd)')
0095     excluded_ringtone_origins=('sounds', 'sounds(sd)', 'music', 'music(sd)')
0096 
0097     # our targets are the same for all origins
0098     imagetargets={}
0099     imagetargets.update(common.getkv(parentprofile.stockimagetargets, "wallpaper",
0100                                       {'width': 320, 'height': 204, 'format': "JPEG"}))
0101     imagetargets.update(common.getkv(parentprofile.stockimagetargets, "outsidelcd",
0102                                       {'width': 160, 'height': 99, 'format': "JPEG"}))
0103 
0104     def GetTargetsForImageOrigin(self, origin):
0105         return self.imagetargets
0106 
0107     _supportedsyncs=(
0108         ('phonebook', 'read', None),   # all phonebook reading
0109         ('calendar', 'read', None),    # all calendar reading
0110         ('wallpaper', 'read', None),   # all wallpaper reading
0111         ('ringtone', 'read', None),    # all ringtone reading
0112         ('call_history', 'read', None),# all call history list reading
0113         ('sms', 'read', None),         # all SMS list reading
0114         ('memo', 'read', None),        # all memo list reading
0115         ('phonebook', 'write', 'OVERWRITE'),  # only overwriting phonebook
0116         ('calendar', 'write', 'OVERWRITE'),   # only overwriting calendar
0117         ('wallpaper', 'write', 'MERGE'),      # merge and overwrite wallpaper
0118         ('wallpaper', 'write', 'OVERWRITE'),
0119         ('ringtone', 'write', 'MERGE'),       # merge and overwrite ringtone
0120         ('ringtone', 'write', 'OVERWRITE'),
0121 ##        ('sms', 'write', 'OVERWRITE'),        # all SMS list writing
0122         ('memo', 'write', 'OVERWRITE'),       # all memo list writing
0123 ##        ('playlist', 'read', 'OVERWRITE'),
0124 ##        ('playlist', 'write', 'OVERWRITE'),
0125         )
0126 

Generated by PyXR 0.9.4