⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 comm.h

📁 磁卡读写测试程序
💻 H
字号:
#ifndef _COMM_H__
#define _COMM_H__
#define MAXBUFLEN	250
#define BUFFLEN		4096
#define MAXBLOCKLEN	256

typedef struct _COMM_INFO
{
	HANDLE hComm;		//comm handle
	DCB dcb;
	BOOL bConnection;	//mark the comm is open or not

	COMMTIMEOUTS cto;	//set timeouts

	HANDLE hCommWatch;	//thread handle
	DWORD dwTID;		//thread identifier

	HANDLE hEvent;
	OVERLAPPED osWait;
	OVERLAPPED osRead;
	OVERLAPPED osWrite;
}COMMINFO , *LPCOMMINFO;

BOOL WriteBlock(LPCOMMINFO,LPVOID lpData, DWORD dwlen);
DWORD ReadBlock(LPCOMMINFO,LPVOID lpData, DWORD dwMaxLen);
DWORD Read(LPCOMMINFO,BYTE* pBuffer);
BOOL InitComm( LPCOMMINFO m_info,const char* strCom);
BOOL  DestroyComm(LPCOMMINFO m_info);
LPCOMMINFO BuildComm(LPCOMMINFO info,
    long DCBlength,				     // sizeof(DCB) .
    long BaudRate,					// current baud rate .
    BOOL fBinary,							// binary mode, no EOF check 
    BOOL fParity,							// enable parity checking 
    int fOutxCtsFlow,						// CTS output flow control 
    int fOutxDsrFlow,						// DSR output flow control 
    int fDtrControl,		// DTR flow control type 
    int fOutX,								// XON/XOFF out flow control 
    int fInX,								// XON/XOFF in flow control 
    int fRtsControl,		// RTS flow control 
    int fAbortOnError,						// abort reads/writes on error 
    int XonLim,							// transmit XON threshold 
    int XoffLim,							// transmit XOFF threshold 
    int ByteSize,							// number of bits/byte, 4-8 .
    int Parity=NOPARITY,						// 0-4=no,odd,even,mark,space .
    int StopBits=ONESTOPBIT					// 0,1,2 = 1, 1.5, 2 
		 );
#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -