Skip to content
This repository was archived by the owner on Feb 26, 2020. It is now read-only.

Commit d17db57

Browse files
committed
header: Update documentation for hid_get_feature_report()
1 parent 54eb31d commit d17db57

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

hidapi/hidapi.h

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -293,22 +293,26 @@ extern "C" {
293293

294294
/** @brief Get a feature report from a HID device.
295295
296-
Make sure to set the first byte of @p data[] to the Report
297-
ID of the report to be read. Make sure to allow space for
298-
this extra byte in @p data[].
296+
Set the first byte of @p data[] to the Report ID of the
297+
report to be read. Make sure to allow space for this
298+
extra byte in @p data[]. Upon return, the first byte will
299+
still contain the Report ID, and the report data will
300+
start in data[1].
299301
300302
@ingroup API
301303
@param device A device handle returned from hid_open().
302304
@param data A buffer to put the read data into, including
303305
the Report ID. Set the first byte of @p data[] to the
304-
Report ID of the report to be read.
306+
Report ID of the report to be read, or set it to zero
307+
if your device does not use numbered reports.
305308
@param length The number of bytes to read, including an
306309
extra byte for the report ID. The buffer can be longer
307310
than the actual report.
308311
309312
@returns
310-
This function returns the number of bytes read and
311-
-1 on error.
313+
This function returns the number of bytes read plus
314+
one for the report ID (which is still in the first
315+
byte), or -1 on error.
312316
*/
313317
int HID_API_EXPORT HID_API_CALL hid_get_feature_report(hid_device *device, unsigned char *data, size_t length);
314318

0 commit comments

Comments
 (0)