Share via


LoopbackEndpoint Property

The LoopbackEndpoint property gets or sets a partner endpoint for which this endpoint will call ISoftUSBEndpoint::QueueINData for each OUT transaction that it receives.

This property is read/write.

Syntax

HRESULT put_LoopbackEndpoint(
  [in]   ISoftUSBEndpoint *piSoftUSBEndpoint
);

HRESULT putref_LoopbackEndpoint(
  [in]   ISoftUSBEndpoint *piSoftUSBEndpoint
);

HRESULT get_LoopbackEndpoint(
  [out]  ISoftUSBEndpoint **ppiSoftUSBEndpoint
);

Property Value

The new loopback endpoint for the endpoint.

Error Codes

LoopbackEndpoint returns S_OK if the operation succeeds.

This property can return other standard COM return values.

Remarks

The LoopbackEndpoint property provides a simple mechanism to create a loopback device.

You should use this property only to test that endpoints are correctly sending and receiving data from each endpoint.

Examples

The following VBScript code example shows to set and get the Loopback property to produce a simple loopback device.

Private Sub SetupEndpoint(UsbDev)

    Dim BulkINEndpoint 
    Set BulkINEndpoint    = CreateObject("SOFTUSB.SoftUSBEndpoint")
    Dim BulkOUTEndpoint 
    Set BulkOUTEndpoint   = CreateObject("SOFTUSB.SoftUSBEndpoint")

 ' Set up the endpoints.
 BulkINEndpoint.EndpointAddress = &H81          ' Endpoint #1, IN
 BulkINEndpoint.Attributes = &H02               ' Bulk data endpoint
 BulkINEndpoint.MaxPacketSize = 1024
 BulkINEndpoint.Interval = 0
 BulkINEndpoint.Halted = FALSE

 BulkOUTEndpoint.EndpointAddress = &H02          ' Endpoint #2, OUT
 BulkOUTEndpoint.Attributes = &H02               ' Bulk data endpoint
 BulkOUTEndpoint.MaxPacketSize = 1024
 BulkOUTEndpoint.Interval = 0
 BulkOUTEndpoint.Halted = FALSE

 ' Give the endpoints a backpointer to their owning device
    Set BulkINEndpoint.USBDevice = UsbDev
    Set BulkOUTEndpoint.USBDevice = UsbDev

 ' Make the device a loopback device by tying the endpoints together. The following line of
 ' code tells the bulk OUT endpoint that it should pass all of the data that it receives
 ' from the host to the bulk IN endpoint's data queue for IN transactions.
    Set BulkOUTEndpoint.LoopbackEndpoint = BulkINEndpoint

End Sub

Requirements

Header

SoftUSBif.h

See Also

ISoftUSBEndpoint

ISoftUSBEndpoint::QueueINData

 

 

Send comments about this topic to Microsoft

Build date: 9/21/2010