sireader.py 文件源码

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

项目:pysport 作者: sportorg 项目源码 文件源码
def _update_proto_config(self):
        # Read protocol configuration
        ret = self._send_command(SIReader.C_GET_SYS_VAL, SIReader.O_PROTO + b'\x01')
        config_byte = byte2int(ret[1][1])
        self.proto_config = {}
        self.proto_config['ext_proto'] = config_byte & (1 << 0) != 0
        self.proto_config['auto_send'] = config_byte & (1 << 1) != 0
        self.proto_config['handshake'] = config_byte & (1 << 2) != 0
        self.proto_config['pw_access'] = config_byte & (1 << 4) != 0
        self.proto_config['punch_read'] = config_byte & (1 << 7) != 0

        # Read operating mode
        ret = self._send_command(SIReader.C_GET_SYS_VAL, SIReader.O_MODE + b'\x01')
        self.proto_config['mode'] = byte2int(ret[1][1])

        return self.proto_config
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号