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

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.

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.

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.

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.

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.

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.