Platforms to show: All Mac Windows Linux Cross-Platform

Back to LinuxHIDInterfaceMBS class.

LinuxHIDInterfaceMBS.Close as Integer

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

Returns error code. See kError* constants.

LinuxHIDInterfaceMBS.DumpTreeToStderr as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method USB MBS USB Plugin 10.3 ❌ No ❌ No ✅ Yes ❌ No Desktop, Console & Web
Dumps the device tree to stderr.
Example
dim h as LinuxHIDInterfaceMBS
// open device
call h.DumpTreeToStderr

Returns error code. See kError* constants.

Some examples using this method:

LinuxHIDInterfaceMBS.DumpTreeToStdout as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method USB MBS USB Plugin 10.3 ❌ No ❌ No ✅ Yes ❌ No Desktop, Console & Web
Dumps the device tree to stdout.
Example
dim h as LinuxHIDInterfaceMBS
// open device
call h.DumpTreeToStdout

Returns error code. See kError* constants.

LinuxHIDInterfaceMBS.ForceOpen(theInterface as Integer, Vendor as Integer, Product as Integer, retries as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method USB MBS USB Plugin 10.3 ❌ No ❌ No ✅ Yes ❌ No Desktop, Console & Web
Opens the USB device with the given interface index, vendor and product codes.
Example
dim h as new LinuxHIDInterfaceMBS

const vendor = &h7C0
const product = &h1500
const retries = 3

dim e as Integer = h.ForceOpen(0, vendor, product, retries)

Vendor or Product code can be kMatchAny (0) to match all devices.
You can use the MatchDevice event to learn which devices are there and return true there to select one.
Returns error code. See kError* constants.

Some examples using this method:

LinuxHIDInterfaceMBS.GetInputReport(path() as Integer, data as memoryblock, offset as Integer, size as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method USB MBS USB Plugin 10.3 ❌ No ❌ No ✅ Yes ❌ No Desktop, Console & Web
Reads an input report.

Path: The path to the endpoint.
Data: the memoryblock to store the data.
Offset: The offset where to start inside the memoryblock.
Size: the length of the data int he memoryblock.

Returns error code. See kError* constants.

LinuxHIDInterfaceMBS.InterruptRead(EndPoint as Integer, mem as memoryblock, size as Integer, timeout as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method USB MBS USB Plugin 10.3 ❌ No ❌ No ✅ Yes ❌ No Desktop, Console & Web
Reads data from an endpoint with timeout.

EndPoint: The index of the endpoint.
mem: the memoryblock where to store the data.
size: the length of the data block to read.
timeout: the timeout in milliseconds.

Returns error code. See kError* constants.

LinuxHIDInterfaceMBS.InterruptWrite(EndPoint as Integer, mem as memoryblock, size as Integer, timeout as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method USB MBS USB Plugin 11.0 ❌ No ❌ No ✅ Yes ❌ No Desktop, Console & Web
Writes data from an endpoint with timeout.

EndPoint: The index of the endpoint.
mem: the memoryblock where to store the data.
size: the length of the data block to read.
timeout: the timeout in milliseconds.

Returns error code. See kError* constants.

LinuxHIDInterfaceMBS.IsOpen as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method USB MBS USB Plugin 10.3 ❌ No ❌ No ✅ Yes ❌ No Desktop, Console & Web
Whether the device is opened.

True if open, false if closed.

LinuxHIDInterfaceMBS.Open(theInterface as Integer, Vendor as Integer, Product as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method USB MBS USB Plugin 10.3 ❌ No ❌ No ✅ Yes ❌ No Desktop, Console & Web
Opens the USB device with the given interface index, vendor and product codes.
Example
dim h as new LinuxHIDInterfaceMBS

const vendor = &h7C0
const product = &h1500

dim e as Integer = h.Open(0, vendor, product)

Vendor or Product code can be kMatchAny (0) to match all devices.
You can use the MatchDevice event to learn which devices are there and return true there to select one.
Returns error code. See kError* constants.

LinuxHIDInterfaceMBS.Reset

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

Returns error code. See kError* constants.

LinuxHIDInterfaceMBS.SetOutputReport(path() as Integer, data as memoryblock, offset as Integer, size as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method USB MBS USB Plugin 10.3 ❌ No ❌ No ✅ Yes ❌ No Desktop, Console & Web
Writes data to the output.
Example
dim h as LinuxHIDInterfaceMBS // your interface
dim n as Integer // some value

const IOW_PIPE_IO_PINS=0

dim m as MemoryBlock = NewMemoryBlock(4) // a device with 4 byte packets

m.Byte(3)=n
m.Byte(0)=IOW_PIPE_IO_PINS

dim path(-1) as Integer

path.Append &h00010000
path.Append 0

dim e as Integer = h.SetOutputReport(path, m, 0, m.size)

Path: The path to the endpoint.
Data: the data to write.
Offset: The offset where to start inside the memoryblock.
Size: the length of the data int he memoryblock.

Returns error code. See kError* constants.

See also:

LinuxHIDInterfaceMBS.SetOutputReport(path() as Integer, data as string) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method USB MBS USB Plugin 10.3 ❌ No ❌ No ✅ Yes ❌ No Desktop, Console & Web
Writes data to the output.

Path: The path to the endpoint.
Data: the data to write.

Returns error code. See kError* constants.

See also:

LinuxHIDInterfaceMBS.WriteIdentificationToStderr as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method USB MBS USB Plugin 10.3 ❌ No ❌ No ✅ Yes ❌ No Desktop, Console & Web
Writes identification to stderr.

Returns error code. See kError* constants.

LinuxHIDInterfaceMBS.WriteIdentificationToStdout as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method USB MBS USB Plugin 10.3 ❌ No ❌ No ✅ Yes ❌ No Desktop, Console & Web
Writes identification to stdout.

Returns error code. See kError* constants.

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


The biggest plugin in space...