URFPublishResponse.py
Go to the documentation of this file.
00001 __author__ = 'tom1231'
00002 import struct
00003 from BAL.Header.RiCHeader import RiCHeader
00004 
00005 ID_LEN = 7
00006 RANGE_LEN = 11
00007 
00008 class URFPublishResponse(RiCHeader):
00009 
00010     def __init__(self):
00011         RiCHeader.__init__(self)
00012         self._urfId = 0
00013         self._range = 0.0
00014 
00015     def buildRequest(self, data):
00016         RiCHeader.buildRequest(self, data)
00017         bytes = bytearray()
00018         while self.index < ID_LEN:
00019             bytes.append(data[self.index])
00020             self.index += 1
00021         self._urfId = struct.unpack('<B', bytes)[0]
00022         bytes = bytearray()
00023         while self.index < RANGE_LEN:
00024             bytes.append(data[self.index])
00025             self.index += 1
00026         self._range = struct.unpack('<f', bytes)[0]
00027 
00028     def getURFId(self): return self._urfId
00029 
00030     def getRange(self): return self._range
00031 
00032 


ric_board
Author(s): RoboTiCan
autogenerated on Fri Oct 27 2017 03:02:31