modbus.h 559 B

12345678910111213141516171819202122232425262728
  1. #pragma once
  2. #include "../common/comm.h"
  3. #include "../common/notifier.h"
  4. #include "../common/iobuffer.h"
  5. #include "../common/sensor_socket.h"
  6. class CMessageQueue;
  7. class CModbusTcpSensor
  8. {
  9. public:
  10. CModbusTcpSensor(CMessageQueue *q);
  11. void Notify(uint16_t * buffer);
  12. void SetModbusTcpSensor(SensorModbusTcp<CModbusTcpSensor>* modbus);
  13. void Start();
  14. void Stop();
  15. private:
  16. void Run();
  17. private:
  18. CMessageQueue* _message;
  19. SensorModbusTcp<CModbusTcpSensor> * _modbus;
  20. bool _run;
  21. std::thread _thread;
  22. };