Platforms to show: All Mac Windows Linux Cross-Platform
Back to LibUSBTransferMBS class.
LibUSBTransferMBS.Cancel as Integer
Function:
Cancels a running transfer.
Notes: Returns error code.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | USB | MBS USB Plugin | 22.2 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
Notes: Returns error code.
LibUSBTransferMBS.Constructor(ISOPackets as Integer = 0)
Function:
Allocates usb transfer object with given number of packets.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | USB | MBS USB Plugin | 22.2 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
LibUSBTransferMBS.ControlTransferGetData as Ptr
Function:
Queries pointer ot the setup part of the control transfer structure within the buffer.
Notes:
Convenience function since there is a 8 byte control block in front of the data.
Returns nil if not possible.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | USB | MBS USB Plugin | 22.2 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
Notes:
Convenience function since there is a 8 byte control block in front of the data.
Returns nil if not possible.
LibUSBTransferMBS.ControlTransferGetSetup as Ptr
Function:
Queries pointer ot the setup part of the control transfer structure within the buffer.
Notes:
Convenience function since there is a 8 byte control block in front of the data.
Returns nil if not possible.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | USB | MBS USB Plugin | 22.2 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
Notes:
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)
Function:
Helper function to populate the required fields for a bulk transfer using bulk streams.
Notes:
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
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | USB | MBS USB Plugin | 22.2 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
Notes:
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)
Function:
Helper function to populate the required fields for a bulk transfer.
Notes:
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
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | USB | MBS USB Plugin | 22.2 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
Notes:
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)
Function:
Helper function to populate the setup packet (first 8 bytes of the data buffer) for a control transfer.
Notes: The Index, Value and Length values should be given in host-endian byte order.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | USB | MBS USB Plugin | 22.2 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
Notes: 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)
Function:
Helper function to populate the required transfer fields for a control transfer.
Notes:
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:
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
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | USB | MBS USB Plugin | 22.2 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
Notes:
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)
Function:
Helper function to populate the required fields for an interrupt transfer.
Notes:
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
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | USB | MBS USB Plugin | 22.2 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
Notes:
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)
Function:
Helper function to populate the required \ref libusb_transfer fields for an isochronous transfer.
Notes:
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
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | USB | MBS USB Plugin | 22.2 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
Notes:
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
Function:
Queries buffer pointer for the packet.
Notes: This points within the buffer MemoryBlock.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | USB | MBS USB Plugin | 22.2 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
Notes: This points within the buffer MemoryBlock.
LibUSBTransferMBS.ISOPacketDescriptor(index as Integer) as LibUSBISOPacketDescriptorMBS
Function:
Isochronous packet descriptors, for isochronous transfers only.
Notes: Queries packet with given index. Zero based.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | USB | MBS USB Plugin | 22.2 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
Notes: Queries packet with given index. Zero based.
LibUSBTransferMBS.SetISOPacketLengths(Length as UInt32)
Function:
Sets length field for all packets.
Example:
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | USB | MBS USB Plugin | 22.2 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
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
Function:
Submits transfer asynchronously.
Notes:
Returns error code.
Later Completed event is called.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | USB | MBS USB Plugin | 22.2 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
Notes:
Returns error code.
Later Completed event is called.
The items on this page are in the following plugins: MBS USB Plugin.
