串口设备驱动相关事件的掩码定义(IOCTL_SERIAL_GET_WAIT_MASK)

来源:互联网 发布:网络上贷款需要些什么 编辑:程序博客网 时间:2024/05/16 07:11

     最近研究网口转虚拟串口驱动程序。通过查看DDK的例子,发现需要处理 IOCTL_SERIAL_GET_WAIT_MASK 。但是一些相关的掩码定义比较少见到,相关的资料说明也少。这里列举出来,以便自己更好的理解,同时用于编写的虚拟串口驱动程序中。

     相关掩码的定义在 C:\WinDDK\7600.16385.1\inc\api\ntddser.h 文件中。 原本的内容注释已经非常清晰了,我就不画蛇添足了。

//// Defines the bitmask that the driver can used to notify// app of various changes in the state of the UART.//#define SERIAL_EV_RXCHAR           0x0001  // Any Character received#define SERIAL_EV_RXFLAG           0x0002  // Received certain character#define SERIAL_EV_TXEMPTY          0x0004  // Transmitt Queue Empty#define SERIAL_EV_CTS              0x0008  // CTS changed state#define SERIAL_EV_DSR              0x0010  // DSR changed state#define SERIAL_EV_RLSD             0x0020  // RLSD changed state#define SERIAL_EV_BREAK            0x0040  // BREAK received#define SERIAL_EV_ERR              0x0080  // Line status error occurred#define SERIAL_EV_RING             0x0100  // Ring signal detected#define SERIAL_EV_PERR             0x0200  // Printer error occured#define SERIAL_EV_RX80FULL         0x0400  // Receive buffer is 80 percent full#define SERIAL_EV_EVENT1           0x0800  // Provider specific event 1#define SERIAL_EV_EVENT2           0x1000  // Provider specific event 2


0 0
原创粉丝点击