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 
00024 /*****************************************************************************
00025 ** Namespaces
00026 *****************************************************************************/
00027 
00028 namespace kobuki {
00029 
00030 /*****************************************************************************
00031 ** Interfaces
00032 *****************************************************************************/
00036 class VersionInfo {
00037 public:
00038   VersionInfo(const uint32_t &fw, const uint32_t &hw, const uint32_t udid0_, const uint32_t udid1_, const uint32_t udid2_ ) :
00039     firmware(fw),
00040     hardware(hw),
00041     software(0),
00042     udid0(udid0_),
00043     udid1(udid1_),
00044     udid2(udid2_)
00045   {}
00046   const uint32_t firmware;
00047   const uint32_t hardware;
00048   const uint32_t software;
00049   const uint32_t udid0;
00050   const uint32_t udid1;
00051   const uint32_t udid2;
00052 
00053   static std::string toString(const uint32_t &version)
00054   {
00055     // Convert an unsigned int into a string of type <mayor>.<minor>.<patch>; first byte is ignored
00056     std::stringstream ss;
00057     ss << ((version & 0x00FF0000) >> 16) << "." << ((version & 0x0000FF00) >>  8) << "." << (version & 0x000000FF);
00058     return std::string(ss.str());
00059   }
00060 
00061   static std::string toString(const uint32_t &udid0, const uint32_t &udid1, const uint32_t &udid2)
00062   {
00063     // Convert three udid unsigned integers into a string of type <udid0>-<udid1>-<udid2>
00064     std::stringstream ss;
00065     ss << udid0 << "-" << udid1 << "-" << udid2;
00066     return std::string(ss.str());
00067   }
00068 
00069   static std::string getSoftwareVersion();
00070 };
00071 
00072 } // namespace kobuki
00073 #endif /* KOBUKI_VERSION_HPP_ */


kobuki_driver
Author(s): Daniel Stonier , Younghun Ju , Jorge Santos Simon
autogenerated on Mon Oct 6 2014 01:31:10