# THIS FILE IS AUTOMATICALLY GENERATED.  EDIT THE SOURCE FILE NOT THIS ONE

"""Proposed descriptions of data usign AT commands"""

from prototypes import *

# We use LSB for all integer like fields in diagnostic mode
UINT=UINTlsb
BOOL=BOOLlsb
#

NUMPHONEBOOKENTRIES=500
NUMEMAILS=3
NUMPHONENUMBERS=5
MAXNUMBERLEN=32
NUMTODOENTRIES=9
NUMSMSENTRIES=94

MAXMEMOLEN=72


NUMGROUPS=4

AMSREGISTRY="ams/AmsRegistry"

DEFAULT_RINGTONE=0
DEFAULT_WALLPAPER=0

class firmwarerequest(BaseProtogenClass):
    __fields=['command']

    def __init__(self, *args, **kwargs):
        dict={}
        # What was supplied to this function
        dict.update(kwargs)
        # Parent constructor
        super(firmwarerequest,self).__init__(**dict)
        if self.__class__ is firmwarerequest:
            self._update(args,dict)


    def getfields(self):
        return self.__fields


    def _update(self, args, kwargs):
        super(firmwarerequest,self)._update(args,kwargs)
        keys=kwargs.keys()
        for key in keys:
            if key in self.__fields:
                setattr(self, key, kwargs[key])
                del kwargs[key]
        # Were any unrecognized kwargs passed in?
        if __debug__:
            self._complainaboutunusedargs(firmwarerequest,kwargs)
        if len(args):
            dict2={'sizeinbytes': 1, 'constant': 0x00}
            dict2.update(kwargs)
            kwargs=dict2
            self.__field_command=UINT(*args,**dict2)
        # Make all P fields that haven't already been constructed


    def writetobuffer(self,buf,autolog=True,logtitle="<written data>"):
        'Writes this packet to the supplied buffer'
        self._bufferstartoffset=buf.getcurrentoffset()
        try: self.__field_command
        except:
            self.__field_command=UINT(**{'sizeinbytes': 1, 'constant': 0x00})
        self.__field_command.writetobuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()
        if autolog and self._bufferstartoffset==0: self.autologwrite(buf, logtitle=logtitle)


    def readfrombuffer(self,buf,autolog=True,logtitle="<read data>"):
        'Reads this packet from the supplied buffer'
        self._bufferstartoffset=buf.getcurrentoffset()
        if autolog and self._bufferstartoffset==0: self.autologread(buf, logtitle=logtitle)
        self.__field_command=UINT(**{'sizeinbytes': 1, 'constant': 0x00})
        self.__field_command.readfrombuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()


    def __getfield_command(self):
        try: self.__field_command
        except:
            self.__field_command=UINT(**{'sizeinbytes': 1, 'constant': 0x00})
        return self.__field_command.getvalue()

    def __setfield_command(self, value):
        if isinstance(value,UINT):
            self.__field_command=value
        else:
            self.__field_command=UINT(value,**{'sizeinbytes': 1, 'constant': 0x00})

    def __delfield_command(self): del self.__field_command

    command=property(__getfield_command, __setfield_command, __delfield_command, None)

    def iscontainer(self):
        return True

    def containerelements(self):
        yield ('command', self.__field_command, None)




class firmwareresponse(BaseProtogenClass):
    __fields=['command', 'unknown']

    def __init__(self, *args, **kwargs):
        dict={}
        # What was supplied to this function
        dict.update(kwargs)
        # Parent constructor
        super(firmwareresponse,self).__init__(**dict)
        if self.__class__ is firmwareresponse:
            self._update(args,dict)


    def getfields(self):
        return self.__fields


    def _update(self, args, kwargs):
        super(firmwareresponse,self)._update(args,kwargs)
        keys=kwargs.keys()
        for key in keys:
            if key in self.__fields:
                setattr(self, key, kwargs[key])
                del kwargs[key]
        # Were any unrecognized kwargs passed in?
        if __debug__:
            self._complainaboutunusedargs(firmwareresponse,kwargs)
        if len(args): raise TypeError('Unexpected arguments supplied: '+`args`)
        # Make all P fields that haven't already been constructed


    def writetobuffer(self,buf,autolog=True,logtitle="<written data>"):
        'Writes this packet to the supplied buffer'
        self._bufferstartoffset=buf.getcurrentoffset()
        self.__field_command.writetobuffer(buf)
        self.__field_unknown.writetobuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()
        if autolog and self._bufferstartoffset==0: self.autologwrite(buf, logtitle=logtitle)


    def readfrombuffer(self,buf,autolog=True,logtitle="<read data>"):
        'Reads this packet from the supplied buffer'
        self._bufferstartoffset=buf.getcurrentoffset()
        if autolog and self._bufferstartoffset==0: self.autologread(buf, logtitle=logtitle)
        self.__field_command=UINT(**{'sizeinbytes': 1})
        self.__field_command.readfrombuffer(buf)
        self.__field_unknown=UNKNOWN()
        self.__field_unknown.readfrombuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()


    def __getfield_command(self):
        return self.__field_command.getvalue()

    def __setfield_command(self, value):
        if isinstance(value,UINT):
            self.__field_command=value
        else:
            self.__field_command=UINT(value,**{'sizeinbytes': 1})

    def __delfield_command(self): del self.__field_command

    command=property(__getfield_command, __setfield_command, __delfield_command, None)

    def __getfield_unknown(self):
        return self.__field_unknown.getvalue()

    def __setfield_unknown(self, value):
        if isinstance(value,UNKNOWN):
            self.__field_unknown=value
        else:
            self.__field_unknown=UNKNOWN(value,)

    def __delfield_unknown(self): del self.__field_unknown

    unknown=property(__getfield_unknown, __setfield_unknown, __delfield_unknown, None)

    def iscontainer(self):
        return True

    def containerelements(self):
        yield ('command', self.__field_command, None)
        yield ('unknown', self.__field_unknown, None)




class numberheader(BaseProtogenClass):
    __fields=['head1', 'head2', 'head3']

    def __init__(self, *args, **kwargs):
        dict={}
        # What was supplied to this function
        dict.update(kwargs)
        # Parent constructor
        super(numberheader,self).__init__(**dict)
        if self.__class__ is numberheader:
            self._update(args,dict)


    def getfields(self):
        return self.__fields


    def _update(self, args, kwargs):
        super(numberheader,self)._update(args,kwargs)
        keys=kwargs.keys()
        for key in keys:
            if key in self.__fields:
                setattr(self, key, kwargs[key])
                del kwargs[key]
        # Were any unrecognized kwargs passed in?
        if __debug__:
            self._complainaboutunusedargs(numberheader,kwargs)
        if len(args): raise TypeError('Unexpected arguments supplied: '+`args`)
        # Make all P fields that haven't already been constructed


    def writetobuffer(self,buf,autolog=True,logtitle="<written data>"):
        'Writes this packet to the supplied buffer'
        self._bufferstartoffset=buf.getcurrentoffset()
        try: self.__field_head1
        except:
            self.__field_head1=UINT(**{'sizeinbytes': 1, 'default': 0x26})
        self.__field_head1.writetobuffer(buf)
        try: self.__field_head2
        except:
            self.__field_head2=UINT(**{'sizeinbytes': 1, 'constant': 0x39})
        self.__field_head2.writetobuffer(buf)
        try: self.__field_head3
        except:
            self.__field_head3=UINT(**{'sizeinbytes': 1, 'constant': 0x0})
        self.__field_head3.writetobuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()
        if autolog and self._bufferstartoffset==0: self.autologwrite(buf, logtitle=logtitle)


    def readfrombuffer(self,buf,autolog=True,logtitle="<read data>"):
        'Reads this packet from the supplied buffer'
        self._bufferstartoffset=buf.getcurrentoffset()
        if autolog and self._bufferstartoffset==0: self.autologread(buf, logtitle=logtitle)
        self.__field_head1=UINT(**{'sizeinbytes': 1, 'default': 0x26})
        self.__field_head1.readfrombuffer(buf)
        self.__field_head2=UINT(**{'sizeinbytes': 1, 'constant': 0x39})
        self.__field_head2.readfrombuffer(buf)
        self.__field_head3=UINT(**{'sizeinbytes': 1, 'constant': 0x0})
        self.__field_head3.readfrombuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()


    def __getfield_head1(self):
        try: self.__field_head1
        except:
            self.__field_head1=UINT(**{'sizeinbytes': 1, 'default': 0x26})
        return self.__field_head1.getvalue()

    def __setfield_head1(self, value):
        if isinstance(value,UINT):
            self.__field_head1=value
        else:
            self.__field_head1=UINT(value,**{'sizeinbytes': 1, 'default': 0x26})

    def __delfield_head1(self): del self.__field_head1

    head1=property(__getfield_head1, __setfield_head1, __delfield_head1, None)

    def __getfield_head2(self):
        try: self.__field_head2
        except:
            self.__field_head2=UINT(**{'sizeinbytes': 1, 'constant': 0x39})
        return self.__field_head2.getvalue()

    def __setfield_head2(self, value):
        if isinstance(value,UINT):
            self.__field_head2=value
        else:
            self.__field_head2=UINT(value,**{'sizeinbytes': 1, 'constant': 0x39})

    def __delfield_head2(self): del self.__field_head2

    head2=property(__getfield_head2, __setfield_head2, __delfield_head2, None)

    def __getfield_head3(self):
        try: self.__field_head3
        except:
            self.__field_head3=UINT(**{'sizeinbytes': 1, 'constant': 0x0})
        return self.__field_head3.getvalue()

    def __setfield_head3(self, value):
        if isinstance(value,UINT):
            self.__field_head3=value
        else:
            self.__field_head3=UINT(value,**{'sizeinbytes': 1, 'constant': 0x0})

    def __delfield_head3(self): del self.__field_head3

    head3=property(__getfield_head3, __setfield_head3, __delfield_head3, None)

    def iscontainer(self):
        return True

    def containerelements(self):
        yield ('head1', self.__field_head1, None)
        yield ('head2', self.__field_head2, None)
        yield ('head3', self.__field_head3, None)




