Files
checker_host/prot/prot_m4.h

50 lines
893 B
C
Raw Normal View History

2023-11-26 23:05:35 +08:00
#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;
2023-11-27 14:31:00 +08:00
typedef struct
{
2023-11-29 15:36:45 +08:00
QList<prot_m4_cb> funs;
2023-11-27 14:31:00 +08:00
myarray cmd;
} HandleM4_def;
2023-11-26 23:05:35 +08:00
2023-11-27 14:31:00 +08:00
class prot_m4 : public QObject
2023-11-26 23:05:35 +08:00
{
public:
2023-11-29 15:36:45 +08:00
prot_m4() { if_ = nullptr;wait=0; }
2023-11-27 14:31:00 +08:00
~prot_m4() {}
void init();
bool set_irq_fun(prot_m4_cb fun, myarray data);
bool del_irq_fun(prot_m4_cb fun, myarray data);
2023-11-26 23:05:35 +08:00
public slots:
2023-11-27 14:31:00 +08:00
void send_data_slot(myarray data);
2023-11-26 23:05:35 +08:00
protected:
2023-11-27 14:31:00 +08:00
bool exe_cb_fun(myarray data);
2023-11-26 23:05:35 +08:00
protected:
2023-11-27 14:31:00 +08:00
InterFace *if_;
QList<HandleM4_def> funs;
Codec *codec_;
QThread thread;
myarray recv_data;
2023-11-29 15:36:45 +08:00
int wait;
QList<myarray> send_list;
2023-11-26 23:05:35 +08:00
};
prot_m4 *protM4();
#endif // PROT_M4_H