ascom_alpaca/api/
filter_wheel.rs

1use super::Device;
2use crate::{ASCOMError, ASCOMResult};
3use macro_rules_attribute::apply;
4
5/// FilterWheel Specific Methods.
6#[apply(rpc_trait)]
7pub trait FilterWheel: Device + Send + Sync {
8    /// An integer array of filter focus offsets.
9    #[http("focusoffsets", method = Get)]
10    async fn focus_offsets(&self) -> ASCOMResult<Vec<i32>>;
11
12    /// The names of the filters.
13    #[http("names", method = Get)]
14    async fn names(&self) -> ASCOMResult<Vec<String>>;
15
16    /// Returns the current filter wheel position.
17    #[http("position", method = Get, device_state = Position)]
18    async fn position(&self) -> ASCOMResult<i32>;
19
20    /// Sets the filter wheel position.
21    #[http("position", method = Put)]
22    async fn set_position(&self, #[http("Position")] position: i32) -> ASCOMResult<()> {
23        Err(ASCOMError::NOT_IMPLEMENTED)
24    }
25
26    /// This method returns the version of the ASCOM device interface contract to which this device complies.
27    ///
28    /// Only one interface version is current at a moment in time and all new devices should be built to the latest interface version. Applications can choose which device interface versions they support and it is in their interest to support  previous versions as well as the current version to ensure thay can use the largest number of devices.
29    #[http("interfaceversion", method = Get)]
30    async fn interface_version(&self) -> ASCOMResult<i32> {
31        Ok(3_i32)
32    }
33}