serialcommunication.h

来自「シリアル通信のプログラム、初学者により、いいです。」· C头文件 代码 · 共 55 行

H
55
字号
// SerialCommunication.h: interface for the CSerialCommunication class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_SERIALCOMMUNICATION_H__DC25C566_6D46_4433_ABC3_AFF6CEC292DD__INCLUDED_)
#define AFX_SERIALCOMMUNICATION_H__DC25C566_6D46_4433_ABC3_AFF6CEC292DD__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "IReceiveEvent.h"

class CSerialCommunication  
{
private:
	HANDLE m_hComm; 
	CWinThread *m_receiveThread; // RS232C
public:
	bool m_isReceiving; // RS232C
	IReceiveEvent *m_receiveEvent; // 
	//CEcoPowerMeterApp  *m_pApp ;
	//CConfig *cfig;

public:
	void Close();
	/** 
	 * @param receiveEvent 
	 */
	CSerialCommunication(IReceiveEvent *receiveEvent);
	
	~CSerialCommunication(void);//

	// 
	bool Open(LPCSTR strPort);

	// 
	//void Close();

	// 
	void Send(LPCSTR str,DWORD strLength);
	//void CSerialCommunication::OnReceive21(LPCSTR str,DWORD strLength);

private:
	// 
	void FireOnReceive(LPCSTR str,DWORD strLength);

private:
	// 
	static UINT ReceiveRs232cFunc(LPVOID pParam);

};

#endif // !defined(AFX_SERIALCOMMUNICATION_H__DC25C566_6D46_4433_ABC3_AFF6CEC292DD__INCLUDED_)

⌨️ 快捷键说明

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