8 Ekim 2016 Cumartesi

cfmakeraw

Giriş
Bazı platformlar hem input hem de outputdu raw yapmak için cfmakeraw() metodunu tanımlamışlar ancak bu metod portable değil.
cfmakeraw() and cfsetspeed() are nonstandard, but available on the BSDs.
İmzası şöyle
void cfmakeraw(struct termios *termios_p); 
Bu metod yoksa şöyle yaparız.
// Get current port config.
tcgetattr(sfd, &tty);

//Set raw mode, equivalent to:
tty->c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP
            | INLCR | IGNCR | ICRNL | IXON);
tty->c_oflag &= ~OPOST;
tty->c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN);
tty->c_cflag &= ~(CSIZE | PARENB);
tty->c_cflag |= CS8;

tcsetattr (sfd, TCSANOW, &tty);

Hiç yorum yok:

Yorum Gönder