/// Read various parameters from the controller including its current
/// status.
Read various parameters from the controller including its current
status.
Read various parameters from the controller including its current status .
pub fn read_config(&mut self) -> Result<ControllerConfiguration, E> {
        let mut config: ControllerConfiguration = Default::default();
        let mut buffer = [0u8; MESSAGE_MAX_LENGTH];
        self.send_command(CMD_ENTER_ESCAPE_MODE, &mut buffer)?;
        self.send_command(CMD_READ_STATUS, &mut buffer)?;
        config.status.copy_from_slice(&buffer[HEADER_LEN..9]);
        self.send_command(CMD_READ_CONST1A, &mut buffer)?;
        config.const1a.copy_from_slice(&buffer[4..9]);
        self.send_command(CMD_READ_CONST1B, &mut buffer)?;
        config.const1b.copy_from_slice(&buffer[4..9]);
        self.send_command(CMD_READ_CONST2, &mut buffer)?;
        config.const2.copy_from_slice(&buffer[4..9]);
        self.send_command(CMD_READ_CONST3A, &mut buffer)?;
        config.const3a.copy_from_slice(&buffer[4..9]);
        self.send_command(CMD_READ_CONST3B, &mut buffer)?;
        config.const3b.copy_from_slice(&buffer[4..9]);
        self.send_command(CMD_EXIT_ESCAPE_MODE, &mut buffer)?;
        Ok(config)
    }
pub fn read_config ( & mut self ) -> Result < ControllerConfiguration , E > { let mut config : ControllerConfiguration = Default :: default ( ) ; let mut buffer = [ 0u8 ; MESSAGE_MAX_LENGTH ] ; self . send_command ( CMD_ENTER_ESCAPE_MODE , & mut buffer ) ? ; self . send_command ( CMD_READ_STATUS , & mut buffer ) ? ; config . status . copy_from_slice ( & buffer [ HEADER_LEN .. 9 ] ) ; self . send_command ( CMD_READ_CONST1A , & mut buffer ) ? ; config . const1a . copy_from_slice ( & buffer [ 4 .. 9 ] ) ; self . send_command ( CMD_READ_CONST1B , & mut buffer ) ? ; config . const1b . copy_from_slice ( & buffer [ 4 .. 9 ] ) ; self . send_command ( CMD_READ_CONST2 , & mut buffer ) ? ; config . const2 . copy_from_slice ( & buffer [ 4 .. 9 ] ) ; self . send_command ( CMD_READ_CONST3A , & mut buffer ) ? ; config . const3a . copy_from_slice ( & buffer [ 4 .. 9 ] ) ; self . send_command ( CMD_READ_CONST3B , & mut buffer ) ? ; config . const3b . copy_from_slice ( & buffer [ 4 .. 9 ] ) ; self . send_command ( CMD_EXIT_ESCAPE_MODE , & mut buffer ) ? ; Ok ( config ) }
Read various parameters from the controller including its current
status.
Read various parameters from the controller including its current status .
&mut self