→ Bell Labs low-level sorcerer
→ Ontologically sane and Tautologically inoculated.
"Wherever there is a crowd there is untruth." - Søren Kierkegaard
int fd = open("/dev/hidraw0", O_RDONLY);
If (fd < 0) exit(EXIT_FAILURE);
unsigned char buf[256];
int res = read(fd, buf, sizeof(buf));
if (res > 0) {
printf("%d bytes:\n", res);
// do something else
}
close(fd)
int fd = open("/dev/hidraw0", O_RDONLY);
If (fd < 0) exit(EXIT_FAILURE);
unsigned char buf[256];
int res = read(fd, buf, sizeof(buf));
if (res > 0) {
printf("%d bytes:\n", res);
// do something else
}
close(fd)
Once you’ve identified the correct device, you can use the open() and read() sys calls in a C program to interact with it.
Once you’ve identified the correct device, you can use the open() and read() sys calls in a C program to interact with it.