40 lines
579 B
C
40 lines
579 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;
|
||
|
}
|
||
|
~CodecYm() {}
|
||
|
// 重载接收字节函数
|
||
|
bool recvByte(int byte);
|
||
|
// 重载解码函数
|
||
|
myarray decode(int &srcAddr, int &dstAddr, int &cmd, myarray data);
|
||
|
bool 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;
|
||
|
};
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
#endif // CODEC_YM_H
|