#pragma once #include #include #include "SCF.hpp" #include "SyncEvent.hpp" //----------------------------------------------------------------------------- // DiosConnect //----------------------------------------------------------------------------- namespace nsSCF = DIOS::Dev::Communication; namespace DIOS::Dev::Communication { #define CMD_LEN_MAX 1024 // Linux兼容类型定义 using DWORD = unsigned long; using tbDataFun = std::function ; class DiosConnect { public: DiosConnect(int millisecond = 200); ~DiosConnect(); void Prepare(std::string DllName); bool Connect(std::string strProfile, tPacketPredate Pr, _SCF_Transfertype TransferType, DWORD msTimeOut); bool Run(tbDataFun Dequeue); bool DecodePack(bool action); void Disconnect(); bool isConnected(); bool TryReconnect(); bool isActDecodeFun{ true }; nsSCF::SCF m_SCF; //�����շ��������� protected: SyncEvent::Auto m_NewPacket; //��������ͬ���¼� //HANDLE m_DataThread; //���������߳� tbDataFun m_tbFunction; //�������ݻص����� int m_iWaitSCFTimeOut; //��������ʱ���� std::string m_tConnectParam; //���Ӳ��� tPacketPredate m_tCallbackFun; std::thread::id m_TID; //ThreadID }; }