irdaport.h

来自「这是专门针对PDA设备做的一个电视遥控器程序」· C头文件 代码 · 共 73 行

H
73
字号
//////////////////////////////////////////////////////////////////////
//
// IRDA Port class, a class for IRDA support.
//
// Copyright (c) 2003, Strigl Daniel.
//
// License:
// --------
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
// 
// You should have received a copy of the GNU Lesser General Public
// License along with this source code; if not, write to the Free 
// Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
// MA 02111-1307 USA.
//
// Author: Strigl Daniel, daniel.strigl@web.de,
//         http://www.hh-system.com/danielstrigl
//
//////////////////////////////////////////////////////////////////////
//
// IrdaPort.h:  interface of the CIrdaPort class
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_IRDAPORT_H__5FA2C204_2921_11D7_9A54_0002B32C4875__INCLUDED_)
#define AFX_IRDAPORT_H__5FA2C204_2921_11D7_9A54_0002B32C4875__INCLUDED_

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

class CIrdaPort : public CObject  
{
public:
	CIrdaPort();
	virtual ~CIrdaPort();

    #ifdef _DEBUG
	    virtual void AssertValid() const;
	    virtual void Dump(CDumpContext& dc) const;
    #endif

    static UINT FindPortIndex();

    BOOL Open(UINT uiPort);
    void Close();
	//BOOL isprint(char) const;
    BOOL IsOpen() const;

    BOOL WaitForResponse(CString& strResponse, DWORD dwTimeout) const;
    BOOL Send(const CString& strSend) const;
	DWORD Write(const void* pData, DWORD dwCount) const;
protected:

    DWORD Read(void* pData, DWORD dwCount) const;
    

    HANDLE m_hPort;

    DECLARE_DYNAMIC(CIrdaPort);
};

#endif // !defined(AFX_IRDAPORT_H__5FA2C204_2921_11D7_9A54_0002B32C4875__INCLUDED_)

⌨️ 快捷键说明

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