#ifndef HONALOWLEVELAPI_H #define HONALOWLEVELAPI_H #include #include "include/LowLevel/Setting/Setting.h" #include "include/LowLevel/HonaPacket.h" #include "LowLevel/Setting/Setting.h" #include "HonaPacket.h" #include "QWaitCondition" #include "QMutex" #include "include/LowLevel/HonaPacket.h" #include "include/Wrapper/PlxWrapper.h" class HonaLowLevelAPI : public QObject { Q_OBJECT private: bool _hsruIsStarted; bool _hiruIsStarted; HonaSettings _honaSetting; QWaitCondition _hsruReadDone, _hsruUpdateAck, _hsruStopEvent; QMutex _mutex; int _threadSforValue = 0; bool _isReaderThreadFree = false; bool _isUpdateThreadFree = false; QVector honaRegisterBuffer; QList honaPacketList; PlxWrapper plxwrapper; quint32 hsruLoss = 0; static quint32 packetLenInt123C; static quint32 packetLenRes123C; static quint32 packetLenIntS; static quint32 packetLenResS; public: explicit HonaLowLevelAPI(QObject* parent = nullptr); bool isHsruStarted(); bool isHiruStarted(); void deviceReset(); void setConfig(HonaSettings* honaSetting); HonaSettings getConfig(); QString getSwVersion(); QString getDeviceId(); void hsruStart(); void hiruStart(); void init(); bool getHsruIsStarted() const; void setHsruIsStarted(bool hsruIsStarted); bool getHiruIsStarted() const; void setHiruIsStarted(bool hiruIsStarted); private: void writeSettingToRegisters(HonaSettings& settings); void setConfig(); void hsruMainThread(); void hsruReadThread(); void hsruUpdateThread(); int hiruGetDOA(); void hsruReaderMethod(); QVector hsruReadHonaBuffer(honaReceivers receiver); quint32 hsruParserInt123C(quint32 honaData,QList honaPacketList); signals: void signalToTop(QList honaPacketList, int i, int j); //uncrustify off public slots: //uncrustify on }; #endif //HONALOWLEVELAPI_H