class nameheader(BaseProtogenClass):
    __fields=['head1', 'head2', 'head3']

    def __init__(self, *args, **kwargs):
        dict={}
        # What was supplied to this function
        dict.update(kwargs)
        # Parent constructor
        super(nameheader,self).__init__(**dict)
        if self.__class__ is nameheader:
            self._update(args,dict)


    def getfields(self):
        return self.__fields


    def _update(self, args, kwargs):
        super(nameheader,self)._update(args,kwargs)
        keys=kwargs.keys()
        for key in keys:
            if key in self.__fields:
                setattr(self, key, kwargs[key])
                del kwargs[key]
        # Were any unrecognized kwargs passed in?
        if __debug__:
            self._complainaboutunusedargs(nameheader,kwargs)
        if len(args): raise TypeError('Unexpected arguments supplied: '+`args`)
        # Make all P fields that haven't already been constructed


    def writetobuffer(self,buf,autolog=True,logtitle="<written data>"):
        'Writes this packet to the supplied buffer'
        self._bufferstartoffset=buf.getcurrentoffset()
        try: self.__field_head1
        except:
            self.__field_head1=UINT(**{'sizeinbytes': 1, 'default': 0xd3})
        self.__field_head1.writetobuffer(buf)
        try: self.__field_head2
        except:
            self.__field_head2=UINT(**{'sizeinbytes': 1, 'constant': 0x59})
        self.__field_head2.writetobuffer(buf)
        try: self.__field_head3
        except:
            self.__field_head3=UINT(**{'sizeinbytes': 1, 'constant': 0x0e})
        self.__field_head3.writetobuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()
        if autolog and self._bufferstartoffset==0: self.autologwrite(buf, logtitle=logtitle)


    def readfrombuffer(self,buf,autolog=True,logtitle="<read data>"):
        'Reads this packet from the supplied buffer'
        self._bufferstartoffset=buf.getcurrentoffset()
        if autolog and self._bufferstartoffset==0: self.autologread(buf, logtitle=logtitle)
        self.__field_head1=UINT(**{'sizeinbytes': 1, 'default': 0xd3})
        self.__field_head1.readfrombuffer(buf)
        self.__field_head2=UINT(**{'sizeinbytes': 1, 'constant': 0x59})
        self.__field_head2.readfrombuffer(buf)
        self.__field_head3=UINT(**{'sizeinbytes': 1, 'constant': 0x0e})
        self.__field_head3.readfrombuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()


    def __getfield_head1(self):
        try: self.__field_head1
        except:
            self.__field_head1=UINT(**{'sizeinbytes': 1, 'default': 0xd3})
        return self.__field_head1.getvalue()

    def __setfield_head1(self, value):
        if isinstance(value,UINT):
            self.__field_head1=value
        else:
            self.__field_head1=UINT(value,**{'sizeinbytes': 1, 'default': 0xd3})

    def __delfield_head1(self): del self.__field_head1

    head1=property(__getfield_head1, __setfield_head1, __delfield_head1, None)

    def __getfield_head2(self):
        try: self.__field_head2
        except:
            self.__field_head2=UINT(**{'sizeinbytes': 1, 'constant': 0x59})
        return self.__field_head2.getvalue()

    def __setfield_head2(self, value):
        if isinstance(value,UINT):
            self.__field_head2=value
        else:
            self.__field_head2=UINT(value,**{'sizeinbytes': 1, 'constant': 0x59})

    def __delfield_head2(self): del self.__field_head2

    head2=property(__getfield_head2, __setfield_head2, __delfield_head2, None)

    def __getfield_head3(self):
        try: self.__field_head3
        except:
            self.__field_head3=UINT(**{'sizeinbytes': 1, 'constant': 0x0e})
        return self.__field_head3.getvalue()

    def __setfield_head3(self, value):
        if isinstance(value,UINT):
            self.__field_head3=value
        else:
            self.__field_head3=UINT(value,**{'sizeinbytes': 1, 'constant': 0x0e})

    def __delfield_head3(self): del self.__field_head3

    head3=property(__getfield_head3, __setfield_head3, __delfield_head3, None)

    def iscontainer(self):
        return True

    def containerelements(self):
        yield ('head1', self.__field_head1, None)
        yield ('head2', self.__field_head2, None)
        yield ('head3', self.__field_head3, None)




class numberrequest(BaseProtogenClass):
    __fields=['header', 'slot', 'pad']

    def __init__(self, *args, **kwargs):
        dict={}
        # What was supplied to this function
        dict.update(kwargs)
        # Parent constructor
        super(numberrequest,self).__init__(**dict)
        if self.__class__ is numberrequest:
            self._update(args,dict)


    def getfields(self):
        return self.__fields


    def _update(self, args, kwargs):
        super(numberrequest,self)._update(args,kwargs)
        keys=kwargs.keys()
        for key in keys:
            if key in self.__fields:
                setattr(self, key, kwargs[key])
                del kwargs[key]
        # Were any unrecognized kwargs passed in?
        if __debug__:
            self._complainaboutunusedargs(numberrequest,kwargs)
        if len(args): raise TypeError('Unexpected arguments supplied: '+`args`)
        # Make all P fields that haven't already been constructed


    def writetobuffer(self,buf,autolog=True,logtitle="<written data>"):
        'Writes this packet to the supplied buffer'
        self._bufferstartoffset=buf.getcurrentoffset()
        try: self.__field_header
        except:
            self.__field_header=numberheader()
        self.__field_header.writetobuffer(buf)
        self.__field_slot.writetobuffer(buf)
        try: self.__field_pad
        except:
            self.__field_pad=UNKNOWN(**{'sizeinbytes': 128})
        self.__field_pad.writetobuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()
        if autolog and self._bufferstartoffset==0: self.autologwrite(buf, logtitle=logtitle)


    def readfrombuffer(self,buf,autolog=True,logtitle="<read data>"):
        'Reads this packet from the supplied buffer'
        self._bufferstartoffset=buf.getcurrentoffset()
        if autolog and self._bufferstartoffset==0: self.autologread(buf, logtitle=logtitle)
        self.__field_header=numberheader()
        self.__field_header.readfrombuffer(buf)
        self.__field_slot=UINT(**{'sizeinbytes': 2})
        self.__field_slot.readfrombuffer(buf)
        self.__field_pad=UNKNOWN(**{'sizeinbytes': 128})
        self.__field_pad.readfrombuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()


    def __getfield_header(self):
        try: self.__field_header
        except:
            self.__field_header=numberheader()
        return self.__field_header.getvalue()

    def __setfield_header(self, value):
        if isinstance(value,numberheader):
            self.__field_header=value
        else:
            self.__field_header=numberheader(value,)

    def __delfield_header(self): del self.__field_header

    header=property(__getfield_header, __setfield_header, __delfield_header, None)

    def __getfield_slot(self):
        return self.__field_slot.getvalue()

    def __setfield_slot(self, value):
        if isinstance(value,UINT):
            self.__field_slot=value
        else:
            self.__field_slot=UINT(value,**{'sizeinbytes': 2})

    def __delfield_slot(self): del self.__field_slot

    slot=property(__getfield_slot, __setfield_slot, __delfield_slot, None)

    def __getfield_pad(self):
        try: self.__field_pad
        except:
            self.__field_pad=UNKNOWN(**{'sizeinbytes': 128})
        return self.__field_pad.getvalue()

    def __setfield_pad(self, value):
        if isinstance(value,UNKNOWN):
            self.__field_pad=value
        else:
            self.__field_pad=UNKNOWN(value,**{'sizeinbytes': 128})

    def __delfield_pad(self): del self.__field_pad

    pad=property(__getfield_pad, __setfield_pad, __delfield_pad, None)

    def iscontainer(self):
        return True

    def containerelements(self):
        yield ('header', self.__field_header, None)
        yield ('slot', self.__field_slot, None)
        yield ('pad', self.__field_pad, None)




class numberresponse(BaseProtogenClass):
    __fields=['header', 'slot', 'entry', 'pad']

    def __init__(self, *args, **kwargs):
        dict={}
        # What was supplied to this function
        dict.update(kwargs)
        # Parent constructor
        super(numberresponse,self).__init__(**dict)
        if self.__class__ is numberresponse:
            self._update(args,dict)


    def getfields(self):
        return self.__fields


    def _update(self, args, kwargs):
        super(numberresponse,self)._update(args,kwargs)
        keys=kwargs.keys()
        for key in keys:
            if key in self.__fields:
                setattr(self, key, kwargs[key])
                del kwargs[key]
        # Were any unrecognized kwargs passed in?
        if __debug__:
            self._complainaboutunusedargs(numberresponse,kwargs)
        if len(args): raise TypeError('Unexpected arguments supplied: '+`args`)
        # Make all P fields that haven't already been constructed


    def writetobuffer(self,buf,autolog=True,logtitle="<written data>"):
        'Writes this packet to the supplied buffer'
        self._bufferstartoffset=buf.getcurrentoffset()
        self.__field_header.writetobuffer(buf)
        self.__field_slot.writetobuffer(buf)
        self.__field_entry.writetobuffer(buf)
        self.__field_pad.writetobuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()
        if autolog and self._bufferstartoffset==0: self.autologwrite(buf, logtitle=logtitle)


    def readfrombuffer(self,buf,autolog=True,logtitle="<read data>"):
        'Reads this packet from the supplied buffer'
        self._bufferstartoffset=buf.getcurrentoffset()
        if autolog and self._bufferstartoffset==0: self.autologread(buf, logtitle=logtitle)
        self.__field_header=numberheader()
        self.__field_header.readfrombuffer(buf)
        self.__field_slot=UINT(**{'sizeinbytes': 2})
        self.__field_slot.readfrombuffer(buf)
        self.__field_entry=numberentry()
        self.__field_entry.readfrombuffer(buf)
        self.__field_pad=UNKNOWN()
        self.__field_pad.readfrombuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()


    def __getfield_header(self):
        return self.__field_header.getvalue()

    def __setfield_header(self, value):
        if isinstance(value,numberheader):
            self.__field_header=value
        else:
            self.__field_header=numberheader(value,)

    def __delfield_header(self): del self.__field_header

    header=property(__getfield_header, __setfield_header, __delfield_header, None)

    def __getfield_slot(self):
        return self.__field_slot.getvalue()

    def __setfield_slot(self, value):
        if isinstance(value,UINT):
            self.__field_slot=value
        else:
            self.__field_slot=UINT(value,**{'sizeinbytes': 2})

    def __delfield_slot(self): del self.__field_slot

    slot=property(__getfield_slot, __setfield_slot, __delfield_slot, None)

    def __getfield_entry(self):
        return self.__field_entry.getvalue()

    def __setfield_entry(self, value):
        if isinstance(value,numberentry):
            self.__field_entry=value
        else:
            self.__field_entry=numberentry(value,)

    def __delfield_entry(self): del self.__field_entry

    entry=property(__getfield_entry, __setfield_entry, __delfield_entry, None)

    def __getfield_pad(self):
        return self.__field_pad.getvalue()

    def __setfield_pad(self, value):
        if isinstance(value,UNKNOWN):
            self.__field_pad=value
        else:
            self.__field_pad=UNKNOWN(value,)

    def __delfield_pad(self): del self.__field_pad

    pad=property(__getfield_pad, __setfield_pad, __delfield_pad, None)

    def iscontainer(self):
        return True

    def containerelements(self):
        yield ('header', self.__field_header, None)
        yield ('slot', self.__field_slot, None)
        yield ('entry', self.__field_entry, None)
        yield ('pad', self.__field_pad, None)




