|
Package phones ::
Module p_etsi
|
|
1
2
3 """Various descriptions of data specific to GSM phones"""
4
5 from prototypes import *
6 from prototypeslg import *
7
8
9 UINT=UINTlsb
10 BOOL=BOOLlsb
11
13 __fields=['command']
14
23
24
27
28
44
45
46
47 - def writetobuffer(self,buf,autolog=True,logtitle="<written data>"):
48 'Writes this packet to the supplied buffer'
49 self._bufferstartoffset=buf.getcurrentoffset()
50 try: self.__field_command
51 except:
52 self.__field_command=USTRING(**{ 'terminator': None, 'default': 'E0V1' })
53 self.__field_command.writetobuffer(buf)
54 self._bufferendoffset=buf.getcurrentoffset()
55 if autolog and self._bufferstartoffset==0: self.autologwrite(buf, logtitle=logtitle)
56
57
59 'Reads this packet from the supplied buffer'
60 self._bufferstartoffset=buf.getcurrentoffset()
61 if autolog and self._bufferstartoffset==0: self.autologread(buf, logtitle=logtitle)
62 self.__field_command=USTRING(**{ 'terminator': None, 'default': 'E0V1' })
63 self.__field_command.readfrombuffer(buf)
64 self._bufferendoffset=buf.getcurrentoffset()
65
66
68 try: self.__field_command
69 except:
70 self.__field_command=USTRING(**{ 'terminator': None, 'default': 'E0V1' })
71 return self.__field_command.getvalue()
72
74 if isinstance(value,USTRING):
75 self.__field_command=value
76 else:
77 self.__field_command=USTRING(value,**{ 'terminator': None, 'default': 'E0V1' })
78
80
81 command=property(__getfield_command, __setfield_command, __delfield_command, None)
82
85
87 yield ('command', self.__field_command, None)
88
89
90
91
93 __fields=['command']
94
103
104
107
108
124
125
126
127 - def writetobuffer(self,buf,autolog=True,logtitle="<written data>"):
128 'Writes this packet to the supplied buffer'
129 self._bufferstartoffset=buf.getcurrentoffset()
130 try: self.__field_command
131 except:
132 self.__field_command=USTRING(**{ 'terminator': None, 'default': '+GSN' })
133 self.__field_command.writetobuffer(buf)
134 self._bufferendoffset=buf.getcurrentoffset()
135 if autolog and self._bufferstartoffset==0: self.autologwrite(buf, logtitle=logtitle)
136
137
139 'Reads this packet from the supplied buffer'
140 self._bufferstartoffset=buf.getcurrentoffset()
141 if autolog and self._bufferstartoffset==0: self.autologread(buf, logtitle=logtitle)
142 self.__field_command=USTRING(**{ 'terminator': None, 'default': '+GSN' })
143 self.__field_command.readfrombuffer(buf)
144 self._bufferendoffset=buf.getcurrentoffset()
145
146
148 try: self.__field_command
149 except:
150 self.__field_command=USTRING(**{ 'terminator': None, 'default': '+GSN' })
151 return self.__field_command.getvalue()
152
154 if isinstance(value,USTRING):
155 self.__field_command=value
156 else:
157 self.__field_command=USTRING(value,**{ 'terminator': None, 'default': '+GSN' })
158
160
161 command=property(__getfield_command, __setfield_command, __delfield_command, None)
162
165
167 yield ('command', self.__field_command, None)
168
169
170
171
173 __fields=['command', 'esn']
174
183
184
187
188
200
201
202
203 - def writetobuffer(self,buf,autolog=True,logtitle="<written data>"):
210
211
213 'Reads this packet from the supplied buffer'
214 self._bufferstartoffset=buf.getcurrentoffset()
215 if autolog and self._bufferstartoffset==0: self.autologread(buf, logtitle=logtitle)
216 self.__field_command=CSVSTRING(**{'quotechar': None, 'terminator': ord(' '), 'default': '+GSN'})
217 self.__field_command.readfrombuffer(buf)
218 self.__field_esn=CSVSTRING(**{'quotechar': None, 'terminator': None})
219 self.__field_esn.readfrombuffer(buf)
220 self._bufferendoffset=buf.getcurrentoffset()
221
222
224 return self.__field_command.getvalue()
225
227 if isinstance(value,CSVSTRING):
228 self.__field_command=value
229 else:
230 self.__field_command=CSVSTRING(value,**{'quotechar': None, 'terminator': ord(' '), 'default': '+GSN'})
231
233
234 command=property(__getfield_command, __setfield_command, __delfield_command, None)
235
238
240 if isinstance(value,CSVSTRING):
241 self.__field_esn=value
242 else:
243 self.__field_esn=CSVSTRING(value,**{'quotechar': None, 'terminator': None})
244
246
247 esn=property(__getfield_esn, __setfield_esn, __delfield_esn, None)
248
251
253 yield ('command', self.__field_command, None)
254 yield ('esn', self.__field_esn, None)
255
256
257
258