-
Notifications
You must be signed in to change notification settings - Fork 654
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
Provide baud constants for cfsetispeed and family #514
Comments
Hey @berkowski. We would definitely prefer to have an enum that matches to the right constants. Would you be willing to put together a PR for this? |
Sure, no problem. |
homu
added a commit
that referenced
this issue
Feb 25, 2017
Added BaudRate enum for termios Issue #514 Does not provide `BaudRate::EXTA` or `BaudRate::EXTB` constants. These seem to alias to `B19200` and `B38400` respectively and so break the 1:1 mapping needed by `From`. I don't know their historic use.
homu
added a commit
that referenced
this issue
Feb 25, 2017
Added BaudRate enum for termios Issue #514 Does not provide `BaudRate::EXTA` or `BaudRate::EXTB` constants. These seem to alias to `B19200` and `B38400` respectively and so break the 1:1 mapping needed by `From`. I don't know their historic use.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
cfgetospeed
,cfgetispeed
,cfsetospeed
, andcfsetispeed
all work with the typespeed_t
, which is aliased toc_uint
.However the baud speeds are not their numerical value but system-defined constants. For example, 9600 on linux is defined as
B9600 = 15
.Knowing what these constants are defined as on the target system is required to use these functions, but
nix
provides none and renders these functions unusable without knowledge from outside the crate.nix
should either provide aptly namedspeed_t
constants that can be used with the baud related functions or an enum type that maps to valid values ofsize_t
.The text was updated successfully, but these errors were encountered: