54 lines
861 B
C++
54 lines
861 B
C++
#ifndef PROT_M4_H
|
|
#define PROT_M4_H
|
|
|
|
|
|
#include "QObject"
|
|
#include "base/base.h"
|
|
#include "QList"
|
|
#include "interface/codec.h"
|
|
#include "interface/interface.h"
|
|
#include "base/mycfg.h"
|
|
#include "QThread"
|
|
|
|
|
|
|
|
using namespace std;
|
|
using namespace std::placeholders;
|
|
|
|
typedef std::function<void(myarray data)> prot_m4_cb;
|
|
|
|
|
|
typedef struct{
|
|
prot_m4_cb fun;
|
|
myarray cmd;
|
|
}HandleM4_def;
|
|
|
|
|
|
|
|
class prot_m4:public QObject
|
|
{
|
|
public:
|
|
prot_m4(){if_=nullptr;}
|
|
~prot_m4(){}
|
|
void init();
|
|
bool set_irq_fun(prot_m4_cb fun,myarray data);
|
|
bool del_irq_fun(prot_m4_cb fun,myarray data);
|
|
public slots:
|
|
void send_data_slot(myarray data);
|
|
protected:
|
|
bool exe_cb_fun(myarray data);
|
|
protected:
|
|
InterFace *if_;
|
|
QList<HandleM4_def> funs;
|
|
Codec *codec_;
|
|
QThread thread;
|
|
myarray recv_data;
|
|
};
|
|
|
|
|
|
prot_m4 *protM4();
|
|
|
|
#endif // PROT_M4_H
|
|
|
|
|