Device.py 文件源码

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

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


问题


面经


文章

微信
公众号

扫码关注公众号