Platforms to show: All Mac Windows Linux Cross-Platform

Back to MacUSBMBS class.

MacUSBMBS.AbortPipe(PipeRef as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method USB MBS USB Plugin 12.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Aborts any outstanding transactions on the pipe with status kIOReturnAborted.

If there are outstanding asynchronous transactions on the pipe, the callbacks will happen.
Note that this command will also clear the halted bit on the endpoint in the controller, but will NOT clear the data toggle bit. If you want to clear the data toggle bit as well, see ClearPipeStall or ClearPipeStallBothEnds for more information. The interface must be open for the pipe to exist.
pipeRef: Index for the desired pipe (1 - GetNumEndpoints).
Lasterror is set to kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, or kIOReturnNotOpen if the interface is not open for exclusive access.

MacUSBMBS.ClearPipeStall(PipeRef as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method USB MBS USB Plugin 13.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Clears the halted bit and the data toggle bit on the pipe's endpoint in the controller.

This function also returns any outstanding transactions on the pipe with status kIOUSBTransactionReturned.
If there are outstanding asynchronous transactions on the pipe, the callbacks will happen. The data toggle may need to be resynchronized. The driver may handle this by sending a ClearFeature(ENDPOINT_HALT) to the default control pipe, specifying the device's endpoint for this pipe.

pipeRef: Index for the desired pipe (1 - NumEndpoints).
Lasterror is set to kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, or kIOReturnNotOpen if the interface is not open for exclusive access.

MacUSBMBS.Close

Type Topic Plugin Version macOS Windows Linux iOS Targets
method USB MBS USB Plugin 12.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Closes connection to the device.

MacUSBMBS.ConfigurationValue as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method USB MBS USB Plugin 12.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the current configuration value set in the device (the interface will be part of that configuration.)

The interface does not have to be open to use this function.
Lasterror is set.

MacUSBMBS.Connect as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method USB MBS USB Plugin 12.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Connects to the first device matching product and vendor IDs.

Returns true on success.

MacUSBMBS.DeviceProduct as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method USB MBS USB Plugin 12.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the USB Product ID (idProduct) of the device.

The device does not have to be open to use this function.
Lasterror is set. Returns the actual product ID of the device.

MacUSBMBS.DeviceReleaseNumber as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method USB MBS USB Plugin 12.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the Device Release Number (bcdDevice) of the device.

The device does not have to be open to use this function.
Lasterror is set.

MacUSBMBS.DeviceVendor as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method USB MBS USB Plugin 12.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the USB Vendor ID (idVendor) of the device.

The device does not have to be open to use this function.
Lasterror is set. Returns the actual vendor ID of the device.

MacUSBMBS.InterfaceClass as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method USB MBS USB Plugin 12.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the USB Class of the interface.

Lasterror is set.

MacUSBMBS.InterfaceNumber as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method USB MBS USB Plugin 12.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the interface number (zero-based index) of this interface within the current configuration of the device.

Lasterror is set.

MacUSBMBS.InterfaceProtocol as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method USB MBS USB Plugin 12.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the USB Protocol of the interface.

Lasterror is set.

MacUSBMBS.InterfaceSubClass as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method USB MBS USB Plugin 12.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the USB Subclass of the interface.

Lasterror is set.

MacUSBMBS.LocationID as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method USB MBS USB Plugin 12.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the location ID.

The location ID is a 32 bit number which is unique among all USB devices in the system, and which will not change on a system reboot unless the topology of the bus itself changes. The interface does not have to be open to use this function.
Lasterror is set.

MacUSBMBS.NumEndpoints as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method USB MBS USB Plugin 12.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the number of endpoints in this interface.

The interface does not have to be open to use this function.
Lasterror is set.

MacUSBMBS.ReadPacket(PipeRef as Integer, MaxSize as Integer = 1024) as Memoryblock

Type Topic Plugin Version macOS Windows Linux iOS Targets
method USB MBS USB Plugin 12.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Reads data packet.

We developed this function for a client, so it's probably useless for everyone else.

Some examples using this method:

MacUSBMBS.ReadRaw(PipeRef as Integer, MaxSize as Integer = 1024) as Memoryblock

Type Topic Plugin Version macOS Windows Linux iOS Targets
method USB MBS USB Plugin 12.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Reads data on a BULK IN or an INTERRUPT pipe.

Reads up to MaxSize bytes from the given pipe. Pipe is in range 1 to GetNumEndpoints.

MacUSBMBS.ResetPipe(PipeRef as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method USB MBS USB Plugin 12.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Equivalent to ClearPipeStall.

The interface must be open for the pipe to exist.
pipeRef: Index for the desired pipe (1 - GetNumEndpoints).
Lasterror is set to kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, or kIOReturnNotOpen if the interface is not open for exclusive access.

MacUSBMBS.WritePacket(PipeRef as Integer, Data as Memoryblock) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method USB MBS USB Plugin 12.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Sends data packet.

We developed this function for a client, so it's probably useless for everyone else.
Lasterror is set.

See also:

Some examples using this method:

MacUSBMBS.WritePacket(PipeRef as Integer, Data as string) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method USB MBS USB Plugin 12.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Sends data packet.

We developed this function for a client, so it's probably useless for everyone else.
Lasterror is set.

See also:

MacUSBMBS.WriteRaw(PipeRef as Integer, Data as Memoryblock) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method USB MBS USB Plugin 12.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Writes data on a BULK OUT or INTERRUPT OUT pipe.

The interface must be open for the pipe to exist.
PipeRef: Index for the desired pipe (1 - GetNumEndpoints).
Data: the buffer of data to send.
Lasterror is set.

See also:

MacUSBMBS.WriteRaw(PipeRef as Integer, Data as string) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method USB MBS USB Plugin 12.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Writes data on a BULK OUT or INTERRUPT OUT pipe.

The interface must be open for the pipe to exist.
PipeRef: Index for the desired pipe (1 - GetNumEndpoints).
Data: the buffer of data to send.
Lasterror is set.

See also:

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


The biggest plugin in space...