rtuport.h 560 B

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef RTUPORT_H
  2. #define RTUPORT_H
  3. #include <QObject>
  4. #include "QDebug"
  5. #include "QtSerialPort/QSerialPort"
  6. #include "QtSerialPort/QSerialPortInfo"
  7. #include "QTimer"
  8. #include "logserialport.h"
  9. #include "globalinfo.h"
  10. class RtuPort : public QObject
  11. {
  12. Q_OBJECT
  13. public:
  14. RtuPort();
  15. void portStart();
  16. private slots:
  17. void receiveInfo();
  18. void portWrite();
  19. private:
  20. QSerialPort *m_serialPort;
  21. QStringList m_serialPortName;
  22. QTimer *timer;
  23. QTimer *portTimer;
  24. LogSerialPort log;
  25. QByteArray ret;
  26. };
  27. #endif // RTUPORT_H