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

"""Descriptions of Sanyo Media Packets"""

from prototypes import *

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

class sanyomediaheader(BaseProtogenClass):
    __fields=['fa', 'faset', 'command', 'pad']

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


    def getfields(self):
        return self.__fields


    def _update(self, args, kwargs):
        super(sanyomediaheader,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(sanyomediaheader,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_fa
        except:
            self.__field_fa=UINT(**{'sizeinbytes': 2, 'constant': 0xfa})
        self.__field_fa.writetobuffer(buf)
        try: self.__field_faset
        except:
            self.__field_faset=UINT(**{'sizeinbytes': 1, 'default': 0x09})
        self.__field_faset.writetobuffer(buf)
        self.__field_command.writetobuffer(buf)
        try: self.__field_pad
        except:
            self.__field_pad=UINT(**{'sizeinbytes': 2, 'default': 0xffff})
        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_fa=UINT(**{'sizeinbytes': 2, 'constant': 0xfa})
        self.__field_fa.readfrombuffer(buf)
        self.__field_faset=UINT(**{'sizeinbytes': 1, 'default': 0x09})
        self.__field_faset.readfrombuffer(buf)
        self.__field_command=UINT(**{'sizeinbytes': 2})
        self.__field_command.readfrombuffer(buf)
        self.__field_pad=UINT(**{'sizeinbytes': 2, 'default': 0xffff})
        self.__field_pad.readfrombuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()


    def __getfield_fa(self):
        try: self.__field_fa
        except:
            self.__field_fa=UINT(**{'sizeinbytes': 2, 'constant': 0xfa})
        return self.__field_fa.getvalue()

    def __setfield_fa(self, value):
        if isinstance(value,UINT):
            self.__field_fa=value
        else:
            self.__field_fa=UINT(value,**{'sizeinbytes': 2, 'constant': 0xfa})

    def __delfield_fa(self): del self.__field_fa

    fa=property(__getfield_fa, __setfield_fa, __delfield_fa, None)

    def __getfield_faset(self):
        try: self.__field_faset
        except:
            self.__field_faset=UINT(**{'sizeinbytes': 1, 'default': 0x09})
        return self.__field_faset.getvalue()

    def __setfield_faset(self, value):
        if isinstance(value,UINT):
            self.__field_faset=value
        else:
            self.__field_faset=UINT(value,**{'sizeinbytes': 1, 'default': 0x09})

    def __delfield_faset(self): del self.__field_faset

    faset=property(__getfield_faset, __setfield_faset, __delfield_faset, 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': 2})

    def __delfield_command(self): del self.__field_command

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

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

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

    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 ('fa', self.__field_fa, None)
        yield ('faset', self.__field_faset, None)
        yield ('command', self.__field_command, None)
        yield ('pad', self.__field_pad, None)




class sanyochangedir(BaseProtogenClass):
    __fields=['header', 'pad', 'dirindex']

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


    def getfields(self):
        return self.__fields


    def _update(self, args, kwargs):
        super(sanyochangedir,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(sanyochangedir,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=sanyomediaheader(**{'command': 0x71})
        self.__field_header.writetobuffer(buf)
        try: self.__field_pad
        except:
            self.__field_pad=UNKNOWN(**{'sizeinbytes': 170})
        self.__field_pad.writetobuffer(buf)
        self.__field_dirindex.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=sanyomediaheader(**{'command': 0x71})
        self.__field_header.readfrombuffer(buf)
        self.__field_pad=UNKNOWN(**{'sizeinbytes': 170})
        self.__field_pad.readfrombuffer(buf)
        self.__field_dirindex=UINT(**{'sizeinbytes': 2})
        self.__field_dirindex.readfrombuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()


    def __getfield_header(self):
        try: self.__field_header
        except:
            self.__field_header=sanyomediaheader(**{'command': 0x71})
        return self.__field_header.getvalue()

    def __setfield_header(self, value):
        if isinstance(value,sanyomediaheader):
            self.__field_header=value
        else:
            self.__field_header=sanyomediaheader(value,**{'command': 0x71})

    def __delfield_header(self): del self.__field_header

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

    def __getfield_pad(self):
        try: self.__field_pad
        except:
            self.__field_pad=UNKNOWN(**{'sizeinbytes': 170})
        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': 170})

    def __delfield_pad(self): del self.__field_pad

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

    def __getfield_dirindex(self):
        return self.__field_dirindex.getvalue()

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

    def __delfield_dirindex(self): del self.__field_dirindex

    dirindex=property(__getfield_dirindex, __setfield_dirindex, __delfield_dirindex, None)

    def iscontainer(self):
        return True

    def containerelements(self):
        yield ('header', self.__field_header, None)
        yield ('pad', self.__field_pad, None)
        yield ('dirindex', self.__field_dirindex, None)




class sanyochangedirresponse(BaseProtogenClass):
    __fields=['header', 'pad', 'status', 'dirindex']

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


    def getfields(self):
        return self.__fields


    def _update(self, args, kwargs):
        super(sanyochangedirresponse,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(sanyochangedirresponse,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)
        try: self.__field_pad
        except:
            self.__field_pad=UNKNOWN(**{'sizeinbytes': 169})
        self.__field_pad.writetobuffer(buf)
        self.__field_status.writetobuffer(buf)
        self.__field_dirindex.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=sanyomediaheader()
        self.__field_header.readfrombuffer(buf)
        self.__field_pad=UNKNOWN(**{'sizeinbytes': 169})
        self.__field_pad.readfrombuffer(buf)
        self.__field_status=UINT(**{'sizeinbytes': 1})
        self.__field_status.readfrombuffer(buf)
        self.__field_dirindex=UINT(**{'sizeinbytes': 2})
        self.__field_dirindex.readfrombuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()


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

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

    def __delfield_header(self): del self.__field_header

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

    def __getfield_pad(self):
        try: self.__field_pad
        except:
            self.__field_pad=UNKNOWN(**{'sizeinbytes': 169})
        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': 169})

    def __delfield_pad(self): del self.__field_pad

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

    def __getfield_status(self):
        return self.__field_status.getvalue()

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

    def __delfield_status(self): del self.__field_status

    status=property(__getfield_status, __setfield_status, __delfield_status, None)

    def __getfield_dirindex(self):
        return self.__field_dirindex.getvalue()

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

    def __delfield_dirindex(self): del self.__field_dirindex

    dirindex=property(__getfield_dirindex, __setfield_dirindex, __delfield_dirindex, None)

    def iscontainer(self):
        return True

    def containerelements(self):
        yield ('header', self.__field_header, None)
        yield ('pad', self.__field_pad, None)
        yield ('status', self.__field_status, None)
        yield ('dirindex', self.__field_dirindex, None)




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

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


    def getfields(self):
        return self.__fields


    def _update(self, args, kwargs):
        super(sanyonumfilesrequest,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(sanyonumfilesrequest,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=sanyomediaheader(**{'command': 0x72})
        self.__field_header.writetobuffer(buf)
        try: self.__field_pad
        except:
            self.__field_pad=UNKNOWN(**{'sizeinbytes': 172})
        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=sanyomediaheader(**{'command': 0x72})
        self.__field_header.readfrombuffer(buf)
        self.__field_pad=UNKNOWN(**{'sizeinbytes': 172})
        self.__field_pad.readfrombuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()


    def __getfield_header(self):
        try: self.__field_header
        except:
            self.__field_header=sanyomediaheader(**{'command': 0x72})
        return self.__field_header.getvalue()

    def __setfield_header(self, value):
        if isinstance(value,sanyomediaheader):
            self.__field_header=value
        else:
            self.__field_header=sanyomediaheader(value,**{'command': 0x72})

    def __delfield_header(self): del self.__field_header

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

    def __getfield_pad(self):
        try: self.__field_pad
        except:
            self.__field_pad=UNKNOWN(**{'sizeinbytes': 172})
        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': 172})

    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 ('pad', self.__field_pad, None)




class sanyonumfilesresponse(BaseProtogenClass):
    __fields=['header', 'pad1', 'count', 'pad2']

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


    def getfields(self):
        return self.__fields


    def _update(self, args, kwargs):
        super(sanyonumfilesresponse,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(sanyonumfilesresponse,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)
        try: self.__field_pad1
        except:
            self.__field_pad1=UNKNOWN(**{'sizeinbytes': 165})
        self.__field_pad1.writetobuffer(buf)
        self.__field_count.writetobuffer(buf)
        try: self.__field_pad2
        except:
            self.__field_pad2=UNKNOWN(**{'sizeinbytes': 6})
        self.__field_pad2.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=sanyomediaheader()
        self.__field_header.readfrombuffer(buf)
        self.__field_pad1=UNKNOWN(**{'sizeinbytes': 165})
        self.__field_pad1.readfrombuffer(buf)
        self.__field_count=UINT(**{'sizeinbytes': 1})
        self.__field_count.readfrombuffer(buf)
        self.__field_pad2=UNKNOWN(**{'sizeinbytes': 6})
        self.__field_pad2.readfrombuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()


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

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

    def __delfield_header(self): del self.__field_header

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

    def __getfield_pad1(self):
        try: self.__field_pad1
        except:
            self.__field_pad1=UNKNOWN(**{'sizeinbytes': 165})
        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': 165})

    def __delfield_pad1(self): del self.__field_pad1

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

    def __getfield_count(self):
        return self.__field_count.getvalue()

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

    def __delfield_count(self): del self.__field_count

    count=property(__getfield_count, __setfield_count, __delfield_count, None)

    def __getfield_pad2(self):
        try: self.__field_pad2
        except:
            self.__field_pad2=UNKNOWN(**{'sizeinbytes': 6})
        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': 6})

    def __delfield_pad2(self): del self.__field_pad2

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

    def iscontainer(self):
        return True

    def containerelements(self):
        yield ('header', self.__field_header, None)
        yield ('pad1', self.__field_pad1, None)
        yield ('count', self.__field_count, None)
        yield ('pad2', self.__field_pad2, None)




class sanyomediafilenamerequest(BaseProtogenClass):
    __fields=['header', 'pad1', 'index', 'pad2']

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


    def getfields(self):
        return self.__fields


    def _update(self, args, kwargs):
        super(sanyomediafilenamerequest,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(sanyomediafilenamerequest,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=sanyomediaheader(**{'command': 0x73})
        self.__field_header.writetobuffer(buf)
        try: self.__field_pad1
        except:
            self.__field_pad1=UNKNOWN(**{'sizeinbytes': 161})
        self.__field_pad1.writetobuffer(buf)
        self.__field_index.writetobuffer(buf)
        try: self.__field_pad2
        except:
            self.__field_pad2=UNKNOWN(**{'sizeinbytes': 10})
        self.__field_pad2.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=sanyomediaheader(**{'command': 0x73})
        self.__field_header.readfrombuffer(buf)
        self.__field_pad1=UNKNOWN(**{'sizeinbytes': 161})
        self.__field_pad1.readfrombuffer(buf)
        self.__field_index=UINT(**{'sizeinbytes': 1})
        self.__field_index.readfrombuffer(buf)
        self.__field_pad2=UNKNOWN(**{'sizeinbytes': 10})
        self.__field_pad2.readfrombuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()


    def __getfield_header(self):
        try: self.__field_header
        except:
            self.__field_header=sanyomediaheader(**{'command': 0x73})
        return self.__field_header.getvalue()

    def __setfield_header(self, value):
        if isinstance(value,sanyomediaheader):
            self.__field_header=value
        else:
            self.__field_header=sanyomediaheader(value,**{'command': 0x73})

    def __delfield_header(self): del self.__field_header

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

    def __getfield_pad1(self):
        try: self.__field_pad1
        except:
            self.__field_pad1=UNKNOWN(**{'sizeinbytes': 161})
        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': 161})

    def __delfield_pad1(self): del self.__field_pad1

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

    def __getfield_index(self):
        return self.__field_index.getvalue()

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

    def __delfield_index(self): del self.__field_index

    index=property(__getfield_index, __setfield_index, __delfield_index, None)

    def __getfield_pad2(self):
        try: self.__field_pad2
        except:
            self.__field_pad2=UNKNOWN(**{'sizeinbytes': 10})
        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': 10})

    def __delfield_pad2(self): del self.__field_pad2

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

    def iscontainer(self):
        return True

    def containerelements(self):
        yield ('header', self.__field_header, None)
        yield ('pad1', self.__field_pad1, None)
        yield ('index', self.__field_index, None)
        yield ('pad2', self.__field_pad2, None)




class sanyomediafilenameresponse(BaseProtogenClass):
    __fields=['header', 'pad1', 'filename', 'num1', 'pad2', 'num2', 'pad3', 'num3', 'pad4', 'num4', 'pad5']

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


    def getfields(self):
        return self.__fields


    def _update(self, args, kwargs):
        super(sanyomediafilenameresponse,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(sanyomediafilenameresponse,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_pad1.writetobuffer(buf)
        self.__field_filename.writetobuffer(buf)
        self.__field_num1.writetobuffer(buf)
        self.__field_pad2.writetobuffer(buf)
        self.__field_num2.writetobuffer(buf)
        self.__field_pad3.writetobuffer(buf)
        self.__field_num3.writetobuffer(buf)
        self.__field_pad4.writetobuffer(buf)
        self.__field_num4.writetobuffer(buf)
        self.__field_pad5.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=sanyomediaheader()
        self.__field_header.readfrombuffer(buf)
        self.__field_pad1=UINT(**{'sizeinbytes': 1})
        self.__field_pad1.readfrombuffer(buf)
        self.__field_filename=USTRING(**{'sizeinbytes': 154})
        self.__field_filename.readfrombuffer(buf)
        self.__field_num1=UINT(**{'sizeinbytes': 1})
        self.__field_num1.readfrombuffer(buf)
        self.__field_pad2=UNKNOWN(**{'sizeinbytes': 1})
        self.__field_pad2.readfrombuffer(buf)
        self.__field_num2=UINT(**{'sizeinbytes': 1})
        self.__field_num2.readfrombuffer(buf)
        self.__field_pad3=UNKNOWN(**{'sizeinbytes': 1})
        self.__field_pad3.readfrombuffer(buf)
        self.__field_num3=UINT(**{'sizeinbytes': 1})
        self.__field_num3.readfrombuffer(buf)
        self.__field_pad4=UNKNOWN(**{'sizeinbytes': 1})
        self.__field_pad4.readfrombuffer(buf)
        self.__field_num4=UINT(**{'sizeinbytes': 1})
        self.__field_num4.readfrombuffer(buf)
        self.__field_pad5=UNKNOWN(**{'sizeinbytes': 10})
        self.__field_pad5.readfrombuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()


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

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

    def __delfield_header(self): del self.__field_header

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

    def __getfield_pad1(self):
        return self.__field_pad1.getvalue()

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

    def __delfield_pad1(self): del self.__field_pad1

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

    def __getfield_filename(self):
        return self.__field_filename.getvalue()

    def __setfield_filename(self, value):
        if isinstance(value,USTRING):
            self.__field_filename=value
        else:
            self.__field_filename=USTRING(value,**{'sizeinbytes': 154})

    def __delfield_filename(self): del self.__field_filename

    filename=property(__getfield_filename, __setfield_filename, __delfield_filename, None)

    def __getfield_num1(self):
        return self.__field_num1.getvalue()

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

    def __delfield_num1(self): del self.__field_num1

    num1=property(__getfield_num1, __setfield_num1, __delfield_num1, None)

    def __getfield_pad2(self):
        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_num2(self):
        return self.__field_num2.getvalue()

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

    def __delfield_num2(self): del self.__field_num2

    num2=property(__getfield_num2, __setfield_num2, __delfield_num2, None)

    def __getfield_pad3(self):
        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_num3(self):
        return self.__field_num3.getvalue()

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

    def __delfield_num3(self): del self.__field_num3

    num3=property(__getfield_num3, __setfield_num3, __delfield_num3, None)

    def __getfield_pad4(self):
        return self.__field_pad4.getvalue()

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

    def __delfield_pad4(self): del self.__field_pad4

    pad4=property(__getfield_pad4, __setfield_pad4, __delfield_pad4, None)

    def __getfield_num4(self):
        return self.__field_num4.getvalue()

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

    def __delfield_num4(self): del self.__field_num4

    num4=property(__getfield_num4, __setfield_num4, __delfield_num4, None)

    def __getfield_pad5(self):
        return self.__field_pad5.getvalue()

    def __setfield_pad5(self, value):
        if isinstance(value,UNKNOWN):
            self.__field_pad5=value
        else:
            self.__field_pad5=UNKNOWN(value,**{'sizeinbytes': 10})

    def __delfield_pad5(self): del self.__field_pad5

    pad5=property(__getfield_pad5, __setfield_pad5, __delfield_pad5, None)

    def iscontainer(self):
        return True

    def containerelements(self):
        yield ('header', self.__field_header, None)
        yield ('pad1', self.__field_pad1, None)
        yield ('filename', self.__field_filename, None)
        yield ('num1', self.__field_num1, None)
        yield ('pad2', self.__field_pad2, None)
        yield ('num2', self.__field_num2, None)
        yield ('pad3', self.__field_pad3, None)
        yield ('num3', self.__field_num3, None)
        yield ('pad4', self.__field_pad4, None)
        yield ('num4', self.__field_num4, None)
        yield ('pad5', self.__field_pad5, None)




class sanyomediafragmentrequest(BaseProtogenClass):
    __fields=['header', 'pad1', 'fileindex', 'pad2']

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


    def getfields(self):
        return self.__fields


    def _update(self, args, kwargs):
        super(sanyomediafragmentrequest,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(sanyomediafragmentrequest,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=sanyomediaheader(**{'command': 0x74})
        self.__field_header.writetobuffer(buf)
        try: self.__field_pad1
        except:
            self.__field_pad1=UNKNOWN(**{'sizeinbytes': 155})
        self.__field_pad1.writetobuffer(buf)
        self.__field_fileindex.writetobuffer(buf)
        try: self.__field_pad2
        except:
            self.__field_pad2=UNKNOWN(**{'sizeinbytes': 16})
        self.__field_pad2.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=sanyomediaheader(**{'command': 0x74})
        self.__field_header.readfrombuffer(buf)
        self.__field_pad1=UNKNOWN(**{'sizeinbytes': 155})
        self.__field_pad1.readfrombuffer(buf)
        self.__field_fileindex=UINT(**{'sizeinbytes': 1})
        self.__field_fileindex.readfrombuffer(buf)
        self.__field_pad2=UNKNOWN(**{'sizeinbytes': 16})
        self.__field_pad2.readfrombuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()


    def __getfield_header(self):
        try: self.__field_header
        except:
            self.__field_header=sanyomediaheader(**{'command': 0x74})
        return self.__field_header.getvalue()

    def __setfield_header(self, value):
        if isinstance(value,sanyomediaheader):
            self.__field_header=value
        else:
            self.__field_header=sanyomediaheader(value,**{'command': 0x74})

    def __delfield_header(self): del self.__field_header

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

    def __getfield_pad1(self):
        try: self.__field_pad1
        except:
            self.__field_pad1=UNKNOWN(**{'sizeinbytes': 155})
        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': 155})

    def __delfield_pad1(self): del self.__field_pad1

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

    def __getfield_fileindex(self):
        return self.__field_fileindex.getvalue()

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

    def __delfield_fileindex(self): del self.__field_fileindex

    fileindex=property(__getfield_fileindex, __setfield_fileindex, __delfield_fileindex, None)

    def __getfield_pad2(self):
        try: self.__field_pad2
        except:
            self.__field_pad2=UNKNOWN(**{'sizeinbytes': 16})
        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': 16})

    def __delfield_pad2(self): del self.__field_pad2

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

    def iscontainer(self):
        return True

    def containerelements(self):
        yield ('header', self.__field_header, None)
        yield ('pad1', self.__field_pad1, None)
        yield ('fileindex', self.__field_fileindex, None)
        yield ('pad2', self.__field_pad2, None)




class sanyomediafragmentresponse(BaseProtogenClass):
    __fields=['header', 'pad1', 'data', 'length', 'pad2', 'fileindex', 'pad3', 'more']

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


    def getfields(self):
        return self.__fields


    def _update(self, args, kwargs):
        super(sanyomediafragmentresponse,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(sanyomediafragmentresponse,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_pad1.writetobuffer(buf)
        self.__field_data.writetobuffer(buf)
        self.__field_length.writetobuffer(buf)
        self.__field_pad2.writetobuffer(buf)
        self.__field_fileindex.writetobuffer(buf)
        self.__field_pad3.writetobuffer(buf)
        self.__field_more.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=sanyomediaheader()
        self.__field_header.readfrombuffer(buf)
        self.__field_pad1=UNKNOWN(**{'sizeinbytes': 1})
        self.__field_pad1.readfrombuffer(buf)
        self.__field_data=DATA(**{'sizeinbytes': 150})
        self.__field_data.readfrombuffer(buf)
        self.__field_length=UINT(**{'sizeinbytes': 1})
        self.__field_length.readfrombuffer(buf)
        self.__field_pad2=UNKNOWN(**{'sizeinbytes': 3})
        self.__field_pad2.readfrombuffer(buf)
        self.__field_fileindex=UINT(**{'sizeinbytes': 1})
        self.__field_fileindex.readfrombuffer(buf)
        self.__field_pad3=UNKNOWN(**{'sizeinbytes': 15})
        self.__field_pad3.readfrombuffer(buf)
        self.__field_more=UINT(**{'sizeinbytes': 1})
        self.__field_more.readfrombuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()


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

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

    def __delfield_header(self): del self.__field_header

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

    def __getfield_pad1(self):
        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_data(self):
        return self.__field_data.getvalue()

    def __setfield_data(self, value):
        if isinstance(value,DATA):
            self.__field_data=value
        else:
            self.__field_data=DATA(value,**{'sizeinbytes': 150})

    def __delfield_data(self): del self.__field_data

    data=property(__getfield_data, __setfield_data, __delfield_data, None)

    def __getfield_length(self):
        return self.__field_length.getvalue()

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

    def __delfield_length(self): del self.__field_length

    length=property(__getfield_length, __setfield_length, __delfield_length, None)

    def __getfield_pad2(self):
        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': 3})

    def __delfield_pad2(self): del self.__field_pad2

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

    def __getfield_fileindex(self):
        return self.__field_fileindex.getvalue()

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

    def __delfield_fileindex(self): del self.__field_fileindex

    fileindex=property(__getfield_fileindex, __setfield_fileindex, __delfield_fileindex, None)

    def __getfield_pad3(self):
        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': 15})

    def __delfield_pad3(self): del self.__field_pad3

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

    def __getfield_more(self):
        return self.__field_more.getvalue()

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

    def __delfield_more(self): del self.__field_more

    more=property(__getfield_more, __setfield_more, __delfield_more, None)

    def iscontainer(self):
        return True

    def containerelements(self):
        yield ('header', self.__field_header, None)
        yield ('pad1', self.__field_pad1, None)
        yield ('data', self.__field_data, None)
        yield ('length', self.__field_length, None)
        yield ('pad2', self.__field_pad2, None)
        yield ('fileindex', self.__field_fileindex, None)
        yield ('pad3', self.__field_pad3, None)
        yield ('more', self.__field_more, None)




class sanyomediafilegragment(BaseProtogenClass):
    __fields=['header', 'word', 'len', 'data', 'pad']

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


    def getfields(self):
        return self.__fields


    def _update(self, args, kwargs):
        super(sanyomediafilegragment,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(sanyomediafilegragment,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=sanyomediaheader()
        self.__field_header.writetobuffer(buf)
        try: self.__field_word
        except:
            self.__field_word=UINT(**{'sizeinbytes': 2, 'constant': 0})
        self.__field_word.writetobuffer(buf)
        try: self.__field_len
        except:
            self.__field_len=UINT(**{'sizeinbytes': 1, 'constant': 150})
        self.__field_len.writetobuffer(buf)
        self.__field_data.writetobuffer(buf)
        try: self.__field_pad
        except:
            self.__field_pad=UNKNOWN(**{'sizeinbytes': 21})
        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=sanyomediaheader()
        self.__field_header.readfrombuffer(buf)
        self.__field_word=UINT(**{'sizeinbytes': 2, 'constant': 0})
        self.__field_word.readfrombuffer(buf)
        self.__field_len=UINT(**{'sizeinbytes': 1, 'constant': 150})
        self.__field_len.readfrombuffer(buf)
        self.__field_data=DATA(**{'sizeinbytes': 150})
        self.__field_data.readfrombuffer(buf)
        self.__field_pad=UNKNOWN(**{'sizeinbytes': 21})
        self.__field_pad.readfrombuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()


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

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

    def __delfield_header(self): del self.__field_header

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

    def __getfield_word(self):
        try: self.__field_word
        except:
            self.__field_word=UINT(**{'sizeinbytes': 2, 'constant': 0})
        return self.__field_word.getvalue()

    def __setfield_word(self, value):
        if isinstance(value,UINT):
            self.__field_word=value
        else:
            self.__field_word=UINT(value,**{'sizeinbytes': 2, 'constant': 0})

    def __delfield_word(self): del self.__field_word

    word=property(__getfield_word, __setfield_word, __delfield_word, None)

    def __getfield_len(self):
        try: self.__field_len
        except:
            self.__field_len=UINT(**{'sizeinbytes': 1, 'constant': 150})
        return self.__field_len.getvalue()

    def __setfield_len(self, value):
        if isinstance(value,UINT):
            self.__field_len=value
        else:
            self.__field_len=UINT(value,**{'sizeinbytes': 1, 'constant': 150})

    def __delfield_len(self): del self.__field_len

    len=property(__getfield_len, __setfield_len, __delfield_len, None)

    def __getfield_data(self):
        return self.__field_data.getvalue()

    def __setfield_data(self, value):
        if isinstance(value,DATA):
            self.__field_data=value
        else:
            self.__field_data=DATA(value,**{'sizeinbytes': 150})

    def __delfield_data(self): del self.__field_data

    data=property(__getfield_data, __setfield_data, __delfield_data, None)

    def __getfield_pad(self):
        try: self.__field_pad
        except:
            self.__field_pad=UNKNOWN(**{'sizeinbytes': 21})
        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': 21})

    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 ('word', self.__field_word, None)
        yield ('len', self.__field_len, None)
        yield ('data', self.__field_data, None)
        yield ('pad', self.__field_pad, None)




class sanyomediaresponse(BaseProtogenClass):
    __fields=['header', 'UNKNOWN']

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


    def getfields(self):
        return self.__fields


    def _update(self, args, kwargs):
        super(sanyomediaresponse,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(sanyomediaresponse,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_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_header=sanyomediaheader()
        self.__field_header.readfrombuffer(buf)
        self.__field_UNKNOWN=UNKNOWN()
        self.__field_UNKNOWN.readfrombuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()


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

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

    def __delfield_header(self): del self.__field_header

    header=property(__getfield_header, __setfield_header, __delfield_header, 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 ('header', self.__field_header, None)
        yield ('UNKNOWN', self.__field_UNKNOWN, None)




class sanyosendfilename(BaseProtogenClass):
    __fields=['header', 'payloadsize', 'filename', 'pad']

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


    def getfields(self):
        return self.__fields


    def _update(self, args, kwargs):
        super(sanyosendfilename,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(sanyosendfilename,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=sanyomediaheader(**{'command': 0xffa1, 'pad': 0, 'faset': 0x05})
        self.__field_header.writetobuffer(buf)
        try: self.__field_payloadsize
        except:
            self.__field_payloadsize=UINT(**{'sizeinbytes': 1, 'constant': 0x96})
        self.__field_payloadsize.writetobuffer(buf)
        try: self.__field_filename
        except:
            self.__field_filename=USTRING(**{'sizeinbytes': 150, 'default': ""})
        self.__field_filename.writetobuffer(buf)
        try: self.__field_pad
        except:
            self.__field_pad=UNKNOWN(**{'sizeinbytes': 21})
        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=sanyomediaheader(**{'command': 0xffa1, 'pad': 0, 'faset': 0x05})
        self.__field_header.readfrombuffer(buf)
        self.__field_payloadsize=UINT(**{'sizeinbytes': 1, 'constant': 0x96})
        self.__field_payloadsize.readfrombuffer(buf)
        self.__field_filename=USTRING(**{'sizeinbytes': 150, 'default': ""})
        self.__field_filename.readfrombuffer(buf)
        self.__field_pad=UNKNOWN(**{'sizeinbytes': 21})
        self.__field_pad.readfrombuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()


    def __getfield_header(self):
        try: self.__field_header
        except:
            self.__field_header=sanyomediaheader(**{'command': 0xffa1, 'pad': 0, 'faset': 0x05})
        return self.__field_header.getvalue()

    def __setfield_header(self, value):
        if isinstance(value,sanyomediaheader):
            self.__field_header=value
        else:
            self.__field_header=sanyomediaheader(value,**{'command': 0xffa1, 'pad': 0, 'faset': 0x05})

    def __delfield_header(self): del self.__field_header

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

    def __getfield_payloadsize(self):
        try: self.__field_payloadsize
        except:
            self.__field_payloadsize=UINT(**{'sizeinbytes': 1, 'constant': 0x96})
        return self.__field_payloadsize.getvalue()

    def __setfield_payloadsize(self, value):
        if isinstance(value,UINT):
            self.__field_payloadsize=value
        else:
            self.__field_payloadsize=UINT(value,**{'sizeinbytes': 1, 'constant': 0x96})

    def __delfield_payloadsize(self): del self.__field_payloadsize

    payloadsize=property(__getfield_payloadsize, __setfield_payloadsize, __delfield_payloadsize, None)

    def __getfield_filename(self):
        try: self.__field_filename
        except:
            self.__field_filename=USTRING(**{'sizeinbytes': 150, 'default': ""})
        return self.__field_filename.getvalue()

    def __setfield_filename(self, value):
        if isinstance(value,USTRING):
            self.__field_filename=value
        else:
            self.__field_filename=USTRING(value,**{'sizeinbytes': 150, 'default': ""})

    def __delfield_filename(self): del self.__field_filename

    filename=property(__getfield_filename, __setfield_filename, __delfield_filename, None)

    def __getfield_pad(self):
        try: self.__field_pad
        except:
            self.__field_pad=UNKNOWN(**{'sizeinbytes': 21})
        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': 21})

    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 ('payloadsize', self.__field_payloadsize, None)
        yield ('filename', self.__field_filename, None)
        yield ('pad', self.__field_pad, None)




class sanyosendfilesize(BaseProtogenClass):
    __fields=['header', 'payloadsize', 'pad1', 'filesize', 'pad2']

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


    def getfields(self):
        return self.__fields


    def _update(self, args, kwargs):
        super(sanyosendfilesize,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(sanyosendfilesize,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=sanyomediaheader(**{'command': 0xffc1, 'pad': 0, 'faset': 0x05})
        self.__field_header.writetobuffer(buf)
        try: self.__field_payloadsize
        except:
            self.__field_payloadsize=UINT(**{'sizeinbytes': 1, 'constant': 0x96})
        self.__field_payloadsize.writetobuffer(buf)
        try: self.__field_pad1
        except:
            self.__field_pad1=UNKNOWN(**{'sizeinbytes': 1})
        self.__field_pad1.writetobuffer(buf)
        self.__field_filesize.writetobuffer(buf)
        try: self.__field_pad2
        except:
            self.__field_pad2=UNKNOWN(**{'sizeinbytes': 168})
        self.__field_pad2.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=sanyomediaheader(**{'command': 0xffc1, 'pad': 0, 'faset': 0x05})
        self.__field_header.readfrombuffer(buf)
        self.__field_payloadsize=UINT(**{'sizeinbytes': 1, 'constant': 0x96})
        self.__field_payloadsize.readfrombuffer(buf)
        self.__field_pad1=UNKNOWN(**{'sizeinbytes': 1})
        self.__field_pad1.readfrombuffer(buf)
        self.__field_filesize=UINT(**{'sizeinbytes': 2})
        self.__field_filesize.readfrombuffer(buf)
        self.__field_pad2=UNKNOWN(**{'sizeinbytes': 168})
        self.__field_pad2.readfrombuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()


    def __getfield_header(self):
        try: self.__field_header
        except:
            self.__field_header=sanyomediaheader(**{'command': 0xffc1, 'pad': 0, 'faset': 0x05})
        return self.__field_header.getvalue()

    def __setfield_header(self, value):
        if isinstance(value,sanyomediaheader):
            self.__field_header=value
        else:
            self.__field_header=sanyomediaheader(value,**{'command': 0xffc1, 'pad': 0, 'faset': 0x05})

    def __delfield_header(self): del self.__field_header

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

    def __getfield_payloadsize(self):
        try: self.__field_payloadsize
        except:
            self.__field_payloadsize=UINT(**{'sizeinbytes': 1, 'constant': 0x96})
        return self.__field_payloadsize.getvalue()

    def __setfield_payloadsize(self, value):
        if isinstance(value,UINT):
            self.__field_payloadsize=value
        else:
            self.__field_payloadsize=UINT(value,**{'sizeinbytes': 1, 'constant': 0x96})

    def __delfield_payloadsize(self): del self.__field_payloadsize

    payloadsize=property(__getfield_payloadsize, __setfield_payloadsize, __delfield_payloadsize, None)

    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_filesize(self):
        return self.__field_filesize.getvalue()

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

    def __delfield_filesize(self): del self.__field_filesize

    filesize=property(__getfield_filesize, __setfield_filesize, __delfield_filesize, None)

    def __getfield_pad2(self):
        try: self.__field_pad2
        except:
            self.__field_pad2=UNKNOWN(**{'sizeinbytes': 168})
        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': 168})

    def __delfield_pad2(self): del self.__field_pad2

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

    def iscontainer(self):
        return True

    def containerelements(self):
        yield ('header', self.__field_header, None)
        yield ('payloadsize', self.__field_payloadsize, None)
        yield ('pad1', self.__field_pad1, None)
        yield ('filesize', self.__field_filesize, None)
        yield ('pad2', self.__field_pad2, None)




class sanyosendfilefragment(BaseProtogenClass):
    __fields=['header', 'payloadsize', 'data', 'pad']

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


    def getfields(self):
        return self.__fields


    def _update(self, args, kwargs):
        super(sanyosendfilefragment,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(sanyosendfilefragment,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=sanyomediaheader(**{'pad': 0, 'faset': 0x05})
        self.__field_header.writetobuffer(buf)
        try: self.__field_payloadsize
        except:
            self.__field_payloadsize=UINT(**{'sizeinbytes': 1, 'constant': 0x96})
        self.__field_payloadsize.writetobuffer(buf)
        self.__field_data.writetobuffer(buf)
        try: self.__field_pad
        except:
            self.__field_pad=UNKNOWN(**{'sizeinbytes': 21})
        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=sanyomediaheader(**{'pad': 0, 'faset': 0x05})
        self.__field_header.readfrombuffer(buf)
        self.__field_payloadsize=UINT(**{'sizeinbytes': 1, 'constant': 0x96})
        self.__field_payloadsize.readfrombuffer(buf)
        self.__field_data=DATA(**{'sizeinbytes': 150})
        self.__field_data.readfrombuffer(buf)
        self.__field_pad=UNKNOWN(**{'sizeinbytes': 21})
        self.__field_pad.readfrombuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()


    def __getfield_header(self):
        try: self.__field_header
        except:
            self.__field_header=sanyomediaheader(**{'pad': 0, 'faset': 0x05})
        return self.__field_header.getvalue()

    def __setfield_header(self, value):
        if isinstance(value,sanyomediaheader):
            self.__field_header=value
        else:
            self.__field_header=sanyomediaheader(value,**{'pad': 0, 'faset': 0x05})

    def __delfield_header(self): del self.__field_header

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

    def __getfield_payloadsize(self):
        try: self.__field_payloadsize
        except:
            self.__field_payloadsize=UINT(**{'sizeinbytes': 1, 'constant': 0x96})
        return self.__field_payloadsize.getvalue()

    def __setfield_payloadsize(self, value):
        if isinstance(value,UINT):
            self.__field_payloadsize=value
        else:
            self.__field_payloadsize=UINT(value,**{'sizeinbytes': 1, 'constant': 0x96})

    def __delfield_payloadsize(self): del self.__field_payloadsize

    payloadsize=property(__getfield_payloadsize, __setfield_payloadsize, __delfield_payloadsize, None)

    def __getfield_data(self):
        return self.__field_data.getvalue()

    def __setfield_data(self, value):
        if isinstance(value,DATA):
            self.__field_data=value
        else:
            self.__field_data=DATA(value,**{'sizeinbytes': 150})

    def __delfield_data(self): del self.__field_data

    data=property(__getfield_data, __setfield_data, __delfield_data, None)

    def __getfield_pad(self):
        try: self.__field_pad
        except:
            self.__field_pad=UNKNOWN(**{'sizeinbytes': 21})
        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': 21})

    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 ('payloadsize', self.__field_payloadsize, None)
        yield ('data', self.__field_data, None)
        yield ('pad', self.__field_pad, None)




class sanyosendfileterminator(BaseProtogenClass):
    __fields=['header', 'payloadsize', 'pad']

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


    def getfields(self):
        return self.__fields


    def _update(self, args, kwargs):
        super(sanyosendfileterminator,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(sanyosendfileterminator,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=sanyomediaheader(**{'command': 0xffe1, 'pad': 0, 'faset': 0x05})
        self.__field_header.writetobuffer(buf)
        try: self.__field_payloadsize
        except:
            self.__field_payloadsize=UINT(**{'sizeinbytes': 1, 'constant': 0x96})
        self.__field_payloadsize.writetobuffer(buf)
        try: self.__field_pad
        except:
            self.__field_pad=UNKNOWN(**{'sizeinbytes': 171})
        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=sanyomediaheader(**{'command': 0xffe1, 'pad': 0, 'faset': 0x05})
        self.__field_header.readfrombuffer(buf)
        self.__field_payloadsize=UINT(**{'sizeinbytes': 1, 'constant': 0x96})
        self.__field_payloadsize.readfrombuffer(buf)
        self.__field_pad=UNKNOWN(**{'sizeinbytes': 171})
        self.__field_pad.readfrombuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()


    def __getfield_header(self):
        try: self.__field_header
        except:
            self.__field_header=sanyomediaheader(**{'command': 0xffe1, 'pad': 0, 'faset': 0x05})
        return self.__field_header.getvalue()

    def __setfield_header(self, value):
        if isinstance(value,sanyomediaheader):
            self.__field_header=value
        else:
            self.__field_header=sanyomediaheader(value,**{'command': 0xffe1, 'pad': 0, 'faset': 0x05})

    def __delfield_header(self): del self.__field_header

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

    def __getfield_payloadsize(self):
        try: self.__field_payloadsize
        except:
            self.__field_payloadsize=UINT(**{'sizeinbytes': 1, 'constant': 0x96})
        return self.__field_payloadsize.getvalue()

    def __setfield_payloadsize(self, value):
        if isinstance(value,UINT):
            self.__field_payloadsize=value
        else:
            self.__field_payloadsize=UINT(value,**{'sizeinbytes': 1, 'constant': 0x96})

    def __delfield_payloadsize(self): del self.__field_payloadsize

    payloadsize=property(__getfield_payloadsize, __setfield_payloadsize, __delfield_payloadsize, None)

    def __getfield_pad(self):
        try: self.__field_pad
        except:
            self.__field_pad=UNKNOWN(**{'sizeinbytes': 171})
        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': 171})

    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 ('payloadsize', self.__field_payloadsize, None)
        yield ('pad', self.__field_pad, None)




class sanyosendfileresponse(BaseProtogenClass):
    __fields=['header', 'payloadsize', 'pad']

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


    def getfields(self):
        return self.__fields


    def _update(self, args, kwargs):
        super(sanyosendfileresponse,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(sanyosendfileresponse,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=sanyomediaheader()
        self.__field_header.writetobuffer(buf)
        self.__field_payloadsize.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=sanyomediaheader()
        self.__field_header.readfrombuffer(buf)
        self.__field_payloadsize=UINT(**{'sizeinbytes': 1})
        self.__field_payloadsize.readfrombuffer(buf)
        self.__field_pad=UNKNOWN(**{'sizeinbytes': 171})
        self.__field_pad.readfrombuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()


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

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

    def __delfield_header(self): del self.__field_header

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

    def __getfield_payloadsize(self):
        return self.__field_payloadsize.getvalue()

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

    def __delfield_payloadsize(self): del self.__field_payloadsize

    payloadsize=property(__getfield_payloadsize, __setfield_payloadsize, __delfield_payloadsize, 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,**{'sizeinbytes': 171})

    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 ('payloadsize', self.__field_payloadsize, None)
        yield ('pad', self.__field_pad, None)




class sanyomediathingyrequest(BaseProtogenClass):
    __fields=['fa', 'faset', 'value']

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


    def getfields(self):
        return self.__fields


    def _update(self, args, kwargs):
        super(sanyomediathingyrequest,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(sanyomediathingyrequest,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_fa
        except:
            self.__field_fa=UINT(**{'sizeinbytes': 2, 'constant': 0xfa})
        self.__field_fa.writetobuffer(buf)
        self.__field_faset.writetobuffer(buf)
        try: self.__field_value
        except:
            self.__field_value=UINT(**{'sizeinbytes': 2, 'default': 0x0})
        self.__field_value.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_fa=UINT(**{'sizeinbytes': 2, 'constant': 0xfa})
        self.__field_fa.readfrombuffer(buf)
        self.__field_faset=UINT(**{'sizeinbytes': 1})
        self.__field_faset.readfrombuffer(buf)
        self.__field_value=UINT(**{'sizeinbytes': 2, 'default': 0x0})
        self.__field_value.readfrombuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()


    def __getfield_fa(self):
        try: self.__field_fa
        except:
            self.__field_fa=UINT(**{'sizeinbytes': 2, 'constant': 0xfa})
        return self.__field_fa.getvalue()

    def __setfield_fa(self, value):
        if isinstance(value,UINT):
            self.__field_fa=value
        else:
            self.__field_fa=UINT(value,**{'sizeinbytes': 2, 'constant': 0xfa})

    def __delfield_fa(self): del self.__field_fa

    fa=property(__getfield_fa, __setfield_fa, __delfield_fa, None)

    def __getfield_faset(self):
        return self.__field_faset.getvalue()

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

    def __delfield_faset(self): del self.__field_faset

    faset=property(__getfield_faset, __setfield_faset, __delfield_faset, None)

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

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

    def __delfield_value(self): del self.__field_value

    value=property(__getfield_value, __setfield_value, __delfield_value, None)

    def iscontainer(self):
        return True

    def containerelements(self):
        yield ('fa', self.__field_fa, None)
        yield ('faset', self.__field_faset, None)
        yield ('value', self.__field_value, None)




class sanyomediathingyresponse(BaseProtogenClass):
    __fields=['fa', 'faset', 'value']

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


    def getfields(self):
        return self.__fields


    def _update(self, args, kwargs):
        super(sanyomediathingyresponse,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(sanyomediathingyresponse,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_fa.writetobuffer(buf)
        self.__field_faset.writetobuffer(buf)
        self.__field_value.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_fa=UINT(**{'sizeinbytes': 2})
        self.__field_fa.readfrombuffer(buf)
        self.__field_faset=UINT(**{'sizeinbytes': 1})
        self.__field_faset.readfrombuffer(buf)
        self.__field_value=UINT(**{'sizeinbytes': 2})
        self.__field_value.readfrombuffer(buf)
        self._bufferendoffset=buf.getcurrentoffset()


    def __getfield_fa(self):
        return self.__field_fa.getvalue()

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

    def __delfield_fa(self): del self.__field_fa

    fa=property(__getfield_fa, __setfield_fa, __delfield_fa, None)

    def __getfield_faset(self):
        return self.__field_faset.getvalue()

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

    def __delfield_faset(self): del self.__field_faset

    faset=property(__getfield_faset, __setfield_faset, __delfield_faset, None)

    def __getfield_value(self):
        return self.__field_value.getvalue()

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

    def __delfield_value(self): del self.__field_value

    value=property(__getfield_value, __setfield_value, __delfield_value, None)

    def iscontainer(self):
        return True

    def containerelements(self):
        yield ('fa', self.__field_fa, None)
        yield ('faset', self.__field_faset, None)
        yield ('value', self.__field_value, None)




