serial.h 550 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 CSerialSensor
  8. {
  9. public:
  10. CSerialSensor(CMessageQueue *q);
  11. void Notify(uint8_t * buffer,int32_t size);
  12. void SetSerialSensor(SensorSerial<CSerialSensor>* serial);
  13. void Start();
  14. void Stop();
  15. private:
  16. void Run();
  17. private:
  18. CMessageQueue* _message;
  19. SensorSerial<CSerialSensor> * _serial;
  20. bool _run;
  21. std::thread _thread;
  22. };