#pragma once
|
#include "CReadStep.h"
|
#include <functional>
|
|
|
#define READ_BUFFER_MAX 1024
|
|
#define ROK 0 /* ¶ÁÊý¾ÝOK */
|
#define RTIMEOUT -1 /* ¶ÁÊý¾Ý³¬Ê± */
|
#define RERROR -2 /* ¶ÁÊý¾Ý³ö´í */
|
#define RCOMPLETE 1 /* ¶ÁÊý¾ÝÁ÷³ÌÍê³É */
|
|
namespace SERVO {
|
typedef std::function<int(int code, const char* pszData, size_t size)> ONREAD;
|
|
class CEqReadStep : public CReadStep
|
{
|
public:
|
CEqReadStep();
|
CEqReadStep(int dev, size_t readSize, ONREAD onReadBlock);
|
~CEqReadStep();
|
|
public:
|
virtual void getAttributeVector(CAttributeVector& attrubutes);
|
virtual int onReadData();
|
virtual int onComplete();
|
virtual int onTimeout();
|
|
private:
|
ONREAD m_onReadBlock;
|
int m_nDataDev;
|
size_t m_nReadSize;
|
};
|
}
|