RawDevice Class
Namespace: GHIElectronics.TinyCLR.Devices.UsbClient · Assembly: GHIElectronics.TinyCLR.Devices.UsbClient
Represent a USB device.
public class RawDevice
Constructors
RawDevice(UsbClientController usbClientController, UsbClientSetting usbClientSetting)
public RawDevice(UsbClientController usbClientController, UsbClientSetting usbClientSetting)
Creates a new raw device.
| Parameter | Type | Description |
|---|---|---|
usbClientController | UsbClientController | UsbClient controller. |
usbClientSetting | UsbClientSetting | UsbClient setting |
Properties
MaxEndpoint
public static int MaxEndpoint { get; }
The maximum number of endpoints.
MaxStreams
public static int MaxStreams { get; }
The maximum number of streams.
VendorId
public ushort VendorId { get; }
The vendor id of the device.
ProductId
public ushort ProductId { get; }
The product id of the device.
BcdUsb
public ushort BcdUsb { get; }
The version of the device.
BcdDevice
public ushort BcdDevice { get; }
The version of the device.
MaximumPower
public ushort MaximumPower { get; }
The maximum power the device might need.
Manufacturer
public string Manufacturer { get; }
The manufacturer of the device.
Product
public string Product { get; }
The product name.
SerialNumber
public string SerialNumber { get; }
The serial number of the device.
DeviceState
public DeviceState DeviceState { get; }
No description available.
Methods
ReserveNewEndpoint()
public int ReserveNewEndpoint()
Gets the next available endpoint.
Returns int — The endpoint number.
ReserveNewEndpoint(int endpoint)
public void ReserveNewEndpoint(int endpoint)
Reserves the given endpoint.
| Parameter | Type | Description |
|---|---|---|
endpoint | int | The specific endpoint number to reserve. |
AddDescriptor(Configuration.Descriptor descriptor)
public void AddDescriptor(Configuration.Descriptor descriptor)
Adds a descriptor to the device.
| Parameter | Type | Description |
|---|---|---|
descriptor | Configuration.Descriptor | The descriptor to add. |
AddInterface(Configuration.UsbInterface usbInterface, string interfaceString)
public byte AddInterface(Configuration.UsbInterface usbInterface, string interfaceString)
Adds an interface to the device.
| Parameter | Type | Description |
|---|---|---|
usbInterface | Configuration.UsbInterface | The interface. |
interfaceString | string | The interface name. |
Returns byte — The assigned interface index.
Enable()
public virtual void Enable()
Re-enables interrupts after a matching Disable. (inherited)
Disable()
public virtual void Disable()
Disables interrupts on the current core. Always pair with Enable. (inherited)
Dispose()
public void Dispose()
Releases buffered memory (the unmanaged firmware/application buffers). (inherited)
CreateStream(int writeEndpoint, int readEndpoint)
public RawStream CreateStream(int writeEndpoint, int readEndpoint)
Creates a steam for reading and writing to the device.
| Parameter | Type | Description |
|---|---|---|
writeEndpoint | int | The write endpoint. Use RawStream.NullEndpoint if not available. |
readEndpoint | int | The read endpoint. Use RawStream.NullEndpoint if not available. |
Returns RawStream — The new stream.
SetInterfaceMap(byte interfaceIndex, byte data1, byte data2, byte data3)
public void SetInterfaceMap(byte interfaceIndex, byte data1, byte data2, byte data3)
No description available.
| Parameter | Type | Description |
|---|---|---|
interfaceIndex | byte | |
data1 | byte | |
data2 | byte | |
data3 | byte |
CreateStream(int index, RawDevice parent)
protected virtual RawStream CreateStream(int index, RawDevice parent)
Creates a new instance of the stream type for this device type.
| Parameter | Type | Description |
|---|---|---|
index | int | The index of the stream |
parent | RawDevice | The owning raw device. |
Returns RawStream — The new stream.
Events
DeviceStateChanged
public event DeviceStateChangedEventHandler DeviceStateChanged
No description available.
Fields
MAX_POWER
public const ushort MAX_POWER
No description available.
GHI_VID
public const ushort GHI_VID
No description available.