Skip to main content

RawDevice Class

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

Provides low level access functionalities for the connected USB device. This is useful if there is not already a predefined driver for that device.

public class RawDevice : BaseDevice

Methods

OpenPipe(Descriptors.Endpoint endpoint)

public RawDevice.Pipe OpenPipe(Descriptors.Endpoint endpoint)

Opens a new communication pipe.

ParameterTypeDescription
endpointDescriptors.EndpointThe descriptor for the communication endpoint.

Returns RawDevice.Pipe — The new pipe.

SendSetupPacket(byte requestType, byte request, ushort value, ushort index)

public void SendSetupPacket(byte requestType, byte request, ushort value, ushort index)

Sends a USB setup packet.

ParameterTypeDescription
requestTypebyteThe request type, recipient, and direction.
requestbyteThe request to make.
valueushortThe value of the request.
indexushortThe index of the request.

SendSetupPacket(byte requestType, byte request, ushort value, ushort index, byte[] data, int dataOffset, int dataCount)

public void SendSetupPacket(byte requestType, byte request, ushort value, ushort index, byte[] data, int dataOffset, int dataCount)

Sends a USB setup packet.

ParameterTypeDescription
requestTypebyteThe request type, recipient, and direction.
requestbyteThe request to make.
valueushortThe value of the request.
indexushortThe index of the request.
databyte[]The data to receive.
dataOffsetintThe offset into data at which to receive the data.
dataCountintThe number of bytes to receive into data starting at offset.

GetDeviceDescriptor()

public Descriptors.Device GetDeviceDescriptor()

Gets the device descriptor.

Returns Descriptors.Device — The device descriptor.

GetConfigurationDescriptor(byte configurationIndex)

public Descriptors.Configuration GetConfigurationDescriptor(byte configurationIndex)

Gets the configuration descriptor.

ParameterTypeDescription
configurationIndexbyteThe configuration index.

Returns Descriptors.Configuration — The configuration descriptor.

Dispose(bool disposing)

protected override void Dispose(bool disposing)

Disconnects and disposes the device.

ParameterTypeDescription
disposingboolWhether or not this is called from Dispose.