Skip to content

Commit

Permalink
make modesbeast read nonblocking
Browse files Browse the repository at this point in the history
this time for real hopefully
  • Loading branch information
wiedehopf committed Sep 16, 2024
1 parent 2a5e8b9 commit 4de46de
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sdr_beast.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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;
Expand Down

0 comments on commit 4de46de

Please sign in to comment.