Skip to content
This repository was archived by the owner on Nov 26, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good quick-fix but we should refactor the function (or how we allow for bitrates here).

We take a bitrate argument but in case we hit the branch here the argument is never used.

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) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should check for feof (?)

throw error{"encountered EOF on serial device"};
} else {
bytes_read += ret;
Expand Down