34 lines
598 B
C++
34 lines
598 B
C++
#ifndef CODEC_YM_H
|
|
#define CODEC_YM_H
|
|
|
|
#include "interface/codec.h"
|
|
|
|
class CodecYm : public Codec
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
CodecYm() : Codec()
|
|
{
|
|
is_big_data = false;
|
|
num_to_read = 0;
|
|
offset=0;
|
|
}
|
|
~CodecYm() {}
|
|
// 重载接收字节函数
|
|
bool recvByte(int byte);
|
|
// 重载解码函数
|
|
myarray decode(int &srcAddr, int &dstAddr, int &cmd, myarray data);
|
|
int packCheck(myarray data);
|
|
myarray encode(int srcAddr, int dstAddr, int cmd, myarray data);
|
|
|
|
private:
|
|
bool is_big_data;
|
|
int num_to_read;
|
|
int cmd_no;
|
|
int cmd;
|
|
int len;
|
|
int offset;
|
|
};
|
|
|
|
#endif // CODEC_YM_H
|