From 4de46de3cfedb1cfd6bdc3e70a66234a94020e48 Mon Sep 17 00:00:00 2001 From: Matthias Wirth Date: Mon, 16 Sep 2024 13:13:04 +0200 Subject: [PATCH] make modesbeast read nonblocking this time for real hopefully --- sdr_beast.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sdr_beast.c b/sdr_beast.c index 94111a0d..2893f7d8 100644 --- a/sdr_beast.c +++ b/sdr_beast.c @@ -137,6 +137,7 @@ bool beastOpen(void) { speed_t baud = B3000000; int flags = O_RDWR | O_NOCTTY; + //flags |= O_NONBLOCK; Modes.beast_fd = open(Modes.beast_serial, flags); if (Modes.beast_fd < 0) { fprintf(stderr, "Failed to open serial device %s: %s\n", @@ -154,8 +155,9 @@ bool beastOpen(void) { tios.c_oflag = 0; tios.c_lflag = 0; tios.c_cflag = CS8 | CRTSCTS; - tios.c_cc[VMIN] = 11; // read returns when a minimum of 11 characters are available - tios.c_cc[VTIME] = 1; // 100 ms timeout for reads + //tios.c_cc[VMIN] = 11; // read returns when a minimum of 11 characters are available + tios.c_cc[VMIN] = 0; // polling read with vtime 0 + tios.c_cc[VTIME] = 0; if (Modes.sdr_type == SDR_GNS) { baud = B921600;