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

"""Various descriptions of data specific to Sanyo MM-7500"""

from prototypes import *

# Make all sanyo stuff available in this module as well
from p_sanyo import *
from p_sanyomedia import *
from p_sanyonewer import *
from p_sanyo4930 import *

# We use LSB for all integer like fields
UINT=UINTlsb
BOOL=BOOLlsb
_NUMPBSLOTS=500
_NUMSPEEDDIALS=8
_NUMLONGNUMBERS=5
_LONGPHONENUMBERLEN=30
_NUMEVENTSLOTS=100
_NUMCALLALARMSLOTS=15
 # Need to check.  Is max phone will hold 32/96 or 33/97
_MAXNUMBERLEN=32
_MAXEMAILLEN=96
HASRINGPICBUF=0

#BREW_FILE_SYSTEM=2

class messagesententry(BaseProtogenClass):
    __fields=['slot', 'read', 'counter', 'pad1', 'dunno1', 'dunno2', 'dunno3', 'pad2', 'dunno4', 'dunno5', 'pad3', 'message_len', 'message', 'pad4', 'year', 'month', 'day', 'hour', 'minute', 'second', 'callback_len', 'callback', 'phonenum_len', 'phonenum', 'dunno6', 'priority', 'pad6', 'dunno7', 'dunno8']

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


    def getfields(self):
        return self.__fields


    def _update(self, args, kwargs):
        super(messagesententry,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(messagesententry,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_slot.writetobuffer(buf)
        self.__field_read.writetobuffer(buf)
        self.__field_counter.writetobuffer(buf)
        self.__field_pad1.writetobuffer(buf)
        self.__field_dunno1.writetobuffer(buf)
        self.__field_dunno2.writetobuffer(buf)
        self.__field_dunno3.writetobuffer(buf)
        self.__field_pad2.writetobuffer(buf)
        self.__field_dunno4.writetobuffer(buf)
        self.__field_dunno5.writetobuffer(buf)
        self.__field_pad3.writetobuffer(buf)
        self.__field_message_len.writetobuffer(buf)
        self.__field_message.writetobuffer(buf)
        self.__field_pad4.writetobuffer(buf)
        self.__field_year.writetobuffer(buf)
        self.__field_month.writetobuffer(buf)
        self.__field_day.writetobuffer(buf)
        self.__field_hour.writetobuffer(buf)
        self.__field_minute.writetobuffer(buf)
        self.__field_second.writetobuffer(buf)
        self.__field_callback_len.writetobuffer(buf)
        self.__field_callback.writetobuffer(buf)
        self.__field_phonenum_len.writetobuffer(buf)
        self.__field_phonenum.writetobuffer(buf)
        self.__field_dunno6.writetobuffer(buf)
        self.__field_priority.writetobuffer(buf)
        self.__field_pad6.writetobuffer(buf)
        self.__field_dunno7.writetobuffer(buf)
        self.__field_dunno8.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': 1})
        self.__field_slot.readfrombuffer(buf)
        self.__field_read=UINT(**{'sizeinbytes': 1})
        self.__field_read.readfrombuffer(buf)
        self.__field_counter=UINT(**{'sizeinbytes': 1})
        self.__field_counter.readfrombuffer(buf)
        self.__field_pad1=UNKNOWN(**{'sizeinbytes': 3})
        self.__field_pad1.readfrombuffer(buf)
        self.__field_dunno1=UINT(**{'sizeinbytes': 1})
        self.__field_dunno1.readfrombuffer(buf)
        self.__field_dunno2=UINT(**{'sizeinbytes': 1})
        self.__field_dunno2.readfrombuffer(buf)
        self.__field_dunno3=UINT(**{'sizeinbytes': 1})
        self.__field_dunno3.readfrombuffer(buf)
        self.__field_pad2=UNKNOWN(**{'sizeinbytes': 1})
        self.__field_pad2.readfrombuffer(buf)
        self.__field_dunno4=UINT(**{'sizeinbytes': 1})
        self.__field_dunno4.readfrombuffer(buf)
        self.__field_dunno5=UINT(**{'sizeinbytes': 1})
        self.__field_dunno5.readfrombuffer(buf)
        self.__field_pad3=UNKNOWN(**{'sizeinbytes': 1})
        self.__field_pad3.readfrombuffer(buf)
        self.__field_message_len=UINT(**{'sizeinbytes': 1})
        self.__field_message_len.readfrombuffer(buf)
        self.__field_message=USTRING(**{'sizeinbytes': 255})
        self.__field_message.readfrombuffer(buf)
        self.__field_pad4=UNKNOWN(**{'sizeinbytes': 2})
        self.__field_pad4.readfrombuffer(buf)
        self.__field_year=UINT(**{'sizeinbytes': 1})
        self.__field_year.readfrombuffer(buf)
        self.__field_month=UINT(**{'sizeinbytes': 1})
        self.__field_month.readfrombuffer(buf)
        self.__field_day=UINT(**{'sizeinbytes': 1})
        self.__field_day.readfrombuffer(buf)
        self.__field_hour=UINT(**{'sizeinbytes': 1})
        self.__field_hour.readfrombuffer(buf)
        self.__field_minute=UINT(**{'sizeinbytes': 1})
        self.__field_minute.readfrombuffer(buf)
        self.__field_second=UINT(**{'sizeinbytes': 1})
        self.__field_second.readfrombuffer(buf)
        self.__field_callback_len=UINT(**{'sizeinbytes': 1})
        self.__field_callback_len.readfrombuffer(buf)
        self.__field_callback=USTRING(**{'sizeinbytes': 34})
        self.__field_callback.readfrombuffer(buf)
        self.__field_phonenum_len=UINT(**{'sizeinbytes': 1})
        self.__field_phonenum_len.readfrombuffer(buf)
        self.__field_phonenum=USTRING(**{'sizeinbytes': 37})
        self.__field_phonenum.readfrombuffer(buf)
        self.__field_dunno6=UINT(**{'sizeinbytes': 1})
        self.__field_dunno6.readfrombuffer(buf)
        self.__field_priority=UINT(**{'sizeinbytes': 1})
        self.__field_priority.readfrombuffer(buf)
        self.__field_pad6=UNKNOWN(**{'sizeinbytes': 3})
        self.__field_pad6.readfrombuffer(buf)
        self.__field_dunno7=UINT(**{'sizeinbytes': 1})
        self.__field_dunno7.readfrombuffer(buf)
        self.__field_dunno8=UINT(**{'sizeinbytes': 1})
        self.__field_dunno8.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': 1})

    def __delfield_slot(self): del self.__field_slot

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

    def __getfield_read(self):
        return self.__field_read.getvalue()

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

    def __delfield_read(self): del self.__field_read

    read=property(__getfield_read, __setfield_read, __delfield_read, None)

    def __getfield_counter(self):
        return self.__field_counter.getvalue()

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

    def __delfield_counter(self): del self.__field_counter

    counter=property(__getfield_counter, __setfield_counter, __delfield_counter, 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': 3})

    def __delfield_pad1(self): del self.__field_pad1

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

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

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

    def __delfield_dunno1(self): del self.__field_dunno1

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

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

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

    def __delfield_dunno2(self): del self.__field_dunno2

    dunno2=property(__getfield_dunno2, __setfield_dunno2, __delfield_dunno2, 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_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_dunno4(self):
        return self.__field_dunno4.getvalue()

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

    def __delfield_dunno4(self): del self.__field_dunno4

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

    def __getfield_dunno5(self):
        return self.__field_dunno5.getvalue()

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

    def __delfield_dunno5(self): del self.__field_dunno5

    dunno5=property(__getfield_dunno5, __setfield_dunno5, __delfield_dunno5, 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_message_len(self):
        return self.__field_message_len.getvalue()

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

    def __delfield_message_len(self): del self.__field_message_len

    message_len=property(__getfield_message_len, __setfield_message_len, __delfield_message_len, None)

    def __getfield_message(self):
        return self.__field_message.getvalue()

    def __setfield_message(self, value):
        if isinstance(value,USTRING):
            self.__field_message=value
        else:
            self.__field_message=USTRING(value,**{'sizeinbytes': 255})

    def __delfield_message(self): del self.__field_message

    message=property(__getfield_message, __setfield_message, __delfield_message, "Text of the notification")

    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': 2})

    def __delfield_pad4(self): del self.__field_pad4

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

    def __getfield_year(self):
        return self.__field_year.getvalue()

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

    def __delfield_year(self): del self.__field_year

    year=property(__getfield_year, __setfield_year, __delfield_year, None)

    def __getfield_month(self):
        return self.__field_month.getvalue()

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

    def __delfield_month(self): del self.__field_month

    month=property(__getfield_month, __setfield_month, __delfield_month, None)

    def __getfield_day(self):
        return self.__field_day.getvalue()

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

    def __delfield_day(self): del self.__field_day

    day=property(__getfield_day, __setfield_day, __delfield_day, None)

    def __getfield_hour(self):
        return self.__field_hour.getvalue()

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

    def __delfield_hour(self): del self.__field_hour

    hour=property(__getfield_hour, __setfield_hour, __delfield_hour, None)

    def __getfield_minute(self):
        return self.__field_minute.getvalue()

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

    def __delfield_minute(self): del self.__field_minute

    minute=property(__getfield_minute, __setfield_minute, __delfield_minute, None)

    def __getfield_second(self):
        return self.__field_second.getvalue()

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

    def __delfield_second(self): del self.__field_second

    second=property(__getfield_second, __setfield_second, __delfield_second, None)

    def __getfield_callback_len(self):
        return self.__field_callback_len.getvalue()

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

    def __delfield_callback_len(self): del self.__field_callback_len

    callback_len=property(__getfield_callback_len, __setfield_callback_len, __delfield_callback_len, None)

    def __getfield_callback(self):
        return self.__field_callback.getvalue()

    def __setfield_callback(self, value):
        if isinstance(value,USTRING):
            self.__field_callback=value
        else:
            self.__field_callback=USTRING(value,**{'sizeinbytes': 34})

    def __delfield_callback(self): del self.__field_callback

    callback=property(__getfield_callback, __setfield_callback, __delfield_callback, None)

    def __getfield_phonenum_len(self):
        return self.__field_phonenum_len.getvalue()

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

    def __delfield_phonenum_len(self): del self.__field_phonenum_len

    phonenum_len=property(__getfield_phonenum_len, __setfield_phonenum_len, __delfield_phonenum_len, None)

    def __getfield_phonenum(self):
        return self.__field_phonenum.getvalue()

    def __setfield_phonenum(self, value):
        if isinstance(value,USTRING):
            self.__field_phonenum=value
        else:
            self.__field_phonenum=USTRING(value,**{'sizeinbytes': 37})

    def __delfield_phonenum(self): del self.__field_phonenum

    phonenum=property(__getfield_phonenum, __setfield_phonenum, __delfield_phonenum, None)

    def __getfield_dunno6(self):
        return self.__field_dunno6.getvalue()

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

    def __delfield_dunno6(self): del self.__field_dunno6

    dunno6=property(__getfield_dunno6, __setfield_dunno6, __delfield_dunno6, None)

    def __getfield_priority(self):
        return self.__field_priority.getvalue()

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

    def __delfield_priority(self): del self.__field_priority

    priority=property(__getfield_priority, __setfield_priority, __delfield_priority, None)

    def __getfield_pad6(self):
        return self.__field_pad6.getvalue()

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

    def __delfield_pad6(self): del self.__field_pad6

    pad6=property(__getfield_pad6, __setfield_pad6, __delfield_pad6, None)

    def __getfield_dunno7(self):
        return self.__field_dunno7.getvalue()

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

    def __delfield_dunno7(self): del self.__field_dunno7

    dunno7=property(__getfield_dunno7, __setfield_dunno7, __delfield_dunno7, None)

    def __getfield_dunno8(self):
        return self.__field_dunno8.getvalue()

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

    def __delfield_dunno8(self): del self.__field_dunno8

    dunno8=property(__getfield_dunno8, __setfield_dunno8, __delfield_dunno8, None)

    def iscontainer(self):
        return True

    def containerelements(self):
        yield ('slot', self.__field_slot, None)
        yield ('read', self.__field_read, None)
        yield ('counter', self.__field_counter, None)
        yield ('pad1', self.__field_pad1, None)
        yield ('dunno1', self.__field_dunno1, None)
        yield ('dunno2', self.__field_dunno2, None)
        yield ('dunno3', self.__field_dunno3, None)
        yield ('pad2', self.__field_pad2, None)
        yield ('dunno4', self.__field_dunno4, None)
        yield ('dunno5', self.__field_dunno5, None)
        yield ('pad3', self.__field_pad3, None)
        yield ('message_len', self.__field_message_len, None)
        yield ('message', self.__field_message, "Text of the notification")
        yield ('pad4', self.__field_pad4, None)
        yield ('year', self.__field_year, None)
        yield ('month', self.__field_month, None)
        yield ('day', self.__field_day, None)
        yield ('hour', self.__field_hour, None)
        yield ('minute', self.__field_minute, None)
        yield ('second', self.__field_second, None)
        yield ('callback_len', self.__field_callback_len, None)
        yield ('callback', self.__field_callback, None)
        yield ('phonenum_len', self.__field_phonenum_len, None)
        yield ('phonenum', self.__field_phonenum, None)
        yield ('dunno6', self.__field_dunno6, None)
        yield ('priority', self.__field_priority, None)
        yield ('pad6', self.__field_pad6, None)
        yield ('dunno7', self.__field_dunno7, None)
        yield ('dunno8', self.__field_dunno8, None)




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

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


    def getfields(self):
        return self.__fields


    def _update(self, args, kwargs):
        super(messagesentresponse,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(messagesentresponse,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_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=sanyoheader()
        self.__field_header.readfrombuffer(buf)
        self.__field_entry=messagesententry()
        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,sanyoheader):
            self.__field_header=value
        else:
            self.__field_header=sanyoheader(value,)

    def __delfield_header(self): del self.__field_header

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

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

    def __setfield_entry(self, value):
        if isinstance(value,messagesententry):
            self.__field_entry=value
        else:
            self.__field_entry=messagesententry(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 ('entry', self.__field_entry, None)
        yield ('pad', self.__field_pad, None)




