Welcome 微信登录

首页 / 操作系统 / Linux / Linux下cfsetospeed和cfsetispeed函数

对于波特率的设置通常使用cfsetospeed和cfsetispeed函数来完成。获取波特率信息是通过cfgetispeed和cfgetospeed函数来完成的。cfsetospeed函数头文件:#include函数原型:int cfsetospeed(struct termios *termptr, speed_t speed);参数:struct termios *termptr - 指向termios结构的指针speed_t speed - 需要设置的输出波特率返回值:如果成功返回0,否则返回-1cfsetispeed函数头文件:#include函数原型:int cfsetispeed(struct termios *termptr, speed_t speed);参数:struct termios *termptr - 指向termios结构的指针speed_t speed - 需要设置的输入波特率返回值:如果成功返回0,否则返回-1cfgetospeed函数头文件:#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波特RedHat下项目测试总结安装openSUSE后不能引导Ubuntu 10.10的解决相关资讯      Linux函数 
  • Linux C语言中gotoxy函数  (04月11日)
  • Linux进程之Fork函数  (04/16/2015 08:48:35)
  • Linux中getrusage的使用  (11/08/2014 07:07:38)
  • Linux内核中min和max的实现  (03月03日)
  • Linux下mmap函数的一个练习  (01/19/2015 21:11:21)
  • Linux下confstr与uname函数_获取C  (10/28/2014 20:23:36)
本文评论 查看全部评论 (0)
表情: 姓名: 字数