version_info.hpp
Go to the documentation of this file.
1 
9 /*****************************************************************************
10 ** Ifdefs
11 *****************************************************************************/
12 
13 #ifndef KOBUKI_VERSION_HPP_
14 #define KOBUKI_VERSION_HPP_
15 
16 /*****************************************************************************
17 ** Includes
18 *****************************************************************************/
19 
20 #include <string>
21 #include <sstream>
22 #include <stdint.h>
23 #include "macros.hpp"
24 
25 /*****************************************************************************
26 ** Namespaces
27 *****************************************************************************/
28 
29 namespace kobuki {
30 
31 /*****************************************************************************
32 ** Interfaces
33 *****************************************************************************/
38 public:
39  VersionInfo(const uint32_t &fw, const uint32_t &hw, const uint32_t udid0_, const uint32_t udid1_, const uint32_t udid2_ ) :
40  firmware(fw),
41  hardware(hw),
42  software(0),
43  udid0(udid0_),
44  udid1(udid1_),
45  udid2(udid2_)
46  {}
47  const uint32_t firmware;
48  const uint32_t hardware;
49  const uint32_t software;
50  const uint32_t udid0;
51  const uint32_t udid1;
52  const uint32_t udid2;
53 
54  static std::string toString(const uint32_t &version)
55  {
56  // Convert an unsigned int into a string of type <major>.<minor>.<patch>; first byte is ignored
57  std::stringstream ss;
58  ss << ((version & 0x00FF0000) >> 16) << "." << ((version & 0x0000FF00) >> 8) << "." << (version & 0x000000FF);
59  return std::string(ss.str());
60  }
61 
62  static std::string toString(const uint32_t &udid0, const uint32_t &udid1, const uint32_t &udid2)
63  {
64  // Convert three udid unsigned integers into a string of type <udid0>-<udid1>-<udid2>
65  std::stringstream ss;
66  ss << udid0 << "-" << udid1 << "-" << udid2;
67  return std::string(ss.str());
68  }
69 
70  static std::string getSoftwareVersion();
71 };
72 
73 } // namespace kobuki
74 #endif /* KOBUKI_VERSION_HPP_ */
const uint32_t udid0
const uint32_t udid2
const uint32_t hardware
const uint32_t firmware
const uint32_t udid1
#define kobuki_PUBLIC
Definition: macros.hpp:39
static std::string toString(const uint32_t &version)
Macros for kobuki_driver.
VersionInfo(const uint32_t &fw, const uint32_t &hw, const uint32_t udid0_, const uint32_t udid1_, const uint32_t udid2_)
const uint32_t software
static std::string toString(const uint32_t &udid0, const uint32_t &udid1, const uint32_t &udid2)


kobuki_driver
Author(s): Daniel Stonier , Younghun Ju , Jorge Santos Simon
autogenerated on Mon Mar 27 2017 01:02:59