@@ -293,22 +293,26 @@ extern "C" {
293
293
294
294
/** @brief Get a feature report from a HID device.
295
295
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].
299
301
300
302
@ingroup API
301
303
@param device A device handle returned from hid_open().
302
304
@param data A buffer to put the read data into, including
303
305
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.
305
308
@param length The number of bytes to read, including an
306
309
extra byte for the report ID. The buffer can be longer
307
310
than the actual report.
308
311
309
312
@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.
312
316
*/
313
317
int HID_API_EXPORT HID_API_CALL hid_get_feature_report (hid_device * device , unsigned char * data , size_t length );
314
318
0 commit comments