class numberentry(BaseProtogenClass):
    __fields=['pad1', 'pos', 'numbertype', 'pad2', 'numlen', 'num']

    def __init__(self, *args, **kwargs):
        dict={}
        # What was supplied to this function
        dict.update(kwargs)
        # Parent constructor
        super(numberentry,self).__init__(**dict)
        if self.__class__ is numberentry:
            self._update(args,dict)


    def getfields(self):
        return self.__fields


    def _update(self, args, kwargs):
        super(numberentry,self)._update(args,kwargs)
        keys=kwargs.keys()
        for key in keys:
            if key in self.__fields:
                setattr(self, key, kwargs[key])
                del kwargs[key]
        # Were any unrecognized kwargs passed in?
        if __debug__:
            self._complainaboutunusedargs(numberentry,kwargs)
        if len(args): raise TypeError('Unexpected arguments supplied: '+`args`)
        # Make all P fields that haven't already been constructed


    def writetobuffer(self,buf,autolog=True,logtitle="<written data>"):
        'Writes this packet to the supplied buffer'
        self._bufferstartoffset=buf.getcurrentoffset()
        try: self.__field_pad1
        except:
            self.__field_pad1=UNKNOWN(**{'sizeinbytes': 1})
        self.__field_pad1.writetobuffer(buf)
        self.__field_pos.writetobuffer(buf)
        self.__field_numbertype.writetobuffer(buf)
        try: self.__field_pad2
        except:
            self.__field_pad2=UNKNOWN(**{'sizeinbytes': 2})
        self.__field_pad2.writetobuffer(buf)
        self.__field_numlen.writetobuffer(buf)
        self.__field_num.writetobuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()
        if autolog and self._bufferstartoffset==0: self.autologwrite(buf, logtitle=logtitle)


    def readfrombuffer(self,buf,autolog=True,logtitle="<read data>"):
        'Reads this packet from the supplied buffer'
        self._bufferstartoffset=buf.getcurrentoffset()
        if autolog and self._bufferstartoffset==0: self.autologread(buf, logtitle=logtitle)
        self.__field_pad1=UNKNOWN(**{'sizeinbytes': 1})
        self.__field_pad1.readfrombuffer(buf)
        self.__field_pos=UINT(**{'sizeinbytes': 1})
        self.__field_pos.readfrombuffer(buf)
        self.__field_numbertype=UINT(**{'sizeinbytes': 1})
        self.__field_numbertype.readfrombuffer(buf)
        self.__field_pad2=UNKNOWN(**{'sizeinbytes': 2})
        self.__field_pad2.readfrombuffer(buf)
        self.__field_numlen=UINT(**{'sizeinbytes': 1})
        self.__field_numlen.readfrombuffer(buf)
        self.__field_num=USTRING(**{'sizeinbytes': 48, 'raiseonunterminatedread': False})
        self.__field_num.readfrombuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()


    def __getfield_pad1(self):
        try: self.__field_pad1
        except:
            self.__field_pad1=UNKNOWN(**{'sizeinbytes': 1})
        return self.__field_pad1.getvalue()

    def __setfield_pad1(self, value):
        if isinstance(value,UNKNOWN):
            self.__field_pad1=value
        else:
            self.__field_pad1=UNKNOWN(value,**{'sizeinbytes': 1})

    def __delfield_pad1(self): del self.__field_pad1

    pad1=property(__getfield_pad1, __setfield_pad1, __delfield_pad1, None)

    def __getfield_pos(self):
        return self.__field_pos.getvalue()

    def __setfield_pos(self, value):
        if isinstance(value,UINT):
            self.__field_pos=value
        else:
            self.__field_pos=UINT(value,**{'sizeinbytes': 1})

    def __delfield_pos(self): del self.__field_pos

    pos=property(__getfield_pos, __setfield_pos, __delfield_pos, None)

    def __getfield_numbertype(self):
        return self.__field_numbertype.getvalue()

    def __setfield_numbertype(self, value):
        if isinstance(value,UINT):
            self.__field_numbertype=value
        else:
            self.__field_numbertype=UINT(value,**{'sizeinbytes': 1})

    def __delfield_numbertype(self): del self.__field_numbertype

    numbertype=property(__getfield_numbertype, __setfield_numbertype, __delfield_numbertype, None)

    def __getfield_pad2(self):
        try: self.__field_pad2
        except:
            self.__field_pad2=UNKNOWN(**{'sizeinbytes': 2})
        return self.__field_pad2.getvalue()

    def __setfield_pad2(self, value):
        if isinstance(value,UNKNOWN):
            self.__field_pad2=value
        else:
            self.__field_pad2=UNKNOWN(value,**{'sizeinbytes': 2})

    def __delfield_pad2(self): del self.__field_pad2

    pad2=property(__getfield_pad2, __setfield_pad2, __delfield_pad2, None)

    def __getfield_numlen(self):
        return self.__field_numlen.getvalue()

    def __setfield_numlen(self, value):
        if isinstance(value,UINT):
            self.__field_numlen=value
        else:
            self.__field_numlen=UINT(value,**{'sizeinbytes': 1})

    def __delfield_numlen(self): del self.__field_numlen

    numlen=property(__getfield_numlen, __setfield_numlen, __delfield_numlen, None)

    def __getfield_num(self):
        return self.__field_num.getvalue()

    def __setfield_num(self, value):
        if isinstance(value,USTRING):
            self.__field_num=value
        else:
            self.__field_num=USTRING(value,**{'sizeinbytes': 48, 'raiseonunterminatedread': False})

    def __delfield_num(self): del self.__field_num

    num=property(__getfield_num, __setfield_num, __delfield_num, None)

    def iscontainer(self):
        return True

    def containerelements(self):
        yield ('pad1', self.__field_pad1, None)
        yield ('pos', self.__field_pos, None)
        yield ('numbertype', self.__field_numbertype, None)
        yield ('pad2', self.__field_pad2, None)
        yield ('numlen', self.__field_numlen, None)
        yield ('num', self.__field_num, None)




class numberupdaterequest(BaseProtogenClass):
    __fields=['header', 'slot', 'entry']

    def __init__(self, *args, **kwargs):
        dict={}
        # What was supplied to this function
        dict.update(kwargs)
        # Parent constructor
        super(numberupdaterequest,self).__init__(**dict)
        if self.__class__ is numberupdaterequest:
            self._update(args,dict)


    def getfields(self):
        return self.__fields


    def _update(self, args, kwargs):
        super(numberupdaterequest,self)._update(args,kwargs)
        keys=kwargs.keys()
        for key in keys:
            if key in self.__fields:
                setattr(self, key, kwargs[key])
                del kwargs[key]
        # Were any unrecognized kwargs passed in?
        if __debug__:
            self._complainaboutunusedargs(numberupdaterequest,kwargs)
        if len(args): raise TypeError('Unexpected arguments supplied: '+`args`)
        # Make all P fields that haven't already been constructed


    def writetobuffer(self,buf,autolog=True,logtitle="<written data>"):
        'Writes this packet to the supplied buffer'
        self._bufferstartoffset=buf.getcurrentoffset()
        try: self.__field_header
        except:
            self.__field_header=numberheader(**{'head1': 0x27})
        self.__field_header.writetobuffer(buf)
        self.__field_slot.writetobuffer(buf)
        try: self.__field_entry
        except:
            self.__field_entry=numberentry()
        self.__field_entry.writetobuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()
        if autolog and self._bufferstartoffset==0: self.autologwrite(buf, logtitle=logtitle)


    def readfrombuffer(self,buf,autolog=True,logtitle="<read data>"):
        'Reads this packet from the supplied buffer'
        self._bufferstartoffset=buf.getcurrentoffset()
        if autolog and self._bufferstartoffset==0: self.autologread(buf, logtitle=logtitle)
        self.__field_header=numberheader(**{'head1': 0x27})
        self.__field_header.readfrombuffer(buf)
        self.__field_slot=UINT(**{'sizeinbytes': 2})
        self.__field_slot.readfrombuffer(buf)
        self.__field_entry=numberentry()
        self.__field_entry.readfrombuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()


    def __getfield_header(self):
        try: self.__field_header
        except:
            self.__field_header=numberheader(**{'head1': 0x27})
        return self.__field_header.getvalue()

    def __setfield_header(self, value):
        if isinstance(value,numberheader):
            self.__field_header=value
        else:
            self.__field_header=numberheader(value,**{'head1': 0x27})

    def __delfield_header(self): del self.__field_header

    header=property(__getfield_header, __setfield_header, __delfield_header, None)

    def __getfield_slot(self):
        return self.__field_slot.getvalue()

    def __setfield_slot(self, value):
        if isinstance(value,UINT):
            self.__field_slot=value
        else:
            self.__field_slot=UINT(value,**{'sizeinbytes': 2})

    def __delfield_slot(self): del self.__field_slot

    slot=property(__getfield_slot, __setfield_slot, __delfield_slot, None)

    def __getfield_entry(self):
        try: self.__field_entry
        except:
            self.__field_entry=numberentry()
        return self.__field_entry.getvalue()

    def __setfield_entry(self, value):
        if isinstance(value,numberentry):
            self.__field_entry=value
        else:
            self.__field_entry=numberentry(value,)

    def __delfield_entry(self): del self.__field_entry

    entry=property(__getfield_entry, __setfield_entry, __delfield_entry, None)

    def iscontainer(self):
        return True

    def containerelements(self):
        yield ('header', self.__field_header, None)
        yield ('slot', self.__field_slot, None)
        yield ('entry', self.__field_entry, None)




class namerequest(BaseProtogenClass):
    __fields=['header', 'slot', 'pad']

    def __init__(self, *args, **kwargs):
        dict={}
        # What was supplied to this function
        dict.update(kwargs)
        # Parent constructor
        super(namerequest,self).__init__(**dict)
        if self.__class__ is namerequest:
            self._update(args,dict)


    def getfields(self):
        return self.__fields


    def _update(self, args, kwargs):
        super(namerequest,self)._update(args,kwargs)
        keys=kwargs.keys()
        for key in keys:
            if key in self.__fields:
                setattr(self, key, kwargs[key])
                del kwargs[key]
        # Were any unrecognized kwargs passed in?
        if __debug__:
            self._complainaboutunusedargs(namerequest,kwargs)
        if len(args): raise TypeError('Unexpected arguments supplied: '+`args`)
        # Make all P fields that haven't already been constructed


    def writetobuffer(self,buf,autolog=True,logtitle="<written data>"):
        'Writes this packet to the supplied buffer'
        self._bufferstartoffset=buf.getcurrentoffset()
        try: self.__field_header
        except:
            self.__field_header=nameheader()
        self.__field_header.writetobuffer(buf)
        self.__field_slot.writetobuffer(buf)
        try: self.__field_pad
        except:
            self.__field_pad=UNKNOWN(**{'sizeinbytes': 140})
        self.__field_pad.writetobuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()
        if autolog and self._bufferstartoffset==0: self.autologwrite(buf, logtitle=logtitle)


    def readfrombuffer(self,buf,autolog=True,logtitle="<read data>"):
        'Reads this packet from the supplied buffer'
        self._bufferstartoffset=buf.getcurrentoffset()
        if autolog and self._bufferstartoffset==0: self.autologread(buf, logtitle=logtitle)
        self.__field_header=nameheader()
        self.__field_header.readfrombuffer(buf)
        self.__field_slot=UINT(**{'sizeinbytes': 2})
        self.__field_slot.readfrombuffer(buf)
        self.__field_pad=UNKNOWN(**{'sizeinbytes': 140})
        self.__field_pad.readfrombuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()


    def __getfield_header(self):
        try: self.__field_header
        except:
            self.__field_header=nameheader()
        return self.__field_header.getvalue()

    def __setfield_header(self, value):
        if isinstance(value,nameheader):
            self.__field_header=value
        else:
            self.__field_header=nameheader(value,)

    def __delfield_header(self): del self.__field_header

    header=property(__getfield_header, __setfield_header, __delfield_header, None)

    def __getfield_slot(self):
        return self.__field_slot.getvalue()

    def __setfield_slot(self, value):
        if isinstance(value,UINT):
            self.__field_slot=value
        else:
            self.__field_slot=UINT(value,**{'sizeinbytes': 2})

    def __delfield_slot(self): del self.__field_slot

    slot=property(__getfield_slot, __setfield_slot, __delfield_slot, None)

    def __getfield_pad(self):
        try: self.__field_pad
        except:
            self.__field_pad=UNKNOWN(**{'sizeinbytes': 140})
        return self.__field_pad.getvalue()

    def __setfield_pad(self, value):
        if isinstance(value,UNKNOWN):
            self.__field_pad=value
        else:
            self.__field_pad=UNKNOWN(value,**{'sizeinbytes': 140})

    def __delfield_pad(self): del self.__field_pad

    pad=property(__getfield_pad, __setfield_pad, __delfield_pad, None)

    def iscontainer(self):
        return True

    def containerelements(self):
        yield ('header', self.__field_header, None)
        yield ('slot', self.__field_slot, None)
        yield ('pad', self.__field_pad, None)




