Platforms to show: All Mac Windows Linux Cross-Platform

Back to LibUSBTransferMBS class.

LibUSBTransferMBS.Cancel as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method USB MBS USB Plugin 22.2 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Cancels a running transfer.

Returns error code.

LibUSBTransferMBS.Constructor(ISOPackets as Integer = 0)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method USB MBS USB Plugin 22.2 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Allocates usb transfer object with given number of packets.

LibUSBTransferMBS.ControlTransferGetData as Ptr

Type Topic Plugin Version macOS Windows Linux iOS Targets
method USB MBS USB Plugin 22.2 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Queries pointer ot the setup part of the control transfer structure within the buffer.

Convenience function since there is a 8 byte control block in front of the data.
Returns nil if not possible.

LibUSBTransferMBS.ControlTransferGetSetup as Ptr

Type Topic Plugin Version macOS Windows Linux iOS Targets
method USB MBS USB Plugin 22.2 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Queries pointer ot the setup part of the control transfer structure within the buffer.

Convenience function since there is a 8 byte control block in front of the data.
Returns nil if not possible.

LibUSBTransferMBS.FillBulkStreamTransfer(Device as LibUSBDeviceMBS, EndPoint as Integer, StreamId as Integer, Buffer as MemoryBlock, Timeout as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method USB MBS USB Plugin 22.2 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Helper function to populate the required fields for a bulk transfer using bulk streams.

Device: the device that will handle the transfer
endpoint: address of the endpoint where this transfer will be sent
StreamId: id for this transfer
buffer: data buffer
timeout: timeout for the transfer in milliseconds

LibUSBTransferMBS.FillBulkTransfer(Device as LibUSBDeviceMBS, EndPoint as Integer, Buffer as MemoryBlock, Timeout as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method USB MBS USB Plugin 22.2 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Helper function to populate the required fields for a bulk transfer.

Device: the device that will handle the transfer
endpoint: address of the endpoint where this transfer will be sent
buffer: data buffer
timeout: timeout for the transfer in milliseconds

LibUSBTransferMBS.FillControlSetup(Buffer as MemoryBlock, RequestType as Integer, Request as Integer, Value as Integer, Index as Integer, Length as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method USB MBS USB Plugin 22.2 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Helper function to populate the setup packet (first 8 bytes of the data buffer) for a control transfer.

The Index, Value and Length values should be given in host-endian byte order.

LibUSBTransferMBS.FillControlTransfer(Device as LibUSBDeviceMBS, Buffer as MemoryBlock, Timeout as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method USB MBS USB Plugin 22.2 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Helper function to populate the required transfer fields for a control transfer.

If you pass a transfer buffer to this function, the first 8 bytes will be interpreted as a control setup packet.

Therefore the recommended approach is:

  • Allocate a suitably sized MemoryBlock (including space for control setup)
  • Call FillControlSetup()
  • If this is a host-to-device transfer with a data stage, put the data in place after the setup packet
  • Call this function
  • Call Submit()

Device: the device that will handle the transfer
buffer: The data buffer. If provided, this function will interpret the first 8 bytes as a setup packet and infer the transfer length from that.
timeout: timeout for the transfer in milliseconds

LibUSBTransferMBS.FillInterruptTransfer(Device as LibUSBDeviceMBS, EndPoint as Integer, Buffer as MemoryBlock, Timeout as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method USB MBS USB Plugin 22.2 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Helper function to populate the required fields for an interrupt transfer.

Device: the device that will handle the transfer
endpoint: address of the endpoint where this transfer will be sent
buffer: data buffer
timeout: timeout for the transfer in milliseconds

LibUSBTransferMBS.FillISOTransfer(Device as LibUSBDeviceMBS, EndPoint as Integer, Buffer as MemoryBlock, NumISOPackets as Integer, Timeout as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method USB MBS USB Plugin 22.2 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Helper function to populate the required \ref libusb_transfer fields for an isochronous transfer.

Device: the device that will handle the transfer
endpoint: address of the endpoint where this transfer will be sent
buffer: data buffer
NumISOPackets: the number of isochronous packets
timeout: timeout for the transfer in milliseconds

LibUSBTransferMBS.ISOPacketBuffer(Index as Integer) as Ptr

Type Topic Plugin Version macOS Windows Linux iOS Targets
method USB MBS USB Plugin 22.2 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Queries buffer pointer for the packet.

This points within the buffer MemoryBlock.

LibUSBTransferMBS.ISOPacketDescriptor(index as Integer) as LibUSBISOPacketDescriptorMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method USB MBS USB Plugin 22.2 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Isochronous packet descriptors, for isochronous transfers only.

Queries packet with given index. Zero based.

LibUSBTransferMBS.SetISOPacketLengths(Length as UInt32)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method USB MBS USB Plugin 22.2 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Sets length field for all packets.
Example

// 3 buffers
Dim t As New LibUSBTransferMBS(3)
t.buffer = New MemoryBlock(100)


// set all length to 4
t.SetISOPacketLengths 4

Dim p0 As LibUSBISOPacketDescriptorMBS = t.ISOPacketDescriptor(0)
Dim p1 As LibUSBISOPacketDescriptorMBS = t.ISOPacketDescriptor(1)
Dim p2 As LibUSBISOPacketDescriptorMBS = t.ISOPacketDescriptor(2)

Break // check

LibUSBTransferMBS.Submit as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method USB MBS USB Plugin 22.2 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Submits transfer asynchronously.

Returns error code.

Later Completed event is called.

The items on this page are in the following plugins: MBS USB Plugin.


The biggest plugin in space...