// ServerControl.h: interface for the CServerControl class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_SERVERCONTROL_H__6D605180_54AE_415E_A5A7_207B1AB43B1B__INCLUDED_)
#define AFX_SERVERCONTROL_H__6D605180_54AE_415E_A5A7_207B1AB43B1B__INCLUDED_

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

class CNetViewXCtrl;

class CServerControl  
{
public:
	CServerControl();
	virtual ~CServerControl();
private:
	HANDLE		  m_ConnectHandle;
	DWORD		  m_ConnectID;
public:
    int           m_iSerialPort;    //0£ºRS485£º1£ºRS232
	LONG		  m_hSerialHandle;
	CNetViewXCtrl *m_server;
	BOOL          m_ConnectRun;	
	BOOL          m_hSerialError;
	unsigned char m_RecvData[SERIAL_MAXRECVSIZE];
	int           m_RecvLength;
	HANDLE        m_RecvMutex;
    unsigned char m_SendData[SERIAL_MAXRECVSIZE];
    int           m_SendLength;
	HANDLE        m_ThreadEvent;
    VSSERIAL_INFO m_SerialInfo;
public:
	void          FAD_HTM1000SetAddr(int addr);
	void          FAD_HTM1000QueryTemData(int addr);
	void          FAD_HTM1000QueryHumData(int addr);
	int 		  FAD_HTM1000GetAlarmData();
	int           StartThread(BOOL start);
    void          SendData();
	void          ClearData();
};

#endif // !defined(AFX_SERVERCONTROL_H__6D605180_54AE_415E_A5A7_207B1AB43B1B__INCLUDED_)
