Skip to content

Commit

Permalink
HID: hiddev.h: Fix example code.
Browse files Browse the repository at this point in the history
Fix hiddev.h example code.
To get the correct usage code, you need to set report_type and
report_id.

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Antonio Ospite authored and Jiri Kosina committed Oct 14, 2008
1 parent 34a5cee commit dded364
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/linux/hiddev.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ struct hiddev_usage_ref_multi {
* finfo.field_index = i;
* ioctl(fd, HIDIOCGFIELDINFO, &finfo);
* for (j = 0; j < finfo.maxusage; j++) {
* uref.report_type = rinfo.report_type;
* uref.report_id = rinfo.report_id;
* uref.field_index = i;
* uref.usage_index = j;
* ioctl(fd, HIDIOCGUCODE, &uref);
Expand Down

0 comments on commit dded364

Please sign in to comment.