serial.h

来自「GPS Source code with C++. It is usefull 」· C头文件 代码 · 共 37 行

H
37
字号
// --------------------------------------------------------------------------------------
// (c) 2003 www.winapi.net
//
// Serial.h
//
// Headerdatei f黵 eine einfache, aber leistungsf鋒ige 
// Kommunikation 黚er die Serielle Schnittstelle
// --------------------------------------------------------------------------------------

#ifndef __SERIAL_H__
#define __SERIAL_H__

class CSerial
{

public:
	CSerial();
	~CSerial();

	BOOL Open (int nComPortNr, int nBaud, int nBits, int nParity, int nStopp);
	BOOL Close (void);
	BOOL ModeSet (int nBaud, int nBits, int nParity, int nStopp);
	BOOL SetTimeout (int iTotalReadTimeout);
	BOOL IsOpen (void);

	int ReadData (char *buffer, int iMaxCount);
	int SendData (const char *buffer, int iBytesToWrite);
	BOOL WriteCommByte (unsigned char ucByte);

private:
	HANDLE hComm;
	DCB dcb_alt;
	COMMTIMEOUTS timeouts_alt;
};

#endif

⌨️ 快捷键说明

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