UsbBulkInPipe UsbBulkInPipe UsbBulkInPipe UsbBulkInPipe UsbBulkInPipe Class


Represents the pipe that the underlying USB driver opens to communicate with a USB bulk IN endpoint of the device. The app can get an input stream from the pipe and access data is being read from the endpoint.

public : sealed class UsbBulkInPipe : IUsbBulkInPipe
struct winrt::Windows::Devices::Usb::UsbBulkInPipe : IUsbBulkInPipe
public sealed class UsbBulkInPipe : IUsbBulkInPipe
Public NotInheritable Class UsbBulkInPipe Implements IUsbBulkInPipe
// This class does not provide a public constructor.
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)


This code example shows how to read data from a bulk IN pipe. The example assumes that the app has previously obtained the UsbDevice object.

UsbDevice device;
UInt32 readLen = 8;

// Get the UsbDevice object. Not shown.


UsbBulkInPipe bulkIn = device.DefaultInterface.BulkInPipes[0];

DataReader reader = new DataReader(bulkIn.InputStream);

await reader.LoadAsync(readLen);

UInt64 data = reader.ReadUInt64();



EndpointDescriptor EndpointDescriptor EndpointDescriptor EndpointDescriptor EndpointDescriptor

Gets the object that represents endpoint descriptor associated with the USB bulk IN endpoint.

public : UsbBulkInEndpointDescriptor EndpointDescriptor { get; }
UsbBulkInEndpointDescriptor EndpointDescriptor();
public UsbBulkInEndpointDescriptor EndpointDescriptor { get; }
Public ReadOnly Property EndpointDescriptor As UsbBulkInEndpointDescriptor
var usbBulkInEndpointDescriptor = usbBulkInPipe.endpointDescriptor;
UsbBulkInEndpointDescriptor UsbBulkInEndpointDescriptor UsbBulkInEndpointDescriptor

A UsbBulkInEndpointDescriptor object that represents endpoint descriptor associated with the USB bulk IN endpoint.

InputStream InputStream InputStream InputStream InputStream

Input stream that stores the data that the bulk IN pipe received from the endpoint.

public : IInputStream InputStream { get; }
IInputStream InputStream();
public IInputStream InputStream { get; }
Public ReadOnly Property InputStream As IInputStream
var iInputStream = usbBulkInPipe.inputStream;
IInputStream IInputStream IInputStream

Input stream that contains data read from the endpoint.


To access data read from a bulk IN pipe, get the input stream from the pipe, and then use the DataReader to read data.

  auto stream = DeviceList::Current->Fx2Device->Configuration->UsbInterfaces->GetAt(0)->BulkInPipes->GetAt(0)->InputStream;  

    Windows::Storage::Streams::DataReader^ reader = ref new Windows::Storage::Streams::DataReader(stream);  

        .then ([this, reader] (uint32 result) 

           //Your code.  


MaxTransferSizeBytes MaxTransferSizeBytes MaxTransferSizeBytes MaxTransferSizeBytes MaxTransferSizeBytes

Gets the maximum number of bytes that can be read from the bulk IN pipe in a single transfer.

public : unsigned int MaxTransferSizeBytes { get; }
uint32_t MaxTransferSizeBytes();
public uint MaxTransferSizeBytes { get; }
Public ReadOnly Property MaxTransferSizeBytes As uint
var uint = usbBulkInPipe.maxTransferSizeBytes;
uint uint uint

The maximum number of bytes that can be read from the bulk IN pipe in a single transfer.

ReadOptions ReadOptions ReadOptions ReadOptions ReadOptions

Gets or sets configuration flags that controls the behavior of the pipe that reads data from a USB bulk IN endpoint.

public : UsbReadOptions ReadOptions { get; set; }
UsbReadOptions ReadOptions(); void ReadOptions(UsbReadOptions readoptions);
public UsbReadOptions ReadOptions { get; set; }
Public ReadWrite Property ReadOptions As UsbReadOptions
var usbReadOptions = usbBulkInPipe.readOptions;
usbBulkInPipe.readOptions = usbReadOptions;
UsbReadOptions UsbReadOptions UsbReadOptions

A UsbReadOptions value that indicates the pipe policy.


ClearStallAsync() ClearStallAsync() ClearStallAsync() ClearStallAsync() ClearStallAsync()

Starts an asynchronous operation to clear a stall condition (endpoint halt) on the USB bulk IN endpoint that is associated with the pipe.

public : IAsyncAction ClearStallAsync()
IAsyncAction ClearStallAsync() const;
public IAsyncAction ClearStallAsync()
Public Function ClearStallAsync() As IAsyncAction
Windows.Devices.Usb.UsbBulkInPipe.clearStallAsync().done( /* Your success and error handlers */ );

An IAsyncAction object that is used to control the asynchronous operation.

FlushBuffer() FlushBuffer() FlushBuffer() FlushBuffer() FlushBuffer()

Discards any data that is cached in the bulk IN pipe.

public : void FlushBuffer()
void FlushBuffer() const;
public void FlushBuffer()
Public Function FlushBuffer() As void