version_info.hpp
Go to the documentation of this file.
00001 
00009 /*****************************************************************************
00010 ** Ifdefs
00011 *****************************************************************************/
00012 
00013 #ifndef KOBUKI_VERSION_HPP_
00014 #define KOBUKI_VERSION_HPP_
00015 
00016 /*****************************************************************************
00017 ** Includes
00018 *****************************************************************************/
00019 
00020 #include <string>
00021 #include <sstream>
00022 #include <stdint.h>
00023 #include "macros.hpp"
00024 
00025 /*****************************************************************************
00026 ** Namespaces
00027 *****************************************************************************/
00028 
00029 namespace kobuki {
00030 
00031 /*****************************************************************************
00032 ** Interfaces
00033 *****************************************************************************/
00037 class kobuki_PUBLIC VersionInfo {
00038 public:
00039   VersionInfo(const uint32_t &fw, const uint32_t &hw, const uint32_t udid0_, const uint32_t udid1_, const uint32_t udid2_ ) :
00040     firmware(fw),
00041     hardware(hw),
00042     software(0),
00043     udid0(udid0_),
00044     udid1(udid1_),
00045     udid2(udid2_)
00046   {}
00047   const uint32_t firmware;
00048   const uint32_t hardware;
00049   const uint32_t software;
00050   const uint32_t udid0;
00051   const uint32_t udid1;
00052   const uint32_t udid2;
00053 
00054   static std::string toString(const uint32_t &version)
00055   {
00056     // Convert an unsigned int into a string of type <major>.<minor>.<patch>; first byte is ignored
00057     std::stringstream ss;
00058     ss << ((version & 0x00FF0000) >> 16) << "." << ((version & 0x0000FF00) >>  8) << "." << (version & 0x000000FF);
00059     return std::string(ss.str());
00060   }
00061 
00062   static std::string toString(const uint32_t &udid0, const uint32_t &udid1, const uint32_t &udid2)
00063   {
00064     // Convert three udid unsigned integers into a string of type <udid0>-<udid1>-<udid2>
00065     std::stringstream ss;
00066     ss << udid0 << "-" << udid1 << "-" << udid2;
00067     return std::string(ss.str());
00068   }
00069 
00070   static std::string getSoftwareVersion();
00071 };
00072 
00073 } // namespace kobuki
00074 #endif /* KOBUKI_VERSION_HPP_ */


kobuki_driver
Author(s): Daniel Stonier , Younghun Ju , Jorge Santos Simon
autogenerated on Thu Aug 27 2015 13:43:58