int main(void) {
struct hiddev_usage_ref ev;
+ struct hiddev_field_info fi;
int r, flag;
flag= HIDDEV_FLAG_UREF|HIDDEV_FLAG_REPORT;
if (ev.field_index == HID_FIELD_INDEX_NONE)
printf("report type %04x id %04x field index NONE\n",
ev.report_type, ev.report_id);
- else
+ else {
printf("report type %04x id %04x field index %04x"
- " usage index %04x code %04x value %08lx\n",
+ " usage index %04x code %04x value %08lx ",
ev.report_type, ev.report_id,
ev.field_index,
ev.usage_index, ev.usage_code,
(unsigned long)ev.value);
+ memset(&fi,0x55,sizeof(fi));
+ fi.report_type= ev.report_type;
+ fi.report_id= ev.report_id;
+ fi.field_index= ev.field_index;
+ r= ioctl(0, HIDIOCGFIELDINFO, &fi);
+ if (r) {
+ printf(" ? %s",strerror(errno));
+ } else {
+ printf(" maxusage %04x flags %04x"
+ " physical %04x %08lx..%08lx"
+ " logical %04x %08lx..%08lx"
+ " application %04x"
+ " unit %04x exponent %04x",
+ fi.maxusage, fi.flags,
+ fi.physical, (unsigned long)fi.physical_minimum,
+ (unsigned long)fi.physical_maximum,
+ fi.logical, (unsigned long)fi.logical_minimum,
+ (unsigned long)fi.logical_maximum,
+ fi.application,
+ fi.unit, fi.unit_exponent);
+ }
+ putchar('\n');
+ }
}
}