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

Hardware flow control for serial ports falsely claims not to be supported. #65

Closed
jpherbst opened this issue Nov 16, 2017 · 4 comments
Closed

Comments

@jpherbst
Copy link

I am using linux and whenever I try to enable hardware flow control on a serial port I get a boost::asio::error::operation_not_supported. If I enable flow control manually using termios everything works fine.

Some sifting through the source code has gotten me to the assumption that _BSD_SOURCE is not defined on my system which appears to gate the standard unix flow control setup in the asio code. According to this website, http://man7.org/tlpi/code/faq.html#use_default_source, use of _BSD_SOURCE is depricated and maybe was removed in glibc, but I'm not really sure what the correct fix is.

I am using Linux 4.9.48 with glibc 2.25. Please let me know if more information is needed.

@mossheim
Copy link

mossheim commented Dec 1, 2018

I also have this issue on macOS (10.13.6). Not sure of the implementation version, but the check in /usr/include/sys/termios.h that enables the control flag definitions is this:

#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
#define CCTS_OFLOW	0x00010000	/* CTS flow control of output */
#define CRTSCTS		(CCTS_OFLOW | CRTS_IFLOW)
#define CRTS_IFLOW	0x00020000	/* RTS flow control of input */
#define	CDTR_IFLOW	0x00040000	/* DTR flow control of input */
#define CDSR_OFLOW	0x00080000	/* DSR flow control of output */
#define	CCAR_OFLOW	0x00100000	/* DCD flow control of output */
#define	MDMBUF		0x00100000	/* old name for CCAR_OFLOW */
#endif

Of course, this is not correct according to https://linux.die.net/man/3/termios, but it would be nice if I didn't have to circumvent this library to get basic functionality, so I hope you'll consider adding a check to enable this.

@jpherbst
Copy link
Author

jpherbst commented Dec 6, 2018

This seems to be fixed for my condition at least as early as Boost 1.66.

@mossheim
Copy link

mossheim commented Dec 7, 2018

Not fixed for me in 1.66.0

@ghost
Copy link

ghost commented Dec 30, 2020

This issue was moved by chriskohlhoff to chriskohlhoff/asio#592.

@ghost ghost closed this as completed Dec 30, 2020
@ghost ghost locked and limited conversation to collaborators Dec 30, 2020
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants