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

Source Code for Module phones.p_etsi

  1  # THIS FILE IS AUTOMATICALLY GENERATED.  EDIT THE SOURCE FILE NOT THIS ONE 
  2   
  3  """Various descriptions of data specific to GSM phones""" 
  4   
  5  from prototypes import * 
  6  from prototypeslg import * 
  7   
  8  # We use LSB for all integer like fields 
  9  UINT=UINTlsb 
 10  BOOL=BOOLlsb 
 11   
12 -class echo_off(BaseProtogenClass):
13 __fields=['command'] 14
15 - def __init__(self, *args, **kwargs):
16 dict={} 17 # What was supplied to this function 18 dict.update(kwargs) 19 # Parent constructor 20 super(echo_off,self).__init__(**dict) 21 if self.__class__ is echo_off: 22 self._update(args,dict)
23 24
25 - def getfields(self):
26 return self.__fields
27 28
29 - def _update(self, args, kwargs):
30 super(echo_off,self)._update(args,kwargs) 31 keys=kwargs.keys() 32 for key in keys: 33 if key in self.__fields: 34 setattr(self, key, kwargs[key]) 35 del kwargs[key] 36 # Were any unrecognized kwargs passed in? 37 if __debug__: 38 self._complainaboutunusedargs(echo_off,kwargs) 39 if len(args): 40 dict2={ 'terminator': None, 'default': 'E0V1' } 41 dict2.update(kwargs) 42 kwargs=dict2 43 self.__field_command=USTRING(*args,**dict2)
44 # Make all P fields that haven't already been constructed 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
58 - def readfrombuffer(self,buf,autolog=True,logtitle="<read data>"):
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
67 - def __getfield_command(self):
68 try: self.__field_command 69 except: 70 self.__field_command=USTRING(**{ 'terminator': None, 'default': 'E0V1' }) 71 return self.__field_command.getvalue()
72
73 - def __setfield_command(self, value):
74 if isinstance(value,USTRING): 75 self.__field_command=value 76 else: 77 self.__field_command=USTRING(value,**{ 'terminator': None, 'default': 'E0V1' })
78
79 - def __delfield_command(self): del self.__field_command
80 81 command=property(__getfield_command, __setfield_command, __delfield_command, None) 82
83 - def iscontainer(self):
84 return True
85
86 - def containerelements(self):
87 yield ('command', self.__field_command, None)
88 89 90 91
92 -class esnrequest(BaseProtogenClass):
93 __fields=['command'] 94
95 - def __init__(self, *args, **kwargs):
96 dict={} 97 # What was supplied to this function 98 dict.update(kwargs) 99 # Parent constructor 100 super(esnrequest,self).__init__(**dict) 101 if self.__class__ is esnrequest: 102 self._update(args,dict)
103 104
105 - def getfields(self):
106 return self.__fields
107 108
109 - def _update(self, args, kwargs):
110 super(esnrequest,self)._update(args,kwargs) 111 keys=kwargs.keys() 112 for key in keys: 113 if key in self.__fields: 114 setattr(self, key, kwargs[key]) 115 del kwargs[key] 116 # Were any unrecognized kwargs passed in? 117 if __debug__: 118 self._complainaboutunusedargs(esnrequest,kwargs) 119 if len(args): 120 dict2={ 'terminator': None, 'default': '+GSN' } 121 dict2.update(kwargs) 122 kwargs=dict2 123 self.__field_command=USTRING(*args,**dict2)
124 # Make all P fields that haven't already been constructed 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
138 - def readfrombuffer(self,buf,autolog=True,logtitle="<read data>"):
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
147 - def __getfield_command(self):
148 try: self.__field_command 149 except: 150 self.__field_command=USTRING(**{ 'terminator': None, 'default': '+GSN' }) 151 return self.__field_command.getvalue()
152
153 - def __setfield_command(self, value):
154 if isinstance(value,USTRING): 155 self.__field_command=value 156 else: 157 self.__field_command=USTRING(value,**{ 'terminator': None, 'default': '+GSN' })
158
159 - def __delfield_command(self): del self.__field_command
160 161 command=property(__getfield_command, __setfield_command, __delfield_command, None) 162
163 - def iscontainer(self):
164 return True
165
166 - def containerelements(self):
167 yield ('command', self.__field_command, None)
168 169 170 171
172 -class esnresponse(BaseProtogenClass):
173 __fields=['command', 'esn'] 174
175 - def __init__(self, *args, **kwargs):
176 dict={} 177 # What was supplied to this function 178 dict.update(kwargs) 179 # Parent constructor 180 super(esnresponse,self).__init__(**dict) 181 if self.__class__ is esnresponse: 182 self._update(args,dict)
183 184
185 - def getfields(self):
186 return self.__fields
187 188
189 - def _update(self, args, kwargs):
190 super(esnresponse,self)._update(args,kwargs) 191 keys=kwargs.keys() 192 for key in keys: 193 if key in self.__fields: 194 setattr(self, key, kwargs[key]) 195 del kwargs[key] 196 # Were any unrecognized kwargs passed in? 197 if __debug__: 198 self._complainaboutunusedargs(esnresponse,kwargs) 199 if len(args): raise TypeError('Unexpected arguments supplied: '+`args`)
200 # Make all P fields that haven't already been constructed 201 202
203 - def writetobuffer(self,buf,autolog=True,logtitle="<written data>"):
204 'Writes this packet to the supplied buffer' 205 self._bufferstartoffset=buf.getcurrentoffset() 206 self.__field_command.writetobuffer(buf) 207 self.__field_esn.writetobuffer(buf) 208 self._bufferendoffset=buf.getcurrentoffset() 209 if autolog and self._bufferstartoffset==0: self.autologwrite(buf, logtitle=logtitle)
210 211
212 - def readfrombuffer(self,buf,autolog=True,logtitle="<read data>"):
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
223 - def __getfield_command(self):
224 return self.__field_command.getvalue()
225
226 - def __setfield_command(self, value):
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
232 - def __delfield_command(self): del self.__field_command
233 234 command=property(__getfield_command, __setfield_command, __delfield_command, None) 235
236 - def __getfield_esn(self):
237 return self.__field_esn.getvalue()
238
239 - def __setfield_esn(self, value):
240 if isinstance(value,CSVSTRING): 241 self.__field_esn=value 242 else: 243 self.__field_esn=CSVSTRING(value,**{'quotechar': None, 'terminator': None})
244
245 - def __delfield_esn(self): del self.__field_esn
246 247 esn=property(__getfield_esn, __setfield_esn, __delfield_esn, None) 248
249 - def iscontainer(self):
250 return True
251
252 - def containerelements(self):
253 yield ('command', self.__field_command, None) 254 yield ('esn', self.__field_esn, None)
255 256 257 258
259 -class SIM_ID_Req(BaseProtogenClass):
260 __fields=['command'] 261
262 - def __init__(self, *args, **kwargs):
263 dict={} 264 # What was supplied to this function 265 dict.update(kwargs) 266 # Parent constructor 267 super(SIM_ID_Req,self).__init__(**dict) 268 if self.__class__ is SIM_ID_Req: 269 self._update(args,dict)
270 271
272 - def getfields(self):
273 return self.