Skip to content

Commit

Permalink
Fixed badly set bitrate causing sweep object creation to hang on Linux (
Browse files Browse the repository at this point in the history
#117)

* Fixed badly set bitrate causing sweep object creation to hang on Linux

* Removed redundant condition in get_baud
  • Loading branch information
Vrong authored and dcyoung committed Jul 18, 2017
1 parent 0a326fa commit 3c6738e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion libsweep/src/unix/serial.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ static speed_t get_baud(int32_t bitrate) {
throw error{"Only baud rate 115200 is supported at this time."};
return -1;
}

// translate human readable bitrate to termios bitrate
#ifdef B115200
return B115200;
#endif
return bitrate;
}

Expand Down Expand Up @@ -148,7 +153,7 @@ void device_read(device_s serial, void* to, int32_t len) {
} else {
throw error{"reading from serial device failed"};
}
} else if(ret == 0){
} else if (ret == 0) {
throw error{"encountered EOF on serial device"};
} else {
bytes_read += ret;
Expand Down

0 comments on commit 3c6738e

Please sign in to comment.