memory_blocs_parsers/external_data/gnss.h
Go to the documentation of this file.
1 #pragma once
2 
5 
6 namespace ixblue_stdbin_decoder
7 {
8 namespace Parser
9 {
10 class Gnss : public MemoryBlockParser
11 {
12 public:
13  Gnss(int bit_pose) : MemoryBlockParser(bit_pose, 46) {}
14  void parse(boost::asio::const_buffer& buffer,
15  Data::BinaryNav& outBinaryNav) override
16  {
17  Data::Gnss res;
18  buffer >> res.validityTime_100us >> res.gnss_id >> res.gnss_quality >>
19  res.latitude_deg >> res.longitude_deg >> res.altitude_m >>
22  fillRes(res, outBinaryNav);
23  }
24  virtual void fillRes(const Data::Gnss& res, Data::BinaryNav& outBinaryNav) = 0;
25 };
26 
27 class Gnss1 : public Gnss
28 {
29 public:
30  Gnss1() : Gnss(1) {}
31 
32 protected:
33  void fillRes(const Data::Gnss& res, Data::BinaryNav& outBinaryNav)
34  {
35  outBinaryNav.gnss1 = res;
36  }
37 };
38 
39 class Gnss2 : public Gnss
40 {
41 public:
42  Gnss2() : Gnss(2) {}
43 
44 protected:
45  void fillRes(const Data::Gnss& res, Data::BinaryNav& outBinaryNav)
46  {
47  outBinaryNav.gnss2 = res;
48  }
49 };
50 
51 class GnssManual : public Gnss
52 {
53 public:
54  GnssManual() : Gnss(3) {}
55 
56 protected:
57  void fillRes(const Data::Gnss& res, Data::BinaryNav& outBinaryNav)
58  {
59  outBinaryNav.gnssManual = res;
60  }
61 };
62 
63 } // namespace Parser
64 } // namespace ixblue_stdbin_decoder
void fillRes(const Data::Gnss &res, Data::BinaryNav &outBinaryNav)
void fillRes(const Data::Gnss &res, Data::BinaryNav &outBinaryNav)
void fillRes(const Data::Gnss &res, Data::BinaryNav &outBinaryNav)
boost::optional< Gnss > gnss1
Definition: stdbin.h:114
boost::optional< Gnss > gnss2
Definition: stdbin.h:115
virtual void fillRes(const Data::Gnss &res, Data::BinaryNav &outBinaryNav)=0
void parse(boost::asio::const_buffer &buffer, Data::BinaryNav &outBinaryNav) override
boost::optional< Gnss > gnssManual
Definition: stdbin.h:116


ixblue_stdbin_decoder
Author(s): Adrien BARRAL , Laure LEBROTON
autogenerated on Sat Jan 9 2021 03:13:21