File tree 2 files changed +16
-0
lines changed
2 files changed +16
-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,15 @@ 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 | :: INLCR | :: IGNCR |
757
+ :: ICRNL | :: IXON ) ;
758
+ ( * termios) . c_oflag &= !:: OPOST ;
759
+ ( * termios) . c_lflag &= !( :: ECHO | :: ECHONL | :: ICANON | :: ISIG | :: IEXTEN ) ;
760
+ ( * termios) . c_cflag &= !( :: CSIZE | :: PARENB ) ;
761
+ ( * termios) . c_cflag |= :: CS8 ;
762
+ ( )
763
+ }
755
764
pub fn cfsetispeed( termios: * mut :: termios, speed: :: speed_t) -> :: c_int {
756
765
let cbaud = :: CBAUD ;
757
766
( * termios) . c_cflag = ( ( * termios) . c_cflag & !cbaud) | ( speed & cbaud) ;
@@ -762,6 +771,11 @@ f! {
762
771
( * termios) . c_cflag = ( ( * termios) . c_cflag & !cbaud) | ( speed & cbaud) ;
763
772
return 0
764
773
}
774
+ pub fn cfsetspeed( termios: * mut :: termios, speed: :: speed_t) -> :: c_int {
775
+ let cbaud = :: CBAUD ;
776
+ ( * termios) . c_cflag = ( ( * termios) . c_cflag & !cbaud) | ( speed & cbaud) ;
777
+ return 0
778
+ }
765
779
pub fn tcgetattr( fd: :: c_int, termios: * mut :: termios) -> :: c_int {
766
780
ioctl( fd, :: TCGETS , termios)
767
781
}
You can’t perform that action at this time.
0 commit comments