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
评论列表
文章目录