class nameresponse(BaseProtogenClass):
    __fields=['header', 'slot', 'entry', 'pad']

    def __init__(self, *args, **kwargs):
        dict={}
        # What was supplied to this function
        dict.update(kwargs)
        # Parent constructor
        super(nameresponse,self).__init__(**dict)
        if self.__class__ is nameresponse:
            self._update(args,dict)


    def getfields(self):
        return self.__fields


    def _update(self, args, kwargs):
        super(nameresponse,self)._update(args,kwargs)
        keys=kwargs.keys()
        for key in keys:
            if key in self.__fields:
                setattr(self, key, kwargs[key])
                del kwargs[key]
        # Were any unrecognized kwargs passed in?
        if __debug__:
            self._complainaboutunusedargs(nameresponse,kwargs)
        if len(args): raise TypeError('Unexpected arguments supplied: '+`args`)
        # Make all P fields that haven't already been constructed


    def writetobuffer(self,buf,autolog=True,logtitle="<written data>"):
        'Writes this packet to the supplied buffer'
        self._bufferstartoffset=buf.getcurrentoffset()
        self.__field_header.writetobuffer(buf)
        self.__field_slot.writetobuffer(buf)
        self.__field_entry.writetobuffer(buf)
        self.__field_pad.writetobuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()
        if autolog and self._bufferstartoffset==0: self.autologwrite(buf, logtitle=logtitle)


    def readfrombuffer(self,buf,autolog=True,logtitle="<read data>"):
        'Reads this packet from the supplied buffer'
        self._bufferstartoffset=buf.getcurrentoffset()
        if autolog and self._bufferstartoffset==0: self.autologread(buf, logtitle=logtitle)
        self.__field_header=nameheader()
        self.__field_header.readfrombuffer(buf)
        self.__field_slot=UINT(**{'sizeinbytes': 2})
        self.__field_slot.readfrombuffer(buf)
        self.__field_entry=nameentry()
        self.__field_entry.readfrombuffer(buf)
        self.__field_pad=UNKNOWN()
        self.__field_pad.readfrombuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()


    def __getfield_header(self):
        return self.__field_header.getvalue()

    def __setfield_header(self, value):
        if isinstance(value,nameheader):
            self.__field_header=value
        else:
            self.__field_header=nameheader(value,)

    def __delfield_header(self): del self.__field_header

    header=property(__getfield_header, __setfield_header, __delfield_header, None)

    def __getfield_slot(self):
        return self.__field_slot.getvalue()

    def __setfield_slot(self, value):
        if isinstance(value,UINT):
            self.__field_slot=value
        else:
            self.__field_slot=UINT(value,**{'sizeinbytes': 2})

    def __delfield_slot(self): del self.__field_slot

    slot=property(__getfield_slot, __setfield_slot, __delfield_slot, None)

    def __getfield_entry(self):
        return self.__field_entry.getvalue()

    def __setfield_entry(self, value):
        if isinstance(value,nameentry):
            self.__field_entry=value
        else:
            self.__field_entry=nameentry(value,)

    def __delfield_entry(self): del self.__field_entry

    entry=property(__getfield_entry, __setfield_entry, __delfield_entry, None)

    def __getfield_pad(self):
        return self.__field_pad.getvalue()

    def __setfield_pad(self, value):
        if isinstance(value,UNKNOWN):
            self.__field_pad=value
        else:
            self.__field_pad=UNKNOWN(value,)

    def __delfield_pad(self): del self.__field_pad

    pad=property(__getfield_pad, __setfield_pad, __delfield_pad, None)

    def iscontainer(self):
        return True

    def containerelements(self):
        yield ('header', self.__field_header, None)
        yield ('slot', self.__field_slot, None)
        yield ('entry', self.__field_entry, None)
        yield ('pad', self.__field_pad, None)




class nameentry(BaseProtogenClass):
    __fields=['bitmask', 'p2', 'numberps', 'emailp', 'urlp', 'p3', 'name_len', 'pad1', 'name', 'pad2', 'nickname', 'pad3', 'memo']

    def __init__(self, *args, **kwargs):
        dict={}
        # What was supplied to this function
        dict.update(kwargs)
        # Parent constructor
        super(nameentry,self).__init__(**dict)
        if self.__class__ is nameentry:
            self._update(args,dict)


    def getfields(self):
        return self.__fields


    def _update(self, args, kwargs):
        super(nameentry,self)._update(args,kwargs)
        keys=kwargs.keys()
        for key in keys:
            if key in self.__fields:
                setattr(self, key, kwargs[key])
                del kwargs[key]
        # Were any unrecognized kwargs passed in?
        if __debug__:
            self._complainaboutunusedargs(nameentry,kwargs)
        if len(args): raise TypeError('Unexpected arguments supplied: '+`args`)
        # Make all P fields that haven't already been constructed


    def writetobuffer(self,buf,autolog=True,logtitle="<written data>"):
        'Writes this packet to the supplied buffer'
        self._bufferstartoffset=buf.getcurrentoffset()
        self.__field_bitmask.writetobuffer(buf)
        try: self.__field_p2
        except:
            self.__field_p2=UNKNOWN(**{'sizeinbytes': 2})
        self.__field_p2.writetobuffer(buf)
        try: self.__field_numberps
        except:
            self.__field_numberps=LIST(**{'elementclass': _gen_p_samsungspha900_96, 'length': NUMPHONENUMBERS})
        self.__field_numberps.writetobuffer(buf)
        try: self.__field_emailp
        except:
            self.__field_emailp=UINT(**{'sizeinbytes': 2, 'default': 0})
        self.__field_emailp.writetobuffer(buf)
        try: self.__field_urlp
        except:
            self.__field_urlp=UINT(**{'sizeinbytes': 2, 'default': 0})
        self.__field_urlp.writetobuffer(buf)
        try: self.__field_p3
        except:
            self.__field_p3=UNKNOWN(**{'sizeinbytes': 2})
        self.__field_p3.writetobuffer(buf)
        self.__field_name_len.writetobuffer(buf)
        try: self.__field_pad1
        except:
            self.__field_pad1=UNKNOWN(**{'sizeinbytes': 2})
        self.__field_pad1.writetobuffer(buf)
        self.__field_name.writetobuffer(buf)
        try: self.__field_pad2
        except:
            self.__field_pad2=UNKNOWN(**{'sizeinbytes': 1})
        self.__field_pad2.writetobuffer(buf)
        try: self.__field_nickname
        except:
            self.__field_nickname=USTRING(**{'sizeinbytes': 20, 'raiseonunterminatedread': False, 'default': ""})
        self.__field_nickname.writetobuffer(buf)
        try: self.__field_pad3
        except:
            self.__field_pad3=UNKNOWN(**{'sizeinbytes': 1})
        self.__field_pad3.writetobuffer(buf)
        try: self.__field_memo
        except:
            self.__field_memo=USTRING(**{'sizeinbytes': 72, 'raiseonunterminatedread': False, 'default': "", 'raiseontruncate': False})
        self.__field_memo.writetobuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()
        if autolog and self._bufferstartoffset==0: self.autologwrite(buf, logtitle=logtitle)


    def readfrombuffer(self,buf,autolog=True,logtitle="<read data>"):
        'Reads this packet from the supplied buffer'
        self._bufferstartoffset=buf.getcurrentoffset()
        if autolog and self._bufferstartoffset==0: self.autologread(buf, logtitle=logtitle)
        self.__field_bitmask=UINT(**{'sizeinbytes': 2})
        self.__field_bitmask.readfrombuffer(buf)
        self.__field_p2=UNKNOWN(**{'sizeinbytes': 2})
        self.__field_p2.readfrombuffer(buf)
        self.__field_numberps=LIST(**{'elementclass': _gen_p_samsungspha900_96, 'length': NUMPHONENUMBERS})
        self.__field_numberps.readfrombuffer(buf)
        self.__field_emailp=UINT(**{'sizeinbytes': 2, 'default': 0})
        self.__field_emailp.readfrombuffer(buf)
        self.__field_urlp=UINT(**{'sizeinbytes': 2, 'default': 0})
        self.__field_urlp.readfrombuffer(buf)
        self.__field_p3=UNKNOWN(**{'sizeinbytes': 2})
        self.__field_p3.readfrombuffer(buf)
        self.__field_name_len=UINT(**{'sizeinbytes': 1})
        self.__field_name_len.readfrombuffer(buf)
        self.__field_pad1=UNKNOWN(**{'sizeinbytes': 2})
        self.__field_pad1.readfrombuffer(buf)
        self.__field_name=USTRING(**{'sizeinbytes': 20, 'raiseonunterminatedread': False, 'raiseontruncate': False})
        self.__field_name.readfrombuffer(buf)
        self.__field_pad2=UNKNOWN(**{'sizeinbytes': 1})
        self.__field_pad2.readfrombuffer(buf)
        self.__field_nickname=USTRING(**{'sizeinbytes': 20, 'raiseonunterminatedread': False, 'default': ""})
        self.__field_nickname.readfrombuffer(buf)
        self.__field_pad3=UNKNOWN(**{'sizeinbytes': 1})
        self.__field_pad3.readfrombuffer(buf)
        self.__field_memo=USTRING(**{'sizeinbytes': 72, 'raiseonunterminatedread': False, 'default': "", 'raiseontruncate': False})
        self.__field_memo.readfrombuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()


    def __getfield_bitmask(self):
        return self.__field_bitmask.getvalue()

    def __setfield_bitmask(self, value):
        if isinstance(value,UINT):
            self.__field_bitmask=value
        else:
            self.__field_bitmask=UINT(value,**{'sizeinbytes': 2})

    def __delfield_bitmask(self): del self.__field_bitmask

    bitmask=property(__getfield_bitmask, __setfield_bitmask, __delfield_bitmask, None)

    def __getfield_p2(self):
        try: self.__field_p2
        except:
            self.__field_p2=UNKNOWN(**{'sizeinbytes': 2})
        return self.__field_p2.getvalue()

    def __setfield_p2(self, value):
        if isinstance(value,UNKNOWN):
            self.__field_p2=value
        else:
            self.__field_p2=UNKNOWN(value,**{'sizeinbytes': 2})

    def __delfield_p2(self): del self.__field_p2

    p2=property(__getfield_p2, __setfield_p2, __delfield_p2, None)

    def __getfield_numberps(self):
        try: self.__field_numberps
        except:
            self.__field_numberps=LIST(**{'elementclass': _gen_p_samsungspha900_96, 'length': NUMPHONENUMBERS})
        return self.__field_numberps.getvalue()

    def __setfield_numberps(self, value):
        if isinstance(value,LIST):
            self.__field_numberps=value
        else:
            self.__field_numberps=LIST(value,**{'elementclass': _gen_p_samsungspha900_96, 'length': NUMPHONENUMBERS})

    def __delfield_numberps(self): del self.__field_numberps

    numberps=property(__getfield_numberps, __setfield_numberps, __delfield_numberps, None)

    def __getfield_emailp(self):
        try: self.__field_emailp
        except:
            self.__field_emailp=UINT(**{'sizeinbytes': 2, 'default': 0})
        return self.__field_emailp.getvalue()

    def __setfield_emailp(self, value):
        if isinstance(value,UINT):
            self.__field_emailp=value
        else:
            self.__field_emailp=UINT(value,**{'sizeinbytes': 2, 'default': 0})

    def __delfield_emailp(self): del self.__field_emailp

    emailp=property(__getfield_emailp, __setfield_emailp, __delfield_emailp, None)

    def __getfield_urlp(self):
        try: self.__field_urlp
        except:
            self.__field_urlp=UINT(**{'sizeinbytes': 2, 'default': 0})
        return self.__field_urlp.getvalue()

    def __setfield_urlp(self, value):
        if isinstance(value,UINT):
            self.__field_urlp=value
        else:
            self.__field_urlp=UINT(value,**{'sizeinbytes': 2, 'default': 0})

    def __delfield_urlp(self): del self.__field_urlp

    urlp=property(__getfield_urlp, __setfield_urlp, __delfield_urlp, None)

    def __getfield_p3(self):
        try: self.__field_p3
        except:
            self.__field_p3=UNKNOWN(**{'sizeinbytes': 2})
        return self.__field_p3.getvalue()

    def __setfield_p3(self, value):
        if isinstance(value,UNKNOWN):
            self.__field_p3=value
        else:
            self.__field_p3=UNKNOWN(value,**{'sizeinbytes': 2})

    def __delfield_p3(self): del self.__field_p3

    p3=property(__getfield_p3, __setfield_p3, __delfield_p3, None)

    def __getfield_name_len(self):
        return self.__field_name_len.getvalue()

    def __setfield_name_len(self, value):
        if isinstance(value,UINT):
            self.__field_name_len=value
        else:
            self.__field_name_len=UINT(value,**{'sizeinbytes': 1})

    def __delfield_name_len(self): del self.__field_name_len

    name_len=property(__getfield_name_len, __setfield_name_len, __delfield_name_len, None)

    def __getfield_pad1(self):
        try: self.__field_pad1
        except:
            self.__field_pad1=UNKNOWN(**{'sizeinbytes': 2})
        return self.__field_pad1.getvalue()

    def __setfield_pad1(self, value):
        if isinstance(value,UNKNOWN):
            self.__field_pad1=value
        else:
            self.__field_pad1=UNKNOWN(value,**{'sizeinbytes': 2})

    def __delfield_pad1(self): del self.__field_pad1

    pad1=property(__getfield_pad1, __setfield_pad1, __delfield_pad1, None)

    def __getfield_name(self):
        return self.__field_name.getvalue()

    def __setfield_name(self, value):
        if isinstance(value,USTRING):
            self.__field_name=value
        else:
            self.__field_name=USTRING(value,**{'sizeinbytes': 20, 'raiseonunterminatedread': False, 'raiseontruncate': False})

    def __delfield_name(self): del self.__field_name

    name=property(__getfield_name, __setfield_name, __delfield_name, None)

    def __getfield_pad2(self):
        try: self.__field_pad2
        except:
            self.__field_pad2=UNKNOWN(**{'sizeinbytes': 1})
        return self.__field_pad2.getvalue()

    def __setfield_pad2(self, value):
        if isinstance(value,UNKNOWN):
            self.__field_pad2=value
        else:
            self.__field_pad2=UNKNOWN(value,**{'sizeinbytes': 1})

    def __delfield_pad2(self): del self.__field_pad2

    pad2=property(__getfield_pad2, __setfield_pad2, __delfield_pad2, None)

    def __getfield_nickname(self):
        try: self.__field_nickname
        except:
            self.__field_nickname=USTRING(**{'sizeinbytes': 20, 'raiseonunterminatedread': False, 'default': ""})
        return self.__field_nickname.getvalue()

    def __setfield_nickname(self, value):
        if isinstance(value,USTRING):
            self.__field_nickname=value
        else:
            self.__field_nickname=USTRING(value,**{'sizeinbytes': 20, 'raiseonunterminatedread': False, 'default': ""})

    def __delfield_nickname(self): del self.__field_nickname

    nickname=property(__getfield_nickname, __setfield_nickname, __delfield_nickname, None)

    def __getfield_pad3(self):
        try: self.__field_pad3
        except:
            self.__field_pad3=UNKNOWN(**{'sizeinbytes': 1})
        return self.__field_pad3.getvalue()

    def __setfield_pad3(self, value):
        if isinstance(value,UNKNOWN):
            self.__field_pad3=value
        else:
            self.__field_pad3=UNKNOWN(value,**{'sizeinbytes': 1})

    def __delfield_pad3(self): del self.__field_pad3

    pad3=property(__getfield_pad3, __setfield_pad3, __delfield_pad3, None)

    def __getfield_memo(self):
        try: self.__field_memo
        except:
            self.__field_memo=USTRING(**{'sizeinbytes': 72, 'raiseonunterminatedread': False, 'default': "", 'raiseontruncate': False})
        return self.__field_memo.getvalue()

    def __setfield_memo(self, value):
        if isinstance(value,USTRING):
            self.__field_memo=value
        else:
            self.__field_memo=USTRING(value,**{'sizeinbytes': 72, 'raiseonunterminatedread': False, 'default': "", 'raiseontruncate': False})

    def __delfield_memo(self): del self.__field_memo

    memo=property(__getfield_memo, __setfield_memo, __delfield_memo, None)

    def iscontainer(self):
        return True

    def containerelements(self):
        yield ('bitmask', self.__field_bitmask, None)
        yield ('p2', self.__field_p2, None)
        yield ('numberps', self.__field_numberps, None)
        yield ('emailp', self.__field_emailp, None)
        yield ('urlp', self.__field_urlp, None)
        yield ('p3', self.__field_p3, None)
        yield ('name_len', self.__field_name_len, None)
        yield ('pad1', self.__field_pad1, None)
        yield ('name', self.__field_name, None)
        yield ('pad2', self.__field_pad2, None)
        yield ('nickname', self.__field_nickname, None)
        yield ('pad3', self.__field_pad3, None)
        yield ('memo', self.__field_memo, None)




