13 #ifndef KOBUKI_VERSION_HPP_
14 #define KOBUKI_VERSION_HPP_
41 VersionInfo(
const uint32_t &fw,
const uint32_t &hw,
const uint32_t udid0_,
const uint32_t udid1_,
const uint32_t udid2_ ) :
49 const uint32_t firmware;
50 const uint32_t hardware;
51 const uint32_t software;
56 static int majorVersion(
const uint32_t &version) {
57 return ((version & 0x00FF0000) >> 16);
60 static int minorVersion(
const uint32_t &version) {
61 return ((version & 0x0000FF00) >> 8);
64 static int patchVersion(
const uint32_t &version) {
65 return (version & 0x000000FF);
68 static std::string toString(
const uint32_t &version)
72 ss << majorVersion(version) <<
"." << minorVersion(version) <<
"." << patchVersion(version);
73 return std::string(ss.str());
76 static std::string toString(
const std::vector<uint32_t> &versions)
79 std::size_t number_versions = versions.size();
80 for(std::size_t i = 0; i < number_versions; ++i) {
82 if (i != (number_versions - 1)) {
86 return std::string(ss.str());
89 static std::string toString(
const uint32_t &udid0,
const uint32_t &udid1,
const uint32_t &udid2)
93 ss << udid0 <<
"-" << udid1 <<
"-" << udid2;
94 return std::string(ss.str());
97 static std::string getSoftwareVersion();