open that stupid hidraw device once and for all!!!
This commit is contained in:
parent
547265b259
commit
3eba3bcd58
3 changed files with 4 additions and 6 deletions
|
|
@ -56,8 +56,6 @@ int dev_hidraw_open(
|
|||
) {
|
||||
int res = -ENOENT;
|
||||
|
||||
|
||||
|
||||
char path[MAX_PATH_LEN] = "\0";
|
||||
|
||||
DIR *d;
|
||||
|
|
@ -75,7 +73,7 @@ int dev_hidraw_open(
|
|||
|
||||
// try to open the device, if it cannot be opened to go the next
|
||||
int fd = open(path, O_RDWR);
|
||||
if (fd != 0) {
|
||||
if (fd < 0) {
|
||||
//fprintf(stderr, "Cannot open %s, device skipped.\n", path);
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -384,8 +384,8 @@ int dev_iio_open(
|
|||
//printf("Testing for device %s\n", path);
|
||||
|
||||
// try to open the device, if it cannot be opened to go the next
|
||||
int fd = dev_iio_create(path, out_dev);
|
||||
if (fd != 0) {
|
||||
const int iio_creation_res = dev_iio_create(path, out_dev);
|
||||
if (iio_creation_res != 0) {
|
||||
//fprintf(stderr, "Cannot open %s, device skipped.\n", path);
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ typedef enum input_dev_type {
|
|||
typedef struct hidraw_filters {
|
||||
const int16_t pid;
|
||||
const int16_t vid;
|
||||
const uint16_t rdesc_size;
|
||||
const uint16_t rdesc_size; // wc -c < /sys/class/hidraw/hidraw0/device/report_descriptor
|
||||
} hidraw_filters_t;
|
||||
|
||||
typedef struct uinput_filters {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue