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

📄 serialctl.hpp

📁 利用Serial ComPort與GPS機器作資料傳輸並可以儲存為google map應用檔
💻 HPP
字号:
/********************************************************************
	file base:	SerialCtl
	file ext:	hpp
	
	purpose:	Use to control the signal of serial communication.
*********************************************************************/

#ifndef SERIAL_CTL_HPP
#define SERIAL_CTL_HPP

// class SerialCtl
//-----------------------------------------------------------------------------
// Description: This class handle the functionality that interface with the serial communication.
// 
class SerialCtl
{
public:
  SerialCtl();  // Constructor
  ~SerialCtl(); // Destructor

public:
	void setStatusPort(BOOL on_off);     // set Status port whether on or off. 
	BOOL closePort();                    // close port operator.
	BOOL openPort(DCB dcb,				// open serial communicaiton port.
		const char* portName = "COM1");		// Default port is COM1.
	BOOL read_scc(char* inputData,       // read data from serial communication.
		const unsigned int& sizeBuffer,    // sizeBuffer is the size of pakcet that
		unsigned long& length);            // receive from serail port.
	BOOL write_scc(LPCVOID data,     // write data to serial communication
		const unsigned int& sizeBuffer,    // sizeBufer is the size of packet that
		unsigned long& length);            // want to send to serial port.
  HANDLE getHandlePort();              // The entry point to get port's handle. 
  BOOL getStatusPort();                // The entry point to get port's staus. 

private:
	BOOL statusPort_;                    // port's status.
	HANDLE handlePort_;                  // the object that is a instace of port. 
	DCB config_;                         // configuation of serial communication.  
};

#endif //SERIAL_CTL_HPP

⌨️ 快捷键说明

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