enable ip command in tool only if EC_EOE defined

This commit is contained in:
Bjarne von Horn 2023-09-20 10:40:35 +02:00
parent 17fe43df94
commit c04fe65fef
4 changed files with 13 additions and 7 deletions

View File

@ -49,7 +49,6 @@ ethercat_SOURCES = \
CommandFoeRead.cpp \ CommandFoeRead.cpp \
CommandFoeWrite.cpp \ CommandFoeWrite.cpp \
CommandGraph.cpp \ CommandGraph.cpp \
CommandIp.cpp \
CommandMaster.cpp \ CommandMaster.cpp \
CommandPdos.cpp \ CommandPdos.cpp \
CommandRegRead.cpp \ CommandRegRead.cpp \
@ -75,9 +74,9 @@ ethercat_SOURCES = \
sii_crc.cpp sii_crc.cpp
if ENABLE_EOE if ENABLE_EOE
ethercat_SOURCES += CommandEoe.cpp ethercat_SOURCES += CommandEoe.cpp CommandIp.cpp
else else
EXTRA_DIST += CommandEoe.cpp EXTRA_DIST += CommandEoe.cpp CommandIp.cpp
endif endif
noinst_HEADERS = \ noinst_HEADERS = \
@ -93,7 +92,6 @@ noinst_HEADERS = \
CommandFoeRead.h \ CommandFoeRead.h \
CommandFoeWrite.h \ CommandFoeWrite.h \
CommandGraph.h \ CommandGraph.h \
CommandIp.h \
CommandMaster.h \ CommandMaster.h \
CommandPdos.h \ CommandPdos.h \
CommandRegRead.h \ CommandRegRead.h \
@ -118,9 +116,9 @@ noinst_HEADERS = \
sii_crc.h sii_crc.h
if ENABLE_EOE if ENABLE_EOE
noinst_HEADERS += CommandEoe.h noinst_HEADERS += CommandEoe.h CommandIp.h
else else
EXTRA_DIST += CommandEoe.h EXTRA_DIST += CommandEoe.h CommandIp.h
endif endif
REV = `if test -s $(top_srcdir)/revision; then \ REV = `if test -s $(top_srcdir)/revision; then \

View File

@ -609,6 +609,7 @@ void MasterDevice::writeSoe(ec_ioctl_slave_soe_write_t *data)
/****************************************************************************/ /****************************************************************************/
#ifdef EC_EOE
void MasterDevice::setIpParam(ec_ioctl_slave_eoe_ip_t *data) void MasterDevice::setIpParam(ec_ioctl_slave_eoe_ip_t *data)
{ {
if (ioctl(fd, EC_IOCTL_SLAVE_EOE_IP_PARAM, data) < 0) { if (ioctl(fd, EC_IOCTL_SLAVE_EOE_IP_PARAM, data) < 0) {
@ -621,5 +622,6 @@ void MasterDevice::setIpParam(ec_ioctl_slave_eoe_ip_t *data)
} }
} }
} }
#endif
/*****************************************************************************/ /*****************************************************************************/

View File

@ -94,6 +94,7 @@ class MasterDeviceSoeException:
/****************************************************************************/ /****************************************************************************/
#ifdef EC_EOE
class MasterDeviceEoeException: class MasterDeviceEoeException:
public MasterDeviceException public MasterDeviceException
{ {
@ -108,6 +109,7 @@ class MasterDeviceEoeException:
MasterDeviceException("EoE set IP parameter failed."), MasterDeviceException("EoE set IP parameter failed."),
result(result) {}; result(result) {};
}; };
#endif
/****************************************************************************/ /****************************************************************************/

View File

@ -49,7 +49,9 @@ using namespace std;
#include "CommandFoeRead.h" #include "CommandFoeRead.h"
#include "CommandFoeWrite.h" #include "CommandFoeWrite.h"
#include "CommandGraph.h" #include "CommandGraph.h"
#include "CommandIp.h" #ifdef EC_EOE
# include "CommandIp.h"
#endif
#include "CommandMaster.h" #include "CommandMaster.h"
#include "CommandPdos.h" #include "CommandPdos.h"
#include "CommandRegRead.h" #include "CommandRegRead.h"
@ -291,7 +293,9 @@ int main(int argc, char **argv)
commandList.push_back(new CommandFoeRead()); commandList.push_back(new CommandFoeRead());
commandList.push_back(new CommandFoeWrite()); commandList.push_back(new CommandFoeWrite());
commandList.push_back(new CommandGraph()); commandList.push_back(new CommandGraph());
#ifdef EC_EOE
commandList.push_back(new CommandIp()); commandList.push_back(new CommandIp());
#endif
commandList.push_back(new CommandMaster()); commandList.push_back(new CommandMaster());
commandList.push_back(new CommandPdos()); commandList.push_back(new CommandPdos());
commandList.push_back(new CommandRegRead()); commandList.push_back(new CommandRegRead());