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
The class for linux to connect to USB HID devices.

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.

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


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


LibUSBVersionMBS   -   LinuxJavaScriptContextMBS


The biggest plugin in space...