get descriptor size

This commit is contained in:
Denis 2023-12-09 03:14:24 +01:00
parent 6ff312f95f
commit 4b07473fe9
No known key found for this signature in database
GPG key ID: DD9B63F805CF5C03

View file

@ -43,6 +43,12 @@ static int dev_hidraw_new_from_fd(int fd, dev_hidraw_t **const out_dev) {
}
res = ioctl((*out_dev)->fd, HIDIOCGRDESC, &(*out_dev)->rdesc);
if (res < 0) {
perror("Error getting Report Descriptor");
goto dev_hidraw_new_from_fd_err;
}
res = ioctl((*out_dev)->fd, HIDIOCGRDESCSIZE, &(*out_dev)->rdesc.size);
if (res < 0) {
perror("Error getting Report Descriptor");
goto dev_hidraw_new_from_fd_err;