Class UsbInterfaceBase
Represents a USB interface
Inheritance
System.Object
UsbInterfaceBase
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: Usb.Net.dll
Syntax
public abstract class UsbInterfaceBase
Constructors
Declaration
protected UsbInterfaceBase(PerformControlTransferAsync performControlTransferAsync, ILogger logger = null, ushort? readBufferSize = null, ushort? writeBufferSize = null)
Parameters
Type |
Name |
Description |
PerformControlTransferAsync |
performControlTransferAsync |
|
Microsoft.Extensions.Logging.ILogger |
logger |
|
System.Nullable<System.UInt16> |
readBufferSize |
|
System.Nullable<System.UInt16> |
writeBufferSize |
|
Properties
InterfaceNumber
Declaration
public abstract byte InterfaceNumber { get; }
Property Value
Type |
Description |
System.Byte |
|
InterruptReadEndpoint
Declaration
public IUsbInterfaceEndpoint InterruptReadEndpoint { get; set; }
Property Value
InterruptWriteEndpoint
Declaration
public IUsbInterfaceEndpoint InterruptWriteEndpoint { get; set; }
Property Value
Logger
Declaration
protected ILogger Logger { get; }
Property Value
Type |
Description |
Microsoft.Extensions.Logging.ILogger |
|
ReadBufferSize
Declaration
public ushort ReadBufferSize { get; }
Property Value
Type |
Description |
System.UInt16 |
|
ReadEndpoint
Declaration
public IUsbInterfaceEndpoint ReadEndpoint { get; set; }
Property Value
UsbInterfaceEndpoints
Declaration
public IList<IUsbInterfaceEndpoint> UsbInterfaceEndpoints { get; }
Property Value
WriteBufferSize
Declaration
public ushort WriteBufferSize { get; }
Property Value
Type |
Description |
System.UInt16 |
|
WriteEndpoint
Declaration
public IUsbInterfaceEndpoint WriteEndpoint { get; set; }
Property Value
Methods
ClaimInterface()
Note: some platforms require a call to be made to claim the interface. This is currently only for Android but may change
Declaration
public virtual async Task ClaimInterface()
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
Declaration
public async Task<TransferResult> PerformControlTransferAsync(SetupPacket setupPacket, byte[] buffer, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
SetupPacket |
setupPacket |
|
System.Byte[] |
buffer |
|
System.Threading.CancellationToken |
cancellationToken |
|
Returns
RegisterDefaultEndpoints()
Declaration
public void RegisterDefaultEndpoints()