class _gen_p_samsungspha900_96(BaseProtogenClass):
    'Anonymous inner class'
    __fields=['slot']

    def __init__(self, *args, **kwargs):
        dict={}
        # What was supplied to this function
        dict.update(kwargs)
        # Parent constructor
        super(_gen_p_samsungspha900_96,self).__init__(**dict)
        if self.__class__ is _gen_p_samsungspha900_96:
            self._update(args,dict)


    def getfields(self):
        return self.__fields


    def _update(self, args, kwargs):
        super(_gen_p_samsungspha900_96,self)._update(args,kwargs)
        keys=kwargs.keys()
        for key in keys:
            if key in self.__fields:
                setattr(self, key, kwargs[key])
                del kwargs[key]
        # Were any unrecognized kwargs passed in?
        if __debug__:
            self._complainaboutunusedargs(_gen_p_samsungspha900_96,kwargs)
        if len(args):
            dict2={'sizeinbytes': 2, 'default': 0}
            dict2.update(kwargs)
            kwargs=dict2
            self.__field_slot=UINT(*args,**dict2)
        # Make all P fields that haven't already been constructed


    def writetobuffer(self,buf,autolog=True,logtitle="<written data>"):
        'Writes this packet to the supplied buffer'
        self._bufferstartoffset=buf.getcurrentoffset()
        self.__field_slot.writetobuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()
        if autolog and self._bufferstartoffset==0: self.autologwrite(buf, logtitle=logtitle)


    def readfrombuffer(self,buf,autolog=True,logtitle="<read data>"):
        'Reads this packet from the supplied buffer'
        self._bufferstartoffset=buf.getcurrentoffset()
        if autolog and self._bufferstartoffset==0: self.autologread(buf, logtitle=logtitle)
        self.__field_slot=UINT(**{'sizeinbytes': 2, 'default': 0})
        self.__field_slot.readfrombuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()


    def __getfield_slot(self):
        return self.__field_slot.getvalue()

    def __setfield_slot(self, value):
        if isinstance(value,UINT):
            self.__field_slot=value
        else:
            self.__field_slot=UINT(value,**{'sizeinbytes': 2, 'default': 0})

    def __delfield_slot(self): del self.__field_slot

    slot=property(__getfield_slot, __setfield_slot, __delfield_slot, None)

    def iscontainer(self):
        return True

    def containerelements(self):
        yield ('slot', self.__field_slot, None)




class nameupdaterequest(BaseProtogenClass):
    __fields=['header', 'slot', 'entry', 'pad']

    def __init__(self, *args, **kwargs):
        dict={}
        # What was supplied to this function
        dict.update(kwargs)
        # Parent constructor
        super(nameupdaterequest,self).__init__(**dict)
        if self.__class__ is nameupdaterequest:
            self._update(args,dict)


    def getfields(self):
        return self.__fields


    def _update(self, args, kwargs):
        super(nameupdaterequest,self)._update(args,kwargs)
        keys=kwargs.keys()
        for key in keys:
            if key in self.__fields:
                setattr(self, key, kwargs[key])
                del kwargs[key]
        # Were any unrecognized kwargs passed in?
        if __debug__:
            self._complainaboutunusedargs(nameupdaterequest,kwargs)
        if len(args): raise TypeError('Unexpected arguments supplied: '+`args`)
        # Make all P fields that haven't already been constructed


    def writetobuffer(self,buf,autolog=True,logtitle="<written data>"):
        'Writes this packet to the supplied buffer'
        self._bufferstartoffset=buf.getcurrentoffset()
        try: self.__field_header
        except:
            self.__field_header=nameheader(**{'head1': 0xd4})
        self.__field_header.writetobuffer(buf)
        self.__field_slot.writetobuffer(buf)
        try: self.__field_entry
        except:
            self.__field_entry=nameentry()
        self.__field_entry.writetobuffer(buf)
        try: self.__field_pad
        except:
            self.__field_pad=UNKNOWN(**{'sizeinbytes': 3})
        self.__field_pad.writetobuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()
        if autolog and self._bufferstartoffset==0: self.autologwrite(buf, logtitle=logtitle)


    def readfrombuffer(self,buf,autolog=True,logtitle="<read data>"):
        'Reads this packet from the supplied buffer'
        self._bufferstartoffset=buf.getcurrentoffset()
        if autolog and self._bufferstartoffset==0: self.autologread(buf, logtitle=logtitle)
        self.__field_header=nameheader(**{'head1': 0xd4})
        self.__field_header.readfrombuffer(buf)
        self.__field_slot=UINT(**{'sizeinbytes': 2})
        self.__field_slot.readfrombuffer(buf)
        self.__field_entry=nameentry()
        self.__field_entry.readfrombuffer(buf)
        self.__field_pad=UNKNOWN(**{'sizeinbytes': 3})
        self.__field_pad.readfrombuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()


    def __getfield_header(self):
        try: self.__field_header
        except:
            self.__field_header=nameheader(**{'head1': 0xd4})
        return self.__field_header.getvalue()

    def __setfield_header(self, value):
        if isinstance(value,nameheader):
            self.__field_header=value
        else:
            self.__field_header=nameheader(value,**{'head1': 0xd4})

    def __delfield_header(self): del self.__field_header

    header=property(__getfield_header, __setfield_header, __delfield_header, None)

    def __getfield_slot(self):
        return self.__field_slot.getvalue()

    def __setfield_slot(self, value):
        if isinstance(value,UINT):
            self.__field_slot=value
        else:
            self.__field_slot=UINT(value,**{'sizeinbytes': 2})

    def __delfield_slot(self): del self.__field_slot

    slot=property(__getfield_slot, __setfield_slot, __delfield_slot, None)

    def __getfield_entry(self):
        try: self.__field_entry
        except:
            self.__field_entry=nameentry()
        return self.__field_entry.getvalue()

    def __setfield_entry(self, value):
        if isinstance(value,nameentry):
            self.__field_entry=value
        else:
            self.__field_entry=nameentry(value,)

    def __delfield_entry(self): del self.__field_entry

    entry=property(__getfield_entry, __setfield_entry, __delfield_entry, None)

    def __getfield_pad(self):
        try: self.__field_pad
        except:
            self.__field_pad=UNKNOWN(**{'sizeinbytes': 3})
        return self.__field_pad.getvalue()

    def __setfield_pad(self, value):
        if isinstance(value,UNKNOWN):
            self.__field_pad=value
        else:
            self.__field_pad=UNKNOWN(value,**{'sizeinbytes': 3})

    def __delfield_pad(self): del self.__field_pad

    pad=property(__getfield_pad, __setfield_pad, __delfield_pad, None)

    def iscontainer(self):
        return True

    def containerelements(self):
        yield ('header', self.__field_header, None)
        yield ('slot', self.__field_slot, None)
        yield ('entry', self.__field_entry, None)
        yield ('pad', self.__field_pad, None)




