cfsetospeed和cfsetispeed函数
来源:互联网 发布:完美红颜进阶数据 编辑:程序博客网 时间:2024/06/07 03:41
对于波特率的设置通常使用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波特
- cfsetospeed和cfsetispeed函数
- 串口------cfsetospeed和cfsetispeed函数
- Linux下cfsetospeed和cfsetispeed函数
- Linux下cfsetospeed和cfsetispeed函数
- linux下cfsetospeed和cfsetispeed函数
- Linux下cfsetospeed和cfsetispeed函数
- Linux下cfsetospeed和cfsetispeed函数——对linux下串口编程的补充
- 函数和函数对象
- 函数指针和函数
- 函数原型和函数
- fread函数和fwrite函数
- 指针函数和函数指针
- 函数指针和函数对象
- 函数指针和函数编译
- fread函数和fwrite函数
- fread函数和fwrite函数
- 函数指针和指针函数
- fread函数和fwrite函数
- win7新建文本文档快捷键
- 测试match()方法、改变样式、换行符
- 题目1009:二叉搜索树
- 尾递归和递归
- 携程2018届实习生招聘在线笔试编程题解 (Java语言)
- cfsetospeed和cfsetispeed函数
- DUBBO的com.alibaba.dubbo.rpc.RpcException远程调用异常解决方法
- Android获取设备唯一ID的几种方式
- smarty的使用和修改包标签方法
- 题目1010:A + B
- Idea license server
- MySQL 数据库
- Ubuntu14 系统下安装Opencv3.0攻略
- C/C++多文件共享全局变量时,使用extern的规范