ubertooth.py 文件源码

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

项目:sturdy-palm-tree 作者: dominicgs 项目源码 文件源码
def rx_stream(self, count=None, secs=None):
        self.set_rx_mode()
        start = time.time()
        while count is None or count > 0:
            buffer = self.device.read(0x82, 64)
            if count is not None:
                count -= 1
            if secs is not None:
                if time.time() >= start+secs:
                    break
            pkt = BitArray(bytes=buffer)
            metadata = pkt.unpack('uint:8, uint:8, uint:8, uint:8, uint:32,'
                                  'int:8, int:8, int:8, uint:8')
            metanames = ('pkt_type', 'status', 'channel', 'clkn_high',
                         'clk100ns', 'rssi_max', 'rssi_min', 'rss_avg',
                         'rssi_count')
            yield dict(zip(metanames, metadata)), pkt[112:]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号