#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 prot_m4_cb; typedef struct { QList funs; myarray cmd; } HandleM4_def; class prot_m4 : public QObject { public: prot_m4() { if_ = nullptr;wait=0; } ~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 funs; Codec *codec_; QThread thread; myarray recv_data; int wait; QList send_list; }; prot_m4 *protM4(); #endif // PROT_M4_H