def deserialize(self, data, report_type: ReportType):
offset = 0
if not isinstance(data, _Bits):
data = _Bits(data)
for item in self.items:
if isinstance(item, Report):
if item.report_type is not report_type:
continue
item.unpack(data[offset:offset + item.bits])
else:
item.deserialize(data[offset:offset + item.bits], report_type)
offset += item.bits
评论列表
文章目录