Skip to content
Snippets Groups Projects
Commit 3ac76097 authored by Lorenz Meier's avatar Lorenz Meier
Browse files

Merge pull request #331 from jean-m-cyr/master

Don't leave RX in bind mode if console open fails
parents 7a6a8ea5 39b3fc8d
No related branches found
No related tags found
No related merge requests found
......@@ -1696,8 +1696,6 @@ bind(int argc, char *argv[])
else
errx(1, "unknown parameter %s, use dsm2 or dsmx", argv[2]);
g_dev->ioctl(nullptr, DSM_BIND_START, pulses);
/* Open console directly to grab CTRL-C signal */
int console = open("/dev/console", O_NONBLOCK | O_RDONLY | O_NOCTTY);
if (!console)
......@@ -1706,6 +1704,8 @@ bind(int argc, char *argv[])
warnx("This command will only bind DSM if satellite VCC (red wire) is controlled by relay 1.");
warnx("Press CTRL-C or 'c' when done.");
g_dev->ioctl(nullptr, DSM_BIND_START, pulses);
for (;;) {
usleep(500000L);
/* Check if user wants to quit */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment