mirror of
https://gitlab.com/obbart/universal_robots_ros_driver.git
synced 2026-04-10 01:50:46 +02:00
Fixed parsing of version message
This commit is contained in:
@@ -37,6 +37,7 @@ namespace primary_interface
|
||||
class VersionMessage : public RobotMessage
|
||||
{
|
||||
public:
|
||||
VersionMessage() = delete;
|
||||
VersionMessage(uint64_t timestamp, uint8_t source) : RobotMessage(timestamp, source)
|
||||
{
|
||||
}
|
||||
@@ -46,6 +47,7 @@ public:
|
||||
|
||||
virtual std::string toString() const;
|
||||
|
||||
int8_t project_name_length_;
|
||||
std::string project_name_;
|
||||
uint8_t major_version_;
|
||||
uint8_t minor_version_;
|
||||
|
||||
@@ -37,8 +37,8 @@ namespace primary_interface
|
||||
{
|
||||
bool VersionMessage::parseWith(comm::BinParser& bp)
|
||||
{
|
||||
RobotMessage::parseWith(bp);
|
||||
bp.parse(project_name_);
|
||||
bp.parse(project_name_length_);
|
||||
bp.parse(project_name_, project_name_length_);
|
||||
bp.parse(major_version_);
|
||||
bp.parse(minor_version_);
|
||||
bp.parse(svn_version_);
|
||||
@@ -52,7 +52,7 @@ std::string VersionMessage::toString() const
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << "project name: " << project_name_ << std::endl;
|
||||
ss << "version: " << major_version_ << "." << minor_version_ << "." << svn_version_ << std::endl;
|
||||
ss << "version: " << unsigned(major_version_) << "." << unsigned(minor_version_) << "." << svn_version_ << std::endl;
|
||||
ss << "build date: " << build_date_;
|
||||
|
||||
return ss.str();
|
||||
|
||||
Reference in New Issue
Block a user