ivdriver_gps.h 926 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #ifndef IVDRIVER_GPS_H
  2. #define IVDRIVER_GPS_H
  3. #include <QSerialPort>
  4. #include <QUdpSocket>
  5. #include <QNetworkDatagram>
  6. #include "ivdriver.h"
  7. #include "gpsimu.pb.h"
  8. #include "xmlparam.h"
  9. namespace iv {
  10. class ivdriver_gps : public ivdriver
  11. {
  12. public:
  13. ivdriver_gps();
  14. public:
  15. void loadxmlparam(std::string strxmlpath);
  16. virtual void modulerun();
  17. //if decode 1 sen. return 1,else return 0
  18. virtual int decode(iv::gps::gpsimu & xgpsimu) = 0;
  19. public:
  20. bool checknmeasen(const char * strsen,const unsigned int nlen);
  21. public:
  22. QString mstrBuffer;
  23. private:
  24. void ShareMsg(iv::gps::gpsimu & xgpsimu);
  25. void broadcastmsg(iv::gps::gpsimu & xgpsimu);
  26. private:
  27. int mnbaudrate = 230400;
  28. std::string mstrportname = "/dev/ttyUSB0";
  29. std::string mstrmsgname = "gps";
  30. void * mpagpsimu;
  31. QSerialPort *m_serialPort_GPS;
  32. QUdpSocket *mudpSocketGPSIMU;
  33. };
  34. }
  35. #endif // IVDRIVER_GPS_H