class beginendupdaterequest(BaseProtogenClass):
    __fields=['command', 'beginend']

    def __init__(self, *args, **kwargs):
        dict={}
        # What was supplied to this function
        dict.update(kwargs)
        # Parent constructor
        super(beginendupdaterequest,self).__init__(**dict)
        if self.__class__ is beginendupdaterequest:
            self._update(args,dict)


    def getfields(self):
        return self.__fields


    def _update(self, args, kwargs):
        super(beginendupdaterequest,self)._update(args,kwargs)
        keys=kwargs.keys()
        for key in keys:
            if key in self.__fields:
                setattr(self, key, kwargs[key])
                del kwargs[key]
        # Were any unrecognized kwargs passed in?
        if __debug__:
            self._complainaboutunusedargs(beginendupdaterequest,kwargs)
        if len(args): raise TypeError('Unexpected arguments supplied: '+`args`)
        # Make all P fields that haven't already been constructed


    def writetobuffer(self,buf,autolog=True,logtitle="<written data>"):
        'Writes this packet to the supplied buffer'
        self._bufferstartoffset=buf.getcurrentoffset()
        try: self.__field_command
        except:
            self.__field_command=UINT(**{'sizeinbytes': 1, 'constant': 0x29})
        self.__field_command.writetobuffer(buf)
        self.__field_beginend.writetobuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()
        if autolog and self._bufferstartoffset==0: self.autologwrite(buf, logtitle=logtitle)


    def readfrombuffer(self,buf,autolog=True,logtitle="<read data>"):
        'Reads this packet from the supplied buffer'
        self._bufferstartoffset=buf.getcurrentoffset()
        if autolog and self._bufferstartoffset==0: self.autologread(buf, logtitle=logtitle)
        self.__field_command=UINT(**{'sizeinbytes': 1, 'constant': 0x29})
        self.__field_command.readfrombuffer(buf)
        self.__field_beginend=UINT(**{'sizeinbytes': 2})
        self.__field_beginend.readfrombuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()


    def __getfield_command(self):
        try: self.__field_command
        except:
            self.__field_command=UINT(**{'sizeinbytes': 1, 'constant': 0x29})
        return self.__field_command.getvalue()

    def __setfield_command(self, value):
        if isinstance(value,UINT):
            self.__field_command=value
        else:
            self.__field_command=UINT(value,**{'sizeinbytes': 1, 'constant': 0x29})

    def __delfield_command(self): del self.__field_command

    command=property(__getfield_command, __setfield_command, __delfield_command, None)

    def __getfield_beginend(self):
        return self.__field_beginend.getvalue()

    def __setfield_beginend(self, value):
        if isinstance(value,UINT):
            self.__field_beginend=value
        else:
            self.__field_beginend=UINT(value,**{'sizeinbytes': 2})

    def __delfield_beginend(self): del self.__field_beginend

    beginend=property(__getfield_beginend, __setfield_beginend, __delfield_beginend, None)

    def iscontainer(self):
        return True

    def containerelements(self):
        yield ('command', self.__field_command, None)
        yield ('beginend', self.__field_beginend, None)




class beginendupdateresponse(BaseProtogenClass):
    __fields=['command', 'beginend']

    def __init__(self, *args, **kwargs):
        dict={}
        # What was supplied to this function
        dict.update(kwargs)
        # Parent constructor
        super(beginendupdateresponse,self).__init__(**dict)
        if self.__class__ is beginendupdateresponse:
            self._update(args,dict)


    def getfields(self):
        return self.__fields


    def _update(self, args, kwargs):
        super(beginendupdateresponse,self)._update(args,kwargs)
        keys=kwargs.keys()
        for key in keys:
            if key in self.__fields:
                setattr(self, key, kwargs[key])
                del kwargs[key]
        # Were any unrecognized kwargs passed in?
        if __debug__:
            self._complainaboutunusedargs(beginendupdateresponse,kwargs)
        if len(args): raise TypeError('Unexpected arguments supplied: '+`args`)
        # Make all P fields that haven't already been constructed


    def writetobuffer(self,buf,autolog=True,logtitle="<written data>"):
        'Writes this packet to the supplied buffer'
        self._bufferstartoffset=buf.getcurrentoffset()
        self.__field_command.writetobuffer(buf)
        self.__field_beginend.writetobuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()
        if autolog and self._bufferstartoffset==0: self.autologwrite(buf, logtitle=logtitle)


    def readfrombuffer(self,buf,autolog=True,logtitle="<read data>"):
        'Reads this packet from the supplied buffer'
        self._bufferstartoffset=buf.getcurrentoffset()
        if autolog and self._bufferstartoffset==0: self.autologread(buf, logtitle=logtitle)
        self.__field_command=UINT(**{'sizeinbytes': 1})
        self.__field_command.readfrombuffer(buf)
        self.__field_beginend=UINT(**{'sizeinbytes': 2})
        self.__field_beginend.readfrombuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()


    def __getfield_command(self):
        return self.__field_command.getvalue()

    def __setfield_command(self, value):
        if isinstance(value,UINT):
            self.__field_command=value
        else:
            self.__field_command=UINT(value,**{'sizeinbytes': 1})

    def __delfield_command(self): del self.__field_command

    command=property(__getfield_command, __setfield_command, __delfield_command, None)

    def __getfield_beginend(self):
        return self.__field_beginend.getvalue()

    def __setfield_beginend(self, value):
        if isinstance(value,UINT):
            self.__field_beginend=value
        else:
            self.__field_beginend=UINT(value,**{'sizeinbytes': 2})

    def __delfield_beginend(self): del self.__field_beginend

    beginend=property(__getfield_beginend, __setfield_beginend, __delfield_beginend, None)

    def iscontainer(self):
        return True

    def containerelements(self):
        yield ('command', self.__field_command, None)
        yield ('beginend', self.__field_beginend, None)




class statusrequest(BaseProtogenClass):
    __fields=['command']

    def __init__(self, *args, **kwargs):
        dict={}
        # What was supplied to this function
        dict.update(kwargs)
        # Parent constructor
        super(statusrequest,self).__init__(**dict)
        if self.__class__ is statusrequest:
            self._update(args,dict)


    def getfields(self):
        return self.__fields


    def _update(self, args, kwargs):
        super(statusrequest,self)._update(args,kwargs)
        keys=kwargs.keys()
        for key in keys:
            if key in self.__fields:
                setattr(self, key, kwargs[key])
                del kwargs[key]
        # Were any unrecognized kwargs passed in?
        if __debug__:
            self._complainaboutunusedargs(statusrequest,kwargs)
        if len(args):
            dict2={'sizeinbytes': 1, 'constant': 0x0c}
            dict2.update(kwargs)
            kwargs=dict2
            self.__field_command=UINT(*args,**dict2)
        # Make all P fields that haven't already been constructed


    def writetobuffer(self,buf,autolog=True,logtitle="<written data>"):
        'Writes this packet to the supplied buffer'
        self._bufferstartoffset=buf.getcurrentoffset()
        try: self.__field_command
        except:
            self.__field_command=UINT(**{'sizeinbytes': 1, 'constant': 0x0c})
        self.__field_command.writetobuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()
        if autolog and self._bufferstartoffset==0: self.autologwrite(buf, logtitle=logtitle)


    def readfrombuffer(self,buf,autolog=True,logtitle="<read data>"):
        'Reads this packet from the supplied buffer'
        self._bufferstartoffset=buf.getcurrentoffset()
        if autolog and self._bufferstartoffset==0: self.autologread(buf, logtitle=logtitle)
        self.__field_command=UINT(**{'sizeinbytes': 1, 'constant': 0x0c})
        self.__field_command.readfrombuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()


    def __getfield_command(self):
        try: self.__field_command
        except:
            self.__field_command=UINT(**{'sizeinbytes': 1, 'constant': 0x0c})
        return self.__field_command.getvalue()

    def __setfield_command(self, value):
        if isinstance(value,UINT):
            self.__field_command=value
        else:
            self.__field_command=UINT(value,**{'sizeinbytes': 1, 'constant': 0x0c})

    def __delfield_command(self): del self.__field_command

    command=property(__getfield_command, __setfield_command, __delfield_command, None)

    def iscontainer(self):
        return True

    def containerelements(self):
        yield ('command', self.__field_command, None)




