Skip to content

Commit

Permalink
add port prefix to rpc port name
Browse files Browse the repository at this point in the history
  • Loading branch information
LoreMoretti committed Dec 3, 2024
1 parent 67e2f0f commit ae1b791
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion devices/YarpRobotLoggerDevice/src/YarpRobotLoggerDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,19 @@ bool YarpRobotLoggerDevice::open(yarp::os::Searchable& config)
return false;
}

// open rpc port for YarpRobotLoggerDevice commands
std::string portPrefix{};

if (!params->getParameter("port_prefix", portPrefix))
{

log()->info("{} The 'port_prefix' is not provided. It willnot be used.", logPrefix);
}

std::string rpcPortFullName = portPrefix + m_rpcPortName;

this->yarp().attachAsServer(this->m_rpcPort);
if (!m_rpcPort.open(m_rpcPortName))
if (!m_rpcPort.open(rpcPortFullName))
{
log()->error("{} Could not open", logPrefix);
return false;
Expand Down

0 comments on commit ae1b791

Please sign in to comment.