Platforms to show: All Mac Windows Linux Cross-Platform
Back to WinHIDMBS class.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | USB | MBS USB Plugin | 7.5 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | USB | MBS USB Plugin | 7.5 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
Lasterror is set.
Returns true on success and false on failure.
The plugin tries to open a read and a write connection. If both fail, connect returns false. If one is okay, it returns true.
Some devices don't allow read or write because of missing permissions.
WinHIDMBS.DevicePath as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | USB | MBS USB Plugin | 9.3 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
Only for debugging.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | USB | MBS USB Plugin | 7.5 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
Lasterror is set.
WinHIDMBS.FindFirstDevice as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | USB | MBS USB Plugin | 7.5 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
Returns true on success and false on failure.
On Windows finds only devices which can be opened for Read/Write.
WinHIDMBS.FindNextDevice as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | USB | MBS USB Plugin | 7.5 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
Returns true on success and false on failure.
WinHIDMBS.GetInputReport(data as MemoryBlock, Offset as Integer = 0, Length as Integer = 0) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | USB | MBS USB Plugin | 15.0 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
This is very low level.
First byte of data block is report ID.
If Length is 0, we use size of memoryblock.
Returns true on success.
see also:
https://msdn.microsoft.com/en-us/library/windows/hardware/ff538945(v=vs.85).aspx
WinHIDMBS.InstallListener(PollSize as Integer) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | USB | MBS USB Plugin | 7.8 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
Use PollString or PollMemory in a timer or a loop to get the data.
This is an alternative way compared to ReadMessage functions.
WinHIDMBS.Manufacturer as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | USB | MBS USB Plugin | 7.5 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
On any error an empty string is returned.
Lasterror is set.
WinHIDMBS.PollMemory as memoryblock
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | USB | MBS USB Plugin | 7.8 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
A connection must be open and InstallListener must be used.
Lasterror is set.
You may want to try this function in a loop or a timer till you get data.
WinHIDMBS.PollString as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | USB | MBS USB Plugin | 7.8 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
A connection must be open and InstallListener must be used.
Lasterror is set.
You may want to try this function in a loop or a timer till you get data.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | USB | MBS USB Plugin | 7.5 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
Lasterror is set.
WinHIDMBS.ProductID as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | USB | MBS USB Plugin | 7.5 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
Lasterror is set.
WinHIDMBS.ReadMessage(length as Integer, timeOut as Integer = 0) as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | USB | MBS USB Plugin | 13.3 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
Length is the length of the receive buffer you want to use.
The string returned is 0 to length bytes long.
A connection must be open.
Lasterror is set.
You may want to try this function in a loop till you get data.
Timeout is a timeout value in milliseconds.
WinHIDMBS.ReadMessageMemory(length as Integer, timeOut as Integer = 0) as memoryblock
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | USB | MBS USB Plugin | 13.3 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
Length is the length of the receive buffer you want to use.
The memoryblock returned has a size of 0 to length bytes.
A connection must be open.
Lasterror is set.
You may want to try this function in a loop till you get data.
Timeout is a timeout value in milliseconds.
WinHIDMBS.SendMessage(data as string) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | USB | MBS USB Plugin | 7.5 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
A connection must be open.
Returns number of bytes sent.
The first byte must be the Report ID which seems to be zero for most devices.
WinHIDMBS.SendMessageMemory(data as memoryblock, Offset as Integer = 0, length as Integer = 0) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | USB | MBS USB Plugin | 7.5 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
A connection must be open.
Lasterror is set.
Returns number of bytes sent.
While writing a crossplatform application we saw the following thing: The data buffer for the SendMessageMemory call must be 8 bytes long on Mac for our device (with MacHIDMBS) and 61 bytes long for Windows (with WinHIDMBS) for our HID device. We have 1 byte for the ReportID and 60 data bytes where the first 8 are set like on the Mac. So if the calls fail on Windows, try with a higher length and check the WinHIDMBS.OutputReportByteLength property.
The first byte must be the Report ID which seems to be zero for most devices.
If length is zero, we use the length of memoryblock.
WinHIDMBS.SerialNumber as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | USB | MBS USB Plugin | 7.5 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
Lasterror is set.
WinHIDMBS.SetOutputReport(data as MemoryBlock, Offset as Integer = 0, Length as Integer = 0) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | USB | MBS USB Plugin | 15.0 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
This is very low level.
First byte of data block is report ID.
If Length is 0, we use size of memoryblock.
Returns true on success.
see also
https://msdn.microsoft.com/en-us/library/windows/hardware/ff539690(v=vs.85).aspx
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | USB | MBS USB Plugin | 7.5 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
Lasterror is set.
WinHIDMBS.VersionNumber as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | USB | MBS USB Plugin | 7.5 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
Value can be anything.
On any error, 0 is returned.
Lasterror is set.
The items on this page are in the following plugins: MBS USB Plugin.