Skip to content

Windows下读写串口(异步),可同时读写,但读写各自阻塞线程

Notifications You must be signed in to change notification settings

zdphpn/Windows-COM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Windows-COM

Windows下读写串口(异步),可同时读写,但读写各自阻塞线程

串口参数

struct COMOPT
{
    DWORD BaudRate;              //Baudrate at which running
    DWORD ByteSize;                //Number of bits/byte, 4-8
    DWORD Parity;                    //0-4=None,Odd,Even,Mark,Space
    DWORD StopBits;                //0,1,2 = 1, 1.5, 2

    DWORD IntervalTimeout;    //Maximum time between chars
};

函数列表

  • BOOL APIENTRY checkCom(unsigned int cNum);
  • HANDLE APIENTRY openCom(unsigned int cNum);
  • BOOL APIENTRY configCom(HANDLE hCom,COMOPT* opt);
  • UINT APIENTRY recvData(HANDLE hCom,unsigned char* buf,unsigned int bufLen);
  • UINT APIENTRY sendData(HANDLE hCom,unsigned char* dat,unsigned int datLen);
  • BOOL APIENTRY closeCom(HANDLE hCom);
  • BOOL APIENTRY clearCache(HANDLE hCom);

About

Windows下读写串口(异步),可同时读写,但读写各自阻塞线程

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published