diff --git a/src/control.rs b/src/control.rs new file mode 100644 index 0000000..336a835 --- /dev/null +++ b/src/control.rs @@ -0,0 +1,40 @@ +use crate::{ffi, Result}; + +type PhantomLifetime<'a> = &'a (); + +pub enum ControlRequest { + GetStatus, + ClearFeature, + SetFeature, + SetAddress, + GetDescriptor, + SetDescriptor, + GetConfiguration, + SetConfiguration, +} + +struct ControlTransfer<'a> { + handle: ffi::HANDLE, + _lifetime: PhantomLifetime<'a>, +} + +impl ControlTransfer<'_> { + pub fn status(&self) -> Result {} + + pub fn clear_feature(&self) -> Result<()> {} +} + +pub struct DeviceStatus { + self_powered: bool, + remote_wakeup: bool, +} + +impl DeviceStatus { + pub fn self_powered(&self) -> bool { + self.self_powered + } + + pub fn remote_wakeup(&self) -> bool { + self.remote_wakeup + } +} diff --git a/src/lib.rs b/src/lib.rs index 469d7c2..e97942d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -53,6 +53,7 @@ #[cfg(feature = "config")] pub mod configuration; +mod control; pub mod descriptor; mod device; mod error;