Platforms to show: All Mac Windows Linux Cross-Platform
LinuxHIDInterfaceMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | USB | MBS USB Plugin | 10.3 | ❌ No | ❌ No | ✅ Yes | ❌ No | Desktop, Console & Web |
For newer development, please use our HIDAPIMBS class.
The constructor does the initialisation of the HID Library and the destructor does the cleanup. This works with several instances, too.
The plugin tries to load one of libhid.so, libhid.so.0 or libhid.so.0.0.0 and one of libusb.so or libusb-0.1.so.4 from your /usr/lib folder (or where else the path environment variable points to). If the libraries are missing, this class will not work properly.
- event MatchDevice(usbdev as LinuxUSBDeviceHandleMBS) as boolean
- property Handle as Integer
- 14 methods
- method Close as Integer
- method DumpTreeToStderr as Integer
- method DumpTreeToStdout as Integer
- method ForceOpen(theInterface as Integer, Vendor as Integer, Product as Integer, retries as Integer) as Integer
- method GetInputReport(path() as Integer, data as memoryblock, offset as Integer, size as Integer) as Integer
- method InterruptRead(EndPoint as Integer, mem as memoryblock, size as Integer, timeout as Integer) as Integer
- method InterruptWrite(EndPoint as Integer, mem as memoryblock, size as Integer, timeout as Integer) as Integer
- method IsOpen as boolean
- method Open(theInterface as Integer, Vendor as Integer, Product as Integer) as Integer
- method Reset
- method SetOutputReport(path() as Integer, data as memoryblock, offset as Integer, size as Integer) as Integer
- method SetOutputReport(path() as Integer, data as string) as Integer
- method WriteIdentificationToStderr as Integer
- method WriteIdentificationToStdout as Integer
- 5 shared methods
- shared method Available as boolean
- shared method IsInitialised as boolean
- shared method SetDebugLevel(level as Integer)
- shared method SetDebugOutputToStderr
- shared method SetDebugOutputToStdout
- 32 constants
Constants
Constant | Value | Description |
---|---|---|
kDebugAll | 31 |
One of the debug level constants.
same as kDebugWarnings + kDebugTraces + kDebugNotices + kDebugErrors + kDebugAsserts |
kDebugAsserts | 16 | One of the debug level constants. |
kDebugErrors | 1 | One of the debug level constants. |
kDebugNone | 0 | One of the debug level constants. |
kDebugNotices | 4 | One of the debug level constants. |
kDebugNoTraces | 23 |
One of the debug level constants.
same as kDebugWarnings + kDebugNotices + kDebugErrors + kDebugAsserts |
kDebugTraces | 8 | One of the debug level constants. |
kDebugWarnings | 2 | One of the debug level constants. |
kErrorAlreadyInitialised | 3 |
One of the error codes.
Device alreay initialised. |
kErrorDeviceAlreadyOpened | 9 |
One of the error codes.
Device already opened. |
kErrorDeviceNotFound | 7 |
One of the error codes.
Device is not found. |
kErrorDeviceNotOpened | 8 |
One of the error codes.
Device is not opened. |
kErrorFailAlloc | 17 |
One of the error codes.
Failed to allocate. |
kErrorFailClaimIFace | 11 |
One of the error codes.
Failed to claim the interface. |
kErrorFailCloseDevice | 10 |
One of the error codes.
Failed to close device. |
kErrorFailDetachDriver | 12 |
One of the error codes.
Failed to detach driver. |
kErrorFailFindBusses | 4 |
One of the error codes.
Failed to find buses. |
kErrorFailFindDevices | 5 |
One of the error codes.
Failed to find devices. |
kErrorFailGetReport | 20 |
One of the error codes.
Get Report failed. |
kErrorFailIntRead | 21 | One of the error codes. |
kErrorFailOpenDevice | 6 |
One of the error codes.
Failed to open device. |
kErrorFailSetReport | 19 |
One of the error codes.
Set Report failed. |
kErrorHIDDescShort | 14 | One of the error codes. |
kErrorInvalidParameter | 1 |
One of the error codes.
Invalid Parameter. |
kErrorNotFound | 22 |
One of the error codes.
Device not found. |
kErrorNotHIDDevice | 13 |
One of the error codes.
Not a HID Device. |
kErrorNotInitialised | 2 |
One of the error codes.
Not initialised. |
kErrorOutOfSpace | 18 |
One of the error codes.
Out of space. |
kErrorReportDescLong | 16 | One of the error codes. |
kErrorReportDescShort | 15 | One of the error codes. |
kErrorSuccess | 0 |
One of the error codes.
Success. No error. |
kMatchAny | 0 | The vendor/product ID to match any device. |
This class has no sub classes.
Some examples using this class:
Blog Entries
- MBS Xojo / Real Studio Plugins, version 14.2pr12
- MBS REALbasic Plugins, version 10.6pr1
- MBS REALbasic Plugins Version 10.4 release notes
- MBS REALbasic Plugins, version 10.4pr2
- MBS Plugins 10.3 Release Notes
- MBS REALbasic Plugins, version 10.3pr4
The items on this page are in the following plugins: MBS USB Plugin.
LibUSBVersionMBS - LinuxJavaScriptContextMBS