mirror of
https://github.com/workinghard/jslisten.git
synced 2025-12-14 11:22:09 +00:00
Compare commits
1 Commits
b746920b68
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| f13e32e708 |
@@ -33,7 +33,7 @@ After searching the internet, I found nothing really interesting. Kodi addon wil
|
||||
|
||||
```
|
||||
cd /tmp
|
||||
git clone git@github.com:workinghard/jslisten.git
|
||||
git clone https://github.com/workinghard/jslisten.git
|
||||
cd jslisten
|
||||
|
||||
echo "Building jslisten binary"
|
||||
|
||||
@@ -417,15 +417,10 @@ void listenJoy (void) {
|
||||
sysPath = udev_device_get_syspath(mydev);
|
||||
devPath = udev_device_get_devnode(mydev);
|
||||
|
||||
if (sysPath != NULL && devPath != NULL && strstr(sysPath, "/js") != 0) {
|
||||
syslog (LOG_NOTICE, "Found Device: %s\n", devPath);
|
||||
if (joyFD < 0 || strcmp(devPath, myDevPath) == 0) {
|
||||
// Open the file descriptor
|
||||
if ((joyFD = open(devPath, O_RDONLY)) < 0) {
|
||||
syslog (LOG_INFO, "error: failed to open fd\n");
|
||||
} else {
|
||||
syslog (LOG_NOTICE, "Watching: %s\n", devPath);
|
||||
}
|
||||
if (sysPath != NULL && devPath != NULL && strstr(sysPath, myDevPath) != 0) {
|
||||
syslog(LOG_NOTICE, "Found Device: %s\n", devPath);
|
||||
if ((joyFD = open(devPath, O_RDONLY)) < 0) { // Open the file descriptor
|
||||
syslog(LOG_INFO, "error: failed to open fd\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -654,10 +649,12 @@ void parse_command_line(int argc, char* argv[]) {
|
||||
case 'm':
|
||||
if (strncmp(optarg, MODE_HOLD_STR, strlen(MODE_HOLD_STR)) == 0) {
|
||||
mode = HOLD;
|
||||
} else if (strncmp(optarg, MODE_PLAIN_STR, strlen(MODE_PLAIN_STR)) == 0) {
|
||||
}
|
||||
if (strncmp(optarg, MODE_PLAIN_STR, strlen(MODE_PLAIN_STR)) == 0) {
|
||||
mode = PLAIN;
|
||||
} else {
|
||||
syslog(LOG_WARNING, "--mode %s parameter unknown. Using default.\n", optarg);
|
||||
|
||||
}
|
||||
break;
|
||||
case '?':
|
||||
|
||||
Reference in New Issue
Block a user