Kobuki 1.0.0
C++ API for the Kobuki research robot
Loading...
Searching...
No Matches
firmware.hpp
Go to the documentation of this file.
1
9/*****************************************************************************
10** Preprocessor
11*****************************************************************************/
12
13#ifndef KOBUKI_CORE_FW_DATA_HPP__
14#define KOBUKI_CORE_FW_DATA_HPP__
15
16/*****************************************************************************
17** Include
18*****************************************************************************/
19
20#include <sstream>
21#include <vector>
22
23#include "../packet_handler/payload_base.hpp"
24#include "../packet_handler/payload_headers.hpp"
25#include "../version_info.hpp"
26
27/*****************************************************************************
28** Namespace
29*****************************************************************************/
30
31namespace kobuki
32{
33
34/*****************************************************************************
35** Interface
36*****************************************************************************/
37
39{
40public:
41 static const uint32_t COMPATIBLE_MAJOR_VERSION; // protocol communication will fail
42 static const std::vector<uint32_t> RECOMMENDED_VERSIONS; // advisory minor.patch recommendations
43
45
46 // methods
47 bool serialise(ecl::PushAndPop<unsigned char> & byteStream);
48 bool deserialise(ecl::PushAndPop<unsigned char> & byteStream);
49
50 bool constrain() { return true; }
51 void showMe() {}
52
53 const uint32_t& version() const { return data.version; }
54 int majorVersion() const { return VersionInfo::majorVersion(data.version); }
55 int minorVersion() const { return VersionInfo::minorVersion(data.version); }
56 int patchVersion() const { return VersionInfo::patchVersion(data.version); }
57
58 int checkMajorVersion() const;
59 int checkRecommendedVersion() const;
60
61private:
62 struct Data {
63 uint32_t version;
64 };
65
66 Data data;
67};
68
69
70} // namespace kobuki
71
72#endif /* KOBUKI_CORE_FW_DATA_HPP__ */
73
Definition firmware.hpp:39
Provides base class for payloads.
Definition payload_base.hpp:39