Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

Platforms to show: All Mac Windows Linux Cross-Platform

HIDAPIDeviceMBS.Close
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method USB MBS USB Plugin 16.0 Yes Yes Yes Yes No
Function: Close a HID device.

Feedback, Comments & Corrections

HIDAPIDeviceMBS.Constructor
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method USB MBS USB Plugin 16.0 Yes Yes Yes Yes No
Function: The private constructor.

Feedback, Comments & Corrections

HIDAPIDeviceMBS.GetFeatureReport(ReportID as Integer, MaxLength as Integer) as MemoryBlock
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method USB MBS USB Plugin 16.0 Yes Yes Yes Yes No
Function: Get a feature report from a HID device.
Notes:
Set the first byte of Data to the Report ID of the report to be read. Make sure to allow space for this extra byte in data. Upon return, the first byte will still contain the Report ID, and the report data will start in data.UInt8(1).

ReportID: The report ID to read.

This function returns the number of bytes read plus one for the report ID (which is still in the first byte), or -1 on error.

Feedback, Comments & Corrections

HIDAPIDeviceMBS.IndexedString(Index as Integer, MaxLen as Integer = 1024) as String
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method USB MBS USB Plugin 16.0 Yes Yes Yes Yes No
Function: Get a string from a HID device, based on its string index.
Notes:
Index: The index of the string to get.
maxlen: The maximum length for read buffer.
Returns text read.

Feedback, Comments & Corrections

HIDAPIDeviceMBS.Read(MaxLength as Integer) as MemoryBlock
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method USB MBS USB Plugin 16.0 Yes Yes Yes Yes No
Function: Read an Input report from a HID device.
Notes:
Input reports are returned to the host through the INTERRUPT IN endpoint. The first byte will contain the Report number if the device uses numbered reports.

MaxLength: The number of bytes to read. For devices with multiple reports, make sure to read an extra byte for the report number.

This function returns the actual number of bytes read and -1 on error. If no packet was available to be read and the handle is in non-blocking mode, this function returns 0.

Feedback, Comments & Corrections

HIDAPIDeviceMBS.ReadTimeOut(MaxLength as Integer, TimeoutMS as Integer) as MemoryBlock
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method USB MBS USB Plugin 16.0 Yes Yes Yes Yes No
Function: Read an Input report from a HID device with timeout.
Notes:
Input reports are returned to the host through the INTERRUPT IN endpoint. The first byte will contain the Report number if the device uses numbered reports.

MaxLength: The number of bytes to read. For devices with multiple reports, make sure to read an extra byte for the report number.

TimeoutMS: timeout in milliseconds or -1 for blocking wait.

This function returns the actual number of bytes read and -1 on error. If no packet was available to be read within the timeout period, this function returns 0.

Feedback, Comments & Corrections

HIDAPIDeviceMBS.SendFeatureReport(data as MemoryBlock) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method USB MBS USB Plugin 16.0 Yes Yes Yes Yes No
Function: Send a Feature report to the device.
Notes:
Feature reports are sent over the Control endpoint as a Set_Report transfer. The first byte of Data must contain the Report ID. For devices which only support a single report, this must be set to 0. The remaining bytes contain the report data. Since the Report ID is mandatory, calls to SendFeatureReport() will always contain one more byte than the report contains. For example, if a hid report is 16 bytes long, 17 bytes must be passed to SendFeatureReport(): the Report ID (or 0, for devices which do not use numbered reports), followed by the report data (16 bytes). In this example, the length passed in would be 17.

dat:a The data to send, including the report number as the first byte.

This function returns the actual number of bytes written and -1 on error.

See also:

Feedback, Comments & Corrections

HIDAPIDeviceMBS.SendFeatureReport(data as String) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method USB MBS USB Plugin 16.0 Yes Yes Yes Yes No
Function: Send a Feature report to the device.
Notes:
Feature reports are sent over the Control endpoint as a Set_Report transfer. The first byte of Data must contain the Report ID. For devices which only support a single report, this must be set to 0. The remaining bytes contain the report data. Since the Report ID is mandatory, calls to SendFeatureReport() will always contain one more byte than the report contains. For example, if a hid report is 16 bytes long, 17 bytes must be passed to SendFeatureReport(): the Report ID (or 0, for devices which do not use numbered reports), followed by the report data (16 bytes). In this example, the length passed in would be 17.

dat:a The data to send, including the report number as the first byte.

This function returns the actual number of bytes written and -1 on error.

See also:

Feedback, Comments & Corrections

HIDAPIDeviceMBS.Write(data as MemoryBlock) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method USB MBS USB Plugin 16.0 Yes Yes Yes Yes No
Function: Write an Output report to a HID device.
Notes:
The first byte of data must contain the Report ID. For devices which only support a single report, this must be set to 0x0. The remaining bytes contain the report data. Since the Report ID is mandatory, calls to Write() will always contain one more byte than the report contains. For example, if a hid report is 16 bytes long, 17 bytes must be passed to Write(), the Report ID (or 0x0, for devices with a single report), followed by the report data (16 bytes). In this example, the length passed in would be 17.
Write() will send the data on the first OUT endpoint, if one exists. If it does not, it will send the data through the Control Endpoint (Endpoint 0).

data: The data to send, including the report number as the first byte.

This function returns the actual number of bytes written and -1 on error.

See also:

Feedback, Comments & Corrections

HIDAPIDeviceMBS.Write(data as String) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method USB MBS USB Plugin 16.0 Yes Yes Yes Yes No
Function: Write an Output report to a HID device.
Notes:
The first byte of data must contain the Report ID. For devices which only support a single report, this must be set to 0x0. The remaining bytes contain the report data. Since the Report ID is mandatory, calls to Write() will always contain one more byte than the report contains. For example, if a hid report is 16 bytes long, 17 bytes must be passed to Write(), the Report ID (or 0x0, for devices with a single report), followed by the report data (16 bytes). In this example, the length passed in would be 17.
Write() will send the data on the first OUT endpoint, if one exists. If it does not, it will send the data through the Control Endpoint (Endpoint 0).

data: The data to send, including the report number as the first byte.

This function returns the actual number of bytes written and -1 on error.

See also:

Feedback, Comments & Corrections

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




Links
MBS Xojo Plugins