Package phones ::
Module com_sanyo8300
|
|
1
2
3
4
5
6
7
8
9
10 """Talk to the Sanyo SCP-8300 cell phone"""
11
12 import re
13 import time
14 import sha
15
16
17 import common
18 import p_brew
19 import p_sanyo8300
20 import com_brew
21 import com_phone
22 import com_sanyo
23 import com_sanyomedia
24 import com_sanyonewer
25 import prototypes
26 import bpcalendar
27
28 numbertypetab=( 'cell', 'home', 'office', 'pager',
29 'fax', 'data', 'none' )
30
31 -class Phone(com_sanyonewer.Phone):
32 "Talk to the Sanyo PM8300 cell phone"
33
34 desc="PM8300"
35
36 FIRST_MEDIA_DIRECTORY=1
37 LAST_MEDIA_DIRECTORY=3
38
39 imagelocations=(
40
41 )
42
43 protocolclass=p_sanyo8300
44 serialsname='mm8300'
45
46 builtinringtones=( 'None', 'Vibrate', '', '', '', '', '', '', '',
47 'Tone 1', 'Tone 2', 'Tone 3', 'Tone 4', 'Tone 5',
48 'Tone 6', 'Tone 7', 'Tone 8', '', '', '', '', '',
49 '', '', '', '',
50 'Requiem:Dies Irae', 'Minute Waltz',
51 'Hungarian Dance', 'Miltary March', 'Ten Little Indians',
52 'Head,Shoulders,Knees&Toes', 'The Moment', 'Asian Jingle',
53 'Kung-fu','','','','','','','','','','','','','','','','','',
54 '','','','','','',
55 'Voice Alarm')
56
57
58
59
60
61
62
63
64
65
66
67
68 calendar_defaultringtone=0
69 calendar_defaultcaringtone=0
70 calendar_toneoffset=734
71 calendar_tonerange=xrange(744,794)
72
73 - def __init__(self, logtarget, commport):
77
79 req=p_brew.firmwarerequest()
80 respc=p_brew.testing0cresponse
81
82 for baud in 0, 38400,115200:
83 if baud:
84 if not self.comm.setbaudrate(baud):
85 continue
86 try:
87 self.sendbrewcommand(req, respc, callsetmode=False)
88 return True
89 except com_phone.modeignoreerrortypes:
90 pass
91
92
93 for baud in (0, 115200, 19200, 230400):
94 if baud:
95 if not self.comm.setbaudrate(baud):
96 continue
97 print "Baud="+`baud`
98
99 try:
100 self.comm.write("AT$QCDMG\r\n")
101 except:
102
103 self.mode=self.MODENONE
104 self.comm.shouldloop=True
105 raise
106 try:
107
108 if self.comm.readsome().find("OK")>=0:
109 break
110 except com_phone.modeignoreerrortypes:
111 self.log("No response to setting QCDMG mode")
112
113
114 for baud in 0,38400,115200:
115 if baud:
116 if not self.comm.setbaudrate(baud):
117 continue
118 try:
119 self.sendbrewcommand(req, respc, callsetmode=False)
120 return True
121 except com_phone.modeignoreerrortypes:
122 pass
123 return False
124
135
136 -class Profile(com_sanyonewer.Profile):
150