Skip to content

Commit

Permalink
Add getter for hardware and getter for the IP address
Browse files Browse the repository at this point in the history
  • Loading branch information
romainreignier committed Mar 10, 2018
1 parent 27ff39e commit 74e5ecc
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/ros_lib/RosQtSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ unsigned long RosQtSocket::time()
return static_cast<unsigned long>(QDateTime::currentMSecsSinceEpoch());
}

QString RosQtSocket::getAddress() const
{
return address_.toString();
}

void RosQtSocket::onConnected()
{
socket_.setSocketOption(QAbstractSocket::LowDelayOption, 1);
Expand Down
8 changes: 5 additions & 3 deletions src/ros_lib/ros/RosQtSocket.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
Software License Agreement (BSD)
\file RosQtSocket.h
\authors Robin Vanhove <r.vanhove@robopec.com>
\copyright Copyright (c) 2017, Robopec, All rights reserved.
\file WindowsSocket.h
\authors Kareem Shehata <kshehata@clearpathrobotics.com>
\copyright Copyright (c) 2014, Clearpath Robotics, Inc., All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that
the following conditions are met:
Expand Down Expand Up @@ -53,6 +53,8 @@ class RosQtSocket : public QObject

unsigned long time ();

QString getAddress() const;

private slots:
void onConnected();

Expand Down
5 changes: 5 additions & 0 deletions src/ros_lib/ros/node_handle.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ class NodeHandle : public NodeHandleBase_
/* Disconnect from server */
void close();

RosQtSocket& getHardware()
{
return hardware_;
}

protected:
//State machine variables for spinOnce
int mode_;
Expand Down

0 comments on commit 74e5ecc

Please sign in to comment.