Go to the documentation of this file.00001 __author__ = 'tom1231'
00002 import struct
00003 from BAL.Header.Response.ParamBuildResponse import ParamBuildResponse, Button
00004
00005 RES_LEN = 18
00006
00007 class SwitchParamResponse(ParamBuildResponse):
00008 def __init__(self, devId, param):
00009 ParamBuildResponse.__init__(self, Button, devId, param.getSwitchPubHz(devId))
00010 self._length = RES_LEN
00011 self._checkSum = 0
00012 self._port = param.getSwitchPort(devId)
00013
00014 self._checkSum = self.calCheckSum(self.dataTosend())
00015
00016 def dataTosend(self):
00017 return ParamBuildResponse.dataTosend(self) + struct.pack('<i', self._port)
00018
00019