command.h

来自「利用串口读写数据实现的识币器驱动程序」· C头文件 代码 · 共 28 行

H
28
字号
#ifndef _COMMAND_H_
#define _COMMAND_H_
#include <windows.h>

#ifdef CASHCODE_EXPORTS
 #define _CASHCODEDLL_API _declspec(dllexport)
#else
 #define _CASHCODEDLL_API _declspec(dllimport)
#endif

class _CASHCODEDLL_API CCommand
{
public:
	char* ToString(char*);			// Formats internal frame data into a string, containing its hexadecimal representation
	void SetByte(BYTE,int);			// Sets specified byte in the buffer to the supplied value
	void SetCode(int);				// Sets transmission error code to the specified value
	CCommand(LPBYTE,int,int iLen=0);// Constructor performing initialization of all object's variables
	int GetCode();					// Retrieves communication error code
	LPBYTE GetData();				// Retrieves pointer to the frame data
	CCommand();						// Default constructor
	virtual ~CCommand();			// Default destructor

private:
	int iCode;						// Frame transmission error code. Valid only after the frame was transmitted or received
	BYTE Data[4096];				// A buffer containing frame data
};

#endif

⌨️ 快捷键说明

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