0001 ### BITPIM 0002 ### 0003 ### Copyright (C) 2004-2005 Stephen Wood <saw@bitpim.org> 0004 ### Copyright (C) 2005 Todd Imboden 0005 ### 0006 ### This program is free software; you can redistribute it and/or modify 0007 ### it under the terms of the BitPim license as detailed in the LICENSE file. 0008 ### 0009 ### By Allan Slawik; based on code from com_samsungspha620.py, and 0010 ### com_samsungspha460.py by sawecw and djpham 0011 ### 0012 ### $Id:$ 0013 0014 """Communicate with a Samsung SPH-A640""" 0015 0016 import sha 0017 import re 0018 import struct 0019 0020 import common 0021 import commport 0022 import p_samsungspha640 0023 import p_brew 0024 import com_brew 0025 import com_phone 0026 import com_samsung_packet 0027 import com_samsungspha620 0028 import prototypes 0029 import fileinfo 0030 import helpids 0031 0032 numbertypetab=('home','cell','office','other','pager','none') 0033 0034 class Phone(com_samsungspha620.Phone): 0035 "Talk to a Samsung SPH-A640 phone" 0036 0037 desc="SPH-A640" 0038 helpid=helpids.ID_PHONE_SAMSUNGOTHERS 0039 protocolclass=p_samsungspha640 0040 serialsname='spha640' 0041 0042 # digital_cam/jpeg Remove first 128 characters 0043 0044 imagelocations=( 0045 # offset, index file, files location, origin, maximumentries, header offset 0046 # Offset is arbitrary. 100 is reserved for amsRegistry indexed files 0047 (400, "cam/dldJpeg", "camera", 100, 128), 0048 (300, "cam/jpeg", "camera", 100, 128), 0049 ) 0050 0051 ringtonelocations=( 0052 # offset, index file, files location, type, maximumentries, header offset 0053 ) 0054 0055 __audio_mimetype={ 'mid': 'audio/midi', 'qcp': 'audio/vnd.qcelp', 'pmd': 'application/x-pmd'} 0056 __image_mimetype={ 'jpg': 'image/jpg', 'jpeg': 'image/jpeg', 'gif': 'image/gif', 'bmp': 'image/bmp', 'png': 'image/png'} 0057 0058 def __init__(self, logtarget, commport): 0059 com_samsungspha620.Phone.__init__(self, logtarget, commport) 0060 self.numbertypetab=numbertypetab 0061 self.mode=self.MODENONE 0062 0063 parentprofile=com_samsungspha620.Profile 0064 class Profile(parentprofile): 0065 protocolclass=Phone.protocolclass 0066 serialsname=Phone.serialsname 0067 0068 MAX_RINGTONE_BASENAME_LENGTH=19 0069 RINGTONE_FILENAME_CHARS="abcdefghijklmnopqrstuvwxyz0123456789_ ." 0070 RINGTONE_LIMITS= { 0071 'MAXSIZE': 500000 0072 } 0073 phone_manufacturer='SAMSUNG' 0074 phone_model='SPH-A640/152' 0075 0076 def __init__(self): 0077 parentprofile.__init__(self) 0078 self.numbertypetab=numbertypetab 0079 0080 _supportedsyncs=( 0081 ('phonebook', 'read', None), # all phonebook reading 0082 # ('phonebook', 'write', 'OVERWRITE'), # only overwriting phonebook 0083 ('wallpaper', 'read', None), # all wallpaper reading 0084 ('wallpaper', 'write', None), # Image conversion needs work 0085 ('ringtone', 'read', None), # all ringtone reading 0086 ('ringtone', 'write', None), 0087 ('calendar', 'read', None), # all calendar reading 0088 ('calendar', 'write', 'OVERWRITE'), # only overwriting calendar 0089 ('todo', 'read', None), # all todo list reading 0090 ('todo', 'write', 'OVERWRITE'), # all todo list writing 0091 ('memo', 'read', None), # all memo list reading 0092 ('memo', 'write', 'OVERWRITE'), # all memo list writing 0093 ) 0094 0095
Generated by PyXR 0.9.4