zoukankan      html  css  js  c++  java
  • linux下清空串口数据 tcflush函数

    #include <termios.h>  //头文件
    
    /*
    tcflush
    入参:
            fd:终端I/O打开的句柄
            queue_selector    // 控制tcflush的操作,取值为下面三个常数中的一个:
                    TCIFLUSH  // 清除正收到的数据,且不会读取出来。
                    TCOFLUSH  // 清除正写入的数据,且不会发送至终端。
                    TCIOFLUSH // 清除所有正在发生的I/O数据。
    返回值:0 成功;-1 失败,并且为 errno 置值来指示错误
    */
    int tcflush(int fd, int queue_selector);             
  • 相关阅读:
    05
    04
    03
    02
    01
    drf 频率类
    drf 视图家族
    drf 之 群改,单改接口
    drf 序列化
    drf 之模块
  • 原文地址:https://www.cnblogs.com/kwinwei/p/13090090.html
Copyright © 2011-2022 走看看