Skip to main content

UsbHostController Class

NuGet: GHIElectronics.TinyCLR.Devices.UsbHost
Assembly: GHIElectronics.TinyCLR.Devices.UsbHost
Namespace: GHIElectronics.TinyCLR.Devices.UsbHost

Represents the USB host controller used to manage connected USB devices.

public class UsbHostController : IDisposable

Properties

Provider

public IUsbHostControllerProvider Provider { get; }

The underlying provider that implements the host controller.

Methods

GetDefault()

public static UsbHostController GetDefault()

Gets the default USB host controller for the system.

Returns UsbHostController

FromName(string name)

public static UsbHostController FromName(string name)

Gets the USB host controller with the given name.

Returns UsbHostController

FromProvider(IUsbHostControllerProvider provider)

public static UsbHostController FromProvider(IUsbHostControllerProvider provider)

Gets a USB host controller backed by the given provider.

Returns UsbHostController

Dispose()

public void Dispose()

Disposes the controller and its provider.

Enable()

public void Enable()

Enables the controller so devices can be detected.

Disable()

public void Disable()

Disables the controller and stops detecting devices.

GetConnectedDevices()

public static BaseDevice[] GetConnectedDevices()

Gets the currently connected devices, or null if the controller is not enabled.

Returns BaseDevice[]

Events

OnConnectionChangedEvent

public event OnConnectionChanged OnConnectionChangedEvent

The event fired when a device's connection status changes.