Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable termios baudrate configuration for macOS #341

Closed
Closed
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions include/uxr/agent/utils/ArgumentParser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1068,10 +1068,10 @@ class ArgumentParser

/* Setting baudrate. */
speed_t baudrate = getBaudRate(baudrate_str);
#if _HAVE_STRUCT_TERMIOS_C_ISPEED
#if _HAVE_STRUCT_TERMIOS_C_ISPEED || __APPLE__
attr.c_ispeed = baudrate;
#endif
#if _HAVE_STRUCT_TERMIOS_C_OSPEED
#if _HAVE_STRUCT_TERMIOS_C_OSPEED || __APPLE__
attr.c_ospeed = baudrate;
#endif

Expand Down
4 changes: 2 additions & 2 deletions src/cpp/transport/serial/MultiTermiosAgentLinux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ void MultiTermiosAgent::init_multiport()
new_attrs.c_cc[VMIN] = termios_attrs_.c_cc[VMIN];
new_attrs.c_cc[VTIME] = termios_attrs_.c_cc[VTIME];

#if _HAVE_STRUCT_TERMIOS_C_ISPEED
#if _HAVE_STRUCT_TERMIOS_C_ISPEED || __APPLE__
cfsetispeed(&new_attrs, termios_attrs_.c_ispeed);
#endif
#if _HAVE_STRUCT_TERMIOS_C_OSPEED
#if _HAVE_STRUCT_TERMIOS_C_OSPEED || __APPLE__
cfsetospeed(&new_attrs, termios_attrs_.c_ospeed);
#endif

Expand Down
4 changes: 2 additions & 2 deletions src/cpp/transport/serial/TermiosAgentLinux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ bool TermiosAgent::init()
new_attrs.c_cc[VMIN] = termios_attrs_.c_cc[VMIN];
new_attrs.c_cc[VTIME] = termios_attrs_.c_cc[VTIME];

#if _HAVE_STRUCT_TERMIOS_C_ISPEED
#if _HAVE_STRUCT_TERMIOS_C_ISPEED || __APPLE__
cfsetispeed(&new_attrs, termios_attrs_.c_ispeed);
#endif
#if _HAVE_STRUCT_TERMIOS_C_OSPEED
#if _HAVE_STRUCT_TERMIOS_C_OSPEED || __APPLE__
cfsetospeed(&new_attrs, termios_attrs_.c_ospeed);
#endif

Expand Down