mirror of https://github.com/nirenjan/libx52.git
Retrieve hidraw file from command line
parent
0a541e18ba
commit
4a1ca0badb
|
@ -48,9 +48,14 @@ int main(int argc, char **argv)
|
||||||
struct hidraw_report_descriptor rpt_desc;
|
struct hidraw_report_descriptor rpt_desc;
|
||||||
struct hidraw_devinfo info;
|
struct hidraw_devinfo info;
|
||||||
|
|
||||||
|
if (argc != 2) {
|
||||||
|
fprintf(stderr, "usage: %s <path-to-hidraw-file>\n", argv[0]);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
/* Open the Device with non-blocking reads. In real life,
|
/* Open the Device with non-blocking reads. In real life,
|
||||||
don't use a hard coded path; use libudev instead. */
|
don't use a hard coded path; use libudev instead. */
|
||||||
fd = open("/dev/hidraw0", O_RDONLY);
|
fd = open(argv[1], O_RDONLY);
|
||||||
|
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
perror("Unable to open device");
|
perror("Unable to open device");
|
||||||
|
|
Loading…
Reference in New Issue