📄 irdaport.h
字号:
//////////////////////////////////////////////////////////////////////
//
// 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, 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
#if defined(UNDER_CE) // for Pocket PC application
static UINT FindPortIndex();
#endif // #if defined(UNDER_CE)
BOOL Open(UINT uiPort);
void Close();
BOOL IsOpen() const;
BOOL WaitForResponse(CString& strResponse, DWORD dwTimeout = 5000) const;
BOOL Send(const CString& strSend, DWORD dwTimeout = 5000) const;
protected:
DWORD Read(void* pData, DWORD dwCount) const;
DWORD Write(const void* pData, DWORD dwCount) const;
BOOL WriteWithTimeout(const void* pData, DWORD dwCount, DWORD dwTimeout = 5000) const;
BOOL ReadWithTimeout(void* pData, DWORD dwCount, DWORD dwTimeout = 5000) const;
HANDLE m_hPort;
DECLARE_DYNAMIC(CIrdaPort);
};
#endif // !defined(AFX_IRDAPORT_H__5FA2C204_2921_11D7_9A54_0002B32C4875__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -