pub struct HubHandler<'d, A: UsbHostAllocator<'d>, const MAX_PORTS: usize> { /* private fields */ }Implementations§
Source§impl<'d, A: UsbHostAllocator<'d>, const MAX_PORTS: usize> HubHandler<'d, A, MAX_PORTS>
impl<'d, A: UsbHostAllocator<'d>, const MAX_PORTS: usize> HubHandler<'d, A, MAX_PORTS>
Sourcepub async fn try_register(
bus: &BusHandle<'d, A>,
enum_info: &EnumerationInfo,
) -> Result<Self, RegisterError>
pub async fn try_register( bus: &BusHandle<'d, A>, enum_info: &EnumerationInfo, ) -> Result<Self, RegisterError>
Attempt to register a hub handler for the given device.
Sourcepub async fn wait_for_event(
&mut self,
) -> Result<HandlerEvent<HubEvent>, HostError>
pub async fn wait_for_event( &mut self, ) -> Result<HandlerEvent<HubEvent>, HostError>
Wait for a hub port status change event.
Sourcepub async fn enumerate_port(
&mut self,
config_buffer: &mut [u8],
port: u8,
speed: Speed,
) -> Result<(EnumerationInfo, usize), EnumerationError>
pub async fn enumerate_port( &mut self, config_buffer: &mut [u8], port: u8, speed: Speed, ) -> Result<(EnumerationInfo, usize), EnumerationError>
Reset a port and enumerate the device attached to it.
port and speed are the 0-based port index and device speed as
reported by HubEvent::DeviceDetected. Enumeration uses the
BusHandle the hub was registered with.
Returns the EnumerationInfo for the device and bytes written
to config_buffer.
The route included in the EnumerationInfo is computed per
USB 2.0 §11.14:
- If this hub is itself reached through a split transaction (e.g. a
full-speed hub behind a high-speed hub’s Transaction Translator),
the child inherits the parent’s TT address and port, with the
device_speedupdated to match the attached device. This is correct because the topmost high-speed hub in the chain owns the TT that services the entire subtree below it. - Otherwise, if this hub introduces a speed mismatch with the child
(HS hub with an LS/FS child, or FS hub with an LS child, where the
latter uses the legacy
PREprefix on full-speed buses), a newSplitInfois constructed pointing at this hub. - Otherwise the child is reached directly at its native speed.
Auto Trait Implementations§
impl<'d, A, const MAX_PORTS: usize> Freeze for HubHandler<'d, A, MAX_PORTS>
impl<'d, A, const MAX_PORTS: usize> !RefUnwindSafe for HubHandler<'d, A, MAX_PORTS>
impl<'d, A, const MAX_PORTS: usize> Send for HubHandler<'d, A, MAX_PORTS>
impl<'d, A, const MAX_PORTS: usize> Sync for HubHandler<'d, A, MAX_PORTS>
impl<'d, A, const MAX_PORTS: usize> Unpin for HubHandler<'d, A, MAX_PORTS>
impl<'d, A, const MAX_PORTS: usize> !UnwindSafe for HubHandler<'d, A, MAX_PORTS>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more