watcmdresult.h

来自「手机发送短信的Activex控件」· C头文件 代码 · 共 69 行

H
69
字号
// WAtCmdResult.h: interface for the CWAtCmdResult class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_WATCMDRESULT_H__48D3519D_ADEB_48B7_9D36_74A152494989__INCLUDED_)
#define AFX_WATCMDRESULT_H__48D3519D_ADEB_48B7_9D36_74A152494989__INCLUDED_

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

const int MAX_AT_CMD_RESULT_LEN = 10;

#include "WCmdParseResult.h"

class CWAtCmdResult  
{
public:
	
	CWAtCmdResult();
	 ~CWAtCmdResult();

	void Reset();
	void GetResult(LPSTR lpszCmd);

	enum CheckResult
	{
		AT_CMD_END,
		AT_CMD_ERROR,
		AT_CMD_MATCH
	};

	enum CheckResult AddCmdChar(BYTE toAdd);


private:

	BOOL IsEnd();

	static char szOKCmd[MAX_AT_CMD_RESULT_LEN];
	static char szWaitSMSMsg[MAX_AT_CMD_RESULT_LEN];

	const char* FindMatchCmd(BYTE toAdd);

	BYTE m_atCmdResult[MAX_AT_CMD_RESULT_LEN];
	int  m_received;

	const char* pCurrMatch;

};

class CWAtCmdParser
{
public:
	
	CWAtCmdParser();
	enum ParseResult ParseOneByte(BYTE toSet);
	const CWAtCmdResult& GetParseResult() const;
	void Reset();
	
private:


	enum CWAtCmdResult::CheckResult m_matchResult;		// last result
	CWAtCmdResult m_atCmd;
};

#endif // !defined(AFX_WATCMDRESULT_H__48D3519D_ADEB_48B7_9D36_74A152494989__INCLUDED_)

⌨️ 快捷键说明

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