class statusresponse(BaseProtogenClass):
    __fields=['readyvalue', 'command', 'dunno1', 'esn', 'flag0', 'dunno2', 'ready', 'dunno3', 'flag2', 'dunno4', 'flag3', 'unknown']

    def __init__(self, *args, **kwargs):
        dict={}
        # What was supplied to this function
        dict.update(kwargs)
        # Parent constructor
        super(statusresponse,self).__init__(**dict)
        if self.__class__ is statusresponse:
            self._update(args,dict)


    def getfields(self):
        return self.__fields


    def _update(self, args, kwargs):
        super(statusresponse,self)._update(args,kwargs)
        keys=kwargs.keys()
        for key in keys:
            if key in self.__fields:
                setattr(self, key, kwargs[key])
                del kwargs[key]
        # Were any unrecognized kwargs passed in?
        if __debug__:
            self._complainaboutunusedargs(statusresponse,kwargs)
        if len(args): raise TypeError('Unexpected arguments supplied: '+`args`)
        # Make all P fields that haven't already been constructed
        try: self.__field_readyvalue
        except:
            self.__field_readyvalue=UINT(**{'constant': 0x0})


    def writetobuffer(self,buf,autolog=True,logtitle="<written data>"):
        'Writes this packet to the supplied buffer'
        self._bufferstartoffset=buf.getcurrentoffset()
        self.__field_command.writetobuffer(buf)
        self.__field_dunno1.writetobuffer(buf)
        self.__field_esn.writetobuffer(buf)
        self.__field_flag0.writetobuffer(buf)
        self.__field_dunno2.writetobuffer(buf)
        self.__field_ready.writetobuffer(buf)
        self.__field_dunno3.writetobuffer(buf)
        self.__field_flag2.writetobuffer(buf)
        self.__field_dunno4.writetobuffer(buf)
        self.__field_flag3.writetobuffer(buf)
        self.__field_unknown.writetobuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()
        if autolog and self._bufferstartoffset==0: self.autologwrite(buf, logtitle=logtitle)


    def readfrombuffer(self,buf,autolog=True,logtitle="<read data>"):
        'Reads this packet from the supplied buffer'
        self._bufferstartoffset=buf.getcurrentoffset()
        if autolog and self._bufferstartoffset==0: self.autologread(buf, logtitle=logtitle)
        self.__field_command=UINT(**{'sizeinbytes': 1})
        self.__field_command.readfrombuffer(buf)
        self.__field_dunno1=UNKNOWN(**{'sizeinbytes': 3})
        self.__field_dunno1.readfrombuffer(buf)
        self.__field_esn=UINT(**{'sizeinbytes': 4})
        self.__field_esn.readfrombuffer(buf)
        self.__field_flag0=UINT(**{'sizeinbytes': 1})
        self.__field_flag0.readfrombuffer(buf)
        self.__field_dunno2=UNKNOWN(**{'sizeinbytes': 14})
        self.__field_dunno2.readfrombuffer(buf)
        self.__field_ready=UINT(**{'sizeinbytes': 1})
        self.__field_ready.readfrombuffer(buf)
        self.__field_dunno3=UINT(**{'sizeinbytes': 1})
        self.__field_dunno3.readfrombuffer(buf)
        self.__field_flag2=UINT(**{'sizeinbytes': 1})
        self.__field_flag2.readfrombuffer(buf)
        self.__field_dunno4=UNKNOWN(**{'sizeinbytes': 6})
        self.__field_dunno4.readfrombuffer(buf)
        self.__field_flag3=UINT(**{'sizeinbytes': 1})
        self.__field_flag3.readfrombuffer(buf)
        self.__field_unknown=UNKNOWN()
        self.__field_unknown.readfrombuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()


    def __getfield_readyvalue(self):
        return self.__field_readyvalue.getvalue()

    def __setfield_readyvalue(self, value):
        if isinstance(value,UINT):
            self.__field_readyvalue=value
        else:
            self.__field_readyvalue=UINT(value,**{'constant': 0x0})

    def __delfield_readyvalue(self): del self.__field_readyvalue

    readyvalue=property(__getfield_readyvalue, __setfield_readyvalue, __delfield_readyvalue, None)

    def __getfield_command(self):
        return self.__field_command.getvalue()

    def __setfield_command(self, value):
        if isinstance(value,UINT):
            self.__field_command=value
        else:
            self.__field_command=UINT(value,**{'sizeinbytes': 1})

    def __delfield_command(self): del self.__field_command

    command=property(__getfield_command, __setfield_command, __delfield_command, None)

    def __getfield_dunno1(self):
        return self.__field_dunno1.getvalue()

    def __setfield_dunno1(self, value):
        if isinstance(value,UNKNOWN):
            self.__field_dunno1=value
        else:
            self.__field_dunno1=UNKNOWN(value,**{'sizeinbytes': 3})

    def __delfield_dunno1(self): del self.__field_dunno1

    dunno1=property(__getfield_dunno1, __setfield_dunno1, __delfield_dunno1, None)

    def __getfield_esn(self):
        return self.__field_esn.getvalue()

    def __setfield_esn(self, value):
        if isinstance(value,UINT):
            self.__field_esn=value
        else:
            self.__field_esn=UINT(value,**{'sizeinbytes': 4})

    def __delfield_esn(self): del self.__field_esn

    esn=property(__getfield_esn, __setfield_esn, __delfield_esn, None)

    def __getfield_flag0(self):
        return self.__field_flag0.getvalue()

    def __setfield_flag0(self, value):
        if isinstance(value,UINT):
            self.__field_flag0=value
        else:
            self.__field_flag0=UINT(value,**{'sizeinbytes': 1})

    def __delfield_flag0(self): del self.__field_flag0

    flag0=property(__getfield_flag0, __setfield_flag0, __delfield_flag0, None)

    def __getfield_dunno2(self):
        return self.__field_dunno2.getvalue()

    def __setfield_dunno2(self, value):
        if isinstance(value,UNKNOWN):
            self.__field_dunno2=value
        else:
            self.__field_dunno2=UNKNOWN(value,**{'sizeinbytes': 14})

    def __delfield_dunno2(self): del self.__field_dunno2

    dunno2=property(__getfield_dunno2, __setfield_dunno2, __delfield_dunno2, None)

    def __getfield_ready(self):
        return self.__field_ready.getvalue()

    def __setfield_ready(self, value):
        if isinstance(value,UINT):
            self.__field_ready=value
        else:
            self.__field_ready=UINT(value,**{'sizeinbytes': 1})

    def __delfield_ready(self): del self.__field_ready

    ready=property(__getfield_ready, __setfield_ready, __delfield_ready, None)

    def __getfield_dunno3(self):
        return self.__field_dunno3.getvalue()

    def __setfield_dunno3(self, value):
        if isinstance(value,UINT):
            self.__field_dunno3=value
        else:
            self.__field_dunno3=UINT(value,**{'sizeinbytes': 1})

    def __delfield_dunno3(self): del self.__field_dunno3

    dunno3=property(__getfield_dunno3, __setfield_dunno3, __delfield_dunno3, None)

    def __getfield_flag2(self):
        return self.__field_flag2.getvalue()

    def __setfield_flag2(self, value):
        if isinstance(value,UINT):
            self.__field_flag2=value
        else:
            self.__field_flag2=UINT(value,**{'sizeinbytes': 1})

    def __delfield_flag2(self): del self.__field_flag2

    flag2=property(__getfield_flag2, __setfield_flag2, __delfield_flag2, None)

    def __getfield_dunno4(self):
        return self.__field_dunno4.getvalue()

    def __setfield_dunno4(self, value):
        if isinstance(value,UNKNOWN):
            self.__field_dunno4=value
        else:
            self.__field_dunno4=UNKNOWN(value,**{'sizeinbytes': 6})

    def __delfield_dunno4(self): del self.__field_dunno4

    dunno4=property(__getfield_dunno4, __setfield_dunno4, __delfield_dunno4, None)

    def __getfield_flag3(self):
        return self.__field_flag3.getvalue()

    def __setfield_flag3(self, value):
        if isinstance(value,UINT):
            self.__field_flag3=value
        else:
            self.__field_flag3=UINT(value,**{'sizeinbytes': 1})

    def __delfield_flag3(self): del self.__field_flag3

    flag3=property(__getfield_flag3, __setfield_flag3, __delfield_flag3, None)

    def __getfield_unknown(self):
        return self.__field_unknown.getvalue()

    def __setfield_unknown(self, value):
        if isinstance(value,UNKNOWN):
            self.__field_unknown=value
        else:
            self.__field_unknown=UNKNOWN(value,)

    def __delfield_unknown(self): del self.__field_unknown

    unknown=property(__getfield_unknown, __setfield_unknown, __delfield_unknown, None)

    def iscontainer(self):
        return True

    def containerelements(self):
        yield ('readyvalue', self.__field_readyvalue, None)
        yield ('command', self.__field_command, None)
        yield ('dunno1', self.__field_dunno1, None)
        yield ('esn', self.__field_esn, None)
        yield ('flag0', self.__field_flag0, None)
        yield ('dunno2', self.__field_dunno2, None)
        yield ('ready', self.__field_ready, None)
        yield ('dunno3', self.__field_dunno3, None)
        yield ('flag2', self.__field_flag2, None)
        yield ('dunno4', self.__field_dunno4, None)
        yield ('flag3', self.__field_flag3, None)
        yield ('unknown', self.__field_unknown, None)




class writeenable(BaseProtogenClass):
    __fields=['c1', 'c2', 'c3', 'c4', 'c5', 'c6', 'c7', 'c8', 'c9', 'c10', 'c11', 'c12', 'c13', 'c14', 'c15', 'c16']

    def __init__(self, *args, **kwargs):
        dict={}
        # What was supplied to this function
        dict.update(kwargs)
        # Parent constructor
        super(writeenable,self).__init__(**dict)
        if self.__class__ is writeenable:
            self._update(args,dict)


    def getfields(self):
        return self.__fields


    def _update(self, args, kwargs):
        super(writeenable,self)._update(args,kwargs)
        keys=kwargs.keys()
        for key in keys:
            if key in self.__fields:
                setattr(self, key, kwargs[key])
                del kwargs[key]
        # Were any unrecognized kwargs passed in?
        if __debug__:
            self._complainaboutunusedargs(writeenable,kwargs)
        if len(args): raise TypeError('Unexpected arguments supplied: '+`args`)
        # Make all P fields that haven't already been constructed


    def writetobuffer(self,buf,autolog=True,logtitle="<written data>"):
        'Writes this packet to the supplied buffer'
        self._bufferstartoffset=buf.getcurrentoffset()
        try: self.__field_c1
        except:
            self.__field_c1=UINT(**{'sizeinbytes': 1, 'constant': 0x46})
        self.__field_c1.writetobuffer(buf)
        try: self.__field_c2
        except:
            self.__field_c2=UINT(**{'sizeinbytes': 1, 'constant': 0x01})
        self.__field_c2.writetobuffer(buf)
        try: self.__field_c3
        except:
            self.__field_c3=UINT(**{'sizeinbytes': 1, 'constant': 0xf2})
        self.__field_c3.writetobuffer(buf)
        try: self.__field_c4
        except:
            self.__field_c4=UINT(**{'sizeinbytes': 1, 'constant': 0x03})
        self.__field_c4.writetobuffer(buf)
        try: self.__field_c5
        except:
            self.__field_c5=UINT(**{'sizeinbytes': 1, 'constant': 0x0f})
        self.__field_c5.writetobuffer(buf)
        try: self.__field_c6
        except:
            self.__field_c6=UINT(**{'sizeinbytes': 1, 'constant': 0x5f})
        self.__field_c6.writetobuffer(buf)
        try: self.__field_c7
        except:
            self.__field_c7=UINT(**{'sizeinbytes': 1, 'constant': 0x67})
        self.__field_c7.writetobuffer(buf)
        try: self.__field_c8
        except:
            self.__field_c8=UINT(**{'sizeinbytes': 1, 'constant': 0x8f})
        self.__field_c8.writetobuffer(buf)
        try: self.__field_c9
        except:
            self.__field_c9=UINT(**{'sizeinbytes': 1, 'constant': 0xf9})
        self.__field_c9.writetobuffer(buf)
        try: self.__field_c10
        except:
            self.__field_c10=UINT(**{'sizeinbytes': 1, 'constant': 0xa2})
        self.__field_c10.writetobuffer(buf)
        try: self.__field_c11
        except:
            self.__field_c11=UINT(**{'sizeinbytes': 1, 'constant': 0x3f})
        self.__field_c11.writetobuffer(buf)
        try: self.__field_c12
        except:
            self.__field_c12=UINT(**{'sizeinbytes': 1, 'constant': 0x7d})
        self.__field_c12.writetobuffer(buf)
        try: self.__field_c13
        except:
            self.__field_c13=UINT(**{'sizeinbytes': 1, 'constant': 0x5e})
        self.__field_c13.writetobuffer(buf)
        try: self.__field_c14
        except:
            self.__field_c14=UINT(**{'sizeinbytes': 1, 'constant': 0x35})
        self.__field_c14.writetobuffer(buf)
        try: self.__field_c15
        except:
            self.__field_c15=UINT(**{'sizeinbytes': 1, 'constant': 0x5c})
        self.__field_c15.writetobuffer(buf)
        try: self.__field_c16
        except:
            self.__field_c16=UINT(**{'sizeinbytes': 1, 'constant': 0x7e})
        self.__field_c16.writetobuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()
        if autolog and self._bufferstartoffset==0: self.autologwrite(buf, logtitle=logtitle)


    def readfrombuffer(self,buf,autolog=True,logtitle="<read data>"):
        'Reads this packet from the supplied buffer'
        self._bufferstartoffset=buf.getcurrentoffset()
        if autolog and self._bufferstartoffset==0: self.autologread(buf, logtitle=logtitle)
        self.__field_c1=UINT(**{'sizeinbytes': 1, 'constant': 0x46})
        self.__field_c1.readfrombuffer(buf)
        self.__field_c2=UINT(**{'sizeinbytes': 1, 'constant': 0x01})
        self.__field_c2.readfrombuffer(buf)
        self.__field_c3=UINT(**{'sizeinbytes': 1, 'constant': 0xf2})
        self.__field_c3.readfrombuffer(buf)
        self.__field_c4=UINT(**{'sizeinbytes': 1, 'constant': 0x03})
        self.__field_c4.readfrombuffer(buf)
        self.__field_c5=UINT(**{'sizeinbytes': 1, 'constant': 0x0f})
        self.__field_c5.readfrombuffer(buf)
        self.__field_c6=UINT(**{'sizeinbytes': 1, 'constant': 0x5f})
        self.__field_c6.readfrombuffer(buf)
        self.__field_c7=UINT(**{'sizeinbytes': 1, 'constant': 0x67})
        self.__field_c7.readfrombuffer(buf)
        self.__field_c8=UINT(**{'sizeinbytes': 1, 'constant': 0x8f})
        self.__field_c8.readfrombuffer(buf)
        self.__field_c9=UINT(**{'sizeinbytes': 1, 'constant': 0xf9})
        self.__field_c9.readfrombuffer(buf)
        self.__field_c10=UINT(**{'sizeinbytes': 1, 'constant': 0xa2})
        self.__field_c10.readfrombuffer(buf)
        self.__field_c11=UINT(**{'sizeinbytes': 1, 'constant': 0x3f})
        self.__field_c11.readfrombuffer(buf)
        self.__field_c12=UINT(**{'sizeinbytes': 1, 'constant': 0x7d})
        self.__field_c12.readfrombuffer(buf)
        self.__field_c13=UINT(**{'sizeinbytes': 1, 'constant': 0x5e})
        self.__field_c13.readfrombuffer(buf)
        self.__field_c14=UINT(**{'sizeinbytes': 1, 'constant': 0x35})
        self.__field_c14.readfrombuffer(buf)
        self.__field_c15=UINT(**{'sizeinbytes': 1, 'constant': 0x5c})
        self.__field_c15.readfrombuffer(buf)
        self.__field_c16=UINT(**{'sizeinbytes': 1, 'constant': 0x7e})
        self.__field_c16.readfrombuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()


    def __getfield_c1(self):
        try: self.__field_c1
        except:
            self.__field_c1=UINT(**{'sizeinbytes': 1, 'constant': 0x46})
        return self.__field_c1.getvalue()

    def __setfield_c1(self, value):
        if isinstance(value,UINT):
            self.__field_c1=value
        else:
            self.__field_c1=UINT(value,**{'sizeinbytes': 1, 'constant': 0x46})

    def __delfield_c1(self): del self.__field_c1

    c1=property(__getfield_c1, __setfield_c1, __delfield_c1, None)

    def __getfield_c2(self):
        try: self.__field_c2
        except:
            self.__field_c2=UINT(**{'sizeinbytes': 1, 'constant': 0x01})
        return self.__field_c2.getvalue()

    def __setfield_c2(self, value):
        if isinstance(value,UINT):
            self.__field_c2=value
        else:
            self.__field_c2=UINT(value,**{'sizeinbytes': 1, 'constant': 0x01})

    def __delfield_c2(self): del self.__field_c2

    c2=property(__getfield_c2, __setfield_c2, __delfield_c2, None)

    def __getfield_c3(self):
        try: self.__field_c3
        except:
            self.__field_c3=UINT(**{'sizeinbytes': 1, 'constant': 0xf2})
        return self.__field_c3.getvalue()

    def __setfield_c3(self, value):
        if isinstance(value,UINT):
            self.__field_c3=value
        else:
            self.__field_c3=UINT(value,**{'sizeinbytes': 1, 'constant': 0xf2})

    def __delfield_c3(self): del self.__field_c3

    c3=property(__getfield_c3, __setfield_c3, __delfield_c3, None)

    def __getfield_c4(self):
        try: self.__field_c4
        except:
            self.__field_c4=UINT(**{'sizeinbytes': 1, 'constant': 0x03})
        return self.__field_c4.getvalue()

    def __setfield_c4(self, value):
        if isinstance(value,UINT):
            self.__field_c4=value
        else:
            self.__field_c4=UINT(value,**{'sizeinbytes': 1, 'constant': 0x03})

    def __delfield_c4(self): del self.__field_c4

    c4=property(__getfield_c4, __setfield_c4, __delfield_c4, None)

    def __getfield_c5(self):
        try: self.__field_c5
        except:
            self.__field_c5=UINT(**{'sizeinbytes': 1, 'constant': 0x0f})
        return self.__field_c5.getvalue()

    def __setfield_c5(self, value):
        if isinstance(value,UINT):
            self.__field_c5=value
        else:
            self.__field_c5=UINT(value,**{'sizeinbytes': 1, 'constant': 0x0f})

    def __delfield_c5(self): del self.__field_c5

    c5=property(__getfield_c5, __setfield_c5, __delfield_c5, None)

    def __getfield_c6(self):
        try: self.__field_c6
        except:
            self.__field_c6=UINT(**{'sizeinbytes': 1, 'constant': 0x5f})
        return self.__field_c6.getvalue()

    def __setfield_c6(self, value):
        if isinstance(value,UINT):
            self.__field_c6=value
        else:
            self.__field_c6=UINT(value,**{'sizeinbytes': 1, 'constant': 0x5f})

    def __delfield_c6(self): del self.__field_c6

    c6=property(__getfield_c6, __setfield_c6, __delfield_c6, None)

    def __getfield_c7(self):
        try: self.__field_c7
        except:
            self.__field_c7=UINT(**{'sizeinbytes': 1, 'constant': 0x67})
        return self.__field_c7.getvalue()

    def __setfield_c7(self, value):
        if isinstance(value,UINT):
            self.__field_c7=value
        else:
            self.__field_c7=UINT(value,**{'sizeinbytes': 1, 'constant': 0x67})

    def __delfield_c7(self): del self.__field_c7

    c7=property(__getfield_c7, __setfield_c7, __delfield_c7, None)

    def __getfield_c8(self):
        try: self.__field_c8
        except:
            self.__field_c8=UINT(**{'sizeinbytes': 1, 'constant': 0x8f})
        return self.__field_c8.getvalue()

    def __setfield_c8(self, value):
        if isinstance(value,UINT):
            self.__field_c8=value
        else:
            self.__field_c8=UINT(value,**{'sizeinbytes': 1, 'constant': 0x8f})

    def __delfield_c8(self): del self.__field_c8

    c8=property(__getfield_c8, __setfield_c8, __delfield_c8, None)

    def __getfield_c9(self):
        try: self.__field_c9
        except:
            self.__field_c9=UINT(**{'sizeinbytes': 1, 'constant': 0xf9})
        return self.__field_c9.getvalue()

    def __setfield_c9(self, value):
        if isinstance(value,UINT):
            self.__field_c9=value
        else:
            self.__field_c9=UINT(value,**{'sizeinbytes': 1, 'constant': 0xf9})

    def __delfield_c9(self): del self.__field_c9

    c9=property(__getfield_c9, __setfield_c9, __delfield_c9, None)

    def __getfield_c10(self):
        try: self.__field_c10
        except:
            self.__field_c10=UINT(**{'sizeinbytes': 1, 'constant': 0xa2})
        return self.__field_c10.getvalue()

    def __setfield_c10(self, value):
        if isinstance(value,UINT):
            self.__field_c10=value
        else:
            self.__field_c10=UINT(value,**{'sizeinbytes': 1, 'constant': 0xa2})

    def __delfield_c10(self): del self.__field_c10

    c10=property(__getfield_c10, __setfield_c10, __delfield_c10, None)

    def __getfield_c11(self):
        try: self.__field_c11
        except:
            self.__field_c11=UINT(**{'sizeinbytes': 1, 'constant': 0x3f})
        return self.__field_c11.getvalue()

    def __setfield_c11(self, value):
        if isinstance(value,UINT):
            self.__field_c11=value
        else:
            self.__field_c11=UINT(value,**{'sizeinbytes': 1, 'constant': 0x3f})

    def __delfield_c11(self): del self.__field_c11

    c11=property(__getfield_c11, __setfield_c11, __delfield_c11, None)

    def __getfield_c12(self):
        try: self.__field_c12
        except:
            self.__field_c12=UINT(**{'sizeinbytes': 1, 'constant': 0x7d})
        return self.__field_c12.getvalue()

    def __setfield_c12(self, value):
        if isinstance(value,UINT):
            self.__field_c12=value
        else:
            self.__field_c12=UINT(value,**{'sizeinbytes': 1, 'constant': 0x7d})

    def __delfield_c12(self): del self.__field_c12

    c12=property(__getfield_c12, __setfield_c12, __delfield_c12, None)

    def __getfield_c13(self):
        try: self.__field_c13
        except:
            self.__field_c13=UINT(**{'sizeinbytes': 1, 'constant': 0x5e})
        return self.__field_c13.getvalue()

    def __setfield_c13(self, value):
        if isinstance(value,UINT):
            self.__field_c13=value
        else:
            self.__field_c13=UINT(value,**{'sizeinbytes': 1, 'constant': 0x5e})

    def __delfield_c13(self): del self.__field_c13

    c13=property(__getfield_c13, __setfield_c13, __delfield_c13, None)

    def __getfield_c14(self):
        try: self.__field_c14
        except:
            self.__field_c14=UINT(**{'sizeinbytes': 1, 'constant': 0x35})
        return self.__field_c14.getvalue()

    def __setfield_c14(self, value):
        if isinstance(value,UINT):
            self.__field_c14=value
        else:
            self.__field_c14=UINT(value,**{'sizeinbytes': 1, 'constant': 0x35})

    def __delfield_c14(self): del self.__field_c14

    c14=property(__getfield_c14, __setfield_c14, __delfield_c14, None)

    def __getfield_c15(self):
        try: self.__field_c15
        except:
            self.__field_c15=UINT(**{'sizeinbytes': 1, 'constant': 0x5c})
        return self.__field_c15.getvalue()

    def __setfield_c15(self, value):
        if isinstance(value,UINT):
            self.__field_c15=value
        else:
            self.__field_c15=UINT(value,**{'sizeinbytes': 1, 'constant': 0x5c})

    def __delfield_c15(self): del self.__field_c15

    c15=property(__getfield_c15, __setfield_c15, __delfield_c15, None)

    def __getfield_c16(self):
        try: self.__field_c16
        except:
            self.__field_c16=UINT(**{'sizeinbytes': 1, 'constant': 0x7e})
        return self.__field_c16.getvalue()

    def __setfield_c16(self, value):
        if isinstance(value,UINT):
            self.__field_c16=value
        else:
            self.__field_c16=UINT(value,**{'sizeinbytes': 1, 'constant': 0x7e})

    def __delfield_c16(self): del self.__field_c16

    c16=property(__getfield_c16, __setfield_c16, __delfield_c16, None)

    def iscontainer(self):
        return True

    def containerelements(self):
        yield ('c1', self.__field_c1, None)
        yield ('c2', self.__field_c2, None)
        yield ('c3', self.__field_c3, None)
        yield ('c4', self.__field_c4, None)
        yield ('c5', self.__field_c5, None)
        yield ('c6', self.__field_c6, None)
        yield ('c7', self.__field_c7, None)
        yield ('c8', self.__field_c8, None)
        yield ('c9', self.__field_c9, None)
        yield ('c10', self.__field_c10, None)
        yield ('c11', self.__field_c11, None)
        yield ('c12', self.__field_c12, None)
        yield ('c13', self.__field_c13, None)
        yield ('c14', self.__field_c14, None)
        yield ('c15', self.__field_c15, None)
        yield ('c16', self.__field_c16, None)




class writeenableresponse(BaseProtogenClass):
    __fields=['unknown']

    def __init__(self, *args, **kwargs):
        dict={}
        # What was supplied to this function
        dict.update(kwargs)
        # Parent constructor
        super(writeenableresponse,self).__init__(**dict)
        if self.__class__ is writeenableresponse:
            self._update(args,dict)


    def getfields(self):
        return self.__fields


    def _update(self, args, kwargs):
        super(writeenableresponse,self)._update(args,kwargs)
        keys=kwargs.keys()
        for key in keys:
            if key in self.__fields:
                setattr(self, key, kwargs[key])
                del kwargs[key]
        # Were any unrecognized kwargs passed in?
        if __debug__:
            self._complainaboutunusedargs(writeenableresponse,kwargs)
        if len(args):
            dict2={}
            dict2.update(kwargs)
            kwargs=dict2
            self.__field_unknown=UNKNOWN(*args,**dict2)
        # Make all P fields that haven't already been constructed


    def writetobuffer(self,buf,autolog=True,logtitle="<written data>"):
        'Writes this packet to the supplied buffer'
        self._bufferstartoffset=buf.getcurrentoffset()
        self.__field_unknown.writetobuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()
        if autolog and self._bufferstartoffset==0: self.autologwrite(buf, logtitle=logtitle)


    def readfrombuffer(self,buf,autolog=True,logtitle="<read data>"):
        'Reads this packet from the supplied buffer'
        self._bufferstartoffset=buf.getcurrentoffset()
        if autolog and self._bufferstartoffset==0: self.autologread(buf, logtitle=logtitle)
        self.__field_unknown=UNKNOWN()
        self.__field_unknown.readfrombuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()


    def __getfield_unknown(self):
        return self.__field_unknown.getvalue()

    def __setfield_unknown(self, value):
        if isinstance(value,UNKNOWN):
            self.__field_unknown=value
        else:
            self.__field_unknown=UNKNOWN(value,)

    def __delfield_unknown(self): del self.__field_unknown

    unknown=property(__getfield_unknown, __setfield_unknown, __delfield_unknown, None)

    def iscontainer(self):
        return True

    def containerelements(self):
        yield ('unknown', self.__field_unknown, None)




