File tree 2 files changed +17
-0
lines changed 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -835,8 +835,10 @@ extern {
835
835
pub fn tcdrain ( fd : :: c_int ) -> :: c_int ;
836
836
pub fn cfgetispeed ( termios : * const :: termios ) -> :: speed_t ;
837
837
pub fn cfgetospeed ( termios : * const :: termios ) -> :: speed_t ;
838
+ pub fn cfmakeraw ( termios : * mut :: termios ) ;
838
839
pub fn cfsetispeed ( termios : * mut :: termios , speed : :: speed_t ) -> :: c_int ;
839
840
pub fn cfsetospeed ( termios : * mut :: termios , speed : :: speed_t ) -> :: c_int ;
841
+ pub fn cfsetspeed ( termios : * mut :: termios , speed : :: speed_t ) -> :: c_int ;
840
842
pub fn tcgetattr ( fd : :: c_int , termios : * mut :: termios ) -> :: c_int ;
841
843
pub fn tcsetattr ( fd : :: c_int ,
842
844
optional_actions : :: c_int ,
Original file line number Diff line number Diff line change @@ -752,6 +752,16 @@ f! {
752
752
pub fn cfgetospeed( termios: * const :: termios) -> :: speed_t {
753
753
( * termios) . c_cflag & :: CBAUD
754
754
}
755
+ pub fn cfmakeraw( termios: * const :: termios) -> ( ) {
756
+ ( * termios) . c_iflag &= !( :: IGNBRK | :: BRKINT | :: PARMRK | :: ISTRIP |
757
+ :: INLCR | :: IGNCR | :: ICRNL | :: IXON ) ;
758
+ ( * termios) . c_oflag &= !:: OPOST ;
759
+ ( * termios) . c_lflag &= !( :: ECHO | :: ECHONL | :: ICANON | :: ISIG |
760
+ :: IEXTEN ) ;
761
+ ( * termios) . c_cflag &= !( :: CSIZE | :: PARENB ) ;
762
+ ( * termios) . c_cflag |= :: CS8 ;
763
+ ( )
764
+ }
755
765
pub fn cfsetispeed( termios: * mut :: termios, speed: :: speed_t) -> :: c_int {
756
766
let cbaud = :: CBAUD ;
757
767
( * termios) . c_cflag = ( ( * termios) . c_cflag & !cbaud) | ( speed & cbaud) ;
@@ -762,6 +772,11 @@ f! {
762
772
( * termios) . c_cflag = ( ( * termios) . c_cflag & !cbaud) | ( speed & cbaud) ;
763
773
return 0
764
774
}
775
+ pub fn cfsetspeed( termios: * mut :: termios, speed: :: speed_t) -> :: c_int {
776
+ let cbaud = :: CBAUD ;
777
+ ( * termios) . c_cflag = ( ( * termios) . c_cflag & !cbaud) | ( speed & cbaud) ;
778
+ return 0
779
+ }
765
780
pub fn tcgetattr( fd: :: c_int, termios: * mut :: termios) -> :: c_int {
766
781
ioctl( fd, :: TCGETS , termios)
767
782
}
You can’t perform that action at this time.
0 commit comments