Linux下cfsetospeed和cfsetispeed函数
来源:互联网 发布:如何统计不重复的数据 编辑:程序博客网 时间:2024/06/07 05:43
对于波特率的设置通常使用cfsetospeed和cfsetispeed函数来完成。获取波特率信息是通过cfgetispeed和 cfgetospeed函数来完成的。
cfsetospeed函数
头文件:
#include
函数原型:
int cfsetospeed(struct termios *termptr, speed_t speed);
参数:
struct termios *termptr - 指向termios结构的指针
speed_t speed - 需要设置的输出波特率
返回值:
如果成功返回0,否则返回-1
cfsetispeed函数
头文件:
#include
函数原型:
int cfsetispeed(struct termios *termptr, speed_t speed);
参数:
struct termios *termptr - 指向termios结构的指针
speed_t speed - 需要设置的输入波特率
返回值:
如果成功返回0,否则返回-1
cfgetospeed函数
头文件:
#include
函数原型:
speed_t cfgetospeed(const struct termios *termptr);
参数:
const struct termios - 指向termios结构的指针
返回值:
返回输出波特率
cfgetispeed函数
头文件:
#include
函数原型:
speed_t cfgetispeed(const struct termios *termptr);
参数:
const struct termios *termptr - 指向termios结构的指针
返回值:
返回输入波特率
波特率常量:
CBAUD 掩码
B0 0波特
B50 50波特
B75 75波特
B110 100波特
B134 134波特
B150 150波特
B200 200波特
B300 300波特
B600 600波特
B1200 1200波特
B1800 1800波特
B2400 2400波特
B9600 9600波特
B19200 19200波特
B38400 38400波特
B57600 57600波特
B115200 115200波特
- Linux下cfsetospeed和cfsetispeed函数
- Linux下cfsetospeed和cfsetispeed函数
- linux下cfsetospeed和cfsetispeed函数
- Linux下cfsetospeed和cfsetispeed函数
- cfsetospeed和cfsetispeed函数
- 串口------cfsetospeed和cfsetispeed函数
- Linux下cfsetospeed和cfsetispeed函数——对linux下串口编程的补充
- linux下open函数和creat函数
- linux下光标定位和清屏函数
- linux下光标定位和清屏函数
- Linux下Exit和_exit函数说明
- linux下光标定位和清屏函数
- Linux下Exit和_exit函数说明
- linux和window下mkdir函数问题
- Linux 下stat和access函数
- linux和window下mkdir函数问题
- Linux下Exit和_exit函数说明
- linux下select和epoll函数总结
- hashcode&equals续
- O_NONBLOCK与O_NDELAY有何不同
- 获取快捷方式的属性
- SDRAM管脚和功耗分析
- You should blog even if you have no readers
- Linux下cfsetospeed和cfsetispeed函数
- c++ clang_complete
- GIT和SVN之间的五个基本区别
- MapX中使用动态图层AnimationLayer,移动图元时标注和图元分离问题解决办法。
- linux 串口概述
- IOS学习之IOS沙盒(sandbox)机制和文件操作
- 一些OpenGL的笔记
- 搞不清楚csdn iteyes cnblogs 这几个技术博客之间的关系了
- RMAN 自动备份脚本设计