示例#1
0
文件: protocol.py 项目: jbdubois/obus
	def __init__(self, bus, header, buf):
		RxPacket.__init__(self, header)
		self.status = buf.readU8()
		if self.status < 0 or self.status >= OBUS_CONRESP_STATUS_COUNT:
			raise DecodeError("RxPacketConnResp: " +
					"invalid connection response status %d" % self.status)
		objCount = buf.readU32()
		self.objects = []
		for _ in range(0, objCount):
			obj = ObusObject.decode(bus, buf)
			if obj is not None:
				self.objects.append(obj)
示例#2
0
文件: protocol.py 项目: jbdubois/obus
	def __init__(self, bus, header, buf):
		RxPacket.__init__(self, header)
		self.obj = ObusObject.decode(bus, buf)
		if not self.obj:
			raise DecodeError("RxPacketAdd: " + "no object decoded")