Device.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:PyHIDParser 作者: NZSmartie 项目源码 文件源码
def unpack(self, data):
        if not isinstance(data, _Bits):
            data = _Bits(data)
        for i in range(self.count):
            offset = i*self.size
            try:
                b = data[offset:offset + self.size]
                self._values[i] = self.logical_range.scale_to(self.physical_range, b.int if self.logical_range.minimum<0 else b.uint)
            except ArithmeticError:
                # If the value is outside of the logical range, and NULLs are allowed, then do not modify the value
                if not self.flags & ReportFlags.NULL_STATE:
                    raise
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号