Skip to content
Snippets Groups Projects
Commit 434fab95 authored by Florian Pose's avatar Florian Pose
Browse files

Added 'ethercat version' command.

parent e2935666
No related branches found
No related tags found
No related merge requests found
...@@ -14,10 +14,7 @@ Version 1.4.0: ...@@ -14,10 +14,7 @@ Version 1.4.0:
* Get original driver for r8169. * Get original driver for r8169.
* Race in jiffies frame timeout? * Race in jiffies frame timeout?
* ethercat tool: * ethercat tool:
- Data type abbreviations.
- Add a -n (numeric) switch.
- Check for options, remove global variables. - Check for options, remove global variables.
- Add 'etherlab version'.
Future issues: Future issues:
...@@ -36,6 +33,9 @@ Future issues: ...@@ -36,6 +33,9 @@ Future issues:
* Interface/buffers for asynchronous domain IO. * Interface/buffers for asynchronous domain IO.
* Make scanning and configuration run parallel (each). * Make scanning and configuration run parallel (each).
* File access over EtherCAT (FoE). * File access over EtherCAT (FoE).
* ethercat tool:
- Data type abbreviations.
- Add a -n (numeric) switch.
Smaller issues: Smaller issues:
......
/*****************************************************************************
*
* $Id$
*
****************************************************************************/
#include <iostream>
using namespace std;
#include "CommandVersion.h"
/*****************************************************************************/
CommandVersion::CommandVersion():
Command("version", "Show version information.")
{
}
/****************************************************************************/
string CommandVersion::helpString() const
{
stringstream str;
str << getName() << " [OPTIONS]" << endl
<< endl
<< getBriefDescription() << endl;
return str.str();
}
/****************************************************************************/
void CommandVersion::execute(MasterDevice &m, const StringVector &args)
{
cout << "IgH EtherCAT master " << EC_MASTER_VERSION << endl;
}
/*****************************************************************************/
/*****************************************************************************
*
* $Id$
*
****************************************************************************/
#ifndef __COMMANDVERSION_H__
#define __COMMANDVERSION_H__
#include "Command.h"
/****************************************************************************/
class CommandVersion:
public Command
{
public:
CommandVersion();
string helpString() const;
void execute(MasterDevice &, const StringVector &);
};
/****************************************************************************/
#endif
...@@ -37,9 +37,9 @@ bin_PROGRAMS = ethercat ...@@ -37,9 +37,9 @@ bin_PROGRAMS = ethercat
ethercat_SOURCES = \ ethercat_SOURCES = \
MasterDevice.cpp MasterDevice.h \ MasterDevice.cpp MasterDevice.h \
Command.cpp \
CommandAlias.cpp \ CommandAlias.cpp \
CommandConfig.cpp \ CommandConfig.cpp \
Command.cpp \
CommandData.cpp \ CommandData.cpp \
CommandDebug.cpp \ CommandDebug.cpp \
CommandDomains.cpp \ CommandDomains.cpp \
...@@ -52,11 +52,18 @@ ethercat_SOURCES = \ ...@@ -52,11 +52,18 @@ ethercat_SOURCES = \
CommandSlaves.cpp \ CommandSlaves.cpp \
CommandStates.cpp \ CommandStates.cpp \
CommandUpload.cpp \ CommandUpload.cpp \
CommandVersion.cpp \
CommandXml.cpp \ CommandXml.cpp \
coe_datatypes.cpp \ coe_datatypes.cpp \
sii_crc.cpp \ sii_crc.cpp \
main.cpp main.cpp
ethercat_CXXFLAGS = -I../master -Wall REV = `if test -s $(srcdir)/../svnrevision; then \
cat $(srcdir)/../svnrevision; \
else \
svnversion $(srcdir)/.. 2>/dev/null || echo "unknown"; \
fi`
ethercat_CXXFLAGS = -I../master -Wall -DSVNREV=$(REV)
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
...@@ -16,15 +16,16 @@ using namespace std; ...@@ -16,15 +16,16 @@ using namespace std;
#include "CommandData.h" #include "CommandData.h"
#include "CommandDebug.h" #include "CommandDebug.h"
#include "CommandDomains.h" #include "CommandDomains.h"
#include "CommandDownload.h"
#include "CommandMaster.h" #include "CommandMaster.h"
#include "CommandPdos.h" #include "CommandPdos.h"
#include "CommandSdos.h" #include "CommandSdos.h"
#include "CommandDownload.h"
#include "CommandUpload.h"
#include "CommandSlaves.h"
#include "CommandSiiRead.h" #include "CommandSiiRead.h"
#include "CommandSiiWrite.h" #include "CommandSiiWrite.h"
#include "CommandSlaves.h"
#include "CommandStates.h" #include "CommandStates.h"
#include "CommandUpload.h"
#include "CommandVersion.h"
#include "CommandXml.h" #include "CommandXml.h"
/*****************************************************************************/ /*****************************************************************************/
...@@ -268,6 +269,7 @@ int main(int argc, char **argv) ...@@ -268,6 +269,7 @@ int main(int argc, char **argv)
commandList.push_back(new CommandSlaves()); commandList.push_back(new CommandSlaves());
commandList.push_back(new CommandStates()); commandList.push_back(new CommandStates());
commandList.push_back(new CommandUpload()); commandList.push_back(new CommandUpload());
commandList.push_back(new CommandVersion());
commandList.push_back(new CommandXml()); commandList.push_back(new CommandXml());
getOptions(argc, argv); getOptions(argc, argv);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment