diff --git a/hidapi/hidapi.h b/hidapi/hidapi.h index 7dfb571..32943c0 100644 --- a/hidapi/hidapi.h +++ b/hidapi/hidapi.h @@ -55,6 +55,9 @@ extern "C" { unsigned short product_id; /** Serial Number */ wchar_t *serial_number; + /** Device Release Number in binary-coded decimal, + also known as Device Version Number */ + unsigned short release_number; /** Manufacturer String */ wchar_t *manufacturer_string; /** Product string */ diff --git a/linux/hid-libusb.c b/linux/hid-libusb.c index 0209a35..f093f1d 100644 --- a/linux/hid-libusb.c +++ b/linux/hid-libusb.c @@ -498,6 +498,9 @@ struct hid_device_info HID_API_EXPORT *hid_enumerate(unsigned short vendor_id, /* VID/PID */ cur_dev->vendor_id = dev_vid; cur_dev->product_id = dev_pid; + + /* Release Number */ + cur_dev->release_number = desc.bcdDevice; } } } /* altsettings */ diff --git a/linux/hid.c b/linux/hid.c index 60a3f78..9a716c5 100644 --- a/linux/hid.c +++ b/linux/hid.c @@ -295,6 +295,10 @@ struct hid_device_info HID_API_EXPORT *hid_enumerate(unsigned short vendor_id, /* VID/PID */ cur_dev->vendor_id = dev_vid; cur_dev->product_id = dev_pid; + + /* Release Number */ + str = udev_device_get_sysattr_value(dev, "bcdDevice"); + cur_dev->release_number = (str)? strtol(str, NULL, 16): 0x0; } else goto next; diff --git a/mac/hid.c b/mac/hid.c index f194e21..af10d81 100644 --- a/mac/hid.c +++ b/mac/hid.c @@ -361,6 +361,9 @@ struct hid_device_info HID_API_EXPORT *hid_enumerate(unsigned short vendor_id, /* VID/PID */ cur_dev->vendor_id = dev_vid; cur_dev->product_id = dev_pid; + + /* Release Number */ + cur_dev->release_number = get_int_property(dev, CFSTR(kIOHIDVersionNumberKey)); } } diff --git a/windows/hid.cpp b/windows/hid.cpp index 0b7ccd3..4688215 100644 --- a/windows/hid.cpp +++ b/windows/hid.cpp @@ -356,6 +356,9 @@ struct hid_device_info HID_API_EXPORT * HID_API_CALL hid_enumerate(unsigned shor /* VID/PID */ cur_dev->vendor_id = attrib.VendorID; cur_dev->product_id = attrib.ProductID; + + /* Release Number */ + cur_dev->release_number = attrib.VersionNumber; } cont_close: