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
Function: Aborts any outstanding transactions on the pipe with status kIOReturnAborted.
Notes:
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
Function: Clears the halted bit and the data toggle bit on the pipe's endpoint in the controller.
Notes:
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
Function: 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
Function: Returns the current configuration value set in the device (the interface will be part of that configuration.)
Notes:
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
Function: Connects to the first device matching product and vendor IDs.
Notes: 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
Function: Returns the USB Product ID (idProduct) of the device.
Notes:
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
Function: Returns the Device Release Number (bcdDevice) of the device.
Notes:
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
Function: Returns the USB Vendor ID (idVendor) of the device.
Notes:
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
Function: Returns the USB Class of the interface.
Notes: 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
Function: Returns the interface number (zero-based index) of this interface within the current configuration of the device.
Notes: 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
Function: Returns the USB Protocol of the interface.
Notes: 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
Function: Returns the USB Subclass of the interface.
Notes: 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
Function: Returns the location ID.
Notes:
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
Function: Returns the number of endpoints in this interface.
Notes:
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
Function: Reads data packet.
Notes: 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
Function: Reads data on a BULK IN or an INTERRUPT pipe.
Notes: 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
Function: Equivalent to ClearPipeStall.
Notes:
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
Function: Sends data packet.
Notes:
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
Function: Sends data packet.
Notes:
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
Function: Writes data on a BULK OUT or INTERRUPT OUT pipe.
Notes:
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
Function: Writes data on a BULK OUT or INTERRUPT OUT pipe.
Notes:
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.


💬 Ask a question or report a problem
The biggest plugin in space...


Start Chat