谁知道cfmakeraw函数有什么作用?就是设置串口属性对吧?我想问的是设置后是什么效果?
答案:1 悬赏:20
解决时间 2021-04-08 06:26
- 提问者网友:恋你成殇
- 2021-04-07 20:16
谁知道cfmakeraw函数有什么作用?就是设置串口属性对吧?我想问的是设置后是什么效果?
最佳答案
- 二级知识专家网友:茫然不知崩溃
- 2021-04-07 21:03
Name: cfmakeraw
Prototype: void cfmakeraw (struct termios *termios-p)
Description:
This function provides an easy way to set up *termios-p for what has traditionally been called ``raw
mode'' in BSD. This uses noncanonical input, and turns off most processing to give an unmodified
channel to the terminal.
It does exactly this:
termios-p->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP
|INLCR|IGNCR|ICRNL|IXON);
termios-p->c_oflag &= ~OPOST;
termios-p->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);
termios-p->c_cflag &= ~(CSIZE|PARENB);
termios-p->c_cflag |= CS8;
Header files:
termios.h
Prototype: void cfmakeraw (struct termios *termios-p)
Description:
This function provides an easy way to set up *termios-p for what has traditionally been called ``raw
mode'' in BSD. This uses noncanonical input, and turns off most processing to give an unmodified
channel to the terminal.
It does exactly this:
termios-p->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP
|INLCR|IGNCR|ICRNL|IXON);
termios-p->c_oflag &= ~OPOST;
termios-p->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);
termios-p->c_cflag &= ~(CSIZE|PARENB);
termios-p->c_cflag |= CS8;
Header files:
termios.h
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