Go to the documentation of this file.00001 __author__ = 'tom1231'
00002 import struct
00003 from BAL.Header.RiCHeader import RiCHeader
00004 from BAL.Handlers.incomingHandler import RIG_REQ
00005
00006 MSG_LEN = 9
00007
00008 class PublishRequest(RiCHeader):
00009 def __init__(self, devType, devId, haveRight):
00010 RiCHeader.__init__(self)
00011
00012 self._id = RIG_REQ
00013 self._length = MSG_LEN
00014 self._des = 0x1001
00015 self._checkSum = 0
00016
00017 self._devType = devType
00018 self._devId = devId
00019 self._haveRight = haveRight
00020
00021 self._checkSum = self.calCheckSum(self.dataTosend())
00022
00023 def dataTosend(self):
00024 return RiCHeader.dataTosend(self) + struct.pack('<B', self._devType)\
00025 + struct.pack('<B', self._devId) + struct.pack('<?', self._haveRight)
00026
00027