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

Source Code for Module phones.com_samsungspha640

 1  ### BITPIM 
 2  ### 
 3  ### Copyright (C) 2004-2005 Stephen Wood <saw@bitpim.org> 
 4  ### Copyright (C) 2005 Todd Imboden 
 5  ### 
 6  ### This program is free software; you can redistribute it and/or modify 
 7  ### it under the terms of the BitPim license as detailed in the LICENSE file. 
 8  ### 
 9  ### By Allan Slawik; based on code from com_samsungspha620.py, and  
10  ### com_samsungspha460.py by sawecw and djpham 
11  ### 
12  ### $Id:$ 
13   
14  """Communicate with a Samsung SPH-A640""" 
15   
16  import sha 
17  import re 
18  import struct 
19   
20  import common 
21  import commport 
22  import p_samsungspha640 
23  import p_brew 
24  import com_brew 
25  import com_phone 
26  import com_samsung_packet 
27  import com_samsungspha620 
28  import prototypes 
29  import fileinfo 
30  import helpids 
31   
32  numbertypetab=('home','cell','office','other','pager','none') 
33   
34 -class Phone(com_samsungspha620.Phone):
35 "Talk to a Samsung SPH-A640 phone" 36 37 desc="SPH-A640" 38 helpid=helpids.ID_PHONE_SAMSUNGOTHERS 39 protocolclass=p_samsungspha640 40 serialsname='spha640' 41 42 # digital_cam/jpeg Remove first 128 characters 43 44 imagelocations=( 45 # offset, index file, files location, origin, maximumentries, header offset 46 # Offset is arbitrary. 100 is reserved for amsRegistry indexed files 47 (400, "cam/dldJpeg", "camera", 100, 128), 48 (300, "cam/jpeg", "camera", 100, 128), 49 ) 50 51 ringtonelocations=( 52 # offset, index file, files location, type, maximumentries, header offset 53 ) 54 55 __audio_mimetype={ 'mid': 'audio/midi', 'qcp': 'audio/vnd.qcelp', 'pmd': 'application/x-pmd'} 56 __image_mimetype={ 'jpg': 'image/jpg', 'jpeg': 'image/jpeg', 'gif': 'image/gif', 'bmp': 'image/bmp', 'png': 'image/png'} 57
58 - def __init__(self, logtarget, commport):
59 com_samsungspha620.Phone.__init__(self, logtarget, commport) 60 self.numbertypetab=numbertypetab 61 self.mode=self.MODENONE
62 63 parentprofile=com_samsungspha620.Profile
64 -class Profile(parentprofile):
65 protocolclass=Phone.protocolclass 66 serialsname=Phone.serialsname 67 68 MAX_RINGTONE_BASENAME_LENGTH=19 69 RINGTONE_FILENAME_CHARS="abcdefghijklmnopqrstuvwxyz0123456789_ ." 70 RINGTONE_LIMITS= { 71 'MAXSIZE': 500000 72 } 73 phone_manufacturer='SAMSUNG' 74 phone_model='SPH-A640/152' 75
76 - def __init__(self):
77 parentprofile.__init__(self) 78 self.numbertypetab=numbertypetab
79 80 _supportedsyncs=( 81 ('phonebook', 'read', None), # all phonebook reading 82 # ('phonebook', 'write', 'OVERWRITE'), # only overwriting phonebook 83 ('wallpaper', 'read', None), # all wallpaper reading 84 ('wallpaper', 'write', None), # Image conversion needs work 85 ('ringtone', 'read', None), # all ringtone reading 86 ('ringtone', 'write', None), 87 ('calendar', 'read', None), # all calendar reading 88 ('calendar', 'write', 'OVERWRITE'), # only overwriting calendar 89 ('todo', 'read', None), # all todo list reading 90 ('todo', 'write', 'OVERWRITE'), # all todo list writing 91 ('memo', 'read', None), # all memo list reading 92 ('memo', 'write', 'OVERWRITE'), # all memo list writing 93 )
94