1。缓存配置有大小的限制吗?
2。我的程序中,上下行都配置了大于1024的缓存,SetupComm(hHandle,1024*3,1024*3),但是当写入数据大于1024时,
查询cbInQue还是1024,为什么呢?
3。怎么查询当前串口的缓存大小?

解决方案 »

  1.   

    我用的时WINAPI,CreateFile,ReadFile,WriteFile,谢谢!
      

  2.   

    cbInQue:
    Number of bytes received by the serial provider but not yet read by a ReadFile operation. 试试GetCommProperties 
      

  3.   

    typedef struct _COMMPROP {  WORD wPacketLength;  WORD wPacketVersion;  DWORD dwServiceMask;  DWORD dwReserved1;  DWORD dwMaxTxQueue;  DWORD dwMaxRxQueue;  DWORD dwMaxBaud;  DWORD dwProvSubType;  DWORD dwProvCapabilities;  DWORD dwSettableParams;  DWORD dwSettableBaud;  WORD wSettableData;  WORD wSettableStopParity;  DWORD dwCurrentTxQueue;  DWORD dwCurrentRxQueue;  DWORD dwProvSpec1;  DWORD dwProvSpec2;  WCHAR wcProvChar[1];
    } COMMPROP;dwMaxTxQueue:
      Maximum size of the driver's internal output buffer, in bytes. A value of zero indicates that no maximum value is imposed by the serial provider. 
    dwMaxRxQueue: 
      Maximum size of the driver's internal input buffer, in bytes. A value of zero indicates that no maximum value is imposed by the serial provider. 
      

  4.   

    是啊,我就是使用下行发送了比如2048个字节给上行,但是上行cbInQue只有1024个,不知道是扫描回事
      

  5.   

    GetCommProperties 调用这个函数成功了,但是dwMaxTxQueue和dwMaxRxQueue都是0,怎么回事?