Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions src/control.rs
Original file line number Diff line number Diff line change
@@ -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<DeviceStatus> {}

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
}
}
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@

#[cfg(feature = "config")]
pub mod configuration;
mod control;
pub mod descriptor;
mod device;
mod error;
Expand Down