www.pudn.com > bluetoothtest.rar > BlueTooth.h


// BlueTooth.h: interface for the BlueTooth class. 
#if !defined(AFX_BLUETOOTH_H__3DFB2ED2_C217_47FD_AB23_DE2E683CDDA2__INCLUDED_) 
#define AFX_BLUETOOTH_H__3DFB2ED2_C217_47FD_AB23_DE2E683CDDA2__INCLUDED_ 
 
#if _MSC_VER > 1000 
#pragma once 
#endif // _MSC_VER > 1000 
 
class BlueTooth   
{ 
public: 
	BlueTooth(); 
virtual ~BlueTooth(); 
protected: 
	CString port_id;   //端口号 
	CString baud_rate; //波特率 
	CString data_bit;  //数据位 
	CString stop_bit;  //停止位 
	CString check_out; //校验位*//* 
public: 
	CString str_receive;//接收到的字符 
	CString str_send;//传输的字符 
	int PortNo,BaudRate,DataBits,StopBits,Parity; 
	CString PortID,PortIDs[9]; 
	int BaudRates[8];	 
	DCB dcb; 
	DWORD dwThreadID; 
	COMMTIMEOUTS CommTimeOuts; 
protected: 
	HICON m_hIcon; 
//函数 
public: 
	BOOL OpenPort(CString PortID);//打开端口 
	BOOL ClosePort();//关闭端口 
	HANDLE hReadThread;//读线程 
	DWORD WritePort(CString strsend); //写数据 
	 
virtual BOOL OnInitDialog(); 
	 void OnSetup(); 
     void OnRece();//接收数据 
	 void OnSend(CString strsend);//发送数据 
	  
 
 
}; 
 
#endif // !defined(AFX_BLUETOOTH_H__3DFB2ED2_C217_47FD_AB23_DE2E683CDDA2__INCLUDED_)