Trait ascom_alpaca::api::Switch
source · pub trait Switch: Device + Send + Sync {
// Provided methods
async fn max_switch(&self) -> ASCOMResult<i32> { ... }
async fn can_write(&self, id: u32) -> ASCOMResult<bool> { ... }
async fn get_switch(&self, id: u32) -> ASCOMResult<bool> { ... }
async fn get_switch_description(&self, id: u32) -> ASCOMResult<String> { ... }
async fn get_switch_name(&self, id: u32) -> ASCOMResult<String> { ... }
async fn get_switch_value(&self, id: u32) -> ASCOMResult<f64> { ... }
async fn min_switch_value(&self, id: u32) -> ASCOMResult<f64> { ... }
async fn max_switch_value(&self, id: u32) -> ASCOMResult<f64> { ... }
async fn set_switch(&self, id: u32, state: bool) -> ASCOMResult { ... }
async fn set_switch_name(&self, id: u32, name: String) -> ASCOMResult { ... }
async fn set_switch_value(&self, id: u32, value: f64) -> ASCOMResult { ... }
async fn switch_step(&self, id: u32) -> ASCOMResult<f64> { ... }
}switch only.Expand description
Switch Specific Methods
Provided Methods§
sourceasync fn max_switch(&self) -> ASCOMResult<i32>
async fn max_switch(&self) -> ASCOMResult<i32>
Returns the number of switch devices managed by this driver. Devices are numbered from 0 to MaxSwitch - 1
sourceasync fn can_write(&self, id: u32) -> ASCOMResult<bool>
async fn can_write(&self, id: u32) -> ASCOMResult<bool>
Reports if the specified switch device can be written to, default true. This is false if the device cannot be written to, for example a limit switch or a sensor. Devices are numbered from 0 to MaxSwitch - 1
sourceasync fn get_switch(&self, id: u32) -> ASCOMResult<bool>
async fn get_switch(&self, id: u32) -> ASCOMResult<bool>
Return the state of switch device id as a boolean. Devices are numbered from 0 to MaxSwitch - 1
sourceasync fn get_switch_description(&self, id: u32) -> ASCOMResult<String>
async fn get_switch_description(&self, id: u32) -> ASCOMResult<String>
Gets the description of the specified switch device. This is to allow a fuller description of the device to be returned, for example for a tool tip. Devices are numbered from 0 to MaxSwitch - 1
sourceasync fn get_switch_name(&self, id: u32) -> ASCOMResult<String>
async fn get_switch_name(&self, id: u32) -> ASCOMResult<String>
Gets the name of the specified switch device. Devices are numbered from 0 to MaxSwitch - 1
sourceasync fn get_switch_value(&self, id: u32) -> ASCOMResult<f64>
async fn get_switch_value(&self, id: u32) -> ASCOMResult<f64>
Gets the value of the specified switch device as a double. Devices are numbered from 0 to MaxSwitch - 1, The value of this switch is expected to be between MinSwitchValue and MaxSwitchValue.
sourceasync fn min_switch_value(&self, id: u32) -> ASCOMResult<f64>
async fn min_switch_value(&self, id: u32) -> ASCOMResult<f64>
Gets the minimum value of the specified switch device as a double. Devices are numbered from 0 to MaxSwitch - 1.
sourceasync fn max_switch_value(&self, id: u32) -> ASCOMResult<f64>
async fn max_switch_value(&self, id: u32) -> ASCOMResult<f64>
Gets the maximum value of the specified switch device as a double. Devices are numbered from 0 to MaxSwitch - 1.
sourceasync fn set_switch(&self, id: u32, state: bool) -> ASCOMResult
async fn set_switch(&self, id: u32, state: bool) -> ASCOMResult
Sets a switch controller device to the specified state, true or false.
sourceasync fn set_switch_name(&self, id: u32, name: String) -> ASCOMResult
async fn set_switch_name(&self, id: u32, name: String) -> ASCOMResult
Sets a switch device name to the specified value.
sourceasync fn set_switch_value(&self, id: u32, value: f64) -> ASCOMResult
async fn set_switch_value(&self, id: u32, value: f64) -> ASCOMResult
Sets a switch device value to the specified value.
sourceasync fn switch_step(&self, id: u32) -> ASCOMResult<f64>
async fn switch_step(&self, id: u32) -> ASCOMResult<f64>
Returns the step size that this device supports (the difference between successive values of the device). Devices are numbered from 0 to MaxSwitch - 1.