Skip to main content

IUsbClientControllerProvider Interface

NuGet: GHIElectronics.TinyCLR.Devices.UsbClient
Assembly: GHIElectronics.TinyCLR.Devices.UsbClient
Namespace: GHIElectronics.TinyCLR.Devices.UsbClient.Provider

Provides the low-level interface for a USB client controller.

public interface IUsbClientControllerProvider : IDisposable

Properties​

WriteBufferSize​

int WriteBufferSize { get; set; }

The size of the write buffer.

ReadBufferSize​

int ReadBufferSize { get; set; }

The size of the read buffer.

DeviceState​

DeviceState DeviceState { get; }

The current state of the device.

Methods​

BytesToRead(int streamIndex)​

int BytesToRead(int streamIndex)

The number of bytes available to read on the given stream.

Returns int

BytesToWrite(int streamIndex)​

int BytesToWrite(int streamIndex)

The number of bytes that are in the process of being written on the given stream.

Returns int

Enable()​

void Enable()

Enables the device.

Disable()​

void Disable()

Disables the device.

SetActiveSetting(UsbClientSetting setting)​

void SetActiveSetting(UsbClientSetting setting)

Sets the active device setting.

SetDeviceDescriptor(Configuration.DeviceDescriptor[] deviceDescriptor)​

void SetDeviceDescriptor(Configuration.DeviceDescriptor[] deviceDescriptor)

Sets the device descriptor.

SetConfigurationDescriptor(Configuration.ConfigurationDescriptor[] configurationDescriptor)​

void SetConfigurationDescriptor(Configuration.ConfigurationDescriptor[] configurationDescriptor)

Sets the configuration descriptor.

SetStringDescriptor(Configuration.StringDescriptor[] stringDescriptor, uint index)​

void SetStringDescriptor(Configuration.StringDescriptor[] stringDescriptor, uint index)

Sets the string descriptor at the given index.

SetGenericDescriptor(Configuration.GenericDescriptor[] genericDescriptor)​

void SetGenericDescriptor(Configuration.GenericDescriptor[] genericDescriptor)

Sets the generic descriptor.

Read(int streamIndex, byte[] data, int offset, int count)​

int Read(int streamIndex, byte[] data, int offset, int count)

Reads data from the given stream.

Returns int

Write(int streamIndex, byte[] data, int offset, int count)​

int Write(int streamIndex, byte[] data, int offset, int count)

Writes data to the given stream.

Returns int

GetControlPacketSize()​

int GetControlPacketSize()

Gets the maximum control packet size.

Returns int

GetEndpointMap()​

ushort GetEndpointMap()

Gets a bitmap of the reserved endpoints.

Returns ushort

ClearReadBuffer(int streamIndex)​

void ClearReadBuffer(int streamIndex)

Clears the read buffer of the given stream.

ClearWriteBuffer(int streamIndex)​

void ClearWriteBuffer(int streamIndex)

Clears the write buffer of the given stream.

Flush(int streamIndex)​

void Flush(int streamIndex)

Flushes the write buffer of the given stream.

Events​

DataReceived​

event DataReceivedEventHandler DataReceived

Raised when data is received from the host.

DeviceStateChanged​

event DeviceStateChangedEventHandler DeviceStateChanged

Raised when the device state changes.